Code Duplication    Length = 13-17 lines in 3 locations

programs/utilit/agent_right.class.php 2 locations

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

programs/utilit/right.class.php 1 location

@@ 1358-1370 (lines=13) @@
1355
	 * @param string $date     YYYY-MM-DD
1356
	 * @return float
1357
	 */
1358
	public function getIncrementQuantity($date = null)
1359
	{
1360
	    $n = 0.0;
1361
	    $I = $this->getIncrementIterator();
1362
	    $I->upto = $date;
1363
	    
1364
	    foreach($I as $d)
1365
	    {
1366
	        $n += (float) $d->quantity;
1367
	    }
1368
	    
1369
	    return $n;
1370
	}
1371
	
1372
	
1373