From: <tim...@us...> - 2010-04-28 17:36:09
|
Revision: 3432 http://web-erp.svn.sourceforge.net/web-erp/?rev=3432&view=rev Author: tim_schofield Date: 2010-04-28 17:36:03 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Matt Taylor: Z_ImportStocks.php : Prevent importing empty string for pdfappend. Modified Paths: -------------- trunk/Z_ImportStocks.php trunk/doc/Change.log.html Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2010-04-28 08:17:27 UTC (rev 3431) +++ trunk/Z_ImportStocks.php 2010-04-28 17:36:03 UTC (rev 3432) @@ -92,7 +92,11 @@ exit; } + // cleanup the data (csv files often import with empty strings and such) $StockID = strtoupper($myrow[0]); + foreach ($myrow as &$value) { + $value = trim($value); + } //first off check if the item already exists $sql = "SELECT COUNT(stockid) FROM stockmaster WHERE stockid='".$StockID."'"; @@ -129,7 +133,7 @@ $InputError = 1; prnMsg(_('The barcode must be 20 characters or less long'),'error'); } - if ($myrow[10]!='0' AND $myrow[10]!='1') { + if ($myrow[10]!=0 AND $myrow[10]!=1) { $InputError = 1; prnMsg (_('Values in the Perishable field must be either 0 (No) or 1 (Yes)') ,'error'); } @@ -171,10 +175,14 @@ $InputError = 1; prnMsg(_('Assembly/Kitset/Phantom/Service items cannot also be controlled items') . '. ' . _('Assemblies, Dummies and Kitsets are not physical items and batch/serial control is therefore not appropriate'),'error'); } - if (trim($myrow[3])==''){ + if ($myrow[3]==''){ $InputError = 1; prnMsg(_('There are no inventory categories defined. All inventory items must belong to a valid inventory category,'),'error'); } + if ($myrow[17]==''){ + $InputError = 1; + prnMsg(_('ItemPDF must contain either a filename, or the keyword `none`'),'error'); + } if ($InputError !=1){ if ($myrow[9]==1){ /*Not appropriate to have several dp on serial items */ @@ -241,7 +249,7 @@ $InsResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_error_no($db) ==0) { - prnMsg( _('New Item') .' ' . $StockID . ' '. _('has been added to the transaction'),'success'); + prnMsg( _('New Item') .' ' . $StockID . ' '. _('has been added to the transaction'),'info'); } else { //location insert failed so set some useful error info $InputError = 1; prnMsg(_($InsResult),'error'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-04-28 08:17:27 UTC (rev 3431) +++ trunk/doc/Change.log.html 2010-04-28 17:36:03 UTC (rev 3432) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> <p>28/04/10 Tim Schofield: MiscFunctions.php : Fix currency download for when there is no internat connection.</p> +<p>28/04/10 Matt Taylor: Z_ImportStocks.php : Prevent importing empty string for pdfappend.</p> <p>23/04/10 Matt Taylor: MiscFunctions.js : Fix IsDate() function for Y/m/d format.</p> <p>23/04/10 Matt Taylor: DateFunctions.inc : Fix Date1GreaterThanDate2() function for Y/m/d format.</p> <p>23/04/10 Matt Taylor: Z_BottomUpCost.php : Add script for batch updating BOM costs.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |