(08-02-2016, 05:56 AM)robkermit Wrote: Using latest WebERP, I was presented with this error today when trying to process recurring sales orders.
INFORMATION Message : The number of recurring orders to process is : 1
Recurring order 3 for MFPW - MFPW is being processed
Date calculated for the next recurrence was: 2016-07-31
Database Error 1292 : The order cannot be added because
Incorrect date value: '0000-00-00' for column 'confirmeddate' at row 1
This is because of a problem I have brought up dozens of times over many years. MySQL can be set to run in many different modes and one of them blocks zero date. Your installation is one of these. To correct the issue change the SQL at line 103 of RecurringSalesOrdersProcess.php to be
$HeaderSQL = "INSERT INTO salesorders (
orderno,
debtorno,
branchcode,
customerref,
comments,
orddate,
ordertype,
shipvia,
deliverto,
deladd1,
deladd2,
deladd3,
deladd4,
deladd5,
deladd6,
contactphone,
contactemail,
freightcost,
fromstkloc,
confirmeddate,
deliverydate )
VALUES (
'" . $OrderNo . "',
'" . $RecurrOrderRow['debtorno'] . "',
'" . $RecurrOrderRow['branchcode'] . "',
'". $RecurrOrderRow['customerref'] ."',
'". $RecurrOrderRow['comments'] ."',
'" . $DelDate . "',
'" . $RecurrOrderRow['ordertype'] . "',
'" . $RecurrOrderRow['shipvia'] ."',
'" . $RecurrOrderRow['deliverto'] . "',
'" . $RecurrOrderRow['deladd1'] . "',
'" . $RecurrOrderRow['deladd2'] . "',
'" . $RecurrOrderRow['deladd3'] . "',
'" . $RecurrOrderRow['deladd4'] . "',
'" . $RecurrOrderRow['deladd5'] . "',
'" . $RecurrOrderRow['deladd6'] . "',
'" . $RecurrOrderRow['contactphone'] . "',
'" . $RecurrOrderRow['contactemail'] . "',
'" . $RecurrOrderRow['freightcost'] ."',
'" . $RecurrOrderRow['fromstkloc'] ."',
CURRENT_DATE;
'" . $DelDate . "')";
This should cure the problem. Though you may find other issues in other scripts.
Thanks
Tim