For everyone having this issue, I've created the following script that checks if the time paid is equal to 00:00:00. If it is, it updates the time for the transaction.
When an invoices goes to "Paid" status, it also updates the time.
<?php
use WHMCS\Billing\Invoice;
use WHMCS\Database\Capsule;
use WHMCS\Carbon;
add_hook('AddTransaction', 1, function($vars) {
$now = Carbon::now();
$transactionDate = Carbon::parse($vars['date']);
if($transactionDate->toTimeString() === '00:00:00')
{
$transaction = Capsule::table('tblaccounts')
->where('id', $vars['id'])
->update(
[
'date' => $now,
]);
}
});
add_hook('InvoicePaidPreEmail', 1, function($vars) {
$now = Carbon::now();
$invoice = Invoice::find($vars['invoiceid']);
if($invoice->datepaid->toTimeString() === '00:00:00')
{
$invoice->datepaid = $now;
$invoice->save();
}
});
Create a new PHP file in /includes/hooks/ and paste the contents into the new file.