function ProcessDuePayment($paymetID, $amount) { $mDeployedVehicleList = $this->userId->getDeployedVehicleList(); $cnt = sizeof($mDeployedVehicleList); if ($amount == 0 || $cnt == 0) { return 0; } $amount /= $cnt; for ($i = 0; $i < $cnt; $i++) { Payments::add($paymetID, $amount, 1, 1, $mDeployedVehicleList[$i]); } return $cnt; }