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

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