Add tfLoanLatePayment flag; full payment is no longer a special case

- A regular payment that is late, or a tfLoanLatePayment that is not
  late will fail.
- Flags are mutually exclusive.
- Add a few interest computation shortcuts and overflow prevention
  checks that return 0 if there's no time to compute for.
This commit is contained in:
Ed Hennis
2025-11-10 23:17:42 -05:00
parent 8d22409ab5
commit 4396b77c4b
5 changed files with 260 additions and 244 deletions

View File

@@ -274,10 +274,11 @@ constexpr std::uint32_t const tfLoanOverpayment = 0x00010000;
// LoanPay exclusive flags:
// tfLoanFullPayment: True, indicates that the payment is
constexpr std::uint32_t const tfLoanFullPayment = 0x00020000;
constexpr std::uint32_t const tfLoanLatePayment = 0x00040000;
constexpr std::uint32_t const tfLoanSetMask = ~(tfUniversal |
tfLoanOverpayment);
constexpr std::uint32_t const tfLoanPayMask = ~(tfUniversal |
tfLoanOverpayment | tfLoanFullPayment);
tfLoanOverpayment | tfLoanFullPayment | tfLoanLatePayment);
// LoanManage flags:
constexpr std::uint32_t const tfLoanDefault = 0x00010000;