fix StockManager lot/serial coercion + add document flow test suite
This commit is contained in:
@@ -64,7 +64,11 @@ class PostingWindowGuard
|
||||
$date = "{$m[3]}-{$m[2]}-{$m[1]}";
|
||||
}
|
||||
|
||||
if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $date)) {
|
||||
if (preg_match("#^([0-9]{4}-[0-9]{2}-[0-9]{2})[ T]#", $date, $m)) {
|
||||
$date = $m[1];
|
||||
}
|
||||
|
||||
if (!preg_match("#^[0-9]{4}-[0-9]{2}-[0-9]{2}$#", $date)) {
|
||||
throw new Exception("Invalid posting date {$date}. Use YYYY-MM-DD.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user