[-] Project : #PSCFV-2633 #PSCFV-2622 - Fix problems with multishipping and order payment & invoice
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15797 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -226,16 +226,19 @@ class OrderHistoryCore extends ObjectModel
|
||||
foreach ($invoices as $invoice)
|
||||
{
|
||||
$rest_paid = $invoice->getRestPaid();
|
||||
if ($rest_paid)
|
||||
if ($rest_paid > 0)
|
||||
{
|
||||
$payment = new OrderPayment();
|
||||
$payment->id_order = $order->id;
|
||||
$payment->id_order_invoice = $invoice->id;
|
||||
$payment->order_reference = $order->reference;
|
||||
$payment->id_currency = $order->id_currency;
|
||||
$payment->amount = $rest_paid;
|
||||
$payment->payment_method = $payment_method->displayName;
|
||||
$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.')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user