From: <dai...@us...> - 2014-10-04 03:41:03
|
Revision: 6906 http://sourceforge.net/p/web-erp/reponame/6906 Author: daintree Date: 2014-10-04 03:40:57 +0000 (Sat, 04 Oct 2014) Log Message: ----------- invoice attempt to lose rounding issue Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/doc/INSTALL.txt Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2014-10-03 21:28:56 UTC (rev 6905) +++ trunk/ConfirmDispatch_Invoice.php 2014-10-04 03:40:57 UTC (rev 6906) @@ -245,7 +245,7 @@ foreach ($Itm->SerialItems as $SerialItem) { //calculate QtyDispatched from bundle quantities $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyDispatched += $SerialItem->BundleQty; } - //Preventing from dispatched more than ordered. Since it's controlled items, users must select the batch/lot again. + //Preventing from dispatched more than ordered. Since it's controlled items, users must select the batch/lot again. if($_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyDispatched > ($_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyInv)){ prnMsg(_('Dispathed Quantity should not be more than order balanced quantity').'. '._('To dispatch quantity is').' '.$_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyDispatched.' '._('And the order balance is ').' '.($_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->Quantity - $_SESSION['Items'.$identifier]->LineItems[$Itm->LineNumber]->QtyInv),'error'); include('includes/footer.inc'); @@ -561,12 +561,6 @@ $DisplaySubTotal = locale_number_format(($_SESSION['Items'.$identifier]->total + filter_number_format($_POST['ChargeFreightCost'])),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); - -/* round the totals to avoid silly entries */ -$TaxTotal = round($TaxTotal,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); -$_SESSION['Items'.$identifier]->total = round($_SESSION['Items'.$identifier]->total,$_SESSION['Items'.$identifier]->CurrDecimalPlaces); -$_POST['ChargeFreightCost'] = round(filter_number_format($_POST['ChargeFreightCost']),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); - echo '<tr> <td colspan="8" class="number">' . _('Invoice Totals'). '</td> <td class="number"><hr /><b>' . $DisplaySubTotal . '</b><hr /></td> @@ -575,6 +569,7 @@ <td class="number"><hr /><b>' . locale_number_format($TaxTotal+($_SESSION['Items'.$identifier]->total + $_POST['ChargeFreightCost']),$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</b><hr /></td> </tr>'; + if (! isset($_POST['DispatchDate']) OR ! Is_Date($_POST['DispatchDate'])){ $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat'],CalcEarliestDispatchDate()); } else { @@ -1376,7 +1371,7 @@ '" . $PeriodNo . "', '" . $SalesGLAccounts['salesglcode'] . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . " - " . $OrderLine->StockID . " x " . $OrderLine->QtyDispatched . " @ " . $OrderLine->Price . "', - '" . round((-$OrderLine->Price * $OrderLine->QtyDispatched/$_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']) . "')"; + '" . (-$OrderLine->Price * $OrderLine->QtyDispatched/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales GL posting could not be inserted because'); $DbgMsg = '<br />' ._('The following SQL to insert the GLTrans record was used'); @@ -1398,7 +1393,7 @@ '" . $PeriodNo . "', '" . $SalesGLAccounts['discountglcode'] . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . " - " . $OrderLine->StockID . " @ " . ($OrderLine->DiscountPercent * 100) . "%', - '" . round(($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent/$_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']) . "')"; + '" . ($OrderLine->Price * $OrderLine->QtyDispatched * $OrderLine->DiscountPercent/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales discount GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1510,7 +1505,7 @@ '" . $PeriodNo . "', '" . $DisposalRow['disposalact'] . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . " - " . $OrderLine->StockID . ' ' . _('asset disposal proceeds') . "', - '" . round((-$OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']) . "')"; + '" . (-$OrderLine->Price * $OrderLine->QtyDispatched* (1 - $OrderLine->DiscountPercent)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The disposal proceeds GL posting could not be inserted because'); $DbgMsg = '<br />' ._('The following SQL to insert the GLTrans record was used'); @@ -1576,7 +1571,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . round((($_SESSION['Items'.$identifier]->total + $_SESSION['Items'.$identifier]->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']) . "')"; + '" . (($_SESSION['Items'.$identifier]->total + $_SESSION['Items'.$identifier]->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the total debtors control GLTrans record was used'); @@ -1601,7 +1596,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['freightact'] . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . round((-$_SESSION['Items'.$identifier]->FreightCost/$_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']) . "')"; + '" . (-$_SESSION['Items'.$identifier]->FreightCost/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The freight GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); @@ -1623,7 +1618,7 @@ '" . $PeriodNo . "', '" . $TaxGLCodes[$TaxAuthID] . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . round((-$TaxAmount/$_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']) . "')"; + '" . (-$TaxAmount/$_SESSION['CurrencyRate']) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The tax GL posting could not be inserted because'); $DbgMsg = _('The following SQL to insert the GLTrans record was used'); Modified: trunk/doc/INSTALL.txt =================================================================== --- trunk/doc/INSTALL.txt 2014-10-03 21:28:56 UTC (rev 6905) +++ trunk/doc/INSTALL.txt 2014-10-04 03:40:57 UTC (rev 6906) @@ -18,7 +18,7 @@ at the beginning of the script. Where mydatabase is the name of the company database that you are using in your webERP installation. -It is recommended to use phpMyAdmin to run the upgrade script since you select the database to use using the web GUI and you can click on the import tab and select the upgrade script to run against the DB more easily. +It is recommended to use phpMyAdmin to run the upgrade script since you select the database to use using the web GUI and you can click on the import tab and select the upgrade script to run against the DB more easily. If you are running the upgrade script with the mysql command line client, after editing the script as described above the syntax to use is as follows: @@ -27,16 +27,16 @@ where weberp_db_user is the name of your mysql user and some_pass is the password for that user. -If you have some modified scripts that you require these should be saved in a separate directory for the purposes of reworking against the new scripts. +If you have some modified scripts that you require these should be saved in a separate directory for the purposes of reworking against the new scripts. The old version scripts should be deleted and the new scripts extracted to the webERP installation directory under the web-server root directory. config.php will require modification for your database username and password and company specific details. ***************New Installations*************** -There is an automated Installation script to +There is an automated Installation script to -Extract the webERP archive under your web-root directory (folder). Browse to the +Extract the webERP archive under your web-root directory (folder). Browse to the http://yourhost/webERP/ @@ -56,7 +56,7 @@ - A working PHP web server - v 5.0 or later is required (it no longer works with versions prior) PHP must have support for mysql databases (either mysql or mysqli), gd, gettext (for translations), libxml, mbstring and ftp - A working MySQL server (MySql version 4.1 or above - innodb tables MUST be enabled - check your my.cnf file to ensure innodb tables are enabled (normally under /etc/my.cnf or the mysql data directory - see the MySQL manual). -Installing these components are well covered elsewhere - but if you need to install these components the recommended solution under windows would be to download and install apache2triad - http://apache2triad.net/ or under windows or *nix download and install XAMPP - http://www.apachefriends.org/en/xampp.html +Installing these components are well covered elsewhere - but if you need to install these components the recommended solution under windows would be to download and install AMPPS see http://www.ampps.com/ or under windows. AMPPS also has a one click install option for webERP and a multitude of other PHP/MYSQL - LAMP stack web-applications. On *nix download and install XAMPP - https://www.apachefriends.org/index.html PHP must have the register globals configuration parameter set to off. This is the default (now). This flag can be set in the php.ini on the server. If it can't be changed on the server's php.ini, it is possibe for apache web servers to alter the configuration using a file called .htaccess. A .htaccess file is included in the webERP directory that ensures the register_globals flag is set to off for those web-servers that support .htaccess files. @@ -144,7 +144,7 @@ 2. Creating the Database -MySQL version 4.1 or above is required +MySQL version 4.1 or above is required INNODB TABLES MUST BE ENABLED IN THE MYSQL SERVER. @@ -198,7 +198,7 @@ 1. demo.sql This has a minimal amount of demonstration data in a bogus company set up so that transactions can be tried to see how the system works. 2. default.sql This script has only the basic data necessary to start a new company system off. If you wish to set up your company on webERP then this is the script to use. weberp-new.sql you will need to create a database first (using phpMyAdmin for example) or add the following sql commands to this script - CREATE DATABASE mycompanyname DEFAULT CHARACTER SET utf8 DEFAULT + CREATE DATABASE mycompanyname DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci; USE mycompanyname @@ -222,7 +222,7 @@ 3. Editing config.php -The webERP archive no longer comes with a config.php file. There is now a web-based installer that is activated when there is no config.php file. Simply browse to your webERP installation with the URL +The webERP archive no longer comes with a config.php file. There is now a web-based installer that is activated when there is no config.php file. Simply browse to your webERP installation with the URL http://yourdomain/webERP/ in your browser, @@ -259,7 +259,7 @@ //DefaultLanguage $DefaultLanguage ='en_GB.utf8'; -// Whether to display the admin login and password or not +// Whether to display the admin login and password or not $AllowDemoMode = True; // Application version @@ -341,7 +341,7 @@ All the standing configuration data is defined from the system setup tab and each link should be reviewed to enter appropriate data for the business. The manual has a section on Getting Started which is essential reading before going live. -Please try not to refer questions about PHP or database configuration +Please try not to refer questions about PHP or database configuration - check your PHP web server works by installing phpMyAdmin before referring any installation issues - check http://www.weberp.org for Installation FAQ |