It was before $data['invoice_number'] = str_replace('-', '', substr(date("Y-m-d"),2,8)).substr(md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count;
and others had trouble
Seems related to j1.5 or j1.6+ or to the php version
Hi, in the line 993 (models/orders.php)
str_replace('-', '', substr(JFactory::getDate(),2,8)).substr(md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count; the term
JFactory::getDate() computes a reference to the class object JDate!
So it is definitely wrong - and the PHP throws an information or error...
Sometimes the md5 function calculates a pure number too, so I changed the line and added some stuff too; no errors, no information any more:
File: administrator/components/com_virtuemart/models/orders.php (line 991)
if(empty($data['invoice_number'])) {
//$variable_fixed=sprintf("%05s",$num_rows);
$_date = JFactory::getDate();
$data['invoice_number'] = str_replace('-', '', substr($_date->toISO8601(),2,8)).substr((string)md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count;
//$data['invoice_number'] = str_replace('-', '', substr(JFactory::getDate(),2,8)).substr(md5($orderDetails['order_number'].$orderDetails['order_status']),0,3).'0'.$count;
}
tested with J1.5, VM2.02, PHP 5.3.10-2, debian
Best regards,
Thomas