Code Duplication    Length = 13-17 lines in 3 locations

programs/utilit/agent_right.class.php 2 locations

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

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