From: <dai...@us...> - 2013-10-04 21:26:54
|
Revision: 6345 http://sourceforge.net/p/web-erp/reponame/6345 Author: daintree Date: 2013-10-04 21:26:52 +0000 (Fri, 04 Oct 2013) Log Message: ----------- Check for AP->GL link before setting GL code to 0 Modified Paths: -------------- trunk/PO_Items.php trunk/ShopParameters.php trunk/sql/mysql/upgrade4.11-4.12.sql Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2013-10-04 17:10:45 UTC (rev 6344) +++ trunk/PO_Items.php 2013-10-04 21:26:52 UTC (rev 6345) @@ -437,14 +437,13 @@ prnMsg( _('Cannot Enter this order line') . '</b><br />' . _('The date entered must be in the format') . ' ' . $_SESSION['DefaultDateFormat'], 'error'); } - /*It's not a stock item */ + /*It's not a stock item + * need to check GL Code is valid if GLLink is active + * [icedlava] GL Code is required for non stock item variance in price vs purchase order when supplier invoice generated even if stock not linked to GL, but AP is else + * there will be an sql error in SupplierInvoice.php without a valid GL Code + */ + if ($_SESSION['PO'.$identifier]->GLLink==1 OR $_SESSION['CompanyRecord']['gllink_creditors']==1){ - /*need to check GL Code is valid if GLLink is active */ - /* [icedlava] GL Code is required for non stock item variance in price vs purchase order when supplier invoice generated else - there will be an sql error in SupplierInvoice.php without a valid GL Code - */ - //if ($_SESSION['PO'.$identifier]->GLLink==1){ - $sql = "SELECT accountname FROM chartmaster WHERE accountcode ='" . $_POST['GLCode'] . "'"; @@ -467,10 +466,10 @@ $myrow = DB_fetch_row($GLValidResult); $GLAccountName = $myrow[0]; } - //} /* dont bother checking the GL Code if there is no GL code to check ie not linked to GL */ - //else { - // $_POST['GLCode']=0; - //} + } /* dont bother checking the GL Code if there is no GL code to check ie not linked to GL */ + else { + $_POST['GLCode']=0; + } if ($_POST['AssetID'] !='Not an Asset'){ $ValidAssetResult = DB_query("SELECT assetid, description, Modified: trunk/ShopParameters.php =================================================================== --- trunk/ShopParameters.php 2013-10-04 17:10:45 UTC (rev 6344) +++ trunk/ShopParameters.php 2013-10-04 21:26:52 UTC (rev 6345) @@ -107,6 +107,9 @@ if ($_SESSION['ShopPayPalBankAccount'] != $_POST['X_ShopPayPalBankAccount'] ) { $SQL[] = "UPDATE config SET confvalue = '".$_POST['X_ShopPayPalBankAccount']."' WHERE confname = 'ShopPayPalBankAccount'"; } + if ($_SESSION['ShopFreightModule'] != $_POST['X_ShopFreightModule'] ) { + $SQL[] = "UPDATE config SET confvalue = '".$_POST['X_ShopFreightModule']."' WHERE confname = 'ShopFreightModule'"; + } if (!$AllowDemoMode) { if ($_SESSION['ShopCreditCardGateway'] != $_POST['X_ShopCreditCardGateway'] ) { @@ -355,6 +358,27 @@ </tr>'; echo '<tr> + <td>' . _('Freight Calculations') . ':</td> + <td><select name="X_ShopFreightModule">'; + +$FreightModules = array(array('MethodName'=>'No Freight','MethodCode'=>'NoFreight'), + array('MethodName'=>'webERP calculation','MethodCode'=>'webERPDefault'), + array('MethodName'=>'Australia Post API','MethodCode'=>'AusPost')); + +foreach($FreightModules as $FreightCalc){ + if ($_SESSION['ShopFreightModule'] ==$FreightCalc['MethodCode']) { + echo '<option selected="selected" value="' . $FreightCalc['MethodCode'] . '">' . $FreightCalc['MethodName'] . '</option>'; + } else { + echo '<option value="' . $FreightCalc['MethodCode'] . '">' . $FreightCalc['MethodName'] . '</option>'; + } +} +echo '</select></td> + <td>' . _('Select the freight calculation method to use for the webSHOP') . '</td> + </tr>'; + + + +echo '<tr> <th colspan="3">' . _('Bank Transfer Settings') . '</th></tr>'; echo $TableHeader; Modified: trunk/sql/mysql/upgrade4.11-4.12.sql =================================================================== --- trunk/sql/mysql/upgrade4.11-4.12.sql 2013-10-04 17:10:45 UTC (rev 6344) +++ trunk/sql/mysql/upgrade4.11-4.12.sql 2013-10-04 21:26:52 UTC (rev 6345) @@ -1,5 +1,6 @@ INSERT INTO scripts VALUES ('Z_UpdateSalesAnalysisWithLatestCustomerData.php','15','Update sales analysis with latest customer and branch salesperson sales area and salestype irrespective of what these settings were when the sale was made'); INSERT INTO scripts VALUES ('PurchaseByPrefSupplier.php','2','Purchase ordering by preferred supplier'); ALTER TABLE `suppliers` ADD COLUMN `url` varchar(50) NOT NULL DEFAULT ''; +INSERT INTO config ('ShopFreightModule','webERPDefault'); #--UPDATE config SET confvalue='4.11.0' WHERE confname='VersionNumber'; |