From: <dai...@us...> - 2011-02-18 09:56:59
|
Revision: 4492 http://web-erp.svn.sourceforge.net/web-erp/?rev=4492&view=rev Author: daintree Date: 2011-02-18 09:56:52 +0000 (Fri, 18 Feb 2011) Log Message: ----------- various Modified Paths: -------------- trunk/CompanyPreferences.php trunk/ConfirmDispatch_Invoice.php trunk/Credit_Invoice.php trunk/FixedAssetItems.php trunk/PO_Items.php trunk/SelectAsset.php trunk/SelectCreditItems.php trunk/Z_DeleteInvoice.php trunk/doc/Change.log.html trunk/includes/DefineCartClass.php Modified: trunk/CompanyPreferences.php =================================================================== --- trunk/CompanyPreferences.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/CompanyPreferences.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -456,7 +456,7 @@ echo '</select></td></tr>'; -echo '<tr><td>' . _('Create GL entries for stock transactions') . ' (' . _('at standard cost') . '):</td><td><select tabindex="25" Name=GLLink_Stock>'; +echo '<tr><td>' . _('Create GL entries for stock transactions') . '):</td><td><select tabindex="25" Name=GLLink_Stock>'; if ($_POST['GLLink_Stock']==0){ echo '<option selected VALUE=0>' . _('No'); Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/ConfirmDispatch_Invoice.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -336,7 +336,7 @@ $i=0; foreach ($_SESSION['Items']->LineItems[$LnItm->LineNumber]->Taxes AS $Tax) { if ($i>0){ - echo '<br>'; + echo '<br />'; } echo $Tax->TaxAuthDescription; $i++; @@ -353,7 +353,7 @@ $TaxTotals[$Tax->TaxAuthID]=0; } if ($i>0){ - echo '<br>'; + echo '<br />'; } if (isset($_POST['ProcessInvoice'])) { echo $Tax->TaxRate*100; Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/Credit_Invoice.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -1,5 +1,4 @@ <?php -/* $Revision: 1.35 $ */ /* $Id$*/ //$PageSecurity =3; @@ -1447,9 +1446,9 @@ echo '<div class="centre">'._('Credit Note number') . ' ' . $CreditNo . ' ' . _('has been processed'); if ($_SESSION['InvoicePortraitFormat']==0){ - echo "<br><a href='". $rootpath . "/PrintCustTrans.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; + echo "<br /><a href='". $rootpath . "/PrintCustTrans.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; } else { - echo "<br><a href='". $rootpath . "/PrintCustTransPortrait.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; + echo "<br /><a href='". $rootpath . "/PrintCustTransPortrait.php?" . SID . "&FromTransNo=" . $CreditNo . "&InvOrCredit=Credit&PrintPDF=True'>" . _('Print this credit note') . '</a>'; } echo '</div>'; /*end of process credit note */ @@ -1462,19 +1461,19 @@ echo '<tr><td>' . _('Credit Note Type') . "</td><td><select tabindex=".$j." name=CreditType>"; if (!isset($_POST['CreditType']) OR $_POST['CreditType']=="Return"){ - echo "<option selected VALUE='Return'>" . _('Goods returned to store'); - echo "<option VALUE='WriteOff'>" . _('Goods written off'); - echo "<option VALUE='ReverseOverCharge'>" . _('Reverse overcharge'); + echo '<option selected value="Return">' . _('Goods returned to store') . '</option>'; + echo '<option VALUE="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option VALUE="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } elseif($_POST['CreditType']=='WriteOff') { - echo "<option selected VALUE='WriteOff'>" . _('Goods written off'); - echo "<option VALUE='Return'>" . _('Goods returned to store'); - echo "<option VALUE='ReverseOverCharge'>" . _('Reverse overcharge'); + echo '<option selected value="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option VALUE="Return">' . _('Goods returned to store') . '</option>'; + echo '<option VALUE="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } else { - echo "<option VALUE='WriteOff'>" . _('Goods written off'); - echo "<option VALUE='Return'>" . _('Goods returned to store'); - echo "<option selected VALUE='ReverseOverCharge'>" . _('Reverse overcharge'); + echo '<option VALUE="WriteOff">' . _('Goods written off') . '</option>'; + echo '<option VALUE="Return">' . _('Goods returned to store') . '</option>'; + echo '<option selected value="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } - echo "</select></td></tr>"; + echo '</select></td></tr>'; $j++; if (!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return'){ @@ -1483,7 +1482,7 @@ echo '<tr><td>' . _('Goods returned to location') . '</td><td><select tabindex='.$j.' name=Location>'; - $SQL="SELECT loccode, locationname FROM locations"; + $SQL='SELECT loccode, locationname FROM locations'; $Result = DB_query($SQL,$db); if (!isset($_POST['Location'])){ @@ -1504,23 +1503,23 @@ echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select TABINDEX='.$j.' name="WriteOffGLCode">'; - $SQL="SELECT accountcode, + $SQL='SELECT accountcode, accountname FROM chartmaster, accountgroups WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=1 ORDER BY chartmaster.accountcode"; + AND ccountgroups.pandl=1 ORDER BY chartmaster.accountcode'; $Result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($Result)) { - if ($_POST['WriteOffGLCode']==$myrow["accountcode"]){ - echo "<option selected value=" . $myrow["accountcode"] . ">" . $myrow["accountname"]; + if ($_POST['WriteOffGLCode']==$myrow['accountcode']){ + echo '<option selected value=' . $myrow['accountcode'] . '>' . $myrow['accountname']. '</option>'; } else { - echo "<option value=" . $myrow["accountcode"] . ">" . $myrow["accountname"]; + echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountname'] . '</option>'; } } - echo "</select></td></tr>"; + echo '</select></td></tr>'; } if (!isset($_POST['CreditText'])) { $_POST['CreditText'] = ''; @@ -1529,9 +1528,9 @@ echo '<tr><td>' . _('Credit note text') . '</td><td><textarea tabindex='.$j.' name=CreditText cols=31 rows=5>' . $_POST['CreditText'] . '</textarea></td></tr>'; echo '</table><br><div class="centre"><input TABINDEX='.$j.' type=submit name=Update Value=' . _('Update') . '><p>'; $j++; - echo "<input type=submit tabindex=".$j++." name='ProcessCredit' Value='" . _('Process Credit') ."'></div>"; + echo '<input type="submit" tabindex='.$j++.' name="ProcessCredit" Value="' . _('Process Credit') .'"></div>'; } -echo "</form>"; -include("includes/footer.inc"); +echo '</form>'; +include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/FixedAssetItems.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -101,6 +101,12 @@ $Errors[$i] = 'AssetCategoryID'; $i++; } + if (trim($_POST['AssetLocation'])==''){ + $InputError = 1; + prnMsg(_('There are no asset locations defined. All assets must belong to a valid location,'),'error'); + $Errors[$i] = 'AssetLocation'; + $i++; + } if (!is_numeric($_POST['DepnRate']) OR $_POST['DepnRate']>100 OR $_POST['DepnRate']<0){ $InputError = 1; prnMsg(_('The depreciation rate is expected to be a number between 0 and 100'),'error'); @@ -506,7 +512,7 @@ echo '<option value="' . $myrow['locationid'] .'">' . $myrow['locationdescription'] . '</option>'; } } -echo '</select></td></tr>'; +echo '</select><a target="_blank" href="'. $rootpath . '/FixedAssetLocations.php">'.' ' . _('Add Asset Location') . '</a></td></tr>'; echo '<tr><td>' . _('Bar Code') . ':</td><td><input ' . (in_array('BarCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BarCode" size=22 maxlength=20 value="' . $_POST['BarCode'] . '"></td></tr>'; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/PO_Items.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -35,21 +35,21 @@ if (isset($_POST['UpdateLines']) OR isset($_POST['Commit'])) { foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted == false) { - if (!is_numeric($_POST['ConversionFactor'.$POLine->LineNo])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'.$POLine->LineNo])))){ prnMsg(_('The conversion factor is expected to be numeric - the figure which converts from our units to the supplier units. e.g. if the supplier units is a tonne and our unit is a kilogram then the conversion factor that converts our unit to the suppliers unit is 1000'),'error'); $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = 1; } else { //a valid number for the conversion factor is entered - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = $_POST['ConversionFactor'.$POLine->LineNo]; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'.$POLine->LineNo])); } - if (!is_numeric($_POST['SuppQty'.$POLine->LineNo])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppQty'.$POLine->LineNo])))){ prnMsg(_('The quantity in the supplier units is expected to be numeric. Please re-enter as a number'),'error'); } else { //ok to update the PO object variables - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=$_POST['SuppQty'.$POLine->LineNo]*$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Quantity=doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppQty'.$POLine->LineNo]))*doubleval(str_replace($locale_info['thousands_sep'],'',$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor)); } - if (!is_numeric($_POST['SuppPrice'.$POLine->LineNo])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppPrice'.$POLine->LineNo])))){ prnMsg(_('The supplier price is expected to be numeric. Please re-enter as a number'),'error'); } else { //ok to update the PO object variables - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=$_POST['SuppPrice'.$POLine->LineNo]/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppPrice'.$POLine->LineNo]))/doubleval(str_replace($locale_info['thousands_sep'],'',$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor)); } $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->NetWeight=$_POST['NetWeight'.$POLine->LineNo]; $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; @@ -413,14 +413,14 @@ if ($_SESSION['PO'.$identifier]->AllowPrintPO==1 AND ($_SESSION['PO'.$identifier]->Status=='Authorised' OR $_SESSION['PO'.$identifier]->Status=='Printed')){ - echo '<br /><a target="_blank" href="'.$rootpath.'/PO_PDFPurchOrder.php?' . SID . '&OrderNo=' . $_SESSION['PO'.$identifier]->OrderNo . '">' . _('Print Purchase Order') . '</a>'; + echo '<br /><a target="_blank" href="'.$rootpath.'/PO_PDFPurchOrder.php?OrderNo=' . $_SESSION['PO'.$identifier]->OrderNo . '">' . _('Print Purchase Order') . '</a>'; } } /*end of if its a new order or an existing one */ $Result = DB_Txn_Commit($db); unset($_SESSION['PO'.$identifier]); /*Clear the PO data to allow a newy to be input*/ - echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Return To PO List') . '</a>'; + echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Return To PO List') . '</a>'; include('includes/footer.inc'); exit; } /*end if there were no input errors trapped */ @@ -450,7 +450,7 @@ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the ordered item entered must be a positive amount'),'error'); } - if (!is_numeric($_POST['Price'])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The price entered must be numeric'),'error'); } @@ -518,6 +518,9 @@ if ($AllowUpdate == true){ //adding the non-stock item + $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])); + $_POST['Qty'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])); + $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, '', 0, /*Serialised */ @@ -549,7 +552,6 @@ $_POST['Qty'], ($_POST['Qty']*$_POST['Price']), $_POST['AssetID']); - include ('includes/PO_UnsetFormVbls.php'); } } Modified: trunk/SelectAsset.php =================================================================== --- trunk/SelectAsset.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/SelectAsset.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -171,6 +171,7 @@ $ErrMsg = _('No assets were returned by the SQL because'); $DbgMsg = _('The SQL that returned an error was'); $searchresult = DB_query($SQL, $db, $ErrMsg, $DbgMsg); + echo $SQL; if (DB_num_rows($searchresult) == 0) { prnMsg(_('No assets were returned by this search please re-enter alternative criteria to try again'), 'info'); Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/SelectCreditItems.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -72,7 +72,7 @@ //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - $SQL = 'SELECT + $SQL = "SELECT custbranch.debtorno, custbranch.brname, custbranch.contactname, @@ -80,7 +80,7 @@ custbranch.faxno, custbranch.branchcode FROM custbranch - WHERE custbranch.brname ' . LIKE ."'$SearchString' + WHERE custbranch.brname " . LIKE . "'" . $SearchString . "' AND custbranch.disabletrans=0"; } elseif (strlen($_POST['CustCode'])>0){ Modified: trunk/Z_DeleteInvoice.php =================================================================== --- trunk/Z_DeleteInvoice.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/Z_DeleteInvoice.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -132,7 +132,7 @@ echo '<br><br>'; /* Delete any GL Transaction records*/ -$SQL = "DELETE FROM gltrans WHERE type=10 AND transno='" . $_GET['InvoiceNo'] . "'"; +$SQL = "DELETE FROM gltrans WHERE gltrans.type=10 AND gltrans.typeno='" . $_GET['InvoiceNo'] . "'"; $ErrMsg = _('The SQL to delete the general ledger journal records failed because'); $Result = DB_query($SQL, $db,$ErrMsg,$DbgMsg,true); prnMsg(_('The GL journal records associated with the invoice have been deleted'),'info'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/doc/Change.log.html 2011-02-18 09:56:52 UTC (rev 4492) @@ -1,5 +1,11 @@ -<p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p +<p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p /> +<p>18/2/11: PO_Items.php make number_format variables turn back into numbers for > 1000</p> +<p>16/2/11: FixedAssetItems.php now checks for location before allowing additions</p> +<p>16/2/11: Company preferences - changed wording of stock integration at cost removed the word standard as suggested by Exson</p> +<p>16/2/11: SelectCreditItems.php formating/conventions lower case html and CreditInvoice.php</p> +<p>15/2/11: Phil Make invoicing warn the user when no taxes are defined for a tax group - i.e. there is a configuration error with taxes</p> +<p /> <p>15/2/11 Release 4.03RC2</p> <p /> <p>15/2/11: Phil UpgradeDatabase.php fix to upgrade from 4.01RC1 !!</p> Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2011-02-15 06:31:08 UTC (rev 4491) +++ trunk/includes/DefineCartClass.php 2011-02-18 09:56:52 UTC (rev 4492) @@ -341,15 +341,20 @@ $ErrMsg = _('The taxes and rates for this item could not be retrieved because'); $GetTaxRatesResult = DB_query($SQL,$db,$ErrMsg); unset($this->LineItems[$LineNumber]->Taxes); - while ($myrow = DB_fetch_array($GetTaxRatesResult)){ - - $this->LineItems[$LineNumber]->Taxes[$myrow['calculationorder']] = new Tax($myrow['calculationorder'], - $myrow['taxauthid'], - $myrow['description'], - $myrow['taxrate'], - $myrow['taxontax'], - $myrow['taxglcode']); - } + if (DB_num_rows($GetTaxRatesResult)==0){ + prnMsg(_('It appears that taxes are not defined correctly for this customer tax group') ,'error'); + } else { + + while ($myrow = DB_fetch_array($GetTaxRatesResult)){ + + $this->LineItems[$LineNumber]->Taxes[$myrow['calculationorder']] = new Tax($myrow['calculationorder'], + $myrow['taxauthid'], + $myrow['description'], + $myrow['taxrate'], + $myrow['taxontax'], + $myrow['taxglcode']); + } //end loop around different taxes + } //end if there are some taxes defined } //end method GetTaxes function GetFreightTaxes () { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |