[Weberp-svn] SF.net SVN: weberp:[5165] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-04-10 18:13:57
|
Revision: 5165 http://weberp.svn.sourceforge.net/weberp/?rev=5165&view=rev Author: tim_schofield Date: 2011-04-10 18:13:50 +0000 (Sun, 10 Apr 2011) Log Message: ----------- XHTML updates and quoting changes Modified Paths: -------------- trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/SupplierTenderCreate.php trunk/Suppliers.php trunk/WorkOrderEntry.php Removed Paths: ------------- trunk/SystemCheck.php Modified: trunk/SupplierBalsAtPeriodEnd.php =================================================================== --- trunk/SupplierBalsAtPeriodEnd.php 2011-04-10 15:29:34 UTC (rev 5164) +++ trunk/SupplierBalsAtPeriodEnd.php 2011-04-10 18:13:50 UTC (rev 5165) @@ -54,9 +54,9 @@ $title = _('Supplier Balances - Problem Report'); include('includes/header.inc'); prnMsg(_('The Supplier details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br>$SQL"; + echo '<br />' . $SQL; } include('includes/footer.inc'); exit; @@ -65,7 +65,7 @@ $title = _('Supplier Balances - Problem Report'); include('includes/header.inc'); prnMsg(_('There are no supplier balances to list'),'error'); - echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } @@ -126,16 +126,16 @@ } /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '<form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class=selection>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Supplier Code') . ":</font></td> - <td><input Type=text maxlength=6 size=7 name=FromCriteria value=".$_POST['FromCriteria']."></td></tr>"; - echo '<tr><td>' . _('To Supplier Code') . ":</td> - <td><input Type=text maxlength=6 size=7 name=ToCriteria value=".$_POST['ToCriteria']."></td></tr>"; + echo '<tr><td>' . _('From Supplier Code') . ':</font></td> + <td><input Type=text maxlength=6 size=7 name=FromCriteria value="'.$_POST['FromCriteria'].'"></td></tr>'; + echo '<tr><td>' . _('To Supplier Code') . ':</td> + <td><input Type=text maxlength=6 size=7 name=ToCriteria value="'.$_POST['ToCriteria'].'"></td></tr>'; - echo '<tr><td>' . _('Balances As At') . ":</td> - <td><select Name='PeriodEnd'>"; + echo '<tr><td>' . _('Balances As At') . ':</td> + <td><select Name="PeriodEnd">'; $sql = "SELECT periodno, lastdate_in_period,EXTRACT(YEAR_MONTH FROM lastdate_in_period) as YearMonth FROM periods ORDER BY periodno DESC"; @@ -145,7 +145,7 @@ while ($myrow = DB_fetch_array($Periods,$db)){ if ($myrow['YearMonth'] == date("Ym")) { // get the current month - echo '<option VALUE=' . $myrow['lastdate_in_period'] . ' selected="TRUE">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period'],'M',-1); + echo '<option VALUE=' . $myrow['lastdate_in_period'] . ' selected="TRUE">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period'],'M',-1).'</option>'; } else { echo '<option VALUE=' . $myrow['lastdate_in_period'] . '> '.MonthAndYearFromSQLDate($myrow['lastdate_in_period']).'</option>'; @@ -154,7 +154,7 @@ echo '</select></td></tr>'; - echo "</table><br /><div class='centre'><input type=Submit Name='PrintPDF' Value='" . _('Print PDF') . "'></div>"; + echo '</table><br /><div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print PDF') . '"></div>'; include('includes/footer.inc'); }/*end of else not PrintPDF */ Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2011-04-10 15:29:34 UTC (rev 5164) +++ trunk/SupplierCredit.php 2011-04-10 18:13:50 UTC (rev 5165) @@ -115,8 +115,8 @@ $_SESSION['SuppTrans']->SupplierID = $_GET['SupplierID']; $LocalTaxProvinceResult = DB_query("SELECT taxprovinceid - FROM locations - WHERE loccode = '" . $_SESSION['UserStockLocation'] . "'", $db); + FROM locations + WHERE loccode = '" . $_SESSION['UserStockLocation'] . "'", $db); if(DB_num_rows($LocalTaxProvinceResult)==0){ prnMsg(_('The tax province associated with your user account has not been set up in this database. Tax calculations are based on the tax group of the supplier and the tax province of the user entering the invoice. The system administrator should redefine your account with a valid default stocking location and this location should refer to a valid tax province'),'error'); @@ -264,10 +264,10 @@ /* everything below here only do if a Supplier is selected fisrt add a header to show who we are making an credit note for */ -echo "<table class=selection colspan=4><tr><th>" . _('Supplier') . "</th> - <th>" . _('Currency') . "</th> - <th>" . _('Terms') . "</th> - <th>" . _('Tax Group') . '</th></tr>'; +echo '<table class=selection colspan=4><tr><th>' . _('Supplier') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Terms') . '</th> + <th>' . _('Tax Group') . '</th></tr>'; echo '<tr><td><font color=blue><b>' . $_SESSION['SuppTrans']->SupplierID . ' - ' . $_SESSION['SuppTrans']->SupplierName . '</b></font></td> @@ -277,20 +277,20 @@ </tr> </table>'; -echo "<form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post name=form1>"; +echo '<form action="' . $_SERVER['PHP_SELF'] . ' method="post" name=form1>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class=selection>'; -echo '<tr><td><font color=red>' . _('Supplier Credit Note Reference') . ":</font></td> - <td><font size=2><input type=TEXT size=20 maxlength=20 name=SuppReference VALUE='" . $_SESSION['SuppTrans']->SuppReference . "'></td>"; +echo '<tr><td><font color=red>' . _('Supplier Credit Note Reference') . ':</font></td> + <td><font size=2><input type=TEXT size=20 maxlength=20 name=SuppReference VALUE="' . $_SESSION['SuppTrans']->SuppReference . '"></td>'; if (!isset($_SESSION['SuppTrans']->TranDate)){ $_SESSION['SuppTrans']->TranDate= Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))); } -echo '<td><font color=red>' . _('Credit Note Date') . ' (' . _('in format') . ' ' . $_SESSION['DefaultDateFormat'] . ") :</font></td> - <td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']. "' size=11 maxlength=10 name='TranDate' VALUE=" . $_SESSION['SuppTrans']->TranDate . '></td>'; -echo '<td><font color=red>' . _('Exchange Rate') . ":</font></td> - <td><input type=TEXT class='number' size=11 maxlength=10 name='ExRate' VALUE=" . $_SESSION['SuppTrans']->ExRate . '></td></tr>'; +echo '<td><font color=red>' . _('Credit Note Date') . ' (' . _('in format') . ' ' . $_SESSION['DefaultDateFormat'] . ') :</font></td> + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat']. '" size=11 maxlength=10 name="TranDate" VALUE="' . $_SESSION['SuppTrans']->TranDate . '"></td>'; +echo '<td><font color=red>' . _('Exchange Rate') . ':</font></td> + <td><input type=TEXT class="number" size=11 maxlength=10 name="ExRate" VALUE="' . $_SESSION['SuppTrans']->ExRate . '"></td></tr>'; echo '</table>'; echo '<br><div class="centre"><input type="submit" name="GRNS" VALUE="' . _('Purchase Orders') . '"> '; @@ -309,12 +309,12 @@ echo '<table cellpadding=2 class=selection> <tr><th colspan="6">' . _('Purchase Order Credits') . '</th></tr>'; - $TableHeader = "<tr><th>" . _('GRN') . "</th> - <th>" . _('Item Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Quantity') . '<br>' . _('Credited') . "</th> - <th>" . _('Price Credited') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . "</th> - <th>" . _('Line Total') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; + $TableHeader = '<tr><th>' . _('GRN') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity') . '<br>' . _('Credited') . '</th> + <th>' . _('Price Credited') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Line Total') . '<br>' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; echo $TableHeader; $TotalGRNValue=0; @@ -487,13 +487,15 @@ <td colspan=2 class=number><input type=TEXT size="12" maxlength="10" name="OvAmount" VALUE=' . number_format($_SESSION['SuppTrans']->OvAmount,2) . '></td></tr>'; } -echo "<tr><td colspan=2><input type=Submit name='ToggleTaxMethod'VALUE='" . _('Change Tax Calculation Method') . - "'></td><td><select name='OverRideTax' onChange='ReloadForm(form1.ToggleTaxMethod)'>"; +echo '<tr><td colspan=2><input type=Submit name="ToggleTaxMethod" VALUE="' . _('Change Tax Calculation Method') . + '"></td><td><select name="OverRideTax" onChange="ReloadForm(form1.ToggleTaxMethod)">'; if ($_POST['OverRideTax']=='Man'){ - echo "<option VALUE='Auto'>" . _('Automatic') . "<option selected VALUE='Man'>" . _('Manual Entry'); + echo '<option VALUE="Auto">' . _('Automatic') . '</option>'; + echo '<option selected VALUE="Man">' . _('Manual Entry') . '</option>'; } else { - echo "<option selected VALUE='Auto'>" . _('Automatic') . "<option VALUE='Man'>" . _('Manual Entry'); + echo '<option selected VALUE="Auto">' . _('Automatic') . '</option>'; + echo '<option VALUE="Man">' . _('Manual Entry') . '</option>'; } echo '</select></td></tr>'; @@ -554,7 +556,7 @@ echo '<table class=selection><tr><td><font color=red>' . _('Comments') . '</font></td><td><textarea name=Comments cols=40 rows=2>' . $_SESSION['SuppTrans']->Comments . '</textarea></td></tr></table>'; -echo "<p><div class='centre'><input type=submit name='PostCreditNote' VALUE='" . _('Enter Credit Note') . "'></div>"; +echo '<p><div class="centre"><input type=submit name="PostCreditNote" VALUE="' . _('Enter Credit Note') . '"></div>'; if (isset($_POST['PostCreditNote'])){ @@ -843,7 +845,7 @@ /*The cost adjustment is the price variance / the total quantity in stock - But that's only provided that the total quantity in stock is > the quantity charged on this invoice + But thats only provided that the total quantity in stock is greater than the quantity charged on this invoice If the quantity on hand is less the amount charged on this invoice then some must have been sold and the price variance on these must be written off to price variances*/ @@ -883,21 +885,23 @@ /*Now post any remaining price variance to stock rather than price variances */ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $StockGLCode['stockact'] . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Average Cost Adj') . - ' - ' . $EnteredGRN->ItemCode . ' x ' . $TotalQuantityOnHand . ' x ' . - number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', - '" . (-($PurchPriceVar - $WriteOffToVariances)) . "')"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( + 21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['stockact'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Average Cost Adj') . + ' - ' . $EnteredGRN->ItemCode . ' x ' . $TotalQuantityOnHand . ' x ' . + number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . (-($PurchPriceVar - $WriteOffToVariances)) . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -932,21 +936,23 @@ } else { //It must be Standard Costing $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $StockGLCode['purchpricevaract'] . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . - ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var of') . ' ' . - number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', - '" . (-$PurchPriceVar) . "')"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( + 21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $StockGLCode['purchpricevaract'] . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . + ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var of') . ' ' . + number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . (-$PurchPriceVar) . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -965,29 +971,31 @@ /*Need to get the asset details for posting */ $result = DB_query("SELECT costact - FROM fixedassets INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid= fixedassetcategories.categoryid - WHERE assetid='" . $EnteredGRN->AssetID . "'",$db); + FROM fixedassets INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid= fixedassetcategories.categoryid + WHERE assetid='" . $EnteredGRN->AssetID . "'",$db); $AssetRow = DB_fetch_array($result); $GLCode = $AssetRow['costact']; } //the item was an asset $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $GLCode . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . - $EnteredGRN->ItemDescription . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var') . - ' ' . number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', - '" . (-$PurchPriceVar) . "')"; + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES ( + 21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $GLCode . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . + $EnteredGRN->ItemDescription . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var') . + ' ' . number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + '" . (-$PurchPriceVar) . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); $DbgMsg = _('The following SQL to insert the GL transaction was used'); @@ -1005,14 +1013,15 @@ account, narrative, amount) - VALUES (21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . $_SESSION['SuppTrans']->GRNAct . "', - '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') .' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemCode . ' x ' . - $EnteredGRN->This_QuantityInv . ' @ ' . $_SESSION['SuppTrans']->CurrCode . $EnteredGRN->ChgPrice . ' @ ' . _('a rate of') . ' ' . $_SESSION['SuppTrans']->ExRate . "', - '" . round(-$EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv,2) / $_SESSION['SuppTrans']->ExRate . "' + VALUES ( + 21, + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['SuppTrans']->GRNAct . "', + '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') .' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemCode . ' x ' . + $EnteredGRN->This_QuantityInv . ' @ ' . $_SESSION['SuppTrans']->CurrCode . $EnteredGRN->ChgPrice . ' @ ' . _('a rate of') . ' ' . $_SESSION['SuppTrans']->ExRate . "', + '" . round(-$EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv,2) / $_SESSION['SuppTrans']->ExRate . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added because'); @@ -1117,10 +1126,10 @@ $SQL = "INSERT INTO supptranstaxes (supptransid, taxauthid, taxamount) - VALUES ( - '" . $SuppTransID . "', - '" . $TaxTotals->TaxAuthID . "', - '" . -$TaxTotals->TaxOvAmount . "')"; + VALUES ( + '" . $SuppTransID . "', + '" . $TaxTotals->TaxAuthID . "', + '" . -$TaxTotals->TaxOvAmount . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the supplier transaction taxes record was used:'); @@ -1153,17 +1162,18 @@ if (strlen($EnteredGRN->ShiptRef)>0 AND $EnteredGRN->ShiptRef!=0){ /* and insert the shipment charge records */ - $SQL = "INSERT INTO shipmentcharges (shiptref, + $SQL = "INSERT INTO shipmentcharges ( + shiptref, transtype, transno, stockid, value) - VALUES ( - '" . $EnteredGRN->ShiptRef . "', - 21, - '" . $CreditNoteNo . "', - '" . $EnteredGRN->ItemCode . "', - '" . round(-$EnteredGRN->This_QuantityInv * $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate,2) . "' + VALUES ( + '" . $EnteredGRN->ShiptRef . "', + '21', + '" . $CreditNoteNo . "', + '" . $EnteredGRN->ItemCode . "', + '" . round(-$EnteredGRN->This_QuantityInv * $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate,2) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment charge record for the shipment') . ' ' . $EnteredGRN->ShiptRef . ' ' . _('could not be added because'); @@ -1176,21 +1186,23 @@ if ($PurchPriceVar !=0){ /*Add the fixed asset trans for the difference in the cost */ $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ('" . $EnteredGRN->AssetID . "', - 21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'cost', - '" . -($PurchPriceVar) . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ( + '" . $EnteredGRN->AssetID . "', + '21', + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'cost', + '" . -($PurchPriceVar) . "' + )"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); @@ -1215,10 +1227,10 @@ value) VALUES ( '" . $ShiptChg->ShiptRef . "', - 21, + '21', '" . $CreditNoteNo . "', '" . (-$ShiptChg->Amount/$_SESSION['SuppTrans']->ExRate) . "' - )"; + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment charge record for the shipment') . ' ' . $ShiptChg->ShiptRef . ' ' . _('could not be added because'); $DbgMsg = _('The following SQL to insert the Shipment charge record was used'); @@ -1264,29 +1276,31 @@ /* First the fixed asset transaction */ $SQL = "INSERT INTO fixedassettrans (assetid, - transtype, - transno, - transdate, - periodno, - inputdate, - fixedassettranstype, - amount) - VALUES ('" . $AssetAddition->AssetID . "', - 21, - '" . $CreditNoteNo . "', - '" . $SQLCreditNoteDate . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - 'cost', - '" . (-$AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . "')"; + transtype, + transno, + transdate, + periodno, + inputdate, + fixedassettranstype, + amount) + VALUES ( + '" . $AssetAddition->AssetID . "', + '21', + '" . $CreditNoteNo . "', + '" . $SQLCreditNoteDate . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + 'cost', + '" . (-$AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . "' + )"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); /*Now update the asset cost in fixedassets table */ $SQL = "UPDATE fixedassets - SET cost = cost - " . ($AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . " - WHERE assetid = '" . $AssetAddition->AssetID . "'"; + SET cost = cost - " . ($AssetAddition->Amount / $_SESSION['SuppTrans']->ExRate) . " + WHERE assetid = '" . $AssetAddition->AssetID . "'"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost was not able to be updated because:'); $DbgMsg = _('The following SQL was used to attempt the update of the asset cost:'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2011-04-10 15:29:34 UTC (rev 5164) +++ trunk/SupplierInvoice.php 2011-04-10 18:13:50 UTC (rev 5165) @@ -697,7 +697,7 @@ } foreach ($_SESSION['SuppTrans']->Assets as $AssetAddition){ - /* only the GL entries if the creditors->GL integration is enabled */ + /* only the GL entries if the creditors/GL integration is enabled */ $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -721,7 +721,7 @@ foreach ($_SESSION['SuppTrans']->Contracts as $Contract){ - /*contract postings need to get the WIP from the contract item's stock category record + /*contract postings need to get the WIP from the contract items stock category record * debit postings to this WIP account * the WIP account is tidied up when the contract is closed*/ $result = DB_query("SELECT wipact FROM stockcategory @@ -822,7 +822,7 @@ echo '<br>Total Qty On hand = ' . $TotalQuantityOnHand; /*The cost adjustment is the price variance / the total quantity in stock - But that's only provided that the total quantity in stock is > the quantity charged on this invoice + But that is only provided that the total quantity in stock is greater than the quantity charged on this invoice If the quantity on hand is less the amount charged on this invoice then some must have been sold and the price variance on these must be written off to price variances*/ Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2011-04-10 15:29:34 UTC (rev 5164) +++ trunk/SupplierTenderCreate.php 2011-04-10 18:13:50 UTC (rev 5165) @@ -381,7 +381,7 @@ echo '<tr><td>' . $Supplier->SupplierCode . '</td>'; echo '<td>' . $Supplier->SupplierName . '</td>'; echo '<td>' . $Supplier->EmailAddress . '</td>'; - echo "<td><a href='" . $_SERVER['PHP_SELF'] . "?" . SID . "DeleteSupplier=" . $Supplier->SupplierCode . "'>" . _('Delete') . "</a></td></tr>"; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteSupplier=' . $Supplier->SupplierCode . '">' . _('Delete') . '</a></td></tr>'; } echo '</table></td>'; /* Item Details @@ -408,7 +408,7 @@ echo '<td>'.$LineItems->ItemDescription.'</td>'; echo '<td class="number">' . number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'</td>'; echo '<td>'.$LineItems->Units.'</td>'; - echo "<td><a href='" . $_SERVER['PHP_SELF'] . "?" . SID . "DeleteItem=" . $LineItems->LineNo . "'>" . _('Delete') . "</a></td></tr>"; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteItem=' . $LineItems->LineNo . '">' . _('Delete') . '</a></td></tr>'; echo '</tr>'; } } @@ -488,28 +488,28 @@ } if (isset($_POST['Suppliers'])) { - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . ' method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Suppliers') . '</p> <table cellpadding=3 colspan=4 class=selection><tr><td>' . _('Enter a partial Name') . ':</font></td><td>'; if (isset($_POST['Keywords'])) { - echo "<input type='Text' name='Keywords' value='" . $_POST['Keywords'] . "' size=20 maxlength=25>"; + echo '<input type="Text" name="Keywords" value="' . $_POST['Keywords'] . '" size=20 maxlength=25>'; } else { - echo "<input type='Text' name='Keywords' size=20 maxlength=25>"; + echo '<input type="Text" name="Keywords" size=20 maxlength=25>'; } echo '</td><td><b>' . _('OR') . '</b></font></td><td>' . _('Enter a partial Code') . ':</font></td><td>'; if (isset($_POST['SupplierCode'])) { - echo "<input type='Text' name='SupplierCode' value='" . $_POST['SupplierCode'] . "' size=15 maxlength=18>"; + echo '<input type="text" name="SupplierCode" value="' . $_POST['SupplierCode'] . '" size=15 maxlength=18>'; } else { - echo "<input type='Text' name='SupplierCode' size=15 maxlength=18>"; + echo '<input type="Text" name="SupplierCode" size=15 maxlength=18>'; } - echo "</td></tr></table><br><div class='centre'><input type=submit name='SearchSupplier' value='" . _('Search Now') . "'></div>"; + echo '</td></tr></table><br><div class="centre"><input type=submit name="SearchSupplier" value="' . _('Search Now') . '"></div>'; echo '</form>'; } if (isset($_POST['SearchSupplier'])) { - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . ' method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $ListCount = DB_num_rows($result); $ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax']); @@ -524,7 +524,7 @@ } } if ($ListPageMax > 1) { - echo "<p> " . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<p> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; echo '<select name="PageOffset">'; $ListPage = 1; while ($ListPage <= $ListPageMax) { @@ -541,18 +541,18 @@ <input type=submit name="Next" value="' . _('Next') . '">'; echo '<p>'; } - echo "<input type=hidden name='Search' value='" . _('Search Now') . "'>"; + echo '<input type=hidden name="Search" value="' . _('Search Now') . '">'; echo '<br><br>'; - echo '<br><table cellpadding=2 colspan=7'; - $tableheader = "<tr> - <th>" . _('Code') . "</th> - <th>" . _('Supplier Name') . "</th> - <th>" . _('Currency') . "</th> - <th>" . _('Address 1') . "</th> - <th>" . _('Address 2') . "</th> - <th>" . _('Address 3') . "</th> - <th>" . _('Address 4') . "</th> - </tr>"; + echo '<br><table cellpadding=2 colspan=7>'; + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Address 1') . '</th> + <th>' . _('Address 2') . '</th> + <th>' . _('Address 3') . '</th> + <th>' . _('Address 4') . '</th> + </tr>'; echo $tableheader; $j = 1; $k = 0; //row counter to determine background colour @@ -568,14 +568,14 @@ echo '<tr class="OddTableRows">'; $k = 1; } - echo "<td><input type=submit name='SelectedSupplier' value='".$myrow['supplierid']."'</td> - <td>".$myrow['suppname']."</td> - <td>".$myrow['currcode']."</td> - <td>".$myrow['address1']."</td> - <td>".$myrow['address2']."</td> - <td>".$myrow['address3']."</td> - <td>".$myrow['address4']."</td> - </tr>"; + echo '<td><input type=submit name="SelectedSupplier" value="'.$myrow['supplierid'].'" /></td> + <td>'.$myrow['suppname'].'</td> + <td>'.$myrow['currcode'].'</td> + <td>'.$myrow['address1'].'</td> + <td>'.$myrow['address2'].'</td> + <td>'.$myrow['address3'].'</td> + <td>'.$myrow['address4'].'</td> + </tr>'; $RowIndex = $RowIndex + 1; //end of page full new headings if } @@ -607,16 +607,16 @@ if (!isset($_POST['StockCat'])) { $_POST['StockCat'] = ""; } - if ($_POST['StockCat'] == "All") { - echo '<option selected value="All">' . _('All'); + if ($_POST['StockCat'] == 'All') { + echo '<option selected value="All">' . _('All') . '</option>'; } else { - echo '<option value="All">' . _('All'); + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result)) { if ($myrow1['categoryid'] == $_POST['StockCat']) { - echo '<option selected VALUE="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option selected VALUE="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } } echo '</select>'; @@ -641,7 +641,7 @@ } if (isset($_POST['Search'])){ /*ie seach for stock items */ - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . "?" . SID . ">"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items required on this tender').'</p>'; @@ -754,15 +754,15 @@ if (isset($SearchResult)) { - echo "<table cellpadding=1 colspan=7>"; + echo '<table cellpadding=1 colspan=7>'; - $tableheader = "<tr> - <th>" . _('Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('Units') . "</th> - <th>" . _('Image') . "</th> - <th>" . _('Quantity') . "</th> - </tr>"; + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; echo $tableheader; $j = 1; @@ -790,13 +790,13 @@ $uom=$myrow['units']; - echo "<td>".$myrow['stockid']."</td> - <td>".$myrow['description']."</td> - <td>".$uom."</td> - <td>".$ImageSource."</td> - <td><input class='number' type='text' size=6 value=0 name='qty".$myrow['stockid']."'></td> - <input type='hidden' size=6 value=".$uom." name='uom".$myrow['stockid']."'> - </tr>"; + echo '<td>'.$myrow['stockid'].'</td> + <td>'.$myrow['description'].'</td> + <td>'.$uom.'</td> + <td>'.$ImageSource.'</td> + <td><input class="number" type="text" size=6 value=0 name="qty"'.$myrow['stockid'].'"></td> + <input type="hidden" size=6 value="'.$uom.'" name="uom"'.$myrow['stockid'].'"> + </tr>'; $PartsDisplayed++; if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2011-04-10 15:29:34 UTC (rev 5164) +++ trunk/Suppliers.php 2011-04-10 18:13:50 UTC (rev 5165) @@ -342,7 +342,7 @@ } if (ContainsIllegalCharacters($SupplierID)) { $InputError = 1; - prnMsg(_('The supplier code cannot contain any of the following characters') . " - . ' & + \" \\" . ' ' ._('or a space'),'error'); + prnMsg(_('The supplier code cannot contain any of the illegal characters') ,'error'); $Errors[$i]='ID'; $i++; } @@ -405,22 +405,22 @@ $row = DB_fetch_array($resultgeo); $api_key = $row['geocode_key']; $map_host = $row['map_host']; - define("MAPS_HOST", $map_host); - define("KEY", $api_key); + define('MAPS_HOST', $map_host); + define('KEY', $api_key); // check that some sane values are setup already in geocode tables, if not skip the geocoding but add the record anyway. if ($map_host=="") { echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; } else { - $address = $_POST["Address1"] . ", " . $_POST["Address2"] . ", " . $_POST["Address3"] . ", " . $_POST["Address4"]; + $address = $_POST['Address1'] . ', ' . $_POST['Address2'] . ', ' . $_POST['Address3'] . ', ' . $_POST['Address4']; - $base_url = "http://" . MAPS_HOST . "/maps/geo?output=xml" . "&key=" . KEY; - $request_url = $base_url . "&q=" . urlencode($address); + $base_url = 'http://' . MAPS_HOST . '/maps/geo?output=xml' . '&key=' . KEY; + $request_url = $base_url . '&q=' . urlencode($address); - $xml = simplexml_load_string(utf8_encode(file_get_contents($request_url))) or die("url not loading"); + $xml = simplexml_load_string(utf8_encode(file_get_contents($request_url))) or die('url not loading'); // $xml = simplexml_load_file($request_url) or die("url not loading"); $coordinates = $xml->Response->Placemark->Point->coordinates; - $coordinatesSplit = explode(",", $coordinates); + $coordinatesSplit = explode(',', $coordinates); // Format: Longitude, Latitude, Altitude $latitude = $coordinatesSplit[1]; $longitude = $coordinatesSplit[0]; @@ -437,8 +437,8 @@ } else { // failure to geocode $geocode_pending = false; - echo "<p>Address: " . $address . " failed to geocode.\n"; - echo "Received status " . $status . "\n</p>"; + echo '<p>Address: ' . $address . ' failed to geocode'."\n"; + echo 'Received status ' . $status . "\n" . '</p>'; } } } @@ -647,47 +647,48 @@ /*If the page was called without $SupplierID passed to page then assume a new supplier is to be entered show a form with a Supplier Code field other wise the form showing the fields with the existing entries against the supplier will show for editing with only a hidden SupplierID field*/ - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "?" . SID . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type='hidden' name='New' VALUE='Yes'>"; + echo '<input type="hidden" name="New" VALUE="Yes">'; echo '<table class=selection>'; - echo '<tr><td>' . _('Supplier Code') . ":</td><td><input type='text' name='SupplierID' size=11 maxlength=10></td></tr>"; - echo '<tr><td>' . _('Supplier Name') . ":</td><td><input type='text' name='SuppName' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 1 (Street)') . ":</td><td><input type='text' name='Address1' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ":</td><td><input type='text' name='Address2' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 3 (State/Province)') . ":</td><td><input type='text' name='Address3' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ":</td><td><input type='text' name='Address4' size=42 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Telephone') . ":</td><td><input type='text' name='Phone' size=30 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Facsimile') . ":</td><td><input type='text' name='Fax' size=30 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Email Address') . ":</td><td><input type='text' name='Email' size=30 maxlength=40></td></tr>"; - echo '<tr><td>' . _('Supplier Type') . ":</td><td><select name='SupplierType'>"; + echo '<tr><td>' . _('Supplier Code') . ':</td><td><input type="text" name="SupplierID" size=11 maxlength=10></td></tr>'; + echo '<tr><td>' . _('Supplier Name') . ':</td><td><input type="text" name="SuppName" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td><td><input type="text" name="Address1" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td><td><input type="text" name="Address2" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td><td><input type="text" name=2Address3" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td><td><input type="text" name="Address4" size=42 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Telephone') . ':</td><td><input type="text" name="Phone" size=30 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Facsimile') . ':</td><td><input type="text" name="Fax" size=30 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Email Address') . ':</td><td><input type="text" name="Email" size=30 maxlength=40></td></tr>'; + echo '<tr><td>' . _('Supplier Type') . ':</td><td><select name="SupplierType">'; $result=DB_query("SELECT typeid, typename FROM suppliertype", $db); while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='". $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option VALUE="'. $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } //end while loop - echo "</select></td></tr>"; + echo '</select></td></tr>'; $DateString = Date($_SESSION['DefaultDateFormat']); - echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] . "):</td><td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='SupplierSince' VALUE=$DateString size=12 maxlength=10></td></tr>"; - echo '<tr><td>' . _('Bank Particulars') . ":</td><td><input type='text' name='BankPartics' size=13 maxlength=12></td></tr>"; - echo '<tr><td>' . _('Bank reference') . ":</td><td><input type='text' name='BankRef' VALUE=0 size=13 maxlength=12></td></tr>"; - echo '<tr><td>' . _('Bank Account No') . ":</td><td><input type='text' name='BankAct' size=31 maxlength=30></td></tr>"; + echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td><td><input type="text" class="date2 alt="'. + $_SESSION['DefaultDateFormat'].'" name="SupplierSince2 VALUE="' . $DateString . '" size=12 maxlength=10></td></tr>'; + echo '<tr><td>' . _('Bank Particulars') . ':</td><td><input type="text" name=2BankPartics" size=13 maxlength=12></td></tr>'; + echo '<tr><td>' . _('Bank reference') . ':</td><td><input type="text" name="BankRef" VALUE=0 size=13 maxlength=12></td></tr>'; + echo '<tr><td>' . _('Bank Account No') . ':</td><td><input type="text" name="BankAct" size=31 maxlength=30></td></tr>'; $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db); - echo '<tr><td>' . _('Payment Terms') . ":</td><td><select name='PaymentTerms'>"; + echo '<tr><td>' . _('Payment Terms') . ':</td><td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { - echo "<option VALUE='". $myrow['termsindicator'] . "'>" . $myrow['terms']; + echo '<option VALUE="'. $myrow['termsindicator'] . '">' . $myrow['terms'] . '</option>'; } //end while loop DB_data_seek($result, 0); echo '</select></td></tr>'; $result=DB_query("SELECT id, coyname FROM factorcompanies", $db); - echo '<tr><td>' . _('Factor Company') . ":</td><td><select name='FactorID'>"; + echo '<tr><td>' . _('Factor Company') . ':</td><td><select name="FactorID">'; echo '<option VALUE=0>' . _('None'); while ($myrow = DB_fetch_array($result)) { if (isset($_POST['FactorID']) and $_POST['FactorID'] == $myrow['id']){ @@ -698,7 +699,7 @@ } //end while loop DB_data_seek($result, 0); echo '</select></td></tr>'; - echo '<tr><td>' . _('Tax Reference') . ":</td><td><input type='text' name='TaxRef' size=21 maxlength=20></td></tr>"; + echo '<tr><td>' . _('Tax Reference') . ':</td><td><input type="text" name=2TaxRef" size=21 maxlength=20></td></tr>'; $result=DB_query("SELECT currency, currabrev FROM currencies", $db); if (!isset($_POST['CurrCode'])){ @@ -707,23 +708,23 @@ $_POST['CurrCode'] = $myrow[0]; } - echo '<tr><td>' . _("Supplier Currency") . ":</td><td><select name='CurrCode'>"; + echo '<tr><td>' . _('Supplier Currency') . ':</td><td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode'] == $myrow['currabrev']){ - echo '<option selected VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option selected VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } else { - echo '<option VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } } //end while loop DB_data_seek($result, 0); - echo '</select></td></tr><tr><td>' . _('Remittance Advice') . ":</td><td><select name='Remittance'>"; - echo '<option VALUE=0>' . _('Not Required'); - echo '<option VALUE=1>' . _('Required'); + echo '</select></td></tr><tr><td>' . _('Remittance Advice') . ':</td><td><select name="Remittance">'; + echo '<option VALUE=0>' . _('Not Required') . '</option>'; + echo '<option VALUE=1>' . _('Required') . '</option>'; echo '</select></td></tr>'; - echo '<tr><td>' . _('Tax Group') . ":</td><td><select name='TaxGroup'>"; + echo '<tr><td>' . _('Tax Group') . ':</td><td><select name="TaxGroup">'; DB_data_seek($result, 0); @@ -732,13 +733,13 @@ while ($myrow = DB_fetch_array($result)) { if (isset($_POST['TaxGroup']) and $_POST['TaxGroup'] == $myrow['taxgroupid']){ - echo '<option selected VALUE=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription']; + echo '<option selected VALUE=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; } else { - echo '<option VALUE=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription']; + echo '<option VALUE=' . $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription'] . '</option>'; } } //end while loop - echo "</select></td></tr></table><p><div class='centre'><input type='Submit' name='submit' VALUE='" . _('Insert New Supplier') . "'>"; + echo '</select></td></tr></table><p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Insert New Supplier') . '">'; echo '</div></form>'; } else { @@ -796,11 +797,11 @@ $_POST['FactorID'] = $myrow['factorcompanyid']; $_POST['TaxRef'] = $myrow['taxref']; - echo "<input type=hidden name='SupplierID' VALUE='$SupplierID'>"; + echo '<input type=hidden name="SupplierID" VALUE="' . $SupplierID . '">'; } else { // its a new supplier being added - echo "<input type=hidden name='New' VALUE='Yes'>"; + echo '<input type=hidden name="New" VALUE="Yes">'; echo '<tr><td>' . _('Supplier Code') . ':</td><td><input '.(in_array('ID',$Errors) ? 'class="inputerror"' : '').' type="text" name="SupplierID" VALUE="' . $SupplierID . '" size=12 maxlength=10></td></tr>'; } @@ -812,75 +813,75 @@ echo '<tr><td>' . _('Telephone') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Phone" VALUE="' . $_POST['Phone'] . '" size=42 maxlength=40></td></tr>'; echo '<tr><td>' . _('Facsimile') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Fax" VALUE="' . $_POST['Fax'] . '" size=42 maxlength=40></td></tr>'; echo '<tr><td>' . _('Email Address') . ':</td><td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Email" VALUE="' . $_POST['Email'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Supplier Type') . ":</td><td><select name='SupplierType'>"; + echo '<tr><td>' . _('Supplier Type') . ':</td><td><select name="SupplierType">'; $result=DB_query("SELECT typeid, typename FROM suppliertype", $db); while ($myrow = DB_fetch_array($result)) { if ($_POST['SupplierType']==$myrow['typeid']) { - echo "<option selected value='". $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option selected value="'. $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } else { - echo "<option value='". $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option value="'. $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } //end while loop - echo "</select></td></tr>"; + echo '</select></td></tr>'; echo '<tr><td>' . _('Supplier Since') . ' (' . $_SESSION['DefaultDateFormat'] .'):</td><td><input '.(in_array('SupplierSince',$Errors) ? 'class="inputerror"' : '').' size=12 maxlength=10 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="SupplierSince" VALUE=' . $_POST['SupplierSince'] . '></td></tr>'; - echo '<tr><td>' . _('Bank Particulars') . ":</td><td><input type='text' name='BankPartics' size=13 maxlength=12 VALUE='" . $_POST['BankPartics'] . "'></td></tr>"; + echo '<tr><td>' . _('Bank Particulars') . ':</td><td><input type="text" name="BankPartics" size=13 maxlength=12 VALUE="' . $_POST['BankPartics'] . '"></td></tr>'; echo '<tr><td>' . _('Bank Reference') . ':</td><td><input '.(in_array('BankRef',$Errors) ? 'class="inputerror"' : '').' type="text" name="BankRef" size=13 maxlength=12 VALUE="' . $_POST['BankRef'] . '"></td></tr>'; - echo '<tr><td>' . _('Bank Account No') . ":</td><td><input type='text' name='BankAct' size=31 maxlength=30 VALUE='" . $_POST['BankAct'] . "'></td></tr>"; + echo '<tr><td>' . _('Bank Account No') . ':</td><td><input type="text" name="BankAct" size=31 maxlength=30 VALUE="' . $_POST['BankAct'] . '"></td></tr>'; $result=DB_query("SELECT terms, termsindicator FROM paymentterms", $db); - echo '<tr><td>' . _('Payment Terms') . ":</td><td><select name='PaymentTerms'>"; + echo '<tr><td>' . _('Payment Terms') . ':</td><td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['PaymentTerms'] == $myrow['termsindicator']){ - echo '<option selected VALUE=' . $myrow['termsindicator'] . '>' . $myrow['terms']; + echo '<option selected VALUE=' . $myrow['termsindicator'] . '>' . $myrow['terms'] . '</option>'; } else { - echo '<option VALUE=' . $myrow['termsindicator'] . '>' . $myrow['terms']; + echo '<option VALUE=' . $myrow['termsindicator'] . '>' . $myrow['terms'] . '</option>'; } } //end while loop DB_data_seek($result, 0); $result=DB_query("SELECT id, coyname FROM factorcompanies", $db); - echo '<tr><td>' . _('Factor Company') . ":</td><td><select name='FactorID'>"; - echo '<option VALUE=0>' . _('None'); + echo '<tr><td>' . _('Factor Company') . ':</td><td><select name="FactorID">'; + echo '<option VALUE=0>' . _('None') . '</option>'; while ($myrow = DB_fetch_array($result)) { if ($_POST['FactorID'] == $myrow['id']){ - echo '<option selected VALUE=' . $myrow['id'] . '>' . $myrow['coyname']; + echo '<option selected VALUE=' . $myrow['id'] . '>' . $myrow['coyname'] . '</option>'; } else { - echo '<option VALUE=' . $myrow['id'] . '>' . $myrow['coyname']; + echo '<option VALUE=' . $myrow['id'] . '>' . $myrow['coyname'] . '</option>'; } } //end while loop DB_data_seek($result, 0); - echo '<tr><td>' . _('Tax Reference') . ":</td><td><input type='text' name='TaxRef' size=21 maxlength=20 VALUE='".$_POST['TaxRef']."'></td></tr>"; + echo '<tr><td>' . _('Tax Reference') . ':</td><td><input type="text" name="TaxRef" size=21 maxlength=20 VALUE="'.$_POST['TaxRef'].'"></td></tr>'; $result=DB_query("SELECT currency, currabrev FROM currencies", $db); - echo '</select></td></tr><tr><td>' . _('Supplier Currency') . ":</td><td><select name='CurrCode'>"; + echo '</select></td></tr><tr><td>' . _('Supplier Currency') . ':</td><td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode'] == $myrow['currabrev']){ - echo '<option selected VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option selected VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } else { - echo '<option VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency']; + echo '<option VALUE=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } } //end while loop DB_data_seek($result, 0); - echo '</select></td></tr><tr><td>' . _('Remittance Advice') . ":</td><td><select name='Remittance'>"; + echo '</select></td></tr><tr><td>' . _('Remittance Advice') . ':</td><td><select name="Remittance">'; if ($_POST['Remittance'] == 0){ - echo '<option selected VALUE=0>' . _('Not Required'); - echo '<option VALUE=1>' . _('Required'); + echo '<option selected VALUE=0>' . _('Not Required') . '</option>'; + echo '<option VALUE=1>' . _('Required') . '</option>'; } else { - echo '<option VALUE=0>' . _('Not Required'); - echo '<option selected VALUE=1>' . _('Required'); + echo '<option VALUE=0>' . _('Not Required') . '</option>'; + echo '<option selected VALUE=1>' . _('Required') . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Tax Group') . ":</td><td><select name='TaxGroup'>"; + echo '<tr><td>' . _('Tax Group') . ':</td><td><select name="TaxGroup">'; DB_data_seek($result, 0); @@ -889,24 +890,23 @@ while ($myrow = DB_fetch_array($result)) { if ($myrow['taxgroupid'] == $_POST['TaxGroup']) { - echo '<option selected VALUE='; + echo '<option selected VALUE="'.$myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; } else { - echo '<option VALUE='; + echo '<option VALUE="' . $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>'; } - echo $myrow['taxgroupid'] . '>' . $myrow['taxgroupdescription']; } //end while loop echo '</select></td></tr></table>'; if (isset($_POST['New'])) { - echo "<p><div class='centre'>><input type='Submit' name='submit' VALUE='" . _('Add These New Supplier Details') . "'></form>"; + echo '<p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Add These New Supplier Details') . '"></form>'; } else { - echo "<br><p><div class='centre'><input type='Submit' name='submit' VALUE='" . _('Update Supplier') . "'></div><br>"; + echo '<br><p><div class="centre"><input type="Submit" name="submit" VALUE="' . _('Update Supplier') . '"></div><br>'; // echo '<p><font color=red><b>' . _('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed') . '<br></font></b>'; prnMsg(_('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed'), 'Warn'); - echo "<br><div class=centre><input type='Submit' name='delete' VALUE='" . _('Delete Supplier') . "' onclick=\"return confirm('" . _('Are you sure you wish to delete this supplier?') . "');\"></form>"; - echo "<br><a href='$rootpath/SupplierContacts.php?" . SID . "SupplierID=$SupplierID'>" . _('Review Contact Details') . '</a></div>'; + echo '<br><div class=centre><input type="submit" name="delete" VALUE="' . _('Delete Supplier') . '" onclick=\"return confirm(\'' . _('Are you sure you wish to delete this supplier?') . '\');\"></form>'; + echo '<br><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $SupplierID . '">' . _('Review Contact Details') . '</a></div>'; } echo '</div>'; } // end of main ifs Deleted: trunk/SystemCheck.php =================================================================== --- trunk/SystemCheck.php 2011-04-10 15:29:34 UTC (rev 5164) +++ trunk/SystemCheck.php 2011-04-10 18:13:50 UTC (rev 5165) @@ -1,70 +0,0 @@ -<?php -/* $Id$*/ -//$PageSecurity =10; -include('includes/session.inc'); -$title = _('System Check'); -include('includes/header.inc'); - -/* parse php modules from phpinfo */ -function parsePHPModules() { - ob_start(); - phpinfo(INFO_MODULES); - $s = ob_get_contents(); - ob_end_clean(); - - $s = strip_tags($s,'<h2><th><td>'); - $s = preg_replace('/<th[^>]*>([^<]+)<\/th>/',"<info>\\1</info>",$s); - $s = preg_replace('/<td[^>]*>([^<]+)<\/td>/',"<info>\\1</info>",$s); - $vTmp = preg_split('/(<h2[^>]*>[^<]+<\/h2>)/',$s,-1,PREG_SPLIT_DELIM_CAPTURE); - $vModules = array(); - for ($i=1;$i<count($vTmp);$i++) { - if (preg_match('/<h2[^>]*>([^<]+)<\/h2>/',$vTmp[$i],$vMat)) { - $vName = trim($vMat[1]); - $vTmp2 = explode("\n",$vTmp[$i+1]); - foreach ($vTmp2 AS $vOne) { - $vPat = '<info>([^<]+)<\/info>'; - $vPat3 = "/$vPat\s*$vPat\s*$vPat/"; - $vPat2 = "/$vPat\s*$vPat/"; - if (preg_match($vPat3,$vOne,$vMat)) { // 3cols - $vModules[$vName][trim($vMat[1])] = array(trim($vMat[2]),trim($vMat[3])); - } elseif (preg_match($vPat2,$vOne,$vMat)) { // 2cols - $vModules[$vName][trim($vMat[1])] = trim($vMat[2]); - } - } - } - } - return $vModules; -} - -/** get a module setting */ -function getModuleSetting($pModuleName,$pSetting) { - $vModules = parsePHPModules(); - return $vModules[$pModuleName][$pSetting]; -} -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('System Check') . '" alt="" />' . ' ' . _('System Check') . '</p>'; -echo '<div class="system_check">'; -echo '<h3>PHP Settings</h3>'; -echo '<p>PHP version: ' . phpversion(); -echo '<p>GD Module: ' . getModuleSetting('gd','GD Version') . '</p>'; -echo '<p>MYSQL Module: ' . getModuleSetting('mysql','Client API version') . '</p>'; -echo '<p>MySQL character set: '.mysql_client_encoding(); -echo '<p>Zlib: ' . getModuleSetting('zlib','ZLib Support') . '</p>'; -echo '<p>Simple XML: ' . getModuleSetting('SimpleXML','Revision') . '</p>'; -echo '<h3>Linux System Settings</h3>'; -ob_start(); -echo "<p><b>Memory Free</b></br>"; -passthru('free'); -echo "<p><b>CPU type</b></br>"; -passthru('cat /proc/cpuinfo | grep "model name" '); -echo "<p><b>Disk Space Free</b><br>"; -system('df'); -echo "<p><b>webERP Disk Space Usage</b><br>"; -system('du -sh'); -echo "<p>"; -$fr= ob_get_contents(); -ob_end_clean(); - -echo '<pre>' . $fr . '</pre>'; - -include('includes/footer.inc'); -?> Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-04-10 15:29:34 UTC (rev 5164) +++ trunk/WorkOrderEntry.php 2011-04-10 18:13:50 UTC (rev 5165) @@ -158,7 +158,7 @@ prnMsg (_('There are no products available meeting the criteria specified'),'info'); if ($debug==1){ - prnMsg(_('The SQL statement used was') . ':<br>' . $SQL,'info'); + prnMsg(_('The SQL statement used was') . ':<br />' . $SQL,'info'); } } if (DB_num_rows($SearchResult)==1){ @@ -253,8 +253,8 @@ if (isset($_POST['submit'])) { //The update button has been clicked echo '<div class=centre><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Enter a new work order') . '</a>'; - echo '<br><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing work order') . '</a>'; - echo '<br><a href="'. $rootpath . '/WorkOrderCosting.php&WO=' . $_REQUEST['WO'] . '">' . _('Go to Costing'). '</a></div>'; + echo '<br /><a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select an existing work order') . '</a>'; + echo '<br /><a href="'. $rootpath . '/WorkOrderCosting.php&WO=' . $_REQUEST['WO'] . '">' . _('Go to Costing'). '</a></div>'; $Input_Error = false; //hope for the best for ($i=1;$i<=$_POST['NumberOfOutputs'];$i++){ @@ -283,11 +283,13 @@ if ($QtyRecd==0){ //can only change factory location if Qty Recd is 0 $sql[] = "UPDATE workorders SET requiredby='" . $SQL_ReqDate . "', + startdate='" . FormatDateForSQL($_POST['StartDate']) . "', loccode='" . $_POST['StockLocation'] . "' WHERE wo='" . $_POST['WO'] . "'"; } else { prnMsg(_('The factory where this work order is made can only be updated if the quantity received on all output items is 0'),'warn'); - $sql[] = "UPDATE workorders SET requiredby='" . $SQL_ReqDate . "' + $sql[] = "UPDATE workorders SET requiredby='" . $SQL_ReqDate . "', + startdate='" . FormatDateForSQL($_POST['StartDate']) . "' WHERE wo='" . $_POST['WO'] . "'"; } @@ -329,7 +331,7 @@ //run the SQL from either of the above possibilites $ErrMsg = _('The work order could not be added/updated'); foreach ($sql as $sql_stmt){ - // echo '<br>' . $sql_stmt; + // echo '<br />' . $sql_stmt; $result = DB_query($sql_stmt,$db,$ErrMsg); } @@ -396,7 +398,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<br><table class=selection>'; +echo '<br /><table class=selection>'; $sql="SELECT workorders.loccode, requiredby, @@ -470,10 +472,9 @@ $_POST['StartDate'] = Date($_SESSION['DefaultDateFormat']); } -echo '<input type="hidden" name="StartDat... [truncated message content] |