From: <dai...@us...> - 2011-02-07 08:51:42
|
Revision: 4485 http://web-erp.svn.sourceforge.net/web-erp/?rev=4485&view=rev Author: daintree Date: 2011-02-07 08:51:36 +0000 (Mon, 07 Feb 2011) Log Message: ----------- not finished Modified Paths: -------------- trunk/PDFGrn.php trunk/PricesBasedOnMarkUp.php trunk/PricesByCost.php trunk/doc/Change.log.html trunk/index.php Modified: trunk/PDFGrn.php =================================================================== --- trunk/PDFGrn.php 2011-02-06 07:59:50 UTC (rev 4484) +++ trunk/PDFGrn.php 2011-02-07 08:51:36 UTC (rev 4485) @@ -20,39 +20,57 @@ include('includes/PDFStarter.php'); $pdf->addInfo('Title', _('Goods Received Note') ); -$sql="SELECT grns.itemcode, - grns.grnno, - grns.deliverydate, - grns.itemdescription, - grns.qtyrecd, - grns.supplierid, - purchorderdetails.suppliersunit, - purchorderdetails.conversionfactor, - stockmaster.units, - stockmaster.decimalplaces - FROM grns INNER JOIN purchorderdetails - ON grns.podetailitem=purchorderdetails.podetailitem - LEFT JOIN stockmaster - ON grns.itemcode=stockmaster.stockid - WHERE grnbatch='".$GRNNo."'"; - -$GRNResult=DB_query($sql, $db); - -if(DB_num_rows($GRNResult)>0) { //there are GRNs to print +if ($GRNNo == 'Preview'){ + $myrow['itemcode'] = strpad('', 15,'x'); + $myrow['deliverydate'] = '0000-00-00'; + $myrow['itemdescription'] = strpad('', 30,'x'); + $myrow['qtyrecd'] = 99999.99; + $myrow['supplierid'] = strpad('', 10,'x'); + $myrow['suppliersunit'] = strpad('', 10,'x'); + $myrow['units'] = strpad('', 10,'x'); + $SuppRow['suppname'] = strpad('', 30,'x'); + $SuppRow['address1'] = strpad('', 30,'x'); + $SuppRow['address2'] = strpad('', 30,'x'); + $SuppRow['address3'] = strpad('', 20,'x'); + $SuppRow['address4'] = strpad('', 20,'x'); + $SuppRow['address5'] = strpad('', 10,'x'); + $SuppRow['address6'] = strpad('', 10,'x'); +} else { //NOT PREVIEW + + $sql="SELECT grns.itemcode, + grns.grnno, + grns.deliverydate, + grns.itemdescription, + grns.qtyrecd, + grns.supplierid, + purchorderdetails.suppliersunit, + purchorderdetails.conversionfactor, + stockmaster.units, + stockmaster.decimalplaces + FROM grns INNER JOIN purchorderdetails + ON grns.podetailitem=purchorderdetails.podetailitem + LEFT JOIN stockmaster + ON grns.itemcode=stockmaster.stockid + WHERE grnbatch='".$GRNNo."'"; - $sql = "SELECT suppliers.suppname, - suppliers.address1, - suppliers.address2 , - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6 - FROM grns INNER JOIN suppliers - ON grns.supplierid=suppliers.supplierid - WHERE grnbatch='".$GRNNo."'"; - $SuppResult = DB_query($sql,$db,_('Could not get the supplier of the selected GRN')); - $SuppRow = DB_fetch_array($SuppResult); + $GRNResult=DB_query($sql, $db); + if(DB_num_rows($GRNResult)>0) { //there are GRNs to print + + $sql = "SELECT suppliers.suppname, + suppliers.address1, + suppliers.address2 , + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6 + FROM grns INNER JOIN suppliers + ON grns.supplierid=suppliers.supplierid + WHERE grnbatch='".$GRNNo."'"; + $SuppResult = DB_query($sql,$db,_('Could not get the supplier of the selected GRN')); + $SuppRow = DB_fetch_array($SuppResult); + } +} // get data to print include ('includes/PDFGrnHeader.inc'); //head up the page $YPos=$FormDesign->Data->y; Modified: trunk/PricesBasedOnMarkUp.php =================================================================== --- trunk/PricesBasedOnMarkUp.php 2011-02-06 07:59:50 UTC (rev 4484) +++ trunk/PricesBasedOnMarkUp.php 2011-02-07 08:51:36 UTC (rev 4485) @@ -5,13 +5,13 @@ include('includes/session.inc'); -$title=_('Update Pricing From Costs'); +$title=_('Update Pricing'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . '" alt="" />' . $title.'</p>'; -echo '<br /><div class="page_help_text">' . _('This page adds new prices or updates already existing prices for a specified sales type (price list) and currency for the stock category selected - based on a percentage mark up from cost prices or from preferred supplier cost data. The rounding factor ensures that prices are at least this amount or a multiple of it. A rounding factor of 1000 would mean that prices would be a minimum of 1000 and other prices would be expressed as multiples of 1000.') . '</div><br /><div class="centre">'; +echo '<br /><div class="page_help_text">' . _('This page adds new prices or updates already existing prices for a specified sales type (price list) and currency for the stock category selected - based on a percentage mark up from cost prices or from preferred supplier cost data or from another price list. The rounding factor ensures that prices are at least this amount or a multiple of it. A rounding factor of 5 would mean that prices would be a minimum of 5 and other prices would be expressed as multiples of 5.') . '</div><br /><div class="centre">'; echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-02-06 07:59:50 UTC (rev 4484) +++ trunk/PricesByCost.php 2011-02-07 08:51:36 UTC (rev 4485) @@ -1,21 +1,21 @@ <?php /* $Id$ */ -// PricesByCost.php - -//$PageSecurity = 11; + +//$PageSecurity = 11; Now from DB include ('includes/session.inc'); -$title = _('Update of Prices By Cost'); +$title = _('Update of Prices By A Multiple Of Cost'); include ('includes/header.inc'); echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . _('Update Price By Cost') . '</p>'; if (isset($_POST['submit']) or isset($_POST['update'])) { - if ($_POST['Margin'] == "") { + if ($_POST['Margin'] == '') { header('Location: PricesByCost.php'); } if ($_POST['Comparator'] == 1) { - $Comparator = "<="; + $Comparator = '<='; } else { - $Comparator = ">="; + $Comparator = '>='; } /*end of else Comparator */ if ($_POST['StockCat'] != 'all') { $Category = " AND stockmaster.categoryid = '" . $_POST['StockCat'] . "'"; @@ -47,7 +47,7 @@ while ($myrow = DB_fetch_array($result)) { //update database if update pressed $SQLUpdate = "UPDATE prices SET price = '" . $_POST['Price_' . $PriceCounter] . "' - WHERE `prices`.`stockid` = '" . $_POST['StockID_' . $PriceCounter] . "' + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' AND prices.typeabbrev ='" . $_POST['SalesType'] . "' AND prices.currabrev ='" . $_POST['CurrCode'] . "' AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' @@ -217,9 +217,9 @@ <td><select name='SalesType'>"; while ($myrow = DB_fetch_array($result)) { if ($_POST['SalesType'] == $myrow['typeabbrev']) { - echo "<option selected value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + echo "<option selected value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type'] . '</option>'; } else { - echo "<option value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + echo "<option value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type'] . '</option>'; } } //end while loop DB_data_seek($result, 0); @@ -229,9 +229,9 @@ <td><select name='CurrCode'>"; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['CurrCode']) and $_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); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-06 07:59:50 UTC (rev 4484) +++ trunk/doc/Change.log.html 2011-02-07 08:51:36 UTC (rev 4485) @@ -1,10 +1,11 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p <p></p> -<p>6/2/11:sotandeka Fix typos left debug comments prnMsg in</p> -<p>5/2/11: Phil: SystemParameters.php new option to AutoAuthorisePO when the user has authority to do so</p> -<p>5/2/11: Phil: PO_Items.php fixed non-existant variables on Enter nominal line. Added option to automatically authorise when user is an authoriser as well as a creator</p> -<p>5/2/11: PDFGrn.php rewrote - preview never used - confused logic fixed<p> -<p>4/2/11: Tim: CostUpdate.php allow cost update with appropriate permissions token 10 hard coded</p> +<p>7/2/11: Phil PDFGrn.php turns out preview is used from the form modification script doh! Over simplificaton reversed to reinstate preview mode<p> +<p>6/2/11: Otandeka Removed debug prnMsg in FixedAssetDepreciation</p> +<p>5/2/11: Phil SystemParameters.php new option to AutoAuthorisePO when the user has authority to do so</p> +<p>5/2/11: Phil PO_Items.php fixed non-existant variables on Enter nominal line. Added option to automatically authorise when user is an authoriser as well as a creator</p> +<p>5/2/11: Phil PDFGrn.php rewrote - preview never used - simplified<p> +<p>4/2/11: Tim CostUpdate.php allow cost update with appropriate permissions token 10 hard coded</p> <p>4/2/11: Phil SelectCustomer.php rejig selection options in more logical way. Used non-specific SQL to search by any part of the address</p> <p>2/2/11: Phil PDFTopItems.php and TopItems.php removed mysql specific SQL</p> <p>30/1/11: Phil GoodsReceived.php rework for supplier units and conversion factor etc now in PO class</p> @@ -13,7 +14,7 @@ <p>29/1/11:Tim fix reportwriter with tcpdf using parent::__construct rather than $this->Cpdf( </p> <p>24/1/11:Phil Depreciation fixes - SelectAsset by description fix</p> <p>23/1/11:Peter Otandeka: PDFTopItems.php SQL quoting fixes</p> -<p>23/1/11: phil Fix Depreciation posting and dates of end of periods</p> +<p>23/1/11: Phil Fix Depreciation posting and dates of end of periods</p> <p>23/1/11:Phil changed back references throughout several MRP scripts from is_date to Is_Date - as Is_Date is used throughout the code and much bigger job to change all references to is_date</p> <p>20/1/11: Tim changed back addinfo calls to addInfo on PDF reports - Zhigio originally thought to be an issue with Turkish utf-8 pdfs but turned out to be a red herring. class.pdf call changed back to addInfo too - most of calls had not been changed to lower case info</p> <p>20/1/11: Tim changed PricesBasedOnMarkUp to have end date day before new prices effective from</p> Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-02-06 07:59:50 UTC (rev 4484) +++ trunk/index.php 2011-02-07 08:51:36 UTC (rev 4485) @@ -725,7 +725,7 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PricesBasedOnMarkUp.php?' . SID . '">' . _('Add or Update Prices Based On Costs') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PricesBasedOnMarkUp.php?' . SID . '">' . _('Add or Update Prices Based On Costs Or Other Price List') . '</a></p>'; ?> </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |