Skip to content

Commit

Permalink
Issue #24205:use implodeWo and explodeWo to allow the editing of char…
Browse files Browse the repository at this point in the history
…acteristics for configured items
  • Loading branch information
garyhgohoos committed Aug 28, 2014
1 parent cbf04ac commit d26213d
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion guiclient/salesOrderItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,8 @@ void salesOrderItem::sSave(bool pPartial)
// Update supply order characteristics
if ( (_mode != cView) && (_mode != cViewQuote) )
{
if (_supplyOrderId != -1 && !_item->isConfigured())
// if (_supplyOrderId != -1 && !_item->isConfigured())
if (_supplyOrderId != -1)
{
// Update Supply Order Characteristics
if (_itemchar->rowCount() > 0)
Expand Down Expand Up @@ -1416,6 +1417,13 @@ void salesOrderItem::sSave(bool pPartial)
__FILE__, __LINE__);
return;
}
if ( (_supplyOrderType == "W") && (_supplyOrderStatus->text() == "O") && _item->isConfigured() )
{
XSqlQuery explodeq;
explodeq.prepare( "SELECT explodeWo(:wo_id, true) AS result;" );
explodeq.bindValue(":wo_id", _supplyOrderId);
explodeq.exec();
}
}
else if (salesSave.lastError().type() != QSqlError::NoError)
{
Expand Down Expand Up @@ -2471,6 +2479,22 @@ void salesOrderItem::sHandleSupplyOrder()
ordq.bindValue(":parent_type", QString("S"));
ordq.bindValue(":parent_id", _soitemid);
ordq.exec();
if (ordq.first())
{
int _woid = ordq.value("result").toInt();
if ((_woid > 0) && _item->isConfigured())
{
XSqlQuery implodeq;
implodeq.prepare( "SELECT implodeWo(:wo_id, true) AS result;" );
implodeq.bindValue(":wo_id", _woid);
implodeq.exec();
}
}
else if (ordq.lastError().type() != QSqlError::NoError)
{
systemError(this, ordq.lastError().databaseText(), __FILE__, __LINE__);
return;
}
}
else if (_supplyOrderType == "P")
{
Expand Down

0 comments on commit d26213d

Please sign in to comment.