This hook creates a fake, empty pro-forma invoice each time another pro-forma invoice is paid.
<?php
/**
* cretefakeinvoice
*
* create an empty, fake invoice each time another
* invoice is paid
*/
if (!defined("WHMCS"))
die("This file cannot be accessed directly");
function create_fake_invoice($vars) {
$firstname = $vars['firstname'];
$lastname = $vars['lastname'];
$email = $vars['email'];
$command = 'CreateInvoice';
$postData = array(
'userid' => '1',
);
$results = localAPI($command, $postData, $adminUsername);
}
add_hook("InvoicePaidPreEmail",1,"create_fake_invoice");