Thread: [Weberp-svn] SF.net SVN: weberp:[5584] trunk (Page 6)
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-07-10 13:32:38
|
Revision: 5584 http://weberp.svn.sourceforge.net/weberp/?rev=5584&view=rev Author: tim_schofield Date: 2011-07-10 13:32:32 +0000 (Sun, 10 Jul 2011) Log Message: ----------- Implement the currency/decimalplaces session variable in a more logical way Modified Paths: -------------- trunk/Currencies.php trunk/includes/GetConfig.php Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-10 12:35:56 UTC (rev 5583) +++ trunk/Currencies.php 2011-07-10 13:32:32 UTC (rev 5584) @@ -62,6 +62,12 @@ $Errors[$i] = 'ExchangeRate'; $i++; } + if (!is_numeric($_POST['DecimalPlaces'])){ + $InputError = 1; + prnMsg(_('The decimal places must be numeric'),'error'); + $Errors[$i] = 'DecimalPlaces'; + $i++; + } if (mb_strlen($_POST['CurrencyName']) > 20) { $InputError = 1; prnMsg(_('The currency name must be 20 characters or less long'),'error'); @@ -98,6 +104,7 @@ currency='" . $_POST['CurrencyName'] . "', country='". $_POST['Country']. "', hundredsname='" . $_POST['HundredsName'] . "', + decimalplaces='" . $_POST['DecimalPlaces'] . "', rate='" .$_POST['ExchangeRate'] . "' WHERE currabrev = '" . $SelectedCurrency . "'"; @@ -109,11 +116,13 @@ currabrev, country, hundredsname, + decimalplaces, rate) VALUES ('" . $_POST['CurrencyName'] . "', '" . $_POST['Abbreviation'] . "', '" . $_POST['Country'] . "', '" . $_POST['HundredsName'] . "', + '" . $_POST['DecimalPlaces'] . "', '" . $_POST['ExchangeRate'] . "')"; $msg = _('The currency definition record has been added'); @@ -128,6 +137,7 @@ unset($_POST['Country']); unset($_POST['HundredsName']); unset($_POST['ExchangeRate']); + unset($_POST['DecimalPlaces']); unset($_POST['Abbreviation']); } elseif (isset($_GET['delete'])) { @@ -177,7 +187,13 @@ links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = "SELECT currency, currabrev, country, hundredsname, rate FROM currencies"; + $sql = "SELECT currency, + currabrev, + country, + hundredsname, + decimalplaces, + rate + FROM currencies"; $result = DB_query($sql, $db); echo '<table class=selection>'; @@ -186,6 +202,7 @@ <th>' . _('Currency Name') . '</th> <th>' . _('Country') . '</th> <th>' . _('Hundredths Name') . '</th> + <th>' . _('Decimal Places') . '</th> <th>' . _('Exchange Rate') . '</th> <th>' . _('Ex Rate - ECB') .'</th> </tr>'; @@ -198,7 +215,7 @@ $CurrencyRatesArray = array(); } - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { if ($myrow[1]==$FunctionalCurrency){ echo '<tr bgcolor=#FFbbbb>'; } elseif ($k==1){ @@ -223,25 +240,27 @@ <td>%s</td> <td class=number>%s</td> <td class=number>%s</td> + <td class=number>%s</td> <td><a href="%s&SelectedCurrency=%s">%s</a></td> - <td><a href="%s&SelectedCurrency=%s&delete=1">%s</a></td> + <td><a href="%s&SelectedCurrency=%sdelete=1">%s</a></td> <td><a href="%s/ExchangeRateTrend.php?%s">' . _('Graph') . '</a></td> </tr>', $ImageFile, - $myrow[1], - $myrow[0], - $myrow[2], - $myrow[3], - number_format($myrow[4],5), - number_format(GetCurrencyRate($myrow[1],$CurrencyRatesArray),5), - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[1], + $myrow['currabrev'], + $myrow['currency'], + $myrow['country'], + $myrow['hundredsname'], + number_format($myrow['decimalplaces'],0), + number_format($myrow['rate'],5), + number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), + $_SERVER['PHP_SELF'] . '?', + $myrow['currabrev'], _('Edit'), - $_SERVER['PHP_SELF'] . '?' . SID, - $myrow[1], + $_SERVER['PHP_SELF'] . '?', + $myrow['currabrev'], _('Delete'), $rootpath, - SID . '&CurrencyToShow=' . $myrow[1]); + 'CurrencyToShow=' . $myrow['currabrev']); } else { printf('<td><img src="%s"></td> <td>%s</td> @@ -249,13 +268,15 @@ <td>%s</td> <td>%s</td> <td class=number>%s</td> + <td class=number>%s</td> <td colspan=4>%s</td> </tr>', $ImageFile, - $myrow[1], - $myrow[0], - $myrow[2], - $myrow[3], + $myrow['currabrev'], + $myrow['currency'], + $myrow['country'], + $myrow['hundredsname'], + $myrow['decimalplaces'], 1, _('Functional Currency')); } @@ -283,6 +304,7 @@ currabrev, country, hundredsname, + decimalplaces, rate FROM currencies WHERE currabrev='" . $SelectedCurrency . "'"; @@ -296,6 +318,7 @@ $_POST['CurrencyName'] = $myrow['currency']; $_POST['Country'] = $myrow['country']; $_POST['HundredsName'] = $myrow['hundredsname']; + $_POST['DecimalPlaces'] = $myrow['decimalplaces']; $_POST['ExchangeRate'] = $myrow['rate']; @@ -334,6 +357,11 @@ if (!isset($_POST['ExchangeRate'])) {$_POST['ExchangeRate']='';} echo '<input ' . (in_array('ExchangeRate',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class=number name="ExchangeRate" size=10 maxlength=9 value='. $_POST['ExchangeRate'].'>'; echo '</td></tr>'; + echo '<tr><td>'._('Decimal Places to Show').':</td>'; + echo '<td>'; + if (!isset($_POST['DecimalPlaces'])) {$_POST['DecimalPlaces']=2;} + echo '<input ' . (in_array('DecimalPlaces',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class=number name="DecimalPlaces" size=10 maxlength=9 value='. $_POST['DecimalPlaces'].'>'; + echo '</td></tr>'; echo '</table>'; echo '<br /><div class="centre"><input type="Submit" name="submit" value='._('Enter Information').'></div>'; Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2011-07-10 12:35:56 UTC (rev 5583) +++ trunk/includes/GetConfig.php 2011-07-10 13:32:32 UTC (rev 5584) @@ -72,15 +72,21 @@ freightact, gllink_debtors, gllink_creditors, - gllink_stock, - decimalplaces + gllink_stock FROM companies - INNER JOIN currencies ON companies.currencydefault=currencies.currabrev WHERE coycode=1"; $ErrMsg = _('An error occurred accessing the database to retrieve the company information'); $ReadCoyResult = DB_query($sql,$db,$ErrMsg); + $sql="SELECT currabrev, + decimalplaces + FROM currencies"; + $CurrenciesResult=DB_query($sql, $db); + while ($CurrenciesRow=DB_fetch_array($CurrenciesResult)) { + $_SESSION['Currencies'][$CurrenciesRow['currabrev']]['DecimalPlaces']=$CurrenciesRow['decimalplaces']; + } + if (DB_num_rows($ReadCoyResult)==0) { echo '<br /><b>'; prnMsg( _('The company record has not yet been set up') . '</b><br />' . _('From the system setup tab select company maintenance to enter the company information and system preferences'),'error',_('CRITICAL PROBLEM')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-12 13:19:02
|
Revision: 5908 http://weberp.svn.sourceforge.net/weberp/?rev=5908&view=rev Author: tim_schofield Date: 2011-07-12 13:18:56 +0000 (Tue, 12 Jul 2011) Log Message: ----------- Remove unnecessary use of SID Modified Paths: -------------- trunk/POReport.php trunk/PO_PDFPurchOrder.php Modified: trunk/POReport.php =================================================================== --- trunk/POReport.php 2011-07-12 13:18:44 UTC (rev 5907) +++ trunk/POReport.php 2011-07-12 13:18:56 UTC (rev 5908) @@ -729,7 +729,7 @@ $totalinvqty += $myrow['qtyinvoiced']; } //END WHILE LIST LOOP // Print totals - printf("<tr><td>%s</td><td>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td></tr>", + printf('<tr><td>%s</td><td>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td><td class=number>%s</td></tr>', 'Totals', _('Lines - ') . $linectr, $totalqty, @@ -1411,21 +1411,21 @@ // Display form fields. This function is called the first time // the page is called. - echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post>"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; echo '<tr><td>' . _('Report Type') . ':</td>'; - echo "<td><select name='ReportType'>"; - echo "<option selected value='Detail'>" . _('Detail') . '</option>'; - echo "<option value='Summary'>" . _('Summary') . '</option>'; + echo '<td><select name="ReportType">'; + echo '<option selected value="Detail">' . _('Detail') . '</option>'; + echo '<option value="Summary">' . _('Summary') . '</option>'; echo '</select></td><td> </td></tr>'; echo '<tr><td>' . _('Date Type') . ':</td>'; - echo "<td><select name='DateType'>"; - echo "<option selected value='Order'>" . _('Order Date') . '</option>'; - echo "<option value='Delivery'>" . _('Delivery Date') . '</option>'; + echo '<td><select name="DateType">'; + echo '<option selected value="Order">' . _('Order Date') . '</option>'; + echo '<option value="Delivery">' . _('Delivery Date') . '</option>'; echo '</select></td><td> </td></tr>'; echo '<tr> @@ -1436,27 +1436,27 @@ </tr>'; echo '<tr><td>' . _('Part Number') . ':</td>'; - echo "<td><select name='PartNumberOp'>"; - echo "<option selected value='Equals'>" . _('Equals') . '</option>'; - echo "<option value='LIKE'>" . _('Begins With') . '</option>'; + echo '<td><select name="PartNumberOp">'; + echo '<option selected value="Equals">' . _('Equals') . '</option>'; + echo '<option value="LIKE">' . _('Begins With') . '</option>'; echo '</select>'; - echo "  <input type='Text' name='PartNumber' size=20 maxlength=20 value="; + echo '  <input type="text" name="PartNumber" size=20 maxlength=20 value='; if (isset($_POST['PartNumber'])) { - echo $_POST['PartNumber'] . "></td></tr>"; + echo $_POST['PartNumber'] . '></td></tr>'; } else { - echo "></td></tr>"; + echo '></td></tr>'; } echo '<tr><td>' . _('Supplier Number') . ':</td>'; - echo "<td><select name='SupplierIdOp'>"; - echo "<option selected value='Equals'>" . _('Equals') . '</option>'; - echo "<option value='LIKE'>" . _('Begins With') . '</option>'; + echo '<td><select name="SupplierIdOp">'; + echo '<option selected value="Equals">' . _('Equals') . '</option>'; + echo '<option value="LIKE">' . _('Begins With') . '</option>'; echo '</select>'; - echo "  <input type='Text' name='SupplierId' size=10 maxlength=10 value="; + echo '  <input type="text" name="SupplierId" size=10 maxlength=10 value='; if (isset($_POST['SupplierId'])) { - echo $_POST['SupplierId'] . "></td></tr>"; + echo $_POST['SupplierId'] . '></td></tr>'; } else { - echo "></td></tr>"; + echo '></td></tr>'; } echo '<tr><td>' . _('Supplier Name') . ':</td>'; Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-07-12 13:18:44 UTC (rev 5907) +++ trunk/PO_PDFPurchOrder.php 2011-07-12 13:18:56 UTC (rev 5908) @@ -342,7 +342,7 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/printer.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p><br />'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ($ViewingOnly==1){ echo '<input type=hidden name="ViewingOnly" value=1>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-12 13:22:12
|
Revision: 5925 http://weberp.svn.sourceforge.net/weberp/?rev=5925&view=rev Author: tim_schofield Date: 2011-07-12 13:22:06 +0000 (Tue, 12 Jul 2011) Log Message: ----------- Remove unnecessary use of SID Modified Paths: -------------- trunk/PaymentMethods.php trunk/Payments.php Modified: trunk/PaymentMethods.php =================================================================== --- trunk/PaymentMethods.php 2011-07-12 13:21:54 UTC (rev 5924) +++ trunk/PaymentMethods.php 2011-07-12 13:22:06 UTC (rev 5925) @@ -209,7 +209,7 @@ if (isset($SelectedPaymentID)) { - echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?' . SID .'>' . _('Review Payment Methods') . '</a></div>'; + echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Payment Methods') . '</a></div>'; } echo '<br />'; Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-07-12 13:21:54 UTC (rev 5924) +++ trunk/Payments.php 2011-07-12 13:22:06 UTC (rev 5925) @@ -37,7 +37,7 @@ } //note this is already linked from this page -//echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br />'; +//echo "<a href='" . $rootpath . '/SelectSupplier.php'>" . _('Back to Suppliers') . '</a><br />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Payment Entry') . '" alt="" />' . ' ' . _('Payment Entry') . '</p>'; @@ -258,7 +258,7 @@ AND ($myrow[0] == 1)) { // it is a supplier payment by cheque and haven't printed yet so print cheque - echo '<br /><a href="' . $rootpath . '/PrintCheque.php?' . SID . '&ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a><br /><br />'; + echo '<br /><a href="' . $rootpath . '/PrintCheque.php?ChequeNum=' . $_POST['ChequeNum'] . '">' . _('Print Cheque using pre-printed stationery') . '</a><br /><br />'; echo '<form method=post action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -1003,7 +1003,7 @@ <td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td> <td>' . stripslashes($PaymentItem->Narrative) . '</td> <td>' . $PaymentItem->tag . ' - ' . $TagName . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $PaymentItem->ID . '">' . _('Delete') . '</a></td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $PaymentItem->ID . '">' . _('Delete') . '</a></td> </tr>'; $PaymentTotal += $PaymentItem->Amount; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-12 13:24:44
|
Revision: 5939 http://weberp.svn.sourceforge.net/weberp/?rev=5939&view=rev Author: tim_schofield Date: 2011-07-12 13:24:38 +0000 (Tue, 12 Jul 2011) Log Message: ----------- Remove unnecessary use of SID Modified Paths: -------------- trunk/GoodsReceived.php trunk/InventoryPlanningPrefSupplier.php trunk/includes/ConstructSQLForUserDefinedSalesReport.inc trunk/includes/InputSerialItemsKeyed.php Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-07-12 13:24:24 UTC (rev 5938) +++ trunk/GoodsReceived.php 2011-07-12 13:24:38 UTC (rev 5939) @@ -15,11 +15,11 @@ $title = _('Receive Purchase Orders'); include('includes/header.inc'); -echo '<a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Back to Purchase Orders'). '</a><br />'; +echo '<a href="'. $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Back to Purchase Orders'). '</a><br />'; if (isset($_GET['PONumber']) and $_GET['PONumber']<=0 and !isset($_SESSION['PO'])) { /* This page can only be called with a purchase order number for invoicing*/ - echo '<div class="centre"><a href= "' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">'. + echo '<div class="centre"><a href= "' . $rootpath . '/PO_SelectOSPurchOrder.php">'. _('Select a purchase order to receive').'</a></div>'; echo '<br />'. _('This page can only be opened if a purchase order has been selected. Please select a purchase order first'); include ('includes/footer.inc'); @@ -62,7 +62,7 @@ _('Receive') . '" alt="" />' . ' ' . _('Receive Purchase Order') . ''; echo ' : '. $_SESSION['PO']->OrderNo .' '. _('from'). ' ' . $_SESSION['PO']->SupplierName . '</p>'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['ProcessGoodsReceived'])) { @@ -159,7 +159,7 @@ if ($LnItm->Controlled == 1) { - echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; + echo '<input type=hidden name="RecvQty_' . $LnItm->LineNo . '" value="' . $LnItm->ReceiveQty . '"><a href="GoodsReceivedControlled.php?LineNo=' . $LnItm->LineNo . '">' . number_format($LnItm->ReceiveQty,$LnItm->DecimalPlaces) . '</a></td>'; } else { echo '<input type=text class=number name="RecvQty_' . $LnItm->LineNo . '" maxlength=10 size=10 value="' . $LnItm->ReceiveQty . '"></td>'; @@ -173,10 +173,10 @@ if ($LnItm->Controlled == 1) { if ($LnItm->Serialised==1){ - echo '<td><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">'. + echo '<td><a href="GoodsReceivedControlled.php?LineNo=' . $LnItm->LineNo . '">'. _('Enter Serial Nos'). '</a></td>'; } else { - echo '<td><a href="GoodsReceivedControlled.php?' . SID . '&LineNo=' . $LnItm->LineNo . '">'. + echo '<td><a href="GoodsReceivedControlled.php?LineNo=' . $LnItm->LineNo . '">'. _('Enter Batches'). '</a></td>'; } } @@ -705,7 +705,7 @@ echo '<br /><div class=centre>'. _('GRN number'). ' '. $GRN .' '. _('has been processed').'<br />'; echo '<br /><a href=PDFGrn.php?GRNNo='.$GRN .'&PONo='.$PONo.'>'. _('Print this Goods Received Note (GRN)').'</a><br /><br />'; - echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . + echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Select a different purchase order for receiving goods against'). '</a></div>'; /*end of process goods received entry */ include('includes/footer.inc'); @@ -713,7 +713,7 @@ } else { /*Process Goods received not set so show a link to allow mod of line items on order and allow input of date goods received*/ - echo '<br /><div class="centre"><a href="' . $rootpath . '/PO_Items.php?=' . SID . '">' . _('Modify Order Items'). '</a></div>'; + echo '<br /><div class="centre"><a href="' . $rootpath . '/PO_Items.php">' . _('Modify Order Items'). '</a></div>'; echo '<br /><div class="centre"><input type=submit name=Update Value=' . _('Update') . '></div><br />'; echo '<div class="centre"><input type=submit name="ProcessGoodsReceived" Value="' . _('Process Goods Received') . '"></div>'; Modified: trunk/InventoryPlanningPrefSupplier.php =================================================================== --- trunk/InventoryPlanningPrefSupplier.php 2011-07-12 13:24:24 UTC (rev 5938) +++ trunk/InventoryPlanningPrefSupplier.php 2011-07-12 13:24:38 UTC (rev 5939) @@ -457,7 +457,7 @@ $title = _('Print Inventory Planning Report Empty'); include('includes/header.inc'); prnMsg( _('There were no items in the range and location specified'),'error'); - echo '<br /><a href="'.$rootpath/.'index.php">' . _('Back to the menu') . '</a>'; + echo '<br /><a href="'.$rootpath.'/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { Modified: trunk/includes/ConstructSQLForUserDefinedSalesReport.inc =================================================================== --- trunk/includes/ConstructSQLForUserDefinedSalesReport.inc 2011-07-12 13:24:24 UTC (rev 5938) +++ trunk/includes/ConstructSQLForUserDefinedSalesReport.inc 2011-07-12 13:24:38 UTC (rev 5939) @@ -176,16 +176,16 @@ $title = _('User Defined Sales Analysis Problem') . ' ....'; include('includes/header.inc'); prnMsg ( _('The report does not have any output columns') . '. ' . _('You need to set up the data columns that you wish to show in the report'),'error',_('No Columns')); - echo "<BR><A HREF='$rootpath/SalesAnalReptCols.php?" . SID . "&ReportID=" . $_GET['ReportID'] . "'>" . _('Enter Columns for this report') . '</A>'; - echo "<BR><A HREF='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</A>'; + echo '<br /><a href="'.$rootpath.'/SalesAnalReptCols.php?ReportID=' . $_GET['ReportID'] . '">' . _('Enter Columns for this report') . '</a>'; + echo '<br /><a href="'.$rootpath.'/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); Exit; } elseif (DB_num_rows($ColsResult) >10){ $title = _('User Defined Sales Analysis Problem') . ' ....'; include('includes/header.inc'); prnMsg (_('The report cannot have more than 10 columns in it') . '. ' . _('Please delete one or more columns before attempting to run it'),'error',_('Too Many Columns')); - echo "<BR><A HREF='$rootpath/SalesAnalReptCols.php?" . SID . "&ReportID=" . $_GET['ReportID'] . "'>" . _('Maintain Columns for this report') . '</A>'; - echo "<BR><A HREF='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</A>'; + echo '<br /><a href="'.$rootpath.'/SalesAnalReptCols.php?ReportID=' . $_GET['ReportID'] . '">' . _('Maintain Columns for this report') . '</a>'; + echo '<br /><a href="'.$rootpath.'/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } @@ -265,7 +265,7 @@ $title = _('User Defined Sales Analysis Problem') . ' ....'; include('includes/header.inc'); prnMsg(_('Calculated fields must use columns defined in the report specification') . '. ' . _('The numerator column number entered for this calculation is not defined in the report'),'error',_('Calculation With Undefined Column')); - echo "<BR><A HREF='$rootpath/SalesAnalReptCols.php?" . SID . "&ReportID=" . $_GET['ReportID'] . "'>" . _('Maintain Columns for this report') . '</A>'; + echo '<br /><a href="'.$rootpath.'/SalesAnalReptCols.php?ReportID=' . $_GET['ReportID'] . '">' . _('Maintain Columns for this report') . '</a>'; include('includes/footer.inc'); exit; } @@ -336,8 +336,8 @@ $title = _('User Defined Sales Analysis Problem') . ' ....'; include('includes/header.inc'); prnMsg(_('The user defined sales analysis SQL did not return any rows') . ' - ' . _('have another look at the criteria specified'),'error',_('Nothing To Report')); - echo "<BR><A HREF='$rootpath/SalesAnalRepts.php?" . SID . '&SelectedReport=' . $_GET['ReportID'] . "'>" . _('Look at the design of this report') . '</A>'; - echo "<BR><A HREF='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</A>'; + echo '<br /><a href="'.$rootpath.'/SalesAnalRepts.php?SelectedReport=' . $_GET['ReportID'] . '">' . _('Look at the design of this report') . '</a>'; + echo '<br /><a href="'.$rootpath.'/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; Modified: trunk/includes/InputSerialItemsKeyed.php =================================================================== --- trunk/includes/InputSerialItemsKeyed.php 2011-07-12 13:24:24 UTC (rev 5938) +++ trunk/includes/InputSerialItemsKeyed.php 2011-07-12 13:24:38 UTC (rev 5939) @@ -54,7 +54,7 @@ echo '<td class=number>' . $Bundle->ExpiryDate . '</td>'; } - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $Bundle->BundleRef . '&StockID=' . $LineItem->StockID . '&LineNo=' . $LineNo .'">'. _('Delete'). '</a></td></tr>'; $TotalQuantity += $Bundle->BundleQty; } @@ -79,7 +79,7 @@ echo $tableheader; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?=' . SID . '" name="Ga6uF5Wa" method="post"> +echo '<form action="' . $_SERVER['PHP_SELF'] . '" name="Ga6uF5Wa" method="post"> <input type=hidden name=LineNo value="' . $LineNo . '"> <input type=hidden name=StockID value="' . $StockID . '"> <input type=hidden name=EntryType value="KEYED">'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-15 15:11:04
|
Revision: 6345 http://weberp.svn.sourceforge.net/weberp/?rev=6345&view=rev Author: tim_schofield Date: 2011-07-15 15:10:58 +0000 (Fri, 15 Jul 2011) Log Message: ----------- XHTML quoting corrections Modified Paths: -------------- trunk/BOMInquiry.php trunk/Credit_Invoice.php Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-07-15 15:10:46 UTC (rev 6344) +++ trunk/BOMInquiry.php 2011-07-15 15:10:58 UTC (rev 6345) @@ -112,10 +112,10 @@ $StockOnHand = number_format($myrow['totalonhand'],2); } $tabindex=$j+4; - printf("<td><input tabindex='".$tabindex."' type=submit name='StockID' value='%s'</td> + printf('<td><input tabindex="'.$tabindex.'" type=submit name="StockID" value="%s"</td> <td>%s</td> <td class="number">%s</td> - <td>%s</td></tr>", + <td>%s</td></tr>', $myrow['stockid'], $myrow['description'], $StockOnHand, Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-07-15 15:10:46 UTC (rev 6344) +++ trunk/Credit_Invoice.php 2011-07-15 15:10:58 UTC (rev 6345) @@ -446,12 +446,12 @@ if (!isset($_POST['ProcessCredit'])) { echo '<tr> - <td colspan=7 class="number">' . _('Credit Totals') . "</td> + <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>" . number_format($TaxTotal,2) . "<hr></td> - <td class="number"><hr><b>" . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . "</b><hr></td> - </tr></table>"; + <td class="number"><hr><b>' . number_format($TaxTotal,2) . '<hr></td> + <td class="number"><hr><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . '</b><hr></td> + </tr></table>'; } $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-18 21:01:50
|
Revision: 6724 http://weberp.svn.sourceforge.net/weberp/?rev=6724&view=rev Author: tim_schofield Date: 2011-07-18 21:01:43 +0000 (Mon, 18 Jul 2011) Log Message: ----------- Add in the facility to c reate a counter sale for a particular customer direct from SelectCustomer.php Modified Paths: -------------- trunk/CounterSales.php trunk/SelectCustomer.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-18 21:01:18 UTC (rev 6723) +++ trunk/CounterSales.php 2011-07-18 21:01:43 UTC (rev 6724) @@ -47,7 +47,7 @@ $BatchQuantityResult=DB_query($sql, $db); $BatchQuantityRow=DB_fetch_array($BatchQuantityResult); if (!isset($NewItemArray[$StockID])) { - if ($BatchQuantityRow['quantity']<$Quantity) { + if ($BatchQuantityRow['quantity']<$Quantity and $Quantity>0) { prnMsg( _('Batch number').' '.$Batch.' '. _('of item number').' '.$StockID.' '. _('has insufficient items remaining in it to complete this sale') , 'info'); @@ -57,7 +57,7 @@ $NewItemArray[$StockID]['Batch']['Quantity'][] = $Quantity; } } else { - if ($BatchQuantityRow['quantity']<$Quantity+$NewItemArray[$StockID]['Quantity']) { + if ($BatchQuantityRow['quantity']<$Quantity+$NewItemArray[$StockID]['Quantity'] and $NewItemArray[$StockID]['Quantity']>0) { prnMsg( _('Batch number').' '.$Batch.' '. _('of item number').' '.$StockID.' '. _('has insufficient items remaining in it to complete this sale'), 'info'); @@ -119,8 +119,13 @@ exit; } - $CashSaleCustomer[0]=$myrow['cashsalecustomer']; - $CashSaleCustomer[1]=$myrow['cashsalebranch']; + if (isset($_GET['DebtorNo'])) { + $CashSaleCustomer[0]=$_GET['DebtorNo']; + $CashSaleCustomer[1]=$_GET['BranchNo']; + } else { + $CashSaleCustomer[0]=$myrow['cashsalecustomer']; + $CashSaleCustomer[1]=$myrow['cashsalebranch']; + } $_SESSION['Items'.$identifier]->Branch = $CashSaleCustomer[1]; $_SESSION['Items'.$identifier]->DebtorNo = $CashSaleCustomer[0]; @@ -249,7 +254,9 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Counter Sales') . '" alt="" />' . ' '; - echo _('Counter Sale') . ' - ' . $_SESSION['Items'.$identifier]->LocationName . ' (' . _('all amounts in') . ' ' . $_SESSION['Items'.$identifier]->DefaultCurrency . ')'; + echo _('Counter Sale') . ' - ' . $_SESSION['Items'.$identifier]->LocationName . ' (' . _('all amounts in') . ' ' . $_SESSION['Items'.$identifier]->DefaultCurrency . ')<br />'; + + echo _('Customer') . ' - ' . $_SESSION['Items'.$identifier]->CustomerName; echo '</p>'; } Modified: trunk/SelectCustomer.php =================================================================== --- trunk/SelectCustomer.php 2011-07-18 21:01:18 UTC (rev 6723) +++ trunk/SelectCustomer.php 2011-07-18 21:01:43 UTC (rev 6724) @@ -259,6 +259,7 @@ if ($_POST['Select'] != '') { $SQL = "SELECT brname, phoneno FROM custbranch WHERE debtorno='" . $Debtor[0] . "'"; $_SESSION['CustomerID'] = $Debtor[0]; + $_SESSION['BranchID'] = $Debtor[1]; } else { $SQL = "SELECT debtorsmaster.name, custbranch.phoneno FROM debtorsmaster, custbranch WHERE @@ -290,7 +291,8 @@ echo '</td><td valign=top class="select">'; echo '<a href="' . $rootpath . '/SelectSalesOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Modify Outstanding Sales Orders') . '</a><br />'; echo '<a href="' . $rootpath . '/CustomerAllocations.php?DebtorNo=' . $_SESSION['CustomerID'] . '">' . _('Allocate Receipts or Credit Notes') . '</a><br />'; - echo '</td><td valign=top class=select>'; + echo '<a href="' . $rootpath . '/CounterSales.php?DebtorNo=' . $_SESSION['CustomerID'] . '&BranchNo=' . $_SESSION['BranchID'] . '">' . _('Create a Counter Sale for this Customer') . '</a><br />'; + echo '</td><td valign=top class="select">'; echo '<a href="' . $rootpath . '/Customers.php?">' . _('Add a New Customer') . '</a><br />'; echo '<a href="' . $rootpath . '/Customers.php?DebtorNo=' . $_SESSION['CustomerID'] . '">' . _('Modify Customer Details') . '</a><br />'; echo '<a href="' . $rootpath . '/CustomerBranches.php?DebtorNo=' . $_SESSION['CustomerID'] . '">' . _('Add/Modify/Delete Customer Branches') . '</a><br />'; @@ -300,7 +302,7 @@ echo '</td>'; echo '</tr></table><br />'; } else { - echo '<table width=90%><tr><th width=33%>' . _('Customer Inquiries') . '</th> + echo '<table width="90%"><tr><th width="33%">' . _('Customer Inquiries') . '</th> <th width=33%>' . _('Customer Transactions') . '</th> <th width=33%>' . _('Customer Maintenance') . '</th></tr>'; echo '<tr><td class="select">'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-18 21:02:12
|
Revision: 6725 http://weberp.svn.sourceforge.net/weberp/?rev=6725&view=rev Author: tim_schofield Date: 2011-07-18 21:02:04 +0000 (Mon, 18 Jul 2011) Log Message: ----------- Redo index.php to remove unnecessary nested tables and conform to XHTML standards Modified Paths: -------------- trunk/includes/footer.inc trunk/includes/header.inc Added Paths: ----------- trunk/index.php Removed Paths: ------------- trunk/index.php Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2011-07-18 21:01:43 UTC (rev 6724) +++ trunk/includes/footer.inc 2011-07-18 21:02:04 UTC (rev 6725) @@ -1,14 +1,6 @@ <?php /* $Id$*/ - echo '</td>'; - echo '</tr>'; - echo '</table>'; - - echo '</td></tr>'; -/*Do the borders */ - - echo '</table>'; setlocale(LC_ALL,$_SESSION['Language']); if (!isset($DefaultClock)) { include('config.php'); Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2011-07-18 21:01:43 UTC (rev 6724) +++ trunk/includes/header.inc 2011-07-18 21:02:04 UTC (rev 6725) @@ -36,13 +36,6 @@ echo '<tr>'; echo '<td colspan="2" rowspan="2">'; - echo '<table class="main_page" cellpadding="0" cellspacing="0">'; - echo '<tr>'; - echo '<td>'; - echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" >'; - echo '<tr>'; - echo '<td>'; - if (isset($title)) { echo '<table cellpadding="0" cellspacing="0" border="0" id="quick_menu" class="quick_menu">'; echo '<tr>'; Deleted: trunk/index.php =================================================================== --- trunk/index.php 2011-07-18 21:01:43 UTC (rev 6724) +++ trunk/index.php 2011-07-18 21:02:04 UTC (rev 6725) @@ -1,1579 +0,0 @@ -<?php - -include('includes/session.inc'); -$title=_('Main Menu'); - -/*The module link codes are hard coded in a switch statement below to determine the options to show for each tab */ -$ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); -/*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ -$ModuleList = array(_('Sales'), - _('Receivables'), - _('Payables'), - _('Purchases'), - _('Inventory'), - _('Manufacturing'), - _('General Ledger'), - _('Asset Manager'), - _('Petty Cash'), - _('Setup')); - -if (isset($_GET['Application'])){ /*This is sent by this page (to itself) when the user clicks on a tab */ - $_SESSION['Module'] = $_GET['Application']; -} - -include('includes/header.inc'); - -if (isset($SupplierLogin) and count($_SESSION['AllowedPageSecurityTokens'])==2 and $SupplierLogin==0){ - -/* if there is only one security access and its 1 (it has to be 1 for this page came up at all)- it must be a customer log on - * need to limit the menu to show only the customer accessible stuff this is what the page looks like for customers logging in - */ -?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> -<?php - include('includes/footer.inc'); - exit; -} else if (isset($SupplierLogin) and count($_SESSION['AllowedPageSecurityTokens'])==2 and $SupplierLogin==1){ -?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=1">' . _('View or Amend outstanding offers') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=2">' . _('Create a new offer') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php?TenderType=3">' . _('View any open tenders without an offer') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> -<?php -} else { /* Security settings DO allow seeing the main menu */ - -?> - <table width="100%"><td width="10%" valign="top"><table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0"> - - <?php - - - $i=0; - - while ($i < count($ModuleLink)){ - - // This determines if the user has display access to the module see config.php and header.inc - // for the authorisation and security code - if ($_SESSION['ModulesEnabled'][$i]==1) { - - // If this is the first time the application is loaded then it is possible that - // SESSION['Module'] is not set if so set it to the first module that is enabled for the user - if (!isset($_SESSION['Module'])OR $_SESSION['Module']==''){ - $_SESSION['Module']=$ModuleLink[$i]; - } - if ($ModuleLink[$i] == $_SESSION['Module']){ - echo '<tr><td class="main_menu_selected"><a href="' . $_SERVER['PHP_SELF'] . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; - } else { - echo '<tr><td class="main_menu_unselected"><a href="' . $_SERVER['PHP_SELF'] . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; - } - } - $i++; - } - - ?> - </table></td><td> - <?php - - - switch ($_SESSION['Module']) { - - case 'orders': //Sales Orders - ?> - - <table width="100%"> - <tr> - <td class="menu_group_area"> - <table width="100%" > - - <?php - // displays the main area headings - OptionHeadings(); - ?> - - <tr> - <td class="menu_group_items"> <!-- Orders transaction options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?' .sid . '&NewOrder=Yes">' . _('Enter An Order or Quotation') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CounterSales.php?' .sid . '">' . _('Enter Counter Sales') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPickingList.php?' .sid . '">' . _('Print Picking Lists') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SpecialOrder.php?' .sid . '&NewSpecial=Yes">' . _('Special Order') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectRecurringSalesOrder.php?' .sid . '">' . _('Recurring Order Template') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/RecurringSalesOrdersProcess.php?' .sid . '">' . _('Process Recurring Orders') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- Orders Inquiry options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?">' . _('Order Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php?">' . _('Print Price Lists') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php?">' . _('Order Status Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php?">' . _('Orders Invoiced Reports') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php?">' . _('Daily Sales Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php?">' . _('Order Delivery Differences Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php?">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php?">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php?">' . _('Top Sales Items Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFLowGP.php?">' . _('Sales With Low Gross Profit Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ord'); ?> - </td> - </tr> - </table> - </td> - - <td class="menu_group_items"> <!-- Orders Maintenance options --> - <table width="100%"> - <tr> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectContract.php?">' . _('Select Contract') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Contracts.php?">' . _('Create Contract') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; - /* ****************** END OF ORDERS MENU ITEMS **************************** */ - - - Case 'AR': //Debtors Module - - unset($ReceiptBatch); - unset($AllocTrans); - - ?> - <table width="100%"> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> - - <?php OptionHeadings(); ?> - - <tr> - <td class="menu_group_items"> - <table width="100%"class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?">' . _('Select Order to Invoice') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCreditItems.php?' .sid . '&NewCredit=Yes">' . _('Create A Credit Note') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - - <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php?">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php?">' . _('Where Allocated Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php - if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php?">' . _('Print Invoices or Credit Notes') . '</a></p>'; - } else { - echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php?">' . _('Print Invoices or Credit Notes') . '</a></p>'; - } - ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php?">' . _('Print Statements') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php?">' . _('Sales Analysis Reports') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php?">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php?">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php?">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php?">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php?">' . _('Sales Graphs') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php?">' . _('List Daily Transactions') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php?">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ar'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Customers.php?">' . _('Add Customer') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php?">' . _('Customers') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - - /* ********************* END OF AR OPTIONS **************************** */ - break; - - Case 'AP': //Creditors Module - - ?> - <table width="100%"> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> - - <?php OptionHeadings(); ?> - - <tr> - <td class="menu_group_items"> <!-- AP transaction options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?">' . _('Select Supplier') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/SupplierAllocations.php?" . sid . '">' . _('Supplier Allocations') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- AP Inquiries --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php?">' . _('Aged Supplier Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php?">' . _('Payment Run Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php?">' . _('Remittance Advices') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php?">' . _('Outstanding GRNs Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php?">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php?">' . _('List Daily Transactions') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTransInquiry.php?">' . _('Supplier Transaction Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('ap'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- AP Maintenance Options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php?">' . _('Add Supplier') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Factors.php?">' . _('Maintain Factor Companies') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; - - Case 'PO': /* Purchase Ordering */ - - ?> - <table width="100%"> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> - - <?php OptionHeadings(); ?> - - <tr> - <td class="menu_group_items"> <!-- PO Transactions --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?">' . _('Purchase Orders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes">' . _('Add Purchase Order') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenderCreate.php?New=Yes">' . _('Create a New Tender') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenderCreate.php?Edit=Yes">' . _('Edit Existing Tenders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OffersReceived.php?">' . _('Process Tenders and Offers') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php?">' . _('Orders to Authorise') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?">' . _('Shipment Entry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php?">' . _('Select A Shipment') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- PO Inquiries --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php?">' . _('Purchase Order Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/POReport.php?">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('prch'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- PO Maintenance --> - <table width="100%" class="table_index"> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; - - /* ****************************** END OF PURCHASING OPTIONS ******************************** */ - - - Case 'stock': //Inventory Module - - ?> - <table width="100%"> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> - - <?php OptionHeadings(); ?> - - <tr> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?">' . _('Receive Purchase Orders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransfer.php">' . _('Bulk Inventory Transfer') . ' - ' . _('Dispatch') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php?">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?New=Yes">' . _('Inventory Location Transfers') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockAdjustments.php?NewAdjustment=Yes">' . _('Inventory Adjustments') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php?">' . _('Reverse Goods Received') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php?">' . _('Enter Stock Counts') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/StockSerialItemResearch.php?" . sid . '">' . _('Serial Item Research Tool') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/PDFPrintLabel.php?" . sid . '">' . _('Print Price Labels') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReprintGRN.php?' . sid . '">' . _('Reprint GRN') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . "/StockMovements.php?" . sid . '">' . _('Inventory Item Movements') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockStatus.php?">' . _('Inventory Item Status') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockUsage.php?">' . _('Inventory Item Usage') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryQuantities.php?">' . _('Inventory Quantities') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevel.php?">' . _('Reorder Level') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockDispatch.php?">' . _('Stock Dispatch') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryValuation.php?">' . _('Inventory Valuation Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanning.php?">' . _('Inventory Planning Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanningPrefSupplier.php?">' . _('Inventory Planning Based On Preferred Supplier Data') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCheck.php?">' . _('Inventory Stock Check Sheets') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockQties_csv.php?">' . _('Make Inventory Quantities CSV') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockCheckComparison.php?">' . _('Compare Counts Vs Stock Check Data') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocMovements.php?">' . _('All Inventory Movements By Location/Date') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocStatus.php?">' . _('List Inventory Status By Location/Category') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockQuantityByDate.php?">' . _('Historical Stock Quantity By Location/Category') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockNegatives.php?">' . _('List Negative Stocks') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPeriodStockTransListing.php?">' . _('Period Stock Transaction Listing') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('inv'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Stocks.php?">' . _('Add A New Item') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectProduct.php?">' . _('Select An Item') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesCategories.php?">' . _('Sales Category Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PricesBasedOnMarkUp.php?">' . _('Add or Update Prices Based On Costs') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php?">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Manufacturers.php?">' . _('Item Manufacturers') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; - - /* ****************************** END OF INVENTORY OPTIONS *********************************** */ - - Case 'manuf': //Manufacturing Module - - ?> - <table width="100%"> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> - - <?php OptionHeadings(); ?> - - <tr> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WorkOrderEntry.php?">' . _('Work Order Entry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php?">' . _('Select A Work Order') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php?">' . _('Select A Work Order') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMInquiry.php?">' . _('Costed Bill Of Material Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WhereUsedInquiry.php?">' . _('Where Used Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMIndented.php?">' . _('Indented Bill Of Material Listing') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMExtendedQty.php?">' . _('List Components Required') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMIndentedReverse.php?">' . _('Indented Where Used Listing') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPReport.php?">' . _('MRP') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPShortages.php?">' . _('MRP Shortages') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedPurchaseOrders.php?">' . _('MRP Suggested Purchase Orders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedWorkOrders.php?">' . _('MRP Suggested Work Orders') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPReschedules.php?">' . _('MRP Reschedules Required') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('man'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WorkCentres.php?">' . _('Work Centre') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMs.php?">' . _('Bills Of Material') . '</a></p>'; ?> - </td> - </tr> - - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPDemands.php?">' . _('Master Schedule') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPCreateDemands.php?">' . _('Auto Create Master Schedule') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRP.php?">' . _('MRP Calculation') . '</a></p>'; ?> - </td> - </tr> - - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; - - Case 'system': //System setup - - ?> - <table width='100%'> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%" > - <tr> - <td class="menu_group_headers"> - <table> - <tr> - <td> - <?php echo '<img src="'. $rootpath . '/css/' . $theme . '/images/company.png" title="' . _('General Setup Options') . '" alt="">'; ?> - </td> - <td class="menu_group_headers_text"> - <?php echo _('General'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_headers"> - <table> - <tr> - <td> - <?php echo '<img src="'. $rootpath . '/css/' . $theme . '/images/ar.png" title="' . _('Receivables/Payables Setup') . '" alt="">'; ?> - </td> - <td class="menu_group_headers_text"> - <?php echo _('Receivables/Payables'); ?> - - </td> - </tr> - </table> - </td> - <td class="menu_group_headers"> - <table> - <tr> - <td> - <?php echo '<img src="'. $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory Setup') . '" alt="">'; ?> - </td> - <td class="menu_group_headers_text"> - <?php echo _('Inventory Setup'); ?> - </td> - </tr> - </table> - </td> - - - </tr> - <tr> - - <td class="menu_group_items"> <!-- Gereral set up options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CompanyPreferences.php?">' . _('Company Preferences') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SystemParameters.php?">' . _('Configuration Settings') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WWW_Users.php?">' . _('User Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SecurityTokens.php?">' . _('Maintain Security Tokens') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WWW_Access.php?">' . _('Role Permissions') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PageSecurity.php?">' . _('Page Security Settings') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BankAccounts.php?">' . _('Bank Accounts') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Currencies.php?">' . _('Currency Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxAuthorities.php?">' . _('Tax Authorities and Rates Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxGroups.php?">' . _('Tax Group Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxProvinces.php?">' . _('Dispatch Tax Province Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxCategories.php?">' . _('Tax Category Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PeriodsInquiry.php?">' . _('List Periods Defined') . ' <span style="font-size: 9px;">(' . _('Periods are automatically maintained') . ')</span></a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/reportwriter/admin/ReportCreator.php">' . _('Report Builder Tool') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AuditTrail.php">' . _('View Audit Trail') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/GeocodeSetup.php">' . _('Geocode Setup') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/FormDesigner.php">' . _('Form Layout Editor') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Labels.php">' . _('Label Templates Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SMTPServer.php">' . _('SMTP Server Details') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - - <td class="menu_group_items"> <!-- AR/AP set-up options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesTypes.php?">' . _('Sales Types') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerTypes.php?">' . _('Customer Types') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTypes.php?">' . _('Supplier Types') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CreditStatus.php?">' . _('Credit Status') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PaymentTerms.php?">' . _('Payment Terms') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthorisationLevels.php?">' . _('Set Purchase Order Authorisation levels') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PaymentMethods.php?">' . _('Payment Methods') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesPeople.php?">' . _('Sales People') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Areas.php?">' . _('Sales Areas') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Shippers.php?">' . _('Shippers') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesGLPostings.php?">' . _('Sales GL Interface Postings') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/COGSGLPostings.php?">' . _('COGS GL Interface Postings') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/FreightCosts.php?">' . _('Freight Costs Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DiscountMatrix.php?">' . _('Discount Matrix') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - - <td class="menu_group_items"> <!-- Inventory set-up options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCategories.php?">' . _('Inventory Categories Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Locations.php?">' . _('Inventory Locations Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DiscountCategories.php?">' . _('Discount Category Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/UnitsOfMeasure.php?">' . _('Units of Measure') . '</a></p>'; ?> - </td> - </tr> - <tr></tr> - - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPCalendar.php?">' . _('MRP Available Production Days') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPDemandTypes.php?">' . _('MRP Demand Types') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; - - Case 'GL': //General Ledger - - ?> - <table width="100%"> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> <!-- Gereral Ledger Option Headings--> - - <?php OptionHeadings(); ?> - - <tr> - <td class="menu_group_items"> <!-- General transactions options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Payments.php?' .sid . '&NewPayment=Yes">' . _('Bank Account Payments Entry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=GL">' . _('Bank Account Receipts Entry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/GLJournal.php?' .sid . '&NewJournal=Yes">' . _('Journal Entry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BankMatching.php?' .sid . '&Type=Payments">' . _('Bank Account Payments Matching') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BankMatching.php?' .sid . '&Type=Receipts">' . _('Bank Account Receipts Matching') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- Gereral inquiry options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/GLTrialBalance.php?">' . _('Trial Balance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectGLAccount.php?">' . _('Account Inquiry') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/GLAccountReport.php?">' . _('Account Listing') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/GLAccountCSV.php?">' . _('Account Listing to CSV File') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BankReconciliation.php?">' . _('Bank Account Reconciliation Statement') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFChequeListing.php?">' . _('Cheque Payments Listing') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DailyBankTransactions.php?">' . _('Daily Bank Transactions') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/GLProfit_Loss.php?">' . _('Profit and Loss Statement') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/GLBalanceSheet.php?">' . _('Balance Sheet') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/GLTagProfit_Loss.php?">' . _('Tag Reports') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Tax.php?">' . _('Tax Reports') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('gl'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- Gereral Ledger Maintenance options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/GLAccounts.php?">' . _('GL Account') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/GLBudgets.php?">' . _('GL Budgets') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AccountGroups.php?">' . _('Account Groups') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AccountSections.php?">' . _('Account Sections') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/GLTags.php?">' . _('GL Tags') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; - Case 'FA': //Fixed Assets - - ?> - <table width="100%"> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> <!-- Fixed Asset Option Headings--> - <?php OptionHeadings(); ?> - <tr> - <td class="menu_group_items"> <!-- Fixed Asset transactions options --> - <table width="100%" class="table_index"> - <tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/FixedAssetItems.php?">' . _('Add a new Asset') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectAsset.php?">' . _('Select an Asset') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/FixedAssetTransfer.php?">' . _('Change Asset Location') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/FixedAssetDepreciation.php">' . _('Depreciation Journal') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- Fixed Asset transactions options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/FixedAssetRegister.php?">' . _('Asset Register') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('fa'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- General transactions options --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/FixedAssetCategories.php?">' . _('Asset Categories Maintenance') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/FixedAssetLocations.php?">' . _('Add or Maintain Asset Locations') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </table> - </td> - </tr> - </table> - <?php - break; - - Case 'PC': /* Petty Cash Module */ - - ?> - <table width="100%"> - <tr> - <td valign="top" class="menu_group_area"> - <table width="100%"> - - <?php OptionHeadings(); ?> - - <tr> - <td class="menu_group_items"> <!-- PC Transactions --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PcAssignCashToTab.php?">' . _('Assign Cash to PC Tab') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PcClaimExpensesFromTab.php">' . _('Claim Expenses From PC Tab') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PcAuthorizeExpenses.php?">' . _('Expenses Authorisation') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- Pc Inquiries --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PcReportTab.php?">' . _('PC Tab General Report') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo GetRptLinks('prch'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_items"> <!-- PC Maintenance --> - <table width="100%" class="table_index"> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PcTypeTabs.php?">' . _('Types of PC Tabs') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PcTabs.php?">' . _('PC Tabs') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PcExpenses.php?">' . _('PC Expenses') . '</a></p>'; ?> - </td> - </tr> - <tr> - <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PcExpensesTypeTab.php?">' . _('Expenses for Type of PC Tab') . '</a></p>'; ?> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </table> - <?php - break; - - } //end of module switch -} /* end of if security allows to see the full menu */ - -// all tables started are ended within this index script which means 2 outstanding from footer. - -include('includes/footer.inc'); - -function OptionHeadings() { - -global $rootpath, $theme; - -?> - - <tr> - <td class="menu_group_headers"> <!-- Orders option Headings --> - <table> - <tr> - <td> - <?php echo '<img src="' . $rootpath . '/css/' . $theme . '/images/transactions.png" title="' . _('Transactions') . '" alt="">'; ?> - </td> - <td class="menu_group_headers_text"> - <?php echo _('Transactions'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_headers"> - <table> - <tr> - <td> - <?php echo '<img src="' . $rootpath . '/css/' . $theme . '/images/reports.png" title="' . _('Inquiries and Reports') . '" alt="">'; ?> - </td> - <td class="menu_group_headers_text"> - <?php echo _('Inquiries and Reports'); ?> - </td> - </tr> - </table> - </td> - <td class="menu_group_headers"> - <table> - <tr> - <td> - <?php echo '<img src="' . $rootpath . '/css/' . $theme . '/images/maintenance.png" title="' . _('Maintenance') . '" alt="">'; ?> - </td> - <td class="menu_group_headers_text"> - <?php echo _('Maintenance'); ?> - </td> - </tr> - </table> - </td> - </tr> - -<?php - -} - -function GetRptLinks($GroupID) { -/* -This function retrieves the reports given a certain group id as defined in /reports/admin/defaults.php -in the acssociative array $ReportGroups[]. It will fetch the reports belonging solely to the group -specified to create a list of links for insertion into a table to choose a report. Two table sections will -be generated, one for standard reports and the other for custom reports. -*/ - global $db, $rootpath; - require_once('reportwriter/languages/en_US/reports.php'); - require_once('reportwriter/admin/defaults.php'); - - $Title= array(_('Custom Reports'), _('Standard Reports and Forms')); - - $sql= "SELECT id, - reporttype, - defaultreport, - groupname, - reportname - FROM reports - ORDER BY groupname, - reportname"; - $Result=DB_query($sql,$db,'','',false,true); - $ReportList = ''; - while ($Temp = DB_fetch_array($Result)) $ReportList[] = $Temp; - - $RptLinks = ''; - for ($Def=1; $Def>=0; $Def--) { - $RptLinks .= '<tr><td class="menu_group_headers"><div align="center">'.$Title[$Def].'</div></td></tr>'; - $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 .= '<a href="' . $rootpath . '/reportwriter/ReportMaker.php?action=go&reportid=' . $Report['id'] . '">' . _($Report['reportname']) . '</a>'; - $RptLinks .= '</td></tr>'; - $NoEntries = false; - } - } - // now fetch the form groups that are a part of this group (List after reports) - $NoForms = true; - 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 .= '<img src="' . $rootpath . '/css/' . $_SESSION['Theme'] . '/images/folders.gif" width="16" height="13"> '; - $RptLinks .= '<a href="' . $rootpath . '/reportwriter/FormMaker.php?id=' . $Report['groupname'] . '">'; - $RptLinks .= $FormGroups[$Report['groupname']] . '</a>'; - $RptLinks .= '</td></tr>'; - $NoForms = false; - $NoEntries = false; - } - } - } - if ($NoEntries) $RptLinks .= '<tr><td class="menu_group_item">' . _('There are no reports to show!') . '</td></tr>'; - } - return $RptLinks; -} - -?> Added: trunk/index.php =================================================================== --- trunk/index.php (rev 0) +++ trunk/index.php 2011-07-18 21:02:04 UTC (rev 6725) @@ -0,0 +1,682 @@ +<?php +$PageSecurity=0; + +include('includes/session.inc'); +$title=_('Main Menu'); +include('includes/header.inc'); + +/*The module link codes are hard coded in a switch statement below to determine the options to show for each tab */ +$ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); +/*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ +$ModuleList = array(_('Sales'), + _('Receivables'), + _('Payables'), + _('Purchases'), + _('Inventory'), + _('Manufacturing'), + _('General Ledger'), + _('Asset Manager'), + _('Petty Cash'), + _('Setup')); + +$MenuItems['orders']['Transactions']['Caption'] = array( _('Enter An Order or Quotation'), + _('Enter Counter Sales'), + _('Print Picking Lists'), + _('Outstanding Sales Orders/Quotations'), + _('Special Order'), + _('Recurring Order Template'), + _('Process Recurring Orders') + ); +$MenuItems['orders']['Transactions']['URL'] = array( '/SelectOrderItems.php?NewOrder=Yes', + '/CounterSales.php', + '/PDFPickingList.php', + '/SelectSalesOrder.php', + '/SpecialOrder.php', + '/SelectRecurringSalesOrder.php', + '/RecurringSalesOrdersProcess.php' + ); + +$MenuItems['orders']['Reports']['Caption'] = array( _('Order Inquiry'), + _('Print Price Lists'), + _('Order Status Report'), + _('Orders Invoiced Reports'), + _('Daily Sales Inquiry'), + _('Order Delivery Differences Report'), + _('Delivery In Full On Time (DIFOT) Report'), + _('Sales Order Detail Or Summary Inquiries'), + _('Top Sales Items Report'), + _('Sales With Low Gross Profit Report') + ); + +$MenuItems['orders']['Reports']['URL'] = array( '/SelectCompletedOrder.php', + '/PDFPriceList.php', + '/PDFOrderStatu... [truncated message content] |
From: <tim...@us...> - 2011-07-20 16:35:03
|
Revision: 6730 http://weberp.svn.sourceforge.net/weberp/?rev=6730&view=rev Author: tim_schofield Date: 2011-07-20 16:34:51 +0000 (Wed, 20 Jul 2011) Log Message: ----------- Re-write of SelectCreditItems Modified Paths: -------------- trunk/SelectCreditItems.php trunk/includes/DefineCartClass.php trunk/includes/GetPrice.inc Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-07-19 08:54:12 UTC (rev 6729) +++ trunk/SelectCreditItems.php 2011-07-20 16:34:51 UTC (rev 6730) @@ -17,10 +17,10 @@ include('includes/GetSalesTransGLCodes.inc'); include('includes/GetPrice.inc'); - -if (isset($_POST['ProcessCredit']) AND !isset($_SESSION['CreditItems'])){ - prnMsg(_('This credit note has already been processed. Refreshing the page will not enter the credit note again') . '<br />' . _('Please use the navigation links provided rather than using the browser back button and then having to refresh'),'info'); - echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; +if (isset($_POST['ProcessCredit']) and !isset($_SESSION['CreditItems'])){ + prnMsg(_('This credit note has already been processed. Refreshing the page will not enter the credit note again') . '<br />' . + _('Please use the navigation links provided rather than using the browser back button and then having to refresh'),'info'); + echo '<br /><a href="' . $rootpath . '/index.php"">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } @@ -33,248 +33,503 @@ } } +if (isset($_POST['AddToCredit'])){ + foreach ($_POST as $key => $value) { + if (strstr($key,'StockID')) { + $Index=mb_substr($key, 7); + $StockID=$value; + if ($_POST['Quantity'.$Index]!=0) { + $NewItem_array[$StockID] = $_POST['Quantity'.$Index]; + $_POST['Units'.$StockID] = $_POST['Units'.$Index]; + $NewItem=True; + } + } + } +} if (!isset($_SESSION['CreditItems'])){ /* It must be a new credit note being created $_SESSION['CreditItems'] would be set up from a previous call*/ - - $_SESSION['CreditItems'] = new cart; - - $_SESSION['RequireCustomerSelection'] = 1; + $_SESSION['CreditItems'] = new cart; + $_SESSION['RequireCustomerSelection'] = 1; } if (isset($_POST['ChangeCustomer'])){ - $_SESSION['RequireCustomerSelection']=1; + $_SESSION['RequireCustomerSelection']=1; } if (isset($_POST['Quick'])){ - unset($_POST['PartSearch']); + unset($_POST['PartSearch']); } if (isset($_POST['CancelCredit'])) { - unset($_SESSION['CreditItems']->LineItems); - unset($_SESSION['CreditItems']); - $_SESSION['CreditItems'] = new cart; - $_SESSION['RequireCustomerSelection'] = 1; + echo'xxxxxxxxx'; + unset($_SESSION['CreditItems']->LineItems); + unset($_SESSION['CreditItems']); + $_SESSION['CreditItems'] = new cart; + $_SESSION['RequireCustomerSelection'] = 1; } +foreach ($_POST as $key=>$value) { + if (mb_substr($key,0,8)=='Customer') { + $_POST['Customer']=$_POST['Debtor'.mb_substr($key,8)]; + $_POST['Branch']=$_POST['Branch'.mb_substr($key,8)]; + } +} -if (isset($_POST['SearchCust']) AND $_SESSION['RequireCustomerSelection']==1){ +if (isset($_POST['Customer'])) { + $_SESSION['RequireCustomerSelection']=0; +} - if ($_POST['Keywords'] AND $_POST['CustCode']) { - prnMsg( _('Customer name keywords have been used in preference to the customer code extract entered'), 'info' ); - } - if ($_POST['Keywords']=='' AND $_POST['CustCode']=='') { - prnMsg( _('At least one Customer Name keyword OR an extract of a Customer Code must be entered for the search'), 'info' ); - } else { - If (mb_strlen($_POST['Keywords'])>0) { - //insert wildcard characters in spaces - $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; +/* if the change customer button hit or the customer has not already been selected */ +if ($_SESSION['RequireCustomerSelection']==1) { - $SQL = "SELECT - custbranch.debtorno, - custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode - FROM custbranch - WHERE custbranch.brname " . LIKE ." '".$SearchString."' - AND custbranch.disabletrans='0'"; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Customers').'</p>'; + echo '<table cellpadding="3" colspan="4" class="selection">'; + echo '<tr><td colspan="2">' . _('Enter a partial Name') . ':</td><td>'; + if (isset($_POST['Keywords'])) { + echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size="20" maxlength="25" />'; + } else { + echo '<input type="text" name="Keywords" size="20" maxlength="25" />'; + } + echo '</td><td><font size="3"><b>' . _('OR') . '</b></font></td><td>' . _('Enter a partial Code') . ':</td><td>'; + if (isset($_POST['CustCode'])) { + echo '<input type="text" name="CustCode" value="' . $_POST['CustCode'] . '" size="15" maxlength="18" />'; + } else { + echo '<input type="text" name="CustCode" size="15" maxlength="18" />'; + } + echo '</td></tr><tr><td><font size="3"><b>' . _('OR') . '</b></font></td><td>' . _('Enter a partial Phone Number') . ':</td><td>'; + if (isset($_POST['CustPhone'])) { + echo '<input type="text" name="CustPhone" value="' . $_POST['CustPhone'] . '" size="15" maxlength="18" />'; + } else { + echo '<input type="text" name="CustPhone" size="15" maxlength="18" />'; + } + echo '</td>'; + echo '<td><font size="3"><b>' . _('OR') . '</b></font></td><td>' . _('Enter part of the Address') . ':</td><td>'; + if (isset($_POST['CustAdd'])) { + echo '<input type="text" name="CustAdd" value="' . $_POST['CustAdd'] . '" size="20" maxlength="25" />'; + } else { + echo '<input type="text" name="CustAdd" size="20" maxlength="25" />'; + } + echo '</td></tr>'; +/* End addded search feature. Gilles Deacur */ + echo '<tr><td><font size="3"><b>' . _('OR') . '</b></font></td><td>' . _('Choose a Type') . ':</td><td>'; + if (isset($_POST['CustType'])) { + // Show Customer Type drop down list + $result2 = DB_query("SELECT typeid, typename FROM debtortype", $db); + // Error if no customer types setup + if (DB_num_rows($result2) == 0) { + $DataError = 1; + echo '<a href="CustomerTypes.php?" target="_parent">Setup Types</a>'; + echo '<tr><td colspan=2>' . prnMsg(_('No Customer types defined'), 'error') . '</td></tr>'; + } else { + // If OK show select box with option selected + echo '<select name="CustType">'; + echo '<option value="ALL">' . _('Any') . '</option>'; + while ($myrow = DB_fetch_array($result2)) { + if ($_POST['CustType'] == $myrow['typename']) { + echo '<option selected="True" value="' . $myrow['typename'] . '">' . $myrow['typename'] . '</option>'; + } else { + echo '<option value="' . $myrow['typename'] . '">' . $myrow['typename'] . '</option>'; + } + } //end while loop + DB_data_seek($result2, 0); + echo '</select></td>'; + } + } else { + // No option selected yet, so show Customer Type drop down list + $result2 = DB_query("SELECT typeid, typename FROM debtortype", $db); + // Error if no customer types setup + if (DB_num_rows($result2) == 0) { + $DataError = 1; + echo '<a href="CustomerTypes.php?" target="_parent">Setup Types</a>'; + echo '<tr><td colspan=2>' . prnMsg(_('No Customer types defined'), 'error') . '</td></tr>'; + } else { + // if OK show select box with available options to choose + echo '<select name="CustType">'; + echo '<option value="ALL">' . _('Any'). '</option>'; + while ($myrow = DB_fetch_array($result2)) { + echo '<option value="' . $myrow['typename'] . '">' . $myrow['typename'] . '</option>'; + } //end while loop + DB_data_seek($result2, 0); + echo '</select></td>'; + } + } - } elseif (mb_strlen($_POST['CustCode'])>0){ + /* Option to select a sales area */ + echo '<td><font size="3"><b>' . _('OR') . '</b></font></td><td>' . _('Choose an Area') . ':</td><td>'; + $result2 = DB_query("SELECT areacode, areadescription FROM areas", $db); + // Error if no sales areas setup + if (DB_num_rows($result2) == 0) { + $DataError = 1; + echo '<a href="Areas.php?" target="_parent">Setup Types</a>'; + echo '<tr><td colspan=2>' . prnMsg(_('No Sales Areas defined'), 'error') . '</td></tr>'; + } else { + // if OK show select box with available options to choose + echo '<select name="Area">'; + echo '<option value="ALL">' . _('Any') . '</option>'; + while ($myrow = DB_fetch_array($result2)) { + if (isset($_POST['Area']) and $_POST['Area']==$myrow['areacode']) { + echo '<option selected="True" value="' . $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; + } else { + echo '<option value="' . $myrow['areacode'] . '">' . $myrow['areadescription'] . '</option>'; + } + } //end while loop + DB_data_seek($result2, 0); + echo '</select></td></tr>'; + } - $SQL = "SELECT - custbranch.debtorno, - custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode - FROM custbranch - WHERE custbranch.branchcode " . LIKE . " '%" . $_POST['CustCode'] . "%' - AND custbranch.disabletrans='0'"; - } + echo '</table><br />'; + echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div>'; + if (isset($_SESSION['SalesmanLogin']) and $_SESSION['SalesmanLogin'] != '') { + prnMsg(_('Your account enables you to see only customers allocated to you'), 'warn', _('Note: Sales-person Login')); + } - $ErrMsg = _('Customer branch records requested cannot be retrieved because'); - $DbgMsg = _('SQL used to retrieve the customer details was'); - $result_CustSelect = DB_query($SQL,$db,$ErrMsg,$DbgMsg); + if (isset($_POST['Search']) OR isset($_POST['Go']) OR isset($_POST['Next']) OR isset($_POST['Previous'])) { + if (isset($_POST['Search'])) { + $_POST['PageOffset'] = 1; + } + if ($_POST['Keywords'] AND (($_POST['CustCode']) OR ($_POST['CustPhone']) OR ($_POST['CustType']))) { + $msg = _('Search Result: Customer Name has been used in search') . '<br />'; + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); + } + if ($_POST['CustCode'] AND $_POST['CustPhone'] == "" AND isset($_POST['CustType']) AND $_POST['Keywords'] == "") { + $msg = _('Search Result: Customer Code has been used in search') . '<br />'; + } + if (($_POST['CustPhone'])) { + $msg = _('Search Result: Customer Phone has been used in search') . '<br />'; + } + if (($_POST['CustAdd'])) { + $msg = _('Search Result: Customer Address has been used in search') . '<br />'; + } + if ($_POST['CustType'] AND $_POST['CustPhone'] == "" AND $_POST['CustCode'] == "" AND $_POST['Keywords'] == "" AND $_POST['CustAdd'] == "") { + $msg = _('Search Result: Customer Type has been used in search') . '<br />'; + } + if (($_POST['Keywords'] == "") AND ($_POST['CustCode'] == "") AND ($_POST['CustPhone'] == "") AND ($_POST['CustType'] == "") AND ($_POST['Area'] == "") AND ($_POST['CustAdd'] == "")) { + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + custbranch.branchcode, + custbranch.brname, + custbranch.contactname, + debtortype.typename, + custbranch.phoneno, + custbranch.faxno + FROM debtorsmaster + LEFT JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno, debtortype + WHERE debtorsmaster.typeid = debtortype.typeid"; + } elseif (mb_strlen($_POST['Keywords']) > 0) { + //using the customer name + $_POST['Keywords'] = mb_strtoupper(trim($_POST['Keywords'])); + //insert wildcard characters in spaces + $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + custbranch.branchcode, + custbranch.brname, + custbranch.contactname, + debtortype.typename, + custbranch.phoneno, + custbranch.faxno + FROM debtorsmaster + LEFT JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno, debtortype + WHERE debtorsmaster.name " . LIKE . " '$SearchString' + AND debtorsmaster.typeid = debtortype.typeid"; + } elseif (mb_strlen($_POST['CustCode']) > 0) { + $_POST['CustCode'] = mb_strtoupper(trim($_POST['CustCode'])); + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + custbranch.branchcode, + custbranch.brname, + custbranch.contactname, + debtortype.typename, + custbranch.phoneno, + custbranch.faxno + FROM debtorsmaster + LEFT JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno, debtortype + WHERE debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' + AND debtorsmaster.typeid = debtortype.typeid"; + } elseif (mb_strlen($_POST['CustPhone']) > 0) { + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + custbranch.branchcode, + custbranch.brname, + custbranch.contactname, + debtortype.typename, + custbranch.phoneno, + custbranch.faxno + FROM debtorsmaster + LEFT JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno, debtortype + WHERE custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%' + AND debtorsmaster.typeid = debtortype.typeid"; + // Added an option to search by address. I tried having it search address1, address2, address3, and address4, but my knowledge of MYSQL is limited. This will work okay if you select the CSV Format then you can search though the address1 field. I would like to extend this to all 4 address fields. Gilles Deacur + } elseif (mb_strlen($_POST['CustAdd']) > 0) { + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + custbranch.branchcode, + custbranch.brname, + custbranch.contactname, + debtortype.typename, + custbranch.phoneno, + custbranch.faxno + FROM debtorsmaster + LEFT JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno, debtortype + WHERE CONCAT_WS(debtorsmaster.address1,debtorsmaster.address2,debtorsmaster.address3,debtorsmaster.address4) " . LIKE . " '%" . $_POST['CustAdd'] . "%' + AND debtorsmaster.typeid = debtortype.typeid"; + // End added search feature. Gilles Deacur - if (DB_num_rows($result_CustSelect)==1){ - $myrow=DB_fetch_array($result_CustSelect); - $_POST['Select'] = $myrow['debtorno'] . ' - ' . $myrow['branchcode']; - } elseif (DB_num_rows($result_CustSelect)==0){ - prnMsg(_('Sorry') . ' ... ' . _('there are no customer branch records contain the selected text') . ' - ' . _('please alter your search criteria and try again'),'info'); - } + } elseif (mb_strlen($_POST['CustType']) > 0) { + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + custbranch.branchcode, + custbranch.brname, + custbranch.contactname, + debtortype.typename, + custbranch.phoneno, + custbranch.faxno + FROM debtorsmaster + LEFT JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno, debtortype + WHERE debtorsmaster.typeid LIKE debtortype.typeid + AND debtortype.typename = '" . $_POST['CustType'] . "'"; + } elseif (mb_strlen($_POST['Area']) > 0 AND $_POST['Area']!='ALL') { + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + custbranch.branchcode, + custbranch.brname, + custbranch.contactname, + debtortype.typename, + custbranch.phoneno, + custbranch.faxno + FROM debtorsmaster + LEFT JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno, debtortype + WHERE debtorsmaster.typeid LIKE debtortype.typeid + AND custbranch.area = '" . $_POST['Area'] . "'"; + } + if ($_SESSION['SalesmanLogin'] != '') { + $SQL.= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; + } + $SQL.= ' ORDER BY debtorsmaster.name'; + $ErrMsg = _('The searched customer records requested cannot be retrieved because'); - } /*one of keywords or custcode was more than a zero length string */ -} /*end of if search button for customers was hit*/ + $result = DB_query($SQL, $db, $ErrMsg); + if (DB_num_rows($result) == 1) { + $myrow = DB_fetch_array($result); + $_POST['Select'] = $myrow['debtorno']; + unset($result); + } elseif (DB_num_rows($result) == 0) { + prnMsg(_('No customer records contain the selected text') . ' - ' . _('please alter your search criteria and try again'), 'info'); + echo '<br />'; + } + unset($_SESSION['CustomerID']); + $ListCount = DB_num_rows($result); + $ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax']); + if (!isset($_POST['CSV'])) { + if (isset($_POST['Next'])) { + if ($_POST['PageOffset'] < $ListPageMax) { + $_POST['PageOffset'] = $_POST['PageOffset'] + 1; + } + } + if (isset($_POST['Previous'])) { + if ($_POST['PageOffset'] > 1) { + $_POST['PageOffset'] = $_POST['PageOffset'] - 1; + } + } + echo '<input type="hidden" name="PageOffset" value="' . $_POST['PageOffset'] . '" />'; + if ($ListPageMax > 1) { + echo '<br /><div class="centre"> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<select name="PageOffset1">'; + $ListPage = 1; + while ($ListPage <= $ListPageMax) { + if ($ListPage == $_POST['PageOffset']) { + echo '<option value=' . $ListPage . ' selected>' . $ListPage . '</option>'; + } else { + echo '<option value=' . $ListPage . '>' . $ListPage . '</option>'; + } + $ListPage++; + } + echo '</select> + <input type="submit" name="Go1" value="' . _('Go') . '" /> + <input type="submit" name="Previous" value="' . _('Previous') . '" /> + <input type="submit" name="Next" value="' . _('Next') . '" />'; + echo '</div>'; + } + echo '<br /><table cellpadding="2" colspan="7" class="selection">'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Customer Name') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Contact') . '</th> + <th>' . _('Type') . '</th> + <th>' . _('Phone') . '</th> + <th>' . _('Fax') . '</th> + </tr>'; + echo $TableHeader; + $j = 1; + $k = 0; //row counter to determine background colour + $RowIndex = 0; + } + if (DB_num_rows($result)!=0) { + if (!isset($_POST['CSV'])) { + DB_data_seek($result, ($_POST['PageOffset'] - 1) * $_SESSION['DisplayRecordsMax']); + } + while (($myrow = DB_fetch_array($result)) AND ($RowIndex <> $_SESSION['DisplayRecordsMax'])) { + if ($k == 1) { + echo '<tr class="EvenTableRows">'; + $k = 0; + } else { + echo '<tr class="OddTableRows">'; + $k = 1; + } + echo '<td><font size="1"><input type="submit" name="Customer' . $j . '" value="' . _('Select') . '" /></font></td> + <td><font size="1">' . htmlspecialchars($myrow['name']) . '</font></td> + <td><font size="1">' . htmlspecialchars($myrow['brname']) . '</font></td> + <td><font size="1">' . htmlspecialchars($myrow['contactname']) . '</font></td> + <td><font size="1">' . htmlspecialchars($myrow['typename']) . '</font></td> + <td><font size="1">' . $myrow['phoneno'] . '</font></td> + <td><font size="1">' . $myrow['faxno'] . '</font></td></tr> + <input type="hidden" name="Debtor'.$j.'" value="'.$myrow['debtorno'].'" /> + <input type="hidden" name="Branch'.$j.'" value="'.$myrow['branchcode'].'" />'; + $j++; + $RowIndex++; + //end of page full new headings if + } + //end of while loop + echo '</table>'; + } + } +//end if results to show +} -if (isset($_POST['Select']) AND $_POST['Select']!='') { +if (isset($_POST['Customer']) AND $_POST['Customer']!='') { -/*will only be true if page called from customer selection form -parse the $Select string into customer code and branch code */ + /*will only be true if page called from customer selection form + parse the $Select string into customer code and branch code */ - $_SESSION['CreditItems']->Branch = mb_substr($_POST['Select'],mb_strpos($_POST['Select'],' - ')+3); - $_POST['Select'] = mb_substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - ')); + $_SESSION['CreditItems']->Branch = $_POST['Branch']; + $_SESSION['CreditItems']->DebtorNo = $_POST['Customer']; -/*Now retrieve customer information - name, salestype, currency, terms etc */ + /*Now retrieve customer information - name, salestype, currency, terms etc */ - $sql = "SELECT - debtorsmaster.name, - debtorsmaster.salestype, - debtorsmaster.currcode, - currencies.rate - FROM debtorsmaster, - currencies - WHERE debtorsmaster.currcode=currencies.currabrev - AND debtorsmaster.debtorno = '" . $_POST['Select'] . "'"; + $sql = "SELECT debtorsmaster.name, + debtorsmaster.salestype, + debtorsmaster.currcode, + currencies.rate + FROM debtorsmaster, + currencies + WHERE debtorsmaster.currcode=currencies.currabrev + AND debtorsmaster.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "'"; - $ErrMsg = _('The customer record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); + $ErrMsg = _('The customer record of the customer selected') . ': ' . $_SESSION['CreditItems']->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the customer details and failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_row($result); + $myrow = DB_fetch_row($result); - $_SESSION['CreditItems']->DebtorNo = $_POST['Select']; - $_SESSION['RequireCustomerSelection'] = 0; - $_SESSION['CreditItems']->CustomerName = $myrow[0]; + $_SESSION['RequireCustomerSelection'] = 0; + $_SESSION['CreditItems']->CustomerName = $myrow[0]; /* the sales type determines the price list to be used by default the customer of the user is defaulted from the entry of the userid and password. */ - $_SESSION['CreditItems']->DefaultSalesType = $myrow[1]; - $_SESSION['CreditItems']->DefaultCurrency = $myrow[2]; - $_SESSION['CurrencyRate'] = $myrow[3]; + $_SESSION['CreditItems']->DefaultSalesType = $myrow[1]; + $_SESSION['CreditItems']->DefaultCurrency = $myrow[2]; + $_SESSION['CurrencyRate'] = $myrow[3]; /* default the branch information from the customer branches table CustBranch -particularly where the stock will be booked back into. */ - $sql = "SELECT - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.phoneno, - custbranch.email, - custbranch.defaultlocation, - custbranch.taxgroupid, - locations.taxprovinceid - FROM custbranch - INNER JOIN locations ON locations.loccode=custbranch.defaultlocation - WHERE custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "'"; + $sql = "SELECT custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.phoneno, + custbranch.email, + custbranch.defaultlocation, + custbranch.taxgroupid, + locations.taxprovinceid + FROM custbranch + INNER JOIN locations + ON locations.loccode=custbranch.defaultlocation + WHERE custbranch.branchcode='" . $_SESSION['CreditItems']->Branch . "' + AND custbranch.debtorno = '" . $_SESSION['CreditItems']->DebtorNo . "'"; - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); - $DbgMsg = _('SQL used to retrieve the branch details was'); - $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['CreditItems']->DebtorNo . ' ' . _('cannot be retrieved because'); + $DbgMsg = _('SQL used to retrieve the branch details was'); + $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_array($result); - $_SESSION['CreditItems']->DeliverTo = $myrow['brname']; - $_SESSION['CreditItems']->BrAdd1 = $myrow['braddress1']; - $_SESSION['CreditItems']->BrAdd2 = $myrow['braddress2']; - $_SESSION['CreditItems']->BrAdd3 = $myrow['braddress3']; - $_SESSION['CreditItems']->BrAdd4 = $myrow['braddress4']; - $_SESSION['CreditItems']->BrAdd5 = $myrow['braddress5']; - $_SESSION['CreditItems']->BrAdd6 = $myrow['braddress6']; - $_SESSION['CreditItems']->PhoneNo = $myrow['phoneno']; - $_SESSION['CreditItems']->Email = $myrow['email']; - $_SESSION['CreditItems']->Location = $myrow['defaultlocation']; - $_SESSION['CreditItems']->TaxGroup = $myrow['taxgroupid']; - $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; - $_SESSION['CreditItems']->GetFreightTaxes(); + $myrow = DB_fetch_array($result); + $_SESSION['CreditItems']->DeliverTo = $myrow['brname']; + $_SESSION['CreditItems']->BrAdd1 = $myrow['braddress1']; + $_SESSION['CreditItems']->BrAdd2 = $myrow['braddress2']; + $_SESSION['CreditItems']->BrAdd3 = $myrow['braddress3']; + $_SESSION['CreditItems']->BrAdd4 = $myrow['braddress4']; + $_SESSION['CreditItems']->BrAdd5 = $myrow['braddress5']; + $_SESSION['CreditItems']->BrAdd6 = $myrow['braddress6']; + $_SESSION['CreditItems']->PhoneNo = $myrow['phoneno']; + $_SESSION['CreditItems']->Email = $myrow['email']; + $_SESSION['CreditItems']->Location = $myrow['defaultlocation']; + $_SESSION['CreditItems']->TaxGroup = $myrow['taxgroupid']; + $_SESSION['CreditItems']->DispatchTaxProvince = $myrow['taxprovinceid']; + $_SESSION['CreditItems']->GetFreightTaxes(); + $_POST['PartSearch']=True; + + unset($_POST['Keywords']); +//end if RequireCustomerSelection } - - -/* if the change customer button hit or the customer has not already been selected */ -if ($_SESSION['RequireCustomerSelection'] ==1 - OR !isset($_SESSION['CreditItems']->DebtorNo) - OR $_SESSION['CreditItems']->DebtorNo=='' ) { - - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . - _('Search') . '" alt="" />' . ' ' . _('Select Customer For Credit Note').'</p>'; - echo '<table cellpadding=3 colspan=4 class="selection">'; - echo '<tr><th colspan=5><font size=3 color=navy><b> ' . _('Customer Selection') . '</b></font></th></tr>'; - echo '<tr>'; - echo '<td><font size=1>' . _('Enter text in the customer name') . ':</font></td>'; - echo '<td><input type="Text" name="Keywords" size=20 maxlength=25></td>'; - echo '<td><font size=3><b>' . _('OR') . '</b></font></td>'; - echo '<td><font size=1>' . _('Enter text extract in the customer code') . ':</font></td>'; - echo '<td><input type="Text" name="CustCode" size=15 maxlength=18></td>'; - echo '</tr>'; - echo '</table>'; - echo '<br /><div class="centre"><input type="submit" name="SearchCust" value="' . _('Search Now') . '"></div>'; - - if (isset($result_CustSelect)) { - - echo '<br /><table cellpadding=2 colspan=7 class="selection">'; - - $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Branch') . '</th> - <th>' . _('Contact') . '</th> - <th>' . _('Phone') . '</th> - <th>' . _('Fax') . '</th> - </tr>'; - - echo $TableHeader; - - $j = 1; - $k = 0; //row counter to determine background colour - - while ($myrow=DB_fetch_array($result_CustSelect)) { - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k=1; - } - - printf('<td><font size=1><input type="submit" name="Select" value="%s - %s" /></font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - </tr>', - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['brname'], - $myrow['contactname'], - $myrow['phoneno'], - $myrow['faxno']); - -//end of page full new headings if - } -//end of while loop - - echo '</table>'; - - } -//end if results to show - -//end if RequireCustomerSelection -} else { +if (isset($_SESSION['CreditItems']->DebtorNo) and !isset($_POST['ProcessCredit'])) { /* everything below here only do if a customer is selected first add a header to show who we are making a credit note for */ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . - _('Search') . '" alt="" />' . ' ' . $_SESSION['CreditItems']->CustomerName . ' - ' . $_SESSION['CreditItems']->DeliverTo.'</p>'; + _('Search') . '" alt="" />' . ' ' . htmlspecialchars($_SESSION['CreditItems']->CustomerName) . ' - ' . htmlspecialchars($_SESSION['CreditItems']->DeliverTo).'</p>'; /* do the search for parts that might be being looked up to add to the credit note */ - if (isset($_POST['Search'])){ + if (isset($_POST['Search'])){ - if ($_POST['Keywords']!='' AND $_POST['StockCode']!='') { - prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered') . '.', 'info' ); - } + if ($_POST['Keywords']!='' AND $_POST['StockCode']!='') { + prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered') . '.', 'info' ); + } if ($_POST['Keywords']!="") { //insert wildcard characters in spaces @@ -282,167 +537,187 @@ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.description " . LIKE . "'" . $SearchString . "' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.units as stockunits + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.description " . LIKE . "'" . $SearchString . "' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.description " . LIKE . "'" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.units as stockunits + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.description " . LIKE . "'" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } } elseif ($_POST['StockCode']!=''){ $_POST['StockCode'] = '%' . $_POST['StockCode'] . '%'; if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.units as stockunits + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.units as stockunits + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.units as stockunits + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.units as stockunits + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units + ORDER BY stockmaster.stockid"; } } $ErrMsg = _('There is a problem selecting the part records to display because'); $SearchResult = DB_query($SQL,$db,$ErrMsg); - if (DB_num_rows($SearchResult)==0){ - prnMsg(_('There are no products available that match the criteria specified'),'info'); - if ($debug==1){ - prnMsg(_('The SQL statement used was') . ':<br />' . $SQL,'info'); - } + if (isset($_POST['Next'])) { + $Offset = $_POST['nextlist']; } + if (isset($_POST['Prev'])) { + $Offset = $_POST['previous']; + } + if (!isset($Offset) or $Offset<0) { + $Offset=0; + } + $SQL = $SQL . ' LIMIT ' . $_SESSION['DefaultDisplayRecordsMax'].' OFFSET '.number_format($_SESSION['DefaultDisplayRecordsMax']*$Offset); + + $ErrMsg = _('There is a problem selecting the part records to display because'); + $DbgMsg = _('The SQL used to get the part selection was'); + $SearchResult = DB_query($SQL,$db,$ErrMsg, $DbgMsg); + + if (DB_num_rows($SearchResult)==0 ){ + prnMsg (_('There are no products available meeting the criteria specified'),'info'); + } + if (DB_num_rows($SearchResult)<$_SESSION['DisplayRecordsMax']){ + $Offset=0; + } if (DB_num_rows($SearchResult)==1){ - $myrow=DB_fetch_array($SearchResult); - $_POST['NewItem'] = $myrow['stockid']; - DB_data_seek($SearchResult,0); + $myrow=DB_fetch_array($SearchResult); + $_POST['NewItem'] = $myrow['stockid']; + DB_data_seek($SearchResult,0); } - } //end of if search for parts to add to the credit note + } //end of if search for parts to add to the credit note /*Always do the stuff below if not looking for a customerid Set up the form for the credit note display and entry*/ - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*Process Quick Entry */ - if (isset($_POST['QuickEntry'])){ + if (isset($_POST['QuickEntry'])){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart */ - $i=1; - do { - do { - $QuickEntryCode = 'part_' . $i; - $QuickEntryQty = 'qty_' . $i; - $i++; - } while (!is_numeric($_POST[$QuickEntryQty]) AND $_POST[$QuickEntryQty] <=0 AND mb_strlen($_POST[$QuickEntryCode])!=0 AND $i<=$QuickEntires); + $i=1; + do { + do { + $QuickEntryCode = 'part_' . $i; + $QuickEntryQty = 'qty_' . $i; + $i++; + } while (!is_numeric($_POST[$QuickEntryQty]) AND $_POST[$QuickEntryQty] <=0 AND mb_strlen($_POST[$QuickEntryCode])!=0 AND $i<=$QuickEntires); - $_POST['NewItem'] = trim($_POST[$QuickEntryCode]); - $NewItemQty = trim($_POST[$QuickEntryQty]); + $_POST['NewItem'] = trim($_POST[$QuickEntryCode]); + $NewItemQty = trim($_POST[$QuickEntryQty]); - if (mb_strlen($_POST['NewItem'])==0){ - break; /* break out of the loop if nothing in the quick entry fields*/ - } + if (mb_strlen($_POST['NewItem'])==0){ + break; /* break out of the loop if nothing in the quick entry fields*/ + } - $AlreadyOnThisCredit =0; + $AlreadyOnThisCredit =0; - foreach ($_SESSION['CreditItems']->LineItems AS $OrderItem) { + foreach ($_SESSION['CreditItems']->LineItems AS $OrderItem) { - /* do a loop round the items on the credit note to see that the item - is not already on this credit note */ + /* do a loop round the items on the credit note to see that the item + is not already on this credit note */ - if ($_SESSION['SO_AllowSameItemMultipleTimes']==0 && strcasecmp($OrderItem->StockID, $_POST['NewItem']) == 0) { - $AlreadyOnThisCredit = 1; - prnMsg($_POST['NewItem'] . ' ' . _('is already on this credit - the system will not allow the same item on the credit note more than once. However you can change the quantity credited of the existing line if necessary'),'warn'); - } - } /* end of the foreach loop to look for preexisting items of the same code */ + if ($_SESSION['SO_AllowSameItemMultipleTimes']==0 && strcasecmp($OrderItem->StockID, $_POST['NewItem']) == 0) { + $AlreadyOnThisCredit = 1; + prnMsg($_POST['NewItem'] . ' ' . _('is already on this credit - the system will not allow the same item on the credit note more than once. However you can change the quantity credited of the existing line if necessary'),'warn'); + } + } /* end of the foreach loop to look for preexisting items of the same code */ - if ($AlreadyOnThisCredit!=1){ + if ($AlreadyOnThisCredit!=1){ - $sql = "SELECT - stockmaster.description, - stockmaster.stockid, - stockmaster.units, - stockmaster.volume, - stockmaster.kgs, - (materialcost+labourcost+overheadcost) AS standardcost, - stockmaster.mbflag, - stockmaster.decimalplaces, - stockmaster.controlled, - stockmaster.serialised, - stockmaster.discountcategory, - stockmaster.taxcatid - FROM stockmaster - WHERE stockmaster.stockid = '". $_POST['NewItem'] . "'"; + $sql = "SELECT stockmaster.description, + stockmaster.stockid, + stockmaster.units as stockunits, + stockmaster.volume, + stockmaster.kgs, + (materialcost+labourcost+overheadcost) AS standardcost, + stockmaster.mbflag, + stockmaster.decimalplaces, + stockmaster.controlled, + stockmaster.serialised, + stockmaster.discountcategory, + stockmaster.taxcatid + FROM stockmaster + WHERE stockmaster.stockid = '". $_POST['NewItem'] . "'"; $ErrMsg = _('There is a problem selecting the part because'); $result1 = DB_query($sql,$db,$ErrMsg); - if ($myrow = DB_fetch_array($result1)){ + if ($myrow = DB_fetch_array($result1)){ $LineNumber = $_SESSION['CreditItems']->LineCounter; @@ -453,7 +728,7 @@ $_SESSION['CreditItems']->DebtorNo, $_SESSION['CreditItems']->Branch, $db), 0, - $myrow['units'], + $_POST['Units'.$myrow['stockid']], $myrow['volume'], $myrow['kgs'], 0, @@ -482,9 +757,9 @@ } } - } else { + } else { prnMsg( $_POST['NewItem'] . ' ' . _('does not exist in the database and cannot therefore be added to the credit note'),'warn'); - } + } } /* end of if not already on the credit note */ } while ($i<=$_SESSION['QuickEntries']); /*loop to the next quick entry record */ unset($_POST['NewItem']); @@ -494,7 +769,7 @@ /* setup system defaults for looking up prices and the number of ordered items if an item has been selected for adding to the basket add it to the session arrays */ - if ($_SESSION['CreditItems']->ItemsOrdered > 0 OR isset($_POST['NewItem'])){ + if ($_SESSION['CreditItems']->ItemsOrdered > 0 OR isset($NewItem)){ if (isset($_GET['Delete'])){ $_SESSION['CreditItems']->remove_from_cart($_GET['Delete']); @@ -504,7 +779,7 @@ $_SESSION['CreditItems']->FreightCost = $_POST['ChargeFreightCost']; } - If (isset($_POST['Location']) AND $_POST['Location'] != $_SESSION['CreditItems']->Location){ + if (isset($_POST['Location']) AND $_POST['Location'] != $_SESSION['CreditItems']->Location){ $_SESSION['CreditItems']->Location = $_POST['Location']; @@ -540,7 +815,7 @@ $Price = $_POST['Price_' . $LineItem->LineNumber]; } - $DiscountPercentage = $_POST['Discount_' . $LineItem->LineNumber]; + $DiscountPercentage = $_POST['Discount_' . $LineItem->LineNumber]; foreach ($LineItem->Taxes as $TaxLine) { if (isset($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])){ @@ -551,7 +826,17 @@ 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%'),'warn'); } elseif (isset($_POST['Quantity_' . $LineItem->LineNumber])) { - $_SESSION['CreditItems']->update_cart_item($LineItem->LineNumber, $Quantity, $Price, $DiscountPercentage/100, $Narrative, 'No', $LineItem->ItemDue, $LineItem->POLine, 0); + $_SESSION['CreditItems']->update_cart_item($LineItem->LineNumber, + $Quantity, + $Price, + $LineItem->Units, + $LineItem->ConversionFactor, + $DiscountPercentage/100, + $Narrative, + 'No', + $LineItem->ItemDue, + $LineItem->POLine, + 0); } } @@ -563,55 +848,60 @@ } } - If (isset($_POST['NewItem'])){ + if (isset($_POST['AddToCredit'])){ /* get the item details from the database and hold them in the cart object make the quantity 1 by default then add it to the cart */ - $AlreadyOnThisCredit =0; + $AlreadyOnThisCredit =0; - foreach ($_SESSION['CreditItems']->LineItems AS $OrderItem) { + foreach ($_SESSION['CreditItems']->LineItems AS $OrderItem) { - /* do a loop round the items on the credit note to see that the item - is not already on this credit note */ + /* do a loop round the items on the credit note to see that the item + is not already on this credit note */ - if ($_SESSION['SO_AllowSameItemMultipleTimes']==0 && strcasecmp($OrderItem->StockID, $_POST['NewItem']) == 0) { - $AlreadyOnThisCredit = 1; - prnMsg(_('The item selected is already on this credit the system will not allow the same item on the credit note more than once. However you can change the quantity credited of the existing line if necessary.'),'warn'); - } - } /* end of the foreach loop to look for preexisting items of the same code */ + if ($_SESSION['SO_AllowSameItemMultipleTimes']==0 && strcasecmp($OrderItem->StockID, $_POST['NewItem']) == 0) { + $AlreadyOnThisCredit = 1; + prnMsg(_('The item selected is already on this credit the system will not allow the same item on the credit note more than once. However you can change the quantity credited of the existing line if necessary.'),'warn'); + } + } /* end of the foreach loop to look for preexisting items of the same code */ - if ($AlreadyOnThisCredit!=1){ + if ($AlreadyOnThisCredit!=1){ - $sql = "SELECT stockmaster.description, - stockmaster.stockid, - stockmaster.units, - stockmaster.volume, - stockmaster.kgs, - stockmaster.mbflag, - stockmaster.discountcategory, - stockmaster.controlled, - stockmaster.decimalplaces, - stockmaster.serialised, - (materialcost+labourcost+overheadcost) AS standardcost, - stockmaster.taxcatid - FROM stockmaster - WHERE stockmaster.stockid = '". $_POST['NewItem'] . "'"; + foreach ($NewItem_array as $key=>$value) { + $NewItem=$key; + $sql = "SELECT stockmaster.description, + stockmaster.stockid, + stockmaster.units as stockunits, + stockmaster.volume, + stockmaster.kgs, + stockmaster.mbflag, + stockmaster.discountcategory, + stockmaster.controlled, + stockmaster.decimalplaces, + stockmaster.serialised, + (materialcost+labourcost+overheadcost) AS standardcost, + stockmaster.taxcatid + FROM stockmaster + WHERE stockmaster.stockid = '". $NewItem . "'"; - $ErrMsg = _('The item details could not be retrieved because'); - $DbgMsg = _('The SQL used to retrieve the item details but failed was'); - $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); - $myrow = DB_fetch_array($result1); + $ErrMsg = _('The item details could not be retrieved because'); + $DbgMsg = _('The SQL used to retrieve the item details but failed was'); + $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); + $myrow = DB_fetch_array($result1); - $LineNumber = $_SESSION['CreditItems']->LineCounter; + $LineNumber = $_SESSION['CreditItems']->LineCounter; /*validate the data returned before adding to the items to credit */ - if ($_SESSION['CreditItems']->add_to_cart ($myrow['stockid'], - 1, + $Price=GetPrice($NewItem, + $_SESSION['CreditItems']->DebtorNo, + $_SESSION['CreditItems']->Branch, + $db); + + if ($_SESSION['CreditItems']->add_to_cart ( + $myrow['stockid'], + $value, $myrow['description'], - GetPrice($_POST['NewItem'], - $_SESSION['CreditItems']->DebtorNo, - $_SESSION['CreditItems']->Branch, - $db), + $Price[0], 0, - $myrow['units'], + $_POST['Units'.$myrow['stockid']], $myrow['volume'], $myrow['kgs'], 0, @@ -622,80 +912,85 @@ $myrow['controlled'], $myrow['serialised'], $myrow['decimalplaces'], + $Price[2], '', 'No', -1, $myrow['taxcatid'], '', '', - '', - $myrow['standardcost']) ==1){ + $myrow['standardcost'], + 1, + 0, + 1, + $Price[1]) ==1){ - $_SESSION['CreditItems']->GetTaxes($LineNumber); + $_SESSION['CreditItems']->GetTaxes($LineNumber); - if ($myrow['controlled']==1){ - /*Qty must be built up from serial item entries */ - $_SESSION['CreditItems']->LineItems[$LineNumber]->Quantity = 0; + if ($myrow['controlled']==1){ + /*Qty must be built up from serial item entries */ + $_SESSION['CreditItems']->LineItems[$LineNumber]->Quantity = 0; + } } - } - } /* end of if not already on the credit note */ - } /* end of if its a new item */ - + } /* end of if not already on the credit note */ + } /* end of if its a new item */ + } /* This is where the credit note as selected should be displayed reflecting any deletions or insertions*/ - echo '<table cellpadding=2 colspan=7 class="selection"> - <tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Gross') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> - <th>' . _('Tax Authority') . '</th> - <th>' . _('Tax') . '<br />' . _('Rate') . '</th> - <th>' . _('Tax') . '<br />' . _('Amount') . '</th> - <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> - </tr>'; + echo '<font color="red"><table cellpadding="2" colspan="7" class="selection"> + <tr> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Gross') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> + <th>' . _('Tax Authority') . '</th> + <th>' . _('Tax') . '<br />' . _('Rate') . '</th> + <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']->total = 0; + $_SESSION['CreditItems']->totalVolume = 0; + $_SESSION['CreditItems']->totalWeight = 0; - $TaxTotal = 0; - $TaxTotals = array(); - $TaxGLCodes = array(); + $TaxTotal = 0; + $TaxTotals = array(); + $TaxGLCodes = array(); - $k =0; //row colour counter - foreach ($_SESSION['CreditItems']->LineItems as $LineItem) { + $k =0; //row colour counter + foreach ($_SESSION['CreditItems']->LineItems as $LineItem) { - $LineTotal = $LineItem->Quantity * $LineItem->Price * (1 - $LineItem->DiscountPercent); - $DisplayLineTotal = number_format($LineTotal,2); + $LineTotal = $LineItem->Quantity * $LineItem->Price * (1 - $LineItem->DiscountPercent); + $DisplayLineTotal = number_format($LineTotal,$_SESSION['Currencies'][$_SESSION['CreditItems']->DefaultCurrency]['DecimalPlaces']); - if ($k==1){ + if ($k==1){ $RowStarter = '<tr class="EvenTableRows">'; $k=0; - } else { + } else { $RowStarter = '<tr class="OddTableRows">'; $k++; - } + } - echo $RowStarter . '<td>' . $LineItem->StockID . '</td> - <td>' . $LineItem->ItemDescription . '</td>'; + echo $RowStarter . '<td>' . $LineItem->StockID . '</td> + <td>' . $LineItem->ItemDescription . '</td>'; - if ($LineItem->Controlled==0){ - echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength=6 size=6 value=' . $LineItem->Quantity . '></td>'; - } else { + if ($LineItem->Controlled==0){ + echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength="6" size="6" value="' . $LineItem->Quantity . '" /></td>'; + } else { echo '<td class="number"><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LineItem->LineNumber . '">' . $LineItem->Quantity . '</a> - <input type="hidden" name="Quantity_' . $LineItem->LineNumber . '" value="' . $LineItem->Quantity . '" /></td>'; - } + <input type="hidden" name="Quantity_' . $LineItem->LineNumber . '" value="' . $LineItem->Quantity . '" /></td>'; + } echo '<td>' . $LineItem->Units . '</td> - <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 value=' . $LineItem->Price . '></td> - <td><input type="checkbox" name="Gross" value=False></td> - <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 value=' . ($LineItem->DiscountPercent * 100) . '>%</td> - <td class="number">' . $DisplayLineTotal . '</td>'; + <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size="10" maxlength="12" value="' . + number_format($LineItem->Price, $LineItem->PriceDecimals) . '" /></td> + <td><input type="checkbox" name="Gross" value="False" /></td> + <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size="3" maxlength="3" value="' . ($LineItem->DiscountPercent * 100) . '" /> %</td> + <td class="number">' . $DisplayLineTotal . '</td>'; /*Need to list the taxes applicable to this line */ @@ -721,7 +1016,7 @@ if ($i>0){ echo '<br />'; } - echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; + echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength="4" size="4" value="' . $Tax->TaxRate*100 . '" /> %'; $i++; if ($Tax->TaxOnTax ==1){ $TaxTotals[$Tax->TaxAuthID] += ($Tax->TaxRate * ($LineTotal + $TaxLineTotal)); @@ -736,8 +1031,8 @@ $TaxTotal += $TaxLineTotal; - $DisplayTaxAmount = number_format($TaxLineTotal ,2); - $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,2); + $DisplayTaxAmount = number_format($TaxLineTotal ,$_SESSION['Currencies'][$_SESSION['CreditItems']->DefaultCurrency]['DecimalPlaces']); + $DisplayGrossLineTotal = number_format($LineTotal+ $TaxLineTotal,$_SESSION['Currencies'][$_SESSION['CreditItems']->DefaultCurrency]['DecimalPlaces']); echo '<td class="number">' . $DisplayTaxAmount . '</td> <td class="number">' . $DisplayGrossLineTotal . '</td> @@ -747,7 +1042,7 @@ </tr>'; echo $RowStarter; - echo '<td colspan=11><textarea name="Narrative_' . $LineItem->LineNumber . '" cols=100% rows=1>' . $LineItem->Narrative . '</textarea><br /></td></tr>'; + echo '<td colspan="11"><textarea name="Narrative_' . $LineItem->LineNumber . '" cols="100%" rows="1">' . $LineItem->Narrative . '</textarea><br /></td></tr>'; $_SESSION['CreditItems']->total = $_SESSION['CreditItems']->total + $LineTotal; @@ -758,11 +1053,11 @@ $_POST['ChargeFreightCost']=0; } echo '<tr> - <td colspan=5></td>'; + <td colspan="5"></td>'; - echo '<td colspan=2 class="number">'. _('Credit Freight').'</td> - <td><input type="text" class="number" size=6 maxlength=6 name=ChargeFreightCost value=' . $_SESSION['CreditItems']->FreightCost . '></td>'; + echo '<td colspan="2" class="number">'. _('Credit Freight').'</td> + <td><input type="text" class="number" size="6" maxlength="6" name="ChargeFreightCost" value="' . $_SESSION['CreditItems']->FreightCost . '" /></td>'; $FreightTaxTotal =0; //initialise tax total @@ -785,7 +1080,7 @@ echo '<br />'; } - echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength=4 size=4 value=' . $FreightTaxLine->TaxRate * 100 . '>'; + 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)); @@ -799,38 +1094,51 @@ } echo '</td>'; - echo '<td class="number">' . number_format($FreightTaxTotal,2) . '</td> - <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost,2) . '</td> + echo '<td class="number">' . number_format($FreightTaxTotal, $_SESSION['Currencies'][$_SESSION['CreditItems']->DefaultCurrency]['DecimalPlaces']) . '</td> + <td class="number">' . number_format($FreightTaxTotal+ $_SESSION['CreditItems']->FreightCost, $_SESSION['Currencies'][$_SESSION['CreditItems']->DefaultCurrency]['DecimalPlaces']) . '</td> </tr>'; $TaxTotal += $FreightTaxTotal; - $DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost,2); + $DisplayTotal = number_format($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost, $_SESSION['Currencies'][$_SESSION['CreditItems']->DefaultCurrency]['DecimalPlaces']); echo '<tr> - <td colspan=7 class="number">' . _('Credit Totals') . '</td> + <td colspan="7" class="number">' . _('Credit Totals') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> - <td colspan=2></td> - <td class="number"><b>' . number_format($TaxTotal,2) . '</td> - <td class="number"><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost),2) . '</b></td> - </tr></table>'; + <td colspan="2"></td> + <td class="number"><b>' . number_format($TaxTotal, $_SESSION['Currencies'][$_SESSION['CreditItems']->DefaultCurrency]['DecimalPlaces']) . '</b></td> + <td class="number"><b>' . number_format($TaxTotal+($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost), $_SESSION['Currencies'][$_SESSION['CreditItems']->DefaultCurrency]['DecimalPlaces']) . '</b></td> + </tr></table></font>'; + $_SESSION['CreditItems']->TaxTotal=$TaxTotal; + $_SESSION['CreditItems']->TaxTotals=$TaxTotals; + $_SESSION['CreditItems']->TaxGLCodes=$TaxGLCodes; - /*Now show options for the credit note */ - echo '<br /><table class="selection"><tr><td>' . _('Credit Note Type') . ' :</td><td><... [truncated message content] |
From: <tim...@us...> - 2011-07-20 19:10:49
|
Revision: 6793 http://weberp.svn.sourceforge.net/weberp/?rev=6793&view=rev Author: tim_schofield Date: 2011-07-20 19:10:43 +0000 (Wed, 20 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/GLTrialBalance.php trunk/Z_RePostGLFromPeriod.php Modified: trunk/GLTrialBalance.php =================================================================== --- trunk/GLTrialBalance.php 2011-07-20 18:25:05 UTC (rev 6792) +++ trunk/GLTrialBalance.php 2011-07-20 19:10:43 UTC (rev 6793) @@ -23,7 +23,7 @@ include ('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Trial Balance') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (Date('m') > $_SESSION['YearEnd']){ @@ -37,7 +37,7 @@ $period=GetPeriod($FromDate, $db); /*Show a form to allow input of criteria for TB to show */ - echo '<table class="selection"><tr><td>' . _('Select Period From:') . '</td><td><select Name="FromPeriod">'; + echo '<table class="selection"><tr><td>' . _('Select Period From:') . '</td><td><select name="FromPeriod">'; $nextYear = date('Y-m-d',strtotime('+1 Year')); $sql = "SELECT periodno, lastdate_in_period @@ -50,13 +50,13 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ - echo '<option selected value="' . $myrow['periodno'] . '">' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected="True" value="' . $myrow['periodno'] . '">' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } else { if($myrow['lastdate_in_period']==$DefaultFromDate){ - echo '<option selected value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected="True" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } @@ -77,22 +77,22 @@ $DefaultToPeriod = $_POST['ToPeriod']; } - echo '<tr><td>' . _('Select Period To:') .'</td><td><select Name="ToPeriod">'; + echo '<tr><td>' . _('Select Period To:') .'</td><td><select name="ToPeriod">'; $RetResult = DB_data_seek($Periods,0); while ($myrow=DB_fetch_array($Periods,$db)){ if($myrow['periodno']==$DefaultToPeriod){ - echo '<option selected value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected="True" value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { echo '<option value ="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr></table><br />'; - echo '<div class="centre"><input type="submit" Name="ShowTB" Value="' . _('Show Trial Balance') .'">'; - echo '<input type="submit" Name="PrintPDF" Value="'._('PrintPDF').'"></div>'; + echo '<div class="centre"><input type="submit" name="ShowTB" value="' . _('Show Trial Balance') .'" />'; + echo '<input type="submit" name="PrintPDF" value="'._('PrintPDF').'" /></div>'; /*Now do the posting while the user is thinking about the period to select */ @@ -380,9 +380,10 @@ } else { include('includes/header.inc'); - echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '"><input type="hidden" name="ToPeriod" value="' . $_POST['ToPeriod'] . '" />'; + echo '<input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '" /> + <input type="hidden" name="ToPeriod" value="' . $_POST['ToPeriod'] . '" />'; $NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1; @@ -431,8 +432,8 @@ /*show a table of the accounts info returned by the SQL Account Code , Account Name , Month Actual, Month Budget, Period Actual, Period Budget */ - echo '<table cellpadding=2 class="selection">'; - echo '<tr><th colspan=6><font size=3 color=blue><b>'. _('Trial Balance for the month of ') . $PeriodToDate . + echo '<table cellpadding="2" class="selection">'; + echo '<tr><th colspan="6"><font size="3" color="blue"><b>'. _('Trial Balance for the month of ') . $PeriodToDate . _(' and for the ') . $NumberOfMonths . _(' months to ') . $PeriodToDate .'</b></font></th></tr>'; $TableHeader = '<tr> <th>' . _('Account') . '</th> @@ -478,7 +479,7 @@ $ParentGroups[$Level]=''; } elseif ($ParentGroups[$Level]==$myrow['parentgroupname']) { printf('<tr> - <td colspan=2><font size=2><I>%s ' . _('Total') . ' </I></font></td> + <td colspan="2"><font size="2"><I>%s ' . _('Total') . ' </I></font></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> @@ -498,7 +499,7 @@ } else { do { printf('<tr> - <td colspan=2><font size=2><I>%s ' . _('Total') . ' </I></font></td> + <td colspan="2"><font size="2"><I>%s ' . _('Total') . ' </I></font></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> @@ -522,7 +523,7 @@ if ($Level>0){ printf('<tr> - <td colspan=2><font size=2><I>%s ' . _('Total') . ' </I></font></td> + <td colspan="2"><font size="2"><I>%s ' . _('Total') . ' </I></font></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> @@ -547,7 +548,7 @@ $ParentGroups[$Level]=$myrow['groupname']; $ActGrp = $myrow['groupname']; printf('<tr> - <td colspan=6><font size=4 color=blue><b>%s</b></font></td> + <td colspan="6"><font size="4" color="blue"><b>%s</b></font></td> </tr>', $myrow['groupname']); echo $TableHeader; @@ -599,7 +600,7 @@ $CheckPeriodActual += $AccountPeriodActual; $CheckPeriodBudget += $AccountPeriodBudget; - $ActEnquiryURL = '<a href="'. $rootpath . '/GLAccountInquiry.php?Period=' . $_POST['ToPeriod'] . '&Account=' . $myrow['accountcode'] . '&Show=Yes">' . $myrow['accountcode'] . '<a>'; + $ActEnquiryURL = '<a href="'. $rootpath . '/GLAccountInquiry.php?Period=' . $_POST['ToPeriod'] . '&Account=' . $myrow['accountcode'] . '&Show=Yes">' . $myrow['accountcode'] . '</a>'; printf('<td>%s</td> <td>%s</td> @@ -609,7 +610,7 @@ <td class="number">%s</td> </tr>', $ActEnquiryURL, - $myrow['accountname'], + htmlspecialchars($myrow['accountname']), number_format($myrow['monthactual'],2), number_format($myrow['monthbudget'],2), number_format($AccountPeriodActual,2), @@ -626,7 +627,7 @@ $ParentGroups[$Level]=$myrow['groupname']; } elseif ($ParentGroups[$Level]==$myrow['parentgroupname']) { printf('<tr> - <td colspan=2><font size=2><I>%s ' . _('Total') . ' </I></font></td> + <td colspan="2"><font size="2"><i>%s ' . _('Total') . ' </i></font></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> @@ -646,7 +647,7 @@ } else { do { printf('<tr> - <td colspan=2><font size=2><I>%s ' . _('Total') . ' </I></font></td> + <td colspan="2"><font size="2"><i>%s ' . _('Total') . ' </i></font></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> @@ -670,7 +671,7 @@ if ($Level >0){ printf('<tr> - <td colspan=2><font size=2><I>%s ' . _('Total') . ' </I></font></td> + <td colspan="2"><font size="2"><I>%s ' . _('Total') . ' </I></font></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> <td class="number"><I>%s</I></td> @@ -696,7 +697,7 @@ printf('<tr bgcolor="#ffffff"> - <td colspan=2><font color=BLUE><b>' . _('Check Totals') . '</b></font></td> + <td colspan="2"><font color="blue"><b>' . _('Check Totals') . '</b></font></td> <td class="number">%s</td> <td class="number">%s</td> <td class="number">%s</td> Modified: trunk/Z_RePostGLFromPeriod.php =================================================================== --- trunk/Z_RePostGLFromPeriod.php 2011-07-20 18:25:05 UTC (rev 6792) +++ trunk/Z_RePostGLFromPeriod.php 2011-07-20 19:10:43 UTC (rev 6793) @@ -15,7 +15,7 @@ echo '<table> <tr> <td>' . _('Select Period From') . ':</td> - <td><select Name="FromPeriod">'; + <td><select name="FromPeriod">'; $sql = "SELECT periodno, lastdate_in_period This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-21 16:20:06
|
Revision: 6823 http://weberp.svn.sourceforge.net/weberp/?rev=6823&view=rev Author: tim_schofield Date: 2011-07-21 16:20:00 +0000 (Thu, 21 Jul 2011) Log Message: ----------- Changes to coding layout Modified Paths: -------------- trunk/CustomerTransInquiry.php trunk/GLTagProfit_Loss.php Modified: trunk/CustomerTransInquiry.php =================================================================== --- trunk/CustomerTransInquiry.php 2011-07-21 16:19:47 UTC (rev 6822) +++ trunk/CustomerTransInquiry.php 2011-07-21 16:20:00 UTC (rev 6823) @@ -121,7 +121,7 @@ if ($_POST['TransType']==10){ /* invoices */ printf($format_base.' - <td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice"><img src='%s' title="' . _('Click to preview the invoice') . '"></a></td> + <td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice"><img src="%s" title="' . _('Click to preview the invoice') . '"></a></td> </tr>', $myrow['typename'], $myrow['transno'], @@ -139,7 +139,7 @@ $rootpath.'/css/'.$theme.'/images/preview.gif'); } elseif ($_POST['TransType']==11){ /* credit notes */ printf($format_base.' - <td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit"><img src='%s' title="' . _('Click to preview the credit') . '"></a></td> + <td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit"><img src="%s" title="' . _('Click to preview the credit') . '"></a></td> </tr>', $myrow['typename'], $myrow['transno'], Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2011-07-21 16:19:47 UTC (rev 6822) +++ trunk/GLTagProfit_Loss.php 2011-07-21 16:20:00 UTC (rev 6823) @@ -34,22 +34,25 @@ /*Show a form to allow input of criteria for profit and loss to show */ echo '<table class="selection"><tr><td>' . _('Select Period From') . ':</td><td><select name="FromPeriod">'; - $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; + $sql = "SELECT periodno, + lastdate_in_period + FROM periods + ORDER BY periodno DESC"; $Periods = DB_query($sql,$db); while ($myrow=DB_fetch_array($Periods,$db)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ - echo '<option selected value=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']). '</option>'; + echo '<option selected value="' . $myrow['periodno'] . '">' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']). '</option>'; } else { - echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']). '</option>'; + echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']). '</option>'; } } else { if($myrow['lastdate_in_period']==$DefaultFromDate){ - echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']). '</option>'; + echo '<option selected value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']). '</option>'; } else { - echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']). '</option>'; + echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']). '</option>'; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-21 16:20:58
|
Revision: 6827 http://weberp.svn.sourceforge.net/weberp/?rev=6827&view=rev Author: tim_schofield Date: 2011-07-21 16:20:52 +0000 (Thu, 21 Jul 2011) Log Message: ----------- Changes to coding layout Modified Paths: -------------- trunk/Currencies.php trunk/includes/MiscFunctions.php Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-21 16:20:40 UTC (rev 6826) +++ trunk/Currencies.php 2011-07-21 16:20:52 UTC (rev 6827) @@ -7,6 +7,7 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); +include('includes/CurrenciesArray.php'); if (isset($_GET['SelectedCurrency'])){ $SelectedCurrency = $_GET['SelectedCurrency']; @@ -67,12 +68,6 @@ $Errors[$i] = 'DecimalPlaces'; $i++; } - if (mb_strlen($_POST['CurrencyName']) > 20) { - $InputError = 1; - prnMsg(_('The currency name must be 20 characters or less long'),'error'); - $Errors[$i] = 'CurrencyName'; - $i++; - } if (mb_strlen($_POST['Country']) > 50) { $InputError = 1; prnMsg(_('The currency country must be 50 characters or less long'),'error'); @@ -100,7 +95,7 @@ /*SelectedCurrency could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ $sql = "UPDATE currencies SET - currency='" . $_POST['CurrencyName'] . "', + currency='" . $CurrenciesArray[$SelectedCurrency] . "', country='". $_POST['Country']. "', hundredsname='" . $_POST['HundredsName'] . "', decimalplaces='" . $_POST['DecimalPlaces'] . "', @@ -117,12 +112,13 @@ hundredsname, decimalplaces, rate) - VALUES ('" . $_POST['CurrencyName'] . "', - '" . $_POST['Abbreviation'] . "', - '" . $_POST['Country'] . "', - '" . $_POST['HundredsName'] . "', - '" . $_POST['DecimalPlaces'] . "', - '" . $_POST['ExchangeRate'] . "')"; + VALUES ('" . $CurrenciesArray[$_POST['Abbreviation']] . "', + '" . $_POST['Abbreviation'] . "', + '" . $_POST['Country'] . "', + '" . $_POST['HundredsName'] . "', + '" . $_POST['DecimalPlaces'] . "', + '" . $_POST['ExchangeRate'] . "' + )"; $msg = _('The currency definition record has been added'); } @@ -195,7 +191,7 @@ FROM currencies"; $result = DB_query($sql, $db); - echo '<table class="selection">'; + echo '<br /><table class="selection">'; echo '<tr><td></td> <th>' . _('ISO4217 Code') . '</th> <th>' . _('Currency Name') . '</th> @@ -241,7 +237,7 @@ <td class="number">%s</td> <td class="number">%s</td> <td><a href="%s&SelectedCurrency=%s">%s</a></td> - <td><a href="%s&SelectedCurrency=%sdelete=1">%s</a></td> + <td><a href="%s&SelectedCurrency=%s&delete=1">%s</a></td> <td><a href="%s/ExchangeRateTrend.php?%s">' . _('Graph') . '</a></td> </tr>', $ImageFile, @@ -333,14 +329,13 @@ if (!isset($_POST['Abbreviation'])) {$_POST['Abbreviation']='';} echo '<table class="selection"><tr> <td>' ._('Currency Abbreviation') . ':</td> - <td><input ' . (in_array('Abbreviation',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Abbreviation" value="' . $_POST['Abbreviation'] . '" size=4 maxlength=3></td></tr>'; + <td><select name="Abbreviation">'; + foreach ($CurrenciesArray as $Abbreviation=>$CurrencyName) { + echo '<option value="'.$Abbreviation.'">'.$CurrencyName.'</option>'; + } + echo '</select></td></tr>'; } - echo '<tr><td>'._('Currency Name').':</td>'; - echo '<td>'; - if (!isset($_POST['CurrencyName'])) {$_POST['CurrencyName']='';} - echo '<input ' . (in_array('CurrencyName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="CurrencyName" size=20 maxlength=20 value="' . $_POST['CurrencyName'] . '">'; - echo '</td></tr>'; echo '<tr><td>'._('Country').':</td>'; echo '<td>'; if (!isset($_POST['Country'])) {$_POST['Country']='';} Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-07-21 16:20:40 UTC (rev 6826) +++ trunk/includes/MiscFunctions.php 2011-07-21 16:20:52 UTC (rev 6827) @@ -152,7 +152,7 @@ $stack = array(); foreach ($tags as $tag) { $index = count($elements); - if ($tag['type'] == 'complete' OR $tag['type'] == 'open') { + if (isset($tag['attributes']) and ($tag['type'] == 'complete' OR $tag['type'] == 'open')) { $elements[$index] = new XmlElement; $elements[$index]->name = $tag['tag']; $elements[$index]->attributes = $tag['attributes']; @@ -173,8 +173,10 @@ $Currencies = array(); - foreach ($elements[0]->children[2]->children[0]->children as $CurrencyDetails){ - $Currencies[$CurrencyDetails->attributes['currency']]= $CurrencyDetails->attributes['rate'] ; + if (isset($elements)) { + foreach ($elements[0]->children[2]->children[0]->children as $CurrencyDetails){ + $Currencies[$CurrencyDetails->attributes['currency']]= $CurrencyDetails->attributes['rate'] ; + } } $Currencies['EUR']=1; //ECB delivers no rate for Euro //return an array of the currencies and rates This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-21 16:22:18
|
Revision: 6830 http://weberp.svn.sourceforge.net/weberp/?rev=6830&view=rev Author: tim_schofield Date: 2011-07-21 16:22:09 +0000 (Thu, 21 Jul 2011) Log Message: ----------- Replace all occurencies of strstr() with mb_strstr() Modified Paths: -------------- trunk/CounterSales.php trunk/Currencies.php trunk/CustLoginSetup.php trunk/CustomerBranches.php trunk/SelectCreditItems.php trunk/SelectOrderItems.php trunk/StockSerialItemResearch.php trunk/Stocks.php trunk/SuppLoginSetup.php trunk/SystemParameters.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/WorkCentres.php trunk/Z_ImportStocks.php trunk/Z_MakeNewCompany.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/api/api_debtortransactions.php trunk/api/api_salesorders.php trunk/api/api_stock.php trunk/api/api_suppliers.php trunk/api/api_workorders.php trunk/build/tests/PurchasingTest.php trunk/build/tests/includes/SelectModule.php trunk/includes/MiscFunctions.php trunk/install/save.php Property Changed: ---------------- trunk/build/tests/PurchasingTest.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/CounterSales.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -33,7 +33,7 @@ if (isset($_POST['OrderItems'])){ foreach ($_POST as $key => $value) { - if (strstr($key,'StockID')) { + if (mb_strstr($key,'StockID')) { $Index=substr($key,7); $StockID=$value; $Quantity=$_POST['Quantity'.$Index]; Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/Currencies.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -84,7 +84,7 @@ $InputError = 1; prnMsg(_('The functional currency cannot be modified or deleted'),'error'); } - if (strstr($_POST['Abbreviation'],"'") OR strstr($_POST['Abbreviation'],'+') OR strstr($_POST['Abbreviation'],"\"") OR strstr($_POST['Abbreviation'],'&') OR strstr($_POST['Abbreviation'],' ') OR strstr($_POST['Abbreviation'],"\\") OR strstr($_POST['Abbreviation'],'.') OR strstr($_POST['Abbreviation'],'"')) { + if (mb_strstr($_POST['Abbreviation'],"'") OR mb_strstr($_POST['Abbreviation'],'+') OR mb_strstr($_POST['Abbreviation'],"\"") OR mb_strstr($_POST['Abbreviation'],'&') OR mb_strstr($_POST['Abbreviation'],' ') OR mb_strstr($_POST['Abbreviation'],"\\") OR mb_strstr($_POST['Abbreviation'],'.') OR mb_strstr($_POST['Abbreviation'],'"')) { $InputError = 1; prnMsg( _('The currency code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'Abbreviation'; Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/CustLoginSetup.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -76,7 +76,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/CustomerBranches.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -50,7 +50,7 @@ $_POST['BranchCode'] = mb_strtoupper($_POST['BranchCode']); - if (ContainsIllegalCharacters($_POST['BranchCode']) OR strstr($_POST['BranchCode'],' ')) { + if (ContainsIllegalCharacters($_POST['BranchCode']) OR mb_strstr($_POST['BranchCode'],' ')) { $InputError = 1; prnMsg(_('The Branch code cannot contain a space or any of the illegal characters'),'error'); $Errors[$i] = 'BranchCode'; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/SelectCreditItems.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -35,7 +35,7 @@ if (isset($_POST['AddToCredit'])){ foreach ($_POST as $key => $value) { - if (strstr($key,'StockID')) { + if (mb_strstr($key,'StockID')) { $Index=mb_substr($key, 7); $StockID=$value; if ($_POST['Quantity'.$Index]!=0) { Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/SelectOrderItems.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -24,7 +24,7 @@ if (isset($_POST['order_items'])){ foreach ($_POST as $key => $value) { - if (strstr($key,'StockID')) { + if (mb_strstr($key,'StockID')) { $Index=mb_substr($key, 7); $StockID=$value; $NewItem_array[$StockID] = $_POST['Quantity'.$Index]; Modified: trunk/StockSerialItemResearch.php =================================================================== --- trunk/StockSerialItemResearch.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/StockSerialItemResearch.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -35,8 +35,8 @@ if ($SN!='') { //the point here is to allow a semi fuzzy search, but still keep someone from killing the db server - if (strstr($SN,'%')){ - while(strstr($SN,'%%')) { + if (mb_strstr($SN,'%')){ + while(mb_strstr($SN,'%%')) { $SN = str_replace('%%','%',$SN); } if (mb_strlen($SN) < 11){ Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/Stocks.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -103,7 +103,7 @@ $Errors[$i] = 'StockID'; $i++; } - if (ContainsIllegalCharacters($StockID) OR strstr($StockID,' ')) { + if (ContainsIllegalCharacters($StockID) OR mb_strstr($StockID,' ')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the illegal characters') ,'error'); $Errors[$i] = 'StockID'; Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/SuppLoginSetup.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -64,7 +64,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } Modified: trunk/SystemParameters.php =================================================================== --- trunk/SystemParameters.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/SystemParameters.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -33,7 +33,7 @@ } elseif (mb_strlen($_POST['X_DefaultCreditLimit']) > 12 || !is_numeric($_POST['X_DefaultCreditLimit']) ) { $InputError = 1; prnMsg(_('Default Credit Limit must be a number'),'error'); - } elseif (strstr($_POST['X_RomalpaClause'], "'") || mb_strlen($_POST['X_RomalpaClause']) > 5000) { + } elseif (mb_strstr($_POST['X_RomalpaClause'], "'") || mb_strlen($_POST['X_RomalpaClause']) > 5000) { $InputError = 1; prnMsg(_('The Romalpa Clause may not contain single quotes and may not be longer than 5000 chars'),'error'); } elseif (mb_strlen($_POST['X_QuickEntries']) > 2 || !is_numeric($_POST['X_QuickEntries']) || Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/UpgradeDatabase.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -122,7 +122,7 @@ if (mb_substr($SQLEntries[$i], 0, 2) != '--' AND mb_substr($SQLEntries[$i], 0, 3) != 'USE' - AND strstr($SQLEntries[$i],'/*')==FALSE + AND mb_strstr($SQLEntries[$i],'/*')==FALSE AND mb_strlen($SQLEntries[$i])>1){ $sql .= ' ' . $SQLEntries[$i]; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/WWW_Users.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -70,7 +70,7 @@ $InputError = 1; prnMsg(_('The password entered must be at least 5 characters long'),'error'); } - } elseif (strstr($_POST['Password'],$_POST['UserID'])!= False){ + } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/WorkCentres.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -29,7 +29,7 @@ $InputError = 1; prnMsg(_('The Work Centre description must be at least 3 characters long'),'error'); } - if (strstr($_POST['Code'],' ') OR strstr($_POST['Code'],"'") OR strstr($_POST['Code'],'+') OR strstr($_POST['Code'],"\\") OR strstr($_POST['Code'],"\"") OR strstr($_POST['Code'],'&') OR strstr($_POST['Code'],'.') OR strstr($_POST['Code'],'"')) { + if (mb_strstr($_POST['Code'],' ') OR mb_strstr($_POST['Code'],"'") OR mb_strstr($_POST['Code'],'+') OR mb_strstr($_POST['Code'],"\\") OR mb_strstr($_POST['Code'],"\"") OR mb_strstr($_POST['Code'],'&') OR mb_strstr($_POST['Code'],'.') OR mb_strstr($_POST['Code'],'"')) { $InputError = 1; prnMsg(_('The work centre code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); } Modified: trunk/Z_ImportStocks.php =================================================================== --- trunk/Z_ImportStocks.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/Z_ImportStocks.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -119,7 +119,7 @@ $InputError = 1; prnMsg (_('The Stock Item code cannot be empty'),'error'); } - if (strstr($StockID,' ') OR strstr($StockID,"'") OR strstr($StockID,'+') OR strstr($StockID,"\\") OR strstr($StockID,"\"") OR strstr($StockID,'&') OR strstr($StockID,'"')) { + if (mb_strstr($StockID,' ') OR mb_strstr($StockID,"'") OR mb_strstr($StockID,'+') OR mb_strstr($StockID,"\\") OR mb_strstr($StockID,"\"") OR mb_strstr($StockID,'&') OR mb_strstr($StockID,'"')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " ' & + \" \\ " . _('or a space'). " (". $StockID. ")",'error'); $StockID=''; Modified: trunk/Z_MakeNewCompany.php =================================================================== --- trunk/Z_MakeNewCompany.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/Z_MakeNewCompany.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -104,7 +104,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.04-3.05.php =================================================================== --- trunk/Z_Upgrade_3.04-3.05.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/Z_Upgrade_3.04-3.05.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -35,7 +35,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.05-3.06.php =================================================================== --- trunk/Z_Upgrade_3.05-3.06.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/Z_Upgrade_3.05-3.06.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -27,7 +27,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.07-3.08.php =================================================================== --- trunk/Z_Upgrade_3.07-3.08.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/Z_Upgrade_3.07-3.08.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -27,7 +27,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.08-3.09.php =================================================================== --- trunk/Z_Upgrade_3.08-3.09.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/Z_Upgrade_3.08-3.09.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -27,7 +27,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.09-3.10.php =================================================================== --- trunk/Z_Upgrade_3.09-3.10.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/Z_Upgrade_3.09-3.10.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -27,7 +27,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.10-3.11.php =================================================================== --- trunk/Z_Upgrade_3.10-3.11.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/Z_Upgrade_3.10-3.11.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -37,7 +37,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $sql .= ' ' . $SQLScriptFile[$i]; Modified: trunk/Z_Upgrade_3.11-4.00.php =================================================================== --- trunk/Z_Upgrade_3.11-4.00.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/Z_Upgrade_3.11-4.00.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -37,7 +37,7 @@ if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' AND mb_substr($SQLScriptFile[$i], 0, 3) != 'USE' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + AND mb_strstr($SQLScriptFile[$i],'/*')==FALSE AND mb_strlen($SQLScriptFile[$i])>1){ $sql .= ' ' . $SQLScriptFile[$i]; Modified: trunk/api/api_debtortransactions.php =================================================================== --- trunk/api/api_debtortransactions.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/api/api_debtortransactions.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -87,9 +87,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_salesorders.php =================================================================== --- trunk/api/api_salesorders.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/api/api_salesorders.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -43,9 +43,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($orddate,"/")) { + if (mb_strstr($orddate,"/")) { $DateArray = explode('/',$orddate); - } elseif (strstr($orddate,".")) { + } elseif (mb_strstr($orddate,".")) { $DateArray = explode('.',$orddate); } if ($DateFormat=='d/m/Y') { @@ -121,9 +121,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($deliverydate,'/')) { + if (mb_strstr($deliverydate,'/')) { $DateArray = explode('/',$deliverydate); - } elseif (strstr($PeriodEnd,'.')) { + } elseif (mb_strstr($PeriodEnd,'.')) { $DateArray = explode('.',$deliverydate); } if ($DateFormat=='d/m/Y') { @@ -231,9 +231,9 @@ $result=api_DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr($itemdue,'/')) { + if (mb_strstr($itemdue,'/')) { $DateArray = explode('/',$itemdue); - } elseif (strstr($itemdue,'.')) { + } elseif (mb_strstr($itemdue,'.')) { $DateArray = explode('.',$itemdue); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/api/api_stock.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -79,9 +79,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_suppliers.php =================================================================== --- trunk/api/api_suppliers.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/api/api_suppliers.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -51,9 +51,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Modified: trunk/api/api_workorders.php =================================================================== --- trunk/api/api_workorders.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/api/api_workorders.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -48,9 +48,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { @@ -81,9 +81,9 @@ $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $DateFormat=$myrow[0]; - if (strstr('/',$PeriodEnd)) { + if (mb_strstr('/',$PeriodEnd)) { $Date_Array = explode('/',$PeriodEnd); - } elseif (strstr('.',$PeriodEnd)) { + } elseif (mb_strstr('.',$PeriodEnd)) { $Date_Array = explode('.',$PeriodEnd); } if ($DateFormat=='d/m/Y') { Property changes on: trunk/build/tests/PurchasingTest.php ___________________________________________________________________ Deleted: svn:executable - * Modified: trunk/build/tests/includes/SelectModule.php =================================================================== --- trunk/build/tests/includes/SelectModule.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/build/tests/includes/SelectModule.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -1,6 +1,6 @@ <?php -$ModuleID=mb_substr(strstr($result, $ModuleName, true),-4,2); +$ModuleID=mb_substr(mb_strstr($result, $ModuleName, true),-4,2); $url=$RootPath.'index.php?Application='.$ModuleID; include('GetURL.php'); Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/includes/MiscFunctions.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -108,12 +108,12 @@ function ContainsIllegalCharacters ($CheckVariable) { - if (strstr($CheckVariable,"'") - OR strstr($CheckVariable,'+') - OR strstr($CheckVariable,"\"") - OR strstr($CheckVariable,'&') - OR strstr($CheckVariable,"\\") - OR strstr($CheckVariable,'"')){ + if (mb_strstr($CheckVariable,"'") + OR mb_strstr($CheckVariable,'+') + OR mb_strstr($CheckVariable,"\"") + OR mb_strstr($CheckVariable,'&') + OR mb_strstr($CheckVariable,"\\") + OR mb_strstr($CheckVariable,'"')){ return true; } else { Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-07-21 16:21:14 UTC (rev 6829) +++ trunk/install/save.php 2011-07-21 16:22:09 UTC (rev 6830) @@ -293,7 +293,7 @@ $SQLScriptFile[$i] = trim($SQLScriptFile[$i]); //ignore lines that start with -- or USE or /* if (mb_substr($SQLScriptFile[$i], 0, 2) != '--' - OR strstr($SQLScriptFile[$i],'/*')==FALSE + OR mb_strstr($SQLScriptFile[$i],'/*')==FALSE OR mb_strlen($SQLScriptFile[$i])>1){ $SQL .= ' ' . $SQLScriptFile[$i]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-21 16:22:41
|
Revision: 6832 http://weberp.svn.sourceforge.net/weberp/?rev=6832&view=rev Author: tim_schofield Date: 2011-07-21 16:22:34 +0000 (Thu, 21 Jul 2011) Log Message: ----------- Changes to coding layout Modified Paths: -------------- trunk/Prices_Customer.php trunk/SelectOrderItems.php Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-07-21 16:22:21 UTC (rev 6831) +++ trunk/Prices_Customer.php 2011-07-21 16:22:34 UTC (rev 6832) @@ -145,18 +145,19 @@ branchcode, startdate, enddate) - valueS ('".$Item."', - '".$SalesType."', - '".$CurrCode."', - '" . $_SESSION['CustomerID'] . "', - '" . $_POST['Price'] . "', - '" . $_POST['Units'] . "', - '" . $_POST['ConversionFactor'] . "', - '" . $_POST['DecimalPlaces'] . "', - '" . $_POST['Branch'] . "', - '" . FormatDateForSQL($_POST['StartDate']) . "', - '" . FormatDateForSQL($_POST['EndDate']) . "' - )"; + VALUES ( + '".$Item."', + '".$SalesType."', + '".$CurrCode."', + '" . $_SESSION['CustomerID'] . "', + '" . $_POST['Price'] . "', + '" . $_POST['Units'] . "', + '" . $_POST['ConversionFactor'] . "', + '" . $_POST['DecimalPlaces'] . "', + '" . $_POST['Branch'] . "', + '" . FormatDateForSQL($_POST['StartDate']) . "', + '" . FormatDateForSQL($_POST['EndDate']) . "' + )"; $msg = _('Price added') . '.'; } //run the SQL from either of the above possibilites @@ -168,7 +169,7 @@ } else { $msg = _('The price could not be added because') . ' - ' . DB_error_msg($db); } - }else { + } else { ReSequenceEffectiveDates ($Item, $SalesType, $CurrCode, $_SESSION['CustomerID'], $db); unset($_POST['EndDate']); unset($_POST['StartDate']); @@ -209,20 +210,20 @@ prices.typeabbrev, prices.startdate, prices.enddate - FROM prices - WHERE prices.stockid='" . $Item . "' - AND prices.typeabbrev='". $SalesType ."' - AND prices.currabrev ='". $CurrCode ."' - AND prices.debtorno='' - ORDER BY currabrev, - typeabbrev, - startdate"; + FROM prices + WHERE prices.stockid='" . $Item . "' + AND prices.typeabbrev='". $SalesType ."' + AND prices.currabrev ='". $CurrCode ."' + AND prices.debtorno='' + ORDER BY currabrev, + typeabbrev, + startdate"; $ErrMsg = _('Could not retrieve the normal prices set up because'); $DbgMsg = _('The SQL used to retrieve these records was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); -echo '<table><tr><td valign=top>'; +echo '<table><tr><td valign="top">'; echo '<table class="selection">'; if (DB_num_rows($result) == 0) { @@ -310,20 +311,21 @@ $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } echo '<tr bgcolor="#CCCCCC"> - <td class="number">'.number_format($myrow['price'],2).'</td> - <td>'.$Branch.'</td> - <td>'.$myrow['units'].'</td> - <td class="number">'.$myrow['conversionfactor'].'</td> - <td class="number">'.$myrow['decimalplaces'].'</td> - <td>'.ConvertSQLDate($myrow['startdate']).'</td> - <td>'.$EndDateDisplay.'</td> - <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Price='.$myrow['price'].'&Branch='.$myrow['branchcode'].'&StartDate='.$myrow['startdate'].'&EndDate='.$myrow['enddate'].'&Edit=1">' . _('Edit') . '</td> - <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Branch='.$myrow['branchcode'].'&StartDate='.$myrow['startdate'].'&EndDate='.$myrow['enddate'].'&delete=yes">' . _('Delete') . '</td></tr>'; + <td class="number">'.number_format($myrow['price'],2).'</td> + <td>'.$Branch.'</td> + <td>'.$myrow['units'].'</td> + <td class="number">'.$myrow['conversionfactor'].'</td> + <td class="number">'.$myrow['decimalplaces'].'</td> + <td>'.ConvertSQLDate($myrow['startdate']).'</td> + <td>'.$EndDateDisplay.'</td> + <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Price='.$myrow['price'].'&Branch='.$myrow['branchcode'].'&StartDate='.$myrow['startdate'].'&EndDate='.$myrow['enddate'].'&Edit=1">' . _('Edit') . '</a></td> + <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Branch='.$myrow['branchcode'].'&StartDate='.$myrow['startdate'].'&EndDate='.$myrow['enddate'].'&delete=yes">' . _('Delete') . '</a></td> + </tr>'; } //END WHILE LIST LOOP } -echo '</table></tr></table><br />'; +echo '</table></td></tr></table><br />'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -410,12 +412,12 @@ while ($myrow=DB_fetch_array($result)) { $CustomerCurrency=$myrow['currency']; if ($myrow['branchcode']==$_POST['branch']) { - echo '<option selected value="'.$myrow['branchcode'].'">'.$myrow['brname'].'</option>'; + echo '<option selected="True" value="'.$myrow['branchcode'].'">'.$myrow['brname'].'</option>'; } else { echo '<option value="'.$myrow['branchcode'].'">'.$myrow['brname'].'</option>'; } } -echo '</td></tr>'; +echo '</select></td></tr>'; echo '<tr><td>' . _('Currency') .':</td><td>' . $CustomerCurrency.'</td></tr>'; echo '<tr><td>' . _('Price Effective From Date') . ':</td> <td><input type="text" name="StartDate" class="date" alt="'.$_SESSION['DefaultDateFormat']. @@ -429,18 +431,16 @@ $result = DB_query($sql, $db); while ($myrow = DB_fetch_array($result)) { if ($_POST['Units'] == $myrow['unitname']) { - echo '<option selected value="' . $myrow['unitname'] . '">' . $myrow['unitname'] . '</option>'; + echo '<option selected="True" value="' . $myrow['unitname'] . '">' . $myrow['unitname'] . '</option>'; } else if ($DefaultUOM == $myrow['unitname'] and ($_POST['Units'] != $myrow['unitname'])) { - echo '<option selected value="' . $myrow['unitname'] . '">' . $myrow['unitname'] . '</option>'; + echo '<option selected="True" value="' . $myrow['unitname'] . '">' . $myrow['unitname'] . '</option>'; } else { echo '<option value="' . $myrow['unitname'] . '">' . $myrow['unitname'] . '</option>'; } } -echo '</td></tr>'; +echo '</select></td></tr>'; echo '<input type="hidden" name="Item" value="'.$Item.'" />'; -echo '</select></td></tr>'; - echo '<tr><td>'. _('Decimal Places') . '<br />'._('to display').'</td>'; echo '<td><input type="text" class="number" name="DecimalPlaces" size="8" maxlength="8" value="'; if(isset($_POST['DecimalPlaces'])) { @@ -448,7 +448,7 @@ } else { echo '0'; } -echo '">'; +echo '" /></td></tr>'; echo '<tr><td>'. _('Conversion Factor') . '<br />'._('to stock units').'</td>'; echo '<td><input type="text" class="number" name="ConversionFactor" size="8" maxlength="8" value="'; @@ -457,7 +457,7 @@ } else { echo '1'; } -echo '">'; +echo '" /></td></tr>'; echo '<tr><td>' . _('Price') . ':</td> <td><input type="text" class="number" name="Price" size="11" maxlength="10" value="' . $_POST['Price'] . '" /></td> Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-21 16:22:21 UTC (rev 6831) +++ trunk/SelectOrderItems.php 2011-07-21 16:22:34 UTC (rev 6832) @@ -614,7 +614,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Enter an Order or Quotation') . ' : ' . _('Search for the Customer Branch.') . '</p>'; - echo '<div class="page_help_text">' . _('Orders/Quotations are placed against the Customer Branch. A Customer may have several Branches.') . '<div/>'; + echo '<div class="page_help_text">' . _('Orders/Quotations are placed against the Customer Branch. A Customer may have several Branches.') . '</div>'; ?> <form action="<?php echo $_SERVER['PHP_SELF'] . '?identifier='.$identifier;?>" name="SelectCustomer" method="post"> <?php @@ -624,17 +624,17 @@ <table cellpadding="3" colspan="4" class="selection"> <tr> <td><h5><?php echo _('Part of the Customer Branch Name'); ?>:</h5></td> - <td><input tabindex="1" type="Text" name="CustKeywords" size="20" maxlength="25"><td/> + <td><input tabindex="1" type="Text" name="CustKeywords" size="20" maxlength="25"></td> <td><h2><b><?php echo _('OR'); ?></b></h2></td> <td><h5><?php echo _('Part of the Customer Branch Code'); ?>:</h5></td> - <td><input tabindex="2" type="Text" name="CustCode" size="15" maxlength="18"><td/> + <td><input tabindex="2" type="Text" name="CustCode" size="15" maxlength="18"></td> <td><h2><b><?php echo _('OR'); ?></b></h2></td> <td><h5><?php echo _('Part of the Branch Phone Number'); ?>:</h5></td> - <td><input tabindex="3" type="Text" name="CustPhone" size="15" maxlength="18"><td/> - <tr/> - <table/> + <td><input tabindex="3" type="Text" name="CustPhone" size="15" maxlength="18"></td> + </tr> + </table> <br /><div class="centre"><input tabindex="4" type="submit" name="SearchCust" value="<?php echo _('Search Now'); ?>"> - <input tabindex="5" type="submit" action="reset" value="<?php echo _('Reset'); ?>"><div/> + <input tabindex="5" type="submit" action="reset" value="<?php echo _('Reset'); ?>"></div> <?php if (isset($result_CustSelect)) { @@ -647,7 +647,7 @@ <th>' . _('Contact') . '</th> <th>' . _('Phone') . '</th> <th>' . _('Fax') . '</th> - <tr/>'; + </tr>'; echo $TableHeader; $j = 1; @@ -674,14 +674,14 @@ <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> - <tr/><form/>'; + </tr></form>'; $LastCustomer=$myrow['name']; $j++; //end of page full new headings if } //end of while loop - echo '<table/>'; + echo '</table>'; }//end if results to show @@ -753,17 +753,17 @@ echo '</b> ' . _('From Location') . ':<b> ' . $_SESSION['Items'.$identifier]->LocationName; echo '</b><br />' . _('Sales Type') . '/' . _('Price List') . ':<b> ' . $_SESSION['Items'.$identifier]->SalesTypeName; echo '</b><br />' . _('Terms') . ':<b> ' . $_SESSION['Items'.$identifier]->PaymentTerms; - echo '</b><div/>'; + echo '</b></div>'; } if (isset($_POST['Search']) or isset($_POST['Next']) or isset($_POST['Prev'])){ if ($_POST['Keywords']!=='' AND $_POST['StockCode']=='') { - $msg='</b><div class="page_help_text">' . _('Order Item description has been used in search') . '.<div/>'; + $msg='</b><div class="page_help_text">' . _('Order Item description has been used in search') . '.</div>'; } elseif ($_POST['StockCode']!=='' AND $_POST['Keywords']=='') { - $msg='</b><div class="page_help_text">' . _('Stock Code has been used in search') . '.<div/>'; + $msg='</b><div class="page_help_text">' . _('Stock Code has been used in search') . '.</div>'; } elseif ($_POST['Keywords']=='' AND $_POST['StockCode']=='') { - $msg='</b><div class="page_help_text">' . _('Stock Category has been used in search') . '.<div/>'; + $msg='</b><div class="page_help_text">' . _('Stock Category has been used in search') . '.</div>'; } if (isset($_POST['Keywords']) AND mb_strlen($_POST['Keywords'])>0) { //insert wildcard characters in spaces @@ -915,13 +915,13 @@ OR isset($_POST['QuickEntry']) OR isset($_POST['Recalculate'])){ - /* get the item details from the database and hold them in the cart object */ + /* get the item details from the database and hold them in the cart object */ - /*Discount can only be set later on -- after quick entry -- so default discount to 0 in the first place */ - $Discount = 0; - - $i=1; - while ($i<=$_SESSION['QuickEntries'] and isset($_POST['part_' . $i]) and $_POST['part_' . $i]!='') { + /*Discount can only be set later on -- after quick entry -- so default discount to 0 in the first place */ + $Discount = 0; + $AlreadyWarnedAboutCredit = false; + $i=1; + while ($i<=$_SESSION['QuickEntries'] and isset($_POST['part_' . $i]) and $_POST['part_' . $i]!='') { $QuickEntryCode = 'part_' . $i; $QuickEntryQty = 'qty_' . $i; $QuickEntryPOLine = 'poline_' . $i; @@ -1077,7 +1077,7 @@ stockid) SELECT loccode, '" . $AssetStockID . "' - FROM locations",$db); + FROM locations",$db); /*Now the asset has been added to the stock master we can add it to the sales order */ $NewItemDue = date($_SESSION['DefaultDateFormat']); if (isset($_POST['POLine'])){ @@ -1104,6 +1104,7 @@ } } + $AlreadyWarnedAboutCredit = false; foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { if (isset($_POST['Quantity_' . $OrderLine->LineNumber])){ @@ -1313,7 +1314,7 @@ if($_SESSION['Items'.$identifier]->DefaultPOLine == 1){ echo '<th>' . _('PO Line') . '</th>'; } - echo '<div class="page_help_text">' . _('Quantity (required) - Enter the number of units ordered. Price (required) - Enter the unit price. Discount (optional) - Enter a percentage discount. GP% (optional) - Enter a percentage Gross Profit (GP) to add to the unit cost. Due Date (optional) - Enter a date for delivery.') . '<div/><br />'; + echo '<div class="page_help_text">' . _('Quantity (required) - Enter the number of units ordered. Price (required) - Enter the unit price. Discount (optional) - Enter a percentage discount. GP% (optional) - Enter a percentage Gross Profit (GP) to add to the unit cost. Due Date (optional) - Enter a date for delivery.') . '</div><br />'; echo '<th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> <th>' . _('Quantity') . '</th> @@ -1326,7 +1327,7 @@ <th>' . _('GP %') . '</th>'; } echo '<th>' . _('Total') . '</th> - <th>' . _('Due Date') . '</th><tr/>'; + <th>' . _('Due Date') . '</th></tr>'; $_SESSION['Items'.$identifier]->total = 0; $_SESSION['Items'.$identifier]->totalVolume = 0; @@ -1394,11 +1395,11 @@ echo '<td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ItemDue_' . $OrderLine->LineNumber . '" size=10 maxlength=10 value=' . $LineDueDate . '></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . $RemTxt . '</a></td><tr/>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . $RemTxt . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ echo $RowStarter; - echo '<td colspan=10>' . _('Narrative') . ':<textarea name="Narrative_' . $OrderLine->LineNumber . '" cols="100%" rows="1">' . stripslashes(AddCarriageReturns($OrderLine->Narrative)) . '</textarea><br /></td><tr/>'; + echo '<td colspan=10>' . _('Narrative') . ':<textarea name="Narrative_' . $OrderLine->LineNumber . '" cols="100%" rows="1">' . stripslashes(AddCarriageReturns($OrderLine->Narrative)) . '</textarea><br /></td></tr>'; } else { echo '<input type="hidden" name="Narrative" value="" />'; } @@ -1416,7 +1417,7 @@ $ColSpanNumber = 1; } echo '<tr class="EvenTableRows"><td class="number" colspan=7><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> - <td colspan="' . $ColSpanNumber . '" class="number">' . $DisplayTotal . '</td><tr/><table/>'; + <td colspan="' . $ColSpanNumber . '" class="number">' . $DisplayTotal . '</td></tr></table>'; $DisplayVolume = number_format($_SESSION['Items'.$identifier]->totalVolume,2); $DisplayWeight = number_format($_SESSION['Items'.$identifier]->totalWeight,2); @@ -1428,7 +1429,7 @@ echo '<br /><div class="centre"><input type="submit" name="Recalculate" Value="' . _('Re-Calculate') . '"> - <input type="submit" name="DeliveryDetails" value="' . _('Enter Delivery Details and Confirm Order') . '"><div/><hr>'; + <input type="submit" name="DeliveryDetails" value="' . _('Enter Delivery Details and Confirm Order') . '"><div/><hr />'; } # end of if lines /* Now show the stock item selection search stuff below */ @@ -1459,7 +1460,7 @@ $result2 = DB_query($SQL,$db); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' '; echo _('Frequently Ordered Items') . '</p><br />'; - echo '<div class="page_help_text">' . _('Frequently Ordered Items') . _(', shows the most frequently ordered items in the last 6 months. You can choose from this list, or search further for other items') . '.<div/><br />'; + echo '<div class="page_help_text">' . _('Frequently Ordered Items') . _(', shows the most frequently ordered items in the last 6 months. You can choose from this list, or search further for other items') . '.</div><br />'; echo '<table class="table1">'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> @@ -1470,7 +1471,7 @@ <th>' . _('Available') . '</th> <th>' . _('Quantity') . '</th> <th>' . _('Price') . '</th> - <tr/>'; + </tr>'; echo $TableHeader; $j = 1; $k=0; //row colour counter @@ -1565,7 +1566,7 @@ <td class="number">%s</td> <td><font size=1><input class="number" tabindex='.number_format($j+7).' type="textbox" size=6 name="itm'.$myrow['stockid'].'" value=0> </td> - <tr/>', + </tr>', $myrow['stockid'], $myrow['description'], $myrow['units'], @@ -1581,12 +1582,12 @@ } #end of while loop for Frequently Ordered Items echo '<td style="text-align:center" colspan=8><input type="hidden" name="order_items" value=1><input tabindex='.number_format($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; - echo '<table/>'; + echo '</table>'; } //end of if Frequently Ordered Items > 0 - echo '<p><div class="centre"><b>' . $msg . '</b><div/></p>'; + echo '<p><div class="centre"><b>' . $msg . '</b></div></p>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' '; echo _('Search for Order Items') . '</p>'; - echo '<div class="page_help_text">' . _('Search for Order Items') . _(', Searches the database for items, you can narrow the results by selecting a stock category, or just enter a partial item description or partial item code') . '.<div/><br />'; + echo '<div class="page_help_text">' . _('Search for Order Items') . _(', Searches the database for items, you can narrow the results by selecting a stock category, or just enter a partial item description or partial item code') . '.</div><br />'; echo '<table class="selection"><tr><td><b>' . _('Select a Stock Category') . ': </b><select tabindex=1 name="StockCat">'; if (!isset($_POST['StockCat'])){ @@ -1622,7 +1623,7 @@ if (isset($_POST['StockCode'])) { echo $_POST['StockCode']; } - echo '"></td><tr/>'; + echo '"></td></tr>'; echo '<tr> <td style="text-align:center" colspan=1><input tabindex=4 type="submit" name="Search" value="' . _('Search Now') . '"></td> @@ -1634,12 +1635,12 @@ if (in_array(2,$_SESSION['AllowedPageSecurityTokens'])){ //not a customer entry of own order echo '<td style="text-align:center" colspan=1><input tabindex=6 type="submit" name="ChangeCustomer" value="' . _('Change Customer') . '"></td> <td style="text-align:center" colspan=1><input tabindex=7 type="submit" name="SelectAsset" value="' . _('Fixed Asset Disposal') . '"></td> - <tr/><table/><br />'; + </tr></table><br />'; } if (isset($SearchResult)) { echo '<br />'; - echo '<div class="page_help_text">' . _('Select an item by entering the quantity required. Click Order when ready.') . '<div/>'; + echo '<div class="page_help_text">' . _('Select an item by entering the quantity required. Click Order when ready.') . '</div>'; echo '<br />'; $j = 1; echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" method="post" name="orderform">'; @@ -1647,7 +1648,7 @@ echo '<table class="table1">'; echo '<tr><td colspan=><input type="hidden" name="previous" value='.number_format($Offset-1).'><input tabindex='.number_format($j+8).' type="submit" name="Prev" value="'._('Prev').'"></td>'; echo '<td style="text-align:center" colspan="7"><input type="hidden" name="order_items" value=1><input tabindex='.number_format($j+9).' type="submit" value="'._('Add to Sales Order').'"></td>'; - echo '<td><input type="hidden" name="nextlist" value='.number_format($Offset+1).'><input tabindex='.number_format($j+10).' type="submit" name="Next" value="'._('Next').'"></td><tr/>'; + echo '<td><input type="hidden" name="nextlist" value='.number_format($Offset+1).'><input tabindex='.number_format($j+10).' type="submit" name="Next" value="'._('Next').'"></td></tr>'; $TableHeader = '<tr><th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> @@ -1657,7 +1658,7 @@ <th>' . _('Available') . '</th> <th>' . _('Quantity') . '</th> <th>' . _('Price') . '</th> - <tr/>'; + </tr>'; echo $TableHeader; $ImageSource = _('No Image'); @@ -1799,7 +1800,7 @@ <input type="hidden" name="StockID'.$i.'" value="'.$myrow['stockid'].'" /> <td class="number">'.number_format($PriceRow['price'],2).'</td> </td> - <tr/>'; + </tr>'; echo '<input type="hidden" name="ConversionFactor'.$i.'" value="' . $PriceRow['conversionfactor'] . '" />'; echo '<input type="hidden" name="Units'.$i.'" value="' . $myrow['units'] . '" />'; if ($j==1) { @@ -1812,14 +1813,14 @@ echo '<tr><td><input type="hidden" name="previous" value='.number_format($Offset-1).'><input tabindex='.number_format($j+7).' type="submit" name="Prev" value="'._('Prev').'"></td>'; echo '<td style="text-align:center" colspan="7"><input type="hidden" name="order_items" value=1><input tabindex='.number_format($j+8).' type="submit" value="'._('Add to Sales Order').'"></td>'; echo '<td><input type="hidden" name="nextlist" value='.number_format($Offset+1).'><input tabindex='.number_format($j+9).' type="submit" name="Next" value="'._('Next').'"></td><tr/>'; - echo '<table/><form/>'; + echo '</table></form>'; echo $jsCall; }#end if SearchResults to show } /*end of PartSearch options to be displayed */ elseif( isset($_POST['QuickEntry'])) { /* show the quick entry form variable */ /*FORM VARIABLES TO POST TO THE ORDER WITH PART CODE AND QUANTITY */ - echo '<div class="page_help_text"><b>' . _('Use this screen for the '). _('Quick Entry')._(' of products to be ordered') . '</b><div/><br /> + echo '<div class="page_help_text"><b>' . _('Use this screen for the '). _('Quick Entry')._(' of products to be ordered') . '</b></div><br /> <table border="1"> <tr>'; /*do not display colum unless customer requires po line number by sales order line*/ @@ -1829,7 +1830,7 @@ echo '<th>' . _('Part Code') . '</th> <th>' . _('Quantity') . '</th> <th>' . _('Due Date') . '</th> - <tr/>'; + </tr>'; $DefaultDeliveryDate = DateAdd(Date($_SESSION['DefaultDateFormat']),'d',$_SESSION['Items'.$identifier]->DeliveryDays); for ($i=1;$i<=$_SESSION['QuickEntries'];$i++){ @@ -1841,21 +1842,21 @@ echo '<td><input type="text" name="part_' . $i . '" size="21" maxlength="20"></td> <td><input type="text" name="qty_' . $i . '" size="6" maxlength="6"></td> <td><input type="text" class="date" name="itemdue_' . $i . '" size="25" maxlength="25" - alt="'.$_SESSION['DefaultDateFormat'].'" value="' . $DefaultDeliveryDate . '"></td><tr/>'; + alt="'.$_SESSION['DefaultDateFormat'].'" value="' . $DefaultDeliveryDate . '"></td></tr>'; } echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.part_1);}</script>'; - echo '<table/><br /><div class="centre"><input type="submit" name="QuickEntry" value="' . _('Quick Entry') . '"> - <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"><div/>'; + echo '</table><br /><div class="centre"><input type="submit" name="QuickEntry" value="' . _('Quick Entry') . '"> + <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"></div>'; } elseif (isset($_POST['SelectAsset'])){ - echo '<div class="page_help_text"><b>' . _('Use this screen to select an asset to dispose of to this customer') . '</b><div/><br /> + echo '<div class="page_help_text"><b>' . _('Use this screen to select an asset to dispose of to this customer') . '</b></div><br /> <table border="1">'; /*do not display colum unless customer requires po line number by sales order line*/ if($_SESSION['Items'.$identifier]->DefaultPOLine ==1){ echo '<tr><td>' . _('PO Line') . '</td> - <td><input type="text" name="poline" size="21" maxlength="20"></td><tr/>'; + <td><input type="text" name="poline" size="21" maxlength="20"></td></tr>'; } echo '<tr><td>' . _('Asset to Dispose Of') . ':</td> <td><select name="AssetToDisposeOf">'; @@ -1864,18 +1865,18 @@ while ($AssetRow = DB_fetch_array($AssetsResult)){ echo '<option value="' . $AssetRow['assetid'] . '">' . $AssetRow['assetid'] . ' - ' . $AssetRow['description'] . '</option>'; } - echo '</select></td><tr/><table/> + echo '</select></td></tr></table> <br /><div class="centre"><input type="submit" name="AssetDisposalEntered" value="' . _('Add Asset To Order') . '"> - <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"><div/>'; + <input type="submit" name="PartSearch" value="' . _('Search Parts') . '"></div>'; } //end of if it is a Quick Entry screen/part search or asset selection form to display if ($_SESSION['Items'.$identifier]->ItemsOrdered >=1){ - echo '<br /><div class="centre"><input type="submit" name="CancelOrder" value="' . _('Cancel Whole Order') . '" onclick="return confirm(\'' . _('Are you sure you wish to cancel this entire order?') . '\');"><div/>'; + echo '<br /><div class="centre"><input type="submit" name="CancelOrder" value="' . _('Cancel Whole Order') . '" onclick="return confirm(\'' . _('Are you sure you wish to cancel this entire order?') . '\');"></div>'; } }#end of else not selecting a customer -echo '<form/>'; +echo '</form>'; if (isset($_GET['NewOrder']) and $_GET['NewOrder']!='') { echo '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectCustomer.CustKeywords);}</script>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-22 08:30:22
|
Revision: 6837 http://weberp.svn.sourceforge.net/weberp/?rev=6837&view=rev Author: tim_schofield Date: 2011-07-22 08:30:16 +0000 (Fri, 22 Jul 2011) Log Message: ----------- Prevent the supplier/customer login setup screens being used to alter other users Modified Paths: -------------- trunk/CustLoginSetup.php trunk/SuppLoginSetup.php trunk/includes/UserLogin.php Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-07-21 21:43:06 UTC (rev 6836) +++ trunk/CustLoginSetup.php 2011-07-22 08:30:16 UTC (rev 6837) @@ -357,6 +357,12 @@ $_POST['UserLanguage'] = $myrow['language']; $_POST['Blocked'] = $myrow['blocked']; + if ($myrow['customerid']!=$_SESSION['CustomerID']) { + prnMsg( _('This is not a user for this customer, and so cannot be edited'), 'error'); + include('includes/footer.inc'); + exit; + } + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2011-07-21 21:43:06 UTC (rev 6836) +++ trunk/SuppLoginSetup.php 2011-07-22 08:30:16 UTC (rev 6837) @@ -303,6 +303,12 @@ $_POST['UserLanguage'] = $myrow['language']; $_POST['Blocked'] = $myrow['blocked']; + if ($myrow['supplierid']!=$_SESSION['SupplierID']) { + prnMsg( _('This is not a user for this supplier, and so cannot be edited'), 'error'); + include('includes/footer.inc'); + exit; + } + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; Modified: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php 2011-07-21 21:43:06 UTC (rev 6836) +++ trunk/includes/UserLogin.php 2011-07-22 08:30:16 UTC (rev 6837) @@ -66,6 +66,7 @@ $_SESSION['CanCreateTender'] = $myrow['cancreatetender']; $_SESSION['CustomerID'] = $myrow['customerid']; $_SESSION['UserBranch'] = $myrow['branchcode']; + $_SESSION['UserSupplierID'] = $myrow['supplierid']; $_SESSION['DefaultPageSize'] = $myrow['pagesize']; $_SESSION['UserStockLocation'] = $myrow['defaultlocation']; $_SESSION['UserEmail'] = $myrow['email']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-26 13:38:35
|
Revision: 6852 http://weberp.svn.sourceforge.net/weberp/?rev=6852&view=rev Author: tim_schofield Date: 2011-07-26 13:38:28 +0000 (Tue, 26 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/Stocks.php trunk/Z_UpdateChartDetailsBFwd.php trunk/includes/header.inc trunk/index.php Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-07-26 11:01:29 UTC (rev 6851) +++ trunk/Stocks.php 2011-07-26 13:38:28 UTC (rev 6852) @@ -586,7 +586,7 @@ } if ($New==1) { echo '<tr><td>'. _('Item Code'). ':</td><td><input ' . (in_array('StockID',$Errors) ? 'class="inputerror"' : '' ) .' type="text" - value="'.$StockID.'" name="StockID" size=21 maxlength=20 /></td></tr>'. "\n"; + value="'.$StockID.'" name="StockID" size="21" maxlength="20" /></td></tr>'. "\n"; } else { echo '<tr><td>'. _('Item Code'). ':</td><td>'.$StockID.'</td></tr>'. "\n"; echo '<input type="hidden" name ="StockID" value="'.$StockID.'" />'; @@ -643,11 +643,11 @@ $_POST['ShrinkFactor'] = $myrow['shrinkfactor']; echo '<tr><td>' . _('Item Code') . ':</td><td>'.$StockID.'</td></tr>'. "\n"; - echo '<input type="Hidden" name="StockID" value='.$StockID.'>'. "\n"; + echo '<input type="Hidden" name="StockID" value="'.$StockID.'" />'. "\n"; } else { // some changes were made to the data so don't re-set form variables to DB ie the code above echo '<tr><td>' . _('Item Code') . ':</td><td>'.$StockID.'</td></tr>'; - echo '<input type="hidden" name="StockID" value="'.$StockID.'">'; + echo '<input type="hidden" name="StockID" value="'.$StockID.'" />'; } if (isset($_POST['Description'])) { @@ -655,14 +655,14 @@ } else { $Description =''; } -echo '<tr><td>' . _('Part Description') . ' (' . _('short') . '):</td><td><input ' . (in_array('Description',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Description" size=52 maxlength=50 value="' . $Description . '"></td></tr>'."\n"; +echo '<tr><td>' . _('Part Description') . ' (' . _('short') . '):</td><td><input ' . (in_array('Description',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Description" size="52" maxlength="50" value="' . $Description . '" /></td></tr>'."\n"; if (isset($_POST['LongDescription'])) { $LongDescription = AddCarriageReturns($_POST['LongDescription']); } else { $LongDescription =''; } -echo '<tr><td>' . _('Part Description') . ' (' . _('long') . '):</td><td><textarea ' . (in_array('LongDescription',$Errors) ? 'class="texterror"' : '' ) .' name="LongDescription" cols=40 rows=4>' . stripslashes($LongDescription) . '</textarea></td></tr>'; +echo '<tr><td>' . _('Part Description') . ' (' . _('long') . '):</td><td><textarea ' . (in_array('LongDescription',$Errors) ? 'class="texterror"' : '' ) .' name="LongDescription" cols="40" rows="4">' . stripslashes($LongDescription) . '</textarea></td></tr>'; // Generate selection drop down from pdf_append directory - by emdx, // developed with examples from http://au2.php.net/manual/en/function.opendir.php @@ -674,7 +674,7 @@ } if ($handle = opendir($dir)) { $mydir = '<select name="'.$select_name.'">'; - $mydir .= '<option value=0>none</option>'; + $mydir .= '<option value="0">none</option>'; if (isset($_POST['ItemPDF'])) { $curr_val = $_POST['ItemPDF']; } else { @@ -697,6 +697,7 @@ $teller++; } } + $mydir .= '</select>'; $mydir .= ""; } return $mydir; @@ -705,10 +706,10 @@ $_POST['ItemPDF'] = ''; } echo '<tr><td>' . _('PDF attachment (.pdf)') . ':</td><td>' . select_files('companies/' . $_SESSION['DatabaseName'] . - "/pdf_append//",'' , 'ItemPDF', $_POST['ItemPDF'], '60') . '</td></tr>'; + '/pdf_append/','' , 'ItemPDF', $_POST['ItemPDF'], '60') . '</td></tr>'; // Add image upload for New Item - by Ori -echo '<tr><td>'. _('Image File (.jpg)') . ':</td><td><input type="file" id="ItemPicture" name="ItemPicture"></td>'; +echo '<tr><td>'. _('Image File (.jpg)') . ':</td><td><input type="file" id="ItemPicture" name="ItemPicture" /></td>'; if (function_exists('imagecreatefromjpg')){ $StockImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. @@ -716,7 +717,7 @@ '&text='. '&width=64'. '&height=64'. - '" >'; + '" />'; } else { if( isset($StockID) and file_exists($_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg') ) { $StockImgLink = '<img src="' . $_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg" >'; @@ -740,7 +741,7 @@ while ($myrow=DB_fetch_array($result)){ if (!isset($_POST['CategoryID']) or $myrow['categoryid']==$_POST['CategoryID']){ - echo '<option selected value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; + echo '<option selected="True" value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } else { echo '<option value="'. $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } @@ -786,11 +787,11 @@ } -echo '<tr><td>' . _('Economic Order Quantity') . ':</td><td><input ' . (in_array('EOQ',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class="number" name="EOQ" size=12 maxlength=10 value="' . $_POST['EOQ'] . '"></td></tr>'; +echo '<tr><td>' . _('Economic Order Quantity') . ':</td><td><input ' . (in_array('EOQ',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="EOQ" size="12" maxlength="10" value="' . $_POST['EOQ'] . '" /></td></tr>'; -echo '<tr><td>' . _('Packaged Volume (metres cubed)') . ':</td><td><input ' . (in_array('Volume',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class="number" name="Volume" size=12 maxlength=10 value="' . $_POST['Volume'] . '"></td></tr>'; +echo '<tr><td>' . _('Packaged Volume (metres cubed)') . ':</td><td><input ' . (in_array('Volume',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="Volume" size="12" maxlength="10" value="' . $_POST['Volume'] . '" /></td></tr>'; -echo '<tr><td>' . _('Packaged Weight (KGs)') . ':</td><td><input ' . (in_array('KGS',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class="number" name="KGS" size=12 maxlength=10 value="' . $_POST['KGS'] . '"></td></tr>'; +echo '<tr><td>' . _('Packaged Weight (KGs)') . ':</td><td><input ' . (in_array('KGS',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="KGS" size="12" maxlength="10" value="' . $_POST['KGS'] . '" /></td></tr>'; echo '<tr><td>' . _('Units of Measure') . ':</td><td><select ' . (in_array('Description',$Errors) ? 'class="selecterror"' : '' ) .' name="Units">'; @@ -848,42 +849,42 @@ echo '<tr><td>' . _('Current or Obsolete') . ':</td><td><select name="Discontinued">'; if ($_POST['Discontinued']==0){ - echo '<option selected value=0>' . _('Current') . '</option>'; + echo '<option selected value="0">' . _('Current') . '</option>'; } else { - echo '<option value=0>' . _('Current') . '</option>'; + echo '<option value="0">' . _('Current') . '</option>'; } if ($_POST['Discontinued']==1){ - echo '<option selected value=1>' . _('Obsolete') . '</option>'; + echo '<option selected value="1">' . _('Obsolete') . '</option>'; } else { - echo '<option value=1>' . _('Obsolete') . '</option>'; + echo '<option value="1">' . _('Obsolete') . '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Batch, Serial or Lot Control') . ':</td><td><select name="Controlled">'; if ($_POST['Controlled']==0){ - echo '<option selected value=0>' . _('No Control') . '</option>'; + echo '<option selected value="0">' . _('No Control') . '</option>'; } else { - echo '<option value=0>' . _('No Control') . '</option>'; + echo '<option value="0">' . _('No Control') . '</option>'; } if ($_POST['Controlled']==1){ - echo '<option selected value=1>' . _('Controlled'). '</option>'; + echo '<option selected value="1">' . _('Controlled'). '</option>'; } else { - echo '<option value=1>' . _('Controlled'). '</option>'; + echo '<option value="1">' . _('Controlled'). '</option>'; } echo '</select></td></tr>'; echo '<tr><td>' . _('Serialised') . ':</td><td><select ' . (in_array('Serialised',$Errors) ? 'class="selecterror"' : '' ) .' name="Serialised">'; if ($_POST['Serialised']==0){ - echo '<option selected value=0>' . _('No'). '</option>'; + echo '<option selected value="0">' . _('No'). '</option>'; } else { - echo '<option value=0>' . _('No'). '</option>'; + echo '<option value="0">' . _('No'). '</option>'; } if ($_POST['Serialised']==1){ - echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option selected value="1">' . _('Yes') . '</option>'; } else { - echo '<option value=1>' . _('Yes'). '</option>'; + echo '<option value="1">' . _('Yes'). '</option>'; } echo '</select><i>' . _('Note') . ', ' . _('this has no effect if the item is not Controlled') . '</i></td></tr>'; @@ -896,14 +897,14 @@ echo '<tr><td>' . _('Perishable') . ':</td><td><select name="Perishable">'; if (!isset($_POST['Perishable']) or $_POST['Perishable']==0){ - echo '<option selected value=0>' . _('No'). '</option>'; + echo '<option selected value="0">' . _('No'). '</option>'; } else { - echo '<option value=0>' . _('No'). '</option>'; + echo '<option value="0">' . _('No'). '</option>'; } if (isset($_POST['Perishable']) and $_POST['Perishable']==1){ - echo '<option selected value=1>' . _('Yes'). '</option>'; + echo '<option selected value="1">' . _('Yes'). '</option>'; } else { - echo '<option value=1>' . _('Yes'). '</option>'; + echo '<option value="1">' . _('Yes'). '</option>'; } echo '</select></td></tr>'; Modified: trunk/Z_UpdateChartDetailsBFwd.php =================================================================== --- trunk/Z_UpdateChartDetailsBFwd.php 2011-07-26 11:01:29 UTC (rev 6851) +++ trunk/Z_UpdateChartDetailsBFwd.php 2011-07-26 13:38:28 UTC (rev 6852) @@ -51,7 +51,7 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if($myrow['periodno']==$DefaultToPeriod){ - echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected="True" value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { echo '<option value =' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2011-07-26 11:01:29 UTC (rev 6851) +++ trunk/includes/header.inc 2011-07-26 13:38:28 UTC (rev 6852) @@ -6,7 +6,7 @@ // $rootpath // $title - should be defined in the page this file is included with - $StrictXHTML=False; + $StrictXHTML=True; if (!headers_sent()){ if ($StrictXHTML) { Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-07-26 11:01:29 UTC (rev 6851) +++ trunk/index.php 2011-07-26 13:38:28 UTC (rev 6852) @@ -708,7 +708,7 @@ foreach ($ReportList as $Report) { if ($Report['groupname']==$GroupID AND $Report['defaultreport']==$Def) { $RptLinks .= '<tr><td class="menu_group_item">'; - $RptLinks .= '<p>• <a href="' . $rootpath . '/reportwriter/ReportMaker.php?action=go&reportid=' . $Report['id'] . '">' . _($Report['reportname']) . '</a></p>'; + $RptLinks .= '<p>• <a href="' . $rootpath . '/reportwriter/ReportMaker.php?action=go&reportid=' . $Report['id'] . '">' . _($Report['reportname']) . '</a></p>'; $RptLinks .= '</td></tr>'; $NoEntries = false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-26 16:23:44
|
Revision: 7003 http://weberp.svn.sourceforge.net/weberp/?rev=7003&view=rev Author: tim_schofield Date: 2011-07-26 16:23:37 +0000 (Tue, 26 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/Stocks.php trunk/WorkOrderStatus.php Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-07-26 14:06:11 UTC (rev 7002) +++ trunk/Stocks.php 2011-07-26 16:23:37 UTC (rev 7003) @@ -908,7 +908,8 @@ } echo '</select></td></tr>'; -echo '<tr><td>' . _('Decimal Places for display Quantity') . ':</td><td><input type="text" class="number" name="DecimalPlaces" size="1" maxlength="1" value="' . $_POST['DecimalPlaces'] . '" /><td></tr>'; +echo '<tr><td>' . _('Decimal Places for display Quantity') . ':</td> + <td><input type="text" class="number" name="DecimalPlaces" size="1" maxlength="1" value="' . $_POST['DecimalPlaces'] . '" /></td></tr>'; if (isset($_POST['BarCode'])) { $BarCode = $_POST['BarCode']; Modified: trunk/WorkOrderStatus.php =================================================================== --- trunk/WorkOrderStatus.php 2011-07-26 14:06:11 UTC (rev 7002) +++ trunk/WorkOrderStatus.php 2011-07-26 16:23:37 UTC (rev 7003) @@ -41,12 +41,32 @@ _('Search') . '" alt="" />' . ' ' . $title.'</p>'; echo '<table cellpadding="2" class="selection"> - <tr><td class="label">' . _('Issue to work order') . ':</td><td>' . $_REQUEST['WO'] .'</td><td class="label">' . _('Item') . ':</td><td>' . $_REQUEST['StockID'] . ' - ' . $WORow['description'] . '</td></tr> - <tr><td class="label">' . _('Manufactured at') . ':</td><td>' . $WORow['locationname'] . '</td><td class="label">' . _('Required By') . ':</td><td>' . ConvertSQLDate($WORow['requiredby']) . '</td></tr> - <tr><td class="label">' . _('Quantity Ordered') . ':</td><td class="number">' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> - <tr><td class="label">' . _('Already Received') . ':</td><td class="number">' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td><td colspan=2>' . $WORow['units'] . '</td></tr> - <tr><td class="label">' . _('Date Material Issued') . ':</td><td>' . Date($_SESSION['DefaultDateFormat']) . '</td> - <td class="label">' . _('Issued From') . ':</td><td>'; + <tr> + <td class="label">' . _('Issue to work order') . ':</td> + <td>' . $_REQUEST['WO'] .'</td><td class="label">' . _('Item') . ':</td> + <td>' . $_REQUEST['StockID'] . ' - ' . $WORow['description'] . '</td> + </tr> + <tr> + <td class="label">' . _('Manufactured at') . ':</td> + <td>' . $WORow['locationname'] . '</td> + <td class="label">' . _('Required By') . ':</td> + <td>' . ConvertSQLDate($WORow['requiredby']) . '</td> + </tr> + <tr> + <td class="label">' . _('Quantity Ordered') . ':</td> + <td class="number">' . number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td> + <td colspan="2">' . $WORow['units'] . '</td> + </tr> + <tr> + <td class="label">' . _('Already Received') . ':</td> + <td class="number">' . number_format($WORow['qtyrecd'],$WORow['decimalplaces']) . '</td> + <td colspan="2">' . $WORow['units'] . '</td> + </tr> + <tr> + <td class="label">' . _('Date Material Issued') . ':</td> + <td>' . Date($_SESSION['DefaultDateFormat']) . '</td> + <td class="label">' . _('Issued From') . ':</td> + </tr>'; if (!isset($_POST['FromLocation'])){ $_POST['FromLocation']=$WORow['loccode']; @@ -57,14 +77,15 @@ $db); $LocRow = DB_fetch_array($LocResult); echo $LocRow['locationname']; - echo '<tr><td colspan=4></td></tr>'; + echo '<tr><td colspan="4"></td></tr>'; echo '</td></tr></table><br />'; //set up options for selection of the item to be issued to the WO - echo '<table class="selection"><tr><th colspan=5><font size=2 color=navy>' . _('Material Requirements For this Work Order') . '</font></th></tr>'; - echo '<tr><th colspan=2>' . _('Item') . '</th> - <th>' . _('Qty Required') . '</th> - <th>' . _('Qty Issued') . '</th></tr>'; + echo '<table class="selection"><tr><th colspan="5"><font size="2" color="navy">' . _('Material Requirements For this Work Order') . '</font></th></tr>'; + echo '<tr><th colspan="2">' . _('Item') . '</th> + <th>' . _('Qty Required') . '</th> + <th>' . _('Qty Issued') . '</th> + </tr>'; $RequirmentsResult = DB_query("SELECT worequirements.stockid, stockmaster.description, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-26 20:34:33
|
Revision: 7025 http://weberp.svn.sourceforge.net/weberp/?rev=7025&view=rev Author: tim_schofield Date: 2011-07-26 20:34:27 +0000 (Tue, 26 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/SuppPriceList.php trunk/SupplierTenderCreate.php Modified: trunk/SuppPriceList.php =================================================================== --- trunk/SuppPriceList.php 2011-07-26 20:34:10 UTC (rev 7024) +++ trunk/SuppPriceList.php 2011-07-26 20:34:27 UTC (rev 7025) @@ -133,7 +133,7 @@ $YPos -=$line_height; // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width - // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor + // 4) Height 5) text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent if (mb_strpos($myrow[3],'-')) { Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2011-07-26 20:34:10 UTC (rev 7024) +++ trunk/SupplierTenderCreate.php 2011-07-26 20:34:27 UTC (rev 7025) @@ -492,15 +492,15 @@ '" alt="" />' . ' ' . _('Search for Suppliers') . '</p> <table cellpadding=3 colspan=4 class="selection"><tr><td>' . _('Enter a partial Name') . ':</font></td><td>'; if (isset($_POST['Keywords'])) { - echo '<input type="Text" name="Keywords" value="' . $_POST['Keywords'] . '" size=20 maxlength=25>'; + echo '<input type="text" name="Keywords" value="' . $_POST['Keywords'] . '" size=20 maxlength=25>'; } else { - echo '<input type="Text" name="Keywords" size=20 maxlength=25>'; + echo '<input type="text" name="Keywords" size=20 maxlength=25>'; } echo '</td><td><b>' . _('OR') . '</b></font></td><td>' . _('Enter a partial Code') . ':</font></td><td>'; if (isset($_POST['SupplierCode'])) { echo '<input type="text" name="SupplierCode" value="' . $_POST['SupplierCode'] . '" size=15 maxlength=18>'; } else { - echo '<input type="Text" name="SupplierCode" size=15 maxlength=18>'; + echo '<input type="text" name="SupplierCode" size=15 maxlength=18>'; } echo '</td></tr></table><br /><div class="centre"><input type="submit" name="SearchSupplier" value="' . _('Search Now') . '"></div>'; echo '</form>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-26 20:40:44
|
Revision: 7043 http://weberp.svn.sourceforge.net/weberp/?rev=7043&view=rev Author: tim_schofield Date: 2011-07-26 20:40:37 +0000 (Tue, 26 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MRPReschedules.php trunk/MRPShortages.php Modified: trunk/MRPPlannedPurchaseOrders.php =================================================================== --- trunk/MRPPlannedPurchaseOrders.php 2011-07-26 20:40:05 UTC (rev 7042) +++ trunk/MRPPlannedPurchaseOrders.php 2011-07-26 20:40:37 UTC (rev 7043) @@ -183,7 +183,7 @@ // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width - // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor + // 4) Height 5) text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent $FormatedSupDueDate = ConvertSQLDate($myrow['duedate']); $FormatedSupMRPDate = ConvertSQLDate($myrow['mrpdate']); Modified: trunk/MRPPlannedWorkOrders.php =================================================================== --- trunk/MRPPlannedWorkOrders.php 2011-07-26 20:40:05 UTC (rev 7042) +++ trunk/MRPPlannedWorkOrders.php 2011-07-26 20:40:37 UTC (rev 7043) @@ -175,7 +175,7 @@ // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width - // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor + // 4) Height 5) text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent $FormatedSupDueDate = ConvertSQLDate($myrow['duedate']); $FormatedSupMRPDate = ConvertSQLDate($myrow['mrpdate']); Modified: trunk/MRPReport.php =================================================================== --- trunk/MRPReport.php 2011-07-26 20:40:05 UTC (rev 7042) +++ trunk/MRPReport.php 2011-07-26 20:40:37 UTC (rev 7043) @@ -434,7 +434,7 @@ */ // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width - // 4) Height 5) Text To Display 6) Alignment 7) Border 8) Fill - True to use SetFillColor + // 4) Height 5) text To Display 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set for transparent if (isset($Requirements[$i]['part']) and mb_strlen($Requirements[$i]['part']) > 1) { $FormatedReqDueDate = ConvertSQLDate($Requirements[$i]['daterequired']); Modified: trunk/MRPReschedules.php =================================================================== --- trunk/MRPReschedules.php 2011-07-26 20:40:05 UTC (rev 7042) +++ trunk/MRPReschedules.php 2011-07-26 20:40:37 UTC (rev 7043) @@ -89,7 +89,7 @@ // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width - // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor + // 4) Height 5) text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent $pdf->addTextWrap($Left_Margin,$YPos,90,$FontSize,$myrow['part'],'',0,$fill); $pdf->addTextWrap(130,$YPos,200,$FontSize,$myrow['description'],'',0,$fill); Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-07-26 20:40:05 UTC (rev 7042) +++ trunk/MRPShortages.php 2011-07-26 20:40:37 UTC (rev 7043) @@ -201,7 +201,7 @@ // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width - // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor + // 4) Height 5) text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent $shortage = ($myrow['demand'] - $myrow['supply']) * -1; $extcost = $shortage * $myrow['computedcost']; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-26 20:46:20
|
Revision: 7063 http://weberp.svn.sourceforge.net/weberp/?rev=7063&view=rev Author: tim_schofield Date: 2011-07-26 20:46:14 +0000 (Tue, 26 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/CustomerTypes.php trunk/includes/header.inc Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-07-26 20:45:48 UTC (rev 7062) +++ trunk/BOMExtendedQty.php 2011-07-26 20:46:14 UTC (rev 7063) @@ -214,7 +214,7 @@ // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width - // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor + // 4) Height 5) text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent $Difference = $myrow['quantity'] - ($myrow['qoh'] + $myrow['poqty'] + $myrow['woqty']); if (($_POST['Select'] == 'All') or ($Difference > 0)) { Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-07-26 20:45:48 UTC (rev 7062) +++ trunk/BOMIndented.php 2011-07-26 20:46:14 UTC (rev 7063) @@ -202,7 +202,7 @@ // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width - // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor + // 4) Height 5) text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent $pdf->addTextWrap($Left_Margin+($myrow['level'] * 5),$YPos,90,$FontSize,$myrow['component'],'',0,$fill); $pdf->addTextWrap(160,$YPos,20,$FontSize,$myrow['mbflag'],'',0,$fill); Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-07-26 20:45:48 UTC (rev 7062) +++ trunk/BOMIndentedReverse.php 2011-07-26 20:46:14 UTC (rev 7063) @@ -202,7 +202,7 @@ // Parameters for addTextWrap are defined in /includes/class.pdf.php // 1) X position 2) Y position 3) Width - // 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor + // 4) Height 5) text 6) Alignment 7) Border 8) Fill - True to use SetFillColor // and False to set to transparent $pdf->addTextWrap($Left_Margin+($myrow['level'] * 5),$YPos,90,$FontSize,$myrow['parent'],'',0,$fill); $pdf->addTextWrap(160,$YPos,20,$FontSize,$myrow['mbflag'],'',0,$fill); Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2011-07-26 20:45:48 UTC (rev 7062) +++ trunk/CustomerTypes.php 2011-07-26 20:46:14 UTC (rev 7063) @@ -260,7 +260,7 @@ if (!isset($_POST['typename'])) { $_POST['typename']=''; } - echo '<tr><td>' . _('Type Name') . ':</td><td><input type="Text" name="typename" value="' . $_POST['typename'] . '"></td></tr>'; + echo '<tr><td>' . _('Type Name') . ':</td><td><input type="text" name="typename" value="' . $_POST['typename'] . '" /></td></tr>'; echo '</td></tr></table>'; // close main table Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2011-07-26 20:45:48 UTC (rev 7062) +++ trunk/includes/header.inc 2011-07-26 20:46:14 UTC (rev 7063) @@ -41,7 +41,7 @@ echo '<tr>'; echo '<td align="left" style="width:100%;" class="quick_menu_left">'; // Use icons for company and user data, saves screen realestate, use ALT tag in case theme icon not avail. - echo '<img src="'.$rootpath.'/css/'.$theme.'/images/company.png" TITLE="' . _('Company') . '" ALT="' . _('Company') . '"></img>'; + echo '<img src="'.$rootpath.'/css/'.$theme.'/images/company.png" title="' . _('Company') . '" ALT="' . _('Company') . '"></img>'; echo ' ' . stripslashes($_SESSION['CompanyRecord']['coyname']) . ' <a href="' . $rootpath . '/UserSettings.php"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" TITLE="User" ALT="' . _('User') . '"> </img>' . stripslashes($_SESSION['UsersRealName']) . '</a>'; // Make the title text a class, can be set to display:none is some themes echo '<br /><font class="header_title"> ' . $title . '</font></td>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-27 21:00:54
|
Revision: 7159 http://weberp.svn.sourceforge.net/weberp/?rev=7159&view=rev Author: tim_schofield Date: 2011-07-27 21:00:48 +0000 (Wed, 27 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/CustomerBranches.php trunk/DailyBankTransactions.php Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-07-27 21:00:31 UTC (rev 7158) +++ trunk/CustomerBranches.php 2011-07-27 21:00:48 UTC (rev 7159) @@ -582,7 +582,7 @@ echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Add a Branch').'</p>'; echo '<table class="selection"><tr><td>'._('Branch Code'). ':</td> <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . - ' tabindex=1 type="text" name="BranchCode" size=12 maxlength=10 value="' . $_POST['BranchCode'] . '"></td></tr>'; + ' tabindex=1 type="text" name="BranchCode" size="12" maxlength="10" value="' . $_POST['BranchCode'] . '" /></td></tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -604,40 +604,40 @@ echo '<tr><td>'._('Branch Name').':</td>'; if (!isset($_POST['BrName'])) {$_POST['BrName']='';} - echo '<td><input tabindex=2 type="text" name="BrName" size=41 maxlength=40 value="'. $_POST['BrName'].'"></td></tr>'; + echo '<td><input tabindex="2" type="text" name="BrName" size="41" maxlength="40" value="'. $_POST['BrName'].'" /></td></tr>'; echo '<tr><td>'._('Branch Contact').':</td>'; if (!isset($_POST['ContactName'])) {$_POST['ContactName']='';} - echo '<td><input tabindex=3 type="text" name="ContactName" size=41 maxlength=40 value="'. $_POST['ContactName'].'"></td></tr>'; + echo '<td><input tabindex="3" type="text" name="ContactName" size="41" maxlength="40" value="'. $_POST['ContactName'].'" /></td></tr>'; echo '<tr><td>'._('Street Address 1 (Street)').':</td>'; if (!isset($_POST['BrAddress1'])) {$_POST['BrAddress1']='';} - echo '<td><input tabindex=4 type="text" name="BrAddress1" size=41 maxlength=40 value="'. $_POST['BrAddress1'].'"></td></tr>'; + echo '<td><input tabindex="4" type="text" name="BrAddress1" size="41" maxlength="40" value="'. $_POST['BrAddress1'].'" /></td></tr>'; echo '<tr><td>'._('Street Address 2 (Suburb/City)').':</td>'; if (!isset($_POST['BrAddress2'])) {$_POST['BrAddress2']='';} - echo '<td><input tabindex=5 type="text" name="BrAddress2" size=41 maxlength=40 value="'. $_POST['BrAddress2'].'"></td></tr>'; + echo '<td><input tabindex="5" type="text" name="BrAddress2" size="41" maxlength="40" value="'. $_POST['BrAddress2'].'" /></td></tr>'; echo '<tr><td>'._('Street Address 3 (State)').':</td>'; if (!isset($_POST['BrAddress3'])) {$_POST['BrAddress3']='';} - echo '<td><input tabindex=6 type="text" name="BrAddress3" size=41 maxlength=40 value="'. $_POST['BrAddress3'].'"></td></tr>'; + echo '<td><input tabindex="6" type="text" name="BrAddress3" size="41" maxlength="40" value="'. $_POST['BrAddress3'].'" /></td></tr>'; echo '<tr><td>'._('Street Address 4 (Postal Code)').':</td>'; if (!isset($_POST['BrAddress4'])) {$_POST['BrAddress4']='';} - echo '<td><input tabindex=7 type="text" name="BrAddress4" size=31 maxlength=40 value="'. $_POST['BrAddress4'].'"></td></tr>'; + echo '<td><input tabindex="7" type="text" name="BrAddress4" size="31" maxlength="40" value="'. $_POST['BrAddress4'].'" /></td></tr>'; echo '<tr><td>'._('Street Address 5').':</td>'; if (!isset($_POST['BrAddress5'])) {$_POST['BrAddress5']='';} - echo '<td><input tabindex=8 type="text" name="BrAddress5" size=21 maxlength=20 value="'. $_POST['BrAddress5'].'"></td></tr>'; + echo '<td><input tabindex="8" type="text" name="BrAddress5" size="21" maxlength="20" value="'. $_POST['BrAddress5'].'" /></td></tr>'; echo '<tr><td>'._('Street Address 6').':</td>'; if (!isset($_POST['BrAddress6'])) {$_POST['BrAddress6']='';} - echo '<td><input tabindex=9 type="text" name="BrAddress6" size=16 maxlength=15 value="'. $_POST['BrAddress6'].'"></td></tr>'; + echo '<td><input tabindex="9" type="text" name="BrAddress6" size="16" maxlength="15" value="'. $_POST['BrAddress6'].'" /></td></tr>'; echo '<tr><td>'._('Special Instructions').':</td>'; if (!isset($_POST['specialinstructions'])) {$_POST['specialinstructions']='';} - echo '<td><input tabindex=10 type="text" name="specialinstructions" size=56 value="'. $_POST['specialinstructions'].'"></td></tr>'; + echo '<td><input tabindex="10" type="text" name="specialinstructions" size="56" value="'. $_POST['specialinstructions'].'" /></td></tr>'; echo '<tr><td>'._('Default days to deliver').':</td>'; if (!isset($_POST['EstDeliveryDays'])) {$_POST['EstDeliveryDays']=0;} - echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex=11 type="text" class="number" name="EstDeliveryDays" size=4 maxlength=2 value='. $_POST['EstDeliveryDays'].'></td></tr>'; + echo '<td><input ' .(in_array('EstDeliveryDays',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="11" type="text" class="number" name="EstDeliveryDays" size="4" maxlength="2" value="'. $_POST['EstDeliveryDays'].'" /></td></tr>'; echo '<tr><td>'._('Forward Date After (day in month)').':</td>'; if (!isset($_POST['FwdDate'])) {$_POST['FwdDate']=0;} - echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex=12 type="text" class="number" name="FwdDate" size=4 maxlength=2 value='. $_POST['FwdDate'].'></td></tr>'; + echo '<td><input ' .(in_array('FwdDate',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="12" type="text" class="number" name="FwdDate" size="4" maxlength="2" value="'. $_POST['FwdDate'].'" /></td></tr>'; echo '<tr><td>'._('Salesperson').':</td>'; - echo '<td><select tabindex=13 name="Salesman">'; + echo '<td><select tabindex="13" name="Salesman">'; while ($myrow = DB_fetch_array($result)) { if (isset($_POST['Salesman']) and $myrow['salesmancode']==$_POST['Salesman']) { Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2011-07-27 21:00:31 UTC (rev 7158) +++ trunk/DailyBankTransactions.php 2011-07-27 21:00:48 UTC (rev 7159) @@ -46,12 +46,12 @@ echo '</select></td></tr>'; } echo '<tr><td>' . _('Transactions Dated From') . ':</td> - <td><input type="text" name="FromTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . - date($_SESSION['DefaultDateFormat']) . '"></td></tr> + <td><input type="text" name="FromTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . + date($_SESSION['DefaultDateFormat']) . '" /></td></tr> <tr><td>' . _('Transactions Dated To') . ':</td> - <td><input type="text" name="ToTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 + <td><input type="text" name="ToTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . - date($_SESSION['DefaultDateFormat']) . '"></td> + date($_SESSION['DefaultDateFormat']) . '" /></td> </tr>'; echo '</table>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-27 21:01:27
|
Revision: 7161 http://weberp.svn.sourceforge.net/weberp/?rev=7161&view=rev Author: tim_schofield Date: 2011-07-27 21:01:21 +0000 (Wed, 27 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/AddCustomerNotes.php trunk/ConfirmDispatch_Invoice.php Modified: trunk/AddCustomerNotes.php =================================================================== --- trunk/AddCustomerNotes.php 2011-07-27 21:01:02 UTC (rev 7160) +++ trunk/AddCustomerNotes.php 2011-07-27 21:01:21 UTC (rev 7161) @@ -182,23 +182,23 @@ } echo '<tr><td>'. _('WWW').'</td>'; if (isset($_POST['href'])) { - echo '<td><input type="text" name="href" value="'.$_POST['href'].'" size=35 maxlength=100></td></tr>'; + echo '<td><input type="text" name="href" value="'.$_POST['href'].'" size="35" maxlength="100" /></td></tr>'; } else { - echo '<td><input type="text" name="href" size=35 maxlength=100></td></tr>'; + echo '<td><input type="text" name="href" size="35" maxlength="100" /></td></tr>'; } echo '<tr><td>' . _('Date') .'</td>'; if (isset($_POST['date'])) { - echo '<td><input type="text" name="date" value="'.ConvertSQLDate($_POST['date']).'" size=10 maxlength=10></td></tr>'; + echo '<td><input type="text" name="date" value="'.ConvertSQLDate($_POST['date']).'" size="10" maxlength="10" /></td></tr>'; } else { - echo '<td><input type="text" name="date" size=10 maxlength=10></td></tr>'; + echo '<td><input type="text" name="date" size="10" maxlength="10" /></td></tr>'; } echo '<tr><td>'. _('Priority'). '</td>'; if (isset($_POST['priority'])) { - echo '<td><input type="text" name="priority" value="' .$_POST['priority']. '" size=1 maxlength=3></td></td>'; + echo '<td><input type="text" name="priority" value="' .$_POST['priority']. '" size="1" maxlength="3" /></td></td>'; } else { - echo '<td><input type="text" name="priority" size=1 maxlength=3></td></td>'; + echo '<td><input type="text" name="priority" size="1" maxlength="3"></td></td>'; } - echo '<tr><td colspan=2><div class="centre"><input type="submit" name="submit" value="'._('Enter Information').'"></div></td></tr>'; + echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="'._('Enter Information').'"></div></td></tr>'; echo '</table>'; echo '</form>'; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-07-27 21:01:02 UTC (rev 7160) +++ trunk/ConfirmDispatch_Invoice.php 2011-07-27 21:01:21 UTC (rev 7161) @@ -323,15 +323,15 @@ if (isset($_POST['ProcessInvoice'])) { echo '<td class="number">' . $LnItm->QtyDispatched . '</td>'; } else { - echo '<td class="number"><input type="hidden" name="' . $LnItm->LineNumber . '_QtyDispatched" value="' . - $LnItm->QtyDispatched . '"><a href="' . $rootpath .'/ConfirmDispatchControlled_Invoice.php?LineNo='. $LnItm->LineNumber.'">' .$LnItm->QtyDispatched . '</a></td>'; + echo '<td class="number"><input type="hidden" name="' . $LnItm->LineNumber . '_QtyDispatched" value="' .$LnItm->QtyDispatched . '" /> + <a href="' . $rootpath .'/ConfirmDispatchControlled_Invoice.php?LineNo='. $LnItm->LineNumber.'">' .$LnItm->QtyDispatched . '</a></td>'; } } else { if (isset($_POST['ProcessInvoice'])) { echo '<td class="number">' . $LnItm->QtyDispatched . '</td>'; } else { - echo '<td class="number"><input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . - '_QtyDispatched" maxlength=12 size=12 value="' . $LnItm->QtyDispatched . '"></td>'; + echo '<td class="number"> + <input tabindex="'.$j.'" type="text" class="number" name="' . $LnItm->LineNumber . '_QtyDispatched" maxlength="12" size="12" value="' . $LnItm->QtyDispatched . '" /></td>'; } } $DisplayDiscountPercent = number_format($LnItm->DiscountPercent*100,2) . '%'; @@ -369,7 +369,7 @@ echo $Tax->TaxRate*100; } else { echo '<input type="text" class="number" name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . - '_TaxRate" maxlength=4 size=4 value="' . $Tax->TaxRate*100 . '">'; + '_TaxRate" maxlength="4" size="4" value="' . $Tax->TaxRate*100 . '">'; } $i++; if ($Tax->TaxOnTax ==1){ @@ -405,7 +405,7 @@ echo '</tr>'; if (mb_strlen($LnItm->Narrative)>1){ $narrative=str_replace('\r\n','<br />', $LnItm->Narrative); - echo $RowStarter . '<td colspan=12>' . stripslashes($narrative) . '</td></tr>'; + echo $RowStarter . '<td colspan="12">' . stripslashes($narrative) . '</td></tr>'; } }//end foreach ($line) @@ -1650,19 +1650,19 @@ $j++; echo '<tr> <td>' . _('Consignment Note Ref'). ':</td> - <td><input tabindex='.$j.' type="text" maxlength=15 size=15 name=Consignment value="' . $_POST['Consignment'] . '"></td> + <td><input tabindex='.$j.' type="text" maxlength="15" size="15" name="Consignment" value="' . $_POST['Consignment'] . '" /></td> </tr>'; $j++; echo '<tr> <td>'._('Action For Balance'). ':</td> - <td><select tabindex='.$j.' name=BOPolicy> + <td><select tabindex="'.$j.'" name="BOPolicy"> <option selected="True" value="BO">'._('Automatically put balance on back order') . '</option> <option value="CAN">'._('Cancel any quantities not delivered') . '</option>'.'</select></td> </tr>'; $j++; echo '<tr> <td>' ._('Invoice Text'). ':</td> - <td><textarea tabindex="'.$j.'" name="InvoiceText" COLS="31" ROWS="5">' . reverse_escape($_POST['InvoiceText']) . '</textarea></td> + <td><textarea tabindex="'.$j.'" name="InvoiceText" cols="31" rows="5">' . reverse_escape($_POST['InvoiceText']) . '</textarea></td> </tr>'; $j++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-28 16:54:56
|
Revision: 7198 http://weberp.svn.sourceforge.net/weberp/?rev=7198&view=rev Author: tim_schofield Date: 2011-07-28 16:54:49 +0000 (Thu, 28 Jul 2011) Log Message: ----------- Improvements to testing suite Modified Paths: -------------- trunk/build/tests/SupplierTest.php trunk/build/tests/classes/URLDetails.class.php trunk/build/tests/includes/SelectModule.php trunk/build/tests/includes/login.php trunk/includes/header.inc Modified: trunk/build/tests/SupplierTest.php =================================================================== --- trunk/build/tests/SupplierTest.php 2011-07-27 21:10:53 UTC (rev 7197) +++ trunk/build/tests/SupplierTest.php 2011-07-28 16:54:49 UTC (rev 7198) @@ -2,7 +2,9 @@ <?php include('includes/config.php'); + include('includes/login.php'); +include('includes/SelectModule.php'); include('includes/validators/XhtmlValidator.php'); include('classes/URLDetails.class.php'); @@ -10,9 +12,11 @@ //Set up the session ID //open connection $ch = curl_init(); +$TestSessionID = sha1(uniqid(mt_rand(), true)); -$IndexPage=webERPLogIn($ch, $RootPath, $CompanyName, $UserName, $Password); - +$IndexPage=webERPLogIn($ch, $TestSessionID, $RootPath, $ServerPath, $CompanyName, $UserName, $Password); +$APPage=FindModule($ch, $RootPath, $ServerPath, $TestSessionID, $IndexPage, 'AP'); +//echo $APPage; curl_close($ch); /* Modified: trunk/build/tests/classes/URLDetails.class.php =================================================================== --- trunk/build/tests/classes/URLDetails.class.php 2011-07-27 21:10:53 UTC (rev 7197) +++ trunk/build/tests/classes/URLDetails.class.php 2011-07-28 16:54:49 UTC (rev 7198) @@ -9,6 +9,8 @@ function __construct($SessionID) { $this->SessionID = $SessionID; + $this->xml = new DOMDocument(); + $this->PostArray=array(); if (!file_exists('/tmp/'.$this->SessionID)) mkdir('/tmp/'.$this->SessionID); } @@ -61,143 +63,133 @@ public function Load($name) { } - private function GetTextDetails($xml) { + private function GetTextDetails() { $Texts=array(); - $result=$xml->xpath('//input'); - $j = 0; - for ($i=0; $i<sizeOf($result); $i++) { - foreach ($result[$i]->attributes() as $key=>$value) { - if ($key=='type' and $value=='text') { - foreach ($result[$i]->attributes() as $key=>$value) { - $Texts['text'][$j][$key]=(string)$value[0]; - } - $j++; + $result=$this->xml->getElementsByTagName('input'); + $k=0; + for ($i=0; $i<$result->length; $i++) { + if ($result->item($i)->getAttribute('type')=='text') { + for ($j=0; $j<$result->item($i)->attributes->length; $j++) { + $name = $result->item($i)->attributes->item($j)->name; +// echo $name.' '.$result->item($i)->attributes->getNamedItem($name)->nodeValue . "\n"; + $Texts['text'][$k][$name]=(string)$result->item($i)->attributes->getNamedItem($name)->nodeValue; } + $k++; } } return $Texts; } - private function GetSubmitDetails($xml) { + private function GetSubmitDetails() { $Submits=array(); - $result=$xml->xpath('//input'); - $j = 0; - for ($i=0; $i<sizeOf($result); $i++) { - foreach ($result[$i]->attributes() as $key=>$value) { - if ($key=='type' and $value=='submit') { - foreach ($result[$i]->attributes() as $key=>$value) { - $Submits['submit'][$j][$key]=(string)$value[0]; - } - $j++; + $result=$this->xml->getElementsByTagName('input'); + $k=0; + for ($i=0; $i<$result->length; $i++) { + if ($result->item($i)->getAttribute('type')=='submit') { + for ($j=0; $j<$result->item($i)->attributes->length; $j++) { + $name = $result->item($i)->attributes->item($j)->name; + $Submits['submit'][$k][$name]=(string)$result->item($i)->attributes->getNamedItem($name)->nodeValue; } + $k++; } } return $Submits; } - private function GetRadioDetails($xml) { + private function GetRadioDetails() { $Radios=array(); - $result=$xml->xpath('//input'); - $j = 0; - for ($i=0; $i<sizeOf($result); $i++) { - foreach ($result[$i]->attributes() as $key=>$value) { - if ($key=='type' and $value=='radio') { - foreach ($result[$i]->attributes() as $key=>$value) { - $Radios['radio'][$j][$key]=(string)$value[0]; - } - $j++; + $result=$this->xml->getElementsByTagName('input'); + $k=0; + for ($i=0; $i<$result->length; $i++) { + if ($result->item($i)->getAttribute('type')=='radio') { + for ($j=0; $j<$result->item($i)->attributes->length; $j++) { + $name = $result->item($i)->attributes->item($j)->name; + $Radios['radio'][$k][$name]=(string)$result->item($i)->attributes->getNamedItem($name)->nodeValue; } + $k++; } } return $Radios; } - private function GetCheckBoxDetails($xml) { + private function GetCheckBoxDetails() { $CheckBoxs=array(); - $result=$xml->xpath('//input'); - $j = 0; - for ($i=0; $i<sizeOf($result); $i++) { - foreach ($result[$i]->attributes() as $key=>$value) { - if ($key=='type' and $value=='checkbox') { - foreach ($result[$i]->attributes() as $key=>$value) { - $CheckBoxs['checkbox'][$j][$key]=(string)$value[0]; - } - $j++; + $result=$this->xml->getElementsByTagName('input'); + $k=0; + for ($i=0; $i<$result->length; $i++) { + if ($result->item($i)->getAttribute('type')=='checkbox') { + for ($j=0; $j<$result->item($i)->attributes->length; $j++) { + $name = $result->item($i)->attributes->item($j)->name; + $CheckBoxs['checkbox'][$k][$name]=(string)$result->item($i)->attributes->getNamedItem($name)->nodeValue; } + $k++; } } return $CheckBoxs; } - private function GetHiddenDetails($xml) { + private function GetHiddenDetails() { $Hiddens=array(); - $result=$xml->xpath('//input'); - $j = 0; - for ($i=0; $i<sizeOf($result); $i++) { - foreach ($result[$i]->attributes() as $key=>$value) { - if ($key=='type' and $value=='hidden') { - foreach ($result[$i]->attributes() as $key=>$value) { - $Hiddens['hidden'][$j][$key]=(string)$value[0]; - } - $j++; + $result=$this->xml->getElementsByTagName('input'); + $k=0; + for ($i=0; $i<$result->length; $i++) { + if ($result->item($i)->getAttribute('type')=='hidden') { + for ($j=0; $j<$result->item($i)->attributes->length; $j++) { + $name = $result->item($i)->attributes->item($j)->name; + $Hiddens['hidden'][$k][$name]=(string)$result->item($i)->attributes->getNamedItem($name)->nodeValue; } + $k++; } } return $Hiddens; } - private function GetHREFDetails($xml) { - $Links=array(); - print_r($xml); - $result=$xml->xpath('//title'); - $j = 0; - for ($i=0; $i<sizeOf($result); $i++) { - foreach ($result[$i]->attributes() as $key=>$value) { - echo $key.' '.$value."\n"; - foreach ($result[$i]->attributes() as $key=>$value) { - $Links['a'][$j][$key]=(string)$value[0]; - } - } - } - return $Links; - } - - private function GetPasswordDetails($xml) { + private function GetPasswordDetails() { $Passwords=array(); - $result=$xml->xpath('//input'); - $j = 0; - for ($i=0; $i<sizeOf($result); $i++) { - foreach ($result[$i]->attributes() as $key=>$value) { - if ($key=='type' and $value=='password') { - foreach ($result[$i]->attributes() as $key=>$value) { - $Passwords['password'][$j][$key]=(string)$value[0]; - } - $j++; + $result=$this->xml->getElementsByTagName('input'); + $k=0; + for ($i=0; $i<$result->length; $i++) { + if ($result->item($i)->getAttribute('type')=='password') { + for ($j=0; $j<$result->item($i)->attributes->length; $j++) { + $name = $result->item($i)->attributes->item($j)->name; + $Passwords['password'][$k][$name]=(string)$result->item($i)->attributes->getNamedItem($name)->nodeValue; } + $k++; } } return $Passwords; } - private function GetSelectDetails($xml) { + private function GetSelectDetails() { $Selects=array(); - $result=$xml->xpath('//select'); - $j = 0; - for ($i=0; $i<sizeOf($result); $i++) { - foreach ($result[$i]->attributes() as $key=>$value) { - $result1=$value->xpath('//option'); - $name=(string)$value; - for ($k=0; $k<sizeOf($result1); $k++) { - foreach ($result1[$j]->attributes() as $key=>$value) { - $Selects['select'][$name]['options'][$j][$key]=(string)$value; + $result=$this->xml->getElementsByTagName('select'); + for ($i=0; $i<$result->length; $i++) { + $SelectName=$result->item($i)->getAttribute('name'); + $result1=$result->item($i)->getElementsByTagName('option'); + for ($j=0; $j<$result1->length; $j++) { + for ($k=0; $k<$result1->item($j)->attributes->length; $k++) { + $name = $result1->item($j)->attributes->item($k)->name; + $Selects['select'][$SelectName]['options'][$j][$name]=(string)$result1->item($j)->attributes->getNamedItem($name)->nodeValue; } - $j++; - } } } return $Selects; } + private function GetHREFDetails() { + $Links=array(); + $result=$this->xml->getElementsByTagName('a'); + $k=0; + for ($i=0; $i<$result->length; $i++) { + for ($j=0; $j<$result->item($i)->attributes->length; $j++) { + $name = $result->item($i)->attributes->item($j)->name; + $Links[$k][$name]=(string)$result->item($i)->attributes->getNamedItem($name)->nodeValue; + } + $k++; + } + return $Links; + } + public function GetFormDetails() { $this->FormDetails['Texts']=$this->GetTextDetails($this->xml); $this->FormDetails['Passwords']=$this->GetPasswordDetails($this->xml); @@ -212,10 +204,20 @@ return $result; } - private function ValidateLink($html) { + private function ValidateLinks($ServerPath, $ch) { + for ($i=0; $i<sizeOf($this->Links); $i++) { + curl_setopt($ch,CURLOPT_URL,$ServerPath.$this->Links[$i]['href']); + curl_setopt($ch,CURLOPT_RETURNTRANSFER,True); + curl_setopt($ch,CURLOPT_COOKIEJAR,'/tmp/'.$this->SessionID.'/curl.txt'); + $result = curl_exec($ch); + $response = curl_getinfo( $ch ); + if ($response['http_code']!=200) { + error_log($i.' '.$this->Links[$i]['href'].' '.$response['http_code']."\n", 3, '/home/tim/weberp'.$this->SessionID.'.log'); + } + } } - public function FetchPage($RootPath, $ch) { + public function FetchPage($RootPath, $ServerPath, $ch) { //url-ify the data for the POST $fields_string=''; foreach($this->GetPostArray() as $key=>$value) { @@ -233,11 +235,16 @@ //execute post $result = curl_exec($ch); - $this->xml = simplexml_load_string($result); + $this->xml->loadHTML($result); $answer = $this->ValidateHTML($result); - $this->GetHREFDetails($this->xml); + + $this->Links=$this->GetHREFDetails(); + $this->ValidateLinks($ServerPath, $ch); + $this->GetFormDetails(); + return $result; + } } Modified: trunk/build/tests/includes/SelectModule.php =================================================================== --- trunk/build/tests/includes/SelectModule.php 2011-07-27 21:10:53 UTC (rev 7197) +++ trunk/build/tests/includes/SelectModule.php 2011-07-28 16:54:49 UTC (rev 7198) @@ -1,8 +1,12 @@ <?php -$ModuleID=mb_substr(mb_strstr($result, $ModuleName, true),-4,2); -$url=$RootPath.'index.php?Application='.$ModuleID; +function FindModule($ch, $RootPath, $ServerPath, $TestSessionID, $IndexPage, $Module) { + $SelectedModuleScreen = new URLDetails($TestSessionID); + $SelectedModuleScreen->SetURL('index.php?Application='.$Module); -include('GetURL.php'); + $ModulePage=$SelectedModuleScreen->FetchPage($RootPath, $ServerPath, $ch); + return $ModulePage; +} + ?> \ No newline at end of file Modified: trunk/build/tests/includes/login.php =================================================================== --- trunk/build/tests/includes/login.php 2011-07-27 21:10:53 UTC (rev 7197) +++ trunk/build/tests/includes/login.php 2011-07-28 16:54:49 UTC (rev 7198) @@ -1,13 +1,12 @@ <?php -function webERPLogIn($ch, $RootPath, $Company, $UserName, $Password) { - $TestSessionID = sha1(uniqid(mt_rand(), true)); +function webERPLogIn($ch, $TestSessionID, $RootPath, $ServerPath, $Company, $UserName, $Password) { $LoginScreenDetails = new URLDetails($TestSessionID); $LoginScreenDetails->SetURL('index.php'); $LoginScreenDetails->SetPostArray(array()); - $LoginScreenDetails->FetchPage($RootPath, $ch); + $LoginScreenDetails->FetchPage($RootPath, $ServerPath, $ch); for ($i=0; $i<sizeOf($LoginScreenDetails->FormDetails['Selects']['select']['CompanyNameField']['options']); $i++) { if ($LoginScreenDetails->FormDetails['Selects']['select']['CompanyNameField']['options'][$i]['label']==$Company) { @@ -44,13 +43,17 @@ } } + $LoginScreenDetails->__destruct(); + $IndexScreenDetails = new URLDetails($TestSessionID); $IndexScreenDetails->SetURL('index.php'); $IndexScreenDetails->SetPostArray($PostArray); - $IndexScreenDetails->FetchPage($RootPath, $ch); + $IndexPage=$IndexScreenDetails->FetchPage($RootPath, $ServerPath, $ch); - return $IndexScreenDetails; + $IndexScreenDetails->__destruct(); + + return $IndexPage; } ?> \ No newline at end of file Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2011-07-27 21:10:53 UTC (rev 7197) +++ trunk/includes/header.inc 2011-07-28 16:54:49 UTC (rev 7198) @@ -6,7 +6,7 @@ // $rootpath // $title - should be defined in the page this file is included with - $StrictXHTML=True; + $StrictXHTML=False; if (!headers_sent()){ if ($StrictXHTML) { @@ -41,8 +41,8 @@ echo '<tr>'; echo '<td align="left" style="width:100%;" class="quick_menu_left">'; // Use icons for company and user data, saves screen realestate, use ALT tag in case theme icon not avail. - echo '<img src="'.$rootpath.'/css/'.$theme.'/images/company.png" title="' . _('Company') . '" ALT="' . _('Company') . '"></img>'; - echo ' ' . stripslashes($_SESSION['CompanyRecord']['coyname']) . ' <a href="' . $rootpath . '/UserSettings.php"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" TITLE="User" ALT="' . _('User') . '"> </img>' . stripslashes($_SESSION['UsersRealName']) . '</a>'; + echo '<img src="'.$rootpath.'/css/'.$theme.'/images/company.png" title="' . _('Company') . '" ALT="' . _('Company') . '" />'; + echo ' ' . stripslashes($_SESSION['CompanyRecord']['coyname']) . ' <a href="' . $rootpath . '/UserSettings.php"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" TITLE="User" ALT="' . _('User') . '" /> ' . stripslashes($_SESSION['UsersRealName']) . '</a>'; // Make the title text a class, can be set to display:none is some themes echo '<br /><font class="header_title"> ' . $title . '</font></td>'; echo '<td class="quick_menu_tabs">'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-29 16:11:53
|
Revision: 7206 http://weberp.svn.sourceforge.net/weberp/?rev=7206&view=rev Author: tim_schofield Date: 2011-07-29 16:11:46 +0000 (Fri, 29 Jul 2011) Log Message: ----------- Improvements to testing suite Modified Paths: -------------- trunk/build/tests/SupplierTest.php trunk/build/tests/classes/URLDetails.class.php trunk/build/tests/includes/SelectMenuOption.php trunk/includes/header.inc Modified: trunk/build/tests/SupplierTest.php =================================================================== --- trunk/build/tests/SupplierTest.php 2011-07-29 16:11:31 UTC (rev 7205) +++ trunk/build/tests/SupplierTest.php 2011-07-29 16:11:46 UTC (rev 7206) @@ -5,6 +5,7 @@ include('includes/login.php'); include('includes/SelectModule.php'); +include('includes/SelectMenuOption.php'); include('includes/validators/XhtmlValidator.php'); include('classes/URLDetails.class.php'); @@ -16,12 +17,8 @@ $IndexPage=webERPLogIn($ch, $TestSessionID, $RootPath, $ServerPath, $CompanyName, $UserName, $Password); $APPage=FindModule($ch, $RootPath, $ServerPath, $TestSessionID, $IndexPage, 'AP'); +$SupplierInsertPage=ChooseMenuOption($ch, $RootPath, $ServerPath, $TestSessionID, $APPage, 'Add Supplier'); //echo $APPage; curl_close($ch); -/* -exec('cat /tmp/'.$TestSessionID.'/login', $output); -echo $output[0]; - -*/ ?> \ No newline at end of file Modified: trunk/build/tests/classes/URLDetails.class.php =================================================================== --- trunk/build/tests/classes/URLDetails.class.php 2011-07-29 16:11:31 UTC (rev 7205) +++ trunk/build/tests/classes/URLDetails.class.php 2011-07-29 16:11:46 UTC (rev 7206) @@ -6,6 +6,7 @@ private $URL; private $PostArray; public $xml; + public $Links; function __construct($SessionID) { $this->SessionID = $SessionID; @@ -184,6 +185,7 @@ for ($j=0; $j<$result->item($i)->attributes->length; $j++) { $name = $result->item($i)->attributes->item($j)->name; $Links[$k][$name]=(string)$result->item($i)->attributes->getNamedItem($name)->nodeValue; + $Links[$k]['value']=$result->item($i)->nodeValue; } $k++; } Modified: trunk/build/tests/includes/SelectMenuOption.php =================================================================== --- trunk/build/tests/includes/SelectMenuOption.php 2011-07-29 16:11:31 UTC (rev 7205) +++ trunk/build/tests/includes/SelectMenuOption.php 2011-07-29 16:11:46 UTC (rev 7206) @@ -1,9 +1,7 @@ <?php -$OptionURL=mb_substr(mb_strstr(mb_substr(mb_strstr($result, $OptionName, true),-100,98), 'href', false),6); +function ChooseMenuOption($ch, $RootPath, $ServerPath, $TestSessionID, $IndexPage, $MenuOption) { -$url=$ServerPath.$OptionURL; +} -include('GetURL.php'); - ?> \ No newline at end of file Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2011-07-29 16:11:31 UTC (rev 7205) +++ trunk/includes/header.inc 2011-07-29 16:11:46 UTC (rev 7206) @@ -42,7 +42,7 @@ echo '<td align="left" style="width:100%;" class="quick_menu_left">'; // Use icons for company and user data, saves screen realestate, use ALT tag in case theme icon not avail. echo '<img src="'.$rootpath.'/css/'.$theme.'/images/company.png" title="' . _('Company') . '" ALT="' . _('Company') . '" />'; - echo ' ' . stripslashes($_SESSION['CompanyRecord']['coyname']) . ' <a href="' . $rootpath . '/UserSettings.php"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" TITLE="User" ALT="' . _('User') . '" /> ' . stripslashes($_SESSION['UsersRealName']) . '</a>'; + echo ' ' . stripslashes($_SESSION['CompanyRecord']['coyname']) . ' <a href="' . $rootpath . '/UserSettings.php"><img src="'.$rootpath.'/css/'.$theme.'/images/user.png" TITLE="User" ALT="' . _('User') . '" />' . stripslashes($_SESSION['UsersRealName']) . '</a>'; // Make the title text a class, can be set to display:none is some themes echo '<br /><font class="header_title"> ' . $title . '</font></td>'; echo '<td class="quick_menu_tabs">'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-29 21:31:59
|
Revision: 7326 http://weberp.svn.sourceforge.net/weberp/?rev=7326&view=rev Author: tim_schofield Date: 2011-07-29 21:31:52 +0000 (Fri, 29 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/SelectOrderItems.php trunk/StockMovements.php Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-07-29 21:31:37 UTC (rev 7325) +++ trunk/SelectOrderItems.php 2011-07-29 21:31:52 UTC (rev 7326) @@ -1399,7 +1399,9 @@ if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ echo $RowStarter; - echo '<td colspan=10>' . _('Narrative') . ':<textarea name="Narrative_' . $OrderLine->LineNumber . '" cols="100%" rows="1">' . stripslashes(AddCarriageReturns($OrderLine->Narrative)) . '</textarea><br /></td></tr>'; + echo '<td colspan="10">' . _('Narrative') . ': + <textarea name="Narrative_' . $OrderLine->LineNumber . '" cols="100%" rows="1">' . stripslashes(AddCarriageReturns($OrderLine->Narrative)) . '</textarea> + <br /></td></tr>'; } else { echo '<input type="hidden" name="Narrative" value="" />'; } Modified: trunk/StockMovements.php =================================================================== --- trunk/StockMovements.php 2011-07-29 21:31:37 UTC (rev 7325) +++ trunk/StockMovements.php 2011-07-29 21:31:52 UTC (rev 7326) @@ -32,8 +32,8 @@ if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-3,Date('d'),Date('y'))); } -echo '<br /><table cellpadding=2 class="selection">'; -echo '<tr><th colspan=10>' . _('Stock Code') . ':<input type="text" name="StockID" size="21" value="'.$StockID.'" maxlength="20" />'; +echo '<br /><table cellpadding="2" class="selection">'; +echo '<tr><th colspan="10">' . _('Stock Code') . ':<input type="text" name="StockID" size="21" value="'.$StockID.'" maxlength="20" />'; echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; @@ -56,8 +56,10 @@ } echo '</select></th></tr>'; -echo '<tr><th colspan=10>' . _('Show Movements before') . ': <input type="text" name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" value="' . $_POST['BeforeDate'] . '">'; -echo ' ' . _('But after') . ': <input type="text" name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" value="' . $_POST['AfterDate'] . '">'; +echo '<tr><th colspan="10">' . _('Show Movements before') . ': + <input type="text" name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" value="' . $_POST['BeforeDate'] . '" />'; +echo ' ' . _('But after') . ': + <input type="text" name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" value="' . $_POST['AfterDate'] . '" />'; echo ' <input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '" /></th></tr>'; $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2011-07-31 20:50:06
|
Revision: 7415 http://weberp.svn.sourceforge.net/weberp/?rev=7415&view=rev Author: tim_schofield Date: 2011-07-31 20:50:00 +0000 (Sun, 31 Jul 2011) Log Message: ----------- XHTML corrections to code Modified Paths: -------------- trunk/AddCustomerContacts.php trunk/BOMs.php Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2011-07-31 20:49:37 UTC (rev 7414) +++ trunk/AddCustomerContacts.php 2011-07-31 20:50:00 UTC (rev 7415) @@ -183,21 +183,21 @@ echo '<tr><td>'. _('Contact Name') . '</td>'; if (isset($_POST['conName'])) { - echo '<td><input type="text" name="conName" value="' . $_POST['conName']. '" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="conName" value="' . $_POST['conName']. '" size="35" maxlength="40" /></td></tr>'; } else { - echo '<td><input type="text" name="conName" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="conName" size="35" maxlength="40"></td></tr>'; } echo '<tr><td>' . _('Role') . '</td>'; if (isset($_POST['conRole'])) { - echo '<td><input type="text" name="conRole" value="'. $_POST['conRole']. '" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="conRole" value="'. $_POST['conRole']. '" size="35" maxlength="40" /></td></tr>'; } else { - echo '<td><input type="text" name="conRole" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="conRole" size="35" maxlength="40"></td></tr>'; } echo '<tr><td>' . _('Phone') . '</td>'; if (isset($_POST['conPhone'])) { - echo '<td><input type="text" name="conPhone" value="' . $_POST['conPhone'] . '" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="conPhone" value="' . $_POST['conPhone'] . '" size="35" maxlength="40" /></td></tr>'; } else { - echo '<td><input type="text" name="conPhone"" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="conPhone"" size="35" maxlength="40" /></td></tr>'; } echo '<tr><td>' . _('Notes') . '</td>'; if (isset($_POST['conNotes'])) { Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-07-31 20:49:37 UTC (rev 7414) +++ trunk/BOMs.php 2011-07-31 20:50:00 UTC (rev 7415) @@ -795,7 +795,7 @@ ', ' . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. '</font><br /><table class="selection" cellpadding="3" colspan="4"><tr><td><font size="1">' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td><td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25"></td> - <td><font size=3><b>' . _('OR') . '</b></font></td><td><font size="1">' . _('Enter extract of the') . + <td><font size="3"><b>' . _('OR') . '</b></font></td><td><font size="1">' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td><td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="18"></td> </tr></table><br /><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '"></div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |