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:
Javi
2026-05-27 12:22:25 +02:00
parent f3096faee6
commit 649ddff5fe
8 changed files with 131 additions and 19 deletions
+7 -4
View File
@@ -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)))
{