Code Duplication    Length = 5-5 lines in 2 locations

src/Intraface/modules/debtor/DebtorItem.php 1 location

@@ 463-467 (lines=5) @@
460
                $item["product_id"] = $product->getId();
461
                $item["product_detail_id"] = $product->get("detail_id");
462
                $unit = $product->get('unit');
463
                if ($db->f("quantity") == 1) {
464
                    $item["unit"] = $unit['singular'];
465
                } else {
466
                    $item["unit"] = $unit['plural'];
467
                }
468
469
                if ($product->get('has_variation')) {
470
                    $variation = $product->getVariation($db->f('product_variation_id'));

src/Intraface/modules/procurement/ProcurementItem.php 1 location

@@ 421-425 (lines=5) @@
418
            $item[$i]["id"] = $db->f("id");
419
420
            $unit = $product->get("unit");
421
            if ($db->f("quantity") == 1) {
422
                $item[$i]["unit"] = $unit['singular'];
423
            } else {
424
                $item[$i]["unit"] = $unit['plural'];
425
            }
426
            $item[$i]["unit_purchase_price"] = $db->f("unit_purchase_price");
427
            $item[$i]["calculated_unit_price"] = $db->f("unit_purchase_price") + $db->f("unit_purchase_price") * $calculated;
428
            $item[$i]["quantity"] = $db->f("quantity");