diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index aa6272ae30b..d2d92188662 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -472,7 +472,10 @@ if (empty($reshook)) { // If we add a line and no invoice yet, we create the invoice if (($action == "addline" || $action == "freezone") && $placeid == 0) { $invoice->socid = getDolGlobalString($constforcompanyid); - $invoice->date = dol_now('tzuserrel'); // We use the local date, only the day will be saved. + + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; + $invoice->date = dol_get_first_hour(dol_now('tzuserrel')); // Invoice::create() needs a date with no hours + $invoice->module_source = 'takepos'; $invoice->pos_source = isset($_SESSION["takeposterminal"]) ? $_SESSION["takeposterminal"] : '' ; $invoice->entity = !empty($_SESSION["takeposinvoiceentity"]) ? $_SESSION["takeposinvoiceentity"] : $conf->entity;