Code Duplication    Length = 13-17 lines in 3 locations

programs/utilit/agent_right.class.php 2 locations

@@ 1425-1437 (lines=13) @@
1422
	 *
1423
	 * @return float
1424
	 */
1425
	public function getAgentIncrementQuantity($date = null)
1426
	{
1427
	    $n = 0.0;
1428
	    $I = $this->getIncrementAgentRightIterator();
1429
	    $I->upto = $date;
1430
	    
1431
	    foreach($I as $d)
1432
	    {
1433
	        $n += (float) $d->quantity;
1434
	    }
1435
	    
1436
	    return $n;
1437
	}
1438
	
1439
	
1440
	
@@ 1446-1462 (lines=17) @@
1443
	 * @param string $date YYYY-MM-DD
1444
	 * @return float
1445
	 */
1446
	public function getIncrementQuantity($date = null)
1447
	{
1448
	    
1449
	    $n = 0.0;
1450
	    $I = $this->getIncrementIterator();
1451
	    
1452
	    if (isset($date) && '0000-00-00' !== $date) {
1453
	         $I->upto = $date;
1454
	    }
1455
	    
1456
	    foreach($I as $d)
1457
	    {
1458
	        $n += (float) $d->quantity;
1459
	    }
1460
	
1461
	    return $n;
1462
	}
1463
	
1464
	
1465
	

programs/utilit/right.class.php 1 location

@@ 1349-1361 (lines=13) @@
1346
	 * @param string $date     YYYY-MM-DD
1347
	 * @return float
1348
	 */
1349
	public function getIncrementQuantity($date = null)
1350
	{
1351
	    $n = 0.0;
1352
	    $I = $this->getIncrementIterator();
1353
	    $I->upto = $date;
1354
	    
1355
	    foreach($I as $d)
1356
	    {
1357
	        $n += (float) $d->quantity;
1358
	    }
1359
	    
1360
	    return $n;
1361
	}
1362
	
1363
	
1364