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

Invoice::set_unpaid possible bug #12

Closed
kmark opened this issue Apr 3, 2013 · 7 comments
Closed

Invoice::set_unpaid possible bug #12

kmark opened this issue Apr 3, 2013 · 7 comments

Comments

@kmark
Copy link
Member

@kmark kmark commented Apr 3, 2013

Original author: gugli...@gmail.com (June 16, 2010 10:31:29)

The set_unpaid function should have a $server->suspend function like this:

$server->suspend($iid);

The set_paid function have a $server->unsuspend() see here:
http://code.google.com/p/thehostingtool/source/browse/trunk/includes/class_invoice.php#114

Maybe there is a reason that the server->suspend is missing in set_unpaid function or is a bug?

Function Invoice::set_unpaid

http://code.google.com/p/thehostingtool/source/browse/trunk/includes/class_invoice.php#120

Original issue: http://code.google.com/p/thehostingtool/issues/detail?id=14

@kmark
Copy link
Member Author

@kmark kmark commented Apr 3, 2013

From gugli...@gmail.com on June 16, 2010 11:02:18
I'm adding the complete "set_unpaid" function modified here:

public function set_unpaid($iid) { # UnPay the invoice by giving invoice id - Don't think this will be useful
    global $db, $server;
    $query = $db->query("UPDATE `<PRE>invoices` SET `is_paid` = '0' WHERE `id` = '{$iid}'");

    $query2 = $db->query("SELECT * FROM `<PRE>invoices` WHERE `id` = '{$iid}' LIMIT 1");
    $data2 = $db->fetch_array($query2);
    $query3 = $db->query("SELECT * FROM `<PRE>user_packs` WHERE `userid` = '{$data2['uid']}'");
    $data3 = $db->fetch_array($query3);
    $server->suspend($data3['id']);
    return $query;
}
@kmark
Copy link
Member Author

@kmark kmark commented Apr 3, 2013

From gugli...@gmail.com on June 16, 2010 12:20:30
So the idea is to use the $server->suspend and $server->unsuspend in the set_unpaid and set_paid function respectively?

@kmark
Copy link
Member Author

@kmark kmark commented Apr 3, 2013

From gugli...@gmail.com on June 17, 2010 07:20:58
Hello kujoez when you said: "We have no plans to continue development of Paid Hosting"? what do you exactly meant? I'm developing some new features for THT that could be integrated in the SVN: http://thehostingtool.com/forum/thread-880.html

@kmark
Copy link
Member Author

@kmark kmark commented Apr 3, 2013

From kmark937 on June 17, 2010 21:50:36
As far as the main development branch for THT goes, we will only be bug-fixing paid hosting. Enhancements and new features will all be of low priority. So essentially you want it to suspend the account when the invoice is set as unpaid?

@kmark
Copy link
Member Author

@kmark kmark commented Apr 3, 2013

From kuj...@gmail.com on June 18, 2010 19:56:13
Also what would happen if say you mark an invoice as unpaid while the previous billing cycle is in effect? You wouldn't want to automatically suspend a up-to-date paid account just because their invoice was marked unpaid would you?

@kmark
Copy link
Member Author

@kmark kmark commented Apr 3, 2013

From kmark937 on February 02, 2013 02:56:38
Pushing back. Not worth delaying 1.2.5 for this.

@kmark
Copy link
Member Author

@kmark kmark commented Apr 3, 2013

From kmark937 on March 31, 2013 03:31:55
Not sure about this. WontFix for now.

@kmark kmark closed this Apr 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant