// Add title ou sub-title TSubtotal::addSubTotalLine($object, $row['label'], 0 + $row['level']); $TLastLevelTitleAdded[] = $row['level']; } else { if (!empty($conf->nomenclature->enabled) && ($row['type'] == 'nomenclature' || $row['type'] == 'workstation')) { //var_dump($last_line_product,$last_line_id);exit; if ($last_line_id > 0) { $nomenclature = new TNomenclature(); $workstation = new TWorkstation(); if ($last_line_product > 0 && !empty($conf->global->CREATE_PRODUCT_FROM_IMPORT)) { $nomenclature->loadByObjectId($PDOdb, $last_line_product, 'product'); $nomenclature->fk_object = $last_line_product; $nomenclature->fk_nomenclature_parent = 0; $nomenclature->is_default = 0; $nomenclature->object_type = 'product'; $nomenclature->save($PDOdb); } else { $nomenclature->loadByObjectId($PDOdb, $last_line_id, $object->element); $nomenclature->fk_object = $last_line_id; $nomenclature->fk_nomenclature_parent = 0; $nomenclature->is_default = 0; $nomenclature->object_type = $object->element; $nomenclature->save($PDOdb); } if (!empty($row['fk_product'])) { $k = $nomenclature->addChild($PDOdb, 'TNomenclatureDet'); $nomenclature->TNomenclatureDet[$k]->fk_product = $row['fk_product']; $nomenclature->TNomenclatureDet[$k]->title = $row['label']; $nomenclature->TNomenclatureDet[$k]->fk_nomenclature = $nomenclature->getId(); $nomenclature->TNomenclatureDet[$k]->qty = $row['qty']; $nomenclature->TNomenclatureDet[$k]->price = $row['price'];