Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Prevent new order if outstanding invoice - Page 2
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Prevent new order if outstanding invoice

2»

Comments

  • @AnthonySmith said: You could take out additional service any time as long as you don't have OVER due invoices.

    I see now. I was confused since BuyVM disallows you to order anything starting when the invoice is created.

  • AnthonySmithAnthonySmith Member, Patron Provider

    @gubbyte said: I see now. I was confused since BuyVM disallows you to order anything starting when the invoice is created.

    I see, well that is mad :)

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    @gubbyte said: But what if there's a customer that has a invoice that they do intend to pay later when the time comes, and want an additional product?

    I experienced this at BuyVM.

    Settle your invoice then? :) If you need some extra time, etc, Aldryic is usually pretty reasonable and lends a hand.

    The system is in place and was developed in full by Aldryic.

    LOOK AT MY HORSE, MY HORSE IS AMAZING.

    Francisco

  • I don't think this would be too hard, let me throw my hands at it.

  • FranciscoFrancisco Top Host, Host Rep, Veteran

    @Jack said: @franciso gimme the code!

    Surely pony would give it for $50/each.

    I don't know. I think he's been offered more in the past and turned it down.

    Francisco

  • @Francisco said: LOOK AT MY HORSE, MY HORSE IS AMAZING.

    GIVE IT A LICK, IT TASTES JUST LIKE RAISI...oh damn you

  • SpencerSpencer Member
    edited December 2012

    @sshVM @AnthonySmith @Jack

    This plugin won't let the client order if the invoice is OVERDUE say you send out invoices 2 weeks early that is fine it won't have an issue with that since they are not overdue

    I got it done for you guys! You can download it here: http://pytohost.com/overdue.zip

    image

    Just upload overdue.php to /includes/hooks/
    Edit the file and where it says $adminuser = 'AdminName';
    Change AdminName to an actual admin name.

    Make me giddy and donate to me :)

  • @Spencer said: Edit the file and where it says $adminuser = 'AdminName';

    What if the system has more than a single administror account? Any will do?

  • @miTgiB said: What if the system has more than a single administror account? Any will do?

    Yup it just has to be one of them. Its part of the WHMCS internal API.

  • @Spencer said: I got it done for you guys!

    Congrats, Spencer! Well-written, too!

    image

  • AnthonySmithAnthonySmith Member, Patron Provider

    @Spencer, nice one, can you include a link to the invoices section in the message?

  • @Spencer said: I got it done for you guys! You can download it here: http://pytohost.com/overdue.zip

    woot! ;o

  • @AnthonySmith said: @Spencer, nice one, can you include a link to the invoices section in the message?

    Just edit overdue.php and replace line 12:

    $errormessage = "<li>You have overdue invoices, you need to pay them before you can create a new order</li>";

    with:

    $errormessage = "<li>You have overdue invoices, you need to pay them before you can create a new order. <a href='clientarea.php?action=masspay&all=true'>Pay Now &raquo;</a></li>";

  • @Spencer good work but this doesn't help our first issue
    1. To prevent multiple unpaid orders.

    Is it possible to make this script like avoid new order if invoice is Unpaid

  • Has anyone implemented this?

    If so, have you had any new orders since? I tried it out - turns out it stopped people from ordering!

  • lol'd

    The student fails, more like, @Damian.

  • @MartinD said: Has anyone implemented this?

    If so, have you had any new orders since? I tried it out - turns out it stopped people from ordering!

    LOL

  • @MartinD said: If so, have you had any new orders since? I tried it out - turns out it stopped people from ordering!

    Im running it fine, no issues at all.

  • @Spencer said: @MartinD said: If so, have you had any new orders since? I tried it out - turns out it stopped people from ordering!

    @Spencer Im running it fine, no issues at all.

    I has the same issue - though it seemed for me to only happen when a new customer was trying to sign up.

  • @imagine said: I has the same issue - though it seemed for me to only happen when a new customer was trying to sign up.

    Let me take a look, odd.

  • I tried this and had the same issue. Gave the warning on new orders for unregistered customers. This would be a great tool if it got working correctly. :)

  • @Kevin_K said: I tried this and had the same issue. Gave the warning on new orders for unregistered customers. This would be a great tool if it got working correctly. :)

    Yea I know the issue, it is an easy fix. Ive just been sooooo busy. Tomorrow ill have a fix.

  • We considered doing this in the past however there is one small problem.... if someone wants to avoid this then why don't they just create a new account?

  • rskrsk Member, Patron Provider

    @sean said: We considered doing this in the past however there is one small problem.... if someone wants to avoid this then why don't they just create a new account?

    Well, this plugin is only good if you implement harsh screening on new client accounts. Some take it to the next level and even check paypal accounts - as that is a unique identifier of a client. Unless they also have several paypals hhh

    Regards

  • Kevin_KKevin_K Member
    edited January 2013

    @Spencer said: Yea I know the issue, it is an easy fix. Ive just been sooooo busy. Tomorrow ill have a fix.:

    I look forward to the fix :)

  • I've been fiddling with this a little bit and worked out that when this is called, if it's a new customer there is no "uid" so the API searches for all overdue invoices. This means any new customers have issues signing up if you have overdue invoices in your WHMCS.

    A quick bit of extra code seems to fix this so that only customers with a uid in session are checked:

    Old code:
    if ($anyoverdue['totalresults'] >= 1) {

    New code:
    if ($_SESSION['uid'] != "" && $anyoverdue['totalresults'] >= 1) {

  • Probably a better idea to use if(!isset($_SESSION['uid'])), or if(array_key_exists...), because you'll be generating undefined index errors every time that code is run when that session key isn't set.

  • Yeah my bad, I had changed it to isset but didn't update my copy/paste code for here :)

  • Cool, just figured it needed to be pointed out :)

Sign In or Register to comment.