From: <dai...@us...> - 2013-12-23 02:11:33
|
Revision: 6511 http://sourceforge.net/p/web-erp/reponame/6511 Author: daintree Date: 2013-12-23 02:11:30 +0000 (Mon, 23 Dec 2013) Log Message: ----------- modification to strings for the credit note duplication traps - still a bit suspect! Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2013-12-22 14:21:44 UTC (rev 6510) +++ trunk/Credit_Invoice.php 2013-12-23 02:11:30 UTC (rev 6511) @@ -483,15 +483,15 @@ //Here we just validate if there is no credit qty available since the credit items not retrieve from salesorders, so following method is not 100% correct. if(isset($_POST['CreditType']) AND ($_POST['CreditType']=='WriteOff' OR $_POST['CreditType'] == 'Return' OR $_POST['CreditType']=='ReverseOverCharge')){ foreach ($_SESSION['CreditItems' . $identifier]->LineItems as $CreditLine) { - $SQL = "SELECT count(*) FROM salesorderdetails WHERE orderno = '".$_SESSION['CreditItems'.$identifier]->OrderNo."' - AND stkcode = '".$CreditLine->StockID."' - AND quantity >=".$CreditLine->QtyDispatched." - AND qtyinvoiced >= ".$CreditLine->QtyDispatched; - $ErrMsg = _('Failed to retrieve salesoderdetails to compare if the credit is overkill'); + $SQL = "SELECT count(*) FROM salesorderdetails WHERE orderno = '" . $_SESSION['CreditItems'.$identifier]->OrderNo . "' + AND stkcode = '" . $CreditLine->StockID . "' + AND quantity >=" . $CreditLine->QtyDispatched . " + AND qtyinvoiced >=" . $CreditLine->QtyDispatched; + $ErrMsg = _('Failed to retrieve salesoderdetails to compare if the order has been invoiced and that it is possible that the credit note may not already have been done'); $DuplicateCreditResult = DB_query($SQL,$db,$ErrMsg); $myrow1 = DB_fetch_array($DuplicateCreditResult); if($myrow1[0] == 0){ - prnMsg(_('The credit quantity for ').$CreditLine->StockID.(' is over than quantity invoiced, must reduce the quantity to credit or you are duplicating the same invoice which is not allowed'),'error'); + prnMsg(_('The credit quantity for the line for') . ' ' . $CreditLine->StockID . ' ' . ('is more than the quantity invoiced. This check is made to ensure that the credit note is not duplicated.'),'error'); $OKToProcess = false; include('includes/footer.inc'); exit; |