Don't filter on paiement type

This commit is contained in:
Michael RICOIS 2018-03-16 15:13:34 +01:00
parent dfbd8a23b4
commit 6afc0582f9

View File

@ -602,35 +602,37 @@ if($slipNb > 0) {
$order_details[$k]['product_quantity_refunded'] = $detail['product_quantity']; $order_details[$k]['product_quantity_refunded'] = $detail['product_quantity'];
} }
} }
// Paybox refund // Details refund
elseif (strtolower($order['payment']) == 'paybox') { else {
$refund_details = Db::getInstance()->executeS(' $refund_details = Db::getInstance()->executeS('
SELECT r.`id_order_detail` SELECT r.`id_order_detail`
FROM `'._DB_PREFIX_.'refund_transaction` r FROM `'._DB_PREFIX_.'refund_transaction` r
WHERE r.`id_order` = '. (int) $slip['id_order'] WHERE r.`id_order` = '. (int) $slip['id_order']
); );
$realrefund = array(); if (count($refund_details) > 0) {
foreach ($refund_details as $r) { $realrefund = array();
$realrefund[] = $r['id_order_detail']; foreach ($refund_details as $r) {
} $realrefund[] = $r['id_order_detail'];
// Clean order_details }
foreach ($order_details as $k => $od) { // Clean order_details
if (in_array($od['id_order_detail'], $realrefund)) { foreach ($order_details as $k => $od) {
if ($optVerbose) { if (in_array($od['id_order_detail'], $realrefund)) {
echo date('Y-m-d H:i:s')." - Refund detail"."\n"; if ($optVerbose) {
} echo date('Y-m-d H:i:s')." - Refund detail"."\n";
} else { }
unset($order_details[$k]); } else {
} unset($order_details[$k]);
} }
} }
// No case, get line mark refunded
else {
foreach ($order_details as $k => $detail) {
if ($detail['product_quantity_refunded'] == 0) {
unset($order_details[$k]);
}
} }
// No case, get line mark refunded
else {
foreach ($order_details as $k => $detail) {
if ($detail['product_quantity_refunded'] == 0) {
unset($order_details[$k]);
}
}
}
} }
} }