fix: Resolved technical debt - updated TODO/FIXME items: fixed UPDATE query in formproduct.cpp, corrected toDouble() in itemnumberdelegate.cpp, added ElementType enumeration, implemented composition deletion in formelementlist.cpp, updated README
This commit is contained in:
@@ -93,17 +93,20 @@ void formElementList::on_buttonDelete_released()
|
||||
dApp->Enterprise().open();
|
||||
QSqlQuery qry = QSqlQuery(dApp->Enterprise());
|
||||
|
||||
/*
|
||||
if (index.parent().child(index.row(), 2).data().toInt() == 0)
|
||||
// Check if it's a composed element (TYPE1 = 0) and delete its composition first
|
||||
QModelIndex parentIndex = index.parent();
|
||||
QModelIndex childIndex = model->index(index.row(), 2, parentIndex); // Obtén el índice del hijo
|
||||
int type = childIndex.data().toInt(); // Accede al dato
|
||||
|
||||
if (type == 0) // ElementType::Composed
|
||||
{
|
||||
// TODO: borrar la composición
|
||||
// Delete composition elements first
|
||||
if(!qry.exec(QString("DELETE FROM ELEMENTCOMPOSITION WHERE CODE = '%1';").arg(ID)))
|
||||
{
|
||||
qDebug() << "Error ejecutando el query: " << qry.lastError().text() << "\n";
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if(!qry.exec(QString("DELETE FROM ELEMENT WHERE CODE = '%1';").arg(ID)))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user