Adding Manual Payment in Membership 2 Pro generates multiple invoices

When a member is added to a subscription and the payment is added manually, system generates 4 invoices for that payment with the year in Description field increasing by 1 year.

Eg: If a manual payment is done for a yearly Membership Subscription starting on 11th October 2018 and ending on 10th October 2019, the system will generate 4 invoices.

These invoices will have the correct expiration date in the End Date field but the Expiry date in the description will increase by 1 year in each invoice, which means 1st invoice will have 2019, 2nd invoice will have 2020, 3rd invoice will have 2021 and 4th invoice will have 2022.

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi Verstraeten and sorry for the late reply.

    I've been trying to replicate this on my dev environments but to no avail. Is it ok with you if I do some tests on your end? Basically create 1 dummy user and go forward on assigning to him some memberships manually so I can see what exactly is going on?

    If not is there a possibility for a staging environment maybe so we won't even do tests on your production site?

    Regards,
    Konstantinos

  • Panos
    • SLS

    Hi Verstraeten ,

    I did a few tests in your staging site some days ago and couldn't replicate the multiple invoices issue. In the Billing page the is still an unpaid invoice which you can mark as paid.

    Could you please provide steps on how to replicate this? Subscriptions were assigned from front end or from admin? Was there any custom page or snippet involved?

    Kind regards!

  • Verstraeten
    • The Incredible Code Injector

    Hello Panos
    You have not to do anything, the problem comes alone
    Se picture from today date is 3 january
    come back tomorrow new bill with date 4 january will be created by the cron.php
    If I rename that file, nothings happens

  • Panos
    • SLS

    Hi Verstraeten ,

    Sorry I meant to ask how to replicate this. I noticed the due date issue, and also the subscriptions have the same issue with the date. But this doesn't happen to the subscriptions and invoices I created. That is why I ask how were those subscriptions created initially.

    For now I have replaced files:
    membership-pro/app/model/class-ms-model-invoice.php
    membership-pro/app/model/class-ms-model-relationship.php

    with ones that fix some issues. Perhaps they fix this one too.

    I'll keep an eye on the invoices in the following days. In the meantime you could let us know how to replicate this. I notice that there are several invoices for same user and same membership which is also strange. Normally they would have an increasing counter eg:
    #51856-1
    #51874-2
    #51877-3
    etc

    which is not the case in your site.

    If we could replicate this it would be easier to find a solid solution for this.

    Kind regards!

  • Verstraeten
    • The Incredible Code Injector

    Hello Panos
    I really do not know how to reproduce that issue, the phenomen is automatic.
    If you rename wp-cron.php it stop's that all what I can remark.
    Is it possible to save all valid members whith all concerning info's, then kill the table(s) and reimport the members with theire actual status
    I try to delete all wrong invoices in the data base with this SQL but I get an error
    An idea wher is the mistake
    Erreur
    Requête SQL : Documentation

    Delete * FROM vince_posts WHERE vince_posts.ID > 39521 AND
    (SELECT * FROM vince_postmeta WHERE post_id > 39521
    AND meta_value IS NULL)

    Error!!
    #1241 - Operand should contain 1 column(s)

  • Panos
    • SLS

    Hi Verstraeten ,

    Membership uses cron to check current subscriptions statuses, for example if it should be set to expired. Those new expiration dates are produced from the cron job, but cron itself is not the issue.

    I would like to install the beta version on your staging site if that is ok with you and see if this issue still happens. Please let me know and I'll install it asap so we can monitor those dates.

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.