• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/component/usestore.php
  • Класс: BitrixCatalogComponentUseStore
  • Вызов: UseStore::resetQuantityTraceSku
static function resetQuantityTraceSku(): void
{
	if (!self::isCloud() && self::isSeparateSku())
	{
		Application::getConnection()->queryExecute("
			update b_catalog_product
			set
				QUANTITY = 0,
				QUANTITY_RESERVED = 0,
				QUANTITY_TRACE = '" . ProductTable::STATUS_DEFAULT . "',
				CAN_BUY_ZERO = '" . ProductTable::STATUS_DEFAULT . "',
				NEGATIVE_AMOUNT_TRACE = '" . ProductTable::STATUS_DEFAULT . "',
				AVAILABLE = '" . ProductTable::STATUS_YES . "'
			where
				TYPE = " . ProductTable::TYPE_SKU
		);
	}
	else
	{
		Application::getConnection()->queryExecute("
			update b_catalog_product
			set
				QUANTITY = 0,
				QUANTITY_RESERVED = 0,
				QUANTITY_TRACE = '" . ProductTable::STATUS_NO . "',
				CAN_BUY_ZERO = '" . ProductTable::STATUS_YES . "',
				NEGATIVE_AMOUNT_TRACE = '" . ProductTable::STATUS_YES . "',
				AVAILABLE = '" . ProductTable::STATUS_YES . "'
			where
				TYPE = " . ProductTable::TYPE_SKU
		);
	}
}