浏览代码

Fix date of invoice. We want the date of the user.

Laurent Destailleur 11 月之前
父节点
当前提交
75f853f2db
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      htdocs/takepos/invoice.php

+ 4 - 1
htdocs/takepos/invoice.php

@@ -473,7 +473,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();		// Invoice::create() needs a GMT timestamp
+
+		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;