Create an invoice based on data in other objects?

Hi there,

This is a bit of a complex situation that I need some inspiration on.

I am trying to set up an invoice generation mechanism for a swimming class based on the accomplishment.  As each of the ranks have requirements, I have a dedicated object called "Swimmer Ranks" that indicate the requirements.

The teacher flicks the approval of the Ranks, and each rank accomplishment are based on which year they accomplish.

 

So let's say, there are these objects:

  • Members: consolidated member object including coaches and swimmers' parents as members.
  • Swimmers: List of individual swimmers, linking with parents.
  • Lessons: List of individual swimmers linking to the Coaches.
  • Rank Accomplishment: List of swimmers with their accomplished Ranks.

These are pre-existing objects, and I wish to add rank invoicing here, so I'm adding the following two objects:

  • Rank Registration: For Coaches to register newly accomplished ranks of Swimmers, based on the Lessons they are registered in.  If they are not registered in the Lesson, the Coaches cannot register for Ranks.
  • Invoice: The amount to charge the Family.

The Rank is a bit tricky since, if they accomplish one higher rank (say from starfish to otter), then there is the "initial fee", but if they have gone three ranks (from starfish to otter to penguin to dolphin), then they are charged for the highest rank advancement (penguin to dolphin), and the rest will be at a discounted price.

I'm having a fit in setting up a mechanism how I can possibly map this complex calculation onto the objects, so at the end the Families get one simple price to pay.

 

From the looks of it, I might be able to utilize the Currency field and Equation, but if there are three "Rank Registration" records, is there any way that I can find out which one of these are the highest rank, and identify how much the family needs to pay?

 

I'm not sure if I'm explaining enough but happy to hear anyone with a mastermind challenging the potential of Knack.

 

Many thanks and kind regards,

Jin