From: <ice...@us...> - 2012-09-12 07:04:57
|
Revision: 5660 http://web-erp.svn.sourceforge.net/web-erp/?rev=5660&view=rev Author: icedlava Date: 2012-09-12 07:04:50 +0000 (Wed, 12 Sep 2012) Log Message: ----------- Manual bookmarks for order related functions. Modified Paths: -------------- trunk/CounterSales.php trunk/DiscountCategories.php trunk/RecurringSalesOrders.php trunk/RecurringSalesOrdersProcess.php trunk/SelectOrderItems.php trunk/SelectSalesOrder.php trunk/doc/Manual/ManualSalesOrders.html Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/CounterSales.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -9,6 +9,9 @@ include('includes/session.inc'); $title = _('Counter Sales'); +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "SalesOrderCounterSales"; include('includes/header.inc'); include('includes/GetPrice.inc'); Modified: trunk/DiscountCategories.php =================================================================== --- trunk/DiscountCategories.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/DiscountCategories.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -5,7 +5,9 @@ include('includes/session.inc'); $title = _('Discount Categories Maintenance'); - +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "DiscountMatrix"; include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; @@ -140,14 +142,14 @@ if (isset($_POST['search'])) { if ($_POST['PartID']!='' and $_POST['PartDesc']=='') - $sql="SELECT stockid, description FROM stockmaster + $sql="SELECT stockid, description FROM stockmaster WHERE stockid " . LIKE . " '%".$_POST['PartID']."%'"; if ($_POST['PartID']=='' and $_POST['PartDesc']!='') - $sql="SELECT stockid, description FROM stockmaster + $sql="SELECT stockid, description FROM stockmaster WHERE description " . LIKE . " '%".$_POST['PartDesc']."%'"; if ($_POST['PartID']!='' and $_POST['PartDesc']!='') - $sql="SELECT stockid, description FROM stockmaster - WHERE stockid " . LIKE . " '%".$_POST['PartID']."%' + $sql="SELECT stockid, description FROM stockmaster + WHERE stockid " . LIKE . " '%".$_POST['PartID']."%' AND description " . LIKE . " '%".$_POST['PartDesc']."%'"; $result=DB_query($sql,$db); if (!isset($_POST['stockID'])) { Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/RecurringSalesOrders.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -5,7 +5,9 @@ include('includes/DefineCartClass.php'); /* Session started in header.inc for password checking the session will contain the details of the order from the Cart class object. The details of the order come from SelectOrderItems.php */ - +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "RecurringSalesOrders"; include('includes/session.inc'); $title = _('Recurring Orders'); include('includes/header.inc'); @@ -57,7 +59,7 @@ recurringsalesorders.stopdate, recurringsalesorders.lastrecurrence, recurringsalesorders.autoinvoice - FROM recurringsalesorders + FROM recurringsalesorders INNER JOIN debtorsmaster ON recurringsalesorders.debtorno = debtorsmaster.debtorno INNER JOIN salestypes @@ -267,7 +269,7 @@ discountpercent, narrative) VALUES ('"; - + foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { $LineItemsSQL = $StartOf_LineItemsSQL . @@ -278,9 +280,9 @@ '" . filter_number_format($StockItem->DiscountPercent) . "', '" . $StockItem->Narrative . "')"; $Ins_LineItemResult = DB_query($LineItemsSQL,$db,$ErrMsg,$DbgMsg,true); - + } /* inserted line items into sales order details */ - + $result = DB_Txn_Commit($db); prnmsg(_('The new recurring order template has been added'),'success'); Modified: trunk/RecurringSalesOrdersProcess.php =================================================================== --- trunk/RecurringSalesOrdersProcess.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/RecurringSalesOrdersProcess.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -5,23 +5,25 @@ $AllowAnyone = true; /* Get this puppy to run from cron (cd webERP && php -f RecurringSalesOrdersProcess.php "weberpdemo") or direct URL (RecurringSalesOrdersProcess.php?Database=weberpdemo) */ -if (isset($_GET['Database'])) { - $_SESSION['DatabaseName'] = $_GET['Database']; - $DatabaseName = $_GET['Database']; - $_POST['CompanyNameField'] = $_GET['Database']; +if (isset($_GET['Database'])) { + $_SESSION['DatabaseName'] = $_GET['Database']; + $DatabaseName = $_GET['Database']; + $_POST['CompanyNameField'] = $_GET['Database']; } if (isset($argc)) { - if (isset($argv[1])) { - $_SESSION['DatabaseName'] = $argv[1]; - $DatabaseName = $argv[1]; - $_POST['CompanyNameField'] = $argv[1]; + if (isset($argv[1])) { + $_SESSION['DatabaseName'] = $argv[1]; + $DatabaseName = $argv[1]; + $_POST['CompanyNameField'] = $argv[1]; } } include('includes/session.inc'); $title = _('Recurring Orders Process'); - +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "RecurringSalesOrders"; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); include('includes/GetSalesTransGLCodes.inc'); @@ -674,7 +676,7 @@ '" . filter_number_format($CurrencyRate) . "', '" . $RecurrOrderRow['comments'] . "', '" . $RecurrOrderRow['shipvia'] . "')"; - + $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction record could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/SelectOrderItems.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -13,6 +13,9 @@ } else { $title = _('Select Order Items'); } +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "SalesOrderEntry"; include('includes/header.inc'); include('includes/GetPrice.inc'); Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/SelectSalesOrder.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -4,6 +4,9 @@ include('includes/session.inc'); $title = _('Search Outstanding Sales Orders'); +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "SelectSalesOrder"; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); Modified: trunk/doc/Manual/ManualSalesOrders.html =================================================================== --- trunk/doc/Manual/ManualSalesOrders.html 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/doc/Manual/ManualSalesOrders.html 2012-09-12 07:04:50 UTC (rev 5660) @@ -38,7 +38,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div><!-- Help Begin: SelectOrderItems --> -<h2>Entry of Sales Orders</h2> +<h2><a id="SalesOrderEntry">Entry of Sales Orders</a></h2> <p>From the main menu, Orders tab, click the Order Entry link.</p> @@ -86,7 +86,7 @@ <p>Once all details are entered correctly the Place Order button should be clicked. It is important to note that abandoning the order before this button is clicked there have been no updates to the database and nothing is saved. Clicking into some other screen loses the order as entered. Whilst it is perfectly acceptable to have several browser screens open looking at different inquiries at the same time. It is not possible to have two windows entering two separate sales orders at the same time, entries in the one window will over-write the other. <!-- Help End: SelectOrderItems --></p> -<h3>Entry of Cash Sales Directly - Counter Sales</h3> +<h3><a id="SalesOrderCounterSales">Entry of Cash Sales Directly - Counter Sales</a></h3> <p>In version 3.12 of webERP a new feature was introduced which allowed for cash sales to be entered directly without first entering an order and then confirming a dispatch to invoice. This feature is known as "counter sales". From the main menu->Sales tab select Enter Counter Sales. Entry is similar to entering an order, by default the quick entry screen allows entry of item codes and quantities but it is also possible to select items by the search functions in much the same way as an order. The tax is calculated and the total amount to pay is shown. This page also expects the payment to be made and entered. The payment entered is automatically allocated to the sale.</p> @@ -96,7 +96,7 @@ <p>webERP looks at the user's default location and then looks up against the location record to find the cash sales debtor account (and branch) to use for counter sales entered. Each location for which counter sales are required must first be set up with the cash sales customer and branch which is to be used for counter sales entered. Note that the default location of the customer branch is ignored - the user's default location (see Setup->General->User Maintenance - the script webERP/WWW_Users.php) is used as the location and stock movements are all created from this location against the customer specified in the location record (Setup - > Inventory Setup -> Location Maintenance - the script webERP/Locations.php). To specify the customer and branch to use for counter sales for an inventory location (or warehouse), the customer code and branch code must be entered in the format customercode-branchcode in the field provided for this purpose. i.e. the customer code then a hyphen then the branch code.</p><!-- Help Begin: SelectSalesOrder --> -<h2>Modfiying An Order</h2> +<h2><a id="ModifyOrder">Modfiying An Order</a></h2> <p>Only Outstanding sales orders can be modified. Only these orders have any balance of a quantity remaining to be delivered and/or invoiced. Order lines that have been invoiced completely will not be available for modification. New items cannot be added to the order. Pricing cannot be altered if any amount of the line has already been delivered/invoiced. Quantities of an order line cannot be reduced below the quantity of the line already invoiced.</p> @@ -106,7 +106,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div> -<h3>Selecting an Outstanding Sales Order</h3> +<h3><a id="SelectSalesOrder">Selecting an Outstanding Sales Order</a></h3> <p>There are several ways:</p> @@ -138,7 +138,7 @@ </div><!-- Help End: Quotations --> <!-- Help Begin: RecurringSalesOrder --> -<h2>Recurring Sales Orders</h2> +<h2><a id="RecurringSalesOrders">Recurring Sales Orders</a></h2> <p>Orders entered can be defined so as to recurr at a desired frequency entered as:</p> @@ -183,7 +183,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div> -<h2>Discount Matrix</h2> +<h2><a id="DiscountMatrix">Discount Matrix</a></h2> <p>webERP has a system called a discount matrix which allows any group of products to be defined and discounts applicable to all items of the group to be set up just once for the whole group of items. Different discounts can be applied to the "discount group" for each sales type (price list). When an item is entered into a sales order the system retrieves the correct price based on the customer's sales type (price list) and then retrieves the appropriate discount based on the quantity of the item and the other items already entered on the order. The discounts retrieved can be over-ridden.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ice...@us...> - 2012-09-12 07:04:57
|
Revision: 5660 http://web-erp.svn.sourceforge.net/web-erp/?rev=5660&view=rev Author: icedlava Date: 2012-09-12 07:04:50 +0000 (Wed, 12 Sep 2012) Log Message: ----------- Manual bookmarks for order related functions. Modified Paths: -------------- trunk/CounterSales.php trunk/DiscountCategories.php trunk/RecurringSalesOrders.php trunk/RecurringSalesOrdersProcess.php trunk/SelectOrderItems.php trunk/SelectSalesOrder.php trunk/doc/Manual/ManualSalesOrders.html Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/CounterSales.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -9,6 +9,9 @@ include('includes/session.inc'); $title = _('Counter Sales'); +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "SalesOrderCounterSales"; include('includes/header.inc'); include('includes/GetPrice.inc'); Modified: trunk/DiscountCategories.php =================================================================== --- trunk/DiscountCategories.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/DiscountCategories.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -5,7 +5,9 @@ include('includes/session.inc'); $title = _('Discount Categories Maintenance'); - +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "DiscountMatrix"; include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; @@ -140,14 +142,14 @@ if (isset($_POST['search'])) { if ($_POST['PartID']!='' and $_POST['PartDesc']=='') - $sql="SELECT stockid, description FROM stockmaster + $sql="SELECT stockid, description FROM stockmaster WHERE stockid " . LIKE . " '%".$_POST['PartID']."%'"; if ($_POST['PartID']=='' and $_POST['PartDesc']!='') - $sql="SELECT stockid, description FROM stockmaster + $sql="SELECT stockid, description FROM stockmaster WHERE description " . LIKE . " '%".$_POST['PartDesc']."%'"; if ($_POST['PartID']!='' and $_POST['PartDesc']!='') - $sql="SELECT stockid, description FROM stockmaster - WHERE stockid " . LIKE . " '%".$_POST['PartID']."%' + $sql="SELECT stockid, description FROM stockmaster + WHERE stockid " . LIKE . " '%".$_POST['PartID']."%' AND description " . LIKE . " '%".$_POST['PartDesc']."%'"; $result=DB_query($sql,$db); if (!isset($_POST['stockID'])) { Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/RecurringSalesOrders.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -5,7 +5,9 @@ include('includes/DefineCartClass.php'); /* Session started in header.inc for password checking the session will contain the details of the order from the Cart class object. The details of the order come from SelectOrderItems.php */ - +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "RecurringSalesOrders"; include('includes/session.inc'); $title = _('Recurring Orders'); include('includes/header.inc'); @@ -57,7 +59,7 @@ recurringsalesorders.stopdate, recurringsalesorders.lastrecurrence, recurringsalesorders.autoinvoice - FROM recurringsalesorders + FROM recurringsalesorders INNER JOIN debtorsmaster ON recurringsalesorders.debtorno = debtorsmaster.debtorno INNER JOIN salestypes @@ -267,7 +269,7 @@ discountpercent, narrative) VALUES ('"; - + foreach ($_SESSION['Items'.$identifier]->LineItems as $StockItem) { $LineItemsSQL = $StartOf_LineItemsSQL . @@ -278,9 +280,9 @@ '" . filter_number_format($StockItem->DiscountPercent) . "', '" . $StockItem->Narrative . "')"; $Ins_LineItemResult = DB_query($LineItemsSQL,$db,$ErrMsg,$DbgMsg,true); - + } /* inserted line items into sales order details */ - + $result = DB_Txn_Commit($db); prnmsg(_('The new recurring order template has been added'),'success'); Modified: trunk/RecurringSalesOrdersProcess.php =================================================================== --- trunk/RecurringSalesOrdersProcess.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/RecurringSalesOrdersProcess.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -5,23 +5,25 @@ $AllowAnyone = true; /* Get this puppy to run from cron (cd webERP && php -f RecurringSalesOrdersProcess.php "weberpdemo") or direct URL (RecurringSalesOrdersProcess.php?Database=weberpdemo) */ -if (isset($_GET['Database'])) { - $_SESSION['DatabaseName'] = $_GET['Database']; - $DatabaseName = $_GET['Database']; - $_POST['CompanyNameField'] = $_GET['Database']; +if (isset($_GET['Database'])) { + $_SESSION['DatabaseName'] = $_GET['Database']; + $DatabaseName = $_GET['Database']; + $_POST['CompanyNameField'] = $_GET['Database']; } if (isset($argc)) { - if (isset($argv[1])) { - $_SESSION['DatabaseName'] = $argv[1]; - $DatabaseName = $argv[1]; - $_POST['CompanyNameField'] = $argv[1]; + if (isset($argv[1])) { + $_SESSION['DatabaseName'] = $argv[1]; + $DatabaseName = $argv[1]; + $_POST['CompanyNameField'] = $argv[1]; } } include('includes/session.inc'); $title = _('Recurring Orders Process'); - +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "RecurringSalesOrders"; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); include('includes/GetSalesTransGLCodes.inc'); @@ -674,7 +676,7 @@ '" . filter_number_format($CurrencyRate) . "', '" . $RecurrOrderRow['comments'] . "', '" . $RecurrOrderRow['shipvia'] . "')"; - + $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction record could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/SelectOrderItems.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -13,6 +13,9 @@ } else { $title = _('Select Order Items'); } +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "SalesOrderEntry"; include('includes/header.inc'); include('includes/GetPrice.inc'); Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/SelectSalesOrder.php 2012-09-12 07:04:50 UTC (rev 5660) @@ -4,6 +4,9 @@ include('includes/session.inc'); $title = _('Search Outstanding Sales Orders'); +/* webERP manual links before header.inc */ +$ViewTopic= "SalesOrders"; +$BookMark = "SelectSalesOrder"; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); Modified: trunk/doc/Manual/ManualSalesOrders.html =================================================================== --- trunk/doc/Manual/ManualSalesOrders.html 2012-09-12 06:33:35 UTC (rev 5659) +++ trunk/doc/Manual/ManualSalesOrders.html 2012-09-12 07:04:50 UTC (rev 5660) @@ -38,7 +38,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div><!-- Help Begin: SelectOrderItems --> -<h2>Entry of Sales Orders</h2> +<h2><a id="SalesOrderEntry">Entry of Sales Orders</a></h2> <p>From the main menu, Orders tab, click the Order Entry link.</p> @@ -86,7 +86,7 @@ <p>Once all details are entered correctly the Place Order button should be clicked. It is important to note that abandoning the order before this button is clicked there have been no updates to the database and nothing is saved. Clicking into some other screen loses the order as entered. Whilst it is perfectly acceptable to have several browser screens open looking at different inquiries at the same time. It is not possible to have two windows entering two separate sales orders at the same time, entries in the one window will over-write the other. <!-- Help End: SelectOrderItems --></p> -<h3>Entry of Cash Sales Directly - Counter Sales</h3> +<h3><a id="SalesOrderCounterSales">Entry of Cash Sales Directly - Counter Sales</a></h3> <p>In version 3.12 of webERP a new feature was introduced which allowed for cash sales to be entered directly without first entering an order and then confirming a dispatch to invoice. This feature is known as "counter sales". From the main menu->Sales tab select Enter Counter Sales. Entry is similar to entering an order, by default the quick entry screen allows entry of item codes and quantities but it is also possible to select items by the search functions in much the same way as an order. The tax is calculated and the total amount to pay is shown. This page also expects the payment to be made and entered. The payment entered is automatically allocated to the sale.</p> @@ -96,7 +96,7 @@ <p>webERP looks at the user's default location and then looks up against the location record to find the cash sales debtor account (and branch) to use for counter sales entered. Each location for which counter sales are required must first be set up with the cash sales customer and branch which is to be used for counter sales entered. Note that the default location of the customer branch is ignored - the user's default location (see Setup->General->User Maintenance - the script webERP/WWW_Users.php) is used as the location and stock movements are all created from this location against the customer specified in the location record (Setup - > Inventory Setup -> Location Maintenance - the script webERP/Locations.php). To specify the customer and branch to use for counter sales for an inventory location (or warehouse), the customer code and branch code must be entered in the format customercode-branchcode in the field provided for this purpose. i.e. the customer code then a hyphen then the branch code.</p><!-- Help Begin: SelectSalesOrder --> -<h2>Modfiying An Order</h2> +<h2><a id="ModifyOrder">Modfiying An Order</a></h2> <p>Only Outstanding sales orders can be modified. Only these orders have any balance of a quantity remaining to be delivered and/or invoiced. Order lines that have been invoiced completely will not be available for modification. New items cannot be added to the order. Pricing cannot be altered if any amount of the line has already been delivered/invoiced. Quantities of an order line cannot be reduced below the quantity of the line already invoiced.</p> @@ -106,7 +106,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div> -<h3>Selecting an Outstanding Sales Order</h3> +<h3><a id="SelectSalesOrder">Selecting an Outstanding Sales Order</a></h3> <p>There are several ways:</p> @@ -138,7 +138,7 @@ </div><!-- Help End: Quotations --> <!-- Help Begin: RecurringSalesOrder --> -<h2>Recurring Sales Orders</h2> +<h2><a id="RecurringSalesOrders">Recurring Sales Orders</a></h2> <p>Orders entered can be defined so as to recurr at a desired frequency entered as:</p> @@ -183,7 +183,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div> -<h2>Discount Matrix</h2> +<h2><a id="DiscountMatrix">Discount Matrix</a></h2> <p>webERP has a system called a discount matrix which allows any group of products to be defined and discounts applicable to all items of the group to be set up just once for the whole group of items. Different discounts can be applied to the "discount group" for each sales type (price list). When an item is entered into a sales order the system retrieves the correct price based on the customer's sales type (price list) and then retrieves the appropriate discount based on the quantity of the item and the other items already entered on the order. The discounts retrieved can be over-ridden.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ice...@us...> - 2012-09-12 07:30:58
|
Revision: 5661 http://web-erp.svn.sourceforge.net/web-erp/?rev=5661&view=rev Author: icedlava Date: 2012-09-12 07:30:47 +0000 (Wed, 12 Sep 2012) Log Message: ----------- Some grammatical and typo fixes in the Petty Cash manual overview. Add bookmark links for petty cash functions. Modified Paths: -------------- trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcTabs.php trunk/PcTypeTabs.php trunk/doc/Manual/ManualPettyCash.html Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcAssignCashToTab.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -3,6 +3,9 @@ include('includes/session.inc'); $title = _('Assignment of Cash to Petty Cash Tab'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "CashAssignment"; include('includes/header.inc'); if (isset($_POST['SelectedTabs'])){ @@ -34,7 +37,7 @@ if (isset($_POST['process'])) { if ($SelectedTabs=='') { - prnMsg(_('You Must First Select a Petty Cash Tab To Assign Cash'),'error'); + prnMsg(_('You Must First Select a Petty Cash Tab To Assign Cash'),'error'); unset($SelectedTabs); } } @@ -191,8 +194,8 @@ } echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Select another tab') . '</a></div>'; - - + + if (! isset($_GET['edit']) OR isset ($_POST['GO'])){ if (isset($_POST['Cancel'])) { @@ -214,7 +217,7 @@ $result = DB_query($SqlDecimalPlaces,$db); $myrow=DB_fetch_array($result); $CurrDecimalPlaces = $myrow['decimalplaces']; - + $sql = "SELECT * FROM pcashdetails WHERE tabcode='" . $SelectedTabs . "' AND date >=DATE_SUB(CURDATE(), INTERVAL " . $Days . " DAY) Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcAuthorizeExpenses.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -3,6 +3,9 @@ include('includes/session.inc'); $title = _('Authorisation of Petty Cash Expenses'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "AuthorizeExpense"; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -99,8 +102,8 @@ while ($myrow=DB_fetch_array($result)) { $CurrDecimalPlaces = $myrow['decimalplaces']; //update database if update pressed - if (isset($_POST['Submit']) - AND $_POST['Submit']==_('Update') + if (isset($_POST['Submit']) + AND $_POST['Submit']==_('Update') AND isset($_POST[$myrow['counterindex']])){ $PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db); Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcClaimExpensesFromTab.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -4,6 +4,9 @@ include('includes/session.inc'); $title = _('Claim Petty Cash Expenses From Tab'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "ExpenseClaim"; include('includes/header.inc'); Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcExpenses.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -4,6 +4,9 @@ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Of Expenses'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "PCExpenses"; include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Payment Entry') Modified: trunk/PcTabs.php =================================================================== --- trunk/PcTabs.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcTabs.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -3,6 +3,9 @@ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Tabs'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "PCTabSetup"; include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Payment Entry') . '" alt="" />' . ' ' . $title . '</p>'; Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcTypeTabs.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -3,6 +3,9 @@ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Type of Tabs'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "PCTabTypes"; include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Payment Entry') @@ -211,15 +214,15 @@ echo '<input type="hidden" name="SelectedTab" value="' . $SelectedTab . '" />'; echo '<input type="hidden" name="TypeTabCode" value="' . $_POST['TypeTabCode']. '" />'; - echo '<table class="selection"> + echo '<table class="selection"> <tr><td>' . _('Code Of Type Of Tab') . ':</td> <td>' . $_POST['TypeTabCode'] . '</td> </tr>'; // We dont allow the user to change an existing type code - + } else { // This is a new type so the user may volunteer a type code Modified: trunk/doc/Manual/ManualPettyCash.html =================================================================== --- trunk/doc/Manual/ManualPettyCash.html 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/doc/Manual/ManualPettyCash.html 2012-09-12 07:30:47 UTC (rev 5661) @@ -2,19 +2,19 @@ <h2>Overview</h2> -<p>This for employees to submit expense claims directly in the system - that are then authorised by their immediate supervisor.</p> +<p>The Petty Cash module enables employees to submit expense claims directly into the system that can then be authorised by their immediate supervisor.</p> -<p>Allows control petty cash expenses in a friendly way, so every employee (without any accounting knowlegde) can enter their expenses, get paid for them, etc</p> +<p>Petty cash expenses are controlled in a friendly way, enabling all employees (including those without accounting knowledge) to enter their expenses and get paid for them.</p> -<p>It consists on a temporary GL table (pcashdetails), containing all info about payments and expenses done as petty cash. Once authorized by a supervisor (both cash assignments or expenses) are posted in gltrans table and flagged.</p> +<p>The Petty cash module uses a temporary GL table (pcashdetails), containing all information about payments and expenses entered as petty cash. When cash assignments or expenses are authorized by a supervisor, they are posted into the gltrans table and flagged.</p> -<p>Once any transacion in the petty cash system has been posted can not be modified, edited or deleted in any way. Once posted, that's it.</p> +<p>Once any transaction in the petty cash system has been posted it cannot be modified, edited or deleted in any way. Once posted, that's it.</p> <div class="floatright"> <a class="minitext" href="#top">⬆ Top</a> </div> <h2>Setup General Parameters</h2> -<h3>Set up expenses</h3> +<h3><a id="PCExpenses">Set up expenses</a></h3> <h4>Definition of expenses allowed to be used in the Petty Cash system.</h4> @@ -29,7 +29,7 @@ <div class="floatright"> <a class="minitext" href="#top">⬆ Top</a> </div> -<h3>Set up types of tabs</h3> +<h3><a id="PCTabTypes">Set up types of tabs</a></h3> <p>Different kinds of users have different privileges. CEO can spend petty cash money on a different way than a truck driver does (no disrespect, for any of them ;-). The system maintain these different categories of tabs of table pctypetabs.</p> @@ -46,7 +46,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div> -<h3>Set up tabs</h3> +<h3><a id="PCTabSetup">Set up tabs</a></h3> <p>PcTabs.php is the script used to set up petty cash tabs</p> @@ -76,7 +76,7 @@ </div> <h2>Workflow</h2> -<h3>Assignment of cash</h3> +<h3><a id="CashAssignment">Assignment of cash</a></h3> <p>The supervisor (authorizer) gives money cash to an employee to be used as petty cash. In script PcAssignCashToTab.php we record this fact.<br></p> @@ -92,7 +92,7 @@ <p>Cash Assignments can be edited and deleted before are authorized. Once authorized and posted can not be modified in any way.<br></p> -<h3>Expense claims</h3> +<h3><a id="ExpenseClaim">Expense claims</a></h3> <p>Employee will go out and spend money. Then will report to webERP these expenses in script PcClaimExpensesFromTab.php<br></p> @@ -114,7 +114,7 @@ <p>Expenses reported can be edited and deleted before are authorized. Once authorized and posted can not be modified in any way.<br></p> -<h3>Expense authorisation</h3> +<h3><a id="AuthorizeExpense">Expense authorisation</a></h3> <p>Supervisor will need to authorize expenses and cash assignemnts reported.<br></p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ice...@us...> - 2012-09-12 07:30:58
|
Revision: 5661 http://web-erp.svn.sourceforge.net/web-erp/?rev=5661&view=rev Author: icedlava Date: 2012-09-12 07:30:47 +0000 (Wed, 12 Sep 2012) Log Message: ----------- Some grammatical and typo fixes in the Petty Cash manual overview. Add bookmark links for petty cash functions. Modified Paths: -------------- trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcTabs.php trunk/PcTypeTabs.php trunk/doc/Manual/ManualPettyCash.html Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcAssignCashToTab.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -3,6 +3,9 @@ include('includes/session.inc'); $title = _('Assignment of Cash to Petty Cash Tab'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "CashAssignment"; include('includes/header.inc'); if (isset($_POST['SelectedTabs'])){ @@ -34,7 +37,7 @@ if (isset($_POST['process'])) { if ($SelectedTabs=='') { - prnMsg(_('You Must First Select a Petty Cash Tab To Assign Cash'),'error'); + prnMsg(_('You Must First Select a Petty Cash Tab To Assign Cash'),'error'); unset($SelectedTabs); } } @@ -191,8 +194,8 @@ } echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Select another tab') . '</a></div>'; - - + + if (! isset($_GET['edit']) OR isset ($_POST['GO'])){ if (isset($_POST['Cancel'])) { @@ -214,7 +217,7 @@ $result = DB_query($SqlDecimalPlaces,$db); $myrow=DB_fetch_array($result); $CurrDecimalPlaces = $myrow['decimalplaces']; - + $sql = "SELECT * FROM pcashdetails WHERE tabcode='" . $SelectedTabs . "' AND date >=DATE_SUB(CURDATE(), INTERVAL " . $Days . " DAY) Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcAuthorizeExpenses.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -3,6 +3,9 @@ include('includes/session.inc'); $title = _('Authorisation of Petty Cash Expenses'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "AuthorizeExpense"; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -99,8 +102,8 @@ while ($myrow=DB_fetch_array($result)) { $CurrDecimalPlaces = $myrow['decimalplaces']; //update database if update pressed - if (isset($_POST['Submit']) - AND $_POST['Submit']==_('Update') + if (isset($_POST['Submit']) + AND $_POST['Submit']==_('Update') AND isset($_POST[$myrow['counterindex']])){ $PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db); Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcClaimExpensesFromTab.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -4,6 +4,9 @@ include('includes/session.inc'); $title = _('Claim Petty Cash Expenses From Tab'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "ExpenseClaim"; include('includes/header.inc'); Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcExpenses.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -4,6 +4,9 @@ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Of Expenses'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "PCExpenses"; include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Payment Entry') Modified: trunk/PcTabs.php =================================================================== --- trunk/PcTabs.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcTabs.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -3,6 +3,9 @@ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Tabs'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "PCTabSetup"; include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Payment Entry') . '" alt="" />' . ' ' . $title . '</p>'; Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/PcTypeTabs.php 2012-09-12 07:30:47 UTC (rev 5661) @@ -3,6 +3,9 @@ include('includes/session.inc'); $title = _('Maintenance Of Petty Cash Type of Tabs'); +/* webERP manual links before header.inc */ +$ViewTopic= "PettyCash"; +$BookMark = "PCTabTypes"; include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Payment Entry') @@ -211,15 +214,15 @@ echo '<input type="hidden" name="SelectedTab" value="' . $SelectedTab . '" />'; echo '<input type="hidden" name="TypeTabCode" value="' . $_POST['TypeTabCode']. '" />'; - echo '<table class="selection"> + echo '<table class="selection"> <tr><td>' . _('Code Of Type Of Tab') . ':</td> <td>' . $_POST['TypeTabCode'] . '</td> </tr>'; // We dont allow the user to change an existing type code - + } else { // This is a new type so the user may volunteer a type code Modified: trunk/doc/Manual/ManualPettyCash.html =================================================================== --- trunk/doc/Manual/ManualPettyCash.html 2012-09-12 07:04:50 UTC (rev 5660) +++ trunk/doc/Manual/ManualPettyCash.html 2012-09-12 07:30:47 UTC (rev 5661) @@ -2,19 +2,19 @@ <h2>Overview</h2> -<p>This for employees to submit expense claims directly in the system - that are then authorised by their immediate supervisor.</p> +<p>The Petty Cash module enables employees to submit expense claims directly into the system that can then be authorised by their immediate supervisor.</p> -<p>Allows control petty cash expenses in a friendly way, so every employee (without any accounting knowlegde) can enter their expenses, get paid for them, etc</p> +<p>Petty cash expenses are controlled in a friendly way, enabling all employees (including those without accounting knowledge) to enter their expenses and get paid for them.</p> -<p>It consists on a temporary GL table (pcashdetails), containing all info about payments and expenses done as petty cash. Once authorized by a supervisor (both cash assignments or expenses) are posted in gltrans table and flagged.</p> +<p>The Petty cash module uses a temporary GL table (pcashdetails), containing all information about payments and expenses entered as petty cash. When cash assignments or expenses are authorized by a supervisor, they are posted into the gltrans table and flagged.</p> -<p>Once any transacion in the petty cash system has been posted can not be modified, edited or deleted in any way. Once posted, that's it.</p> +<p>Once any transaction in the petty cash system has been posted it cannot be modified, edited or deleted in any way. Once posted, that's it.</p> <div class="floatright"> <a class="minitext" href="#top">⬆ Top</a> </div> <h2>Setup General Parameters</h2> -<h3>Set up expenses</h3> +<h3><a id="PCExpenses">Set up expenses</a></h3> <h4>Definition of expenses allowed to be used in the Petty Cash system.</h4> @@ -29,7 +29,7 @@ <div class="floatright"> <a class="minitext" href="#top">⬆ Top</a> </div> -<h3>Set up types of tabs</h3> +<h3><a id="PCTabTypes">Set up types of tabs</a></h3> <p>Different kinds of users have different privileges. CEO can spend petty cash money on a different way than a truck driver does (no disrespect, for any of them ;-). The system maintain these different categories of tabs of table pctypetabs.</p> @@ -46,7 +46,7 @@ <a class="minitext" href="#top">⬆ Top</a> </div> -<h3>Set up tabs</h3> +<h3><a id="PCTabSetup">Set up tabs</a></h3> <p>PcTabs.php is the script used to set up petty cash tabs</p> @@ -76,7 +76,7 @@ </div> <h2>Workflow</h2> -<h3>Assignment of cash</h3> +<h3><a id="CashAssignment">Assignment of cash</a></h3> <p>The supervisor (authorizer) gives money cash to an employee to be used as petty cash. In script PcAssignCashToTab.php we record this fact.<br></p> @@ -92,7 +92,7 @@ <p>Cash Assignments can be edited and deleted before are authorized. Once authorized and posted can not be modified in any way.<br></p> -<h3>Expense claims</h3> +<h3><a id="ExpenseClaim">Expense claims</a></h3> <p>Employee will go out and spend money. Then will report to webERP these expenses in script PcClaimExpensesFromTab.php<br></p> @@ -114,7 +114,7 @@ <p>Expenses reported can be edited and deleted before are authorized. Once authorized and posted can not be modified in any way.<br></p> -<h3>Expense authorisation</h3> +<h3><a id="AuthorizeExpense">Expense authorisation</a></h3> <p>Supervisor will need to authorize expenses and cash assignemnts reported.<br></p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-09-13 22:23:04
|
Revision: 5664 http://web-erp.svn.sourceforge.net/web-erp/?rev=5664&view=rev Author: vvs2012 Date: 2012-09-13 22:22:58 +0000 (Thu, 13 Sep 2012) Log Message: ----------- xhtml cleanup Modified Paths: -------------- trunk/SelectProduct.php trunk/includes/footer.inc trunk/includes/header.inc trunk/index.php Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2012-09-13 15:33:29 UTC (rev 5663) +++ trunk/SelectProduct.php 2012-09-13 22:22:58 UTC (rev 5664) @@ -159,7 +159,7 @@ $Cost = $myrow['cost']; } if (DB_num_rows($PriceResult) == 0) { - echo _('No Default Price Set in Home Currency'); + echo _('No Default Price Set in Home Currency') . '</td></tr>'; $Price = 0; } else { $PriceRow = DB_fetch_row($PriceResult); @@ -739,7 +739,7 @@ $_POST['PageOffset'] = $ListPageMax; } if ($ListPageMax > 1) { - echo '<div class="centre"><p> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<div class="centre"><br /> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; echo '<select name="PageOffset">'; $ListPage = 1; while ($ListPage <= $ListPageMax) { @@ -754,11 +754,11 @@ <input type="submit" name="Go" value="' . _('Go') . '" /> <input type="submit" name="Previous" value="' . _('Previous') . '" /> <input type="submit" name="Next" value="' . _('Next') . '" />'; - echo '<input type="hidden" name=Keywords value="'.$_POST['Keywords'].'" />'; - echo '<input type="hidden" name=StockCat value="'.$_POST['StockCat'].'" />'; - echo '<input type="hidden" name=StockCode value="'.$_POST['StockCode'].'" />'; + echo '<input type="hidden" name="Keywords" value="'.$_POST['Keywords'].'" />'; + echo '<input type="hidden" name="StockCat" value="'.$_POST['StockCat'].'" />'; + echo '<input type="hidden" name="StockCode" value="'.$_POST['StockCode'].'" />'; // echo '<input type="hidden" name=Search value="Search" />'; - echo '<p></div>'; + echo '<br /></div>'; } echo '<table class="selection">'; $TableHeader = '<tr> Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2012-09-13 15:33:29 UTC (rev 5663) +++ trunk/includes/footer.inc 2012-09-13 22:22:58 UTC (rev 5664) @@ -9,11 +9,11 @@ echo '<div id="FooterWrapDiv">'; echo '<div id="FooterLogoDiv">'; - echo '<img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © weberp.org - ' . date('Y') . '" /></td>'; + echo '<img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © weberp.org - ' . date('Y') . '" />'; echo '</div>'; echo '<div id="FooterVersionDiv">'; - echo 'webERP ' ._('version') .' ' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © 2004 - ' . Date('Y'). ' <a target="_blank" href="http://www.weberp.org/weberp/doc/Manual/ManualContributors.html">weberp.org</a>'; + echo 'webERP ' ._('version') .' ' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © 2004 - ' . Date('Y'). ' <a href="http://www.weberp.org/weberp/doc/Manual/ManualContributors.html">weberp.org</a>'; echo '</div>'; echo '<div id="FooterTimeDiv">'; @@ -22,6 +22,7 @@ echo '</div>'; // FooterWrapDiv echo '</div>'; // FooterDiv +echo '</div>'; // Canvas echo '</body>'; echo '</html>'; Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2012-09-13 15:33:29 UTC (rev 5663) +++ trunk/includes/header.inc 2012-09-13 22:22:58 UTC (rev 5664) @@ -87,7 +87,7 @@ } } - echo '<li><a href="'.$rootpath.'/Logout.php" onclick="return confirm(\''._('Are you sure you wish to logout?').'\');">'._('Logout').'</a></l>'; + echo '<li><a href="'.$rootpath.'/Logout.php" onclick="return confirm(\''._('Are you sure you wish to logout?').'\');">'._('Logout').'</a></li>'; echo '</ul></div>'; // QuickMenuDiv } Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-09-13 15:33:29 UTC (rev 5663) +++ trunk/index.php 2012-09-13 22:22:58 UTC (rev 5664) @@ -195,14 +195,16 @@ $RptLinks = ''; for ($Def=1; $Def>=0; $Def--) { - $RptLinks .= '<tr><td class="menu_group_headers"><div style="text-align:center">'.$Title[$Def].'</div></td></tr>'; + $RptLinks .= '<li class="menu_group_headers">'; + $RptLinks .= '<b>'. $Title[$Def] . '</b>'; + $RptLinks .= '</li>'; $NoEntries = true; if ($ReportList) { // then there are reports to show, show by grouping foreach ($ReportList as $Report) { if ($Report['groupname']==$GroupID AND $Report['defaultreport']==$Def) { - $RptLinks .= '<tr><td class="menu_group_item">'; + $RptLinks .= '<li class="menu_group_item">'; $RptLinks .= '<p>• <a href="' . $rootpath . '/reportwriter/ReportMaker.php?action=go&reportid=' . $Report['id'] . '">' . _($Report['reportname']) . '</a></p>'; - $RptLinks .= '</td></tr>'; + $RptLinks .= '</li>'; $NoEntries = false; } } @@ -211,17 +213,17 @@ foreach ($ReportList as $Report) { $Group=explode(':',$Report['groupname']); // break into main group and form group array if ($NoForms AND $Group[0]==$GroupID AND $Report['reporttype']=='frm' AND $Report['defaultreport']==$Def) { - $RptLinks .= '<tr><td class="menu_group_item">'; + $RptLinks .= '<li class="menu_group_item">'; $RptLinks .= '<img src="' . $rootpath . '/css/' . $_SESSION['Theme'] . '/images/folders.gif" width="16" height="13" alt="" /> '; $RptLinks .= '<p>• <a href="' . $rootpath . '/reportwriter/FormMaker.php?id=' . $Report['groupname'] . '"></p>'; $RptLinks .= $FormGroups[$Report['groupname']] . '</a>'; - $RptLinks .= '</td></tr>'; + $RptLinks .= '</li>'; $NoForms = false; $NoEntries = false; } } } - if ($NoEntries) $RptLinks .= '<tr><td class="menu_group_item">' . _('There are no reports to show!') . '</td></tr>'; + if ($NoEntries) $RptLinks .= '<li class="menu_group_item">' . _('There are no reports to show!') . '</li>'; } return $RptLinks; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-09-13 22:23:04
|
Revision: 5664 http://web-erp.svn.sourceforge.net/web-erp/?rev=5664&view=rev Author: vvs2012 Date: 2012-09-13 22:22:58 +0000 (Thu, 13 Sep 2012) Log Message: ----------- xhtml cleanup Modified Paths: -------------- trunk/SelectProduct.php trunk/includes/footer.inc trunk/includes/header.inc trunk/index.php Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2012-09-13 15:33:29 UTC (rev 5663) +++ trunk/SelectProduct.php 2012-09-13 22:22:58 UTC (rev 5664) @@ -159,7 +159,7 @@ $Cost = $myrow['cost']; } if (DB_num_rows($PriceResult) == 0) { - echo _('No Default Price Set in Home Currency'); + echo _('No Default Price Set in Home Currency') . '</td></tr>'; $Price = 0; } else { $PriceRow = DB_fetch_row($PriceResult); @@ -739,7 +739,7 @@ $_POST['PageOffset'] = $ListPageMax; } if ($ListPageMax > 1) { - echo '<div class="centre"><p> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<div class="centre"><br /> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; echo '<select name="PageOffset">'; $ListPage = 1; while ($ListPage <= $ListPageMax) { @@ -754,11 +754,11 @@ <input type="submit" name="Go" value="' . _('Go') . '" /> <input type="submit" name="Previous" value="' . _('Previous') . '" /> <input type="submit" name="Next" value="' . _('Next') . '" />'; - echo '<input type="hidden" name=Keywords value="'.$_POST['Keywords'].'" />'; - echo '<input type="hidden" name=StockCat value="'.$_POST['StockCat'].'" />'; - echo '<input type="hidden" name=StockCode value="'.$_POST['StockCode'].'" />'; + echo '<input type="hidden" name="Keywords" value="'.$_POST['Keywords'].'" />'; + echo '<input type="hidden" name="StockCat" value="'.$_POST['StockCat'].'" />'; + echo '<input type="hidden" name="StockCode" value="'.$_POST['StockCode'].'" />'; // echo '<input type="hidden" name=Search value="Search" />'; - echo '<p></div>'; + echo '<br /></div>'; } echo '<table class="selection">'; $TableHeader = '<tr> Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2012-09-13 15:33:29 UTC (rev 5663) +++ trunk/includes/footer.inc 2012-09-13 22:22:58 UTC (rev 5664) @@ -9,11 +9,11 @@ echo '<div id="FooterWrapDiv">'; echo '<div id="FooterLogoDiv">'; - echo '<img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © weberp.org - ' . date('Y') . '" /></td>'; + echo '<img src="'. $rootpath . '/' . $_SESSION['LogoFile'] . '" width="120" alt="webERP" title="webERP ' . _('Copyright') . ' © weberp.org - ' . date('Y') . '" />'; echo '</div>'; echo '<div id="FooterVersionDiv">'; - echo 'webERP ' ._('version') .' ' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © 2004 - ' . Date('Y'). ' <a target="_blank" href="http://www.weberp.org/weberp/doc/Manual/ManualContributors.html">weberp.org</a>'; + echo 'webERP ' ._('version') .' ' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © 2004 - ' . Date('Y'). ' <a href="http://www.weberp.org/weberp/doc/Manual/ManualContributors.html">weberp.org</a>'; echo '</div>'; echo '<div id="FooterTimeDiv">'; @@ -22,6 +22,7 @@ echo '</div>'; // FooterWrapDiv echo '</div>'; // FooterDiv +echo '</div>'; // Canvas echo '</body>'; echo '</html>'; Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2012-09-13 15:33:29 UTC (rev 5663) +++ trunk/includes/header.inc 2012-09-13 22:22:58 UTC (rev 5664) @@ -87,7 +87,7 @@ } } - echo '<li><a href="'.$rootpath.'/Logout.php" onclick="return confirm(\''._('Are you sure you wish to logout?').'\');">'._('Logout').'</a></l>'; + echo '<li><a href="'.$rootpath.'/Logout.php" onclick="return confirm(\''._('Are you sure you wish to logout?').'\');">'._('Logout').'</a></li>'; echo '</ul></div>'; // QuickMenuDiv } Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-09-13 15:33:29 UTC (rev 5663) +++ trunk/index.php 2012-09-13 22:22:58 UTC (rev 5664) @@ -195,14 +195,16 @@ $RptLinks = ''; for ($Def=1; $Def>=0; $Def--) { - $RptLinks .= '<tr><td class="menu_group_headers"><div style="text-align:center">'.$Title[$Def].'</div></td></tr>'; + $RptLinks .= '<li class="menu_group_headers">'; + $RptLinks .= '<b>'. $Title[$Def] . '</b>'; + $RptLinks .= '</li>'; $NoEntries = true; if ($ReportList) { // then there are reports to show, show by grouping foreach ($ReportList as $Report) { if ($Report['groupname']==$GroupID AND $Report['defaultreport']==$Def) { - $RptLinks .= '<tr><td class="menu_group_item">'; + $RptLinks .= '<li class="menu_group_item">'; $RptLinks .= '<p>• <a href="' . $rootpath . '/reportwriter/ReportMaker.php?action=go&reportid=' . $Report['id'] . '">' . _($Report['reportname']) . '</a></p>'; - $RptLinks .= '</td></tr>'; + $RptLinks .= '</li>'; $NoEntries = false; } } @@ -211,17 +213,17 @@ foreach ($ReportList as $Report) { $Group=explode(':',$Report['groupname']); // break into main group and form group array if ($NoForms AND $Group[0]==$GroupID AND $Report['reporttype']=='frm' AND $Report['defaultreport']==$Def) { - $RptLinks .= '<tr><td class="menu_group_item">'; + $RptLinks .= '<li class="menu_group_item">'; $RptLinks .= '<img src="' . $rootpath . '/css/' . $_SESSION['Theme'] . '/images/folders.gif" width="16" height="13" alt="" /> '; $RptLinks .= '<p>• <a href="' . $rootpath . '/reportwriter/FormMaker.php?id=' . $Report['groupname'] . '"></p>'; $RptLinks .= $FormGroups[$Report['groupname']] . '</a>'; - $RptLinks .= '</td></tr>'; + $RptLinks .= '</li>'; $NoForms = false; $NoEntries = false; } } } - if ($NoEntries) $RptLinks .= '<tr><td class="menu_group_item">' . _('There are no reports to show!') . '</td></tr>'; + if ($NoEntries) $RptLinks .= '<li class="menu_group_item">' . _('There are no reports to show!') . '</li>'; } return $RptLinks; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-09-15 23:52:35
|
Revision: 5665 http://web-erp.svn.sourceforge.net/web-erp/?rev=5665&view=rev Author: vvs2012 Date: 2012-09-15 23:52:28 +0000 (Sat, 15 Sep 2012) Log Message: ----------- Display relevant information about supplier on SelectSupplier page Modified Paths: -------------- trunk/SelectSupplier.php trunk/doc/Change.log Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2012-09-13 22:22:58 UTC (rev 5664) +++ trunk/SelectSupplier.php 2012-09-15 23:52:28 UTC (rev 5665) @@ -120,6 +120,7 @@ } } //one of keywords or SupplierCode was more than a zero length string $result = DB_query($SQL, $db); + unset($SingleSupplierReturned); if (DB_num_rows($result) == 1) { $myrow = DB_fetch_row($result); $SingleSupplierReturned = $myrow[0]; @@ -129,52 +130,120 @@ $_SESSION['SupplierID'] = $SingleSupplierReturned; unset($_POST['Keywords']); unset($_POST['SupplierCode']); + unset($_POST['Search']); } -if (isset($_SESSION['SupplierID'])) { +if (isset($_SESSION['SupplierID']) AND !isset($_POST['Search'])) { $SupplierName = ''; - $SQL = "SELECT suppliers.suppname - FROM suppliers - WHERE suppliers.supplierid ='" . $_SESSION['SupplierID'] . "'"; - $SupplierNameResult = DB_query($SQL, $db); - if (DB_num_rows($SupplierNameResult) == 1) { - $myrow = DB_fetch_row($SupplierNameResult); - $SupplierName = $myrow[0]; - } - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : <b>' . $_SESSION['SupplierID'] . ' - ' . $SupplierName . '</b> ' . _('has been selected') . '.</p>'; - echo '<div class="page_help_text">' . _('Select a menu option to operate using this supplier.') . '</div>'; - echo '<br /> - <table width="90%" cellpadding="4"> - <tr> - <th style="width:33%">' . _('Supplier Inquiries') . '</th> - <th style="width:33%">' . _('Supplier Transactions') . '</th> - <th style="width:33%">' . _('Supplier Maintenance') . '</th> - </tr>'; - echo '<tr><td valign="top" class="select">'; /* Inquiry Options */ - echo '<a href="' . $rootpath . '/SupplierInquiry.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Supplier Account Inquiry') . '</a> - <br /> - <br />'; - - echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Add / Receive / View Outstanding Purchase Orders') . '</a>'; - echo '<br /><a href="' . $rootpath . '/PO_SelectPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('View All Purchase Orders') . '</a><br />'; - wikiLink('Supplier', $_SESSION['SupplierID']); - echo '<br /><a href="' . $rootpath . '/ShiptsList.php?SupplierID=' . $_SESSION['SupplierID'] . '&SupplierName=' . urlencode($SupplierName) . '">' . _('List all open shipments for') .' '.$SupplierName. '</a>'; - echo '<br /><a href="' . $rootpath . '/Shipt_Select.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Search / Modify / Close Shipments') . '</a>'; - echo '<br /><a href="' . $rootpath . '/SuppPriceList.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Supplier Price List') . '</a>'; - echo '</td><td valign="top" class="select">'; /* Supplier Transactions */ - echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Purchase Order for This Supplier') . '</a><br />'; - echo '<a href="' . $rootpath . '/SupplierInvoice.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Invoice') . '</a><br />'; - echo '<a href="' . $rootpath . '/SupplierCredit.php?New=true&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Credit Note') . '</a><br />'; - echo '<a href="' . $rootpath . '/Payments.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Payment to, or Receipt from the Supplier') . '</a><br />'; - echo '<br />'; - echo '<br /><a href="' . $rootpath . '/ReverseGRN.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Reverse an Outstanding Goods Received Note (GRN)') . '</a>'; - echo '</td><td valign="top" class="select">'; /* Supplier Maintenance */ - echo '<a href="' . $rootpath . '/Suppliers.php">' . _('Add a New Supplier') . '</a><br />'; - echo '<a href="' . $rootpath . '/Suppliers.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Modify Or Delete Supplier Details') . '</a>'; - echo '<br /><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Add/Modify/Delete Supplier Contacts') . '</a>'; - echo '<br />'; - echo '<br /><a href="' . $rootpath . '/Shipments.php?NewShipment=Yes">' . _('Set Up A New Shipment') . '</a>'; - echo '<br /><a href="' . $rootpath . '/SuppLoginSetup.php">' . _('Supplier Login Configuration') . '</a>'; - echo '</td></tr></table>'; + $sql = "SELECT suppname, + address1, + address2, + address3, + address4, + telephone, + fax, + email + FROM suppliers + WHERE supplierid = '" . $_SESSION['SupplierID'] . "'"; + + $result = DB_query($sql, $db); + if (DB_num_rows($result) == 1) { + $myrow = DB_fetch_array($result); + $SupplierName = $myrow['suppname']; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : <b>' . $_SESSION['SupplierID'] . ' - ' . $SupplierName . '</b> ' . _('has been selected') . '.</p>'; + echo '<table style="width:80%"><tr><td style="width:50%" valign="top" class="select">'; + echo '<table style="width:90%">'; + echo '<tr><th>' . _('Address Line 1 (Street)') . ':</th><td>' . stripcslashes($myrow['address1']) . '</td></tr>'; + echo '<tr><th>' . _('Address Line 2 (Suburb/City)') . ':</th><td>' . stripcslashes($myrow['address2']) . '</td></tr>'; + echo '<tr><th>' . _('Address Line 3 (State/Province)') . ':</th><td>' . stripcslashes($myrow['address3']) . '</td></tr>'; + echo '<tr><th>' . _('Address Line 4 (Postal Code)') . ':</th><td>' . stripcslashes($myrow['address4']) . '</td></tr>'; + echo '<tr><th>' . _('Telephone') . ':</th><td>' . $myrow['telephone'] . '</td></tr>'; + echo '<tr><th>' . _('Facsimile') . ':</th><td>' . $myrow['fax'] . '</td></tr>'; + echo '<tr><th>' . _('Email Address') . ':</th><td>' . $myrow['email'] . '</td></tr>'; + echo '</table></td><td valign="top" class="select">'; + + echo '<table style="width:90%"><tr> + <th style="white-space: nowrap" colspan="5">' . _('Contacts Defined for') . ' - ' . $SupplierName . '</th> + </tr>'; + + $sql = "SELECT suppliers.suppname, + contact, + position, + tel, + suppliercontacts.fax, + suppliercontacts.email + FROM suppliercontacts, + suppliers + WHERE suppliercontacts.supplierid=suppliers.supplierid + AND suppliercontacts.supplierid = '" . $_SESSION['SupplierID'] . "'"; + + $result = DB_query($sql, $db); + + if (DB_num_rows($result)>0){ + + $myrow = DB_fetch_array($result); + + echo '<tr> + <th>' . _('Name') . '</th> + <th>' . _('Position') . '</th> + <th>' . _('Phone No') . '</th> + <th>' . _('Fax No') . '</th> + <th>' . _('Email') . '</th> + </tr>'; + + do { + printf('<tr><td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href="mailto:%s">%s</a></td></tr>', + $myrow['contact'], + $myrow['position'], + $myrow['tel'], + $myrow['fax'], + $myrow['email'], + $myrow['email']); + } while ($myrow = DB_fetch_array($result)); + } + echo '</table>'; + echo '</td></tr></table>'; + + echo '<div class="page_help_text">' . _('Select a menu option to operate using this supplier.') . '</div>'; + echo '<br /> + <table width="90%" cellpadding="4"> + <tr> + <th style="width:33%">' . _('Supplier Inquiries') . '</th> + <th style="width:33%">' . _('Supplier Transactions') . '</th> + <th style="width:33%">' . _('Supplier Maintenance') . '</th> + </tr>'; + echo '<tr><td valign="top" class="select">'; /* Inquiry Options */ + echo '<a href="' . $rootpath . '/SupplierInquiry.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Supplier Account Inquiry') . '</a> + <br /> + <br />'; + + echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Add / Receive / View Outstanding Purchase Orders') . '</a>'; + echo '<br /><a href="' . $rootpath . '/PO_SelectPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('View All Purchase Orders') . '</a><br />'; + wikiLink('Supplier', $_SESSION['SupplierID']); + echo '<br /><a href="' . $rootpath . '/ShiptsList.php?SupplierID=' . $_SESSION['SupplierID'] . '&SupplierName=' . urlencode($SupplierName) . '">' . _('List all open shipments for') .' '.$SupplierName. '</a>'; + echo '<br /><a href="' . $rootpath . '/Shipt_Select.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Search / Modify / Close Shipments') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SuppPriceList.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Supplier Price List') . '</a>'; + echo '</td><td valign="top" class="select">'; /* Supplier Transactions */ + echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Purchase Order for This Supplier') . '</a><br />'; + echo '<a href="' . $rootpath . '/SupplierInvoice.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Invoice') . '</a><br />'; + echo '<a href="' . $rootpath . '/SupplierCredit.php?New=true&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Credit Note') . '</a><br />'; + echo '<a href="' . $rootpath . '/Payments.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Payment to, or Receipt from the Supplier') . '</a><br />'; + echo '<br />'; + echo '<br /><a href="' . $rootpath . '/ReverseGRN.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Reverse an Outstanding Goods Received Note (GRN)') . '</a>'; + echo '</td><td valign="top" class="select">'; /* Supplier Maintenance */ + echo '<a href="' . $rootpath . '/Suppliers.php">' . _('Add a New Supplier') . '</a><br />'; + echo '<a href="' . $rootpath . '/Suppliers.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Modify Or Delete Supplier Details') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Add/Modify/Delete Supplier Contacts') . '</a>'; + echo '<br />'; + echo '<br /><a href="' . $rootpath . '/Shipments.php?NewShipment=Yes">' . _('Set Up A New Shipment') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SuppLoginSetup.php">' . _('Supplier Login Configuration') . '</a>'; + echo '</td></tr></table>'; + } else { + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : ' . _('is not selected') . '.</p>'; + } } else { // Supplier is not selected yet echo '<br />'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-09-13 22:22:58 UTC (rev 5664) +++ trunk/doc/Change.log 2012-09-15 23:52:28 UTC (rev 5665) @@ -1,4 +1,5 @@ webERP Change Log +15/9/12 Vitaly: Display relevant information about supplier on SelectSupplier page 12/9/12 Icedlava: some small corrections in the Manual, and update of bookmark links for some setup, petty cash and order functions. 8/9/12 Phil: removed all use of $_REQUEST across all scripts replace with GET/POST to cirumvent SQL injection attacks as reported by Daniel Compton 6/9/12 Thomas Timothy Lie and baliboss.com Team: updated Indonesian translation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-09-15 23:52:35
|
Revision: 5665 http://web-erp.svn.sourceforge.net/web-erp/?rev=5665&view=rev Author: vvs2012 Date: 2012-09-15 23:52:28 +0000 (Sat, 15 Sep 2012) Log Message: ----------- Display relevant information about supplier on SelectSupplier page Modified Paths: -------------- trunk/SelectSupplier.php trunk/doc/Change.log Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2012-09-13 22:22:58 UTC (rev 5664) +++ trunk/SelectSupplier.php 2012-09-15 23:52:28 UTC (rev 5665) @@ -120,6 +120,7 @@ } } //one of keywords or SupplierCode was more than a zero length string $result = DB_query($SQL, $db); + unset($SingleSupplierReturned); if (DB_num_rows($result) == 1) { $myrow = DB_fetch_row($result); $SingleSupplierReturned = $myrow[0]; @@ -129,52 +130,120 @@ $_SESSION['SupplierID'] = $SingleSupplierReturned; unset($_POST['Keywords']); unset($_POST['SupplierCode']); + unset($_POST['Search']); } -if (isset($_SESSION['SupplierID'])) { +if (isset($_SESSION['SupplierID']) AND !isset($_POST['Search'])) { $SupplierName = ''; - $SQL = "SELECT suppliers.suppname - FROM suppliers - WHERE suppliers.supplierid ='" . $_SESSION['SupplierID'] . "'"; - $SupplierNameResult = DB_query($SQL, $db); - if (DB_num_rows($SupplierNameResult) == 1) { - $myrow = DB_fetch_row($SupplierNameResult); - $SupplierName = $myrow[0]; - } - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : <b>' . $_SESSION['SupplierID'] . ' - ' . $SupplierName . '</b> ' . _('has been selected') . '.</p>'; - echo '<div class="page_help_text">' . _('Select a menu option to operate using this supplier.') . '</div>'; - echo '<br /> - <table width="90%" cellpadding="4"> - <tr> - <th style="width:33%">' . _('Supplier Inquiries') . '</th> - <th style="width:33%">' . _('Supplier Transactions') . '</th> - <th style="width:33%">' . _('Supplier Maintenance') . '</th> - </tr>'; - echo '<tr><td valign="top" class="select">'; /* Inquiry Options */ - echo '<a href="' . $rootpath . '/SupplierInquiry.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Supplier Account Inquiry') . '</a> - <br /> - <br />'; - - echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Add / Receive / View Outstanding Purchase Orders') . '</a>'; - echo '<br /><a href="' . $rootpath . '/PO_SelectPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('View All Purchase Orders') . '</a><br />'; - wikiLink('Supplier', $_SESSION['SupplierID']); - echo '<br /><a href="' . $rootpath . '/ShiptsList.php?SupplierID=' . $_SESSION['SupplierID'] . '&SupplierName=' . urlencode($SupplierName) . '">' . _('List all open shipments for') .' '.$SupplierName. '</a>'; - echo '<br /><a href="' . $rootpath . '/Shipt_Select.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Search / Modify / Close Shipments') . '</a>'; - echo '<br /><a href="' . $rootpath . '/SuppPriceList.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Supplier Price List') . '</a>'; - echo '</td><td valign="top" class="select">'; /* Supplier Transactions */ - echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Purchase Order for This Supplier') . '</a><br />'; - echo '<a href="' . $rootpath . '/SupplierInvoice.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Invoice') . '</a><br />'; - echo '<a href="' . $rootpath . '/SupplierCredit.php?New=true&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Credit Note') . '</a><br />'; - echo '<a href="' . $rootpath . '/Payments.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Payment to, or Receipt from the Supplier') . '</a><br />'; - echo '<br />'; - echo '<br /><a href="' . $rootpath . '/ReverseGRN.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Reverse an Outstanding Goods Received Note (GRN)') . '</a>'; - echo '</td><td valign="top" class="select">'; /* Supplier Maintenance */ - echo '<a href="' . $rootpath . '/Suppliers.php">' . _('Add a New Supplier') . '</a><br />'; - echo '<a href="' . $rootpath . '/Suppliers.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Modify Or Delete Supplier Details') . '</a>'; - echo '<br /><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Add/Modify/Delete Supplier Contacts') . '</a>'; - echo '<br />'; - echo '<br /><a href="' . $rootpath . '/Shipments.php?NewShipment=Yes">' . _('Set Up A New Shipment') . '</a>'; - echo '<br /><a href="' . $rootpath . '/SuppLoginSetup.php">' . _('Supplier Login Configuration') . '</a>'; - echo '</td></tr></table>'; + $sql = "SELECT suppname, + address1, + address2, + address3, + address4, + telephone, + fax, + email + FROM suppliers + WHERE supplierid = '" . $_SESSION['SupplierID'] . "'"; + + $result = DB_query($sql, $db); + if (DB_num_rows($result) == 1) { + $myrow = DB_fetch_array($result); + $SupplierName = $myrow['suppname']; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : <b>' . $_SESSION['SupplierID'] . ' - ' . $SupplierName . '</b> ' . _('has been selected') . '.</p>'; + echo '<table style="width:80%"><tr><td style="width:50%" valign="top" class="select">'; + echo '<table style="width:90%">'; + echo '<tr><th>' . _('Address Line 1 (Street)') . ':</th><td>' . stripcslashes($myrow['address1']) . '</td></tr>'; + echo '<tr><th>' . _('Address Line 2 (Suburb/City)') . ':</th><td>' . stripcslashes($myrow['address2']) . '</td></tr>'; + echo '<tr><th>' . _('Address Line 3 (State/Province)') . ':</th><td>' . stripcslashes($myrow['address3']) . '</td></tr>'; + echo '<tr><th>' . _('Address Line 4 (Postal Code)') . ':</th><td>' . stripcslashes($myrow['address4']) . '</td></tr>'; + echo '<tr><th>' . _('Telephone') . ':</th><td>' . $myrow['telephone'] . '</td></tr>'; + echo '<tr><th>' . _('Facsimile') . ':</th><td>' . $myrow['fax'] . '</td></tr>'; + echo '<tr><th>' . _('Email Address') . ':</th><td>' . $myrow['email'] . '</td></tr>'; + echo '</table></td><td valign="top" class="select">'; + + echo '<table style="width:90%"><tr> + <th style="white-space: nowrap" colspan="5">' . _('Contacts Defined for') . ' - ' . $SupplierName . '</th> + </tr>'; + + $sql = "SELECT suppliers.suppname, + contact, + position, + tel, + suppliercontacts.fax, + suppliercontacts.email + FROM suppliercontacts, + suppliers + WHERE suppliercontacts.supplierid=suppliers.supplierid + AND suppliercontacts.supplierid = '" . $_SESSION['SupplierID'] . "'"; + + $result = DB_query($sql, $db); + + if (DB_num_rows($result)>0){ + + $myrow = DB_fetch_array($result); + + echo '<tr> + <th>' . _('Name') . '</th> + <th>' . _('Position') . '</th> + <th>' . _('Phone No') . '</th> + <th>' . _('Fax No') . '</th> + <th>' . _('Email') . '</th> + </tr>'; + + do { + printf('<tr><td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href="mailto:%s">%s</a></td></tr>', + $myrow['contact'], + $myrow['position'], + $myrow['tel'], + $myrow['fax'], + $myrow['email'], + $myrow['email']); + } while ($myrow = DB_fetch_array($result)); + } + echo '</table>'; + echo '</td></tr></table>'; + + echo '<div class="page_help_text">' . _('Select a menu option to operate using this supplier.') . '</div>'; + echo '<br /> + <table width="90%" cellpadding="4"> + <tr> + <th style="width:33%">' . _('Supplier Inquiries') . '</th> + <th style="width:33%">' . _('Supplier Transactions') . '</th> + <th style="width:33%">' . _('Supplier Maintenance') . '</th> + </tr>'; + echo '<tr><td valign="top" class="select">'; /* Inquiry Options */ + echo '<a href="' . $rootpath . '/SupplierInquiry.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Supplier Account Inquiry') . '</a> + <br /> + <br />'; + + echo '<br /><a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Add / Receive / View Outstanding Purchase Orders') . '</a>'; + echo '<br /><a href="' . $rootpath . '/PO_SelectPurchOrder.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('View All Purchase Orders') . '</a><br />'; + wikiLink('Supplier', $_SESSION['SupplierID']); + echo '<br /><a href="' . $rootpath . '/ShiptsList.php?SupplierID=' . $_SESSION['SupplierID'] . '&SupplierName=' . urlencode($SupplierName) . '">' . _('List all open shipments for') .' '.$SupplierName. '</a>'; + echo '<br /><a href="' . $rootpath . '/Shipt_Select.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Search / Modify / Close Shipments') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SuppPriceList.php?SelectedSupplier=' . $_SESSION['SupplierID'] . '">' . _('Supplier Price List') . '</a>'; + echo '</td><td valign="top" class="select">'; /* Supplier Transactions */ + echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Purchase Order for This Supplier') . '</a><br />'; + echo '<a href="' . $rootpath . '/SupplierInvoice.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Invoice') . '</a><br />'; + echo '<a href="' . $rootpath . '/SupplierCredit.php?New=true&SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Suppliers Credit Note') . '</a><br />'; + echo '<a href="' . $rootpath . '/Payments.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Enter a Payment to, or Receipt from the Supplier') . '</a><br />'; + echo '<br />'; + echo '<br /><a href="' . $rootpath . '/ReverseGRN.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Reverse an Outstanding Goods Received Note (GRN)') . '</a>'; + echo '</td><td valign="top" class="select">'; /* Supplier Maintenance */ + echo '<a href="' . $rootpath . '/Suppliers.php">' . _('Add a New Supplier') . '</a><br />'; + echo '<a href="' . $rootpath . '/Suppliers.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Modify Or Delete Supplier Details') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Add/Modify/Delete Supplier Contacts') . '</a>'; + echo '<br />'; + echo '<br /><a href="' . $rootpath . '/Shipments.php?NewShipment=Yes">' . _('Set Up A New Shipment') . '</a>'; + echo '<br /><a href="' . $rootpath . '/SuppLoginSetup.php">' . _('Supplier Login Configuration') . '</a>'; + echo '</td></tr></table>'; + } else { + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Supplier') . '" alt="" />' . ' ' . _('Supplier') . ' : ' . _('is not selected') . '.</p>'; + } } else { // Supplier is not selected yet echo '<br />'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-09-13 22:22:58 UTC (rev 5664) +++ trunk/doc/Change.log 2012-09-15 23:52:28 UTC (rev 5665) @@ -1,4 +1,5 @@ webERP Change Log +15/9/12 Vitaly: Display relevant information about supplier on SelectSupplier page 12/9/12 Icedlava: some small corrections in the Manual, and update of bookmark links for some setup, petty cash and order functions. 8/9/12 Phil: removed all use of $_REQUEST across all scripts replace with GET/POST to cirumvent SQL injection attacks as reported by Daniel Compton 6/9/12 Thomas Timothy Lie and baliboss.com Team: updated Indonesian translation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2012-09-17 07:48:19
|
Revision: 5666 http://web-erp.svn.sourceforge.net/web-erp/?rev=5666&view=rev Author: tehonu Date: 2012-09-17 07:48:10 +0000 (Mon, 17 Sep 2012) Log Message: ----------- Modified Paths: -------------- trunk/Suppliers.php Added Paths: ----------- trunk/includes/CountriesArray.php Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2012-09-15 23:52:28 UTC (rev 5665) +++ trunk/Suppliers.php 2012-09-17 07:48:10 UTC (rev 5666) @@ -10,6 +10,7 @@ $BookMark = 'NewSupplier'; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); +include('includes/CountriesArray.php'); Function Is_ValidAccount ($ActNo) { @@ -412,7 +413,7 @@ if ($map_host=="") { echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; } else { - $address = $_POST['Address1'] . ', ' . $_POST['Address2'] . ', ' . $_POST['Address3'] . ', ' . $_POST['Address4']; + $address = $_POST['Address1'] . ', ' . $_POST['Address2'] . ', ' . $_POST['Address3'] . ', ' . $_POST['Address4'] . ', ' . $_POST['Address5']. ', ' . $_POST['Address6']; $base_url = 'http://' . MAPS_HOST . '/maps/geo?output=xml' . '&key=' . KEY; $request_url = $base_url . '&q=' . urlencode($address); @@ -463,6 +464,8 @@ address2='" . $_POST['Address2'] . "', address3='" . $_POST['Address3'] . "', address4='" . $_POST['Address4'] . "', + address5='" . $_POST['Address5'] . "', + address6='" . $_POST['Address6'] . "', telephone='". $_POST['Phone'] ."', fax = '". $_POST['Fax']."', email = '" . $_POST['Email'] . "', @@ -489,6 +492,8 @@ address2='" . $_POST['Address2'] . "', address3='" . $_POST['Address3'] . "', address4='" . $_POST['Address4'] . "', + address5='" . $_POST['Address5'] . "', + address6='" . $_POST['Address6'] . "', telephone='" . $_POST['Phone']."', fax = '" . $_POST['Fax'] . "', email = '" . $_POST['Email'] . "', @@ -522,6 +527,8 @@ address2, address3, address4, + address5, + address6, telephone, fax, email, @@ -544,6 +551,8 @@ '" . $_POST['Address2'] . "', '" . $_POST['Address3'] . "', '" . $_POST['Address4'] . "', + '" . $_POST['Address5'] . "', + '" . $_POST['Address6'] . "', '" . $_POST['Phone'] . "', '" . $_POST['Fax'] . "', '" . $_POST['Email'] . "', @@ -568,12 +577,14 @@ prnMsg(_('A new supplier for') . ' ' . $_POST['SuppName'] . ' ' . _('has been added to the database'),'success'); - unset ($SupplierID); + unset($SupplierID); unset($_POST['SuppName']); unset($_POST['Address1']); unset($_POST['Address2']); unset($_POST['Address3']); unset($_POST['Address4']); + unset($_POST['Address5']); + unset($_POST['Address6']); unset($_POST['Phone']); unset($_POST['Fax']); unset($_POST['Email']); @@ -673,6 +684,31 @@ echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td> <td><input type="text" name="Address4" size="42" maxlength="40" /></td> </tr>'; + echo '<tr><td>' . _('Address Line 5') . ':</td> + <td><input type="text" name="Address5" size="42" maxlength="40" /></td> + </tr>'; +/* echo '<tr><td>' . _('Country') . ':</td> + <td><input type="text" name="Address6" size="42" maxlength="40" /></td> + </tr>'; +*/ + +echo '<tr> + <td>' . _('Country') . ':</td> + <td><select name="Address6">'; + +foreach ($CountriesArray as $CountryEntry => $CountryName){ + if (isset($_POST['Address6']) AND ($_POST['Address6'] == $CountryEntry)){ + echo '<option selected="selected" value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } elseif (!isset($_POST['Address6'])) { + echo '<option selected="selected" value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } else { + echo '<option value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } +} + +echo '</select></td> + </tr>'; + echo '<tr><td>' . _('Telephone') . ':</td> <td><input type="text" name="Phone" size="30" maxlength="40" /></td> </tr>'; @@ -796,6 +832,8 @@ address2, address3, address4, + address5, + address6, telephone, fax, email, @@ -821,6 +859,8 @@ $_POST['Address2'] = stripcslashes($myrow['address2']); $_POST['Address3'] = stripcslashes($myrow['address3']); $_POST['Address4'] = stripcslashes($myrow['address4']); + $_POST['Address5'] = stripcslashes($myrow['address5']); + $_POST['Address6'] = stripcslashes($myrow['address6']); $_POST['CurrCode'] = stripcslashes($myrow['currcode']); $_POST['Phone'] = $myrow['telephone']; $_POST['Fax'] = $myrow['fax']; @@ -855,6 +895,29 @@ <td><input type="text" name="Address3" value="' . $_POST['Address3'] . '" size="42" maxlength="40" /></td></tr>'; echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td> <td><input type="text" name="Address4" value="' . $_POST['Address4'] . '" size="42" maxlength="40" /></td></tr>'; + echo '<tr><td>' . _('Address Line 5') . ':</td> + <td><input type="text" name="Address5" value="' . $_POST['Address5'] . '" size="42" maxlength="40" /></td></tr>'; +/* echo '<tr><td>' . _('Country') . ':</td> + <td><input type="text" name="Address6" value="' . $_POST['Address6'] . '" size="42" maxlength="40" /></td></tr>'; +*/ +echo '<tr> + <td>' . _('Country') . ':</td> + <td><select name="Address6">'; + +foreach ($CountriesArray as $CountryEntry => $CountryName){ + if (isset($_POST['Address6']) AND ($_POST['Address6'] == $CountryEntry)){ + echo '<option selected="selected" value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } elseif (!isset($_POST['Address6'])) { + echo '<option selected="selected" value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } else { + echo '<option value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } +} + +echo '</select></td> + </tr>'; + + echo '<tr><td>' . _('Telephone') . ':</td> <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Phone" value="' . $_POST['Phone'] . '" size="42" maxlength="40" /></td></tr>'; echo '<tr><td>' . _('Facsimile') . ':</td> Added: trunk/includes/CountriesArray.php =================================================================== --- trunk/includes/CountriesArray.php (rev 0) +++ trunk/includes/CountriesArray.php 2012-09-17 07:48:10 UTC (rev 5666) @@ -0,0 +1,223 @@ +<?php +$CountriesArray = array(); + +$CountriesArray['AD'] = _('Andorra'); +$CountriesArray['AE'] = _('United Arab Emirates'); +$CountriesArray['AF'] = _('Afghanistan'); +$CountriesArray['AG'] = _('Antigua & Barbuda'); +$CountriesArray['AI'] = _('Anguilla'); +$CountriesArray['AL'] = _('Albania'); +$CountriesArray['AM'] = _('Armenia'); +$CountriesArray['AN'] = _('Antilles, Netherlands'); +$CountriesArray['AO'] = _('Angola'); +$CountriesArray['AR'] = _('Argentina'); +$CountriesArray['AS'] = _('American Samoa'); +$CountriesArray['AT'] = _('Austria'); +$CountriesArray['AU'] = _('Australia'); +$CountriesArray['AW'] = _('Aruba'); +$CountriesArray['AZ'] = _('Azerbaijan'); +$CountriesArray['BA'] = _('Bosnia and Herzegovina'); +$CountriesArray['BB'] = _('Barbados'); +$CountriesArray['BD'] = _('Bangladesh'); +$CountriesArray['BE'] = _('Belgium'); +$CountriesArray['BF'] = _('Burkina Faso'); +$CountriesArray['BG'] = _('Bulgaria'); +$CountriesArray['BH'] = _('Bahrain'); +$CountriesArray['BI'] = _('Burundi'); +$CountriesArray['BJ'] = _('Benin'); +$CountriesArray['BM'] = _('Bermuda'); +$CountriesArray['BN'] = _('Brunei Darussalam'); +$CountriesArray['BO'] = _('Bolivia'); +$CountriesArray['BR'] = _('Brazil'); +$CountriesArray['BS'] = _('Bahamas, The'); +$CountriesArray['BT'] = _('Bhutan'); +$CountriesArray['BW'] = _('Botswana'); +$CountriesArray['BY'] = _('Belarus'); +$CountriesArray['BZ'] = _('Belize'); +$CountriesArray['CA'] = _('Canada'); +$CountriesArray['CD'] = _('Congo'); +$CountriesArray['CF'] = _('Central African Republic'); +$CountriesArray['CG'] = _('Congo'); +$CountriesArray['CH'] = _('Switzerland'); +$CountriesArray['CI'] = _('Cote D Ivoire'); +$CountriesArray['CK'] = _('Cook Islands'); +$CountriesArray['CL'] = _('Chile'); +$CountriesArray['CM'] = _('Cameroon'); +$CountriesArray['CN'] = _('China'); +$CountriesArray['CO'] = _('Colombia'); +$CountriesArray['CR'] = _('Costa Rica'); +$CountriesArray['CS'] = _('Montenegro'); +$CountriesArray['CT'] = _('Catalonia'); +$CountriesArray['CU'] = _('Cuba'); +$CountriesArray['CV'] = _('Cape Verde'); +$CountriesArray['CY'] = _('Cyprus'); +$CountriesArray['CZ'] = _('Czech Republic'); +$CountriesArray['DE'] = _('Germany'); +$CountriesArray['DJ'] = _('Djibouti'); +$CountriesArray['DK'] = _('Denmark'); +$CountriesArray['DM'] = _('Dominica'); +$CountriesArray['DO'] = _('Dominican Republic'); +$CountriesArray['DZ'] = _('Algeria'); +$CountriesArray['EC'] = _('Ecuador'); +$CountriesArray['EE'] = _('Estonia'); +$CountriesArray['EG'] = _('Egypt'); +$CountriesArray['ER'] = _('Eritrea'); +$CountriesArray['ES'] = _('Spain'); +$CountriesArray['ET'] = _('Ethiopia'); +$CountriesArray['EZ'] = _('Euskadi'); +$CountriesArray['FI'] = _('Finland'); +$CountriesArray['FJ'] = _('Fiji'); +$CountriesArray['FK'] = _('Falkland Islands'); +$CountriesArray['FM'] = _('Micronesia'); +$CountriesArray['FO'] = _('Faroe Islands'); +$CountriesArray['FR'] = _('France'); +$CountriesArray['GA'] = _('Gabon'); +$CountriesArray['GD'] = _('Grenada'); +$CountriesArray['GE'] = _('Georgia'); +$CountriesArray['GF'] = _('French Guiana'); +$CountriesArray['GF'] = _('Guiana, French'); +$CountriesArray['GG'] = _('Guernsey and Alderney'); +$CountriesArray['GH'] = _('Ghana'); +$CountriesArray['GI'] = _('Gibraltar'); +$CountriesArray['GL'] = _('Greenland'); +$CountriesArray['GM'] = _('Gambia, the'); +$CountriesArray['GN'] = _('Guinea'); +$CountriesArray['GP'] = _('Guadeloupe'); +$CountriesArray['GP'] = _('Guinea, Equatorial'); +$CountriesArray['GQ'] = _('Equatorial Guinea'); +$CountriesArray['GR'] = _('Greece'); +$CountriesArray['GT'] = _('Guatemala'); +$CountriesArray['GU'] = _('Guam'); +$CountriesArray['GW'] = _('Guinea-Bissau'); +$CountriesArray['GY'] = _('Guyana'); +$CountriesArray['HK'] = _('Hong Kong, (China)'); +$CountriesArray['HN'] = _('Honduras'); +$CountriesArray['HR'] = _('Croatia'); +$CountriesArray['HT'] = _('Haiti'); +$CountriesArray['HU'] = _('Hungary'); +$CountriesArray['ID'] = _('Indonesia'); +$CountriesArray['IE'] = _('Ireland'); +$CountriesArray['IL'] = _('Israel'); +$CountriesArray['IN'] = _('India'); +$CountriesArray['IQ'] = _('Iraq'); +$CountriesArray['IR'] = _('Iran, Islamic Republic of'); +$CountriesArray['IS'] = _('Iceland'); +$CountriesArray['IT'] = _('Italy'); +$CountriesArray['JE'] = _('Jersey'); +$CountriesArray['JM'] = _('Jamaica'); +$CountriesArray['JO'] = _('Jordan'); +$CountriesArray['JP'] = _('Japan'); +$CountriesArray['KE'] = _('Kenya'); +$CountriesArray['KG'] = _('Kyrgyzstan'); +$CountriesArray['KH'] = _('Cambodia'); +$CountriesArray['KI'] = _('Kiribati'); +$CountriesArray['KM'] = _('Comoros'); +$CountriesArray['KN'] = _('Saint Kitts and Nevis'); +$CountriesArray['KR'] = _('Korea, (South) Rep. of'); +$CountriesArray['KW'] = _('Kuwait'); +$CountriesArray['KX'] = _('Kosovo'); +$CountriesArray['KY'] = _('Cayman Islands'); +$CountriesArray['KZ'] = _('Kazakhstan'); +$CountriesArray['LA'] = _('Lao People s Dem. Rep.'); +$CountriesArray['LB'] = _('Lebanon'); +$CountriesArray['LC'] = _('Saint Lucia'); +$CountriesArray['LI'] = _('Liechtenstein'); +$CountriesArray['LK'] = _('Sri Lanka (ex-Ceilan)'); +$CountriesArray['LS'] = _('Lesotho'); +$CountriesArray['LT'] = _('Lithuania'); +$CountriesArray['LU'] = _('Luxembourg'); +$CountriesArray['LV'] = _('Latvia'); +$CountriesArray['LY'] = _('Libyan Arab Jamahiriya'); +$CountriesArray['MA'] = _('Morocco'); +$CountriesArray['MC'] = _('Monaco'); +$CountriesArray['MD'] = _('Moldova, Republic of'); +$CountriesArray['MG'] = _('Madagascar'); +$CountriesArray['MK'] = _('Macedonia, TFYR'); +$CountriesArray['ML'] = _('Mali'); +$CountriesArray['MM'] = _('Myanmar (ex-Burma)'); +$CountriesArray['MN'] = _('Mongolia'); +$CountriesArray['MO'] = _('Macao, (China)'); +$CountriesArray['MP'] = _('Northern Mariana Islands'); +$CountriesArray['MQ'] = _('Martinique'); +$CountriesArray['MR'] = _('Mauritania'); +$CountriesArray['MT'] = _('Malta'); +$CountriesArray['MU'] = _('Mauritius'); +$CountriesArray['MV'] = _('Maldives'); +$CountriesArray['MW'] = _('Malawi'); +$CountriesArray['MX'] = _('Mexico'); +$CountriesArray['MY'] = _('Malaysia'); +$CountriesArray['MZ'] = _('Mozambique'); +$CountriesArray['NA'] = _('Namibia'); +$CountriesArray['NC'] = _('New Caledonia'); +$CountriesArray['NE'] = _('Niger'); +$CountriesArray['NG'] = _('Nigeria'); +$CountriesArray['NI'] = _('Nicaragua'); +$CountriesArray['NL'] = _('Netherlands'); +$CountriesArray['NO'] = _('Norway'); +$CountriesArray['NP'] = _('Nepal'); +$CountriesArray['NZ'] = _('New Zealand'); +$CountriesArray['OM'] = _('Oman'); +$CountriesArray['PA'] = _('Panama'); +$CountriesArray['PE'] = _('Peru'); +$CountriesArray['PF'] = _('French Polynesia'); +$CountriesArray['PG'] = _('Papua New Guinea'); +$CountriesArray['PH'] = _('Philippines'); +$CountriesArray['PK'] = _('Pakistan'); +$CountriesArray['PL'] = _('Poland'); +$CountriesArray['PS'] = _('Palestinian Territory'); +$CountriesArray['PT'] = _('Portugal'); +$CountriesArray['PY'] = _('Paraguay'); +$CountriesArray['QA'] = _('Qatar'); +$CountriesArray['QB'] = _('Quebec'); +$CountriesArray['RE'] = _('Reunion'); +$CountriesArray['RO'] = _('Romania'); +$CountriesArray['RS'] = _('Serbia'); +$CountriesArray['RU'] = _('Russian Federation'); +$CountriesArray['RW'] = _('Rwanda'); +$CountriesArray['SA'] = _('Saudi Arabia'); +$CountriesArray['SB'] = _('Solomon Islands'); +$CountriesArray['SC'] = _('Seychelles'); +$CountriesArray['SD'] = _('Sudan'); +$CountriesArray['SE'] = _('Sweden'); +$CountriesArray['SG'] = _('Singapore'); +$CountriesArray['SI'] = _('Slovenia'); +$CountriesArray['SK'] = _('Slovakia'); +$CountriesArray['SM'] = _('San Marino'); +$CountriesArray['SN'] = _('Senegal'); +$CountriesArray['SO'] = _('Somalia'); +$CountriesArray['SR'] = _('Suriname'); +$CountriesArray['ST'] = _('Sao Tome and Principe'); +$CountriesArray['SV'] = _('El Salvador'); +$CountriesArray['SY'] = _('Syrian Arab Republic'); +$CountriesArray['SZ'] = _('Swaziland'); +$CountriesArray['TD'] = _('Chad'); +$CountriesArray['TG'] = _('Togo'); +$CountriesArray['TH'] = _('Thailand'); +$CountriesArray['TJ'] = _('Tajikistan'); +$CountriesArray['TM'] = _('Turkmenistan'); +$CountriesArray['TN'] = _('Tunisia'); +$CountriesArray['TO'] = _('Tonga'); +$CountriesArray['TP'] = _('East Timor (Timor-Leste)'); +$CountriesArray['TR'] = _('Turkey'); +$CountriesArray['TT'] = _('Trinidad & Tobago'); +$CountriesArray['TW'] = _('Taiwan'); +$CountriesArray['TZ'] = _('Tanzania, United Rep. of'); +$CountriesArray['UA'] = _('Ukraine'); +$CountriesArray['UG'] = _('Uganda'); +$CountriesArray['UK'] = _('United Kingdom'); +$CountriesArray['US'] = _('United States'); +$CountriesArray['UY'] = _('Uruguay'); +$CountriesArray['UZ'] = _('Uzbekistan'); +$CountriesArray['VC'] = _('St. Vincent & the Grenadines'); +$CountriesArray['VE'] = _('Venezuela'); +$CountriesArray['VG'] = _('British Virgin Islands'); +$CountriesArray['VI'] = _('Virgin Islands, U.S.'); +$CountriesArray['VN'] = _('Viet Nam'); +$CountriesArray['VU'] = _('Vanuatu'); +$CountriesArray['WS'] = _('Samoa'); +$CountriesArray['YE'] = _('Yemen'); +$CountriesArray['ZM'] = _('Zambia'); +$CountriesArray['ZW'] = _('Zimbabwe'); + +asort($CountriesArray); +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <te...@us...> - 2012-09-17 07:48:21
|
Revision: 5666 http://web-erp.svn.sourceforge.net/web-erp/?rev=5666&view=rev Author: tehonu Date: 2012-09-17 07:48:10 +0000 (Mon, 17 Sep 2012) Log Message: ----------- Modified Paths: -------------- trunk/Suppliers.php Added Paths: ----------- trunk/includes/CountriesArray.php Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2012-09-15 23:52:28 UTC (rev 5665) +++ trunk/Suppliers.php 2012-09-17 07:48:10 UTC (rev 5666) @@ -10,6 +10,7 @@ $BookMark = 'NewSupplier'; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); +include('includes/CountriesArray.php'); Function Is_ValidAccount ($ActNo) { @@ -412,7 +413,7 @@ if ($map_host=="") { echo '<div class="warn">' . _('Warning - Geocode Integration is enabled, but no hosts are setup. Go to Geocode Setup') . '</div>'; } else { - $address = $_POST['Address1'] . ', ' . $_POST['Address2'] . ', ' . $_POST['Address3'] . ', ' . $_POST['Address4']; + $address = $_POST['Address1'] . ', ' . $_POST['Address2'] . ', ' . $_POST['Address3'] . ', ' . $_POST['Address4'] . ', ' . $_POST['Address5']. ', ' . $_POST['Address6']; $base_url = 'http://' . MAPS_HOST . '/maps/geo?output=xml' . '&key=' . KEY; $request_url = $base_url . '&q=' . urlencode($address); @@ -463,6 +464,8 @@ address2='" . $_POST['Address2'] . "', address3='" . $_POST['Address3'] . "', address4='" . $_POST['Address4'] . "', + address5='" . $_POST['Address5'] . "', + address6='" . $_POST['Address6'] . "', telephone='". $_POST['Phone'] ."', fax = '". $_POST['Fax']."', email = '" . $_POST['Email'] . "', @@ -489,6 +492,8 @@ address2='" . $_POST['Address2'] . "', address3='" . $_POST['Address3'] . "', address4='" . $_POST['Address4'] . "', + address5='" . $_POST['Address5'] . "', + address6='" . $_POST['Address6'] . "', telephone='" . $_POST['Phone']."', fax = '" . $_POST['Fax'] . "', email = '" . $_POST['Email'] . "', @@ -522,6 +527,8 @@ address2, address3, address4, + address5, + address6, telephone, fax, email, @@ -544,6 +551,8 @@ '" . $_POST['Address2'] . "', '" . $_POST['Address3'] . "', '" . $_POST['Address4'] . "', + '" . $_POST['Address5'] . "', + '" . $_POST['Address6'] . "', '" . $_POST['Phone'] . "', '" . $_POST['Fax'] . "', '" . $_POST['Email'] . "', @@ -568,12 +577,14 @@ prnMsg(_('A new supplier for') . ' ' . $_POST['SuppName'] . ' ' . _('has been added to the database'),'success'); - unset ($SupplierID); + unset($SupplierID); unset($_POST['SuppName']); unset($_POST['Address1']); unset($_POST['Address2']); unset($_POST['Address3']); unset($_POST['Address4']); + unset($_POST['Address5']); + unset($_POST['Address6']); unset($_POST['Phone']); unset($_POST['Fax']); unset($_POST['Email']); @@ -673,6 +684,31 @@ echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td> <td><input type="text" name="Address4" size="42" maxlength="40" /></td> </tr>'; + echo '<tr><td>' . _('Address Line 5') . ':</td> + <td><input type="text" name="Address5" size="42" maxlength="40" /></td> + </tr>'; +/* echo '<tr><td>' . _('Country') . ':</td> + <td><input type="text" name="Address6" size="42" maxlength="40" /></td> + </tr>'; +*/ + +echo '<tr> + <td>' . _('Country') . ':</td> + <td><select name="Address6">'; + +foreach ($CountriesArray as $CountryEntry => $CountryName){ + if (isset($_POST['Address6']) AND ($_POST['Address6'] == $CountryEntry)){ + echo '<option selected="selected" value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } elseif (!isset($_POST['Address6'])) { + echo '<option selected="selected" value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } else { + echo '<option value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } +} + +echo '</select></td> + </tr>'; + echo '<tr><td>' . _('Telephone') . ':</td> <td><input type="text" name="Phone" size="30" maxlength="40" /></td> </tr>'; @@ -796,6 +832,8 @@ address2, address3, address4, + address5, + address6, telephone, fax, email, @@ -821,6 +859,8 @@ $_POST['Address2'] = stripcslashes($myrow['address2']); $_POST['Address3'] = stripcslashes($myrow['address3']); $_POST['Address4'] = stripcslashes($myrow['address4']); + $_POST['Address5'] = stripcslashes($myrow['address5']); + $_POST['Address6'] = stripcslashes($myrow['address6']); $_POST['CurrCode'] = stripcslashes($myrow['currcode']); $_POST['Phone'] = $myrow['telephone']; $_POST['Fax'] = $myrow['fax']; @@ -855,6 +895,29 @@ <td><input type="text" name="Address3" value="' . $_POST['Address3'] . '" size="42" maxlength="40" /></td></tr>'; echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td> <td><input type="text" name="Address4" value="' . $_POST['Address4'] . '" size="42" maxlength="40" /></td></tr>'; + echo '<tr><td>' . _('Address Line 5') . ':</td> + <td><input type="text" name="Address5" value="' . $_POST['Address5'] . '" size="42" maxlength="40" /></td></tr>'; +/* echo '<tr><td>' . _('Country') . ':</td> + <td><input type="text" name="Address6" value="' . $_POST['Address6'] . '" size="42" maxlength="40" /></td></tr>'; +*/ +echo '<tr> + <td>' . _('Country') . ':</td> + <td><select name="Address6">'; + +foreach ($CountriesArray as $CountryEntry => $CountryName){ + if (isset($_POST['Address6']) AND ($_POST['Address6'] == $CountryEntry)){ + echo '<option selected="selected" value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } elseif (!isset($_POST['Address6'])) { + echo '<option selected="selected" value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } else { + echo '<option value="' . $CountryEntry . '">' . $CountryName .'</option>'; + } +} + +echo '</select></td> + </tr>'; + + echo '<tr><td>' . _('Telephone') . ':</td> <td><input '.(in_array('Name',$Errors) ? 'class="inputerror"' : '').' type="text" name="Phone" value="' . $_POST['Phone'] . '" size="42" maxlength="40" /></td></tr>'; echo '<tr><td>' . _('Facsimile') . ':</td> Added: trunk/includes/CountriesArray.php =================================================================== --- trunk/includes/CountriesArray.php (rev 0) +++ trunk/includes/CountriesArray.php 2012-09-17 07:48:10 UTC (rev 5666) @@ -0,0 +1,223 @@ +<?php +$CountriesArray = array(); + +$CountriesArray['AD'] = _('Andorra'); +$CountriesArray['AE'] = _('United Arab Emirates'); +$CountriesArray['AF'] = _('Afghanistan'); +$CountriesArray['AG'] = _('Antigua & Barbuda'); +$CountriesArray['AI'] = _('Anguilla'); +$CountriesArray['AL'] = _('Albania'); +$CountriesArray['AM'] = _('Armenia'); +$CountriesArray['AN'] = _('Antilles, Netherlands'); +$CountriesArray['AO'] = _('Angola'); +$CountriesArray['AR'] = _('Argentina'); +$CountriesArray['AS'] = _('American Samoa'); +$CountriesArray['AT'] = _('Austria'); +$CountriesArray['AU'] = _('Australia'); +$CountriesArray['AW'] = _('Aruba'); +$CountriesArray['AZ'] = _('Azerbaijan'); +$CountriesArray['BA'] = _('Bosnia and Herzegovina'); +$CountriesArray['BB'] = _('Barbados'); +$CountriesArray['BD'] = _('Bangladesh'); +$CountriesArray['BE'] = _('Belgium'); +$CountriesArray['BF'] = _('Burkina Faso'); +$CountriesArray['BG'] = _('Bulgaria'); +$CountriesArray['BH'] = _('Bahrain'); +$CountriesArray['BI'] = _('Burundi'); +$CountriesArray['BJ'] = _('Benin'); +$CountriesArray['BM'] = _('Bermuda'); +$CountriesArray['BN'] = _('Brunei Darussalam'); +$CountriesArray['BO'] = _('Bolivia'); +$CountriesArray['BR'] = _('Brazil'); +$CountriesArray['BS'] = _('Bahamas, The'); +$CountriesArray['BT'] = _('Bhutan'); +$CountriesArray['BW'] = _('Botswana'); +$CountriesArray['BY'] = _('Belarus'); +$CountriesArray['BZ'] = _('Belize'); +$CountriesArray['CA'] = _('Canada'); +$CountriesArray['CD'] = _('Congo'); +$CountriesArray['CF'] = _('Central African Republic'); +$CountriesArray['CG'] = _('Congo'); +$CountriesArray['CH'] = _('Switzerland'); +$CountriesArray['CI'] = _('Cote D Ivoire'); +$CountriesArray['CK'] = _('Cook Islands'); +$CountriesArray['CL'] = _('Chile'); +$CountriesArray['CM'] = _('Cameroon'); +$CountriesArray['CN'] = _('China'); +$CountriesArray['CO'] = _('Colombia'); +$CountriesArray['CR'] = _('Costa Rica'); +$CountriesArray['CS'] = _('Montenegro'); +$CountriesArray['CT'] = _('Catalonia'); +$CountriesArray['CU'] = _('Cuba'); +$CountriesArray['CV'] = _('Cape Verde'); +$CountriesArray['CY'] = _('Cyprus'); +$CountriesArray['CZ'] = _('Czech Republic'); +$CountriesArray['DE'] = _('Germany'); +$CountriesArray['DJ'] = _('Djibouti'); +$CountriesArray['DK'] = _('Denmark'); +$CountriesArray['DM'] = _('Dominica'); +$CountriesArray['DO'] = _('Dominican Republic'); +$CountriesArray['DZ'] = _('Algeria'); +$CountriesArray['EC'] = _('Ecuador'); +$CountriesArray['EE'] = _('Estonia'); +$CountriesArray['EG'] = _('Egypt'); +$CountriesArray['ER'] = _('Eritrea'); +$CountriesArray['ES'] = _('Spain'); +$CountriesArray['ET'] = _('Ethiopia'); +$CountriesArray['EZ'] = _('Euskadi'); +$CountriesArray['FI'] = _('Finland'); +$CountriesArray['FJ'] = _('Fiji'); +$CountriesArray['FK'] = _('Falkland Islands'); +$CountriesArray['FM'] = _('Micronesia'); +$CountriesArray['FO'] = _('Faroe Islands'); +$CountriesArray['FR'] = _('France'); +$CountriesArray['GA'] = _('Gabon'); +$CountriesArray['GD'] = _('Grenada'); +$CountriesArray['GE'] = _('Georgia'); +$CountriesArray['GF'] = _('French Guiana'); +$CountriesArray['GF'] = _('Guiana, French'); +$CountriesArray['GG'] = _('Guernsey and Alderney'); +$CountriesArray['GH'] = _('Ghana'); +$CountriesArray['GI'] = _('Gibraltar'); +$CountriesArray['GL'] = _('Greenland'); +$CountriesArray['GM'] = _('Gambia, the'); +$CountriesArray['GN'] = _('Guinea'); +$CountriesArray['GP'] = _('Guadeloupe'); +$CountriesArray['GP'] = _('Guinea, Equatorial'); +$CountriesArray['GQ'] = _('Equatorial Guinea'); +$CountriesArray['GR'] = _('Greece'); +$CountriesArray['GT'] = _('Guatemala'); +$CountriesArray['GU'] = _('Guam'); +$CountriesArray['GW'] = _('Guinea-Bissau'); +$CountriesArray['GY'] = _('Guyana'); +$CountriesArray['HK'] = _('Hong Kong, (China)'); +$CountriesArray['HN'] = _('Honduras'); +$CountriesArray['HR'] = _('Croatia'); +$CountriesArray['HT'] = _('Haiti'); +$CountriesArray['HU'] = _('Hungary'); +$CountriesArray['ID'] = _('Indonesia'); +$CountriesArray['IE'] = _('Ireland'); +$CountriesArray['IL'] = _('Israel'); +$CountriesArray['IN'] = _('India'); +$CountriesArray['IQ'] = _('Iraq'); +$CountriesArray['IR'] = _('Iran, Islamic Republic of'); +$CountriesArray['IS'] = _('Iceland'); +$CountriesArray['IT'] = _('Italy'); +$CountriesArray['JE'] = _('Jersey'); +$CountriesArray['JM'] = _('Jamaica'); +$CountriesArray['JO'] = _('Jordan'); +$CountriesArray['JP'] = _('Japan'); +$CountriesArray['KE'] = _('Kenya'); +$CountriesArray['KG'] = _('Kyrgyzstan'); +$CountriesArray['KH'] = _('Cambodia'); +$CountriesArray['KI'] = _('Kiribati'); +$CountriesArray['KM'] = _('Comoros'); +$CountriesArray['KN'] = _('Saint Kitts and Nevis'); +$CountriesArray['KR'] = _('Korea, (South) Rep. of'); +$CountriesArray['KW'] = _('Kuwait'); +$CountriesArray['KX'] = _('Kosovo'); +$CountriesArray['KY'] = _('Cayman Islands'); +$CountriesArray['KZ'] = _('Kazakhstan'); +$CountriesArray['LA'] = _('Lao People s Dem. Rep.'); +$CountriesArray['LB'] = _('Lebanon'); +$CountriesArray['LC'] = _('Saint Lucia'); +$CountriesArray['LI'] = _('Liechtenstein'); +$CountriesArray['LK'] = _('Sri Lanka (ex-Ceilan)'); +$CountriesArray['LS'] = _('Lesotho'); +$CountriesArray['LT'] = _('Lithuania'); +$CountriesArray['LU'] = _('Luxembourg'); +$CountriesArray['LV'] = _('Latvia'); +$CountriesArray['LY'] = _('Libyan Arab Jamahiriya'); +$CountriesArray['MA'] = _('Morocco'); +$CountriesArray['MC'] = _('Monaco'); +$CountriesArray['MD'] = _('Moldova, Republic of'); +$CountriesArray['MG'] = _('Madagascar'); +$CountriesArray['MK'] = _('Macedonia, TFYR'); +$CountriesArray['ML'] = _('Mali'); +$CountriesArray['MM'] = _('Myanmar (ex-Burma)'); +$CountriesArray['MN'] = _('Mongolia'); +$CountriesArray['MO'] = _('Macao, (China)'); +$CountriesArray['MP'] = _('Northern Mariana Islands'); +$CountriesArray['MQ'] = _('Martinique'); +$CountriesArray['MR'] = _('Mauritania'); +$CountriesArray['MT'] = _('Malta'); +$CountriesArray['MU'] = _('Mauritius'); +$CountriesArray['MV'] = _('Maldives'); +$CountriesArray['MW'] = _('Malawi'); +$CountriesArray['MX'] = _('Mexico'); +$CountriesArray['MY'] = _('Malaysia'); +$CountriesArray['MZ'] = _('Mozambique'); +$CountriesArray['NA'] = _('Namibia'); +$CountriesArray['NC'] = _('New Caledonia'); +$CountriesArray['NE'] = _('Niger'); +$CountriesArray['NG'] = _('Nigeria'); +$CountriesArray['NI'] = _('Nicaragua'); +$CountriesArray['NL'] = _('Netherlands'); +$CountriesArray['NO'] = _('Norway'); +$CountriesArray['NP'] = _('Nepal'); +$CountriesArray['NZ'] = _('New Zealand'); +$CountriesArray['OM'] = _('Oman'); +$CountriesArray['PA'] = _('Panama'); +$CountriesArray['PE'] = _('Peru'); +$CountriesArray['PF'] = _('French Polynesia'); +$CountriesArray['PG'] = _('Papua New Guinea'); +$CountriesArray['PH'] = _('Philippines'); +$CountriesArray['PK'] = _('Pakistan'); +$CountriesArray['PL'] = _('Poland'); +$CountriesArray['PS'] = _('Palestinian Territory'); +$CountriesArray['PT'] = _('Portugal'); +$CountriesArray['PY'] = _('Paraguay'); +$CountriesArray['QA'] = _('Qatar'); +$CountriesArray['QB'] = _('Quebec'); +$CountriesArray['RE'] = _('Reunion'); +$CountriesArray['RO'] = _('Romania'); +$CountriesArray['RS'] = _('Serbia'); +$CountriesArray['RU'] = _('Russian Federation'); +$CountriesArray['RW'] = _('Rwanda'); +$CountriesArray['SA'] = _('Saudi Arabia'); +$CountriesArray['SB'] = _('Solomon Islands'); +$CountriesArray['SC'] = _('Seychelles'); +$CountriesArray['SD'] = _('Sudan'); +$CountriesArray['SE'] = _('Sweden'); +$CountriesArray['SG'] = _('Singapore'); +$CountriesArray['SI'] = _('Slovenia'); +$CountriesArray['SK'] = _('Slovakia'); +$CountriesArray['SM'] = _('San Marino'); +$CountriesArray['SN'] = _('Senegal'); +$CountriesArray['SO'] = _('Somalia'); +$CountriesArray['SR'] = _('Suriname'); +$CountriesArray['ST'] = _('Sao Tome and Principe'); +$CountriesArray['SV'] = _('El Salvador'); +$CountriesArray['SY'] = _('Syrian Arab Republic'); +$CountriesArray['SZ'] = _('Swaziland'); +$CountriesArray['TD'] = _('Chad'); +$CountriesArray['TG'] = _('Togo'); +$CountriesArray['TH'] = _('Thailand'); +$CountriesArray['TJ'] = _('Tajikistan'); +$CountriesArray['TM'] = _('Turkmenistan'); +$CountriesArray['TN'] = _('Tunisia'); +$CountriesArray['TO'] = _('Tonga'); +$CountriesArray['TP'] = _('East Timor (Timor-Leste)'); +$CountriesArray['TR'] = _('Turkey'); +$CountriesArray['TT'] = _('Trinidad & Tobago'); +$CountriesArray['TW'] = _('Taiwan'); +$CountriesArray['TZ'] = _('Tanzania, United Rep. of'); +$CountriesArray['UA'] = _('Ukraine'); +$CountriesArray['UG'] = _('Uganda'); +$CountriesArray['UK'] = _('United Kingdom'); +$CountriesArray['US'] = _('United States'); +$CountriesArray['UY'] = _('Uruguay'); +$CountriesArray['UZ'] = _('Uzbekistan'); +$CountriesArray['VC'] = _('St. Vincent & the Grenadines'); +$CountriesArray['VE'] = _('Venezuela'); +$CountriesArray['VG'] = _('British Virgin Islands'); +$CountriesArray['VI'] = _('Virgin Islands, U.S.'); +$CountriesArray['VN'] = _('Viet Nam'); +$CountriesArray['VU'] = _('Vanuatu'); +$CountriesArray['WS'] = _('Samoa'); +$CountriesArray['YE'] = _('Yemen'); +$CountriesArray['ZM'] = _('Zambia'); +$CountriesArray['ZW'] = _('Zimbabwe'); + +asort($CountriesArray); +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tu...@us...> - 2012-09-18 00:29:29
|
Revision: 5667 http://web-erp.svn.sourceforge.net/web-erp/?rev=5667&view=rev Author: turbopt Date: 2012-09-18 00:29:23 +0000 (Tue, 18 Sep 2012) Log Message: ----------- Correct strlen() check in condition. Modified Paths: -------------- trunk/PO_PDFPurchOrder.php trunk/doc/Change.log Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2012-09-17 07:48:10 UTC (rev 5666) +++ trunk/PO_PDFPurchOrder.php 2012-09-18 00:29:23 UTC (rev 5667) @@ -257,7 +257,7 @@ $OrderTotal += ($POLine['unitprice']*$POLine['quantityord']); //use suppliers itemcode if available i.e. stringlength >0 - if (strlen($POLine['suppliers_partno']>0)) { + if ( strlen($POLine['suppliers_partno']) > 0 ) { $Itemcode=$POLine['suppliers_partno']; } else { $Itemcode=$POLine['itemcode']; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-09-17 07:48:10 UTC (rev 5666) +++ trunk/doc/Change.log 2012-09-18 00:29:23 UTC (rev 5667) @@ -1,4 +1,5 @@ webERP Change Log +17/9/2012 Paul Thursby: Correct strlen() check in condition. 15/9/12 Vitaly: Display relevant information about supplier on SelectSupplier page 12/9/12 Icedlava: some small corrections in the Manual, and update of bookmark links for some setup, petty cash and order functions. 8/9/12 Phil: removed all use of $_REQUEST across all scripts replace with GET/POST to cirumvent SQL injection attacks as reported by Daniel Compton This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tu...@us...> - 2012-09-18 00:29:29
|
Revision: 5667 http://web-erp.svn.sourceforge.net/web-erp/?rev=5667&view=rev Author: turbopt Date: 2012-09-18 00:29:23 +0000 (Tue, 18 Sep 2012) Log Message: ----------- Correct strlen() check in condition. Modified Paths: -------------- trunk/PO_PDFPurchOrder.php trunk/doc/Change.log Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2012-09-17 07:48:10 UTC (rev 5666) +++ trunk/PO_PDFPurchOrder.php 2012-09-18 00:29:23 UTC (rev 5667) @@ -257,7 +257,7 @@ $OrderTotal += ($POLine['unitprice']*$POLine['quantityord']); //use suppliers itemcode if available i.e. stringlength >0 - if (strlen($POLine['suppliers_partno']>0)) { + if ( strlen($POLine['suppliers_partno']) > 0 ) { $Itemcode=$POLine['suppliers_partno']; } else { $Itemcode=$POLine['itemcode']; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-09-17 07:48:10 UTC (rev 5666) +++ trunk/doc/Change.log 2012-09-18 00:29:23 UTC (rev 5667) @@ -1,4 +1,5 @@ webERP Change Log +17/9/2012 Paul Thursby: Correct strlen() check in condition. 15/9/12 Vitaly: Display relevant information about supplier on SelectSupplier page 12/9/12 Icedlava: some small corrections in the Manual, and update of bookmark links for some setup, petty cash and order functions. 8/9/12 Phil: removed all use of $_REQUEST across all scripts replace with GET/POST to cirumvent SQL injection attacks as reported by Daniel Compton This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-10-20 01:18:07
|
Revision: 5719 http://sourceforge.net/p/web-erp/reponame/5719 Author: daintree Date: 2012-10-20 01:18:03 +0000 (Sat, 20 Oct 2012) Log Message: ----------- google exchange rates option - fix exchange rate trend graph using google based chart creation Modified Paths: -------------- trunk/ExchangeRateTrend.php trunk/SystemParameters.php trunk/doc/Change.log trunk/includes/MiscFunctions.php trunk/includes/session.inc trunk/sql/mysql/upgrade4.09-4.10.sql Modified: trunk/ExchangeRateTrend.php =================================================================== --- trunk/ExchangeRateTrend.php 2012-10-18 12:53:18 UTC (rev 5718) +++ trunk/ExchangeRateTrend.php 2012-10-20 01:18:03 UTC (rev 5719) @@ -57,23 +57,14 @@ // SHOW OUR GRAPH // ************** + $image = 'https://encrypted.google.com/finance/chart?q=CURRENCY:' . $FunctionalCurrency . $CurrencyToShow .'&tkr=1&p=5Y&chst=cob'; + //$graphA = $CurrencyToShow. '/' . $FunctionalCurrency . $graph; + //$image = 'http://www.x-rates.com/d/' . $graphA; - $graphA = $CurrencyToShow. '/' . $FunctionalCurrency . $graph; - $image = 'http://www.x-rates.com/d/' . $graphA; - echo '<br /><table class="selection">'; echo '<tr><th><div class="centre"><b>' . $FunctionalCurrency . ' / ' . $CurrencyToShow . '</b></div></th></tr>'; echo '<tr><td><img src="' . $image . '" alt="' ._('Trend Currently Unavailable') . '" /></td></tr>'; echo '</table>'; - $graphB = $FunctionalCurrency. '/' . $CurrencyToShow . $graph; - $image = 'http://www.x-rates.com/d/' . $graphB; - - echo '<br /><table class="selection">'; - echo '<tr><th><div class="centre"><b>' . $CurrencyToShow . ' / ' . $FunctionalCurrency . '</b></div></th></tr>'; - echo '<tr><td><img src="' . $image . '" alt="' ._('Trend Currently Unavailable') . '" /></td></tr>'; - echo '</table>'; - - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2012-10-18 12:53:18 UTC (rev 5718) +++ trunk/SystemParameters.php 2012-10-20 01:18:03 UTC (rev 5719) @@ -285,6 +285,9 @@ $sql[] = "UPDATE config SET confvalue='0' WHERE confname='UpdateCurrencyRatesDaily'"; } } + if ($_SESSION['ExchangeRateFeed'] != $_POST['X_ExchangeRateFeed']){ + $sql[] = "UPDATE config SET confvalue='" . $_POST['X_ExchangeRateFeed'] . "' WHERE confname='ExchangeRateFeed'"; + } if ($_SESSION['FactoryManagerEmail'] != $_POST['X_FactoryManagerEmail']){ $sql[] = "UPDATE config SET confvalue='" . $_POST['X_FactoryManagerEmail'] . "' WHERE confname='FactoryManagerEmail'"; } @@ -452,8 +455,15 @@ <option '.($_SESSION['UpdateCurrencyRatesDaily']!='1'?'selected="selected" ':'').'value="1">'._('Automatic').'</option> <option '.($_SESSION['UpdateCurrencyRatesDaily']=='0'?'selected="selected" ':'').'value="0">'._('Manual').'</option> </select></td> - <td>' . _('Automatic updates to exchange rates will retrieve the latest daily rates from the European Central Bank once per day - when the first user logs in for the day. Manual will never update the rates automatically - exchange rates will need to be maintained manually') . '</td> + <td>' . _('Automatic updates to exchange rates will retrieve the latest daily rates from either the European Central Bank or Google once per day - when the first user logs in for the day. Manual will never update the rates automatically - exchange rates will need to be maintained manually') . '</td> </tr>'; +echo ' |
From: <dai...@us...> - 2012-10-25 08:20:10
|
Revision: 5729 http://sourceforge.net/p/web-erp/reponame/5729 Author: daintree Date: 2012-10-25 08:20:07 +0000 (Thu, 25 Oct 2012) Log Message: ----------- add telephone and email to search Modified Paths: -------------- trunk/SelectSupplier.php trunk/doc/Change.log Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2012-10-25 07:51:57 UTC (rev 5728) +++ trunk/SelectSupplier.php 2012-10-25 08:20:07 UTC (rev 5729) @@ -87,7 +87,9 @@ address1, address2, address3, - address4 + address4, + telephone, + email FROM suppliers ORDER BY suppname"; } else { @@ -101,7 +103,9 @@ address1, address2, address3, - address4 + address4, + telephone, + email FROM suppliers WHERE suppname " . LIKE . " '" . $SearchString . "' ORDER BY suppname"; @@ -113,7 +117,9 @@ address1, address2, address3, - address4 + address4, + telephone, + email FROM suppliers WHERE supplierid " . LIKE . " '%" . $_POST['SupplierCode'] . "%' ORDER BY supplierid"; @@ -263,6 +269,8 @@ <th>' . _('Address 2') . '</th> <th>' . _('Address 3') . '</th> <th>' . _('Address 4') . '</th> + <th>' . _('Telephone') . '</th> + <th>' . _('Email') . '</th> </tr>'; echo $tableheader; $j = 1; @@ -286,6 +294,8 @@ <td>'.$myrow['address2'].'</td> <td>'.$myrow['address3'].'</td> <td>'.$myrow['address4'].'</td> + <td>'.$myrow['telephone'].'</td> + <td><a href="mailto://'.$myrow['email'].'">' . $myrow['email']. '</a></td> </tr>'; $RowIndex = $RowIndex + 1; //end of page full new headings if Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-10-25 07:51:57 UTC (rev 5728) +++ trunk/doc/Change.log 2012-10-25 08:20:07 UTC (rev 5729) @@ -1,4 +1,7 @@ webERP Change Log + +25/10/12 Phil: Added telephone and email to supplier search - SelectSupplier.php +25/10/12 Phil: Rounding error prevented CounterSales.php from posting a sale where currency was rounding to 0 decimal places - reported by Arwan 20/10/12 Samudaya Nanayakkara: Fixed the problem of Authoriser drop down selection when try to edit a Internal Departments. 19/10/12 Phil: Fixed exchange rate trend using google based https://encrypted.google.com/finance/chart? 18/10/12 Phil: Added google exchange rates option - many more rates than ECB published daily |
From: <dai...@us...> - 2012-11-02 23:45:44
|
Revision: 5732 http://sourceforge.net/p/web-erp/reponame/5732 Author: daintree Date: 2012-11-02 23:45:41 +0000 (Fri, 02 Nov 2012) Log Message: ----------- Modifiable salesman on order entry and counter sales Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/CounterSales.php trunk/DeliveryDetails.php trunk/SelectOrderItems.php trunk/includes/DefineCartClass.php trunk/sql/mysql/upgrade4.09-4.10.sql Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2012-10-29 02:00:22 UTC (rev 5731) +++ trunk/ConfirmDispatch_Invoice.php 2012-11-02 23:45:41 UTC (rev 5732) @@ -60,6 +60,7 @@ salesorders.deladd6, salesorders.contactphone, salesorders.contactemail, + salesorders.salesperson, salesorders.freightcost, salesorders.deliverydate, debtorsmaster.currcode, @@ -114,6 +115,8 @@ $_SESSION['Items'.$identifier]->BrAdd6 = $myrow['deladd6']; $_SESSION['Items'.$identifier]->PhoneNo = $myrow['contactphone']; $_SESSION['Items'.$identifier]->Email = $myrow['contactemail']; + $_SESSION['Items'.$identifier]->SalesPerson = $myrow['salesperson']; + $_SESSION['Items'.$identifier]->Location = $myrow['fromstkloc']; $_SESSION['Items'.$identifier]->FreightCost = $myrow['freightcost']; $_SESSION['Old_FreightCost'] = $myrow['freightcost']; @@ -740,7 +743,7 @@ $SQL = "UPDATE custbranch SET defaultshipvia ='" . $_SESSION['Items'.$identifier]->ShipVia . "' WHERE debtorno='" . $_SESSION['Items'.$identifier]->DebtorNo . "' - AND branchcode='" . $_SESSION['Items'.$identifier]->Branch . "'"; + AND branchcode='" . $_SESSION['Items'.$identifier]->Branch . "'"; $ErrMsg = _('Could not update the default shipping carrier for this branch because'); $DbgMsg = _('The SQL used to update the branch default carrier was'); $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true); @@ -1201,7 +1204,7 @@ AND salesanalysis.cust=custbranch.debtorno AND salesanalysis.custbranch=custbranch.branchcode AND salesanalysis.area=custbranch.area - AND salesanalysis.salesperson=custbranch.salesman + AND salesanalysis.salesperson='" . $_SESSION['Items'.$identifier]->SalesPerson . "' AND salesanalysis.typeabbrev ='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' AND salesanalysis.periodno='" . $PeriodNo . "' AND salesanalysis.cust " . LIKE . " '" . $_SESSION['Items'.$identifier]->DebtorNo . "' @@ -1265,10 +1268,9 @@ '" . $OrderLine->StockID . "', custbranch.area, 1, - custbranch.salesman, + '" . $_SESSION['Items'.$identifier]->SalesPerson . "', stockmaster.categoryid - FROM stockmaster, - custbranch + FROM stockmaster, custbranch WHERE stockmaster.stockid = '" . $OrderLine->StockID . "' AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "' AND custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "'"; Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2012-10-29 02:00:22 UTC (rev 5731) +++ trunk/CounterSales.php 2012-11-02 23:45:41 UTC (rev 5732) @@ -32,6 +32,7 @@ $_SESSION['Items'.$identifier]->DeliverTo = $_POST['DeliverTo']; $_SESSION['Items'.$identifier]->PhoneNo = $_POST['PhoneNo']; $_SESSION['Items'.$identifier]->Email = $_POST['Email']; + $_SESSION['Items'.$identifier]->SalesPerson = $_POST['SalesPerson']; } if (isset($_POST['QuickEntry'])){ @@ -178,8 +179,9 @@ $_SESSION['Items'.$identifier]->DeliverBlind = $myrow['deliverblind']; $_SESSION['Items'.$identifier]->SpecialInstructions = $myrow['specialinstructions']; $_SESSION['Items'.$identifier]->DeliveryDays = $myrow['estdeliverydays']; - $_SESSION['Items'.$identifier]->TaxGroup = $myrow['taxgroupid']; - + $_SESSION['Items'.$identifier]->TaxGroup = $myrow['taxgroupid']; + $_SESSION['Items'.$identifier]->SalesPerson = $myrow['salesman']; + if ($_SESSION['Items'.$identifier]->SpecialInstructions) { prnMsg($_SESSION['Items'.$identifier]->SpecialInstructions,'warn'); } @@ -875,9 +877,27 @@ </tr>'; echo '<tr> - <td>'. _('Comments') .':</td> - <td><textarea name="Comments" cols="23" rows="5">' . stripcslashes($_SESSION['Items'.$identifier]->Comments) .'</textarea></td> - </tr>'; + <td>' . _('Sales person'). ':</td> + <td><select name="SalesPerson">'; + $SalesPeopleResult = DB_query("SELECT salesmancode, salesmanname FROM salesman WHERE current=1",$db); + if (!isset($_POST['SalesPerson']) AND $_SESSION['SalesmanLogin']!=NULL ){ + $_SESSION['Items'.$identifier]->SalesPerson = $_SESSION['SalesmanLogin']; + } + + while ($SalesPersonRow = DB_fetch_array($SalesPeopleResult)){ + if ($SalesPersonRow['salesmancode']==$_SESSION['Items'.$identifier]->SalesPerson){ + echo '<option selected="selected" value="' . $SalesPersonRow['salesmancode'] . '">' . $SalesPersonRow['salesmanname'] . '</option>'; + } else { + echo '<option value="' . $SalesPersonRow['salesmancode'] . '">' . $SalesPersonRow['salesmanname'] . '</option>'; + } + } + + echo '</select></td> + </tr>'; + echo '<tr> + <td>'. _('Comments') .':</td> + <td><textarea name="Comments" cols="23" rows="5">' . stripcslashes($_SESSION['Items'.$identifier]->Comments) .'</textarea></td> + </tr>'; echo '</table>'; //end the sub table in the first column of master table echo '</td><th valign="bottom">'; //for the master table echo '<table class="selection">'; // a new nested table in the second column of master table @@ -1052,7 +1072,8 @@ fromstkloc, deliverydate, confirmeddate, - deliverblind) + deliverblind, + salesperson) VALUES ( '" . $OrderNo . "', '" . $_SESSION['Items'.$identifier]->DebtorNo . "', @@ -1069,7 +1090,8 @@ '" . $_SESSION['Items'.$identifier]->Location ."', '" . Date('Y-m-d') . "', '" . Date('Y-m-d') . "', - 0)"; + 0, + '" . $_SESSION['Items'.$identifier]->SalesPerson . "')"; $ErrMsg = _('The order cannot be added because'); $InsertQryResult = DB_query($HeaderSQL,$db,$ErrMsg); @@ -1129,39 +1151,39 @@ $QuantityDemand = $DemandRow[0]; $SQL = "SELECT SUM((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem - FROM salesorderdetails INNER JOIN salesorders - ON salesorderdetails.orderno=salesorders.orderno - INNER JOIN bom - ON salesorderdetails.stkcode=bom.parent - INNER JOIN stockmaster - ON stockmaster.stockid=bom.parent - WHERE salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 - AND bom.component='" . $StockItem->StockID . "' - AND salesorderdetails.completed=0 - AND salesorders.quotation=0"; + FROM salesorderdetails INNER JOIN salesorders + ON salesorderdetails.orderno=salesorders.orderno + INNER JOIN bom + ON salesorderdetails.stkcode=bom.parent + INNER JOIN stockmaster + ON stockmaster.stockid=bom.parent + WHERE salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 + AND bom.component='" . $StockItem->StockID . "' + AND salesorderdetails.completed=0 + AND salesorders.quotation=0"; $AssemblyDemandResult = DB_query($SQL,$db); $AssemblyDemandRow = DB_fetch_row($AssemblyDemandResult); $QuantityAssemblyDemand = $AssemblyDemandRow[0]; $SQL = "SELECT SUM(purchorderdetails.quantityord - purchorderdetails.quantityrecd) as qtyonorder - FROM purchorderdetails INNER JOIN purchorders - ON purchorderdetails.orderno = purchorders.orderno - WHERE purchorderdetails.itemcode = '" . $StockItem->StockID . "' - AND purchorderdetails.completed = 0 - AND purchorders.status<>'Cancelled' - AND purchorders.status<>'Rejected' - AND purchorders.status<>'Pending' - AND purchorders.status<>'Completed'"; + FROM purchorderdetails INNER JOIN purchorders + ON purchorderdetails.orderno = purchorders.orderno + WHERE purchorderdetails.itemcode = '" . $StockItem->StockID . "' + AND purchorderdetails.completed = 0 + AND purchorders.status<>'Cancelled' + AND purchorders.status<>'Rejected' + AND purchorders.status<>'Pending' + AND purchorders.status<>'Completed'"; $PurchOrdersResult = DB_query($SQL,$db); $PurchOrdersRow = DB_fetch_row($PurchOrdersResult); $QuantityPurchOrders = $PurchOrdersRow[0]; $SQL = "SELECT SUM(woitems.qtyreqd - woitems.qtyrecd) as qtyonorder - FROM woitems INNER JOIN workorders - ON woitems.wo=workorders.wo - WHERE woitems.stockid = '" . $StockItem->StockID . "' - AND woitems.qtyreqd > woitems.qtyrecd - AND workorders.closed = 0"; + FROM woitems INNER JOIN workorders + ON woitems.wo=workorders.wo + WHERE woitems.stockid = '" . $StockItem->StockID . "' + AND woitems.qtyreqd > woitems.qtyrecd + AND workorders.closed = 0"; $WorkOrdersResult = DB_query($SQL,$db); $WorkOrdersRow = DB_fetch_row($WorkOrdersResult); $QuantityWorkOrders = $WorkOrdersRow[0]; @@ -1619,7 +1641,7 @@ AND salesanalysis.cust=custbranch.debtorno AND salesanalysis.custbranch=custbranch.branchcode AND salesanalysis.area=custbranch.area - AND salesanalysis.salesperson=custbranch.salesman + AND salesanalysis.sales |
From: <dai...@us...> - 2012-11-03 00:09:48
|
Revision: 5733 http://sourceforge.net/p/web-erp/reponame/5733 Author: daintree Date: 2012-11-03 00:09:44 +0000 (Sat, 03 Nov 2012) Log Message: ----------- David Short improvement to GLPostings.inc Modified Paths: -------------- trunk/doc/Change.log trunk/includes/GLPostings.inc Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-11-02 23:45:41 UTC (rev 5732) +++ trunk/doc/Change.log 2012-11-03 00:09:44 UTC (rev 5733) @@ -1,5 +1,6 @@ webERP Change Log +3/11/12 David Short: improve GLPostings.inc just update all gltrans posted once the postings are done rather than a whole load of updates for each gltrans posted 25/10/12 Phil: Added telephone and email to supplier search - SelectSupplier.php 25/10/12 Phil: Rounding error prevented CounterSales.php from posting a sale where currency was rounding to 0 decimal places - reported by Arwan 20/10/12 Samudaya Nanayakkara: Fixed the problem of Authoriser drop down selection when try to edit a Internal Departments. Modified: trunk/includes/GLPostings.inc =================================================================== --- trunk/includes/GLPostings.inc 2012-11-02 23:45:41 UTC (rev 5732) +++ trunk/includes/GLPostings.inc 2012-11-03 00:09:44 UTC (rev 5733) @@ -82,13 +82,13 @@ for ( $CurrPeriod = $CreateFrom; $CurrPeriod <= $CreateTo; $CurrPeriod++ ) { $sql = "SELECT counterindex, - periodno, - account, - amount - FROM gltrans - WHERE posted=0 - AND periodno='" . $CurrPeriod . "' - ORDER BY account"; + periodno, + account, + amount + FROM gltrans + WHERE posted=0 + AND periodno='" . $CurrPeriod . "' + ORDER BY account"; $UnpostedTransResult = DB_query($sql, $db); @@ -99,23 +99,22 @@ if($CurrentAccount != $UnpostedTrans['account']) { if($CurrentAccount != 0) { $sql = "UPDATE chartdetails SET actual = actual + " . $TotalAmount . " - WHERE accountcode = '" . $CurrentAccount . "' - AND period= '" . $CurrPeriod . "'"; + WHERE accountcode = '" . $CurrentAccount . "' + AND period= '" . $CurrPeriod . "'"; $PostPrd = DB_query($sql,$db); /*Update the BFwd for all following ChartDetail records */ $sql = "UPDATE chartdetails SET bfwd = bfwd + " . $TotalAmount . " - WHERE accountcode = '" . $CurrentAccount . "' - AND period > '" . $CurrPeriod . "'"; + WHERE accountcode = '" . $CurrentAccount . "' + AND period > '" . $CurrPeriod . "'"; $PostBFwds = DB_query($sql,$db); } $TotalAmount = 0; $CurrentAccount = $UnpostedTrans['account']; } - $TotalAmount = filter_number_format($TotalAmount + $UnpostedTrans['amount']); - /*Update the Actual charge in the period of the transaction */ - $sql = "UPDATE gltrans SET posted = 1 WHERE counterindex = '" . $UnpostedTrans['counterindex'] . "'"; - $Posted = DB_query($sql,$db); + $TotalAmount += $UnpostedTrans['amount']; } + $sql = "UPDATE gltrans SET posted = 1 WHERE periodno = '" . $CurrPeriod . "' AND posted=0"; + $Posted = DB_query($sql,$db); // There will be one chartdetail update outstanding if we processed anything if($CurrentAccount != 0) { $sql = "UPDATE chartdetails SET actual = actual + " . $TotalAmount . " |
From: <dai...@us...> - 2012-11-03 04:34:51
|
Revision: 5735 http://sourceforge.net/p/web-erp/reponame/5735 Author: daintree Date: 2012-11-03 04:34:48 +0000 (Sat, 03 Nov 2012) Log Message: ----------- Jesus Aguirre tags on purchase invoice entry + fix for CounterSales + CounterReturns.php Modified Paths: -------------- trunk/CounterSales.php trunk/SuppTransGLAnalysis.php trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/doc/Change.log trunk/doc/Manual/ManualContributors.html trunk/includes/DefineSuppTransClass.php trunk/includes/GLPostings.inc trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.09-4.10.sql Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2012-11-03 00:10:51 UTC (rev 5734) +++ trunk/CounterSales.php 2012-11-03 04:34:48 UTC (rev 5735) @@ -732,8 +732,7 @@ } /* end of discount matrix lookup code */ -if (count($_SESSION['Items'.$identifier]->LineItems)>0 - AND !isset($_POST['ProcessSale'])){ /*only show order lines if there are any */ +if (count($_SESSION['Items'.$identifier]->LineItems)>0 ){ /*only show order lines if there are any */ /* // ************************************************************************* // T H I S W H E R E T H E S A L E I S D I S P L A Y E D @@ -1449,21 +1448,20 @@ qty, standardcost, show_on_inv_crds, - newqoh - ) VALUES ( - '" . $AssParts['component'] . "', - 10, - '" . $InvoiceNo . "', - '" . $_SESSION['Items'.$identifier]->Location . "', - '" . $DefaultDispatchDate . "', - '" . $_SESSION['Items'.$identifier]->DebtorNo . "', - '" . $_SESSION['Items'.$identifier]->Branch . "', - '" . $PeriodNo . "', - '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $OrderNo . "', - '" . -$AssParts['quantity'] * $OrderLine->Quantity . "', - '" . $AssParts['standard'] . "', - 0, - newqoh-" . ($AssParts['quantity'] * $OrderLine->Quantity) . " )"; + newqoh) + VALUES ('" . $AssParts['component'] . "', + 10, + '" . $InvoiceNo . "', + '" . $_SESSION['Items'.$identifier]->Location . "', + '" . $DefaultDispatchDate . "', + '" . $_SESSION['Items'.$identifier]->DebtorNo . "', + '" . $_SESSION['Items'.$identifier]->Branch . "', + '" . $PeriodNo . "', + '" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $OrderNo . "', + '" . -$AssParts['quantity'] * $OrderLine->Quantity . "', + '" . $AssParts['standard'] . "', + 0, + newqoh-" . ($AssParts['quantity'] * $OrderLine->Quantity) . " )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records for the assembly components of'). ' '. $OrderLine->StockID . ' ' . _('could not be inserted because'); $DbgMsg = _('The following SQL to insert the assembly components stock movement records was used'); @@ -1671,14 +1669,14 @@ qty=qty +" . $OrderLine->Quantity . ", disc=disc+" . ($OrderLine->DiscountPercent * $OrderLine->Price * $OrderLine->Quantity / $ExRate) . " WHERE salesanalysis.area='" . $myrow[5] . "' - AND salesanalysis.salesperson='" . $myrow[8] . "' - AND typeabbrev ='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' - AND periodno = '" . $PeriodNo . "' - AND cust " . LIKE . " '" . $_SESSION['Items'.$identifier]->De |
From: <dai...@us...> - 2012-11-08 07:34:32
|
Revision: 5737 http://sourceforge.net/p/web-erp/reponame/5737 Author: daintree Date: 2012-11-08 07:34:28 +0000 (Thu, 08 Nov 2012) Log Message: ----------- Craig Craven updated Japanese translation Modified Paths: -------------- trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/SelectProduct.php trunk/doc/Change.log trunk/includes/PDFStarter.php trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po Modified: trunk/PDFQuotation.php =================================================================== --- trunk/PDFQuotation.php 2012-11-03 04:35:52 UTC (rev 5736) +++ trunk/PDFQuotation.php 2012-11-08 07:34:28 UTC (rev 5737) @@ -240,7 +240,7 @@ $LeftOvers = $pdf->addTextWrap(700,$YPos,90,$FontSize,locale_number_format($QuotationTotal,$myrow['currdecimalplaces']),'right'); $YPos -= ($line_height); - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,20,10,_('Notes:')); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,30,10,_('Notes:')); $myrow['comments'] = str_replace('\r','',$myrow['comments']); $myrow['comments'] = str_replace('\n','',$myrow['comments']); $LeftOvers = $pdf->addTextWrap($XPos+28,$YPos,800,10,$myrow['comments']); Modified: trunk/PDFQuotationPortrait.php =================================================================== --- trunk/PDFQuotationPortrait.php 2012-11-03 04:35:52 UTC (rev 5736) +++ trunk/PDFQuotationPortrait.php 2012-11-08 07:34:28 UTC (rev 5737) @@ -228,7 +228,7 @@ include ('includes/PDFQuotationPageHeader.inc'); } //end if need a new page headed up - $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,200,10,_('Notes:')); + $LeftOvers = $pdf->addTextWrap($XPos,$YPos-80,30,10,_('Notes:')); $LeftOvers = $pdf->addText($XPos,$YPos-95,10,$myrow['comments']); if (mb_strlen($LeftOvers)>1){ Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2012-11-03 04:35:52 UTC (rev 5736) +++ trunk/SelectProduct.php 2012-11-08 07:34:28 UTC (rev 5737) @@ -68,8 +68,8 @@ stockmaster.volume, stockmaster.kgs, stockcategory.categorydescription - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid WHERE stockid='" . $StockID . "'", $db); $myrow = DB_fetch_array($result); $Its_A_Kitset_Assembly_Or_Dummy = false; @@ -138,7 +138,8 @@ echo '<tr><th colspan="2">' . _('Sell Price') . ':</th> <td class="select">'; $PriceResult = DB_query("SELECT typeabbrev, - price FROM prices + price + FROM prices WHERE currabrev ='" . $_SESSION['CompanyRecord']['currencydefault'] . "' AND typeabbrev = '" . $_SESSION['DefaultPriceList'] . "' AND debtorno='' @@ -147,8 +148,7 @@ AND stockid='" . $StockID . "'", $db); if ($myrow['mbflag'] == 'K' OR $myrow['mbflag'] == 'A') { $CostResult = DB_query("SELECT SUM(bom.quantity * (stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost)) AS cost - FROM bom INNER JOIN - stockmaster + FROM bom INNER JOIN stockmaster ON bom.component=stockmaster.stockid WHERE bom.parent='" . $StockID . "' AND bom.effectiveto > '" . Date('Y-m-d') . "' @@ -164,7 +164,8 @@ } else { $PriceRow = DB_fetch_row($PriceResult); $Price = $PriceRow[1]; - echo $PriceRow[0] . '</td><td class="select">' . locale_number_format($Price, $_SESSION['CompanyRecord']['decimalplaces']) . '</td> + echo $PriceRow[0] . '</td> + <td class="select">' . locale_number_format($Price, $_SESSION['CompanyRecord']['decimalplaces']) . '</td> <th class="number">' . _('Gross Profit') . '</th> <td class="select">'; if ($Price > 0) { @@ -368,7 +369,7 @@ <th style="width:10%">' . _('Lead Time') . '</th> <th style="width:10%">' . _('Min Order Qty') . '</th> <th style="width:5%">' . _('Prefer') . '</th></tr>'; - $SuppResult = DB_query("SELECT suppliers.suppname, + $SuppResult = DB_query("SELECT suppliers.suppname, suppliers.currcode, suppliers.supplierid, purchdata.price, Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-11-03 04:35:52 UTC (rev 5736) +++ trunk/doc/Change.log 2012-11-08 07:34:28 UTC (rev 5737) @@ -1,5 +1,6 @@ webERP Change Log +8/11/12 Craig Craven: Updated Japanese translation 3/11/12 Phil: Fixed BAD bug wtth CounterSales.php it was possible to make sales where the invoice didn't agree with the sum of the lines sold!! 3/11/12 Phil: Added CounterReturns.php script to handle cash returns 3/11/12 Jesus Aguirre: Added tag selection to purchase invoice gl analysis Modified: trunk/includes/PDFStarter.php =================================================================== --- trunk/includes/PDFStarter.php 2012-11-03 04:35:52 UTC (rev 5736) +++ trunk/includes/PDFStarter.php 2012-11-08 07:34:28 UTC (rev 5737) @@ -174,11 +174,12 @@ /* Javier: I have brought this piece from the pdf class constructor to get it closer to the admin/user, I corrected it to match TCPDF, but it still needs check, after which, I think it should be moved to each report to provide flexible Document Header and Margins in a per-report basis. */ - $pdf->SetAutoPageBreak(true, 0); // Javier: needs check. + $pdf->SetPrintHeader(false); // Javier: I added this must be called before Add Pa |
From: <dai...@us...> - 2012-11-10 09:12:40
|
Revision: 5738 http://sourceforge.net/p/web-erp/reponame/5738 Author: daintree Date: 2012-11-10 09:12:37 +0000 (Sat, 10 Nov 2012) Log Message: ----------- Modified Paths: -------------- trunk/Z_DeleteCreditNote.php trunk/Z_DeleteInvoice.php trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po Modified: trunk/Z_DeleteCreditNote.php =================================================================== --- trunk/Z_DeleteCreditNote.php 2012-11-08 07:34:28 UTC (rev 5737) +++ trunk/Z_DeleteCreditNote.php 2012-11-10 09:12:37 UTC (rev 5738) @@ -119,7 +119,16 @@ } /* Delete the stock movements */ +$SQL = "DELETE stockmovestaxes.* FROM stockmovestaxes INNER JOIN stockmoves + ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno + WHERE stockmoves.type=11 AND stockmoves.transno = '" . $_GET['CreditNoteNo'] . "'"; +$ErrMsg = _('SQL to delete the stock movement tax records failed with the message'); +$Result = DB_query($SQL, $db,$ErrMsg,$DbgMsg,true); +prnMsg(_('Deleted the credit note stock move taxes').'info'); +echo '<br /><br />'; + + $SQL = "DELETE FROM stockmoves WHERE type=11 AND transno = '" . $_GET['CreditNoteNo'] . "'"; @@ -128,6 +137,14 @@ prnMsg(_('Deleted the credit note stock movements').'info'); echo '<br /><br />'; + + + +$SQL = "DELETE FROM gltrans WHERE type=11 AND typeno= '" . $_GET['CreditNoteNo'] . "'"; +$ErrMsg = _('SQL to delete the gl transaction records failed with the message'); +$Result = DB_query($SQL, $db,$ErrMsg,$DbgMsg,true); +prnMsg(_('Deleted the credit note general ledger transactions').'info'); + $result = DB_Txn_Commit($db); prnMsg(_('Credit note number') . ' ' . $_GET['CreditNoteNo'] . ' ' . _('has been completely deleted') . '. ' . _('To ensure the integrity of the general ledger transactions must be reposted from the period the credit note was created'),'info'); Modified: trunk/Z_DeleteInvoice.php =================================================================== --- trunk/Z_DeleteInvoice.php 2012-11-08 07:34:28 UTC (rev 5737) +++ trunk/Z_DeleteInvoice.php 2012-11-10 09:12:37 UTC (rev 5738) @@ -138,18 +138,27 @@ have been previous sales to the same customer/branch for the same item Delete Sales Analysis records */ $SQL = "DELETE FROM salesanalysis - WHERE periodno = '" . $OrderLine['prd'] . "' - AND cust='" . $OrderLine['debtorno'] . "' - AND custbranch = '" . $OrderLine['branchcode'] . "' - AND qty = '" . $OrderLine['qty'] . "' - AND stockid = '" . $OrderLine['stockid'] . "'"; - + WHERE periodno = '" . $OrderLine['prd'] . "' + AND cust='" . $OrderLine['debtorno'] . "' + AND custbranch = '" . $OrderLine['branchcode'] . "' + AND qty = '" . $OrderLine['qty'] . "' + AND stockid = '" . $OrderLine['stockid'] . "'"; + $ErrMsg = _('The SQL to delete the sales analysis records failed because'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg,true); prnMsg(_('Sales analysis records deleted') . ' - ' . _('this deleted all sales analysis for the customer/branch and items on this invoice'),'info'); } +$SQL = "DELETE stockmovestaxes.* FROM stockmovestaxes INNER JOIN stockmoves + ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno + WHERE stockmoves.type=10 AND stockmoves.transno = '" . $_GET['Invoi |
From: <dai...@us...> - 2012-11-11 08:03:20
|
Revision: 5739 http://sourceforge.net/p/web-erp/reponame/5739 Author: daintree Date: 2012-11-11 08:03:16 +0000 (Sun, 11 Nov 2012) Log Message: ----------- Make CreditInvoice.php use $identifier to identify session. Fix propagation of identifier in sub worker scripts for entry of serial numbered items Modified Paths: -------------- trunk/CreditItemsControlled.php trunk/Credit_Invoice.php trunk/SelectCreditItems.php trunk/doc/Change.log trunk/includes/DefineCartClass.php trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsKeyed.php Modified: trunk/CreditItemsControlled.php =================================================================== --- trunk/CreditItemsControlled.php 2012-11-10 09:12:37 UTC (rev 5738) +++ trunk/CreditItemsControlled.php 2012-11-11 08:03:16 UTC (rev 5739) @@ -12,22 +12,27 @@ include('includes/header.inc'); -if ($_GET['CreditInvoice']=='Yes' || $_POST['CreditInvoice']=='Yes'){ - $_SESSION['CreditInv']=true; -} else { - $_SESSION['CreditInv']=false; -} -if ($_SESSION['CreditInv']){ +if ($_GET['CreditInvoice']=='Yes' OR $_POST['CreditInvoice']=='Yes'){ $CreditLink = 'Credit_Invoice.php'; } else { $CreditLink = 'SelectCreditItems.php'; } +if (!isset($_GET['identifier'])){ + echo '<div class="centre"><a href="' . $rootpath . '/' . $CreditLink . '">'. _('Select Credit Items'). '</a><br /><br />'; + prnMsg( _('This page must be called with the identifier to uniquely identify the credit note being entered. This is a programming error that should not occur.') , 'error'); + echo '</div>'; + include('includes/footer.inc'); + exit; +} else { + $identifier=$_GET['identifier']; + $CreditLink .= '?identifier=' . $identifier; +} if (isset($_GET['LineNo'])){ - $LineNo = $_GET['LineNo']; + $LineNo = $_GET['LineNo']; } elseif (isset($_POST['LineNo'])){ - $LineNo = $_POST['LineNo']; + $LineNo = $_POST['LineNo']; } else { echo '<div class="centre"><a href="' . $rootpath . '/' . $CreditLink . '">'. _('Select Credit Items'). '</a><br /><br />'; prnMsg( _('This page can only be opened if a Line Item on a credit note has been selected.') . ' ' . _('Please do that first'), 'error'); @@ -36,7 +41,7 @@ exit; } -if (!isset($_SESSION['CreditItems'])) { +if (!isset($_SESSION['CreditItems' . $identifier])) { /* This page can only be called with a credit note entry part entered */ echo '<div class="centre"><a href="' . $rootpath . '/' . $CreditLink . '">'. _('Select Credit Items'). '</a> <br /> @@ -49,7 +54,7 @@ /*Save some typing by referring to the line item class object in short form */ -$LineItem = &$_SESSION['CreditItems']->LineItems[$LineNo]; +$LineItem = &$_SESSION['CreditItems' . $identifier]->LineItems[$LineNo]; //Make sure this item is really controlled if ( $LineItem->Controlled != 1 ){ @@ -69,16 +74,12 @@ echo '<div class="centre">'; -if ($CreditLink == 'Credit_Invoice.php'){ - echo '<input type="hidden" name="CreditInvoice" value="Yes" />'; -} - echo '<br /><a href="' . $rootpath . '/' . $CreditLink . '">'. _('Back to Credit Note Entry'). '</a>'; -echo '<br /><b>'. _('Credit of Controlled Item'). ' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('from') .' '. $_SESSION['CreditItems']->CustomerName . '</b></div>'; +echo '<br /><b>'. _('Credit of Controlled Item'). ' ' . $LineItem->StockID . ' - ' . $LineItem->ItemDescription . ' '. _('from') .' '. $_SESSION['CreditItems' . $identifier]->CustomerName . '</b></div>'; /** vars needed by InputSerialItem : **/ -$LocationOut = $_SESSION['CreditItems']->Location; +$LocationOut = $_SESSION['CreditItems' . $identifier]->Location; /* $_SESSION['CreditingControlledItems_MustExist'] is in config.php - Phil and Jesse disagree on the default treatment compromise position make it user configurable */ $ItemMustExist = $_SESSION['CreditingControlledItems_MustExist']; $StockID = $LineItem->StockID; @@ -92,10 +93,10 @@ /*TotalQuantity set inside this include file from the sum of the bundles of the item selected for dispatch */ -if ($CreditLink == 'Credit_Invoice.php'){ - $_SESSION['CreditItems']->LineItems[$LineNo]->QtyDispatched = $TotalQuantity; +if ($CreditLink == 'Credit_Invoice.php?identifier=' . $identifier){ + $_SESSION['CreditItems' . $identifier]->LineItems[$LineNo]->QtyDispatched = $TotalQuantity; } else { - $_SESSION['CreditItems']->LineItems[$LineNo]->Quantity = $TotalQuantity; + $_SESSION['CreditItems' . $identifier]->LineItems[$LineNo]->Quantity = $TotalQuantity; } include('includes/footer.inc'); Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-11-10 09:12:37 UTC (rev 5738) +++ trunk/Credit_Invoice.php 2012-11-11 08:03:16 UTC (rev 5739) @@ -13,6 +13,13 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); +if (empty($_GET['identifier'])) { + /*unique session identifier to ensure that there is no conflict with other credit entry sessions on the same machine */ + $identifier=date('U'); +} else { + $identifier=$_GET['identifier']; +} + if (!isset($_GET['InvoiceNumber']) AND !$_SESSION['ProcessingCredit']) { /* This page can only be called with an invoice number for crediting*/ prnMsg(_('This page can only be opened if an invoice has been selected for crediting') . '. ' . _('Please select an invoice first') . ' - ' . _('from the customer inquiry screen click the link to credit an invoice'),'info'); @@ -21,11 +28,11 @@ } elseif (isset($_GET['InvoiceNumber'])) { $_GET['InvoiceNumber']=intval($_GET['InvoiceNumber']); - unset($_SESSION['CreditItems']->LineItems); - unset($_SESSION['CreditItems']); + unset($_SESSION['CreditItems' . $identifier]->LineItems); + unset($_SESSION['CreditItems' . $identifier]); $_SESSION['ProcessingCredit'] = intval($_GET['InvoiceNumber']); - $_SESSION['CreditItems'] = new cart; + $_SESSION['CreditItems' . $identifier] = new cart; /*read in all the guff from the selected invoice into the Items cart */ @@ -73,24 +80,24 @@ $myrow = DB_fetch_array($GetInvHdrResult); /*CustomerID variable registered by header.inc */ - $_SESSION['CreditItems']->DebtorNo = $myrow['debtorno']; - $_SESSION['CreditItems']->TransID = $myrow['transid']; - $_SESSION['CreditItems']->Branch = $myrow['branchcode']; - $_SESSION['CreditItems']->CustomerName = $myrow['name']; - $_SESSION['CreditItems']->CustRef = $myrow['reference']; - $_SESSION['CreditItems']->Comments = $myrow['invtext']; - $_SESSION['CreditItems']->DefaultSalesType =$myrow['tpe']; - $_SESSION['CreditItems']->DefaultCurrency = $myrow['currcode']; - $_SESSION['CreditItems']->Location = $myrow['loccode']; + $_SESSION['CreditItems' . $identifier]->DebtorNo = $myrow['debtorno']; + $_SESSION['CreditItems' . $identifier]->TransID = $myrow['transid']; + $_SESSION['CreditItems' . $identifier]->Branch = $myrow['branchcode']; + $_SESSION['CreditItems' . $identifier]->CustomerName = $myrow['name']; + $_SESSION['CreditItems' . $identifier]->CustRef = $myrow['reference']; + $_SESSION['CreditItems' . $identifier]->Comments = $myrow['invtext']; + $_SESSION['CreditItems' . $identifier]->DefaultSalesType =$myrow['tpe']; + $_SESSION['CreditItems' . $identifier]->DefaultCurrency = $myrow['currcode']; + $_SESSION['CreditItems' . $identifier]->Location = $myrow['loccode']; $_SESSION['Old_FreightCost'] = $myrow['ovfreight']; $_SESSION['CurrencyRate'] = $myrow['currency_rate']; - $_SESSION['CreditItems']->OrderNo = $myrow['order_']; - $_SESSION['CreditItems']->ShipVia = $myrow['shipvia']; - $_SESSION['CreditItems']->TaxGroup = $myrow['taxgroupid']; - $_SESSION['CreditItems']->FreightCost = $myrow['ovfreight']; - $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; - $_SESSION['CreditItems']->GetFreightTaxes(); - $_SESSION['CreditItems']->CurrDecimalPlaces = $myrow['decimalplaces']; + $_SESSION['CreditItems' . $identifier]->OrderNo = $myrow['order_']; + $_SESSION['CreditItems' . $identifier]->ShipVia = $myrow['shipvia']; + $_SESSION['CreditItems' . $identifier]->TaxGroup = $myrow['taxgroupid']; + $_SESSION['CreditItems' . $identifier]->FreightCost = $myrow['ovfreight']; + $_SESSION['CreditItems' . $identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; + $_SESSION['CreditItems' . $identifier]->GetFreightTaxes(); + $_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces = $myrow['decimalplaces']; DB_free_result($GetInvHdrResult); @@ -132,9 +139,9 @@ while ($myrow=DB_fetch_array($LineItemsResult)) { - $LineNumber = $_SESSION['CreditItems']->LineCounter; + $LineNumber = $_SESSION['CreditItems' . $identifier]->LineCounter; - $_SESSION['CreditItems']->add_to_cart($myrow['stockid'], + $_SESSION['CreditItems' . $identifier]->add_to_cart($myrow['stockid'], $myrow['quantity'], $myrow['description'], $myrow['longdescription'], @@ -160,7 +167,7 @@ '', $myrow['standardcost']); - $_SESSION['CreditItems']->GetExistingTaxes($LineNumber, $myrow['stkmoveno']); + $_SESSION['CreditItems' . $identifier]->GetExistingTaxes($LineNumber, $myrow['stkmoveno']); if ($myrow['controlled']==1){/* Populate the SerialItems array too*/ @@ -175,8 +182,8 @@ $SerialItemsResult = DB_query($SQL,$db,$ErrMsg, $DbgMsg); while ($SerialItemsRow = DB_fetch_array($SerialItemsResult)){ - $_SESSION['CreditItems']->LineItems[$LineNumber]->SerialItems[$SerialItemsRow['serialno']] = new SerialItem($SerialItemsRow['serialno'], -$SerialItemsRow['moveqty']); - $_SESSION['CreditItems']->LineItems[$LineNumber]->QtyDispatched -= $SerialItemsRow['moveqty']; + $_SESSION['CreditItems' . $identifier]->LineItems[$LineNumber]->SerialItems[$SerialItemsRow['serialno']] = new SerialItem($SerialItemsRow['serialno'], -$SerialItemsRow['moveqty']); + $_SESSION['CreditItems' . $identifier]->LineItems[$LineNumber]->QtyDispatched -= $SerialItemsRow['moveqty']; } } /* end if the item is a controlled item */ } /* loop thro line items from stock movement records */ @@ -198,34 +205,34 @@ } if (isset($_POST['Location'])){ - $_SESSION['CreditItems']->Location = $_POST['Location']; + $_SESSION['CreditItems' . $identifier]->Location = $_POST['Location']; $NewDispatchTaxProvResult = DB_query("SELECT taxprovinceid FROM locations WHERE loccode='" . $_POST['Location'] . "'",$db); $myrow = DB_fetch_array($NewDispatchTaxProvResult); - $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; + $_SESSION['CreditItems' . $identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; - foreach ($_SESSION['CreditItems']->LineItems as $LineItem) { - $_SESSION['CreditItems']->GetTaxes($LineItem->LineNumber); + foreach ($_SESSION['CreditItems' . $identifier]->LineItems as $LineItem) { + $_SESSION['CreditItems' . $identifier]->GetTaxes($LineItem->LineNumber); } } if (isset($_POST['ChargeFreightCost'])){ - $_SESSION['CreditItems']->FreightCost = filter_number_format($_POST['ChargeFreightCost']); + $_SESSION['CreditItems' . $identifier]->FreightCost = filter_number_format($_POST['ChargeFreightCost']); } -foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { +foreach ($_SESSION['CreditItems' . $identifier]->FreightTaxes as $FreightTaxLine) { if (isset($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])){ - $_SESSION['CreditItems']->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])/100; + $_SESSION['CreditItems' . $identifier]->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])/100; } } -if ($_SESSION['CreditItems']->ItemsOrdered > 0 OR isset($_POST['NewItem'])){ +if ($_SESSION['CreditItems' . $identifier]->ItemsOrdered > 0 OR isset($_POST['NewItem'])){ if(isset($_GET['Delete'])){ - $_SESSION['CreditItems']->remove_from_cart($_GET['Delete']); + $_SESSION['CreditItems' . $identifier]->remove_from_cart($_GET['Delete']); } - foreach ($_SESSION['CreditItems']->LineItems as $LineItem) { + foreach ($_SESSION['CreditItems' . $identifier]->LineItems as $LineItem) { if (isset($_POST['Quantity_' . $LineItem->LineNumber])){ @@ -237,14 +244,14 @@ If ($Quantity<0 OR $Price <0 OR $DiscountPercentage >100 OR $DiscountPercentage <0){ prnMsg(_('The item could not be updated because you are attempting to set the quantity credited to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'error'); } else { - $_SESSION['CreditItems']->LineItems[$LineItem->LineNumber]->QtyDispatched=$Quantity; - $_SESSION['CreditItems']->LineItems[$LineItem->LineNumber]->Price=$Price; - $_SESSION['CreditItems']->LineItems[$LineItem->LineNumber]->DiscountPercent=($DiscountPercentage/100); - $_SESSION['CreditItems']->LineItems[$LineItem->LineNumber]->Narrative=$Narrative; + $_SESSION['CreditItems' . $identifier]->LineItems[$LineItem->LineNumber]->QtyDispatched=$Quantity; + $_SESSION['CreditItems' . $identifier]->LineItems[$LineItem->LineNumber]->Price=$Price; + $_SESSION['CreditItems' . $identifier]->LineItems[$LineItem->LineNumber]->DiscountPercent=($DiscountPercentage/100); + $_SESSION['CreditItems' . $identifier]->LineItems[$LineItem->LineNumber]->Narrative=$Narrative; } foreach ($LineItem->Taxes as $TaxLine) { if (isset($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ - $_SESSION['CreditItems']->LineItems[$LineItem->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])/100; + $_SESSION['CreditItems' . $identifier]->LineItems[$LineItem->LineNumber]->Taxes[$TaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])/100; } } } @@ -257,7 +264,7 @@ if (!isset($_POST['ProcessCredit'])) { - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier=' . $identifier . '" method="post">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -265,8 +272,8 @@ echo '<table cellpadding="2" class="selection">'; echo '<tr><th colspan="13">'; echo '<div class="centre"><b>' . _('Credit Invoice') . ' ' . $_SESSION['ProcessingCredit'] . '</b> - <b>'.' - ' . $_SESSION['CreditItems']->CustomerName . '</b> - - ' . _('Credit Note amounts stated in') . ' ' . $_SESSION['CreditItems']->DefaultCurrency . '</div>'; + <b>'.' - ' . $_SESSION['CreditItems' . $identifier]->CustomerName . '</b> + - ' . _('Credit Note amounts stated in') . ' ' . $_SESSION['CreditItems' . $identifier]->DefaultCurrency . '</div>'; echo '</th></tr>'; echo '<tr><th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> @@ -281,9 +288,9 @@ <th>' . _('Tax') . '<br />' . _('Amount') . '</th> <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th></tr>'; - $_SESSION['CreditItems']->total = 0; - $_SESSION['CreditItems']->totalVolume = 0; - $_SESSION['CreditItems']->totalWeight = 0; + $_SESSION['CreditItems' . $identifier]->total = 0; + $_SESSION['CreditItems' . $identifier]->totalVolume = 0; + $_SESSION['CreditItems' . $identifier]->totalWeight = 0; } $TaxTotals = array(); $TaxGLCodes = array(); @@ -293,24 +300,24 @@ $k=0; //row colour counter $j=0; //row counter -if(isset($_POST['AutoUpdate']) and !isset($_POST['Update'])){//clear the $_SESSION value when users have not click update button and directly process the credit note - $_SESSION['CreditItems']->total = 0; - $_SESSION['CreditItems']->totalVolume = 0; - $_SESSION['CreditItems']->totalWeight = 0; +if(isset($_POST['AutoUpdate']) AND !isset($_POST['Update'])){//clear the $_SESSION value when users have not click update button and directly process the credit note + $_SESSION['CreditItems' . $identifier]->total = 0; + $_SESSION['CreditItems' . $identifier]->totalVolume = 0; + $_SESSION['CreditItems' . $identifier]->totalWeight = 0; } -foreach ($_SESSION['CreditItems']->LineItems as $LnItm) { +foreach ($_SESSION['CreditItems' . $identifier]->LineItems as $LnItm) { $LineTotal = $LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent); - if (isset($_POST['AutoUpdate']) and !isset($_POST['Update'])){//If users push Process Credit button instead of Update button, use this variable to update related information - $_SESSION['CreditItems']->total +=$LineTotal; - $_SESSION['CreditItems']->totalVolume += ($LnItm->QtyDispatched * $LnItm->Volume); - $_SESSION['CreditItems']->totalWeight += ($LnItm->QtyDispatched * $LnItm->Weight); + if (isset($_POST['AutoUpdate']) AND !isset($_POST['Update'])){//If users push Process Credit button instead of Update button, use this variable to update related information + $_SESSION['CreditItems' . $identifier]->total +=$LineTotal; + $_SESSION['CreditItems' . $identifier]->totalVolume += ($LnItm->QtyDispatched * $LnItm->Volume); + $_SESSION['CreditItems' . $identifier]->totalWeight += ($LnItm->QtyDispatched * $LnItm->Weight); } $LineTotal = $LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent); if (!isset($_POST['ProcessCredit'])) { - $_SESSION['CreditItems']->total += $LineTotal; - $_SESSION['CreditItems']->totalVolume += ($LnItm->QtyDispatched * $LnItm->Volume); - $_SESSION['CreditItems']->totalWeight += ($LnItm->QtyDispatched * $LnItm->Weight); + $_SESSION['CreditItems' . $identifier]->total += $LineTotal; + $_SESSION['CreditItems' . $identifier]->totalVolume += ($LnItm->QtyDispatched * $LnItm->Volume); + $_SESSION['CreditItems' . $identifier]->totalWeight += ($LnItm->QtyDispatched * $LnItm->Weight); if ($k==1){ $RowStarter = 'class="EvenTableRows"'; @@ -328,7 +335,7 @@ if ($LnItm->Controlled==1){ - echo '<td><input type="hidden" name="Quantity_' . $LnItm->LineNumber .'" value="' . $LnItm->QtyDispatched . '" /><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LnItm->LineNumber . '&CreditInvoice=Yes">' . $LnItm->QtyDispatched . '</a></td>'; + echo '<td><input type="hidden" name="Quantity_' . $LnItm->LineNumber .'" value="' . $LnItm->QtyDispatched . '" /><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LnItm->LineNumber . '&CreditInvoice=Yes&identifier=' . $identifier . '">' . $LnItm->QtyDispatched . '</a></td>'; } else { @@ -336,7 +343,7 @@ } - $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces); $j++; echo '<td><input tabindex="' . $j . '" type="text" class="number" name="Price_' . $LnItm->LineNumber . '" maxlength="12" size="6" value="' . $LnItm->Price . '" /></td> @@ -346,8 +353,8 @@ /*Need to list the taxes applicable to this line */ echo '<td>'; $i=0; - if (is_array($_SESSION['CreditItems']->LineItems[$LnItm->LineNumber]->Taxes) ){ - foreach ($_SESSION['CreditItems']->LineItems[$LnItm->LineNumber]->Taxes AS $Tax) { + if (is_array($_SESSION['CreditItems' . $identifier]->LineItems[$LnItm->LineNumber]->Taxes) ){ + foreach ($_SESSION['CreditItems' . $identifier]->LineItems[$LnItm->LineNumber]->Taxes AS $Tax) { if ($i>0){ echo '<br />'; } @@ -383,38 +390,42 @@ } $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['CreditItems']->CurrDecimalPlaces); - $DisplayGrossLineTotal = locale_number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $DisplayTaxAmount = locale_number_format($TaxLineTotal ,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces); + $DisplayGrossLineTotal = locale_number_format($LineTotal+ $TaxLineTotal,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces); if (!isset($_POST['ProcessCredit'])) { echo '</td>'; echo '<td class="number">' . $DisplayTaxAmount . '</td> <td class="number">' . $DisplayGrossLineTotal . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Delete=' . $LnItm->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this item from the credit?') . '\');">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Delete=' . $LnItm->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this item from the credit?') . '\');">' . _('Delete') . '</a></td> + </tr>'; - echo '<tr ' . $RowStarter . '><td colspan="12"><textarea tabindex="' . $j .'" name="Narrative_' . $LnItm->LineNumber . '" cols="100%" rows="1">' . $LnItm->Narrative . '</textarea><br /><hr /></td></tr>'; + echo '<tr ' . $RowStarter . '> + <td colspan="12"><textarea tabindex="' . $j .'" name="Narrative_' . $LnItm->LineNumber . '" cols="100%" rows="1">' . $LnItm->Narrative . '</textarea> + <br /> + <hr /></td> + </tr>'; $j++; } } /*end foreach loop displaying the invoice lines to credit */ -if (!isset($_POST['ChargeFreightCost']) AND !isset($_SESSION['CreditItems']->FreightCost)){ +if (!isset($_POST['ChargeFreightCost']) AND !isset($_SESSION['CreditItems' . $identifier]->FreightCost)){ $_POST['ChargeFreightCost']=0; } if (!isset($_POST['ProcessCredit'])) { echo '<tr> <td colspan="3" class="number">' . _('Freight cost charged on invoice') . '</td> - <td class="number">' . locale_number_format($_SESSION['Old_FreightCost'],$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($_SESSION['Old_FreightCost'],$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</td> <td></td> <td colspan="2" class="number">' . _('Credit Freight Cost') . '</td> - <td><input tabindex="'.$j.'" type="text" class="number" size="6" maxlength="6" name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '" /></td>'; + <td><input tabindex="'.$j.'" type="text" class="number" size="6" maxlength="6" name="ChargeFreightCost" value="' . $_SESSION['CreditItems' . $identifier]->FreightCost . '" /></td> + <td></td> + <td>'; - echo '<td>'; - echo '</td><td>'; - $i=0; // initialise the number of taxes iterated through - foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { + foreach ($_SESSION['CreditItems' . $identifier]->FreightTaxes as $FreightTaxLine) { if ($i>0){ echo '<br />'; } @@ -425,7 +436,7 @@ $FreightTaxTotal =0; //initialise tax total $i=0; -foreach ($_SESSION['CreditItems']->FreightTaxes as $FreightTaxLine) { +foreach ($_SESSION['CreditItems' . $identifier]->FreightTaxes as $FreightTaxLine) { if ($i>0){ echo '<br />'; } @@ -434,33 +445,35 @@ echo '<input type="text" class="number" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . '" maxlength="4" size="4" value="' . $FreightTaxLine->TaxRate * 100 . '" />'; } if ($FreightTaxLine->TaxOnTax ==1){ - $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); - $FreightTaxTotal += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems']->FreightCost + $FreightTaxTotal)); + $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems' . $identifier]->FreightCost + $FreightTaxTotal)); + $FreightTaxTotal += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems' . $identifier]->FreightCost + $FreightTaxTotal)); } else { - $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * $_SESSION['CreditItems']->FreightCost); - $FreightTaxTotal += ($FreightTaxLine->TaxRate * $_SESSION['CreditItems']->FreightCost); + $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * $_SESSION['CreditItems' . $identifier]->FreightCost); + $FreightTaxTotal += ($FreightTaxLine->TaxRate * $_SESSION['CreditItems' . $identifier]->FreightCost); } $i++; $TaxGLCodes[$FreightTaxLine->TaxAuthID] = $FreightTaxLine->TaxGLCode; } if (!isset($_POST['ProcessCredit'])) { echo '</td>'; - echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> - <td class="number">' . locale_number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</td> + echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($FreightTaxTotal+ $_SESSION['CreditItems' . $identifier]->FreightCost,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</td> </tr>'; } $TaxTotal += $FreightTaxTotal; -$DisplayTotal = locale_number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces); +$DisplayTotal = locale_number_format($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces); if (!isset($_POST['ProcessCredit'])) { echo '<tr> - <td colspan="7" class="number">' . _('Credit Totals') . '</td> - <td class="number"><hr /><b>' . $DisplayTotal . '</b><hr /></td> - <td colspan="2"></td> - <td class="number"><hr /><b>' . locale_number_format($TaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces) . '</b><hr /></td> - <td class="number"><hr /><b>' . locale_number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),$_SESSION['CreditItems']->CurrDecimalPlaces) . '</b><hr /></td> - </tr></table>'; + <td colspan="7" class="number">' . _('Credit Totals') . '</td> + <td class="number"><hr /><b>' . $DisplayTotal . '</b><hr /></td> + <td colspan="2"></td> + <td class="number"><hr /><b>' . locale_number_format($TaxTotal,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</b><hr /></td> + <td class="number"><hr /><b>' . locale_number_format($TaxTotal+($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost),$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</b> + <hr /></td> + </tr> + </table>'; } $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); @@ -477,8 +490,8 @@ $SQL = "SELECT area FROM custbranch - WHERE custbranch.debtorno ='". $_SESSION['CreditItems']->DebtorNo . "' - AND custbranch.branchcode = '" . $_SESSION['CreditItems']->Branch . "'"; + WHERE custbranch.debtorno ='". $_SESSION['CreditItems' . $identifier]->DebtorNo . "' + AND custbranch.branchcode = '" . $_SESSION['CreditItems' . $identifier]->Branch . "'"; $Result = DB_query($SQL,$db); $myrow = DB_fetch_row($Result); @@ -517,19 +530,19 @@ /*Do some rounding */ - $_SESSION['CreditItems']->total = round($_SESSION['CreditItems']->total,$_SESSION['CreditItems']->CurrDecimalPlaces); - $TaxTotal = round($TaxTotal,$_SESSION['CreditItems']->CurrDecimalPlaces); + $_SESSION['CreditItems' . $identifier]->total = round($_SESSION['CreditItems' . $identifier]->total,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces); + $TaxTotal = round($TaxTotal,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces); $Allocate_amount=0; $Settled =0; $SettledInvoice=0; if ($myrow[0]>0){ /*the invoice is not already fully allocated */ - if ($myrow[0] > ($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)){ + if ($myrow[0] > ($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost + $TaxTotal)){ - $Allocate_amount = $_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal; + $Allocate_amount = $_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost + $TaxTotal; $Settled = 1; - } else if ($myrow[0] > ($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)) { + } else if ($myrow[0] > ($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost + $TaxTotal)) { /*the balance left to allocate is less than the credit note value */ $Allocate_amount = $myrow[0]; $SettledInvoice = 1; @@ -573,17 +586,17 @@ settled) VALUES (". $CreditNo . ", 11, - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . $_SESSION['CreditItems' . $identifier]->Branch . "', '" . $DefaultDispatchDate . "', '" . date('Y-m-d H-i-s') . "', '" . $PeriodNo . "', 'Inv-" . $_SESSION['ProcessingCredit'] . "', - '" . $_SESSION['CreditItems']->DefaultSalesType . "', - '" . $_SESSION['CreditItems']->OrderNo . "', - '" . -$_SESSION['CreditItems']->total . "', + '" . $_SESSION['CreditItems' . $identifier]->DefaultSalesType . "', + '" . $_SESSION['CreditItems' . $identifier]->OrderNo . "', + '" . -$_SESSION['CreditItems' . $identifier]->total . "', '" . -$TaxTotal . "', - '" . -$_SESSION['CreditItems']->FreightCost . "', + '" . -$_SESSION['CreditItems' . $identifier]->FreightCost . "', '" . $_SESSION['CurrencyRate'] . "', '" . $_POST['CreditText'] . "', '" . -$Allocate_amount . "', @@ -619,7 +632,7 @@ datealloc) VALUES ('" . $Allocate_amount . "', '" . $CreditTransID . "', - '" . $_SESSION['CreditItems']->TransID . "', + '" . $_SESSION['CreditItems' . $identifier]->TransID . "', '" . Date('Y-m-d') . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The allocation record for the credit note could not be added to the database because'); @@ -630,7 +643,7 @@ /* Update sales order details quantity invoiced less this credit quantity. */ - foreach ($_SESSION['CreditItems']->LineItems as $CreditLine) { + foreach ($_SESSION['CreditItems' . $identifier]->LineItems as $CreditLine) { if ($CreditLine->QtyDispatched >0){ $LocalCurrencyPrice= round(($CreditLine->Price / $_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']); @@ -648,7 +661,7 @@ $SQL="SELECT locstock.quantity FROM locstock WHERE locstock.stockid='" . $CreditLine->StockID . "' - AND loccode= '" . $_SESSION['CreditItems']->Location . "'"; + AND loccode= '" . $_SESSION['CreditItems' . $identifier]->Location . "'"; $Result = DB_query($SQL, $db); if (DB_num_rows($Result)==1){ $LocQtyRow = DB_fetch_row($Result); @@ -672,7 +685,7 @@ $SQL = "UPDATE salesorderdetails SET qtyinvoiced = qtyinvoiced - " . $CreditLine->QtyDispatched . ", completed=0 - WHERE orderno = '" . $_SESSION['CreditItems']->OrderNo . "' + WHERE orderno = '" . $_SESSION['CreditItems' . $identifier]->OrderNo . "' AND stkcode = '" . $CreditLine->StockID . "' AND quantity >=" . $CreditLine->QtyDispatched; @@ -688,7 +701,7 @@ $SQL = "UPDATE locstock SET locstock.quantity = locstock.quantity + " . $CreditLine->QtyDispatched . " WHERE locstock.stockid = '" . $CreditLine->StockID . "' - AND loccode = '" . $_SESSION['CreditItems']->Location . "'"; + AND loccode = '" . $_SESSION['CreditItems' . $identifier]->Location . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Location stock record could not be updated because'); $DbgMsg = _('The following SQL to update the location stock record was used'); @@ -732,7 +745,7 @@ $SQL="SELECT locstock.quantity FROM locstock WHERE locstock.stockid='" . $AssParts['component'] . "' - AND loccode= '" . $_SESSION['CreditItems']->Location . "'"; + AND loccode= '" . $_SESSION['CreditItems' . $identifier]->Location . "'"; $Result = DB_query($SQL, $db, _('Could not get the current location stock of the assembly component') . ' ' . $AssParts['component'], _('The SQL that failed was'), true); if (DB_num_rows($Result)==1){ $LocQtyRow = DB_fetch_row($Result); @@ -763,10 +776,10 @@ VALUES ('" . $AssParts['component'] . "', 11, '" . $CreditNo . "', - '" . $_SESSION['CreditItems']->Location . "', + '" . $_SESSION['CreditItems' . $identifier]->Location . "', '" . $DefaultDispatchDate . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . $_SESSION['CreditItems' . $identifier]->Branch . "', '" . $PeriodNo . "', '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $CreditLine->StockID . "', '" . ($AssParts['quantity'] * $CreditLine->QtyDispatched) . "', @@ -791,10 +804,10 @@ VALUES ('" . $AssParts['component'] . "', 11, '" . $CreditNo . "', - '" . $_SESSION['CreditItems']->Location . "', + '" . $_SESSION['CreditItems' . $identifier]->Location . "', '" . $DefaultDispatchDate . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . $_SESSION['CreditItems' . $identifier]->Branch . "', '" . $PeriodNo . "', '" . _('Ex Inv') . ': ' . $_SESSION['ProcessingCredit'] . ' ' . _('Assembly') . ': ' . $CreditLine->StockID . "', '" . ($AssParts['quantity'] * $CreditLine->QtyDispatched) . "', @@ -810,7 +823,7 @@ $SQL = "UPDATE locstock SET locstock.quantity = locstock.quantity + " . ($AssParts['quantity'] * $CreditLine->QtyDispatched) . " WHERE locstock.stockid = '" . $AssParts['component'] . "' - AND loccode = '" . $_SESSION['CreditItems']->Location . "'"; + AND loccode = '" . $_SESSION['CreditItems' . $identifier]->Location . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Location stock record could not be updated for an assembly component because'); $DbgMsg = _('The following SQL to update the components location stock record was used'); @@ -818,7 +831,7 @@ } } /* end of assembly explosion and updates */ /*Update the cart with the recalculated standard cost from the explosion of the assembly's components*/ - $_SESSION['CreditItems']->LineItems[$CreditLine->LineNumber]->StandardCost = $StandardCost; + $_SESSION['CreditItems' . $identifier]->LineItems[$CreditLine->LineNumber]->StandardCost = $StandardCost; $CreditLine->StandardCost = $StandardCost; } @@ -843,10 +856,10 @@ VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', - '" . $_SESSION['CreditItems']->Location . "', + '" . $_SESSION['CreditItems' . $identifier]->Location . "', '" . $DefaultDispatchDate . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . $_SESSION['CreditItems' . $identifier]->Branch . "', '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') .' - ' . $_SESSION['ProcessingCredit'] . "', @@ -874,10 +887,10 @@ VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', - '" . $_SESSION['CreditItems']->Location . "', + '" . $_SESSION['CreditItems' . $identifier]->Location . "', '" . $DefaultDispatchDate . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . $_SESSION['CreditItems' . $identifier]->Branch . "', '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') . " - " . $_SESSION['ProcessingCredit'] . "', @@ -899,7 +912,7 @@ /*We need to add the StockSerialItem record and The StockSerialMoves as well */ $SQL = "SELECT quantity from stockserialitems WHERE stockid='" . $CreditLine->StockID . "' - AND loccode='" . $_SESSION['CreditItems']->Location . "' + AND loccode='" . $_SESSION['CreditItems' . $identifier]->Location . "' AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be selected because'); @@ -913,7 +926,7 @@ quantity) VALUES ('" . $CreditLine->StockID . "', - '" . $_SESSION['CreditItems']->Location . "', + '" . $_SESSION['CreditItems' . $identifier]->Location . "', '" . $Item->BundleRef . "', '". $Item->BundleQty ."')"; @@ -925,7 +938,7 @@ $SQL = "UPDATE stockserialitems SET quantity= quantity + " . $Item->BundleQty . " WHERE stockid='" . $CreditLine->StockID . "' - AND loccode='" . $_SESSION['CreditItems']->Location . "' + AND loccode='" . $_SESSION['CreditItems' . $identifier]->Location . "' AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -972,10 +985,10 @@ VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', - '" . $_SESSION['CreditItems']->Location . "', + '" . $_SESSION['CreditItems' . $identifier]->Location . "', '" . $DefaultDispatchDate . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . $_SESSION['CreditItems' . $identifier]->Branch . "', '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') . ' - ' . $_SESSION['ProcessingCredit'] . "', @@ -1009,10 +1022,10 @@ VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', - '" . $_SESSION['CreditItems']->Location . "', + '" . $_SESSION['CreditItems' . $identifier]->Location . "', '" . $DefaultDispatchDate . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . $_SESSION['CreditItems' . $identifier]->Branch . "', '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Written off ex Inv') . ' - ' . $_SESSION['ProcessingCredit'] . "', @@ -1048,10 +1061,10 @@ VALUES ('" . $CreditLine->StockID . "', 11, '" . $CreditNo . "', - '" . $_SESSION['CreditItems']->Location . "', + '" . $_SESSION['CreditItems' . $identifier]->Location . "', '" . $DefaultDispatchDate . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . $_SESSION['CreditItems' . $identifier]->Branch . "', '" . $LocalCurrencyPrice . "', '" . $PeriodNo . "', '" . _('Ex Inv') .' - ' . $_SESSION['ProcessingCredit'] . "', @@ -1076,10 +1089,10 @@ foreach ($CreditLine->Taxes as $Tax) { $SQL = "INSERT INTO stockmovestaxes (stkmoveno, - taxauthid, - taxrate, - taxcalculationorder, - taxontax) + taxauthid, + taxrate, + taxcalculationorder, + taxontax) VALUES ('" . $StkMoveNo . "', '" . $Tax->TaxAuthID . "', '" . $Tax->TaxRate . "', @@ -1105,10 +1118,10 @@ INNER JOIN stockmaster ON salesanalysis.stkcategory=stockmaster.categoryid AND salesanalysis.stockid=stockmaster.stockid - WHERE typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' + WHERE typeabbrev ='" . $_SESSION['CreditItems' . $identifier]->DefaultSalesType . "' AND periodno='" . $PeriodNo . "' - AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' - AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' + AND cust = '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "' + AND custbranch = '" . $_SESSION['CreditItems' . $identifier]->Branch . "' AND salesanalysis.stockid = '" . $CreditLine->StockID . "' AND budgetoractual=1 GROUP BY stkcategory, @@ -1131,10 +1144,10 @@ disc=disc-" . ($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . " WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' - AND typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' + AND typeabbrev ='" . $_SESSION['CreditItems' . $identifier]->DefaultSalesType . "' AND periodno = '" . $PeriodNo . "' - AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' - AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' + AND cust = '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "' + AND custbranch = '" . $_SESSION['CreditItems' . $identifier]->Branch . "' AND stockid = '" . $CreditLine->StockID . "' AND salesanalysis.stkcategory ='" . $myrow[1] . "' AND budgetoractual=1"; @@ -1148,10 +1161,10 @@ disc=disc-" . $CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate'] . " WHERE salesanalysis.area='" . $myrow[2] . "' AND salesanalysis.salesperson='" . $myrow[3] . "' - AND typeabbrev ='" . $_SESSION['CreditItems']->DefaultSalesType . "' + AND typeabbrev ='" . $_SESSION['CreditItems' . $identifier]->DefaultSalesType . "' AND periodno = '" . $PeriodNo . "' - AND cust = '" . $_SESSION['CreditItems']->DebtorNo . "' - AND custbranch = '" . $_SESSION['CreditItems']->Branch . "' + AND cust = '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "' + AND custbranch = '" . $_SESSION['CreditItems' . $identifier]->Branch . "' AND stockid = '" . $CreditLine->StockID . "' AND salesanalysis.stkcategory ='" . $myrow[1] . "' AND budgetoractual=1"; @@ -1173,11 +1186,11 @@ budgetoractual, salesperson, stkcategory) - SELECT '" . $_SESSION['CreditItems']->DefaultSalesType . "', + SELECT '" . $_SESSION['CreditItems' . $identifier]->DefaultSalesType . "', '" . $PeriodNo . "', '" . -$CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . $_SESSION['CreditItems' . $identifier]->Branch . "', 0, '" . -$CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate'] . "', '" . $CreditLine->StockID . "', @@ -1188,8 +1201,8 @@ FROM stockmaster, custbranch WHERE stockmaster.stockid = '" . $CreditLine->StockID . "' - AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "' - AND custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "'"; + AND custbranch.debtorno = '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "' + AND custbranch.branchcode='" . $_SESSION['CreditItems' . $identifier]->Branch . "'"; } else { $SQL = "INSERT INTO salesanalysis (typeabbrev, @@ -1205,12 +1218,12 @@ budgetoractual, salesperson, stkcategory) - SELECT '" . $_SESSION['CreditItems']->DefaultSalesType . "', + SELECT '" . $_SESSION['CreditItems' . $identifier]->DefaultSalesType . "', '" . $PeriodNo . "', '" . -$CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate'] . "', '" . -$CreditLine->StandardCost * $CreditLine->QtyDispatched . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . $_SESSION['CreditItems']->Branch . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . $_SESSION['CreditItems' . $identifier]->Branch . "', '" . -$CreditLine->QtyDispatched . "', '" . -$CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate'] . "', '" . $CreditLine->StockID . "', @@ -1221,8 +1234,8 @@ FROM stockmaster, custbranch WHERE stockmaster.stockid = '" . $CreditLine->StockID . "' - AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "' - AND custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "'"; + AND custbranch.debtorno = '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "' + AND custbranch.branchcode='" . $_SESSION['CreditItems' . $identifier]->Branch . "'"; } } @@ -1240,7 +1253,7 @@ /*first the cost of sales entry*/ - $COGSAccount = GetCOGSGLAccount($Area, $CreditLine->StockID, $_SESSION['CreditItems']->DefaultSalesType, $db); + $COGSAccount = GetCOGSGLAccount($Area, $CreditLine->StockID, $_SESSION['CreditItems' . $identifier]->DefaultSalesType, $db); $SQL = "INSERT INTO gltrans (type, typeno, @@ -1254,7 +1267,7 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $COGSAccount . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', '" . -round($CreditLine->StandardCost * $CreditLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; @@ -1278,7 +1291,7 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $_POST['WriteOffGLCode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', '" . round($CreditLine->StandardCost * $CreditLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "')"; } else { $StockGLCode = GetStockGLCode($CreditLine->StockID, $db); @@ -1294,7 +1307,7 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $StockGLCode['stockact'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->StandardCost . "', '" . round($CreditLine->StandardCost * $CreditLine->QtyDispatched,$_SESSION['CompanyRecord']['decimalplaces']) . "')"; } @@ -1307,7 +1320,7 @@ if ($_SESSION['CompanyRecord']['gllink_debtors']==1 AND $CreditLine->Price !=0){ //Post sales transaction to GL credit sales - $SalesGLAccounts = GetSalesGLAccount($Area, $CreditLine->StockID, $_SESSION['CreditItems']->DefaultSalesType, $db); + $SalesGLAccounts = GetSalesGLAccount($Area, $CreditLine->StockID, $_SESSION['CreditItems' . $identifier]->DefaultSalesType, $db); $SQL = "INSERT INTO gltrans (type, typeno, @@ -1321,7 +1334,7 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $SalesGLAccounts['salesglcode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->Price . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . " - " . $CreditLine->StockID . " x " . $CreditLine->QtyDispatched . " @ " . $CreditLine->Price . "', '" . round($CreditLine->Price * $CreditLine->QtyDispatched/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; @@ -1343,7 +1356,7 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $SalesGLAccounts['discountglcode'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . " - " . $CreditLine->StockID . " @ " . ($CreditLine->DiscountPercent * 100) . "%', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . " - " . $CreditLine->StockID . " @ " . ($CreditLine->DiscountPercent * 100) . "%', '" . -round($CreditLine->Price * $CreditLine->QtyDispatched * $CreditLine->DiscountPercent/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit note discount GL posting could not be inserted because'); @@ -1358,7 +1371,7 @@ if ($_SESSION['CompanyRecord']['gllink_debtors']==1){ /*Post credit note transaction to GL credit debtors, debit freight re-charged and debit sales */ - if (($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal) !=0) { + if (($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost + $TaxTotal) !=0) { $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -1371,8 +1384,8 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . -round(($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . -round(($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting for the credit note could not be inserted because'); @@ -1384,7 +1397,7 @@ /*Could do with setting up a more flexible freight posting schema that looks at the sales type and area of the customer branch to determine where to post the freight recovery */ - if (round($_SESSION['CreditItems']->FreightCost,$_SESSION['CreditItems']->CurrDecimalPlaces) !=0 ) { + if (round($_SESSION['CreditItems' . $identifier]->FreightCost,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) !=0 ) { $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -1397,8 +1410,8 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['freightact'] . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . round($_SESSION['CreditItems']->FreightCost/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', + '" . round($_SESSION['CreditItems' . $identifier]->FreightCost/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The freight GL posting for this credit note could not be inserted because'); @@ -1423,7 +1436,7 @@ '" . $DefaultDispatchDate . "', '" . $PeriodNo . "', '" . $TaxGLCodes[$TaxAuthID] . "', - '" . $_SESSION['CreditItems']->DebtorNo . "', + '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "', '" . $TaxAmount/$_SESSION['CurrencyRate'] . "' )"; @@ -1439,8 +1452,8 @@ $Result = DB_Txn_Commit($db); - unset($_SESSION['CreditItems']->LineItems); - unset($_SESSION['CreditItems']); + unset($_SESSION['CreditItems' . $identifier]->LineItems); + unset($_SESSION['CreditItems' . $identifier]); unset($_SESSION['ProcessingCredit']); echo '<div class="centre">'._('Credit Note number') . ' ' . $CreditNo . ' ' . _('has been processed'); @@ -1486,7 +1499,7 @@ $Result = DB_query($SQL,$db); if (!isset($_POST['Location'])){ - $_POST['Location'] = $_SESSION['CreditItems']->Location; + $_POST['Location'] = $_SESSION['CreditItems' . $identifier]->Location; } while ($myrow = DB_fetch_array($Result)) { @@ -1526,11 +1539,19 @@ $_POST['CreditText'] = ''; } $j++; - 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') . '" /><br />'; + echo '<tr> + <td>' . _('Credit note text') . '</td> + <td><textarea tabindex="' . $j . '" name="CreditText" cols="31" rows="5">' . $_POST['CreditText'] . '</textarea></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="' . $j . '" type="submit" name="Update" value="' . _('Update') . '" /> + <br />'; $j++; - echo '<input type="hidden" name="AutoUpdate" value="" />'; - echo '<input type="submit" tabindex="'.$j++.'" name="ProcessCredit" value="' . _('Process Credit') .'" /></div>'; + echo '<input type="hidden" name="AutoUpdate" value="" /> + <input type="submit" tabindex="'.$j++.'" name="ProcessCredit" value="' . _('Process Credit') .'" /> + </div>'; } echo '</div>'; echo '</form>'; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2012-11-10 09:12:37 UTC (rev 5738) +++ trunk/SelectCreditItems.php 2012-11-11 08:03:16 UTC (rev 5739) @@ -717,7 +717,7 @@ if ($LineItem->Controlled==0){ echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength="6" size="6" value="' . locale_number_format(round($LineItem->Quantity,$LineItem->DecimalPlaces),$LineItem->DecimalPlaces) . '" /></td>'; } else { - echo '<td class="number"><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LineItem->LineNumber . '">' . locale_number_format($LineItem->Quantity,$LineItem->DecimalPlaces) . '</a> + echo '<td class="number"><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LineItem->LineNumber . '&identifier=' . $identifier . '">' . locale_number_format($LineItem->Quantity,$LineItem->DecimalPlaces) . '</a> <input type="hidden" name="Quantity_' . $LineItem->LineNumber . '" value="' . locale_number_format(round($LineItem->Quantity,$LineItem->DecimalPlaces),$LineItem->DecimalPlaces) . '" /></td>'; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-11-10 09:12:37 UTC (rev 5738) +++ trunk/doc/Change.log 2012-11-11 08:03:16 UTC (rev 5739) @@ -1,5 +1,7 @@ webERP Change Log +11/11/12 Phil: Fixed Credit_Invoice.php to now use identifier to uniquely identify a credit note session +11/11/12 Phil: Fixed links to send session identifier and whether from CreditInvoice or SelectCreditItems.php InputSerialItemsKeyed.php and CreditItemsControlled. Creating credit notes manually for serial numbered items was failing as reported by Bob Thomas 8/11/12 Craig Craven: Updated Japanese translation 3/11/12 Phil: Fixed BAD bug wtth CounterSales.php it was possible to make sales where the invoice didn't agree with the sum of the lines sold!! 3/11/12 Phil: Added CounterReturns.php script to handle cash returns Modified: trunk/includes/DefineCartClass.php =================================================================== --- trunk/includes/DefineCartClass.php 2012-11-10 09:12:37 UTC (rev 5738) +++ trunk/includes/DefineCartClass.php 2012-11-11 08:03:16 UTC (rev 5739) @@ -55,7 +55,7 @@ Var $CreditAvailable; //in customer currency Var $TaxGroup; Var $DispatchTaxProvince; - VAR $vtigerProductID; + var $vtigerProductID; Var $DefaultPOLine; Var $DeliveryDays; var $TaxTotals; Modified: trunk/includes/InputSerialItems.php =================================================================== --- trunk/includes/InputSerialItems.php 2012-11-10 09:12:37 UTC (rev 5738) +++ trunk/includes/InputSerialItems.php 2012-11-11 08:03:16 UTC (rev 5739) @@ -49,47 +49,62 @@ $valid = true; echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') .'?identifier='.$identifier.'" enctype="multipart/form-data" >'; -echo '<div>'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<input type="hidden" name="LineNo" value="' . $LineNo . '" />'; -echo '<input type="hidden" name="StockID" value="'. $StockID. '" />'; -echo '<table class="selection"><tr><td>'; -echo '<input type="radio" name="EntryType" onclick="submit();" '; +echo '<div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <input type="hidden" name="LineNo" value="' . $LineNo . '" /> + <input type="hidden" name="StockID" value="'. $StockID. '" />'; + +if ($_GET['CreditInvoice']=='Yes' OR $_POST['CreditInvoice']=='Yes'){ + echo '<input type="hidden" name="CreditInvoice" value="Yes" />'; +} + +echo '<table class="selection"> + <tr> + <td><input type="radio" name="EntryType" onclick="submit();" '; if ($_POST['EntryType']=='KEYED') { echo ' checked="checked" '; } -echo 'value="KEYED" />'. _('Keyed Entry'); -echo '</td>'; +echo 'value="KEYED" />'. _('Keyed Entry') . '</td>'; if ($LineItem->Serialised==1){ - echo '<td>'; - echo '<input type="radio" name="EntryType" onclick="submit();" '; + echo '<td><input type="radio" name="EntryType" onclick="submit();" '; if ($_POST['EntryType']=='SEQUENCE') { echo ' checked="checked" '; } - echo ' value="SEQUENCE" />'. _('Sequential'); - echo '</td>'; + echo ' value="SEQUENCE" />'. _('Sequential') . '</td>'; } -echo '<td valign="bottom">'; -echo '<input type="radio" id="FileEntry" name="EntryType" onclick="submit();" '; +echo '<td valign="bottom"><input type="radio" id="FileEntry" name="EntryType" onclick="submit();" '; + if ($_POST['EntryType']=='FILE') { echo ' checked="checked" '; } -echo ' value="FILE" />'. _('File Upload'); -echo ' <input type="file" name="ImportFile" onclick="document.getElementById(\'FileEntry\').checked=true;" />'; -echo '</td></tr><tr><td colspan="3">'; -echo '<div class="centre"><input type="submit" value="'. _('Set Entry Type'). ':" /></div>'; -echo '</td></tr></table>'; -echo '</div>'; -echo '</form>'; +echo ' value="FILE" />'. _('File Upload') . ' <input type="file" name="ImportFile" onclick="document.getElementById(\'FileEntry\').checked=true;" /></td> + </tr> + <tr> + <td colspan="3"> + <div class="centre"> + <input type="submit" value="'. _('Set Entry Type'). ':" /> + </div> + </td> + </tr> + </table> + </div> + </form>'; global $tableheader; /* Link to ... [truncated message content] |
From: <dai...@us...> - 2012-11-17 07:53:54
|
Revision: 5741 http://sourceforge.net/p/web-erp/reponame/5741 Author: daintree Date: 2012-11-17 07:53:49 +0000 (Sat, 17 Nov 2012) Log Message: ----------- Fix Credit_Invoice.php for session overlap problem and incorrect StkMoveNo - also add salesman to credit Modified Paths: -------------- trunk/Credit_Invoice.php trunk/SelectCreditItems.php trunk/doc/Manual/ManualContributors.html trunk/includes/ConnectDB_mysqli.inc trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/InputSerialItemsSequential.php trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-11-17 03:18:43 UTC (rev 5740) +++ trunk/Credit_Invoice.php 2012-11-17 07:53:49 UTC (rev 5741) @@ -53,6 +53,7 @@ debtorsmaster.currcode, custbranch.defaultlocation, custbranch.taxgroupid, + custbranch.salesman, stockmoves.loccode, locations.taxprovinceid, currencies.decimalplaces @@ -98,7 +99,8 @@ $_SESSION['CreditItems' . $identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; $_SESSION['CreditItems' . $identifier]->GetFreightTaxes(); $_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces = $myrow['decimalplaces']; - + $_SESSION['CreditItems' . $identifier]->SalesPerson = $myrow['salesman']; + DB_free_result($GetInvHdrResult); /*now populate the line items array with the stock movement records for the invoice*/ @@ -204,7 +206,7 @@ } -if (isset($_POST['Location'])){ +if (isset($_POST['Location']) AND !isset($_POST['ProcessCredit'])){ $_SESSION['CreditItems' . $identifier]->Location = $_POST['Location']; $NewDispatchTaxProvResult = DB_query("SELECT taxprovinceid FROM locations WHERE loccode='" . $_POST['Location'] . "'",$db); @@ -216,10 +218,15 @@ $_SESSION['CreditItems' . $identifier]->GetTaxes($LineItem->LineNumber); } } + if (isset($_POST['ChargeFreightCost'])){ $_SESSION['CreditItems' . $identifier]->FreightCost = filter_number_format($_POST['ChargeFreightCost']); } +if (isset($_POST['SalesPerson'])){ + $_SESSION['CreditItems' . $identifier]->SalesPerson = $_POST['SalesPerson']; +} + foreach ($_SESSION['CreditItems' . $identifier]->FreightTaxes as $FreightTaxLine) { if (isset($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])){ $_SESSION['CreditItems' . $identifier]->FreightTaxes[$FreightTaxLine->TaxCalculationOrder]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])/100; @@ -241,7 +248,7 @@ $Price = filter_number_format($_POST['Price_' . $LineItem->LineNumber]); $DiscountPercentage = filter_number_format($_POST['Discount_' . $LineItem->LineNumber]); - If ($Quantity<0 OR $Price <0 OR $DiscountPercentage >100 OR $DiscountPercentage <0){ + if ($Quantity<0 OR $Price <0 OR $DiscountPercentage >100 OR $DiscountPercentage <0){ prnMsg(_('The item could not be updated because you are attempting to set the quantity credited to less than 0 or the price less than 0 or the discount more than 100% or less than 0%'),'error'); } else { $_SESSION['CreditItems' . $identifier]->LineItems[$LineItem->LineNumber]->QtyDispatched=$Quantity; @@ -646,22 +653,16 @@ foreach ($_SESSION['CreditItems' . $identifier]->LineItems as $CreditLine) { if ($CreditLine->QtyDispatched >0){ + $LocalCurrencyPrice= round(($CreditLine->Price / $_SESSION['CurrencyRate']),$_SESSION['CompanyRecord']['decimalplaces']); - /*Determine the type of stock item being credited */ - $SQL = "SELECT mbflag FROM stockmaster WHERE stockid = '" . $CreditLine->StockID . "'"; - $Result = DB_query($SQL, - $db, - _('Could not determine if the item') . ' ' . $CreditLine->StockID . ' ' . _('is purchased or manufactured'), - _('The SQL used that failed was'),true); - $MBFlagRow = DB_fetch_row($Result); - $MBFlag = $MBFlagRow[0]; - if ($MBFlag=='M' OR $MBFlag=='B'){ + if ($CreditLine->MBflag=='M' oR $CreditLine->MBflag=='B'){ /*Need to get the current location quantity will need it later for the stock movements */ $SQL="SELECT locstock.quantity FROM locstock WHERE locstock.stockid='" . $CreditLine->StockID . "' AND loccode= '" . $_SESSION['CreditItems' . $identifier]->Location . "'"; + $Result = DB_query($SQL, $db); if (DB_num_rows($Result)==1){ $LocQtyRow = DB_fetch_row($Result); @@ -696,7 +697,7 @@ /* Update location stock records if not a dummy stock item */ - if ($MBFlag=='B' OR $MBFlag=='M') { + if ($CreditLine->MBflag=='M' oR $CreditLine->MBflag=='B'){ $SQL = "UPDATE locstock SET locstock.quantity = locstock.quantity + " . $CreditLine->QtyDispatched . " @@ -707,7 +708,7 @@ $DbgMsg = _('The following SQL to update the location stock record was used'); $Result = DB_query($SQL, $db, $ErrMsg,$DbgMsg,true); - } else if ($MBFlag=='A'){ /* its an assembly */ + } else if ($CreditLine->MBflag=='A'){ /* its an assembly */ /*Need to get the BOM for this part and make stock moves for the components and of course update the Location stock balances */ @@ -837,7 +838,7 @@ /* Insert stock movements for the stock coming back in - with unit cost */ - if ($MBFlag=='M' OR $MBFlag=='B'){ + if ($CreditLine->MBflag=='M' oR $CreditLine->MBflag=='B'){ $SQL = "INSERT INTO stockmoves (stockid, type, transno, @@ -1001,7 +1002,9 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement records was used'); $Result = DB_query($SQL, $db,$ErrMsg, $DbgMsg, true); - + /*Get the ID of the StockMove... */ + $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); + $SQL = "INSERT INTO stockmoves (stockid, type, transno, @@ -1080,11 +1083,10 @@ $DbgMsg = _('The following SQL to insert the stock movement records for the purpose of display on the credit note was used'); $Result = DB_query($SQL, $db,$ErrMsg, $DbgMsg, true); + /*Get the ID of the StockMove... */ + $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); } - /*Get the ID of the StockMove... */ - $StkMoveNo = DB_Last_Insert_ID($db,'stockmoves','stkmoveno'); - /*Insert the taxes that applied to this line */ foreach ($CreditLine->Taxes as $Tax) { @@ -1108,13 +1110,11 @@ $SQL="SELECT COUNT(*), stkcategory, - salesanalysis.area, - salesperson + salesanalysis.area FROM salesanalysis INNER JOIN custbranch ON salesanalysis.cust=custbranch.debtorno AND salesanalysis.custbranch=custbranch.branchcode AND salesanalysis.area=custbranch.area - AND salesanalysis.salesperson=custbranch.salesman INNER JOIN stockmaster ON salesanalysis.stkcategory=stockmaster.categoryid AND salesanalysis.stockid=stockmaster.stockid @@ -1124,6 +1124,7 @@ AND custbranch = '" . $_SESSION['CreditItems' . $identifier]->Branch . "' AND salesanalysis.stockid = '" . $CreditLine->StockID . "' AND budgetoractual=1 + AND salesanalysis.salesperson='" . $_SESSION['CreditItems' . $identifier]->SalesPerson . "' GROUP BY stkcategory, salesanalysis.area, salesperson"; @@ -1143,7 +1144,7 @@ SET amt=amt-" . $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate'] . ", disc=disc-" . ($CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate']) . " WHERE salesanalysis.area='" . $myrow[2] . "' - AND salesanalysis.salesperson='" . $myrow[3] . "' + AND salesanalysis.salesperson='" . $_SESSION['CreditItems' . $identifier]->SalesPerson . "' AND typeabbrev ='" . $_SESSION['CreditItems' . $identifier]->DefaultSalesType . "' AND periodno = '" . $PeriodNo . "' AND cust = '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "' @@ -1160,7 +1161,7 @@ qty=qty-" . $CreditLine->QtyDispatched . ", disc=disc-" . $CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->QtyDispatched / $_SESSION['CurrencyRate'] . " WHERE salesanalysis.area='" . $myrow[2] . "' - AND salesanalysis.salesperson='" . $myrow[3] . "' + AND salesanalysis.salesperson='" . $_SESSION['CreditItems' . $identifier]->SalesPerson . "' AND typeabbrev ='" . $_SESSION['CreditItems' . $identifier]->DefaultSalesType . "' AND periodno = '" . $PeriodNo . "' AND cust = '" . $_SESSION['CreditItems' . $identifier]->DebtorNo . "' @@ -1196,7 +1197,7 @@ '" . $CreditLine->StockID . "', custbranch.area, 1, - custbranch.salesman, + '" . $_SESSION['CreditItems' . $identifier]->SalesPerson . "', stockmaster.categoryid FROM stockmaster, custbranch @@ -1229,7 +1230,7 @@ '" . $CreditLine->StockID . "', custbranch.area, 1, - custbranch.salesman, + '" . $_SESSION['CreditItems' . $identifier]->SalesPerson . "', stockmaster.categoryid FROM stockmaster, custbranch @@ -1468,9 +1469,10 @@ } else { /*Process Credit NOT set so allow inputs to set up the credit note */ - echo '<br /><table class="selection">'; - - echo '<tr><td>' . _('Credit Note Type') . '</td> + echo '<br /> + <table class="selection"> + <tr> + <td>' . _('Credit Note Type') . '</td> <td><select tabindex="' . $j .'" name="CreditType">'; if (!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return'){ @@ -1486,14 +1488,17 @@ echo '<option value="Return">' . _('Goods returned to store') . '</option>'; echo '<option selected="selected" value="ReverseOverCharge">' . _('Reverse overcharge') . '</option>'; } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; $j++; if (!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return'){ /*if the credit note is a return of goods then need to know which location to receive them into */ - echo '<tr><td>' . _('Goods returned to location') . '</td><td><select tabindex="'.$j.'" name="Location">'; + echo '<tr> + <td>' . _('Goods returned to location') . '</td> + <td><select tabindex="'.$j.'" name="Location">'; $SQL="SELECT loccode, locationname FROM locations"; $Result = DB_query($SQL,$db); @@ -1514,7 +1519,9 @@ } elseif($_POST['CreditType']=='WriteOff') { /* the goods are to be written off to somewhere */ - echo '<tr><td>' . _('Write off the cost of the goods to') . '</td><td><select tabindex="' . $j .'" name="WriteOffGLCode">'; + echo '<tr> + <td>' . _('Write off the cost of the goods to') . '</td> + <td><select tabindex="' . $j .'" name="WriteOffGLCode">'; $SQL="SELECT accountcode, accountname @@ -1533,13 +1540,32 @@ echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountname'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (!isset($_POST['CreditText'])) { $_POST['CreditText'] = ''; } $j++; echo '<tr> + <td>' . _('Sales person'). ':</td> + <td><select tabindex="' . $j . '" name="SalesPerson">'; + $SalesPeopleResult = DB_query("SELECT salesmancode, salesmanname FROM salesman WHERE current=1",$db); + if (!isset($_POST['SalesPerson']) AND $_SESSION['SalesmanLogin']!=NULL ){ + $_SESSION['CreditItems'.$identifier]->SalesPerson = $_SESSION['SalesmanLogin']; + } + + while ($SalesPersonRow = DB_fetch_array($SalesPeopleResult)){ + if ($SalesPersonRow['salesmancode']==$_SESSION['CreditItems'.$identifier]->SalesPerson){ + |
From: <dai...@us...> - 2012-11-17 08:58:34
|
Revision: 5742 http://sourceforge.net/p/web-erp/reponame/5742 Author: daintree Date: 2012-11-17 08:58:30 +0000 (Sat, 17 Nov 2012) Log Message: ----------- Allow to specify sales person Modified Paths: -------------- trunk/SelectCreditItems.php trunk/doc/Change.log Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2012-11-17 07:53:49 UTC (rev 5741) +++ trunk/SelectCreditItems.php 2012-11-17 08:58:30 UTC (rev 5742) @@ -166,6 +166,7 @@ custbranch.braddress6, custbranch.phoneno, custbranch.email, + custbranch.salesman, custbranch.defaultlocation, custbranch.taxgroupid, locations.taxprovinceid @@ -198,6 +199,7 @@ $_SESSION['CreditItems'.$identifier]->BrAdd6 = $myrow['braddress6']; $_SESSION['CreditItems'.$identifier]->PhoneNo = $myrow['phoneno']; $_SESSION['CreditItems'.$identifier]->Email = $myrow['email']; + $_SESSION['CreditItems'.$identifier]->SalesPerson = $myrow['salesman']; $_SESSION['CreditItems'.$identifier]->Location = $myrow['defaultlocation']; $_SESSION['CreditItems'.$identifier]->TaxGroup = $myrow['taxgroupid']; $_SESSION['CreditItems'.$identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; @@ -264,9 +266,9 @@ echo '<td><input tabindex="'.($j+5).'" type="submit" name="SubmitCustomerSelection' . $j .'" value="' . htmlspecialchars($myrow['brname'], ENT_QUOTES,'UTF-8'). '" /> <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'" /> <input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'" /></td> - <td>'.$myrow['contactname'].'</td> - <td>'.$myrow['phoneno'].'</td> - <td>'.$myrow['faxno'].'</td> + <td>' . $myrow['contactname'] . '</td> + <td>' . $myrow['phoneno'] . '</td> + <td>' . $myrow['faxno'] . '</td> </tr>'; $LastCustomer=$myrow['name']; $j++; @@ -286,6 +288,10 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $_SESSION['CreditItems'.$identifier]->CustomerName . ' - ' . $_SESSION['CreditItems'.$identifier]->DeliverTo.'</p>'; + if (isset($_POST['SalesPerson'])){ + $_SESSION['CreditItems' . $identifier]->SalesPerson = $_POST['SalesPerson']; + } + /* do the search for parts that might be being looked up to add to the credit note */ if (isset($_POST['Search'])){ @@ -870,7 +876,8 @@ /*if the credit note is a return of goods then need to know which location to receive them into */ - echo '<tr><td>' . _('Goods Returned to Location') . ' :</td> + echo '<tr> + <td>' . _('Goods Returned to Location') . ' :</td> <td><select name="Location">'; $SQL="SELECT loccode, locationname FROM locations"; @@ -912,6 +919,24 @@ } echo '</select></td></tr>'; } + echo '<tr> + <td>' . _('Sales person'). ':</td> + <td><select name="SalesPerson">'; + $SalesPeopleResult = DB_query("SELECT salesmancode, salesmanname FROM salesman WHERE current=1",$db); + if (!isset($_POST['SalesPerson']) AND $_SESSION['SalesmanLogin']!=NULL ){ + $_SESSION['CreditItems'.$identifier]->SalesPerson = $_SESSION['SalesmanLogin']; + } + + while ($SalesPersonRow = DB_fetch_array($SalesPeopleResult)){ + if ($SalesPersonRow['salesmancode']==$_SESSION['CreditItems'.$identifier]->SalesPerson){ + echo '<option selected="selected" value="' . $SalesPersonRow['salesmancode'] . '">' . $SalesPersonRow['salesmanname'] . '</option>'; + } else { + echo '<option value="' . $SalesPersonRow['salesmancode'] . '">' . $SalesPersonRow['salesmanname'] . '</option>'; + } + } + + echo '</select></td> + </tr>'; if (!isset($_POST['CreditText'])) { $_POST['CreditText']=''; } @@ -1610,8 +1635,7 @@ $SQL="SELECT COUNT(*), salesanalysis.stkcategory, - salesanalysis.area, - salesanalysis.salesperson + salesanalysis.area FROM salesanalysis, custbranch, stockmaster @@ -1620,7 +1644,7 @@ AND salesanalysis.cust=custbranch.debtorno AND salesanalysis.custbranch=custbranch.branchcode AND salesanalysis.area=custbranch.area - AND salesanalysis.salesperson=custbranch.salesman + AND salesanalysis.salesperson='" . $_SESSION['CreditItems'.$identifier]->SalesPerson . "' AND salesanalysis.typeabbrev ='" . $_SESSION['CreditItems'.$identifier]->DefaultSalesType . "' AND salesanalysis.periodno='" . $PeriodNo . "' AND salesanalysis.cust = '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "' @@ -1635,7 +1659,7 @@ $DbgMsg = _('SQL to count the no of sales analysis records'); $Result = DB_query($SQL,$db, $ErrMsg, $DbgMsg, true); - $myrow = DB_fetch_row($Result); + $myrow = DB_fetch_array($Result); if ($myrow[0]>0){ /*Update the existing record that already exists */ @@ -1645,14 +1669,14 @@ $SQL = "UPDATE salesanalysis SET amt=amt-" . $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate'] . ", disc=disc-" . $CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate'] . " - WHERE salesanalysis.area='" . $myrow[2] . "' - AND salesanalysis.salesperson='" . $myrow[3] . "' + WHERE salesanalysis.area='" . $myrow['area'] . "' + AND salesanalysis.salesperson='" . $_SESSION['CreditItems'.$identifier]->SalesPerson . "' AND salesanalysis.typeabbrev ='" . $_SESSION['CreditItems'.$identifier]->DefaultSalesType . "' AND salesanalysis.periodno = '" . $PeriodNo . "' AND salesanalysis.cust = '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "' AND salesanalysis.custbranch = '" . $_SESSION['CreditItems'.$identifier]->Branch . "' AND salesanalysis.stockid = '" . $CreditLine->StockID . "' - AND salesanalysis.stkcategory ='" . $myrow[1] . "' + AND salesanalysis.stkcategory ='" . $myrow['stkcategory'] . "' AND salesanalysis.budgetoractual=1"; } else { @@ -1661,14 +1685,14 @@ Cost=Cost-" . $CreditLine->StandardCost * $CreditLine->Quantity . ", Qty=Qty-" . $CreditLine->Quantity . ", Disc=Disc-" . $CreditLine->DiscountPercent * $CreditLine->Price * $CreditLine->Quantity / $_SESSION['CurrencyRate'] . " - WHERE salesanalysis.area='" . $myrow[2] . "' - AND salesanalysis.salesperson='" . $myrow[3] . "' + WHERE salesanalysis.area='" . $myrow['area'] . "' + AND salesanalysis.salesperson='" . $_SESSION['CreditItems'.$identifier]->SalesPerson . "' AND salesanalysis.typeabbrev ='" . $_SESSION['CreditItems'.$identifier]->DefaultSalesType . "' AND salesanalysis.periodno = '" . $PeriodNo . "' AND salesanalysis.cust = '" . $_SESSION['CreditItems'.$identifier]->DebtorNo . "' AND salesanalysis.custbranch = '" . $_SESSION['CreditItems'.$identifier]->Branch . "' AND salesanalysis.stockid = '" . $CreditLine->StockID . "' - AND salesanalysis.stkcategory ='" . $myrow[1] . "' + AND salesanalysis.stkcategory ='" . $myrow['stkcategory'] . "' AND salesanalysis.budgetoractual=1"; } @@ -1698,7 +1722,7 @@ '" . $CreditLine->StockID . "', custbranch.area, 1, - custbranch.salesman, + '" . $_SESSION['Cre |
From: <dai...@us...> - 2012-11-21 09:45:52
|
Revision: 5744 http://sourceforge.net/p/web-erp/reponame/5744 Author: daintree Date: 2012-11-21 09:45:28 +0000 (Wed, 21 Nov 2012) Log Message: ----------- Harald Ringehan: updated German translation Modified Paths: -------------- trunk/SupplierCredit.php trunk/doc/Change.log trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2012-11-17 22:23:20 UTC (rev 5743) +++ trunk/SupplierCredit.php 2012-11-21 09:45:28 UTC (rev 5744) @@ -960,13 +960,13 @@ $CostIncrement = ($PurchPriceVar - $WriteOffToVariances) / $TotalQuantityOnHand; $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=materialcost+" . $CostIncrement . " - WHERE stockid='" . $EnteredGRN->ItemCode . "'"; + materialcost=materialcost+" . $CostIncrement . " + WHERE stockid='" . $EnteredGRN->ItemCode . "'"; $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg, True); } else { $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=" . ($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) . " WHERE stockid='" . $EnteredGRN->ItemCode . "'"; + materialcost=" . ($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) . " WHERE stockid='" . $EnteredGRN->ItemCode . "'"; $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg, True); } /* End of Weighted Average Costing Code */ @@ -1064,7 +1064,6 @@ } /* end of GRN postings */ if ($debug == 1 AND abs(($_SESSION['SuppTrans']->OvAmount/ $_SESSION['SuppTrans']->ExRate) - $LocalTotal)>0.004){ - prnMsg(_('The total posted to the credit accounts is') . ' ' . $LocalTotal . ' ' . _('but the sum of OvAmount converted at ExRate') . ' = ' . ($_SESSION['SuppTrans']->OvAmount / $_SESSION['SuppTrans']->ExRate),'error'); } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-11-17 22:23:20 UTC (rev 5743) +++ trunk/doc/Change.log 2012-11-21 09:45:28 UTC (rev 5744) @@ -1,5 +1,6 @@ webERP Change Log +21/11/12 Harald Ringehan: Updated German translation to SVN revision 5743 17/11/12 Phil: SelectCreditItems.p |
From: <dai...@us...> - 2012-11-22 09:08:05
|
Revision: 5745 http://sourceforge.net/p/web-erp/reponame/5745 Author: daintree Date: 2012-11-22 09:08:01 +0000 (Thu, 22 Nov 2012) Log Message: ----------- New bookmarks ViewTopic for context sensitive manual links - update manual re Counter Sales Modified Paths: -------------- trunk/AccountGroups.php trunk/RecurringSalesOrders.php trunk/SalesAnalRepts.php trunk/SelectRecurringSalesOrder.php trunk/doc/Manual/ManualSalesOrders.html Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2012-11-21 09:45:28 UTC (rev 5744) +++ trunk/AccountGroups.php 2012-11-22 09:08:01 UTC (rev 5745) @@ -7,6 +7,7 @@ $title = _('Account Groups'); $ViewTopic= 'GeneralLedger'; $BookMark = 'AccountGroups'; + include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2012-11-21 09:45:28 UTC (rev 5744) +++ trunk/RecurringSalesOrders.php 2012-11-22 09:08:01 UTC (rev 5745) @@ -6,10 +6,17 @@ /* Session started in header.inc for password checking the session will contain the details of the order from the Cart class object. The details of the order come from SelectOrderItems.php */ /* webERP manual links before header.inc */ -$ViewTopic= "SalesOrders"; -$BookMark = "RecurringSalesOrders"; +$ViewTopic= 'SalesOrders'; +$BookMark = 'RecurringSalesOrders'; + include('includes/session.inc'); $title = _('Recurring Orders'); + + +/* webERP manual links before header.inc */ +$ViewTopic= 'SalesOrders'; +$BookMark = 'RecurringSalesOrders'; + include('includes/header.inc'); if (empty($_GET['identifier'])) { Modified: trunk/SalesAnalRepts.php =================================================================== --- trunk/SalesAnalRepts.php 2012-11-21 09:45:28 UTC (rev 5744) +++ trunk/SalesAnalRepts.php 2012-11-22 09:08:01 UTC (rev 5745) @@ -5,6 +5,9 @@ include('includes/session.inc'); $title = _('Sales Analysis Reports Maintenance'); +/* webERP manual links before header.inc */ +$ViewTopic= 'SalesAnalysis'; +$BookMark = 'SalesAnalysis'; include('includes/header.inc'); Modified: trunk/SelectRecurringSalesOrder.php =================================================================== --- trunk/SelectRecurringSalesOrder.php 2012-11-21 09:45:28 UTC (rev 5744) +++ trunk/SelectRecurringSalesOrder.php 2012-11-22 09:08:01 UTC (rev 5745) @@ -3,6 +3,10 @@ include('includes/session.inc'); $title = _('Search Recurring Sales Orders'); +/* webERP manual links before header.inc */ +$ViewTopic= 'SalesOrders'; +$BookMark = 'RecurringSalesOrders'; + include('includes/header.inc'); echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; Modified: trunk/doc/Manual/ManualSalesOrders.html =================================================================== --- trunk/doc/Manual/ManualSalesOrders.html 2012-11-21 09:45:28 UTC (rev 5744) +++ trunk/doc/Manual/ManualSalesOrders.html 2012-11-22 09:08:01 UTC (rev 5745) @@ -84,18 +84,26 @@ <p>If the automatic freight calculations are being used - see the parameters in config.php, the freight cost will be calculated based on the sum of the whole order cubic metres and weight. The best shipping company will also be returned. The user can choose to charge the freight calculated or just use the cheapest freight company. The freight charge calculated can be over-ridden if required.</p> -<p>Once all details are entered correctly the Place Order button should be clicked. It is important to note that abandoning the order before this button is clicked there have been no updates to the database and nothing is saved. Clicking into some other screen loses the order as entered. Whilst it is perfectly acceptable to have several browser screens open looking at different inquiries at the same time. It is not possible to have two windows entering two separate sales orders at the same time, entries in the one window will over-write the other. <!-- Help End: SelectOrderItems --></p> +<p>Once all details are entered correctly the Place Order button should be clicked. It is important to note that abandoning the order before this button is clicked there have been no updates to the database and nothing is saved. Clicking into some other screen loses the order as entered. Whilst it is perfectly acceptable to have several browser screens open looking at different inquiries at the same time. It is not possible to have two windows entering two separate sales orders at the same time, entries in the one window will over-write the other. +<!-- Help End: SelectOrderItems --></p> + <h3><a id="SalesOrderCounterSales">Entry of Cash Sales Directly - Counter Sales</a></h3> -<p>In version 3.12 of webERP a new feature was introduced which allowed for cash sales to be entered directly without first entering an order and then confirming a dispatch to invoice. This feature is known as "counter sales". From the main menu->Sales tab select Enter Counter Sales. Entry is similar to entering an order, by default the quick entry screen allows entry of item codes and quantities but it is also possible to select items by the search functions in much the same way as an order. The tax is calculated and the total amount to pay is shown. This page also expects the payment to be made and entered. The payment entered is automatically allocated to the sale.</p> +<p>In version 3.12 of webERP a new feature was introduced which allowed for cash sales to be entered directly without first entering an order and then confirming a dispatch to invoice. This feature is known as "counter sales". From the main menu->Sales tab select Enter Counter Sales. Entry is similar to entering an order, by default the quick entry screen allows entry of item codes and quantities but it is also possible to select items by the search functions in much the same way as an order. The tax is calculated and the total amount to pay is shown. This page also expects the payment to be made and entered. The payment entered is automatically allocated to the sale and the invoice and the payment (receipt) are recorded against a defualt counter sale customer and branch - like any other sale. </p> -<p>Behind the scenes this script produces all the database entries for an order and an invoice with sales analysis, stock movements etc etc all correctly created. The customer (and customer branch) used for the entries is derived from the user's default inventory location.</p> +<p>Behind the scenes this script produces all the database entries for an order and an invoice with sales analysis, stock movements etc etc all correctly created. The customer (and customer branch) used for the entries is derived from the user's default inventory location. The only limitation is that serialised and lot controlled stock items cannot be sold using the Counter Sales functionality at the moment.</p> <h3>Setting Up Counter Sales</h3> -<p>webERP looks at the user's default location and then looks up against the location record to find the cash sales debtor account (and branch) to use for counter sales entered. Each location for which counter sales are required must first be set up with the cash sales customer and branch which is to be used for counter sales entered. Note that the default location of the customer branch is ignored - the user's default location (see Setup->General->User Maintenance - the script webERP/WWW_Users.php) is used as the location and stock movements are all created from this location against the customer specified in the location record (Setup - > Inventory Setup -> Location Maintenance - the script webERP/Locations.php). To specify the customer and branch to use for counter sales for an inventory location (or warehouse), the customer code and branch code must be entered in the format customercode-branchcode in the field provided for this purpose. i.e. the customer code then a hyphen then the branch code.</p><!-- Help Begin: SelectSalesOrder --> +<p>webERP looks at the user's default location and then looks up against the location record to find the cash sales debtor account (and branch) to use for counter sales entered. Each location for which counter sales are required must first be set up with the cash sales customer and branch which is to be used for counter sales entered. Note that the default location of the customer branch is ignored - the user's default location (see Setup->General->User Maintenance - the script webERP/WWW_Users.php) is used as the location and stock movements are all created from this location against the customer specified in the location record (Setup - > Inventory Setup -> Location Maintenance - the script webERP/Locations.php). To specify the customer and branch to use for counter sales for an inventory location (or warehouse), the customer code and branch code must be entered.</p> +<h3>Counter Returns</h3> + +<p>To produce credit notes in a customer facing situation it was difficult to first create the credit note manually, then enter a negative receipt (payment) against the customer account, then allocate the credit note to the negative receipt (payment). This has all been simplified with this Counter Returns functionality (new script to 4.09.2). This script allows the return of goods or services with the usual stock functionality and the capability to enter a payment to the customer that automatically allocates directly to the credit note.</p> + +<!-- Help Begin: SelectSalesOrder --> + <h2><a id="ModifyOrder">Modfiying An Order</a></h2> <p>Only Outstanding sales orders can be modified. Only these orders have any balance of a quantity remaining to be delivered and/or invoiced. Order lines that have been invoiced completely will not be available for modification. New items cannot be added to the order. Pricing cannot be altered if any amount of the line has already been delivered/invoiced. Quantities of an order line cannot be reduced below the quantity of the line already invoiced.</p> |
From: <dai...@us...> - 2012-11-29 09:07:02
|
Revision: 5747 http://sourceforge.net/p/web-erp/reponame/5747 Author: daintree Date: 2012-11-29 09:06:53 +0000 (Thu, 29 Nov 2012) Log Message: ----------- jtrick: start on work to map database names to company names and remove dependence on the company directory name Modified Paths: -------------- trunk/CounterReturns.php trunk/CounterSales.php trunk/StockCategories.php trunk/doc/Change.log trunk/install/index.php trunk/install/save.php Added Paths: ----------- trunk/companies/companies.inf Modified: trunk/CounterReturns.php =================================================================== --- trunk/CounterReturns.php 2012-11-25 11:12:57 UTC (rev 5746) +++ trunk/CounterReturns.php 2012-11-29 09:06:53 UTC (rev 5747) @@ -844,9 +844,14 @@ echo '</table>'; //end the sub table in the second column of master table echo '</th></tr></table>'; //end of column/row/master table - echo '<br /><div class="centre"><input type="submit" name="Recalculate" value="' . _('Re-Calculate') . '" /> - <input type="submit" name="ProcessReturn" value="' . _('Process The Return') . '" /></div><hr />'; - + if (!isset($_POST['ProcessReturn'])){ + echo '<br /> + <div class="centre"> + <input type="submit" name="Recalculate" value="' . _('Re-Calculate') . '" /> + <input type="submit" name="ProcessReturn" value="' . _('Process The Return') . '" /> + </div>'; + } + echo '<hr />'; } # end of if lines /* ********************************** Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2012-11-25 11:12:57 UTC (rev 5746) +++ trunk/CounterSales.php 2012-11-29 09:06:53 UTC (rev 5747) @@ -764,7 +764,7 @@ $k =0; //row colour counter foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { - $SubTotal = $OrderLine->Quantity * $OrderLine->Price * (1 - $OrderLine->DiscountPercent); + $SubTotal = round($OrderLine->Quantity * $OrderLine->Price * (1 - $OrderLine->DiscountPercent),$_SESSION['Items'.$identifier]->CurrDecimalPlaces); $DisplayDiscount = locale_number_format(($OrderLine->DiscountPercent * 100),2); $QtyOrdered = $OrderLine->Quantity; $QtyRemain = $QtyOrdered - $OrderLine->QtyInv; @@ -938,12 +938,14 @@ echo '</th> </tr> </table>'; //end of column/row/master table - echo '<br /> - <div class="centre"> - <input type="submit" name="Recalculate" value="' . _('Re-Calculate') . '" /> - <input type="submit" name="ProcessSale" value="' . _('Process The Sale') . '" /> - </div> - <hr />' |