question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Revisit the credit story for HA parent

See original GitHub issue

In the HA (Hierarchical Account) model, when a child delegates its payment to its parent, the parent must first build a summary invoice (one for all its dependent children on any given day). Today this is built by adding a new PARENT_SUMMARY invoice item for each child and the amount is the child invoice amount.

This model therefore includes any credit that child may have on the parent summary invoice , and this probably does not make sense as we don’t want to use a given child’s credit at the parent level by default.

The proposal is the following:

  • Credits are not by default visible at the parent level
  • We have a new api which allow to move a given child credit to the parent level (to support the use case when for instance a child cancels his subscription and is left with some ‘recognizable credit’.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:26 (26 by maintainers)

github_iconTop GitHub Comments

2reactions
sbrossiecommented, Jun 7, 2016

@maguero I would suggest a test-driven approach here (write scenario for each case) and see what happens with current implementation. I’d like @pierre to also review those use cases (he is off until the end of the week). After that, you can submit a proposal on what is the best course of action to modify the code (i think you are on the track track:we probably need new dedicated methods in InvoiceCalculatorUtils but this is probably not enough to achieve the result.

1reaction
sbrossiecommented, Jul 8, 2016

No problem, I can fix it.

Ah ah, you even had a comment 😉

So proposal is to add an ADJ item on the COMMITTED invoice (symetric to what happens to child invoice)

  1. Current process is updating PARENT_SUMMARY item if parent invoice is DRAFT (not adding items… just updating amount value). Do you want to keep this behaviour? Test Assert

Yes

  1. Do we have a way to identify to which child account is referred the ADJ item added into Parent Invoice when it’s COMMITTED but not paid yet.

You should have all the info you need to create the new ItemAdjInvoiceItem item (you have access to child account parent account and child invoice) on the parent invoice. However, when you create the ItemAdjInvoiceItem, make sure the linkedItemId points to the SUMMARY item for the child invoice (similar to what happens on the child invoice). Does that answer your question?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parent Stories - Economic Security Project
For families like Christina's, Alice's, Amber's, and Lori's, the expanded Child Tax Credit is more than a check — it has helped them...
Read more >
YOUR MONEY-When your aging parents need a ... - Reuters
Martha Nurenberg knew her 86-year-old father, Paul, had a problem when he was almost taken in by a letter promising untold riches if...
Read more >
Henrietta Lacks: science must right a historical wrong - Nature
The cell line originated from tissue taken from a woman named Henrietta Lacks — and Johnson's mother was a Lacks.
Read more >
8 Steps for Parents Helping Children Build Good Credit - CNBC
7. Have them report all possible forms of credit. It can be tough for a young adult to establish credit, since 15% of...
Read more >
The Aura is Radical Revisited - Amazon.com
It is a love story between father and son that ends tragically. It takes on many current issues in spousal and family relationships....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found