```\n        } else {\n            // Default to PaymentType.EMI\n            // Max payable amount in a cycle\n            // NOTE: the last cycle could have less than the calculated payment amount\n            uint256 maxCycleOwed = isLastPaymentCycle\n                ? owedPrincipal_ + interest_\n                : _bid.terms.paymentCycleAmount;\n\n            // Calculate accrued amount due since last repayment\n            uint256 owedAmount = (maxCycleOwed * owedTime) /\n                _bid.terms.paymentCycle;\n            duePrincipal_ = Math.min(owedAmount - interest_, owedPrincipal_);\n        }\n```\n