[Weberp-svn] SF.net SVN: weberp:[4641] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-03-01 19:11:09
|
Revision: 4641 http://weberp.svn.sourceforge.net/weberp/?rev=4641&view=rev Author: tim_schofield Date: 2011-03-01 19:11:02 +0000 (Tue, 01 Mar 2011) Log Message: ----------- Create new database field for sales unit conversion factor Modified Paths: -------------- trunk/Prices.php trunk/includes/session.inc Added Paths: ----------- trunk/sql/mysql/updates/65.php Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2011-03-01 15:34:34 UTC (rev 4640) +++ trunk/Prices.php 2011-03-01 19:11:02 UTC (rev 4641) @@ -141,7 +141,7 @@ startdate, enddate, price) - VALUES ('$Item', + valueS ('$Item', '" . $_POST['TypeAbbrev'] . "', '" . $_POST['CurrAbrev'] . "', '" . $_POST['Units'] . "', @@ -177,7 +177,7 @@ //Always do this stuff if ($InputError ==0){ $sql = "SELECT currencies.currency, - salestypes.sales_type, + salestypes.sales_type, prices.units, prices.price, prices.stockid, @@ -202,7 +202,7 @@ echo '<table class=selection>'; echo '<tr><th colspan=7><form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo _('Pricing for part') . ':<input type=text name="Item" MAXSIZEe=22 VALUE="' . $Item . '" maxlength=20><input type=submit name=NewPart Value="' . _('Review Prices') . '">'; + echo _('Pricing for part') . ':<input type=text name="Item" MAXSIZEe=22 value="' . $Item . '" maxlength=20><input type=submit name=NewPart Value="' . _('Review Prices') . '">'; echo '</th></tr></form>'; echo '<tr><th>' . _('Currency') . @@ -285,10 +285,10 @@ echo '<form method="post" action=' . $_SERVER['PHP_SELF'] . '?' . SID . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['Edit'])){ - echo '<input type=hidden name="OldTypeAbbrev" VALUE="' . $_GET['TypeAbbrev'] .'">'; - echo '<input type=hidden name="OldCurrAbrev" VALUE="' . $_GET['CurrAbrev'] . '">'; - echo '<input type=hidden name="OldStartDate" VALUE="' . $_GET['StartDate'] . '">'; - echo '<input type=hidden name="OldEndDate" VALUE="' . $_GET['EndDate'] . '">'; + echo '<input type=hidden name="OldTypeAbbrev" value="' . $_GET['TypeAbbrev'] .'">'; + echo '<input type=hidden name="OldCurrAbrev" value="' . $_GET['CurrAbrev'] . '">'; + echo '<input type=hidden name="OldStartDate" value="' . $_GET['StartDate'] . '">'; + echo '<input type=hidden name="OldEndDate" value="' . $_GET['EndDate'] . '">'; $_POST['CurrAbrev'] = $_GET['CurrAbrev']; $_POST['TypeAbbrev'] = $_GET['TypeAbbrev']; $_POST['Price'] = $_GET['Price']; @@ -308,9 +308,9 @@ echo '<tr><td>' . _('Currency') . ':</td><td><select name="CurrAbrev">'; while ($myrow = DB_fetch_array($result)) { if ($myrow['currabrev']==$_POST['CurrAbrev']) { - echo '<option selected VALUE="'; + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['currabrev'] . '">' . $myrow['currency']; } //end while loop @@ -324,9 +324,9 @@ while ($myrow = DB_fetch_array($result)) { if ($myrow['typeabbrev']==$_POST['TypeAbbrev']) { - echo '<option selected VALUE="'; + echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['typeabbrev'] . '">' . $myrow['sales_type']; @@ -345,20 +345,20 @@ <td><input type="Text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="StartDate" size=10 maxlength=10 value="' . $_POST['StartDate'] . '"></td></tr>'; echo '<tr><td>' . _('Price Effective To Date') . ':</td> <td><input type="Text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="EndDate" size=10 maxlength=10 value="' . $_POST['EndDate'] . '"></td></tr>'; - echo '<tr><td>' . _('Unit of Measure') . ':</td>'; - echo '<td><select name="Units">'; - $sql = "SELECT unitname FROM unitsofmeasure"; - $result = DB_query($sql, $db); - while ($myrow = DB_fetch_array($result)) { - if ($_POST['Units'] == $myrow['unitname']) { - echo '<option selected value="' . $myrow['unitname'] . '">' . $myrow['unitname'] . '</option>'; - } else if ($DefaultUOM == $myrow['unitname'] and ($_POST['Units'] == $myrow['unitname'])) { - echo '<option selected value="' . $myrow['unitname'] . '">' . $myrow['unitname'] . '</option>'; - } else { - echo '<option value="' . $myrow['unitname'] . '">' . $myrow['unitname'] . '</option>'; - } - } - echo '</td></tr>'; + echo '<tr><td>' . _('Unit of Measure') . ':</td>'; + echo '<td><select name="Units">'; + $sql = "SELECT unitname FROM unitsofmeasure"; + $result = DB_query($sql, $db); + while ($myrow = DB_fetch_array($result)) { + if ($_POST['Units'] == $myrow['unitname']) { + echo '<option selected value="' . $myrow['unitname'] . '">' . $myrow['unitname'] . '</option>'; + } else if ($DefaultUOM == $myrow['unitname'] and ($_POST['Units'] == $myrow['unitname'])) { + echo '<option selected value="' . $myrow['unitname'] . '">' . $myrow['unitname'] . '</option>'; + } else { + echo '<option value="' . $myrow['unitname'] . '">' . $myrow['unitname'] . '</option>'; + } + } + echo '</td></tr>'; echo '<input type=hidden name=Item value='.$Item.'>'; ?> Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-01 15:34:34 UTC (rev 4640) +++ trunk/includes/session.inc 2011-03-01 19:11:02 UTC (rev 4641) @@ -13,7 +13,7 @@ header('Location:' . $rootpath . '/install/index.php'); } include($PathPrefix . 'config.php'); -$DBVersion=64; +$DBVersion=65; if (isset($SessionSavePath)){ session_save_path($SessionSavePath); } Added: trunk/sql/mysql/updates/65.php =================================================================== --- trunk/sql/mysql/updates/65.php (rev 0) +++ trunk/sql/mysql/updates/65.php 2011-03-01 19:11:02 UTC (rev 4641) @@ -0,0 +1,13 @@ +<?php + +/* Add extra field into prices table for unit of measure + */ + +AddColumn('conversionfactor', 'prices', 'double', 'NOT NULL', '1', 'units', $db); + +$sql="UPDATE prices SET conversionfactor=1"; +$result=DB_query($sql, $db); + +UpdateDBNo(65, $db); + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |