From: <tim...@us...> - 2012-01-22 10:19:50
|
Revision: 4833 http://web-erp.svn.sourceforge.net/web-erp/?rev=4833&view=rev Author: tim_schofield Date: 2012-01-22 10:19:44 +0000 (Sun, 22 Jan 2012) Log Message: ----------- Fix bug when saving an offer update Modified Paths: -------------- trunk/includes/DefineOfferClass.php Modified: trunk/includes/DefineOfferClass.php =================================================================== --- trunk/includes/DefineOfferClass.php 2012-01-22 10:06:02 UTC (rev 4832) +++ trunk/includes/DefineOfferClass.php 2012-01-22 10:19:44 UTC (rev 4833) @@ -104,20 +104,21 @@ } } } else { - foreach ($_SESSION['offer']->LineItems as $LineItems) { - $sql="UPDATE offers SET quantity='".$LineItems->Quantity."', - price='".$LineItems->Price."', - expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' - WHERE offerid='".$LineItems->LineNo . "'"; + foreach ($this->LineItems as $LineItem) { + $sql="UPDATE offers SET + quantity='".$LineItem->Quantity."', + price='".$LineItem->Price."', + expirydate='".FormatDateForSQL($LineItem->ExpiryDate)."' + WHERE offerid='".$LineItem->LineNo . "'"; $ErrMsg = _('The suppliers offer could not be updated on the database because'); $DbgMsg = _('The SQL statement used to update the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); if (DB_error_no($db)==0) { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('has been updated in the database'), 'success'); - $this->OfferMailText .= $LineItems->Quantity.' '.$LineItems->Units.' '._('of').' '.$LineItems->StockID.' '._('at a price of'). - ' '.$this->CurrCode.$LineItems->Price."\n"; + prnMsg( _('The offer for').' '.$LineItem->StockID.' '._('has been updated in the database'), 'success'); + $this->OfferMailText .= $LineItem->Quantity.' '.$LineItem->Units.' '._('of').' '.$LineItem->StockID.' '._('at a price of'). + ' '.$this->CurrCode.$LineItem->Price."\n"; } else { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('could not be updated in the database'), 'error'); + prnMsg( _('The offer for').' '.$LineItem->StockID.' '._('could not be updated in the database'), 'error'); include('includes/footer.inc'); exit; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |