/** * Calculate rent amount after adding deposit payments to the amount that * was arrived at after subtracting expenses * @param int $prop_id ID used to identify the property * @param string $start Date string specifying start of the period * @param string $end Date string specifying end of the period * @return int $amount_plus_deposit_payments */ public function calcAmountPlusDepositPayments($prop_id, $start, $end) { $bal_after_expenses = $this->calcAmoutLessExpenses($prop_id, $start, $end); $bal_after_expenses = (int) $this->_sanitizeMoneyString($bal_after_expenses); $deposit_payments = Deposit::calcPaymentsForPeriodByProperty($prop_id, $start, $end); $deposit_payments = (int) $this->_sanitizeMoneyString($deposit_payments); $new_balance = $bal_after_expenses + $deposit_payments; return number_format($new_balance, 2); }