Jump to content

error al gestionar cobertura de las existencias


RicRey

Recommended Posts

este error me muestra como dice el título

 

[PrestaShopDatabaseException]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND TO_DAYS(NOW()) - TO_DAYS(sm.`date_add`) <= 7 AND s.`id_product` = 51 ' at line 14
 

			SELECT SUM(view.quantity) as quantity_out			FROM			(	SELECT sm.`physical_quantity` as quantity				FROM `os_stock_mvt` sm				LEFT JOIN `os_stock` s ON (sm.`id_stock` = s.`id_stock`)				LEFT JOIN `os_product` p ON (p.`id_product` = s.`id_product`)				 INNER JOIN os_product_shop product_shop		ON (product_shop.id_product = p.id_product AND product_shop.id_shop = p.id_shop_default)				LEFT JOIN `os_product_attribute` pa ON (p.`id_product` = pa.`id_product`)				 LEFT JOIN os_product_attribute_shop product_attribute_shop		ON (product_attribute_shop.id_product_attribute = pa.id_product_attribute AND product_attribute_shop.id_shop IN (1))				WHERE sm.`sign` = -1				AND sm.`id_stock_mvt_reason` != 				AND TO_DAYS(NOW()) - TO_DAYS(sm.`date_add`) <= 7				AND s.`id_product` = 51				AND s.`id_product_attribute` = 0				GROUP BY sm.`id_stock_mvt`			) as view LIMIT 1

at line 613 in file classes/db/Db.php

607. 			WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);608. 		}609. 		else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))610. 		{611. 			if ($sql)612. 				throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');613. 			throw new PrestaShopDatabaseException($this->getMsgError());614. 		}615. 	}616. 617. 	/**

 

Link to comment
Share on other sites

  • nadie locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...