Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Subscription Link to Invoices #34432

Closed
wants to merge 6 commits into from

Conversation

mayanknahata007
Copy link

Before
Screenshot 2023-03-13 at 9 45 06 PM
In the subscription section of the invoices, there is no link to the subscription it was created from.

After:
Screenshot 2023-03-13 at 9 44 35 PM

Added the field which automatically gets populated along with the other data.

Now the invoices could also be filtered via subscription value.
Screenshot 2023-03-13 at 9 44 16 PM

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Mar 13, 2023
Copy link
Collaborator

@barredterra barredterra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One problem with this is that we'll get circular linking: Subscription links to Sales Invoice and Sales Invoice links back to Subscription. Then you can delete neither one.

I think the link from Sales Invoice to Subscription is the correct way, in theory, but we'll also need to remove the link from Subscription to Sales Invoice and refactor the code to handle this change.

@barredterra
Copy link
Collaborator

I think the link from Sales Invoice to Subscription is the correct way, in theory, but we'll also need to remove the link from Subscription to Sales Invoice and refactor the code to handle this change.

Are you planning to implement this? We've tried to "fix" subscriptions a couple of times before and failed, so from my experience it's not an easy task.

@mayanknahata007
Copy link
Author

mayanknahata007 commented Mar 15, 2023

I think the link from the Sales Invoice to the Subscription is the correct way, in theory, but we'll also need to remove the link from the Subscription to Sales Invoice and refactor the code to handle this change.

Are you planning to implement this? We've tried to "fix" subscriptions a couple of times before and failed, so from my experience, it's not an easy task.

Yes, I plan to.
I wanted the subscription to be linked to the invoices to have consolidation at the invoice level as well, and maybe add additional fetching to the invoices via subscription doctype.
Since it is coded in the core, not sure if a custom app would work here.

The easiest approach would be not to make it "read-only" and maybe remove the link from draft invoices for deletion. I'm sure it wont be the right approach though :P

But yes, would be interested and working on improving it. Also maybe create reminders before the invoices are generated.

Let's collab XD

@Mood93
Copy link

Mood93 commented Mar 16, 2023

Hello, new to ERPNext/Frappe ecosystem. Would it be possible and preferred to create an intermediary DocType to handle a many-to-many relationship between subscription and invoice?

Is there a use case for multiple subscriptions to be on a single invoice? E.g. Customer is subscribed to multiple products but only want to send one invoice?

What about subscriptions having multiple invoices? E.g. With insurance in the US, you have a term length of 6mo or 12mo but you can pay monthly, quarterly, semiannually, and annually; each with different rates/discounts.

@deepeshgarg007
Copy link
Member

deepeshgarg007 commented Mar 17, 2023

@mayanknahata007 Closing this PR for now, is not the right fix

@federicocalvo
Copy link

@barredterra @mayanknahata007 subscriptions is one of the great forgotten ones, and I find it hard to understand why.

In our case we had to make a lot of corrections, which is difficult for us to provide because it is somewhat modified. It is a section where it is very difficult to test changes and simulate cases.

But it is the axis of invoicing for any service company, contemplated for example that Frappe is one of them, I think that by handling the subscriptions from another side with the theme of Press.
Otherwise, it is hard to understand why they would not improve a section that would benefit themselves.

The last attempt I remember is this one, which did not prosper:
#30963

@barredterra
Copy link
Collaborator

I ended up reimplementing subscriptions for one of our customers:
https://github.com/alyf-de/simple_subscription

The existing subscription feature would need a complete reimplementation as well, IMO.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants