|
From: <rc...@us...> - 2015-05-10 20:53:05
|
Revision: 7299
http://sourceforge.net/p/web-erp/reponame/7299
Author: rchacon
Date: 2015-05-10 20:53:03 +0000 (Sun, 10 May 2015)
Log Message:
-----------
Minor changes: clean up code.
Modified Paths:
--------------
trunk/CustomerBranches.php
trunk/DeliveryDetails.php
trunk/Locations.php
trunk/StockLocTransferReceive.php
trunk/StockTransfers.php
trunk/Z_ChangeGLAccountCode.php
trunk/Z_ChangeLocationCode.php
Modified: trunk/CustomerBranches.php
===================================================================
--- trunk/CustomerBranches.php 2015-05-10 18:10:27 UTC (rev 7298)
+++ trunk/CustomerBranches.php 2015-05-10 20:53:03 UTC (rev 7299)
@@ -4,7 +4,7 @@
include('includes/session.inc');
$Title = _('Customer Branches');// Screen identification.
-$ViewTopic= 'AccountsReceivable';// Filename's id in ManualContents.php's TOC.
+$ViewTopic = 'AccountsReceivable';// Filename's id in ManualContents.php's TOC.
$BookMark = 'NewCustomerBranch';// Anchor's id in the manual's html document.
include('includes/header.inc');
@@ -362,7 +362,7 @@
}
}
}
- } //end ifs to test if the branch can be deleted
+ }//end ifs to test if the branch can be deleted
}
if(!isset($SelectedBranch)) {
@@ -601,7 +601,7 @@
<td>' . $_POST['BranchCode'] . '</td>
</tr>';
- } else { //end of if $SelectedBranch only do the else when a new record is being entered
+ } else {//end of if $SelectedBranch only do the else when a new record is being entered
/* SETUP ANY $_GET VALUES THAT ARE PASSED. This really is just used coming from the Customers.php when a new customer is created.
Maybe should only do this when that page is the referrer?
@@ -765,12 +765,12 @@
}
echo $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>';
- } //end while loop
+ }//end while loop
echo '</select></td>
</tr>';
- // DB_data_seek($result,0); //by thumb
+ // DB_data_seek($result,0);//by thumb
}
$SQL = "SELECT areacode, areadescription FROM areas";
$result = DB_query($SQL);
@@ -793,14 +793,13 @@
}
echo $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>';
- } //end while loop
+ }//end while loop
echo '</select></td>
</tr>';
DB_data_seek($result,0);
-// BEGIN: **********************************************************************
$SQL = "SELECT locations.loccode, locationname
FROM locations
INNER JOIN locationusers
@@ -831,7 +830,6 @@
echo $myrow['loccode'], '">', $myrow['locationname'], '</option>';
}// End while loop.
-// END: ************************************************************************
echo '</select></td>
</tr>
@@ -856,7 +854,7 @@
}
echo '<tr>
<td>' . (($_POST['Email']) ? '<a href="Mailto:'.$_POST['Email'].'">' . _('Email').':</a>' : _('Email').':') . '</td>';
- //only display email link if there is an email address
+ //only display email link if there is an email address
echo '<td><input tabindex="18" type="email" name="Email" placeholder="e.g. ex...@do..." size="56" maxlength="55" value="'. $_POST['Email'].'" /></td>
</tr>';
@@ -883,7 +881,7 @@
}
echo $myrow['taxgroupid'] . '">' . $myrow['taxgroupdescription'] . '</option>';
- } //end while loop
+ }//end while loop
echo '</select></td>
</tr>
@@ -997,7 +995,7 @@
</div>
</form>';
-} //end if record deleted no point displaying form to add record
+}//end if record deleted no point displaying form to add record
include('includes/footer.inc');
?>
\ No newline at end of file
Modified: trunk/DeliveryDetails.php
===================================================================
--- trunk/DeliveryDetails.php 2015-05-10 18:10:27 UTC (rev 7298)
+++ trunk/DeliveryDetails.php 2015-05-10 20:53:03 UTC (rev 7299)
@@ -44,7 +44,7 @@
if(isset($_POST['ProcessOrder']) OR isset($_POST['MakeRecurringOrder'])) {
/*need to check for input errors in any case before order processed */
- $_POST['Update']='Yes rerun the validation checks'; //no need for gettext!
+ $_POST['Update']='Yes rerun the validation checks';//no need for gettext!
/*store the old freight cost before it is recalculated to ensure that there has been no change - test for change after freight recalculated and get user to re-confirm if changed */
@@ -432,7 +432,7 @@
if($StockItem->MBflag=='M'
AND $_SESSION['AutoCreateWOs']==1
- AND $_SESSION['Items'.$identifier]->Quotation!=1) { //oh yeah its all on!
+ AND $_SESSION['Items'.$identifier]->Quotation!=1) {//oh yeah its all on!
echo '<br />';
@@ -488,7 +488,7 @@
//Now we have the data - do we need to make any more?
$ShortfallQuantity = $QOH-$QuantityDemand-$QuantityAssemblyDemand+$QuantityPurchOrders+$QuantityWorkOrders;
- if($ShortfallQuantity < 0) { //then we need to make a work order
+ if($ShortfallQuantity < 0) {//then we need to make a work order
//How many should the work order be for??
if($ShortfallQuantity + $StockItem->EOQ < 0) {
$WOQuantity = -$ShortfallQuantity;
@@ -565,25 +565,25 @@
$result = DB_query($sql,$ErrMsg,$DbgMsg,true);
$FactoryManagerEmail .= "\n" . ($StockItem->NextSerialNo + $i);
}
- } //end loop around creation of woserialnos
+ }//end loop around creation of woserialnos
$NewNextSerialNo = ($StockItem->NextSerialNo + $WOQuantity +1);
$ErrMsg = _('Could not update the new next serial number for the item');
$UpdateNextSerialNoResult = DB_query("UPDATE stockmaster SET nextserialno='" . $NewNextSerialNo . "' WHERE stockid='" . $StockItem->StockID . "'",$ErrMsg,$DbgMsg,true);
- } // end if the item is serialised and nextserialno is set
+ }// end if the item is serialised and nextserialno is set
$EmailSubject = _('New Work Order Number') . ' ' . $WONo . ' ' . _('for') . ' ' . $StockItem->StockID . ' x ' . $WOQuantity;
//Send email to the Factory Manager
if($_SESSION['SmtpSetting']==0) {
mail($_SESSION['FactoryManagerEmail'],$EmailSubject,$FactoryManagerEmail);
- }else {
+ } else {
include('includes/htmlMimeMail.php');
$mail = new htmlMimeMail();
$mail->setSubject($EmailSubject);
$result = SendmailBySmtp($mail,array($_SESSION['FactoryManagerEmail']));
}
- } //end if with this sales order there is a shortfall of stock - need to create the WO
+ }//end if with this sales order there is a shortfall of stock - need to create the WO
}//end if auto create WOs in on
} /* end inserted line items into sales order details */
@@ -659,12 +659,12 @@
$Result = DB_Txn_Begin();
/*see if this is a contract quotation being changed to an order? */
- if($_SESSION['Items'.$identifier]->Quotation==0) { //now its being changed? to an order
+ if($_SESSION['Items'.$identifier]->Quotation==0) {//now its being changed? to an order
$ContractResult = DB_query("SELECT contractref,
requireddate
FROM contracts WHERE orderno='" . $_SESSION['ExistingOrder'.$identifier] ."'
AND status=1");
- if(DB_num_rows($ContractResult)==1) { //then it is a contract quotation being changed to an order
+ if(DB_num_rows($ContractResult)==1) {//then it is a contract quotation being changed to an order
$ContractRow = DB_fetch_array($ContractResult);
$WONo = GetNextTransNo(40,$db);
$ErrMsg = _('Could not update the contract status');
@@ -716,7 +716,7 @@
$Cost =0;
prnMsg(_('In automatically creating a work order for') . ' ' . $ContractRow['contractref'] . ' ' . _('an item on this sales order, the cost of this item as accumulated from the sum of the component costs is nil. This could be because there is no bill of material set up ... you may wish to double check this'),'warn');
} else {
- $Cost = $CostRow[0]; //cost of contract BOM
+ $Cost = $CostRow[0];//cost of contract BOM
}
$CostResult = DB_query("SELECT SUM(costperunit*quantity) AS cost
FROM contractreqts
@@ -740,8 +740,8 @@
//Recursively insert real component requirements - see includes/SQL_CommonFunctions.in for function WoRealRequirements
WoRealRequirements($db, $WONo, $_SESSION['Items'.$identifier]->Location, $ContractRow['contractref']);
- } //end processing if the order was a contract quotation being changed to an order
- } //end test to see if the order was a contract quotation being changed to an order
+ }//end processing if the order was a contract quotation being changed to an order
+ }//end test to see if the order was a contract quotation being changed to an order
$HeaderSQL = "UPDATE salesorders SET debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "',
@@ -805,7 +805,7 @@
unset($_SESSION['Items'.$identifier]->LineItems);
unset($_SESSION['Items'.$identifier]);
- if($Quotation) { //handle Quotations and Orders print after modification
+ if($Quotation) {//handle Quotations and Orders print after modification
prnMsg(_('Quotation Number') .' ' . $_SESSION['ExistingOrder'.$identifier] . ' ' . _('has been updated'),'success');
/*link to print the quotation */
@@ -821,7 +821,7 @@
<td>' . ' ' . '<a href="' . $RootPath . '/PDFQuotationPortrait.php?identifier='.$identifier . '&QuotationNo=' . $_SESSION['ExistingOrder'.$identifier] . '" target="_blank">' . _('Print Quotation (Portrait)') . '</a></td>
</tr>
</table>';
- }else {
+ } else {
prnMsg(_('Order Number') .' ' . $_SESSION['ExistingOrder'.$identifier] . ' ' . _('has been updated'),'success');
@@ -887,7 +887,7 @@
$_SESSION['Items'.$identifier]->total = 0;
$_SESSION['Items'.$identifier]->totalVolume = 0;
$_SESSION['Items'.$identifier]->totalWeight = 0;
- $k = 0; //row colour counter
+ $k = 0;//row colour counter
foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) {
@@ -956,7 +956,7 @@
$_SESSION['Items'.$identifier]->total = 0;
$_SESSION['Items'.$identifier]->totalVolume = 0;
$_SESSION['Items'.$identifier]->totalWeight = 0;
- $k=0; // row colour counter
+ $k=0;// row colour counter
foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) {
$LineTotal = $StockItem->Quantity * $StockItem->Price * (1 - $StockItem->DiscountPercent);
@@ -1014,7 +1014,6 @@
$_SESSION['Items'.$identifier]->Location = $DefaultStockLocation;
}
-// BEGIN: **********************************************************************
$SQL = "SELECT locations.loccode, locationname
FROM locations
INNER JOIN locationusers
@@ -1030,7 +1029,6 @@
echo '<option', ($_SESSION['Items'.$identifier]->Location==$myrow['loccode'] ? ' selected="selected"' : ''), ' value="', $myrow['loccode'], '">', $myrow['locationname'], '</option>';
}
echo '</select></td></tr>';
-// END: ************************************************************************
// Set the default date to earliest possible date if not set already
if(!isset($_SESSION['Items'.$identifier]->DeliveryDate)) {
@@ -1084,7 +1082,7 @@
foreach ($CountriesArray as $CountryEntry => $CountryName) {
if(isset($_POST['BrAdd6']) AND (strtoupper($_POST['BrAdd6']) == strtoupper($CountryName))) {
echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>';
- }elseif(!isset($_POST['BrAdd6']) AND $CountryName == $_SESSION['Items'.$identifier]->DelAdd6) {
+ } elseif(!isset($_POST['BrAdd6']) AND $CountryName == $_SESSION['Items'.$identifier]->DelAdd6) {
echo '<option selected="selected" value="' . $CountryName . '">' . $CountryName . '</option>';
} else {
echo '<option value="' . $CountryName . '">' . $CountryName . '</option>';
@@ -1187,15 +1185,13 @@
$ShipperResults = DB_query($sql,$ErrMsg,$DbgMsg);
while ($myrow=DB_fetch_array($ShipperResults)) {
if($myrow['shipper_id']==$_POST['ShipVia']) {
- echo '<option selected="selected" value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>';
- }else {
+ echo '<option selected="selected" value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>';
+ } else {
echo '<option value="' . $myrow['shipper_id'] . '">' . $myrow['shippername'] . '</option>';
}
}
-
echo '</select></td></tr>';
-
echo '<tr><td>' . _('Quotation Only') .':</td>
<td><select name="Quotation">';
if($_SESSION['Items'.$identifier]->Quotation==1) {
@@ -1206,7 +1202,7 @@
echo '<option selected="selected" value="0">' . _('No') . '</option>';
}
echo '</select></td></tr>';
- } //end if it is NOT a CustomerLogin
+ }//end if it is NOT a CustomerLogin
echo '</table>';
Modified: trunk/Locations.php
===================================================================
--- trunk/Locations.php 2015-05-10 18:10:27 UTC (rev 7298)
+++ trunk/Locations.php 2015-05-10 20:53:03 UTC (rev 7299)
@@ -7,10 +7,10 @@
$ViewTopic = 'Inventory';// Filename's id in ManualContents.php's TOC.
$BookMark = 'Locations';// Anchor's id in the manual's html document.
include('includes/header.inc');
-echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme.
- '/images/supplier.png" title="' .// Icon image.
- _('Inventory') . '" /> ' .// Icon title.
- _('Location Maintenance') . '</p>';// Page title.
+echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme,
+ '/images/supplier.png" title="',// Icon image.
+ _('Inventory'), '" /> ',// Icon title.
+ _('Location Maintenance'), '</p>';// Page title.
include('includes/CountriesArray.php');
@@ -38,7 +38,7 @@
if($_POST['CashSaleBranch']=='') {
prnMsg(_('A cash sale customer and branch are necessary to fully setup the counter sales functionality'),'error');
$InputError =1;
- } else { //customer branch is set too ... check it ties up with a valid customer
+ } else {//customer branch is set too ... check it ties up with a valid customer
$sql = "SELECT * FROM custbranch
WHERE debtorno='" . $_POST['CashSaleCustomer'] . "'
AND branchcode='" . $_POST['CashSaleBranch'] . "'";
@@ -49,7 +49,7 @@
prnMsg(_('The cash sale customer for this location must be defined with both a valid customer code and a valid branch code for this customer'),'error');
}
}
- } //end of checking the customer - branch code entered
+ }//end of checking the customer - branch code entered
if(isset($SelectedLocation) AND $InputError !=1) {
@@ -235,7 +235,7 @@
$DispTaxProvincesResult = DB_query("SELECT taxprovinceid FROM locations");
$TaxCatsResult = DB_query("SELECT taxcatid FROM taxcategories");
- if(DB_num_rows($TaxCatsResult) > 0) { // This will only work if there are levels else we get an error on seek.
+ if(DB_num_rows($TaxCatsResult) > 0) {// This will only work if there are levels else we get an error on seek.
while ($myrow=DB_fetch_row($DispTaxProvincesResult)) {
/*Check to see there are TaxAuthRates records set up for this TaxProvince */
@@ -379,7 +379,7 @@
prnMsg(_('Location') . ' ' . $SelectedLocation . ' ' . _('has been deleted') . '!', 'success');
unset ($SelectedLocation);
- } //end if Delete Location
+ }//end if Delete Location
unset($SelectedLocation);
unset($_GET['delete']);
}
@@ -415,7 +415,7 @@
<th class="noprint" colspan="2"> </th>
</tr>';
-$k=0; //row colour counter
+$k=0;//row colour counter
while ($myrow = DB_fetch_array($result)) {
if($k==1) {
echo '<tr class="EvenTableRows">';
@@ -525,7 +525,7 @@
<td>' . _('Location Code') . ':</td>
<td>' . $_POST['LocCode'] . '</td>
</tr>';
- } else { //end of if $SelectedLocation only do the else when a new record is being entered
+ } else {//end of if $SelectedLocation only do the else when a new record is being entered
if(!isset($_POST['LocCode'])) {
$_POST['LocCode'] = '';
}
@@ -716,7 +716,7 @@
</div>
</form>';
-} //end if record deleted no point displaying form to add record
+}//end if record deleted no point displaying form to add record
include('includes/footer.inc');
?>
\ No newline at end of file
Modified: trunk/StockLocTransferReceive.php
===================================================================
--- trunk/StockLocTransferReceive.php 2015-05-10 18:10:27 UTC (rev 7298)
+++ trunk/StockLocTransferReceive.php 2015-05-10 20:53:03 UTC (rev 7299)
@@ -199,7 +199,6 @@
// COMMENT: "if($TrfLine->Quantity !=0) {}" should be as a general condition to avoid transactions in zero.
-// BEGIN: **********************************************************************
// Insert outgoing inventory GL transaction if any of the locations has a GL account code:
if(($_SESSION['Transfer']->StockLocationFromAccount !='' or $_SESSION['Transfer']->StockLocationToAccount !='') and $TrfLine->Quantity !=0) {
// Get the account code:
@@ -238,7 +237,6 @@
$DbgMsg = _('The following SQL to insert records was used');
$Result = DB_query($SQL, $ErrMsg, $DbgMsg, true);
}
-// END: ************************************************************************
// Insert the stock movement for the stock coming into the to location
$SQL = "INSERT INTO stockmoves (stockid,
@@ -354,7 +352,6 @@
$DbgMsg = _('The following SQL to update the stock record was used');
$Result = DB_query($SQL, $ErrMsg, $DbgMsg, true);
-// BEGIN: **********************************************************************
// Insert incoming inventory GL transaction if any of the locations has a GL account code:
if(($_SESSION['Transfer']->StockLocationFromAccount !='' or $_SESSION['Transfer']->StockLocationToAccount !='') and $TrfLine->Quantity !=0) {
// Get the account code:
@@ -393,7 +390,6 @@
$DbgMsg = _('The following SQL to insert records was used');
$Result = DB_query($SQL, $ErrMsg, $DbgMsg, true);
}
-// END: ************************************************************************
prnMsg(_('A stock transfer for item code'). ' - ' . $TrfLine->StockID . ' ' . $TrfLine->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . ' ' . _('for a quantity of'). ' '. $TrfLine->Quantity,'success');
@@ -432,7 +428,7 @@
$EmailSubject = _('Cancelled balance of transfer'). ' ' . $_SESSION['Transfer']->TrfID;
if($_SESSION['SmtpSetting']==0) {
mail($_SESSION['InventoryManagerEmail'],$EmailSubject,$ConfirmationText);
- }else{
+ } else{
include('includes/htmlMimeMail.php');
$mail = new htmlMimeMail();
$mail->setSubject($EmailSubject);
@@ -533,7 +529,7 @@
prnMsg(_('Please Verify Shipment Quantities Received'),'info');
- $i = 0; //Line Item Array pointer
+ $i = 0;//Line Item Array pointer
echo '<br />
<table class="selection">';
@@ -691,4 +687,4 @@
</form>';
}
include('includes/footer.inc');
-?>
+?>
\ No newline at end of file
Modified: trunk/StockTransfers.php
===================================================================
--- trunk/StockTransfers.php 2015-05-10 18:10:27 UTC (rev 7298)
+++ trunk/StockTransfers.php 2015-05-10 20:53:03 UTC (rev 7299)
@@ -25,10 +25,10 @@
if(isset($_POST['CheckCode'])) {
- echo '<p class="page_title_text">
- <img src="'.$RootPath.'/css/'.$Theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />
- ' . ' ' . _('Select Item to Transfer') . '
- </p>';
+ echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme,
+ '/images/magnifier.png" title="',// Icon image.
+ _('Dispatch'), '" /> ',// Icon title.
+ _('Select Item to Transfer'), '</p>';// Page title.
if(mb_strlen($_POST['StockText'])>0) {
$sql="SELECT stockid,
@@ -215,7 +215,6 @@
include('includes/footer.inc');
exit;
}
-// BEGIN: **********************************************************************
// Insert outgoing inventory GL transaction if any of the locations has a GL account code:
if($_SESSION['Transfer']->StockLocationFromAccount !='' or $_SESSION['Transfer']->StockLocationToAccount !='') {
// Get the account code:
@@ -254,7 +253,6 @@
$DbgMsg = _('The following SQL to insert records was used');
$Result = DB_query($SQL, $ErrMsg, $DbgMsg, true);
}
-// END: ************************************************************************
// Insert the stock movement for the stock going out of the from location
$SQL = "INSERT INTO stockmoves(stockid,
type,
@@ -372,7 +370,6 @@
// There must actually be some error this should never happen
$QtyOnHandPrior = 0;
}
-// BEGIN: **********************************************************************
// Insert incoming inventory GL transaction if any of the locations has a GL account code:
if($_SESSION['Transfer']->StockLocationFromAccount !='' or $_SESSION['Transfer']->StockLocationToAccount !='') {
// Get the account code:
@@ -411,7 +408,6 @@
$DbgMsg = _('The following SQL to insert records was used');
$Result = DB_query($SQL, $ErrMsg, $DbgMsg, true);
}
-// END: ************************************************************************
// Insert the stock movement for the stock coming into the to location
$SQL = "INSERT INTO stockmoves (stockid,
type,
Modified: trunk/Z_ChangeGLAccountCode.php
===================================================================
--- trunk/Z_ChangeGLAccountCode.php 2015-05-10 18:10:27 UTC (rev 7298)
+++ trunk/Z_ChangeGLAccountCode.php 2015-05-10 20:53:03 UTC (rev 7299)
@@ -4,17 +4,17 @@
include ('includes/session.inc');
$Title = _('UTILITY PAGE Change A GL Account Code');// Screen identificator.
-$ViewTopic = 'SpecialUtilities'; // Filename's id in ManualContents.php's TOC.
-$BookMark = 'Z_ChangeGLAccountCode'; // Anchor's id in the manual's html document.
+$ViewTopic = 'SpecialUtilities';// Filename's id in ManualContents.php's TOC.
+$BookMark = 'Z_ChangeGLAccountCode';// Anchor's id in the manual's html document.
include('includes/header.inc');
-echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme.
- '/images/gl.png" title="' .
- _('Change A GL Account Code') . '" /> ' .// Icon title.
- _('Change A GL Account Code') . '</p>';// Page title.
+echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme,
+ '/images/gl.png" title="',// Icon image.
+ _('Change A GL Account Code'), '" /> ',// Icon title.
+ _('Change A GL Account Code'), '</p>';// Page title.
include('includes/SQL_CommonFunctions.inc');
-if (isset($_POST['ProcessGLAccountCode'])){
+if(isset($_POST['ProcessGLAccountCode'])) {
$InputError =0;
@@ -22,17 +22,17 @@
/*First check the code exists */
$result=DB_query("SELECT accountcode FROM chartmaster WHERE accountcode='" . $_POST['OldAccountCode'] . "'");
- if (DB_num_rows($result)==0){
+ if(DB_num_rows($result)==0) {
prnMsg(_('The GL account code') . ': ' . $_POST['OldAccountCode'] . ' ' . _('does not currently exist as a GL account code in the system'),'error');
$InputError =1;
}
- if (ContainsIllegalCharacters($_POST['NewAccountCode'])){
+ if(ContainsIllegalCharacters($_POST['NewAccountCode'])) {
prnMsg(_('The new GL account code to change the old code to contains illegal characters - no changes will be made'),'error');
$InputError =1;
}
- if ($_POST['NewAccountCode']==''){
+ if($_POST['NewAccountCode']=='') {
prnMsg(_('The new GL account code to change the old code to must be entered as well'),'error');
$InputError =1;
}
@@ -40,14 +40,14 @@
/*Now check that the new code doesn't already exist */
$result=DB_query("SELECT accountcode FROM chartmaster WHERE accountcode='" . $_POST['NewAccountCode'] . "'");
- if (DB_num_rows($result)!=0){
+ if(DB_num_rows($result)!=0) {
echo '<br /><br />';
prnMsg(_('The replacement GL account code') . ': ' . $_POST['NewAccountCode'] . ' ' . _('already exists as a GL account code in the system') . ' - ' . _('a unique GL account code must be entered for the new code'),'error');
$InputError =1;
}
- if ($InputError ==0){ // no input errors
+ if($InputError ==0) {// no input errors
$result = DB_Txn_Begin();
echo '<br />' . _('Adding the new chartmaster record');
$sql = "INSERT INTO chartmaster (accountcode,
@@ -96,9 +96,7 @@
ChangeFieldInTable("lastcostrollup", "stockact", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db);
ChangeFieldInTable("lastcostrollup", "adjglact", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db);
-// BEGIN: **********************************************************************
ChangeFieldInTable("locations", "glaccountcode", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db);// Location's ledger account.
-// END: ************************************************************************
ChangeFieldInTable("pcexpenses", "glaccount", $_POST['OldAccountCode'], $_POST['NewAccountCode'], $db);
@@ -133,9 +131,8 @@
$result = DB_query($sql,$ErrMsg,$DbgMsg,true);
echo ' ... ' . _('completed');
-
echo '<p>' . _('GL account Code') . ': ' . $_POST['OldAccountCode'] . ' ' . _('was successfully changed to') . ' : ' . $_POST['NewAccountCode'];
- } //only do the stuff above if $InputError==0
+ }//only do the stuff above if $InputError==0
}
Modified: trunk/Z_ChangeLocationCode.php
===================================================================
--- trunk/Z_ChangeLocationCode.php 2015-05-10 18:10:27 UTC (rev 7298)
+++ trunk/Z_ChangeLocationCode.php 2015-05-10 20:53:03 UTC (rev 7299)
@@ -1,20 +1,20 @@
<?php
/* $Id: Z_ChangeLocationCode.php 5296 2012-04-29 15:28:19Z vvs2012 $*/
-/* This script is an utility to change a location code. */
+/* Utility to change a location code. */
include ('includes/session.inc');
$Title = _('UTILITY PAGE Change A Location Code');// Screen identificator.
-$ViewTopic = 'SpecialUtilities'; // Filename's id in ManualContents.php's TOC.
-$BookMark = 'Z_ChangeLocationCode'; // Anchor's id in the manual's html document.
+$ViewTopic = 'SpecialUtilities';// Filename's id in ManualContents.php's TOC.
+$BookMark = 'Z_ChangeLocationCode';// Anchor's id in the manual's html document.
include('includes/header.inc');
-echo '<p class="page_title_text"><img alt="" src="'.$RootPath.'/css/'.$Theme.
- '/images/maintenance.png" title="' .
- _('Change A Location Code') . '" /> ' .// Icon title.
- _('Change A Location Code') . '</p>';// Page title.
+echo '<p class="page_title_text"><img alt="" src="', $RootPath, '/css/', $Theme,
+ '/images/maintenance.png" title="',// Icon image.
+ _('Change A Location Code'), '" /> ',// Icon title.
+ _('Change A Location Code'), '</p>';// Page title.
include('includes/SQL_CommonFunctions.inc');
-if (isset($_POST['ProcessLocationChange'])){
+if(isset($_POST['ProcessLocationChange'])) {
$InputError =0;
@@ -22,39 +22,39 @@
/*First check the location code exists */
$result=DB_query("SELECT loccode FROM locations WHERE loccode='" . $_POST['OldLocationID'] . "'");
- if (DB_num_rows($result)==0){
+ if(DB_num_rows($result)==0) {
prnMsg(_('The location code') . ': ' . $_POST['OldLocationID'] . ' ' . _('does not currently exist as a location code in the system'),'error');
$InputError =1;
}
- if (ContainsIllegalCharacters($_POST['NewLocationID'])){
+ if(ContainsIllegalCharacters($_POST['NewLocationID'])) {
prnMsg(_('The new location code to change the old code to contains illegal characters - no changes will be made'),'error');
$InputError =1;
}
- if ($_POST['NewLocationID']==''){
+ if($_POST['NewLocationID']=='') {
prnMsg(_('The new location code to change the old code to must be entered as well'),'error');
$InputError =1;
}
- if (ContainsIllegalCharacters($_POST['NewLocationName'])){
+ if(ContainsIllegalCharacters($_POST['NewLocationName'])) {
prnMsg(_('The new location name to change the old name to contains illegal characters - no changes will be made'),'error');
$InputError =1;
}
- if ($_POST['NewLocationName']==''){
+ if($_POST['NewLocationName']=='') {
prnMsg(_('The new location name to change the old name to must be entered as well'),'error');
$InputError =1;
}
/*Now check that the new code doesn't already exist */
$result=DB_query("SELECT loccode FROM locations WHERE loccode='" . $_POST['NewLocationID'] . "'");
- if (DB_num_rows($result)!=0){
+ if(DB_num_rows($result)!=0) {
echo '<br /><br />';
prnMsg(_('The replacement location code') . ': ' . $_POST['NewLocationID'] . ' ' . _('already exists as a location code in the system') . ' - ' . _('a unique location code must be entered for the new code'),'error');
$InputError =1;
}
- if ($InputError ==0){ // no input errors
+ if($InputError ==0) {// no input errors
$result = DB_Txn_Begin();
DB_IgnoreForeignKeys();
@@ -159,7 +159,7 @@
//check if MRP tables exist before assuming
$result = DB_query("SELECT COUNT(*) FROM mrpparameters",'','',false,false);
- if (DB_error_no()==0) {
+ if(DB_error_no()==0) {
echo '<br />' . _('Changing MRP parameters information');
$sql = "UPDATE mrpparameters SET location='" . $_POST['NewLocationID'] . "' WHERE location='" . $_POST['OldLocationID'] . "'";
$ErrMsg = _('The SQL to update the mrpparameters records failed');
@@ -251,7 +251,7 @@
echo '<p>' . _('Location code') . ': ' . $_POST['OldLocationID'] . ' ' . _('was successfully changed to') . ' : ' . $_POST['NewLocationID'];
- } //only do the stuff above if $InputError==0
+ }//only do the stuff above if $InputError==0
}
echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">';
@@ -279,4 +279,4 @@
</form>';
include('includes/footer.inc');
-?>
+?>
\ No newline at end of file
|