Code Duplication    Length = 5-5 lines in 2 locations

code/reports/SearchableOrderReport.php 1 location

@@ 240-244 (lines=5) @@
237
                $query->select[$key] = "SUM(IF(Payment.Status = 'Success',{$bt}Payment{$bt}.{$bt}Amount{$bt}, 0)) RealPayments";
238
            }
239
        }
240
        foreach ($query->select as $key=>$value) {
241
            if ($value == "OrderSummary") {
242
                $query->select[$key] = "CONCAT({$bt}Order{$bt}.{$bt}ID{$bt}, ' :: ', {$bt}Order{$bt}.{$bt}Created{$bt}, ' :: ', {$bt}Order{$bt}.{$bt}Status{$bt}) AS OrderSummary";
243
            }
244
        }
245
        $query->groupby("{$bt}Order{$bt}.{$bt}ID{$bt}");
246
        if ($having = Session::get("SearchableOrderReport.having")) {
247
            $query->having($having);

code/reports/SearchablePaymentReport.php 1 location

@@ 202-206 (lines=5) @@
199
                }
200
            }
201
        }
202
        foreach ($query->select as $key=>$value) {
203
            if ($value == "OrderSummary") {
204
                $query->select[$key] = "CONCAT({$bt}Order{$bt}.{$bt}ID{$bt}, ' :: ', {$bt}Order{$bt}.{$bt}Created{$bt}, ' :: ', {$bt}Order{$bt}.{$bt}Status{$bt}) AS OrderSummary";
205
            }
206
        }
207
        if ($having = Session::get("SearchableOrderReport.having")) {
208
            $query->having($having);
209
        }