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. |
From: <tim...@us...> - 2012-01-22 10:19:51
|
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. |
From: <Ex...@us...> - 2012-05-18 08:52:20
|
Revision: 5371 http://web-erp.svn.sourceforge.net/web-erp/?rev=5371&view=rev Author: ExsonQu Date: 2012-05-18 08:52:14 +0000 (Fri, 18 May 2012) Log Message: ----------- 18/5/2012 Ahmed: Fixed bugs that the offer cannot store more than one item and remove function does not work in SupplierTenders.php and DefineOfferClass.php Modified Paths: -------------- trunk/includes/DefineOfferClass.php Modified: trunk/includes/DefineOfferClass.php =================================================================== --- trunk/includes/DefineOfferClass.php 2012-05-18 08:42:16 UTC (rev 5370) +++ trunk/includes/DefineOfferClass.php 2012-05-18 08:52:14 UTC (rev 5371) @@ -105,6 +105,7 @@ } } else { foreach ($this->LineItems as $LineItem) { + if ($LineItem->Deleted==false){ //Update only the LineItems which is not flagged as deleted $sql="UPDATE offers SET quantity='".$LineItem->Quantity."', price='".$LineItem->Price."', @@ -122,9 +123,22 @@ include('includes/footer.inc'); exit; } + } else { // the LineItem is Deleted flag is true so delete it + $sql = "DELETE from offers WHERE offerid='" . $LineItem->LineNo . "'"; + $ErrMsg = _('The supplier offer could not be deleted on the database because'); + $DbgMsg = _('The SQL statement used to delete the suppliers offer record are failed was'); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + if (DB_error_no($db) == 0) { + prnMsg(_('The offer for').' '.$LineItem->StockID.' ' ._('has been deleted in the database'), 'info'); + $this->OfferMailText .= $LineItem->Quantity.' '.$LineItem->Units.' '._('of').' ' .$LineItem->StockID.' ' + ._('at a price of').' '.$this->CurrCode.$LineItem->Price.' '._('has been deleted')."\n"; + + } + } } - } + } + } function EmailOffer() { $Subject=(_('Offer received from').' '.$this->GetSupplierName()); @@ -193,4 +207,4 @@ } } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-05-18 08:52:24
|
Revision: 5371 http://web-erp.svn.sourceforge.net/web-erp/?rev=5371&view=rev Author: ExsonQu Date: 2012-05-18 08:52:14 +0000 (Fri, 18 May 2012) Log Message: ----------- 18/5/2012 Ahmed: Fixed bugs that the offer cannot store more than one item and remove function does not work in SupplierTenders.php and DefineOfferClass.php Modified Paths: -------------- trunk/includes/DefineOfferClass.php Modified: trunk/includes/DefineOfferClass.php =================================================================== --- trunk/includes/DefineOfferClass.php 2012-05-18 08:42:16 UTC (rev 5370) +++ trunk/includes/DefineOfferClass.php 2012-05-18 08:52:14 UTC (rev 5371) @@ -105,6 +105,7 @@ } } else { foreach ($this->LineItems as $LineItem) { + if ($LineItem->Deleted==false){ //Update only the LineItems which is not flagged as deleted $sql="UPDATE offers SET quantity='".$LineItem->Quantity."', price='".$LineItem->Price."', @@ -122,9 +123,22 @@ include('includes/footer.inc'); exit; } + } else { // the LineItem is Deleted flag is true so delete it + $sql = "DELETE from offers WHERE offerid='" . $LineItem->LineNo . "'"; + $ErrMsg = _('The supplier offer could not be deleted on the database because'); + $DbgMsg = _('The SQL statement used to delete the suppliers offer record are failed was'); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + if (DB_error_no($db) == 0) { + prnMsg(_('The offer for').' '.$LineItem->StockID.' ' ._('has been deleted in the database'), 'info'); + $this->OfferMailText .= $LineItem->Quantity.' '.$LineItem->Units.' '._('of').' ' .$LineItem->StockID.' ' + ._('at a price of').' '.$this->CurrCode.$LineItem->Price.' '._('has been deleted')."\n"; + + } + } } - } + } + } function EmailOffer() { $Subject=(_('Offer received from').' '.$this->GetSupplierName()); @@ -193,4 +207,4 @@ } } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ex...@us...> - 2013-05-11 14:53:00
|
Revision: 5918 http://sourceforge.net/p/web-erp/reponame/5918 Author: exsonqu Date: 2013-05-11 14:52:56 +0000 (Sat, 11 May 2013) Log Message: ----------- 11/5/2013 Exson: Make the offer can be mailed via smtp in DefineOfferClass.php. Modified Paths: -------------- trunk/includes/DefineOfferClass.php Modified: trunk/includes/DefineOfferClass.php =================================================================== --- trunk/includes/DefineOfferClass.php 2013-05-11 13:57:18 UTC (rev 5917) +++ trunk/includes/DefineOfferClass.php 2013-05-11 14:52:56 UTC (rev 5918) @@ -145,7 +145,20 @@ $Message=(_('This email is automatically generated by webERP')."\n" . _('You have received the following offer from').' '.$this->GetSupplierName()."\n\n".$this->OfferMailText); $Headers = 'From: '. $this->GetSupplierEmail() . "\r\n" . 'Reply-To: ' . $this->GetSupplierEmail() . "\r\n" . 'X-Mailer: PHP/' . phpversion(); - $result = mail($_SESSION['PurchasingManagerEmail'], $Subject, $Message, $Headers); + if($_SESSION['SmtpSetting']==1){ + include('includes/htmlMimeMail.php'); + $mail = new htmlMimeMail(); + $mail->setText($Message); + $mail->setSubject($Subject); + $mail->setFrom($this->GetSupplierEmail()); + $mail->setHeader('Reply-To',$this->GetSupplierEmail()); + $mail->setCc($this->GetSupplierEmail()); + } + if($_SESSION['SmtpSetting']==0){ + $result = mail($_SESSION['PurchasingManagerEmail'], $Subject, $Message, $Headers); + }else{ + $result = SendmailBySmtp($mail,array($Supplier->EmailAddress,$_SESSION['PurchasingManagerEmail'])); + } return $result; } |