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'];
}
}
// Paybox refund
elseif (strtolower($order['payment']) == 'paybox') {
// Details refund
else {
$refund_details = Db::getInstance()->executeS('
SELECT r.`id_order_detail`
FROM `'._DB_PREFIX_.'refund_transaction` r
WHERE r.`id_order` = '. (int) $slip['id_order']
);
$realrefund = array();
foreach ($refund_details as $r) {
$realrefund[] = $r['id_order_detail'];
}
// Clean order_details
foreach ($order_details as $k => $od) {
if (in_array($od['id_order_detail'], $realrefund)) {
if ($optVerbose) {
echo date('Y-m-d H:i:s')." - Refund detail"."\n";
}
} 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]);
}
if (count($refund_details) > 0) {
$realrefund = array();
foreach ($refund_details as $r) {
$realrefund[] = $r['id_order_detail'];
}
// Clean order_details
foreach ($order_details as $k => $od) {
if (in_array($od['id_order_detail'], $realrefund)) {
if ($optVerbose) {
echo date('Y-m-d H:i:s')." - Refund detail"."\n";
}
} 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]);
}
}
}
}
}