WHMCS autocancel_invoices_of_terminated_products

vim includes/hooks/autocancel_invoices_of_terminated_products.php

<?php

function hook_autocancel_invoices_of_terminated_products() {
$query = mysql_query(‘SELECT id FROM tblinvoices WHERE status=\’Unpaid\’ AND id IN (SELECT invoiceid FROM
tblinvoiceitems WHERE relid IN (SELECT id FROM tblhosting
WHERE domainstatus=\’Terminated\’));’);
$message = ‘
Invoices Canceled List :

‘;
while ($result = mysql_fetch_array($query)) {
$message .= ‘Invoice ID : ‘ . $result[id] . ‘
‘;
logactivity(‘Invoice ID : ‘ . $result[id] . ‘ Cancelled Automatically By WebSoftSolus AutoCancel Invoices Of Terminated
Products Cron Job’);
}
sendadminnotification($to = ‘system’, ‘AutoCancel Invoices Cron Job Activity’, $message, $deptid = ”);
$query = ‘UPDATE tblinvoices SET status=\’Cancelled\’,notes=\’Cancelled Automatically By WebSoftSolus
AutoCancel Invoices Of Terminated Products Cron Job\’ WHERE
status=\’Unpaid\’ AND id IN (SELECT invoiceid FROM
tblinvoiceitems WHERE relid IN (SELECT id FROM tblhosting
WHERE domainstatus=\’Terminated\’));’;
mysql_query($query); } add_hook(‘DailyCronJob’, 1, ‘hook_autocancel_invoices_of_terminated_products’);

共有 0 条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注