Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3610212
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:43:26+00:00 2026-05-18T21:43:26+00:00

I am making a BI system for a bank-like institution. This system should manage

  • 0

I am making a BI system for a bank-like institution. This system should manage credit contracts, invoices, payments, penalties and interest.

Now, I need to make a method that builds an invoice. I have to calculate how much the customer has to pay right now. He has a debt, which he has to pay for. He also has to pay for the interest. If he was ever late with due payment, penalties are applied for each day he’s late.

I thought there were 2 ways of doing this:

  1. By having only 1 original state – the contract’s original state. And each time to compute the monthly payment which the customer has to make, consider the actual, made payments.
  2. By constantly making intermediary states, going from the last intermediary state, and considering only the events that took place between the time of these 2 intermediary states. This means having a job that performs periodically (daily, monthly), that takes the last saved state, apply the changes (due payments, actual payments, changes in global constans like the penalty rate which is controlled by the Central Bank), and save the resulting state.

The benefits of the first variant:

  • Always actual. If changes were made with a date from the past (a guy came with a paid invoice 5 days after he made the payment to the bank), they will be correctly reflected in the results.

The flaws of the first variant:

  • Takes long to compute
  • Documents printed with the current results may differ if the correct data changes due to operations entered with a back date.

The benefits of the second variant:

  • Works fast, and aggregated data is always available for search and reports.
  • Simpler to compute

The flaws of the second variant:

  • Vulnerable to failed jobs.
  • Errors in the past propagate until the end, to the final results.
  • An intermediary result cannot be changed if new data from past transactions arrives (it can, but it’s hard, and with many implications, so I’d rather mark it as Tabu)
  • Jobs cannot be performed successfully and without problems if an unfinished transaction exists (an issued invoice that wasn’t yet paid)

Is there any other way? Can I combine the benefits from these two? Which one is used in other similar systems you’ve encountered? Please share any experience.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:43:27+00:00Added an answer on May 18, 2026 at 9:43 pm

    Problems of this nature are always more complicated than they first appear. This
    is a consequence of what I like to call the Rumsfeldian problem of the unknown unknown.
    Basically, whatever you do now, be prepared to make adjustments for arbitrary future rules.

    This is a tough proposition. some future possibilities that may have a significant impact on
    your calculation model are back dated payments, adjustments and charges.
    Forgiven interest periods may also become an issue (particularly if back dated). Requirements
    to provide various point-in-time (PIT) calculations based on either what was “known” at
    that PIT (past view of the past) or taking into account transactions occurring after the reference PIT that
    were back dated to a PIT before the reference (current view of the past). Calculations of this nature can be
    a real pain in the head.

    My advice would be to calculate from “scratch” (ie. first variant). Implement optimizations (eg. second variant) only
    when necessary to meet performance constraints. Doing calculations from the beginning is a compute intensive
    model but is generally more flexible with respect to accommodating unexpected left turns.

    If performance is a problem but the frequency of complicating factors (eg. back dated transactions)
    is relatively low you could explore a hybrid model employing the best of both variants. Here you store the
    current state and calculate forward
    using only those transactions that posted since the last stored state to create a new current state. If you hit a
    “complication” re-do the entire account from the
    beginning to reestablish the current state.

    Being able to accommodate the unexpected without triggering a re-write is probably more important in the long run
    than shaving calculation time right now. Do not place restrictions on your computation model until you have to. Saving
    current state often brings with it a number of built in assumptions and restrictions that reduce wiggle room for
    accommodating future requirements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making system like client-server. There's two possibilities: to log in as user or
So the question is on title I'm making System.Byte.Parse(0xAA) but I feel like every-time
How can I resolve this problem ?why image file making system.dbnull error? private void
Im making a system which should be running 24/7, with timers to control it.
I'm making a system called NCIV in PHP. In that system you can change
I'm currently making some system that will gather statistical reports from different sites, for
I'm making a System.Timer, using the elapse event to update a int of a
I am using django and making a system similar to job portal or linkedin
I'm making a small system for personal use on that I want to handle
I'm making a rating system, and I have the following jQuery code on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.