Open WMCyn opened 7 months ago
Think I have found the issue, the "product name" in the quote matched both a deleted product and a newer product. after turning on more logging. it was attempting to match the "product name" with the one marked as deleted.
Any idea where in the code to make the import respect the "deleted" flag?
problem is in \app\record.php
public static function getCrmIdByLabel($moduleName, $label, $userId = false)
{
$key = $moduleName . $label . '_' . $userId;
if (\App\Cache::staticHas(__METHOD__, $key)) {
return \App\Cache::staticGet(__METHOD__, $key);
}
$query = (new \App\Db\Query())
->select(['cl.crmid'])
->from('u_#__crmentity_label cl')
->innerJoin('vtiger_crmentity', 'cl.crmid = vtiger_crmentity.crmid')
->where(['vtiger_crmentity.setype' => $moduleName])
->andWhere(['cl.label' => $label]);
if ($userId) {
$query->andWhere(['like', 'vtiger_crmentity.users', ",$userId,"]);
}
$crmId = $query->scalar();
\App\Cache::staticSave(__METHOD__, $key, $crmId);
return $crmId;
}
notice no check for "deleted"
fixed version of the function
public static function getCrmIdByLabel($moduleName, $label, $userId = false)
{
$key = $moduleName . $label . '_' . $userId;
if (\App\Cache::staticHas(__METHOD__, $key)) {
return \App\Cache::staticGet(__METHOD__, $key);
}
$query = (new \App\Db\Query())
->select(['cl.crmid'])
->from('u_#__crmentity_label cl')
->innerJoin('vtiger_crmentity', 'cl.crmid = vtiger_crmentity.crmid')
->where(['vtiger_crmentity.setype' => $moduleName])
->andWhere(['vtiger_crmentity.deleted' => 0])
->andWhere(['cl.label' => $label]);
if ($userId) {
$query->andWhere(['like', 'vtiger_crmentity.users', ",$userId,"]);
}
$crmId = $query->scalar();
\App\Cache::staticSave(__METHOD__, $key, $crmId);
return $crmId;
}
trying to import quotes using csv.
export a test quote from yeti to get formatting.
removed test quote and attempted to import from exported csv
system just gives error
Nothing showing logs
Am I missing something?