From: <dai...@us...> - 2012-01-15 06:52:19
|
Revision: 4798 http://web-erp.svn.sourceforge.net/web-erp/?rev=4798&view=rev Author: daintree Date: 2012-01-15 06:52:12 +0000 (Sun, 15 Jan 2012) Log Message: ----------- removed db_ in function names replaced with DB_ Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/Credit_Invoice.php Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2012-01-13 07:17:29 UTC (rev 4797) +++ trunk/ConfirmDispatch_Invoice.php 2012-01-15 06:52:12 UTC (rev 4798) @@ -160,9 +160,9 @@ $DbgMsg = _('The SQL that failed was'); $LineItemsResult = DB_query($LineItemsSQL,$db,$ErrMsg,$DbgMsg); - if (db_num_rows($LineItemsResult)>0) { + if (DB_num_rows($LineItemsResult)>0) { - while ($myrow=db_fetch_array($LineItemsResult)) { + while ($myrow=DB_fetch_array($LineItemsResult)) { $_SESSION['Items'.$identifier]->add_to_cart($myrow['stkcode'], $myrow['quantity'], Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-01-13 07:17:29 UTC (rev 4797) +++ trunk/Credit_Invoice.php 2012-01-15 06:52:12 UTC (rev 4798) @@ -127,9 +127,9 @@ $LineItemsResult = DB_query($LineItemsSQL,$db,$ErrMsg, $DbgMsg); - if (db_num_rows($LineItemsResult)>0) { + if (DB_num_rows($LineItemsResult)>0) { - while ($myrow=db_fetch_array($LineItemsResult)) { + while ($myrow=DB_fetch_array($LineItemsResult)) { $LineNumber = $_SESSION['CreditItems']->LineCounter; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-15 06:52:19
|
Revision: 4798 http://web-erp.svn.sourceforge.net/web-erp/?rev=4798&view=rev Author: daintree Date: 2012-01-15 06:52:12 +0000 (Sun, 15 Jan 2012) Log Message: ----------- removed db_ in function names replaced with DB_ Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/Credit_Invoice.php Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2012-01-13 07:17:29 UTC (rev 4797) +++ trunk/ConfirmDispatch_Invoice.php 2012-01-15 06:52:12 UTC (rev 4798) @@ -160,9 +160,9 @@ $DbgMsg = _('The SQL that failed was'); $LineItemsResult = DB_query($LineItemsSQL,$db,$ErrMsg,$DbgMsg); - if (db_num_rows($LineItemsResult)>0) { + if (DB_num_rows($LineItemsResult)>0) { - while ($myrow=db_fetch_array($LineItemsResult)) { + while ($myrow=DB_fetch_array($LineItemsResult)) { $_SESSION['Items'.$identifier]->add_to_cart($myrow['stkcode'], $myrow['quantity'], Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-01-13 07:17:29 UTC (rev 4797) +++ trunk/Credit_Invoice.php 2012-01-15 06:52:12 UTC (rev 4798) @@ -127,9 +127,9 @@ $LineItemsResult = DB_query($LineItemsSQL,$db,$ErrMsg, $DbgMsg); - if (db_num_rows($LineItemsResult)>0) { + if (DB_num_rows($LineItemsResult)>0) { - while ($myrow=db_fetch_array($LineItemsResult)) { + while ($myrow=DB_fetch_array($LineItemsResult)) { $LineNumber = $_SESSION['CreditItems']->LineCounter; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-16 09:24:21
|
Revision: 4800 http://web-erp.svn.sourceforge.net/web-erp/?rev=4800&view=rev Author: daintree Date: 2012-01-16 09:24:14 +0000 (Mon, 16 Jan 2012) Log Message: ----------- StockReorderLevel only updates changed fields Modified Paths: -------------- trunk/StockReorderLevel.php trunk/doc/Change.log Modified: trunk/StockReorderLevel.php =================================================================== --- trunk/StockReorderLevel.php 2012-01-15 06:53:30 UTC (rev 4799) +++ trunk/StockReorderLevel.php 2012-01-16 09:24:14 UTC (rev 4800) @@ -70,10 +70,11 @@ } if (isset($_POST['UpdateData']) + AND $_POST['Old_' . $myrow['loccode']]!= filter_number_format($_POST[$myrow['loccode']]) AND is_numeric(filter_number_format($_POST[$myrow['loccode']])) - AND $_POST[$myrow['loccode']]>=0){ + AND filter_number_format($_POST[$myrow['loccode']])>=0){ - $myrow['reorderlevel'] = $_POST[$myrow['loccode']]; + $myrow['reorderlevel'] = filter_number_format($_POST[$myrow['loccode']]); $sql = "UPDATE locstock SET reorderlevel = '" . filter_number_format($_POST[$myrow['loccode']]) . "' WHERE stockid = '" . $StockID . "' AND loccode = '" . $myrow['loccode'] ."'"; @@ -83,10 +84,13 @@ printf('<td>%s</td> <td class="number">%s</td> - <td><input type="text" class="number" name="%s" maxlength="10" size="10" value="%s" /></td>', + <td><input type="text" class="number" name="%s" maxlength="10" size="10" value="%s" /></td> + <input type="hidden" name="Old_%s" value="%s" />', $myrow['locationname'], locale_number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['loccode'], + $myrow['reorderlevel'], + $myrow['loccode'], $myrow['reorderlevel']); $j++; If ($j == 12){ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-15 06:53:30 UTC (rev 4799) +++ trunk/doc/Change.log 2012-01-16 09:24:14 UTC (rev 4800) @@ -1,5 +1,6 @@ webERP Change Log +16/1/12 Phil: Made StockReorderLevel.php just update changed fields rather than update all locations even though they may not have changed. 8/1/12 Phil: Added new api functions to get tax group taxes, list tax authorities, get tax authority details and get tax authority tax rates, also to list and get payment methods 8/1/12 Paul Harness: PcAuthorizeExpenses.php Compare date against SQL raw date format, then convert for display when deciding to display authorize checkbox. 8/1/12 Paul Harness: PcClaimExpensesFromTab.php Use DefaultDateFormat for date in expense entry. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-16 09:24:25
|
Revision: 4800 http://web-erp.svn.sourceforge.net/web-erp/?rev=4800&view=rev Author: daintree Date: 2012-01-16 09:24:14 +0000 (Mon, 16 Jan 2012) Log Message: ----------- StockReorderLevel only updates changed fields Modified Paths: -------------- trunk/StockReorderLevel.php trunk/doc/Change.log Modified: trunk/StockReorderLevel.php =================================================================== --- trunk/StockReorderLevel.php 2012-01-15 06:53:30 UTC (rev 4799) +++ trunk/StockReorderLevel.php 2012-01-16 09:24:14 UTC (rev 4800) @@ -70,10 +70,11 @@ } if (isset($_POST['UpdateData']) + AND $_POST['Old_' . $myrow['loccode']]!= filter_number_format($_POST[$myrow['loccode']]) AND is_numeric(filter_number_format($_POST[$myrow['loccode']])) - AND $_POST[$myrow['loccode']]>=0){ + AND filter_number_format($_POST[$myrow['loccode']])>=0){ - $myrow['reorderlevel'] = $_POST[$myrow['loccode']]; + $myrow['reorderlevel'] = filter_number_format($_POST[$myrow['loccode']]); $sql = "UPDATE locstock SET reorderlevel = '" . filter_number_format($_POST[$myrow['loccode']]) . "' WHERE stockid = '" . $StockID . "' AND loccode = '" . $myrow['loccode'] ."'"; @@ -83,10 +84,13 @@ printf('<td>%s</td> <td class="number">%s</td> - <td><input type="text" class="number" name="%s" maxlength="10" size="10" value="%s" /></td>', + <td><input type="text" class="number" name="%s" maxlength="10" size="10" value="%s" /></td> + <input type="hidden" name="Old_%s" value="%s" />', $myrow['locationname'], locale_number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['loccode'], + $myrow['reorderlevel'], + $myrow['loccode'], $myrow['reorderlevel']); $j++; If ($j == 12){ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-15 06:53:30 UTC (rev 4799) +++ trunk/doc/Change.log 2012-01-16 09:24:14 UTC (rev 4800) @@ -1,5 +1,6 @@ webERP Change Log +16/1/12 Phil: Made StockReorderLevel.php just update changed fields rather than update all locations even though they may not have changed. 8/1/12 Phil: Added new api functions to get tax group taxes, list tax authorities, get tax authority details and get tax authority tax rates, also to list and get payment methods 8/1/12 Paul Harness: PcAuthorizeExpenses.php Compare date against SQL raw date format, then convert for display when deciding to display authorize checkbox. 8/1/12 Paul Harness: PcClaimExpensesFromTab.php Use DefaultDateFormat for date in expense entry. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-18 23:03:56
|
Revision: 4803 http://web-erp.svn.sourceforge.net/web-erp/?rev=4803&view=rev Author: vvs2012 Date: 2012-01-18 23:03:49 +0000 (Wed, 18 Jan 2012) Log Message: ----------- Removed unused .table2 declaration from default.css. Fixed border settings in .table1. Corrected syntax in index.php, Prices.php, SupplierCredit.php Modified Paths: -------------- trunk/Prices.php trunk/SupplierCredit.php trunk/css/aguapop/default.css trunk/css/aguapop/default.css_large trunk/css/default/default.css trunk/css/fresh/default.css trunk/css/gel/default.css trunk/css/jelly/default.css trunk/css/professional/default.css trunk/css/professional-rtl/default.css trunk/css/silverwolf/default.css trunk/doc/Change.log trunk/index.php Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/Prices.php 2012-01-18 23:03:49 UTC (rev 4803) @@ -342,11 +342,11 @@ <tr><td><?php echo _('Price'); ?>:</td> <td> <input type="text" class="number" name="Price" size=12 maxlength=11 value= - <?php + "<?php if(isset($_POST['Price'])) { echo $_POST['Price']; } - ?> > + ?>"> </td></tr> Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/SupplierCredit.php 2012-01-18 23:03:49 UTC (rev 4803) @@ -637,7 +637,7 @@ $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount = filter_number_format($_POST['TaxAmount' . $Tax->TaxCalculationOrder]); } - $TaxTotal += $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount + $TaxTotal += $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount; } $InputError = False; Modified: trunk/css/aguapop/default.css =================================================================== --- trunk/css/aguapop/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/aguapop/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -268,16 +268,9 @@ .table1 { width:90%; background: whitesmoke; - border: 0px 0px 2px 2px darkslategray solid; + border: 1px solid darkslategray; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: whitesmoke; - border: 0px 0px 2px 2px darkslategray solid; - margin: 0 auto; -} input.address3 { text-transform: uppercase; Modified: trunk/css/aguapop/default.css_large =================================================================== --- trunk/css/aguapop/default.css_large 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/aguapop/default.css_large 2012-01-18 23:03:49 UTC (rev 4803) @@ -268,16 +268,9 @@ .table1 { width:90%; background: whitesmoke; - border: 0px 0px 2px 2px darkslategray solid; + border: 1px solid darkslategray; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: whitesmoke; - border: 0px 0px 2px 2px darkslategray solid; - margin: 0 auto; -} input.address3 { text-transform: uppercase; Modified: trunk/css/default/default.css =================================================================== --- trunk/css/default/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/default/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -248,16 +248,9 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - margin: 0 auto; -} input.address3 { text-transform: uppercase; Modified: trunk/css/fresh/default.css =================================================================== --- trunk/css/fresh/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/fresh/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -248,16 +248,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - margin: 0 auto; -} + input.address3 { text-transform: uppercase; } Modified: trunk/css/gel/default.css =================================================================== --- trunk/css/gel/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/gel/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -277,18 +277,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; - margin: 0 auto; -} + input.address3 { text-transform: uppercase; } Modified: trunk/css/jelly/default.css =================================================================== --- trunk/css/jelly/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/jelly/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -316,18 +316,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - margin: 0 auto; -} - input.address3 { text-transform: uppercase; } Modified: trunk/css/professional/default.css =================================================================== --- trunk/css/professional/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/professional/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -249,16 +249,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - margin: 0 auto; -} + input.address3 { text-transform: uppercase; } Modified: trunk/css/professional-rtl/default.css =================================================================== --- trunk/css/professional-rtl/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/professional-rtl/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -243,18 +243,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; - margin: 0 auto; -} + input.address3 { text-transform: uppercase; } Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/silverwolf/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -1,4 +1,4 @@ -@charset "utf-8"; +@charset "UTF-8"; /*--------------------------------------------------\ | | | default.css | |---------------------------------------------------| @@ -322,18 +322,9 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; + border: 1px solid #222; margin: 0 auto; } -// Table type is used for UI tables type 2 -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; - margin: 0 auto; -} input.address3 { text-transform: uppercase; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/doc/Change.log 2012-01-18 23:03:49 UTC (rev 4803) @@ -1,5 +1,6 @@ webERP Change Log +17/1/12 Vitaly: Removed unused .table2 declaration from default.css. Fixed border settings in .table1. 16/1/12 Phil: Made StockReorderLevel.php just update changed fields rather than update all locations even though they may not have changed. 8/1/12 Phil: Added new api functions to get tax group taxes, list tax authorities, get tax authority details and get tax authority tax rates, also to list and get payment methods 8/1/12 Paul Harness: PcAuthorizeExpenses.php Compare date against SQL raw date format, then convert for display when deciding to display authorize checkbox. Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/index.php 2012-01-18 23:03:49 UTC (rev 4803) @@ -274,7 +274,7 @@ <tr> <td class="menu_group_items"> - <table width="100%"class="table_index"> + <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>'; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-18 23:03:57
|
Revision: 4803 http://web-erp.svn.sourceforge.net/web-erp/?rev=4803&view=rev Author: vvs2012 Date: 2012-01-18 23:03:49 +0000 (Wed, 18 Jan 2012) Log Message: ----------- Removed unused .table2 declaration from default.css. Fixed border settings in .table1. Corrected syntax in index.php, Prices.php, SupplierCredit.php Modified Paths: -------------- trunk/Prices.php trunk/SupplierCredit.php trunk/css/aguapop/default.css trunk/css/aguapop/default.css_large trunk/css/default/default.css trunk/css/fresh/default.css trunk/css/gel/default.css trunk/css/jelly/default.css trunk/css/professional/default.css trunk/css/professional-rtl/default.css trunk/css/silverwolf/default.css trunk/doc/Change.log trunk/index.php Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/Prices.php 2012-01-18 23:03:49 UTC (rev 4803) @@ -342,11 +342,11 @@ <tr><td><?php echo _('Price'); ?>:</td> <td> <input type="text" class="number" name="Price" size=12 maxlength=11 value= - <?php + "<?php if(isset($_POST['Price'])) { echo $_POST['Price']; } - ?> > + ?>"> </td></tr> Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/SupplierCredit.php 2012-01-18 23:03:49 UTC (rev 4803) @@ -637,7 +637,7 @@ $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount = filter_number_format($_POST['TaxAmount' . $Tax->TaxCalculationOrder]); } - $TaxTotal += $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount + $TaxTotal += $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount; } $InputError = False; Modified: trunk/css/aguapop/default.css =================================================================== --- trunk/css/aguapop/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/aguapop/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -268,16 +268,9 @@ .table1 { width:90%; background: whitesmoke; - border: 0px 0px 2px 2px darkslategray solid; + border: 1px solid darkslategray; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: whitesmoke; - border: 0px 0px 2px 2px darkslategray solid; - margin: 0 auto; -} input.address3 { text-transform: uppercase; Modified: trunk/css/aguapop/default.css_large =================================================================== --- trunk/css/aguapop/default.css_large 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/aguapop/default.css_large 2012-01-18 23:03:49 UTC (rev 4803) @@ -268,16 +268,9 @@ .table1 { width:90%; background: whitesmoke; - border: 0px 0px 2px 2px darkslategray solid; + border: 1px solid darkslategray; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: whitesmoke; - border: 0px 0px 2px 2px darkslategray solid; - margin: 0 auto; -} input.address3 { text-transform: uppercase; Modified: trunk/css/default/default.css =================================================================== --- trunk/css/default/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/default/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -248,16 +248,9 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - margin: 0 auto; -} input.address3 { text-transform: uppercase; Modified: trunk/css/fresh/default.css =================================================================== --- trunk/css/fresh/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/fresh/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -248,16 +248,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - margin: 0 auto; -} + input.address3 { text-transform: uppercase; } Modified: trunk/css/gel/default.css =================================================================== --- trunk/css/gel/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/gel/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -277,18 +277,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; - margin: 0 auto; -} + input.address3 { text-transform: uppercase; } Modified: trunk/css/jelly/default.css =================================================================== --- trunk/css/jelly/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/jelly/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -316,18 +316,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - margin: 0 auto; -} - input.address3 { text-transform: uppercase; } Modified: trunk/css/professional/default.css =================================================================== --- trunk/css/professional/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/professional/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -249,16 +249,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - margin: 0 auto; -} + input.address3 { text-transform: uppercase; } Modified: trunk/css/professional-rtl/default.css =================================================================== --- trunk/css/professional-rtl/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/professional-rtl/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -243,18 +243,10 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; + border: 1px solid #222; margin: 0 auto; } -/* Table type is used for UI tables type 2 */ -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; - margin: 0 auto; -} + input.address3 { text-transform: uppercase; } Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/css/silverwolf/default.css 2012-01-18 23:03:49 UTC (rev 4803) @@ -1,4 +1,4 @@ -@charset "utf-8"; +@charset "UTF-8"; /*--------------------------------------------------\ | | | default.css | |---------------------------------------------------| @@ -322,18 +322,9 @@ .table1 { width:90%; background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; + border: 1px solid #222; margin: 0 auto; } -// Table type is used for UI tables type 2 -.table2 { - width:90%; - background: #eee; - border: 0px 0px 2px 2px #222 solid; - background: #eee; - margin: 0 auto; -} input.address3 { text-transform: uppercase; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/doc/Change.log 2012-01-18 23:03:49 UTC (rev 4803) @@ -1,5 +1,6 @@ webERP Change Log +17/1/12 Vitaly: Removed unused .table2 declaration from default.css. Fixed border settings in .table1. 16/1/12 Phil: Made StockReorderLevel.php just update changed fields rather than update all locations even though they may not have changed. 8/1/12 Phil: Added new api functions to get tax group taxes, list tax authorities, get tax authority details and get tax authority tax rates, also to list and get payment methods 8/1/12 Paul Harness: PcAuthorizeExpenses.php Compare date against SQL raw date format, then convert for display when deciding to display authorize checkbox. Modified: trunk/index.php =================================================================== --- trunk/index.php 2012-01-18 21:20:19 UTC (rev 4802) +++ trunk/index.php 2012-01-18 23:03:49 UTC (rev 4803) @@ -274,7 +274,7 @@ <tr> <td class="menu_group_items"> - <table width="100%"class="table_index"> + <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>'; ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-19 07:01:06
|
Revision: 4804 http://web-erp.svn.sourceforge.net/web-erp/?rev=4804&view=rev Author: daintree Date: 2012-01-19 07:01:00 +0000 (Thu, 19 Jan 2012) Log Message: ----------- various Modified Paths: -------------- trunk/Locations.php trunk/Prices.php trunk/SelectOrderItems.php trunk/StockCheck.php trunk/doc/Change.log Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2012-01-18 23:03:49 UTC (rev 4803) +++ trunk/Locations.php 2012-01-19 07:01:00 UTC (rev 4804) @@ -290,7 +290,7 @@ $CancelDelete = 1; prnMsg( _('Cannot delete this location because it is used by some work order records'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('work orders using this location'); - }else { + } else { $sql= "SELECT COUNT(*) FROM custbranch WHERE custbranch.defaultlocation='" . $SelectedLocation . "'"; $result = DB_query($sql,$db); @@ -299,6 +299,15 @@ $CancelDelete = 1; prnMsg(_('Cannot delete this location because it is used by some branch records as the default location to deliver from'),'warn'); echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('branches set up to use this location by default'); + } else { + $sql= "SELECT COUNT(*) FROM purchorders WHERE intostocklocation='" . $SelectedLocation . '"; + $result = DB_query($sql,$db); + $myrow = DB_fetch_row($result); + if ($myrow[0]>0) { + $CancelDelete = 1; + prnMsg(_('Cannot delete this location because it is used by some purchase order records as the location to receive stock into'),'warn'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('purchase orders set up to use this location as the receiving location'); + } } } } Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2012-01-18 23:03:49 UTC (rev 4803) +++ trunk/Prices.php 2012-01-19 07:01:00 UTC (rev 4804) @@ -346,7 +346,7 @@ if(isset($_POST['Price'])) { echo $_POST['Price']; } - ?>"> + ?>" /> </td></tr> Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-01-18 23:03:49 UTC (rev 4803) +++ trunk/SelectOrderItems.php 2012-01-19 07:01:00 UTC (rev 4804) @@ -1593,6 +1593,7 @@ if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; } + $i++; $j++; #end of page full new headings if } Modified: trunk/StockCheck.php =================================================================== --- trunk/StockCheck.php 2012-01-18 23:03:49 UTC (rev 4803) +++ trunk/StockCheck.php 2012-01-19 07:01:00 UTC (rev 4804) @@ -31,8 +31,7 @@ '" . Date('Y-m-d') . "' FROM locstock, stockmaster - WHERE locstock.stockid=stockmaster.stockid and - locstock.loccode='" . $_POST['Location'] . "' AND + WHERE locstock.stockid=stockmaster.stockid AND locstock.loccode='" . $_POST['Location'] . "' AND stockmaster.categoryid>='" . $_POST['FromCriteria'] . "' AND stockmaster.categoryid<='" . $_POST['ToCriteria'] . "' AND stockmaster.mbflag!='A' AND @@ -212,8 +211,8 @@ INNER JOIN stockmaster ON stockmaster.stockid=bom.parent WHERE salesorders.fromstkloc='" . $_POST['Location'] . "' - AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 AND - bom.component='" . $InventoryCheckRow['stockid'] . "' AND + AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 + AND bom.component='" . $InventoryCheckRow['stockid'] . "' AND stockmaster.mbflag='A'"; $DemandResult = DB_query($sql,$db,'','',false,false); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-18 23:03:49 UTC (rev 4803) +++ trunk/doc/Change.log 2012-01-19 07:01:00 UTC (rev 4804) @@ -1,5 +1,8 @@ webERP Change Log +19/1/12 Phil: Check on deletion of a location to see if any purchase orders exist prior to deletion +19/1/12 Phil:StockCheck.php fixed error in SQL two ANDs in calculating quantity demand reported by Ricard +19/1/12 Paul Harness: SelectOrderItems.php $i++ - in code for frequently ordered items. 17/1/12 Vitaly: Removed unused .table2 declaration from default.css. Fixed border settings in .table1. 16/1/12 Phil: Made StockReorderLevel.php just update changed fields rather than update all locations even though they may not have changed. 8/1/12 Phil: Added new api functions to get tax group taxes, list tax authorities, get tax authority details and get tax authority tax rates, also to list and get payment methods This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-19 07:01:06
|
Revision: 4804 http://web-erp.svn.sourceforge.net/web-erp/?rev=4804&view=rev Author: daintree Date: 2012-01-19 07:01:00 +0000 (Thu, 19 Jan 2012) Log Message: ----------- various Modified Paths: -------------- trunk/Locations.php trunk/Prices.php trunk/SelectOrderItems.php trunk/StockCheck.php trunk/doc/Change.log Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2012-01-18 23:03:49 UTC (rev 4803) +++ trunk/Locations.php 2012-01-19 07:01:00 UTC (rev 4804) @@ -290,7 +290,7 @@ $CancelDelete = 1; prnMsg( _('Cannot delete this location because it is used by some work order records'),'warn'); echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('work orders using this location'); - }else { + } else { $sql= "SELECT COUNT(*) FROM custbranch WHERE custbranch.defaultlocation='" . $SelectedLocation . "'"; $result = DB_query($sql,$db); @@ -299,6 +299,15 @@ $CancelDelete = 1; prnMsg(_('Cannot delete this location because it is used by some branch records as the default location to deliver from'),'warn'); echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('branches set up to use this location by default'); + } else { + $sql= "SELECT COUNT(*) FROM purchorders WHERE intostocklocation='" . $SelectedLocation . '"; + $result = DB_query($sql,$db); + $myrow = DB_fetch_row($result); + if ($myrow[0]>0) { + $CancelDelete = 1; + prnMsg(_('Cannot delete this location because it is used by some purchase order records as the location to receive stock into'),'warn'); + echo '<br /> ' . _('There are') . ' ' . $myrow[0] . ' ' . _('purchase orders set up to use this location as the receiving location'); + } } } } Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2012-01-18 23:03:49 UTC (rev 4803) +++ trunk/Prices.php 2012-01-19 07:01:00 UTC (rev 4804) @@ -346,7 +346,7 @@ if(isset($_POST['Price'])) { echo $_POST['Price']; } - ?>"> + ?>" /> </td></tr> Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2012-01-18 23:03:49 UTC (rev 4803) +++ trunk/SelectOrderItems.php 2012-01-19 07:01:00 UTC (rev 4804) @@ -1593,6 +1593,7 @@ if ($j==1) { $jsCall = '<script type="text/javascript">if (document.SelectParts) {defaultControl(document.SelectParts.itm'.$myrow['stockid'].');}</script>'; } + $i++; $j++; #end of page full new headings if } Modified: trunk/StockCheck.php =================================================================== --- trunk/StockCheck.php 2012-01-18 23:03:49 UTC (rev 4803) +++ trunk/StockCheck.php 2012-01-19 07:01:00 UTC (rev 4804) @@ -31,8 +31,7 @@ '" . Date('Y-m-d') . "' FROM locstock, stockmaster - WHERE locstock.stockid=stockmaster.stockid and - locstock.loccode='" . $_POST['Location'] . "' AND + WHERE locstock.stockid=stockmaster.stockid AND locstock.loccode='" . $_POST['Location'] . "' AND stockmaster.categoryid>='" . $_POST['FromCriteria'] . "' AND stockmaster.categoryid<='" . $_POST['ToCriteria'] . "' AND stockmaster.mbflag!='A' AND @@ -212,8 +211,8 @@ INNER JOIN stockmaster ON stockmaster.stockid=bom.parent WHERE salesorders.fromstkloc='" . $_POST['Location'] . "' - AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 AND - bom.component='" . $InventoryCheckRow['stockid'] . "' AND + AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 + AND bom.component='" . $InventoryCheckRow['stockid'] . "' AND stockmaster.mbflag='A'"; $DemandResult = DB_query($sql,$db,'','',false,false); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-18 23:03:49 UTC (rev 4803) +++ trunk/doc/Change.log 2012-01-19 07:01:00 UTC (rev 4804) @@ -1,5 +1,8 @@ webERP Change Log +19/1/12 Phil: Check on deletion of a location to see if any purchase orders exist prior to deletion +19/1/12 Phil:StockCheck.php fixed error in SQL two ANDs in calculating quantity demand reported by Ricard +19/1/12 Paul Harness: SelectOrderItems.php $i++ - in code for frequently ordered items. 17/1/12 Vitaly: Removed unused .table2 declaration from default.css. Fixed border settings in .table1. 16/1/12 Phil: Made StockReorderLevel.php just update changed fields rather than update all locations even though they may not have changed. 8/1/12 Phil: Added new api functions to get tax group taxes, list tax authorities, get tax authority details and get tax authority tax rates, also to list and get payment methods This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-19 19:18:23
|
Revision: 4818 http://web-erp.svn.sourceforge.net/web-erp/?rev=4818&view=rev Author: vvs2012 Date: 2012-01-19 19:18:16 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Added missing ')' at the end of some INSERT statements. Modified Paths: -------------- trunk/Stocks.php trunk/doc/Change.log Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2012-01-19 13:30:22 UTC (rev 4817) +++ trunk/Stocks.php 2012-01-19 19:18:16 UTC (rev 4818) @@ -417,7 +417,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . ($UnitCost* $StockQtyRow[0]) . "'"; + '" . ($UnitCost* $StockQtyRow[0]) . "')"; $ErrMsg = _('The stock cost journal could not be inserted because'); $DbgMsg = _('The SQL that was used to create the stock cost journal and failed was'); $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); @@ -434,7 +434,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . (-$UnitCost* $StockQtyRow[0]) . "'"; + '" . (-$UnitCost* $StockQtyRow[0]) . "')"; $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); } /* end if the stock category changed and forced a change in stock cost account */ @@ -472,7 +472,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewWIPAct . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . $WIPValue . "'"; + '" . $WIPValue . "')"; $ErrMsg = _('The WIP cost journal could not be inserted because'); $DbgMsg = _('The SQL that was used to create the WIP cost journal and failed was'); $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); @@ -489,7 +489,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldWIPAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . (-$WIPValue) . "'"; + '" . (-$WIPValue) . "')"; $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); } } /* end if the stock category changed and forced a change in WIP account */ @@ -1207,4 +1207,4 @@ echo '</div> </form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-19 13:30:22 UTC (rev 4817) +++ trunk/doc/Change.log 2012-01-19 19:18:16 UTC (rev 4818) @@ -1,5 +1,6 @@ webERP Change Log +19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements. 19/1/12 Phil: Check on deletion of a location to see if any purchase orders exist prior to deletion 19/1/12 Phil:StockCheck.php fixed error in SQL two ANDs in calculating quantity demand reported by Ricard 19/1/12 Paul Harness: SelectOrderItems.php $i++ - in code for frequently ordered items. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-19 19:18:23
|
Revision: 4818 http://web-erp.svn.sourceforge.net/web-erp/?rev=4818&view=rev Author: vvs2012 Date: 2012-01-19 19:18:16 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Added missing ')' at the end of some INSERT statements. Modified Paths: -------------- trunk/Stocks.php trunk/doc/Change.log Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2012-01-19 13:30:22 UTC (rev 4817) +++ trunk/Stocks.php 2012-01-19 19:18:16 UTC (rev 4818) @@ -417,7 +417,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . ($UnitCost* $StockQtyRow[0]) . "'"; + '" . ($UnitCost* $StockQtyRow[0]) . "')"; $ErrMsg = _('The stock cost journal could not be inserted because'); $DbgMsg = _('The SQL that was used to create the stock cost journal and failed was'); $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); @@ -434,7 +434,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldStockAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . (-$UnitCost* $StockQtyRow[0]) . "'"; + '" . (-$UnitCost* $StockQtyRow[0]) . "')"; $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); } /* end if the stock category changed and forced a change in stock cost account */ @@ -472,7 +472,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $NewWIPAct . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . $WIPValue . "'"; + '" . $WIPValue . "')"; $ErrMsg = _('The WIP cost journal could not be inserted because'); $DbgMsg = _('The SQL that was used to create the WIP cost journal and failed was'); $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); @@ -489,7 +489,7 @@ '" . GetPeriod(Date($_SESSION['DefaultDateFormat']),$db,true) . "', '" . $OldWIPAccount . "', '" . $StockID . ' ' . _('Change stock category') . "', - '" . (-$WIPValue) . "'"; + '" . (-$WIPValue) . "')"; $result = DB_query($SQL,$db, $ErrMsg, $DbgMsg,true); } } /* end if the stock category changed and forced a change in WIP account */ @@ -1207,4 +1207,4 @@ echo '</div> </form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-19 13:30:22 UTC (rev 4817) +++ trunk/doc/Change.log 2012-01-19 19:18:16 UTC (rev 4818) @@ -1,5 +1,6 @@ webERP Change Log +19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements. 19/1/12 Phil: Check on deletion of a location to see if any purchase orders exist prior to deletion 19/1/12 Phil:StockCheck.php fixed error in SQL two ANDs in calculating quantity demand reported by Ricard 19/1/12 Paul Harness: SelectOrderItems.php $i++ - in code for frequently ordered items. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-20 08:18:57
|
Revision: 4819 http://web-erp.svn.sourceforge.net/web-erp/?rev=4819&view=rev Author: daintree Date: 2012-01-20 08:18:50 +0000 (Fri, 20 Jan 2012) Log Message: ----------- various Modified Paths: -------------- trunk/CustomerInquiry.php trunk/Labels.php trunk/Prices.php trunk/doc/Change.log Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/CustomerInquiry.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -123,9 +123,11 @@ } echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . - ' ' . $CustomerRecord['currency'] . ')<br /><br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . '<br />' . _('Credit Limit') . - ': ' . locale_number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . '</p>'; + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . ' ' . $CustomerRecord['currency'] . ') + <br /> + <br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . ' + <br />' . _('Credit Limit') . ': ' . locale_number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . ' + </p>'; if ($CustomerRecord['dissallowinvoices']!=0){ echo '<br /><font color="red" size="4"><b>' . _('ACCOUNT ON HOLD') . '</font></b><br />'; @@ -253,7 +255,7 @@ <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('Email') . ' <img src="%s/email.gif" title="' . _('Click to email the credit note') . '" /></a></td>'; /* assumed allowed page security token 3 allows the user to create credits for invoices */ - if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) && $myrow['type']==10){ + if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) AND $myrow['type']==10){ /*Show a link to allow an invoice to be credited */ /* assumed allowed page security token 8 allows the user to see GL transaction information */ Modified: trunk/Labels.php =================================================================== --- trunk/Labels.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/Labels.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -41,11 +41,11 @@ */ if (isset($_POST['Update'])) { // Get the data from the user input & validate it (not new) - $label=getData($_POST, false, $ok); + $Label=getData($_POST, false, $ok); // If all OK try to update the requested label - if (!$ok OR !updateLabel($label)) { + if (!$ok OR !updateLabel($Label)) { // show the data label from the input data as update data (id read only)} - showLabel($label, _('Correct data'), $theme, false); + showLabel($Label, _('Correct data'), $theme, false); $showList=false; } @@ -54,9 +54,9 @@ */ } elseif (isset($_POST['Save'])) { // Get the data from the user input & validate it for new id - $label=getData($_POST, true, $ok); - if (!$ok OR !createLabel($label)) { // - showLabel($label, _('Correct data'), $theme, false); + $Label=getData($_POST, true, $ok); + if (!$ok OR !createLabel($Label)) { // + showLabel($Label, _('Correct data'), $theme, false); $showList=false; } @@ -64,17 +64,17 @@ * Get the data from an old one to create a new template? */ } elseif (isset($_POST['Copy'])) { - $label=$allLabels->getLabel($_POST['labelID']); - $label->id = _('New ID'); // Well, where did I get it? of course from the user, but .. - showLabel($label, _('Edit data new label'), $theme, false); + $Label=$allLabels->getLabel($_POST['labelID']); + $Label->id = _('New ID'); // Well, where did I get it? of course from the user, but .. + showLabel($Label, _('Edit data new label'), $theme, false); $showList=false; /** * Change some data from an old template? */ } elseif (isset($_POST['Edit'])) { - $label=$allLabels->getLabel($_POST['labelID']); - showLabel($label, _('Edit data label'), $theme, true); + $Label=$allLabels->getLabel($_POST['labelID']); + showLabel($Label, _('Edit data label'), $theme, true); $showList=false; /** @@ -247,14 +247,14 @@ * * It shows the data label from the input $data as update data (id read only) * if the third parameter is true or a fresh data label (new label). It is - * possible that the combination $data valid and $readonly false occurs when + * possible that the combination $data valid and $ReadOnly false occurs when * invalid data needs to be recaptured because an error in a new label capture. */ -function showLabel($label, $msg, $theme, $readonly=false) { +function showLabel($Label, $msg, $theme, $ReadOnly=false) { global $rootpath; - if ($label==null) - $label = newLabel(); - if ($readonly) { + if ($Label==null) + $Label = newLabel(); + if ($ReadOnly) { $name = 'Update'; $value = _('Update'); } else { @@ -264,8 +264,8 @@ $vCancel = _('Cancel'); - $tableGD = setTableGD($label, $readonly); - $tableLines = setTableLines($label->data->line); + $TableGD = setTableGD($Label, $ReadOnly); + $TableLines = setTableLines($Label->data->line); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $msg.'</p>'; @@ -277,11 +277,11 @@ <tbody> <tr> <td align="center"><img src="'.$rootpath.'/css/paramsLabel.png" align="top" border="0" /></td> - <td>'.$tableGD.'</td> + <td>'.$TableGD.'</td> </tr> - <tr>/ + <tr> <td align="center"><IMG src="'.$rootpath.'/css/labelsDim.png" align="top" border="0" /></td> - <td>'.$tableLines.'</td> + <td>'.$TableLines.'</td> </tr> </tbody> </table> @@ -290,18 +290,17 @@ </form>'; } -function setTableGD($label, $readonly) { +function setTableGD($Label, $ReadOnly) { global $GlobalTags, $DimensionTags; - $html=' - <table border="0" cellspacing="1" class="selection">'; - $html .= setDataFields($GlobalTags, 0, $label, $specialTag='id', $readonly); - $html .= setDataFields($DimensionTags, 1, $label->dimensions); + $html='<table border="0" cellspacing="1" class="selection">'; + $html .= setDataFields($GlobalTags, 0, $Label, $specialTag='id', $ReadOnly); + $html .= setDataFields($DimensionTags, 1, $Label->dimensions); $html .= ' </table>'; return $html; } -function setDataFields($tags, $withTagId, $data, $specialTag=false, $readonly=false) { +function setDataFields($tags, $withTagId, $data, $specialTag=false, $ReadOnly=false) { $iCol=0; $html = ''; foreach ($tags as $iTag=>$tag) { @@ -317,7 +316,7 @@ </select>'; } else { $ro=''; - if ($readonly AND $specialTag==$iTag) + if ($ReadOnly AND $specialTag==$iTag) $ro='readonly '; $input = '<input type="text" name="'. $iTag .'" value="'. $vDat .'" size="'. $tag['sz'] .'" maxlength="'. $tag['maxsz'] .'"'. $ro .' />'; } @@ -440,15 +439,15 @@ </tr> </thead> <tbody>'; - foreach ($list as $label) { - $dim = (string)$label->dimensions->Rows. ' x '. (string)$label->dimensions->Cols; + foreach ($list as $Label) { + $dim = (string)$Label->dimensions->Rows. ' x '. (string)$Label->dimensions->Cols; echo ' - <tr><td>'. $label->id . '</td> - <td>'. $label->description . '</td> + <tr><td>'. $Label->id . '</td> + <td>'. $Label->description . '</td> <td><div class="centre">'. $dim . '</div></td> - <td><input type="submit" onclick="submitForm('. "'form1','Edit','". $label->id . "');" .'" value="' . $txt[4]. '" /> - <input type="submit" onclick="submitForm('. "'form1','Copy','". $label->id . "');" .'" value="' . $txt[5]. '" /> - <input type="submit" onclick="areYouSure('. "'form1','Delete','". $label->id . "');" .'" value="' . $txt[6]. '" /> + <td><input type="submit" onclick="submitForm('. "'form1','Edit','". $Label->id . "');" .'" value="' . $txt[4]. '" /> + <input type="submit" onclick="submitForm('. "'form1','Copy','". $Label->id . "');" .'" value="' . $txt[5]. '" /> + <input type="submit" onclick="areYouSure('. "'form1','Delete','". $Label->id . "');" .'" value="' . $txt[6]. '" /> </td> </tr>'; } @@ -463,24 +462,24 @@ * After the user gives the label data, this routine tries to insert * the new label in the current list. * -* @param $label The object label that will replace an old one +* @param $Label The object label that will replace an old one * @return True when the update was ok */ -function createLabel($label) { +function createLabel($Label) { global $allLabels; $new = emptyList(); $done=false; if ($allLabels!=null) { foreach ($allLabels as $oldLabel) { - if (!$done AND (string)$oldLabel->id >= (string)$label->id) { - $new->addLabel($label); + if (!$done AND (string)$oldLabel->id >= (string)$Label->id) { + $new->addLabel($Label); $done=true; } $new->addLabel($oldLabel); // inser data in the list, replacing the old one } } if (!$done) - $new->addLabel($label); + $new->addLabel($Label); $allLabels = $new; rewrite($allLabels); // rewrite it to the XML file return true; @@ -493,15 +492,15 @@ * If the label with the id of the new one is found, the object could * be accepted in the list and written to the XML file. * -* @param $label The object label that will replace an old one +* @param $Label The object label that will replace an old one * @return True when the update was ok */ -function updateLabel($label) { +function updateLabel($Label) { global $allLabels; $new = emptyList(); foreach ($allLabels as $oldLabel) { - if ((string)$oldLabel->id == (string)$label->id) - $new->addLabel($label); + if ((string)$oldLabel->id == (string)$Label->id) + $new->addLabel($Label); else $new->addLabel($oldLabel); // inser data in the list, replacing the old one } @@ -518,15 +517,15 @@ * correct data, it would be unsual that some error exist, but it is * included the code for the validation of some this strange case. * - * @param $labelID is the identifier of the label to delete. + * @param $LabelID is the identifier of the label to delete. * @see $allLabels * @return true in case of success */ -function deleteLabel($list, $labelID) { +function deleteLabel($list, $LabelID) { $new = emptyList(); - foreach ($list as $label) { - if ((string)$label->id!=$labelID) - $new->addLabel($label); + foreach ($list as $Label) { + if ((string)$Label->id!=$LabelID) + $new->addLabel($Label); } rewrite($new); return $new; Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/Prices.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -373,17 +373,17 @@ $SQL = "SELECT price, startdate, enddate - FROM prices - WHERE debtorno='' - AND stockid='" . $Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND enddate <>'0000-00-00' - ORDER BY startdate, enddate"; + FROM prices + WHERE debtorno='' + AND stockid='" . $Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND enddate <>'0000-00-00' + ORDER BY startdate, enddate"; $result = DB_query($SQL,$db); - $NextStartDate = Date($_SESSION['DefaultDateFormat']); + unset($NextStartDate); unset($EndDate); - unset($NextStartDate); + while ($myrow = DB_fetch_array($result)){ if (isset($NextStartDate)){ if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/doc/Change.log 2012-01-20 08:18:50 UTC (rev 4819) @@ -1,6 +1,8 @@ webERP Change Log -19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements. +20/1/12 Tim: xhtml fixes Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php +20/1/12 Tim: Added previously received quantity to stock transfer notes PDFStockLocTransfer.php +19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements Stocks.php. 19/1/12 Phil: Check on deletion of a location to see if any purchase orders exist prior to deletion 19/1/12 Phil:StockCheck.php fixed error in SQL two ANDs in calculating quantity demand reported by Ricard 19/1/12 Paul Harness: SelectOrderItems.php $i++ - in code for frequently ordered items. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-20 08:19:02
|
Revision: 4819 http://web-erp.svn.sourceforge.net/web-erp/?rev=4819&view=rev Author: daintree Date: 2012-01-20 08:18:50 +0000 (Fri, 20 Jan 2012) Log Message: ----------- various Modified Paths: -------------- trunk/CustomerInquiry.php trunk/Labels.php trunk/Prices.php trunk/doc/Change.log Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/CustomerInquiry.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -123,9 +123,11 @@ } echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . - ' ' . $CustomerRecord['currency'] . ')<br /><br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . '<br />' . _('Credit Limit') . - ': ' . locale_number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . '</p>'; + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> ' . _('Customer') . ' : ' . $CustomerRecord['name'] . ' - (' . _('All amounts stated in') . ' ' . $CustomerRecord['currency'] . ') + <br /> + <br />' . _('Terms') . ' : ' . $CustomerRecord['terms'] . ' + <br />' . _('Credit Limit') . ': ' . locale_number_format($CustomerRecord['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $CustomerRecord['reasondescription'] . ' + </p>'; if ($CustomerRecord['dissallowinvoices']!=0){ echo '<br /><font color="red" size="4"><b>' . _('ACCOUNT ON HOLD') . '</font></b><br />'; @@ -253,7 +255,7 @@ <td><a href="%s/EmailCustTrans.php?FromTransNo=%s&InvOrCredit=Credit">' . _('Email') . ' <img src="%s/email.gif" title="' . _('Click to email the credit note') . '" /></a></td>'; /* assumed allowed page security token 3 allows the user to create credits for invoices */ - if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) && $myrow['type']==10){ + if (in_array(3,$_SESSION['AllowedPageSecurityTokens']) AND $myrow['type']==10){ /*Show a link to allow an invoice to be credited */ /* assumed allowed page security token 8 allows the user to see GL transaction information */ Modified: trunk/Labels.php =================================================================== --- trunk/Labels.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/Labels.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -41,11 +41,11 @@ */ if (isset($_POST['Update'])) { // Get the data from the user input & validate it (not new) - $label=getData($_POST, false, $ok); + $Label=getData($_POST, false, $ok); // If all OK try to update the requested label - if (!$ok OR !updateLabel($label)) { + if (!$ok OR !updateLabel($Label)) { // show the data label from the input data as update data (id read only)} - showLabel($label, _('Correct data'), $theme, false); + showLabel($Label, _('Correct data'), $theme, false); $showList=false; } @@ -54,9 +54,9 @@ */ } elseif (isset($_POST['Save'])) { // Get the data from the user input & validate it for new id - $label=getData($_POST, true, $ok); - if (!$ok OR !createLabel($label)) { // - showLabel($label, _('Correct data'), $theme, false); + $Label=getData($_POST, true, $ok); + if (!$ok OR !createLabel($Label)) { // + showLabel($Label, _('Correct data'), $theme, false); $showList=false; } @@ -64,17 +64,17 @@ * Get the data from an old one to create a new template? */ } elseif (isset($_POST['Copy'])) { - $label=$allLabels->getLabel($_POST['labelID']); - $label->id = _('New ID'); // Well, where did I get it? of course from the user, but .. - showLabel($label, _('Edit data new label'), $theme, false); + $Label=$allLabels->getLabel($_POST['labelID']); + $Label->id = _('New ID'); // Well, where did I get it? of course from the user, but .. + showLabel($Label, _('Edit data new label'), $theme, false); $showList=false; /** * Change some data from an old template? */ } elseif (isset($_POST['Edit'])) { - $label=$allLabels->getLabel($_POST['labelID']); - showLabel($label, _('Edit data label'), $theme, true); + $Label=$allLabels->getLabel($_POST['labelID']); + showLabel($Label, _('Edit data label'), $theme, true); $showList=false; /** @@ -247,14 +247,14 @@ * * It shows the data label from the input $data as update data (id read only) * if the third parameter is true or a fresh data label (new label). It is - * possible that the combination $data valid and $readonly false occurs when + * possible that the combination $data valid and $ReadOnly false occurs when * invalid data needs to be recaptured because an error in a new label capture. */ -function showLabel($label, $msg, $theme, $readonly=false) { +function showLabel($Label, $msg, $theme, $ReadOnly=false) { global $rootpath; - if ($label==null) - $label = newLabel(); - if ($readonly) { + if ($Label==null) + $Label = newLabel(); + if ($ReadOnly) { $name = 'Update'; $value = _('Update'); } else { @@ -264,8 +264,8 @@ $vCancel = _('Cancel'); - $tableGD = setTableGD($label, $readonly); - $tableLines = setTableLines($label->data->line); + $TableGD = setTableGD($Label, $ReadOnly); + $TableLines = setTableLines($Label->data->line); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $msg.'</p>'; @@ -277,11 +277,11 @@ <tbody> <tr> <td align="center"><img src="'.$rootpath.'/css/paramsLabel.png" align="top" border="0" /></td> - <td>'.$tableGD.'</td> + <td>'.$TableGD.'</td> </tr> - <tr>/ + <tr> <td align="center"><IMG src="'.$rootpath.'/css/labelsDim.png" align="top" border="0" /></td> - <td>'.$tableLines.'</td> + <td>'.$TableLines.'</td> </tr> </tbody> </table> @@ -290,18 +290,17 @@ </form>'; } -function setTableGD($label, $readonly) { +function setTableGD($Label, $ReadOnly) { global $GlobalTags, $DimensionTags; - $html=' - <table border="0" cellspacing="1" class="selection">'; - $html .= setDataFields($GlobalTags, 0, $label, $specialTag='id', $readonly); - $html .= setDataFields($DimensionTags, 1, $label->dimensions); + $html='<table border="0" cellspacing="1" class="selection">'; + $html .= setDataFields($GlobalTags, 0, $Label, $specialTag='id', $ReadOnly); + $html .= setDataFields($DimensionTags, 1, $Label->dimensions); $html .= ' </table>'; return $html; } -function setDataFields($tags, $withTagId, $data, $specialTag=false, $readonly=false) { +function setDataFields($tags, $withTagId, $data, $specialTag=false, $ReadOnly=false) { $iCol=0; $html = ''; foreach ($tags as $iTag=>$tag) { @@ -317,7 +316,7 @@ </select>'; } else { $ro=''; - if ($readonly AND $specialTag==$iTag) + if ($ReadOnly AND $specialTag==$iTag) $ro='readonly '; $input = '<input type="text" name="'. $iTag .'" value="'. $vDat .'" size="'. $tag['sz'] .'" maxlength="'. $tag['maxsz'] .'"'. $ro .' />'; } @@ -440,15 +439,15 @@ </tr> </thead> <tbody>'; - foreach ($list as $label) { - $dim = (string)$label->dimensions->Rows. ' x '. (string)$label->dimensions->Cols; + foreach ($list as $Label) { + $dim = (string)$Label->dimensions->Rows. ' x '. (string)$Label->dimensions->Cols; echo ' - <tr><td>'. $label->id . '</td> - <td>'. $label->description . '</td> + <tr><td>'. $Label->id . '</td> + <td>'. $Label->description . '</td> <td><div class="centre">'. $dim . '</div></td> - <td><input type="submit" onclick="submitForm('. "'form1','Edit','". $label->id . "');" .'" value="' . $txt[4]. '" /> - <input type="submit" onclick="submitForm('. "'form1','Copy','". $label->id . "');" .'" value="' . $txt[5]. '" /> - <input type="submit" onclick="areYouSure('. "'form1','Delete','". $label->id . "');" .'" value="' . $txt[6]. '" /> + <td><input type="submit" onclick="submitForm('. "'form1','Edit','". $Label->id . "');" .'" value="' . $txt[4]. '" /> + <input type="submit" onclick="submitForm('. "'form1','Copy','". $Label->id . "');" .'" value="' . $txt[5]. '" /> + <input type="submit" onclick="areYouSure('. "'form1','Delete','". $Label->id . "');" .'" value="' . $txt[6]. '" /> </td> </tr>'; } @@ -463,24 +462,24 @@ * After the user gives the label data, this routine tries to insert * the new label in the current list. * -* @param $label The object label that will replace an old one +* @param $Label The object label that will replace an old one * @return True when the update was ok */ -function createLabel($label) { +function createLabel($Label) { global $allLabels; $new = emptyList(); $done=false; if ($allLabels!=null) { foreach ($allLabels as $oldLabel) { - if (!$done AND (string)$oldLabel->id >= (string)$label->id) { - $new->addLabel($label); + if (!$done AND (string)$oldLabel->id >= (string)$Label->id) { + $new->addLabel($Label); $done=true; } $new->addLabel($oldLabel); // inser data in the list, replacing the old one } } if (!$done) - $new->addLabel($label); + $new->addLabel($Label); $allLabels = $new; rewrite($allLabels); // rewrite it to the XML file return true; @@ -493,15 +492,15 @@ * If the label with the id of the new one is found, the object could * be accepted in the list and written to the XML file. * -* @param $label The object label that will replace an old one +* @param $Label The object label that will replace an old one * @return True when the update was ok */ -function updateLabel($label) { +function updateLabel($Label) { global $allLabels; $new = emptyList(); foreach ($allLabels as $oldLabel) { - if ((string)$oldLabel->id == (string)$label->id) - $new->addLabel($label); + if ((string)$oldLabel->id == (string)$Label->id) + $new->addLabel($Label); else $new->addLabel($oldLabel); // inser data in the list, replacing the old one } @@ -518,15 +517,15 @@ * correct data, it would be unsual that some error exist, but it is * included the code for the validation of some this strange case. * - * @param $labelID is the identifier of the label to delete. + * @param $LabelID is the identifier of the label to delete. * @see $allLabels * @return true in case of success */ -function deleteLabel($list, $labelID) { +function deleteLabel($list, $LabelID) { $new = emptyList(); - foreach ($list as $label) { - if ((string)$label->id!=$labelID) - $new->addLabel($label); + foreach ($list as $Label) { + if ((string)$Label->id!=$LabelID) + $new->addLabel($Label); } rewrite($new); return $new; Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/Prices.php 2012-01-20 08:18:50 UTC (rev 4819) @@ -373,17 +373,17 @@ $SQL = "SELECT price, startdate, enddate - FROM prices - WHERE debtorno='' - AND stockid='" . $Item . "' - AND currabrev='" . $CurrAbbrev . "' - AND typeabbrev='" . $PriceList . "' - AND enddate <>'0000-00-00' - ORDER BY startdate, enddate"; + FROM prices + WHERE debtorno='' + AND stockid='" . $Item . "' + AND currabrev='" . $CurrAbbrev . "' + AND typeabbrev='" . $PriceList . "' + AND enddate <>'0000-00-00' + ORDER BY startdate, enddate"; $result = DB_query($SQL,$db); - $NextStartDate = Date($_SESSION['DefaultDateFormat']); + unset($NextStartDate); unset($EndDate); - unset($NextStartDate); + while ($myrow = DB_fetch_array($result)){ if (isset($NextStartDate)){ if (Date1GreaterThanDate2(ConvertSQLDate($myrow['startdate']),$NextStartDate)){ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-19 19:18:16 UTC (rev 4818) +++ trunk/doc/Change.log 2012-01-20 08:18:50 UTC (rev 4819) @@ -1,6 +1,8 @@ webERP Change Log -19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements. +20/1/12 Tim: xhtml fixes Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php +20/1/12 Tim: Added previously received quantity to stock transfer notes PDFStockLocTransfer.php +19/1/12 Vitaly: Added missing ')' at the end of some INSERT statements Stocks.php. 19/1/12 Phil: Check on deletion of a location to see if any purchase orders exist prior to deletion 19/1/12 Phil:StockCheck.php fixed error in SQL two ANDs in calculating quantity demand reported by Ricard 19/1/12 Paul Harness: SelectOrderItems.php $i++ - in code for frequently ordered items. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2012-01-20 13:49:05
|
Revision: 4821 http://web-erp.svn.sourceforge.net/web-erp/?rev=4821&view=rev Author: tim_schofield Date: 2012-01-20 13:48:53 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Add tendering facility Modified Paths: -------------- trunk/SupplierTenders.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/ConnectDB.inc trunk/includes/DefineOfferClass.php trunk/includes/UserLogin.php trunk/index.php trunk/sql/mysql/upgrade4.05-4.06.sql Added Paths: ----------- trunk/SupplierTenderCreate.php trunk/includes/DefineTenderClass.php Added: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php (rev 0) +++ trunk/SupplierTenderCreate.php 2012-01-20 13:48:53 UTC (rev 4821) @@ -0,0 +1,809 @@ +<?php +/* $Id$*/ + +include('includes/DefineTenderClass.php'); +include('includes/SQL_CommonFunctions.inc'); +include('includes/session.inc'); + +$Maximum_Number_Of_Parts_To_Show=50; + +if (isset($_GET['New']) and isset($_SESSION['tender'])) { + unset($_SESSION['tender']); +} + +if (isset($_GET['New']) and $_SESSION['CanCreateTender']==0) { + $title = _('Authorisation Problem'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; + prnMsg( _('You do not have authority to create supplier tenders for this company.') . '<br />' . + _('Please see your system administrator'), 'warn'); + include('includes/footer.inc'); + exit; +} + +if (isset($_GET['Edit']) and $_SESSION['CanCreateTender']==0) { + $title = _('Authorisation Problem'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; + prnMsg( _('You do not have authority to amend supplier tenders for this company.') . '<br />' . + _('Please see your system administrator'), 'warn'); + include('includes/footer.inc'); + exit; +} + +$ShowTender = 0; + +if (isset($_GET['ID'])) { + $sql="SELECT tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + if (isset($_SESSION['tender'])) { + unset($_SESSION['tender']); + } + $_SESSION['tender'] = new Tender(); + $_SESSION['tender']->TenderId = $myrow['tenderid']; + $_SESSION['tender']->Location = $myrow['location']; + $_SESSION['tender']->DelAdd1 = $myrow['address1']; + $_SESSION['tender']->DelAdd2 = $myrow['address2']; + $_SESSION['tender']->DelAdd3 = $myrow['address3']; + $_SESSION['tender']->DelAdd4 = $myrow['address4']; + $_SESSION['tender']->DelAdd5 = $myrow['address5']; + $_SESSION['tender']->DelAdd6 = $myrow['address6']; + + $sql="SELECT tenderid, + tendersuppliers.supplierid, + suppliers.suppname, + tendersuppliers.email + FROM tendersuppliers + LEFT JOIN suppliers + ON tendersuppliers.supplierid=suppliers.supplierid + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + while ($myrow=DB_fetch_array($result)) { + $_SESSION['tender']->add_supplier_to_tender( + $myrow['supplierid'], + $myrow['suppname'], + $myrow['email']); + } + + $sql="SELECT tenderid, + tenderitems.stockid, + tenderitems.quantity, + stockmaster.description, + tenderitems.units, + stockmaster.decimalplaces + FROM tenderitems + LEFT JOIN stockmaster + ON tenderitems.stockid=stockmaster.stockid + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + while ($myrow=DB_fetch_array($result)) { + $_SESSION['tender']->add_item_to_tender( + $_SESSION['tender']->LinesOnTender, + $myrow['stockid'], + $myrow['quantity'], + $myrow['description'], + $myrow['units'], + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + } + $ShowTender = 1; +} + +if (isset($_GET['Edit'])) { + $title = _('Edit an Existing Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; + $sql="SELECT tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + WHERE closed=0"; + $result=DB_query($sql, $db); + echo '<table class="selection">'; + echo '<tr><th>' . _('Tender ID') . '</th>'; + echo '<th>' . _('Location') . '</th>'; + echo '<th>' . _('Address 1') . '</th>'; + echo '<th>' . _('Address 2') . '</th>'; + echo '<th>' . _('Address 3') . '</th>'; + echo '<th>' . _('Address 4') . '</th>'; + echo '<th>' . _('Address 5') . '</th>'; + echo '<th>' . _('Address 6') . '</th>'; + echo '<th>' . _('Telephone') . '</th></tr>'; + while ($myrow=DB_fetch_array($result)) { + echo '<tr><td>' . $myrow['tenderid'] . '</td>'; + echo '<td>' . $myrow['location'] . '</td>'; + echo '<td>' . $myrow['address1'] . '</td>'; + echo '<td>' . $myrow['address2'] . '</td>'; + echo '<td>' . $myrow['address3'] . '</td>'; + echo '<td>' . $myrow['address4'] . '</td>'; + echo '<td>' . $myrow['address5'] . '</td>'; + echo '<td>' . $myrow['address6'] . '</td>'; + echo '<td>' . $myrow['telephone'] . '</td>'; + echo '<td><a href="'.$_SERVER['PHP_SELF'] . '?ID='.$myrow['tenderid'].'">'. _('Edit') .'</a></td>'; + } + echo '</table>'; + include('includes/footer.inc'); + exit; +} else if (isset($_GET['ID']) or (isset($_SESSION['tender']->TenderId))) { + $title = _('Edit an Existing Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; +} else { + $title = _('Create a New Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; +} + +if (isset($_POST['Save'])) { + $_SESSION['tender']->RequiredByDate=$_POST['RequiredByDate']; + $_SESSION['tender']->save($db); + $_SESSION['tender']->EmailSuppliers(); + prnMsg( _('The tender has been successfully saved'), 'success'); + include('includes/footer.inc'); + exit; +} + +if (isset($_GET['DeleteSupplier'])) { + $_SESSION['tender']->remove_supplier_from_tender($_GET['DeleteSupplier']); + $ShowTender = 1; +} + +if (isset($_GET['DeleteItem'])) { + $_SESSION['tender']->remove_item_from_tender($_GET['DeleteItem']); + $ShowTender = 1; +} + +if (isset($_POST['SelectedSupplier'])) { + $sql = "SELECT suppname, + email + FROM suppliers + WHERE supplierid='" . $_POST['SelectedSupplier'] . "'"; + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); + if (mb_strlen($myrow['email'])>0) { + $_SESSION['tender']->add_supplier_to_tender( + $_POST['SelectedSupplier'], + $myrow['suppname'], + $myrow['email']); + } else { + prnMsg( _('The supplier must have an email set up or they cannot be part of a tender'), 'warn'); + } + $ShowTender = 1; +} + +if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { + foreach ($_POST as $key => $value) { + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID = $value; + $Quantity = filter_number_format($_POST['Qty'.$Index]); + $UOM = $_POST['UOM'.$Index]; + $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + $_SESSION['tender']->add_item_to_tender( + $_SESSION['tender']->LinesOnTender, + $StockID, + $Quantity, + $myrow['description'], + $UOM, + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + unset($UOM); + } + } + $ShowTender = 1; +} + +if (!isset($_SESSION['tender']) or isset($_POST['LookupDeliveryAddress']) or $ShowTender==1) { + /* Show Tender header screen */ + if (!isset($_SESSION['tender'])) { + $_SESSION['tender']=new Tender(); + } + echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<tr><th colspan="4"><font size="3" color="#616161">' . _('Tender header details') . '</font></th></tr>'; + echo '<tr><td>' . _('Delivery Must Be Made Before') . '</td>'; + echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredByDate" size="11" value="' . date($_SESSION['DefaultDateFormat']) . '" /></td></tr>'; + + if (!isset($_POST['StkLocation']) OR $_POST['StkLocation']==''){ + /* If this is the first time + * the form loaded set up defaults */ + + $_POST['StkLocation'] = $_SESSION['UserStockLocation']; + + $sql = "SELECT deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; + + $LocnAddrResult = DB_query($sql,$db); + if (DB_num_rows($LocnAddrResult)==1){ + $LocnRow = DB_fetch_array($LocnAddrResult); + $_POST['DelAdd1'] = $LocnRow['deladd1']; + $_POST['DelAdd2'] = $LocnRow['deladd2']; + $_POST['DelAdd3'] = $LocnRow['deladd3']; + $_POST['DelAdd4'] = $LocnRow['deladd4']; + $_POST['DelAdd5'] = $LocnRow['deladd5']; + $_POST['DelAdd6'] = $LocnRow['deladd6']; + $_POST['Tel'] = $LocnRow['tel']; + $_POST['Contact'] = $LocnRow['contact']; + + $_SESSION['tender']->Location= $_POST['StkLocation']; + $_SESSION['tender']->DelAdd1 = $_POST['DelAdd1']; + $_SESSION['tender']->DelAdd2 = $_POST['DelAdd2']; + $_SESSION['tender']->DelAdd3 = $_POST['DelAdd3']; + $_SESSION['tender']->DelAdd4 = $_POST['DelAdd4']; + $_SESSION['tender']->DelAdd5 = $_POST['DelAdd5']; + $_SESSION['tender']->DelAdd6 = $_POST['DelAdd6']; + $_SESSION['tender']->Telephone = $_POST['Tel']; + $_SESSION['tender']->Contact = $_POST['Contact']; + + } else { + /*The default location of the user is crook */ + prnMsg(_('The default stock location set up for this user is not a currently defined stock location') . + '. ' . _('Your system administrator needs to amend your user record'),'error'); + } + + + } elseif (isset($_POST['LookupDeliveryAddress'])){ + + $sql = "SELECT deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; + + $LocnAddrResult = DB_query($sql,$db); + if (DB_num_rows($LocnAddrResult)==1){ + $LocnRow = DB_fetch_array($LocnAddrResult); + $_POST['DelAdd1'] = $LocnRow['deladd1']; + $_POST['DelAdd2'] = $LocnRow['deladd2']; + $_POST['DelAdd3'] = $LocnRow['deladd3']; + $_POST['DelAdd4'] = $LocnRow['deladd4']; + $_POST['DelAdd5'] = $LocnRow['deladd5']; + $_POST['DelAdd6'] = $LocnRow['deladd6']; + $_POST['Tel'] = $LocnRow['tel']; + $_POST['Contact'] = $LocnRow['contact']; + + $_SESSION['tender']->Location= $_POST['StkLocation']; + $_SESSION['tender']->DelAdd1 = $_POST['DelAdd1']; + $_SESSION['tender']->DelAdd2 = $_POST['DelAdd2']; + $_SESSION['tender']->DelAdd3 = $_POST['DelAdd3']; + $_SESSION['tender']->DelAdd4 = $_POST['DelAdd4']; + $_SESSION['tender']->DelAdd5 = $_POST['DelAdd5']; + $_SESSION['tender']->DelAdd6 = $_POST['DelAdd6']; + $_SESSION['tender']->Telephone = $_POST['Tel']; + $_SESSION['tender']->Contact = $_POST['Contact']; + } + } + echo '<tr><td>' . _('Warehouse') . ':</td> + <td><select name=StkLocation onChange="ReloadForm(form1.LookupDeliveryAddress)">'; + + $sql = "SELECT loccode, + locationname + FROM locations"; + $LocnResult = DB_query($sql,$db); + + while ($LocnRow=DB_fetch_array($LocnResult)){ + if ((isset($_SESSION['tender']->Location) and $_SESSION['tender']->Location == $LocnRow['loccode'])){ + echo '<option selected="True" value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; + } else { + echo '<option value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; + } + } + + echo '</select> + <input type="submit" name="LookupDeliveryAddress" value="' ._('Select') . '" /></td> + </tr>'; + + /* Display the details of the delivery location + */ + echo '<tr><td>' . _('Delivery Contact') . ':</td> + <td><input type="text" name="Contact" size="41" value="' . $_SESSION['tender']->Contact . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 1 :</td> + <td><input type="text" name="DelAdd1" size="41" maxlength="40" value="' . $_POST['DelAdd1'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 2 :</td> + <td><input type="text" name="DelAdd2" size="41" maxlength="40" value="' . $_POST['DelAdd2'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 3 :</td> + <td><input type="text" name="DelAdd3" size="41" maxlength="40" value="' . $_POST['DelAdd3'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 4 :</td> + <td><input type="text" name="DelAdd4" size="21" maxlength="20" value="' . $_POST['DelAdd4'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 5 :</td> + <td><input type="text" name="DelAdd5" size="16" maxlength="15" value="' . $_POST['DelAdd5'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 6 :</td> + <td><input type="text" name="DelAdd6" size="16" maxlength="15" value="' . $_POST['DelAdd6'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Phone') . ':</td> + <td><input type="text" name="Tel" size="31" maxlength="30" value="' . $_SESSION['tender']->Telephone . '" /></td> + </tr>'; + echo '</table><br />'; + + /* Display the supplier/item details + */ + echo '<table>'; + + /* Supplier Details + */ + echo '<tr><td valign="top"><table class="selection">'; + echo '<tr><th colspan="4"><font size="3" color="#616161">' . _('Suppliers To Send Tender') . '</font></th></tr>'; + echo '<tr><th>'. _('Supplier Code') . '</th><th>' ._('Supplier Name') . '</th><th>' ._('Email Address') . '</th></tr>'; + foreach ($_SESSION['tender']->Suppliers as $Supplier) { + echo '<tr><td>' . $Supplier->SupplierCode . '</td>'; + echo '<td>' . $Supplier->SupplierName . '</td>'; + echo '<td>' . $Supplier->EmailAddress . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteSupplier=' . $Supplier->SupplierCode . '">' . _('Delete') . '</a></td></tr>'; + } + echo '</table></td>'; + /* Item Details + */ + echo '<td valign="top"><table class="selection">'; + echo '<tr><th colspan="6"><font size="3" color="#616161">' . _('Items in Tender') . '</font></th></tr>'; + echo '<tr>'; + echo '<th>'._('Stock ID').'</th>'; + echo '<th>'._('Description').'</th>'; + echo '<th>'._('Quantity').'</th>'; + echo '<th>'._('UOM').'</th>'; + echo '</tr>'; + $k=0; + foreach ($_SESSION['tender']->LineItems as $LineItems) { + if ($LineItems->Deleted==False) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<td>'.$LineItems->StockID.'</td>'; + echo '<td>'.$LineItems->ItemDescription.'</td>'; + echo '<td class="number">' . locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'</td>'; + echo '<td>'.$LineItems->Units.'</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteItem=' . $LineItems->LineNo . '">' . _('Delete') . '</a></td></tr>'; + echo '</tr>'; + } + } + echo '</table></td></tr></table><br />'; + + echo '<div class="centre"><input type="submit" name="Suppliers" value="' . _('Select Suppliers') . '" />'; + echo '<input type="submit" name="Items" value="' . _('Select Item Details') . '" /></div><br />'; + if ($_SESSION['tender']->LinesOnTender > 0 and $_SESSION['tender']->SuppliersOnTender > 0) { + echo '<div class="centre"><input type="submit" name="Save" value="' . _('Save Tender') . '" /></div>'; + } + echo '</form>'; + include('includes/footer.inc'); + exit; +} + +if (isset($_POST['SearchSupplier']) OR isset($_POST['Go']) OR isset($_POST['Next']) OR isset($_POST['Previous'])) { + if (mb_strlen($_POST['Keywords']) > 0 AND mb_strlen($_POST['SupplierCode']) > 0) { + prnMsg( '<br />' . _('Supplier name keywords have been used in preference to the Supplier code extract entered'), 'info' ); + } + if ($_POST['Keywords'] == '' AND $_POST['SupplierCode'] == '') { + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + ORDER BY suppname"; + } else { + if (mb_strlen($_POST['Keywords']) > 0) { + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); + //insert wildcard characters in spaces + $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + WHERE suppname " . LIKE . " '$SearchString' + ORDER BY suppname"; + } elseif (mb_strlen($_POST['SupplierCode']) > 0) { + $_POST['SupplierCode'] = mb_strtoupper($_POST['SupplierCode']); + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + WHERE supplierid " . LIKE . " '%" . $_POST['SupplierCode'] . "%' + ORDER BY supplierid"; + } + } //one of keywords or SupplierCode was more than a zero length string + $result = DB_query($SQL, $db); + if (DB_num_rows($result) == 1) { + $myrow = DB_fetch_row($result); + $SingleSupplierReturned = $myrow[0]; + } +} //end of if search +if (isset($SingleSupplierReturned)) { /*there was only one supplier returned */ + $_SESSION['SupplierID'] = $SingleSupplierReturned; + unset($_POST['Keywords']); + unset($_POST['SupplierCode']); +} + +if (!isset($_POST['PageOffset'])) { + $_POST['PageOffset'] = 1; +} else { + if ($_POST['PageOffset'] == 0) { + $_POST['PageOffset'] = 1; + } +} + +if (isset($_POST['Suppliers'])) { + 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 Suppliers') . '</p> + <table cellpadding="3" colspan="4" class="selection"><tr><td>' . _('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><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 '</td></tr></table><br /><div class="centre"><input type="submit" name="SearchSupplier" value="' . _('Search Now') . '" /></div>'; + echo '</form>'; +} + +if (isset($_POST['SearchSupplier'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + $ListCount = DB_num_rows($result); + $ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax']); + 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; + } + } + if ($ListPageMax > 1) { + echo '<br /> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<select name="PageOffset">'; + $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="Go" value="' . _('Go') . '" /> + <input type="submit" name="Previous" value="' . _('Previous') . '" /> + <input type="submit" name="Next" value="' . _('Next') . '" />'; + echo '<br />'; + } + echo '<input type="hidden" name="Search" value="' . _('Search Now') . '" />'; + echo '<br /><br />'; + echo '<br /><table cellpadding="2" colspan="7">'; + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Address 1') . '</th> + <th>' . _('Address 2') . '</th> + <th>' . _('Address 3') . '</th> + <th>' . _('Address 4') . '</th> + </tr>'; + echo $tableheader; + $j = 1; + $k = 0; //row counter to determine background colour + $RowIndex = 0; + if (DB_num_rows($result) <> 0) { + 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><input type="submit" name="SelectedSupplier" value="'.$myrow['supplierid'].'" /></td> + <td>'.$myrow['suppname'].'</td> + <td>'.$myrow['currcode'].'</td> + <td>'.$myrow['address1'].'</td> + <td>'.$myrow['address2'].'</td> + <td>'.$myrow['address3'].'</td> + <td>'.$myrow['address4'].'</td> + </tr>'; + $RowIndex = $RowIndex + 1; + //end of page full new headings if + } + //end of while loop + echo '</table>'; +} + +/*The supplier has chosen option 2 + */ +if (isset($_POST['Items'])) { + 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 Inventory Items') . '</p>'; + $sql = "SELECT categoryid, + categorydescription + FROM stockcategory + ORDER BY categorydescription"; + $result = DB_query($sql, $db); + if (DB_num_rows($result) == 0) { + echo '<br /><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . + _('There are no stock categories currently defined please use the link below to set them up'); + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; + exit; + } + echo '<table class="selection"><tr>'; + echo '<td>' . _('In Stock Category') . ':'; + echo '<select name="StockCat">'; + if (!isset($_POST['StockCat'])) { + $_POST['StockCat'] = ""; + } + if ($_POST['StockCat'] == 'All') { + echo '<option selected="True" value="All">' . _('All') . '</option>'; + } else { + echo '<option value="All">' . _('All') . '</option>'; + } + while ($myrow1 = DB_fetch_array($result)) { + if ($myrow1['categoryid'] == $_POST['StockCat']) { + echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } else { + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } + } + echo '</select>'; + echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</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></tr><tr><td></td>'; + echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; + echo '<td>'; + if (isset($_POST['StockCode'])) { + echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; + } else { + echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; + } + echo '</td></tr></table><br />'; + echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; + echo '</form>'; +} + +if (isset($_POST['Search'])){ /*ie seach for stock items */ + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items required on this tender').'</p>'; + + 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 + $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; + + if ($_POST['StockCat']=='All'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; + } else { + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + 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 INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; + } else { + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + + } else { + if ($_POST['StockCat']=='All'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; + } else { + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + } + + $ErrMsg = _('There is a problem selecting the part records to display because'); + $DbgMsg = _('The SQL statement that failed was'); + $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); + + if (DB_num_rows($SearchResult)==0 and $debug==1){ + prnMsg( _('There are no products to display matching the criteria provided'),'warn'); + } + if (DB_num_rows($SearchResult)==1){ + + $myrow=DB_fetch_array($SearchResult); + $_GET['NewItem'] = $myrow['stockid']; + DB_data_seek($SearchResult,0); + } + + if (isset($SearchResult)) { + + echo '<table cellpadding="1" colspan="7">'; + + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; + echo $tableheader; + + $i = 0; + $k = 0; //row colour counter + $PartsDisplayed=0; + while ($myrow=DB_fetch_array($SearchResult)) { + + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + $filename = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; + + } else { + $ImageSource = '<i>'._('No Image').'</i>'; + } + + $uom=$myrow['units']; + + echo '<td>'.$myrow['stockid'].'</td> + <td>'.$myrow['description'].'</td> + <td>'.$uom.'</td> + <td>'.$ImageSource.'</td> + <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> + <input type="hidden" value="'.$uom.'" name="UOM'.$i.'" /> + <input type="hidden" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> + </tr>'; + + $PartsDisplayed++; + if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ + break; + } + $i++; +#end of page full new headings if + } +#end of while loop + echo '</table>'; + if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ + + /*$Maximum_Number_Of_Parts_To_Show defined in config.php */ + + prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . + _('Please restrict your search to only the parts required'),'info'); + } + echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Tender" /></div>'; + }#end if SearchResults to show + + echo '</form>'; + +} //end of if search + +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2012-01-20 08:19:32 UTC (rev 4820) +++ trunk/SupplierTenders.php 2012-01-20 13:48:53 UTC (rev 4821) @@ -8,6 +8,10 @@ $Maximum_Number_Of_Parts_To_Show=50; +if (isset($_GET['TenderType'])) { + $_POST['TenderType']=$_GET['TenderType']; +} + if (!isset($_POST['SupplierID'])) { $sql="SELECT supplierid FROM www_users WHERE userid='" . $_SESSION['UserID'] . "'"; $result=DB_query($sql, $db); @@ -27,12 +31,110 @@ $_SESSION['offer']->remove_from_offer($_GET['Delete']); } -$sql="SELECT suppname, currcode FROM suppliers WHERE supplierid='" . $_POST['SupplierID'] . "'"; +$sql="SELECT suppname, + currcode + FROM suppliers + WHERE supplierid='".$_POST['SupplierID']."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $Supplier=$myrow['suppname']; $Currency=$myrow['currcode']; +if (isset($_POST['Confirm'])) { + $_SESSION['offer']->Save($db); + $_SESSION['offer']->EmailOffer(); + $sql="UPDATE tendersuppliers + SET responded=1 + WHERE supplierid='" . $_SESSION['offer']->SupplierID . "' + AND tenderid='" . $_SESSION['offer']->TenderID . "'"; + $result=DB_query($sql, $db); +} + +if (isset($_POST['Process'])) { + if (isset($_SESSION['offer'])) { + unset($_SESSION['offer']); + } + $_SESSION['offer']=new Offer($_POST['SupplierID']); + $_SESSION['offer']->TenderID=$_POST['Tender']; + $_SESSION['offer']->CurrCode=$Currency; + $LineNo=0; + foreach ($_POST as $key=>$value) { + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $ItemCode=$value; + $Quantity=$_POST['Qty'.$Index]; + $Price=$_POST['Price'.$Index]; + $_SESSION['offer']->add_to_offer( + $LineNo, + $ItemCode, + $Quantity, + $_POST['ItemDescription'.$Index], + $Price, + $_POST['UOM'.$Index], + $_POST['DecimalPlaces'.$Index], + $_POST['RequiredByDate'.$Index]); + $LineNo++; + } + } + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Confirm the Response For Tender') . ' ' . $_SESSION['offer']->TenderID .'</p>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<input type="hidden" name="TenderType" value="3" />'; + $LocationSQL="SELECT tenderid, + locations.locationname, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + LEFT JOIN locations + ON tenders.location=locations.loccode + WHERE closed=0 + AND tenderid='".$_SESSION['offer']->TenderID."'"; + $LocationResult=DB_query($LocationSQL, $db); + $MyLocationRow=DB_fetch_row($LocationResult); + $CurrencySQL="SELECT decimalplaces from currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; + $CurrencyResult=DB_query($CurrencySQL, $db); + $CurrencyRow=DB_fetch_array($CurrencyResult); + echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + for ($i=1; $i<8; $i++) { + if ($MyLocationRow[$i]!='') { + echo $MyLocationRow[$i] . '<br />'; + } + } + echo '</td>'; + echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$_SESSION['offer']->TenderID . '</font></th>'; + echo '<input type="hidden" value="' . $_SESSION['offer']->TenderID . '" name="Tender" />'; + echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Currency') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; + echo '<th>' . _('Line Value') . '</th>'; + echo '<th>' . _('Delivery By') . '</th>'; + foreach ($_SESSION['offer']->LineItems as $LineItem) { + echo '<tr><td>' . $LineItem->StockID . '</td>'; + echo '<td>' . $LineItem->ItemDescription . '</td>'; + echo '<td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td>'; + echo '<td>' . $LineItem->Units . '</td>'; + echo '<td>' . $_SESSION['offer']->CurrCode . '</td>'; + echo '<td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td>'; + echo '<td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td>'; + echo '<td>' . $LineItem->ExpiryDate . '</td>'; + } + echo '</table><br />'; + echo '<div class="centre"><input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /><br />'; + echo '<br /><input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /></div>'; + echo '</form>'; + include('includes/footer.inc'); + exit; +} + /* If the supplierID is set then it must be a login from the supplier but if nothing else is * set then the supplier must have just logged in so show them the choices. */ @@ -42,66 +144,57 @@ } echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; echo '<table class="selection">'; echo'<tr><td>'._('Select option for tendering').'</td>'; - echo '<td><select name=TenderType>'; - echo '<option value=1>'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; - echo '<option value=2>'._('Create a new offer from').' '.$Supplier .'</option>'; -// echo '<option value=3>'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; + echo '<td><select name="TenderType">'; + echo '<option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; + echo '<option value="2">'._('Create a new offer from').' '.$Supplier .'</option>'; + echo '<option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; echo '</select></td></tr>'; - echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'"'; - echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '"></div></td></tr>'; - echo '</table> - </form>'; + echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; + echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '" /></div></td></tr>'; + echo '</table></form>'; } if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { - if (mb_substr($key,0,3)=='qty') { - $StockID=mb_substr($key,3); - $Quantity=$value; + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID=$value; + $Quantity=filter_number_format($_POST['Qty'.$Index]); + $Price=filter_number_format($_POST['Price'.$Index]); + $UOM=$_POST['uom'.$Index]; + if (isset($UOM) and $Quantity>0) { + $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + $_SESSION['offer']->add_to_offer($_SESSION['offer']->LinesOnOffer, + $StockID, + $Quantity, + $myrow['description'], + $Price, + $UOM, + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + unset($UOM); + } } - if (mb_substr($key,0,5)=='price') { - $Price=$value; - } - if (mb_substr($key,0,3)=='uom') { - $UOM=$value; - } - if (isset($UOM)) { - $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='" . $StockID."'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_array($result); - $_SESSION['offer']->add_to_offer( - $_SESSION['offer']->LinesOnOffer, - $StockID, - $Quantity, - $myrow['description'], - $Price, - $UOM, - $myrow['decimalplaces'], - DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); - unset($UOM); - } } } if (isset($_POST['Refresh']) and !isset($_POST['NewItem'])) { foreach ($_POST as $key => $value) { - if (mb_substr($key,0,3)=='qty') { - $LineNo=mb_substr($key,3); - $Quantity=$value; + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID=$value; + $Quantity=filter_number_format($_POST['Qty'.$Index]); + $Price=filter_number_format($_POST['Price'.$Index]); + $ExpiryDate=$_POST['expirydate'.$Index]; } - if (mb_substr($key,0,5)=='price') { - $Price=$value; - } - if (mb_substr($key,0,10)=='expirydate') { - $ExpiryDate=$value; - } if (isset($ExpiryDate)) { $_SESSION['offer']->update_offer_item( - $LineNo, + $Index, $Quantity, $Price, $ExpiryDate); @@ -111,7 +204,6 @@ } if (isset($_POST['Update'])) { - $MailText=''; foreach ($_POST as $key => $value) { if (mb_substr($key,0,3)=='qty') { $LineNo=mb_substr($key,3); @@ -132,31 +224,14 @@ unset($ExpiryDate); } } - foreach ($_SESSION['offer']->LineItems as $LineItems) { - $sql="UPDATE offers SET - quantity='".$LineItems->Quantity."', - price='".$LineItems->Price."', - expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' - WHERE offerid='".$LineItems->LineNo . "'"; - $ErrMsg = _('The suppliers offer could not be updated on the database because'); - $DbgMsg = _('The SQL statement used to update the suppliers offer record and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - if (DB_error_no($db)==0) { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('has been updated in the database'), 'success'); - $MailText .= $LineItems->Quantity.$LineItems->Units.' '._('of').' '.$LineItems->StockID.' '._('at a price of'). - ' '.$Currency.$LineItems->Price."\n"; - } else { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('could not be updated in the database'), 'error'); - include('includes/footer.inc'); - exit; - } - } + $_SESSION['offer']->Save($db, 'Yes'); + $_SESSION['offer']->EmailOffer(); + unset($_SESSION['offer']); include('includes/footer.inc'); exit; } if (isset($_POST['Save'])) { - $MailText=''; foreach ($_POST as $key => $value) { if (mb_substr($key,0,3)=='qty') { $LineNo=mb_substr($key,3); @@ -177,46 +252,9 @@ unset($ExpiryDate); } } - foreach ($_SESSION['offer']->LineItems as $LineItems) { - if ($LineItems->Deleted==False) { - $sql="INSERT INTO offers ( - supplierid, - stockid, - quantity, - uom, - price, - expirydate, - currcode) - VALUES ( - '".$_POST['SupplierID']."', - '".$LineItems->StockID."', - '".$LineItems->Quantity."', - '".$LineItems->Units."', - '".$LineItems->Price."', - '".FormatDateForSQL($LineItems->ExpiryDate)."', - '".$Currency."' - )"; - $ErrMsg = _('The suppliers offer could not be inserted into the database because'); - $DbgMsg = _('The SQL statement used to insert the suppliers offer record and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - if (DB_error_no($db)==0) { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('has been inserted into the database'), 'success'); - $MailText .= $LineItems->Quantity.$LineItems->Units.' '._('of').' '.$LineItems->StockID.' '._('at a price of'). - ' '.$Currency.$LineItems->Price."\n"; - } else { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('could not be inserted into the database'), 'error'); - include('includes/footer.inc'); - exit; - } - } - } - include ('includes/htmlMimeMail.php'); - $mail = new htmlMimeMail(); - $mail->setSubject(_('Offer received from').' '.$Supplier); - $mail->setText(_('This email is automatically generated by webERP')."\n" . - _('You have received the following offer from').' '.$Supplier."\n\n".$MailText); - $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>'); - $result = $mail->send(array($_SESSION['PurchasingManagerEmail']), 'smtp'); + $_SESSION['offer']->Save($db); + $_SESSION['offer']->EmailOffer(); + unset($_SESSION['offer']); include('includes/footer.inc'); exit; } @@ -234,11 +272,10 @@ stockmaster.decimalplaces FROM offers INNER JOIN stockmaster - ON offers.stockid=stockmaster.stockid - WHERE offers.supplierid='" . $_POST['SupplierID']."'"; + ON offers.stockid=stockmaster.stockid + WHERE offers.supplierid='" . $_POST['SupplierID'] . "'"; $result=DB_query($sql, $db); - $_SESSION['offer']=new Offer(); - $_SESSION['offer']->SupplierID=$_POST['SupplierID']; + $_SESSION['offer']=new Offer($_POST['SupplierID']); $_SESSION['offer']->CurrCode=$Currency; while ($myrow=DB_fetch_array($result)) { $_SESSION['offer']->add_to_offer( @@ -253,11 +290,10 @@ } } -if (isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { +if (isset($_POST['TenderType']) and $_POST['TenderType']!=3 and isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; echo '<table>'; echo '<tr> <th>'._('Stock ID').'</th> @@ -279,27 +315,28 @@ $k=1; } if ($LineItems->ExpiryDate < date('Y-m-d')) { - echo '<tr bgcolor=#F7A9A9>'; + echo '<tr bgcolor="#F7A9A9">'; } + echo '<input type="hidden" name="StockID'.$LineItems->LineNo.'" value="'.$LineItems->StockID.'" />'; echo '<td>'.$LineItems->StockID.'</td>'; echo '<td>'.$LineItems->ItemDescription.'</td>'; - echo '<td><input type="text" class=number name="qty'.$LineItems->LineNo.'" value='.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'></td>'; + echo '<td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td>'; echo '<td>'.$LineItems->Units.'</td>'; - echo '<td><input type="text" class=number name="price'.$LineItems->LineNo.'" value='.locale_number_format($LineItems->Price,2,'.','').'></td>'; - echo '<td class=number>'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; - echo '<td><input type="text" size=11 class=date alt='.$_SESSION['DefaultDateFormat'].' name="expirydate'.$LineItems->LineNo.'" value='.$LineItems->ExpiryDate.'></td>'; + echo '<td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td>'; + echo '<td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; + echo '<td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td>'; echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td></tr>'; echo '</tr>'; } } echo '</table>'; - echo '<input type=hidden name=TenderType value="'.$_POST['TenderType'].'">'; + echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; if ($_POST['TenderType']==1) { - echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen"></div>'; + echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer" />'; + echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; } else if ($_POST['TenderType']==2) { echo '<br /><div class="centre"><input type="submit" name="Save" value="Save offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen"></div>'; + echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; } echo '</form>'; } @@ -308,74 +345,175 @@ */ if (isset($_POST['TenderType']) and $_POST['TenderType']==2 and !isset($_POST['Search']) or isset($_GET['Delete'])) { if (!isset($_SESSION['offer'])) { - $_SESSION['offer']=new Offer(); - $_SESSION['offer']->SupplierID=$_POST['SupplierID']; + $_SESSION['offer']=new Offer($_POST['SupplierID']); } echo '<form action="' . htmlspecialchars($_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 Inventory Items') . '</p>'; - - $sql = 'SELECT categoryid, + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; + + $sql = "SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result = DB_query($sql, $db); - + if (DB_num_rows($result) == 0) { - echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . + echo '<p><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up'); - echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a></p>'; exit; } - echo '<table class=selection><tr>'; + echo '<table class="selection"><tr>'; echo '<td>' . _('In Stock Category') . ':'; echo '<select name="StockCat">'; if (!isset($_POST['StockCat'])) { $_POST['StockCat'] = ''; } if ($_POST['StockCat'] == 'All') { - echo '<option selected value="All">' . _('All'); + echo '<option selected="True" value="All">' . _('All') . '</option>'; } else { - echo '<option value="All">' . _('All'); + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result)) { if ($myrow1['categoryid'] == $_POST['StockCat']) { - echo '<option selected VALUE="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } } echo '</select>'; echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</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 '<input type="hidden" name="TenderType" value='.$_POST['TenderType'].'>'; - echo '<input type="hidden" name="SupplierID" value='.$_POST['SupplierID'].'>'; + echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; + echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; echo '</td></tr><tr><td></td>'; - echo '<td><font size 3><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; + echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; echo '<td>'; if (isset($_POST['StockCode'])) { - echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18">'; + echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { - echo '<input type="text" name="StockCode" size="15" maxlength="18">'; + echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } echo '</td></tr></table><br />'; - echo '<div class="centre"><input type=submit name="Search" value="' . _('Search Now') . '"></div><br /></form>'; + echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; echo '</form>'; } +/*The supplier has chosen option 3 + */ +if (isset($_POST['TenderType']) and $_POST['TenderType']==3 and !isset($_POST['Search']) or isset($_GET['Delete'])) { + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Tenders Waiting For Offers').'</p>'; + $sql="SELECT DISTINCT tendersuppliers.tenderid, + suppliers.currcode + FROM tendersuppliers + LEFT JOIN suppliers + ON suppliers.supplierid=tendersuppliers.supplierid + LEFT JOIN tenders + ON tenders.tenderid=tendersuppliers.tenderid + WHERE tendersuppliers.supplierid='" . $_POST['SupplierID'] . "' + AND tenders.closed=0 + AND tendersuppliers.responded=0 + ORDER BY tendersuppliers.tenderid"; + $result=DB_query($sql, $db); + echo '<table class="selection">'; + echo '<tr><th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th></tr>'; + while ($myrow=DB_fetch_row($result)) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<input type="hidden" name="TenderType" value="3" />'; + $LocationSQL="SELECT tenderid, + locations.locationname, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + LEFT JOIN locations + ON tenders.location=locations.loccode + WHERE closed=0 + AND tenderid='".$myrow[0]."'"; + $LocationResult=DB_query($LocationSQL, $db); + $MyLocationRow=DB_fetch_row($LocationResult); + echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + for ($i=1; $i<8; $i++) { + if ($MyLocationRow[$i]!='') { + echo $MyLocationRow[$i] . '<br />'; + } + } + echo '</td>'; + echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$myrow[0] . '</font></th>'; + echo '<input type="hidden" value="' . $myrow[0] . '" name="Tender" />'; + echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th></tr>'; + $ItemSQL="SELECT tenderitems.tenderid, + tenderitems.stockid, + stockmaster.description, + stockmaster.decimalplaces, + purchdata.suppliers_partno, + tenderitems.quantity, + tenderitems.units, + tenders.requiredbydate, + purchdata.suppliersuom + FROM tenderitems + LEFT JOIN stockmaster + ON tenderitems.stockid=stockmaster.stockid + LEFT JOIN purchdata + ON tenderitems.stockid=purchdata.stockid + AND purchdata.supplierno='".$_POST['SupplierID']."' + LEFT JOIN tenders + ON tenders.tenderid=tenderitems.tenderid + WHERE tenderitems.tenderid='" . $myrow[0] . "'"; + $ItemResult=DB_query($ItemSQL, $db); + echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Required') . '</th>'; + echo '<th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Required By') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Currency') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; + echo '<th>' . _('Delivery By') . '</th>'; + $i=0; + while ($MyItemRow=DB_fetch_array($ItemResult)) { + echo '<tr><td>' . $MyItemRow['stockid'] . '</td>'; + echo '<td>' . $MyItemRow['description'] . '</td>'; + echo '<input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" />'; + echo '<input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" />'; + echo '<td>' . $MyItemRow['suppliers_partno'] . '</td>'; + echo '<td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td>'; + echo '<td>' . $MyItemRow['units'] . '</td>'; + echo '<td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + if ($MyItemRow['suppliersuom']=='') { + $MyItemRow['suppliersuom']=$MyItemRow['units']; + } + echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td>'; + echo '<input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" />'; + echo '<input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" />'; + echo '<td>' . $MyItemRow['suppliersuom'] . '</td>'; + echo '<td>' . $myrow[1] . '</td>'; + echo '<td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td>'; + echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td>'; + } + echo '</form>'; + } + echo '</table>'; +} + if (isset($_POST['Search'])){ /*ie seach for stock items */ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; - if ($_POST['Keywords'] AND $_POST['StockCode']) { + 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']) { @@ -471,7 +609,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 && $debug==1){ + if (DB_num_rows($SearchResult)==0 and $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -483,7 +621,7 @@ if (isset($SearchResult)) { - echo "<table cellpadding=1 colspan=7>"; + echo '<table cellpadding="1" colspan="7">'; $tableheader = '<tr> <th>' . _('Code') . '</th> @@ -495,8 +633,8 @@ </tr>'; echo $tableheader; - $j = 1; - $k=0; //row colour counter + $i = 0; + $k = 0; //row colour counter $PartsDisplayed=0; while ($myrow=DB_fetch_array($SearchResult)) { @@ -511,8 +649,7 @@ $filename = $myrow['stockid'] . '.jpg'; if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { - $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . - '.jpg" width="50" height="50">'; + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; } else { $ImageSource = '<i>'._('No Image').'</i>'; @@ -525,7 +662,7 @@ LEFT JOIN unitsofmeasure ON purchdata.suppliersuom=unitsofmeasure.unitid WHERE supplierno='".$_POST['SupplierID']."' - AND stockid='" . $myrow['stockid']. "'"; + AND stockid='" . $myrow['stockid'] . "'"; $uomresult=DB_query($uomsql, $db); if (DB_num_rows($uomresult)... [truncated message content] |
From: <tim...@us...> - 2012-01-20 13:49:05
|
Revision: 4821 http://web-erp.svn.sourceforge.net/web-erp/?rev=4821&view=rev Author: tim_schofield Date: 2012-01-20 13:48:53 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Merge Tims branch into trunk: Add tendering facility Modified Paths: -------------- trunk/SupplierTenders.php trunk/UpgradeDatabase.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/ConnectDB.inc trunk/includes/DefineOfferClass.php trunk/includes/UserLogin.php trunk/index.php trunk/sql/mysql/upgrade4.05-4.06.sql Added Paths: ----------- trunk/SupplierTenderCreate.php trunk/includes/DefineTenderClass.php Added: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php (rev 0) +++ trunk/SupplierTenderCreate.php 2012-01-20 13:48:53 UTC (rev 4821) @@ -0,0 +1,809 @@ +<?php +/* $Id$*/ + +include('includes/DefineTenderClass.php'); +include('includes/SQL_CommonFunctions.inc'); +include('includes/session.inc'); + +$Maximum_Number_Of_Parts_To_Show=50; + +if (isset($_GET['New']) and isset($_SESSION['tender'])) { + unset($_SESSION['tender']); +} + +if (isset($_GET['New']) and $_SESSION['CanCreateTender']==0) { + $title = _('Authorisation Problem'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; + prnMsg( _('You do not have authority to create supplier tenders for this company.') . '<br />' . + _('Please see your system administrator'), 'warn'); + include('includes/footer.inc'); + exit; +} + +if (isset($_GET['Edit']) and $_SESSION['CanCreateTender']==0) { + $title = _('Authorisation Problem'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; + prnMsg( _('You do not have authority to amend supplier tenders for this company.') . '<br />' . + _('Please see your system administrator'), 'warn'); + include('includes/footer.inc'); + exit; +} + +$ShowTender = 0; + +if (isset($_GET['ID'])) { + $sql="SELECT tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + if (isset($_SESSION['tender'])) { + unset($_SESSION['tender']); + } + $_SESSION['tender'] = new Tender(); + $_SESSION['tender']->TenderId = $myrow['tenderid']; + $_SESSION['tender']->Location = $myrow['location']; + $_SESSION['tender']->DelAdd1 = $myrow['address1']; + $_SESSION['tender']->DelAdd2 = $myrow['address2']; + $_SESSION['tender']->DelAdd3 = $myrow['address3']; + $_SESSION['tender']->DelAdd4 = $myrow['address4']; + $_SESSION['tender']->DelAdd5 = $myrow['address5']; + $_SESSION['tender']->DelAdd6 = $myrow['address6']; + + $sql="SELECT tenderid, + tendersuppliers.supplierid, + suppliers.suppname, + tendersuppliers.email + FROM tendersuppliers + LEFT JOIN suppliers + ON tendersuppliers.supplierid=suppliers.supplierid + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + while ($myrow=DB_fetch_array($result)) { + $_SESSION['tender']->add_supplier_to_tender( + $myrow['supplierid'], + $myrow['suppname'], + $myrow['email']); + } + + $sql="SELECT tenderid, + tenderitems.stockid, + tenderitems.quantity, + stockmaster.description, + tenderitems.units, + stockmaster.decimalplaces + FROM tenderitems + LEFT JOIN stockmaster + ON tenderitems.stockid=stockmaster.stockid + WHERE tenderid='" . $_GET['ID'] . "'"; + $result=DB_query($sql, $db); + while ($myrow=DB_fetch_array($result)) { + $_SESSION['tender']->add_item_to_tender( + $_SESSION['tender']->LinesOnTender, + $myrow['stockid'], + $myrow['quantity'], + $myrow['description'], + $myrow['units'], + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + } + $ShowTender = 1; +} + +if (isset($_GET['Edit'])) { + $title = _('Edit an Existing Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; + $sql="SELECT tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + WHERE closed=0"; + $result=DB_query($sql, $db); + echo '<table class="selection">'; + echo '<tr><th>' . _('Tender ID') . '</th>'; + echo '<th>' . _('Location') . '</th>'; + echo '<th>' . _('Address 1') . '</th>'; + echo '<th>' . _('Address 2') . '</th>'; + echo '<th>' . _('Address 3') . '</th>'; + echo '<th>' . _('Address 4') . '</th>'; + echo '<th>' . _('Address 5') . '</th>'; + echo '<th>' . _('Address 6') . '</th>'; + echo '<th>' . _('Telephone') . '</th></tr>'; + while ($myrow=DB_fetch_array($result)) { + echo '<tr><td>' . $myrow['tenderid'] . '</td>'; + echo '<td>' . $myrow['location'] . '</td>'; + echo '<td>' . $myrow['address1'] . '</td>'; + echo '<td>' . $myrow['address2'] . '</td>'; + echo '<td>' . $myrow['address3'] . '</td>'; + echo '<td>' . $myrow['address4'] . '</td>'; + echo '<td>' . $myrow['address5'] . '</td>'; + echo '<td>' . $myrow['address6'] . '</td>'; + echo '<td>' . $myrow['telephone'] . '</td>'; + echo '<td><a href="'.$_SERVER['PHP_SELF'] . '?ID='.$myrow['tenderid'].'">'. _('Edit') .'</a></td>'; + } + echo '</table>'; + include('includes/footer.inc'); + exit; +} else if (isset($_GET['ID']) or (isset($_SESSION['tender']->TenderId))) { + $title = _('Edit an Existing Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; +} else { + $title = _('Create a New Supplier Tender Request'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order Tendering') . '" alt="" /> '.$title . '</p>'; +} + +if (isset($_POST['Save'])) { + $_SESSION['tender']->RequiredByDate=$_POST['RequiredByDate']; + $_SESSION['tender']->save($db); + $_SESSION['tender']->EmailSuppliers(); + prnMsg( _('The tender has been successfully saved'), 'success'); + include('includes/footer.inc'); + exit; +} + +if (isset($_GET['DeleteSupplier'])) { + $_SESSION['tender']->remove_supplier_from_tender($_GET['DeleteSupplier']); + $ShowTender = 1; +} + +if (isset($_GET['DeleteItem'])) { + $_SESSION['tender']->remove_item_from_tender($_GET['DeleteItem']); + $ShowTender = 1; +} + +if (isset($_POST['SelectedSupplier'])) { + $sql = "SELECT suppname, + email + FROM suppliers + WHERE supplierid='" . $_POST['SelectedSupplier'] . "'"; + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); + if (mb_strlen($myrow['email'])>0) { + $_SESSION['tender']->add_supplier_to_tender( + $_POST['SelectedSupplier'], + $myrow['suppname'], + $myrow['email']); + } else { + prnMsg( _('The supplier must have an email set up or they cannot be part of a tender'), 'warn'); + } + $ShowTender = 1; +} + +if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { + foreach ($_POST as $key => $value) { + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID = $value; + $Quantity = filter_number_format($_POST['Qty'.$Index]); + $UOM = $_POST['UOM'.$Index]; + $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + $_SESSION['tender']->add_item_to_tender( + $_SESSION['tender']->LinesOnTender, + $StockID, + $Quantity, + $myrow['description'], + $UOM, + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + unset($UOM); + } + } + $ShowTender = 1; +} + +if (!isset($_SESSION['tender']) or isset($_POST['LookupDeliveryAddress']) or $ShowTender==1) { + /* Show Tender header screen */ + if (!isset($_SESSION['tender'])) { + $_SESSION['tender']=new Tender(); + } + echo '<form name="form1" action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<tr><th colspan="4"><font size="3" color="#616161">' . _('Tender header details') . '</font></th></tr>'; + echo '<tr><td>' . _('Delivery Must Be Made Before') . '</td>'; + echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredByDate" size="11" value="' . date($_SESSION['DefaultDateFormat']) . '" /></td></tr>'; + + if (!isset($_POST['StkLocation']) OR $_POST['StkLocation']==''){ + /* If this is the first time + * the form loaded set up defaults */ + + $_POST['StkLocation'] = $_SESSION['UserStockLocation']; + + $sql = "SELECT deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; + + $LocnAddrResult = DB_query($sql,$db); + if (DB_num_rows($LocnAddrResult)==1){ + $LocnRow = DB_fetch_array($LocnAddrResult); + $_POST['DelAdd1'] = $LocnRow['deladd1']; + $_POST['DelAdd2'] = $LocnRow['deladd2']; + $_POST['DelAdd3'] = $LocnRow['deladd3']; + $_POST['DelAdd4'] = $LocnRow['deladd4']; + $_POST['DelAdd5'] = $LocnRow['deladd5']; + $_POST['DelAdd6'] = $LocnRow['deladd6']; + $_POST['Tel'] = $LocnRow['tel']; + $_POST['Contact'] = $LocnRow['contact']; + + $_SESSION['tender']->Location= $_POST['StkLocation']; + $_SESSION['tender']->DelAdd1 = $_POST['DelAdd1']; + $_SESSION['tender']->DelAdd2 = $_POST['DelAdd2']; + $_SESSION['tender']->DelAdd3 = $_POST['DelAdd3']; + $_SESSION['tender']->DelAdd4 = $_POST['DelAdd4']; + $_SESSION['tender']->DelAdd5 = $_POST['DelAdd5']; + $_SESSION['tender']->DelAdd6 = $_POST['DelAdd6']; + $_SESSION['tender']->Telephone = $_POST['Tel']; + $_SESSION['tender']->Contact = $_POST['Contact']; + + } else { + /*The default location of the user is crook */ + prnMsg(_('The default stock location set up for this user is not a currently defined stock location') . + '. ' . _('Your system administrator needs to amend your user record'),'error'); + } + + + } elseif (isset($_POST['LookupDeliveryAddress'])){ + + $sql = "SELECT deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; + + $LocnAddrResult = DB_query($sql,$db); + if (DB_num_rows($LocnAddrResult)==1){ + $LocnRow = DB_fetch_array($LocnAddrResult); + $_POST['DelAdd1'] = $LocnRow['deladd1']; + $_POST['DelAdd2'] = $LocnRow['deladd2']; + $_POST['DelAdd3'] = $LocnRow['deladd3']; + $_POST['DelAdd4'] = $LocnRow['deladd4']; + $_POST['DelAdd5'] = $LocnRow['deladd5']; + $_POST['DelAdd6'] = $LocnRow['deladd6']; + $_POST['Tel'] = $LocnRow['tel']; + $_POST['Contact'] = $LocnRow['contact']; + + $_SESSION['tender']->Location= $_POST['StkLocation']; + $_SESSION['tender']->DelAdd1 = $_POST['DelAdd1']; + $_SESSION['tender']->DelAdd2 = $_POST['DelAdd2']; + $_SESSION['tender']->DelAdd3 = $_POST['DelAdd3']; + $_SESSION['tender']->DelAdd4 = $_POST['DelAdd4']; + $_SESSION['tender']->DelAdd5 = $_POST['DelAdd5']; + $_SESSION['tender']->DelAdd6 = $_POST['DelAdd6']; + $_SESSION['tender']->Telephone = $_POST['Tel']; + $_SESSION['tender']->Contact = $_POST['Contact']; + } + } + echo '<tr><td>' . _('Warehouse') . ':</td> + <td><select name=StkLocation onChange="ReloadForm(form1.LookupDeliveryAddress)">'; + + $sql = "SELECT loccode, + locationname + FROM locations"; + $LocnResult = DB_query($sql,$db); + + while ($LocnRow=DB_fetch_array($LocnResult)){ + if ((isset($_SESSION['tender']->Location) and $_SESSION['tender']->Location == $LocnRow['loccode'])){ + echo '<option selected="True" value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; + } else { + echo '<option value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; + } + } + + echo '</select> + <input type="submit" name="LookupDeliveryAddress" value="' ._('Select') . '" /></td> + </tr>'; + + /* Display the details of the delivery location + */ + echo '<tr><td>' . _('Delivery Contact') . ':</td> + <td><input type="text" name="Contact" size="41" value="' . $_SESSION['tender']->Contact . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 1 :</td> + <td><input type="text" name="DelAdd1" size="41" maxlength="40" value="' . $_POST['DelAdd1'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 2 :</td> + <td><input type="text" name="DelAdd2" size="41" maxlength="40" value="' . $_POST['DelAdd2'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 3 :</td> + <td><input type="text" name="DelAdd3" size="41" maxlength="40" value="' . $_POST['DelAdd3'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 4 :</td> + <td><input type="text" name="DelAdd4" size="21" maxlength="20" value="' . $_POST['DelAdd4'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 5 :</td> + <td><input type="text" name="DelAdd5" size="16" maxlength="15" value="' . $_POST['DelAdd5'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Address') . ' 6 :</td> + <td><input type="text" name="DelAdd6" size="16" maxlength="15" value="' . $_POST['DelAdd6'] . '" /></td> + </tr>'; + echo '<tr><td>' . _('Phone') . ':</td> + <td><input type="text" name="Tel" size="31" maxlength="30" value="' . $_SESSION['tender']->Telephone . '" /></td> + </tr>'; + echo '</table><br />'; + + /* Display the supplier/item details + */ + echo '<table>'; + + /* Supplier Details + */ + echo '<tr><td valign="top"><table class="selection">'; + echo '<tr><th colspan="4"><font size="3" color="#616161">' . _('Suppliers To Send Tender') . '</font></th></tr>'; + echo '<tr><th>'. _('Supplier Code') . '</th><th>' ._('Supplier Name') . '</th><th>' ._('Email Address') . '</th></tr>'; + foreach ($_SESSION['tender']->Suppliers as $Supplier) { + echo '<tr><td>' . $Supplier->SupplierCode . '</td>'; + echo '<td>' . $Supplier->SupplierName . '</td>'; + echo '<td>' . $Supplier->EmailAddress . '</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteSupplier=' . $Supplier->SupplierCode . '">' . _('Delete') . '</a></td></tr>'; + } + echo '</table></td>'; + /* Item Details + */ + echo '<td valign="top"><table class="selection">'; + echo '<tr><th colspan="6"><font size="3" color="#616161">' . _('Items in Tender') . '</font></th></tr>'; + echo '<tr>'; + echo '<th>'._('Stock ID').'</th>'; + echo '<th>'._('Description').'</th>'; + echo '<th>'._('Quantity').'</th>'; + echo '<th>'._('UOM').'</th>'; + echo '</tr>'; + $k=0; + foreach ($_SESSION['tender']->LineItems as $LineItems) { + if ($LineItems->Deleted==False) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + echo '<td>'.$LineItems->StockID.'</td>'; + echo '<td>'.$LineItems->ItemDescription.'</td>'; + echo '<td class="number">' . locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'</td>'; + echo '<td>'.$LineItems->Units.'</td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?DeleteItem=' . $LineItems->LineNo . '">' . _('Delete') . '</a></td></tr>'; + echo '</tr>'; + } + } + echo '</table></td></tr></table><br />'; + + echo '<div class="centre"><input type="submit" name="Suppliers" value="' . _('Select Suppliers') . '" />'; + echo '<input type="submit" name="Items" value="' . _('Select Item Details') . '" /></div><br />'; + if ($_SESSION['tender']->LinesOnTender > 0 and $_SESSION['tender']->SuppliersOnTender > 0) { + echo '<div class="centre"><input type="submit" name="Save" value="' . _('Save Tender') . '" /></div>'; + } + echo '</form>'; + include('includes/footer.inc'); + exit; +} + +if (isset($_POST['SearchSupplier']) OR isset($_POST['Go']) OR isset($_POST['Next']) OR isset($_POST['Previous'])) { + if (mb_strlen($_POST['Keywords']) > 0 AND mb_strlen($_POST['SupplierCode']) > 0) { + prnMsg( '<br />' . _('Supplier name keywords have been used in preference to the Supplier code extract entered'), 'info' ); + } + if ($_POST['Keywords'] == '' AND $_POST['SupplierCode'] == '') { + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + ORDER BY suppname"; + } else { + if (mb_strlen($_POST['Keywords']) > 0) { + $_POST['Keywords'] = mb_strtoupper($_POST['Keywords']); + //insert wildcard characters in spaces + $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + WHERE suppname " . LIKE . " '$SearchString' + ORDER BY suppname"; + } elseif (mb_strlen($_POST['SupplierCode']) > 0) { + $_POST['SupplierCode'] = mb_strtoupper($_POST['SupplierCode']); + $SQL = "SELECT supplierid, + suppname, + currcode, + address1, + address2, + address3, + address4 + FROM suppliers + WHERE supplierid " . LIKE . " '%" . $_POST['SupplierCode'] . "%' + ORDER BY supplierid"; + } + } //one of keywords or SupplierCode was more than a zero length string + $result = DB_query($SQL, $db); + if (DB_num_rows($result) == 1) { + $myrow = DB_fetch_row($result); + $SingleSupplierReturned = $myrow[0]; + } +} //end of if search +if (isset($SingleSupplierReturned)) { /*there was only one supplier returned */ + $_SESSION['SupplierID'] = $SingleSupplierReturned; + unset($_POST['Keywords']); + unset($_POST['SupplierCode']); +} + +if (!isset($_POST['PageOffset'])) { + $_POST['PageOffset'] = 1; +} else { + if ($_POST['PageOffset'] == 0) { + $_POST['PageOffset'] = 1; + } +} + +if (isset($_POST['Suppliers'])) { + 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 Suppliers') . '</p> + <table cellpadding="3" colspan="4" class="selection"><tr><td>' . _('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><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 '</td></tr></table><br /><div class="centre"><input type="submit" name="SearchSupplier" value="' . _('Search Now') . '" /></div>'; + echo '</form>'; +} + +if (isset($_POST['SearchSupplier'])) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + $ListCount = DB_num_rows($result); + $ListPageMax = ceil($ListCount / $_SESSION['DisplayRecordsMax']); + 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; + } + } + if ($ListPageMax > 1) { + echo '<br /> ' . $_POST['PageOffset'] . ' ' . _('of') . ' ' . $ListPageMax . ' ' . _('pages') . '. ' . _('Go to Page') . ': '; + echo '<select name="PageOffset">'; + $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="Go" value="' . _('Go') . '" /> + <input type="submit" name="Previous" value="' . _('Previous') . '" /> + <input type="submit" name="Next" value="' . _('Next') . '" />'; + echo '<br />'; + } + echo '<input type="hidden" name="Search" value="' . _('Search Now') . '" />'; + echo '<br /><br />'; + echo '<br /><table cellpadding="2" colspan="7">'; + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Address 1') . '</th> + <th>' . _('Address 2') . '</th> + <th>' . _('Address 3') . '</th> + <th>' . _('Address 4') . '</th> + </tr>'; + echo $tableheader; + $j = 1; + $k = 0; //row counter to determine background colour + $RowIndex = 0; + if (DB_num_rows($result) <> 0) { + 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><input type="submit" name="SelectedSupplier" value="'.$myrow['supplierid'].'" /></td> + <td>'.$myrow['suppname'].'</td> + <td>'.$myrow['currcode'].'</td> + <td>'.$myrow['address1'].'</td> + <td>'.$myrow['address2'].'</td> + <td>'.$myrow['address3'].'</td> + <td>'.$myrow['address4'].'</td> + </tr>'; + $RowIndex = $RowIndex + 1; + //end of page full new headings if + } + //end of while loop + echo '</table>'; +} + +/*The supplier has chosen option 2 + */ +if (isset($_POST['Items'])) { + 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 Inventory Items') . '</p>'; + $sql = "SELECT categoryid, + categorydescription + FROM stockcategory + ORDER BY categorydescription"; + $result = DB_query($sql, $db); + if (DB_num_rows($result) == 0) { + echo '<br /><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . + _('There are no stock categories currently defined please use the link below to set them up'); + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; + exit; + } + echo '<table class="selection"><tr>'; + echo '<td>' . _('In Stock Category') . ':'; + echo '<select name="StockCat">'; + if (!isset($_POST['StockCat'])) { + $_POST['StockCat'] = ""; + } + if ($_POST['StockCat'] == 'All') { + echo '<option selected="True" value="All">' . _('All') . '</option>'; + } else { + echo '<option value="All">' . _('All') . '</option>'; + } + while ($myrow1 = DB_fetch_array($result)) { + if ($myrow1['categoryid'] == $_POST['StockCat']) { + echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } else { + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; + } + } + echo '</select>'; + echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</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></tr><tr><td></td>'; + echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; + echo '<td>'; + if (isset($_POST['StockCode'])) { + echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; + } else { + echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; + } + echo '</td></tr></table><br />'; + echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; + echo '</form>'; +} + +if (isset($_POST['Search'])){ /*ie seach for stock items */ + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items required on this tender').'</p>'; + + 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 + $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; + + if ($_POST['StockCat']=='All'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; + } else { + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + 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 INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; + } else { + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + + } else { + if ($_POST['StockCat']=='All'){ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; + } else { + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; + } + } + + $ErrMsg = _('There is a problem selecting the part records to display because'); + $DbgMsg = _('The SQL statement that failed was'); + $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); + + if (DB_num_rows($SearchResult)==0 and $debug==1){ + prnMsg( _('There are no products to display matching the criteria provided'),'warn'); + } + if (DB_num_rows($SearchResult)==1){ + + $myrow=DB_fetch_array($SearchResult); + $_GET['NewItem'] = $myrow['stockid']; + DB_data_seek($SearchResult,0); + } + + if (isset($SearchResult)) { + + echo '<table cellpadding="1" colspan="7">'; + + $tableheader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; + echo $tableheader; + + $i = 0; + $k = 0; //row colour counter + $PartsDisplayed=0; + while ($myrow=DB_fetch_array($SearchResult)) { + + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + $filename = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; + + } else { + $ImageSource = '<i>'._('No Image').'</i>'; + } + + $uom=$myrow['units']; + + echo '<td>'.$myrow['stockid'].'</td> + <td>'.$myrow['description'].'</td> + <td>'.$uom.'</td> + <td>'.$ImageSource.'</td> + <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> + <input type="hidden" value="'.$uom.'" name="UOM'.$i.'" /> + <input type="hidden" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> + </tr>'; + + $PartsDisplayed++; + if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ + break; + } + $i++; +#end of page full new headings if + } +#end of while loop + echo '</table>'; + if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ + + /*$Maximum_Number_Of_Parts_To_Show defined in config.php */ + + prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . + _('Please restrict your search to only the parts required'),'info'); + } + echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Tender" /></div>'; + }#end if SearchResults to show + + echo '</form>'; + +} //end of if search + +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2012-01-20 08:19:32 UTC (rev 4820) +++ trunk/SupplierTenders.php 2012-01-20 13:48:53 UTC (rev 4821) @@ -8,6 +8,10 @@ $Maximum_Number_Of_Parts_To_Show=50; +if (isset($_GET['TenderType'])) { + $_POST['TenderType']=$_GET['TenderType']; +} + if (!isset($_POST['SupplierID'])) { $sql="SELECT supplierid FROM www_users WHERE userid='" . $_SESSION['UserID'] . "'"; $result=DB_query($sql, $db); @@ -27,12 +31,110 @@ $_SESSION['offer']->remove_from_offer($_GET['Delete']); } -$sql="SELECT suppname, currcode FROM suppliers WHERE supplierid='" . $_POST['SupplierID'] . "'"; +$sql="SELECT suppname, + currcode + FROM suppliers + WHERE supplierid='".$_POST['SupplierID']."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $Supplier=$myrow['suppname']; $Currency=$myrow['currcode']; +if (isset($_POST['Confirm'])) { + $_SESSION['offer']->Save($db); + $_SESSION['offer']->EmailOffer(); + $sql="UPDATE tendersuppliers + SET responded=1 + WHERE supplierid='" . $_SESSION['offer']->SupplierID . "' + AND tenderid='" . $_SESSION['offer']->TenderID . "'"; + $result=DB_query($sql, $db); +} + +if (isset($_POST['Process'])) { + if (isset($_SESSION['offer'])) { + unset($_SESSION['offer']); + } + $_SESSION['offer']=new Offer($_POST['SupplierID']); + $_SESSION['offer']->TenderID=$_POST['Tender']; + $_SESSION['offer']->CurrCode=$Currency; + $LineNo=0; + foreach ($_POST as $key=>$value) { + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $ItemCode=$value; + $Quantity=$_POST['Qty'.$Index]; + $Price=$_POST['Price'.$Index]; + $_SESSION['offer']->add_to_offer( + $LineNo, + $ItemCode, + $Quantity, + $_POST['ItemDescription'.$Index], + $Price, + $_POST['UOM'.$Index], + $_POST['DecimalPlaces'.$Index], + $_POST['RequiredByDate'.$Index]); + $LineNo++; + } + } + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Confirm the Response For Tender') . ' ' . $_SESSION['offer']->TenderID .'</p>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection">'; + echo '<input type="hidden" name="TenderType" value="3" />'; + $LocationSQL="SELECT tenderid, + locations.locationname, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + LEFT JOIN locations + ON tenders.location=locations.loccode + WHERE closed=0 + AND tenderid='".$_SESSION['offer']->TenderID."'"; + $LocationResult=DB_query($LocationSQL, $db); + $MyLocationRow=DB_fetch_row($LocationResult); + $CurrencySQL="SELECT decimalplaces from currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; + $CurrencyResult=DB_query($CurrencySQL, $db); + $CurrencyRow=DB_fetch_array($CurrencyResult); + echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + for ($i=1; $i<8; $i++) { + if ($MyLocationRow[$i]!='') { + echo $MyLocationRow[$i] . '<br />'; + } + } + echo '</td>'; + echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$_SESSION['offer']->TenderID . '</font></th>'; + echo '<input type="hidden" value="' . $_SESSION['offer']->TenderID . '" name="Tender" />'; + echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Currency') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; + echo '<th>' . _('Line Value') . '</th>'; + echo '<th>' . _('Delivery By') . '</th>'; + foreach ($_SESSION['offer']->LineItems as $LineItem) { + echo '<tr><td>' . $LineItem->StockID . '</td>'; + echo '<td>' . $LineItem->ItemDescription . '</td>'; + echo '<td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td>'; + echo '<td>' . $LineItem->Units . '</td>'; + echo '<td>' . $_SESSION['offer']->CurrCode . '</td>'; + echo '<td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td>'; + echo '<td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td>'; + echo '<td>' . $LineItem->ExpiryDate . '</td>'; + } + echo '</table><br />'; + echo '<div class="centre"><input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /><br />'; + echo '<br /><input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /></div>'; + echo '</form>'; + include('includes/footer.inc'); + exit; +} + /* If the supplierID is set then it must be a login from the supplier but if nothing else is * set then the supplier must have just logged in so show them the choices. */ @@ -42,66 +144,57 @@ } echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; echo '<table class="selection">'; echo'<tr><td>'._('Select option for tendering').'</td>'; - echo '<td><select name=TenderType>'; - echo '<option value=1>'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; - echo '<option value=2>'._('Create a new offer from').' '.$Supplier .'</option>'; -// echo '<option value=3>'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; + echo '<td><select name="TenderType">'; + echo '<option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; + echo '<option value="2">'._('Create a new offer from').' '.$Supplier .'</option>'; + echo '<option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; echo '</select></td></tr>'; - echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'"'; - echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '"></div></td></tr>'; - echo '</table> - </form>'; + echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; + echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '" /></div></td></tr>'; + echo '</table></form>'; } if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { - if (mb_substr($key,0,3)=='qty') { - $StockID=mb_substr($key,3); - $Quantity=$value; + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID=$value; + $Quantity=filter_number_format($_POST['Qty'.$Index]); + $Price=filter_number_format($_POST['Price'.$Index]); + $UOM=$_POST['uom'.$Index]; + if (isset($UOM) and $Quantity>0) { + $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + $_SESSION['offer']->add_to_offer($_SESSION['offer']->LinesOnOffer, + $StockID, + $Quantity, + $myrow['description'], + $Price, + $UOM, + $myrow['decimalplaces'], + DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); + unset($UOM); + } } - if (mb_substr($key,0,5)=='price') { - $Price=$value; - } - if (mb_substr($key,0,3)=='uom') { - $UOM=$value; - } - if (isset($UOM)) { - $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='" . $StockID."'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_array($result); - $_SESSION['offer']->add_to_offer( - $_SESSION['offer']->LinesOnOffer, - $StockID, - $Quantity, - $myrow['description'], - $Price, - $UOM, - $myrow['decimalplaces'], - DateAdd(date($_SESSION['DefaultDateFormat']),'m',3)); - unset($UOM); - } } } if (isset($_POST['Refresh']) and !isset($_POST['NewItem'])) { foreach ($_POST as $key => $value) { - if (mb_substr($key,0,3)=='qty') { - $LineNo=mb_substr($key,3); - $Quantity=$value; + if (mb_substr($key,0,7)=='StockID') { + $Index = mb_substr($key,7,mb_strlen($key)-7); + $StockID=$value; + $Quantity=filter_number_format($_POST['Qty'.$Index]); + $Price=filter_number_format($_POST['Price'.$Index]); + $ExpiryDate=$_POST['expirydate'.$Index]; } - if (mb_substr($key,0,5)=='price') { - $Price=$value; - } - if (mb_substr($key,0,10)=='expirydate') { - $ExpiryDate=$value; - } if (isset($ExpiryDate)) { $_SESSION['offer']->update_offer_item( - $LineNo, + $Index, $Quantity, $Price, $ExpiryDate); @@ -111,7 +204,6 @@ } if (isset($_POST['Update'])) { - $MailText=''; foreach ($_POST as $key => $value) { if (mb_substr($key,0,3)=='qty') { $LineNo=mb_substr($key,3); @@ -132,31 +224,14 @@ unset($ExpiryDate); } } - foreach ($_SESSION['offer']->LineItems as $LineItems) { - $sql="UPDATE offers SET - quantity='".$LineItems->Quantity."', - price='".$LineItems->Price."', - expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' - WHERE offerid='".$LineItems->LineNo . "'"; - $ErrMsg = _('The suppliers offer could not be updated on the database because'); - $DbgMsg = _('The SQL statement used to update the suppliers offer record and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - if (DB_error_no($db)==0) { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('has been updated in the database'), 'success'); - $MailText .= $LineItems->Quantity.$LineItems->Units.' '._('of').' '.$LineItems->StockID.' '._('at a price of'). - ' '.$Currency.$LineItems->Price."\n"; - } else { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('could not be updated in the database'), 'error'); - include('includes/footer.inc'); - exit; - } - } + $_SESSION['offer']->Save($db, 'Yes'); + $_SESSION['offer']->EmailOffer(); + unset($_SESSION['offer']); include('includes/footer.inc'); exit; } if (isset($_POST['Save'])) { - $MailText=''; foreach ($_POST as $key => $value) { if (mb_substr($key,0,3)=='qty') { $LineNo=mb_substr($key,3); @@ -177,46 +252,9 @@ unset($ExpiryDate); } } - foreach ($_SESSION['offer']->LineItems as $LineItems) { - if ($LineItems->Deleted==False) { - $sql="INSERT INTO offers ( - supplierid, - stockid, - quantity, - uom, - price, - expirydate, - currcode) - VALUES ( - '".$_POST['SupplierID']."', - '".$LineItems->StockID."', - '".$LineItems->Quantity."', - '".$LineItems->Units."', - '".$LineItems->Price."', - '".FormatDateForSQL($LineItems->ExpiryDate)."', - '".$Currency."' - )"; - $ErrMsg = _('The suppliers offer could not be inserted into the database because'); - $DbgMsg = _('The SQL statement used to insert the suppliers offer record and failed was'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - if (DB_error_no($db)==0) { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('has been inserted into the database'), 'success'); - $MailText .= $LineItems->Quantity.$LineItems->Units.' '._('of').' '.$LineItems->StockID.' '._('at a price of'). - ' '.$Currency.$LineItems->Price."\n"; - } else { - prnMsg( _('The offer for').' '.$LineItems->StockID.' '._('could not be inserted into the database'), 'error'); - include('includes/footer.inc'); - exit; - } - } - } - include ('includes/htmlMimeMail.php'); - $mail = new htmlMimeMail(); - $mail->setSubject(_('Offer received from').' '.$Supplier); - $mail->setText(_('This email is automatically generated by webERP')."\n" . - _('You have received the following offer from').' '.$Supplier."\n\n".$MailText); - $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>'); - $result = $mail->send(array($_SESSION['PurchasingManagerEmail']), 'smtp'); + $_SESSION['offer']->Save($db); + $_SESSION['offer']->EmailOffer(); + unset($_SESSION['offer']); include('includes/footer.inc'); exit; } @@ -234,11 +272,10 @@ stockmaster.decimalplaces FROM offers INNER JOIN stockmaster - ON offers.stockid=stockmaster.stockid - WHERE offers.supplierid='" . $_POST['SupplierID']."'"; + ON offers.stockid=stockmaster.stockid + WHERE offers.supplierid='" . $_POST['SupplierID'] . "'"; $result=DB_query($sql, $db); - $_SESSION['offer']=new Offer(); - $_SESSION['offer']->SupplierID=$_POST['SupplierID']; + $_SESSION['offer']=new Offer($_POST['SupplierID']); $_SESSION['offer']->CurrCode=$Currency; while ($myrow=DB_fetch_array($result)) { $_SESSION['offer']->add_to_offer( @@ -253,11 +290,10 @@ } } -if (isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { +if (isset($_POST['TenderType']) and $_POST['TenderType']!=3 and isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; echo '<table>'; echo '<tr> <th>'._('Stock ID').'</th> @@ -279,27 +315,28 @@ $k=1; } if ($LineItems->ExpiryDate < date('Y-m-d')) { - echo '<tr bgcolor=#F7A9A9>'; + echo '<tr bgcolor="#F7A9A9">'; } + echo '<input type="hidden" name="StockID'.$LineItems->LineNo.'" value="'.$LineItems->StockID.'" />'; echo '<td>'.$LineItems->StockID.'</td>'; echo '<td>'.$LineItems->ItemDescription.'</td>'; - echo '<td><input type="text" class=number name="qty'.$LineItems->LineNo.'" value='.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'></td>'; + echo '<td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td>'; echo '<td>'.$LineItems->Units.'</td>'; - echo '<td><input type="text" class=number name="price'.$LineItems->LineNo.'" value='.locale_number_format($LineItems->Price,2,'.','').'></td>'; - echo '<td class=number>'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; - echo '<td><input type="text" size=11 class=date alt='.$_SESSION['DefaultDateFormat'].' name="expirydate'.$LineItems->LineNo.'" value='.$LineItems->ExpiryDate.'></td>'; + echo '<td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td>'; + echo '<td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; + echo '<td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td>'; echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td></tr>'; echo '</tr>'; } } echo '</table>'; - echo '<input type=hidden name=TenderType value="'.$_POST['TenderType'].'">'; + echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; if ($_POST['TenderType']==1) { - echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen"></div>'; + echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer" />'; + echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; } else if ($_POST['TenderType']==2) { echo '<br /><div class="centre"><input type="submit" name="Save" value="Save offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen"></div>'; + echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; } echo '</form>'; } @@ -308,74 +345,175 @@ */ if (isset($_POST['TenderType']) and $_POST['TenderType']==2 and !isset($_POST['Search']) or isset($_GET['Delete'])) { if (!isset($_SESSION['offer'])) { - $_SESSION['offer']=new Offer(); - $_SESSION['offer']->SupplierID=$_POST['SupplierID']; + $_SESSION['offer']=new Offer($_POST['SupplierID']); } echo '<form action="' . htmlspecialchars($_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 Inventory Items') . '</p>'; - - $sql = 'SELECT categoryid, + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; + + $sql = "SELECT categoryid, categorydescription FROM stockcategory - ORDER BY categorydescription'; + ORDER BY categorydescription"; $result = DB_query($sql, $db); - + if (DB_num_rows($result) == 0) { - echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . + echo '<p><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up'); - echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a></p>'; exit; } - echo '<table class=selection><tr>'; + echo '<table class="selection"><tr>'; echo '<td>' . _('In Stock Category') . ':'; echo '<select name="StockCat">'; if (!isset($_POST['StockCat'])) { $_POST['StockCat'] = ''; } if ($_POST['StockCat'] == 'All') { - echo '<option selected value="All">' . _('All'); + echo '<option selected="True" value="All">' . _('All') . '</option>'; } else { - echo '<option value="All">' . _('All'); + echo '<option value="All">' . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result)) { if ($myrow1['categoryid'] == $_POST['StockCat']) { - echo '<option selected VALUE="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option selected="True" value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } else { - echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } } echo '</select>'; echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</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 '<input type="hidden" name="TenderType" value='.$_POST['TenderType'].'>'; - echo '<input type="hidden" name="SupplierID" value='.$_POST['SupplierID'].'>'; + echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; + echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; echo '</td></tr><tr><td></td>'; - echo '<td><font size 3><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; + echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; echo '<td>'; if (isset($_POST['StockCode'])) { - echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18">'; + echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { - echo '<input type="text" name="StockCode" size="15" maxlength="18">'; + echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } echo '</td></tr></table><br />'; - echo '<div class="centre"><input type=submit name="Search" value="' . _('Search Now') . '"></div><br /></form>'; + echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; echo '</form>'; } +/*The supplier has chosen option 3 + */ +if (isset($_POST['TenderType']) and $_POST['TenderType']==3 and !isset($_POST['Search']) or isset($_GET['Delete'])) { + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Tenders Waiting For Offers').'</p>'; + $sql="SELECT DISTINCT tendersuppliers.tenderid, + suppliers.currcode + FROM tendersuppliers + LEFT JOIN suppliers + ON suppliers.supplierid=tendersuppliers.supplierid + LEFT JOIN tenders + ON tenders.tenderid=tendersuppliers.tenderid + WHERE tendersuppliers.supplierid='" . $_POST['SupplierID'] . "' + AND tenders.closed=0 + AND tendersuppliers.responded=0 + ORDER BY tendersuppliers.tenderid"; + $result=DB_query($sql, $db); + echo '<table class="selection">'; + echo '<tr><th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th></tr>'; + while ($myrow=DB_fetch_row($result)) { + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<input type="hidden" name="TenderType" value="3" />'; + $LocationSQL="SELECT tenderid, + locations.locationname, + address1, + address2, + address3, + address4, + address5, + address6, + telephone + FROM tenders + LEFT JOIN locations + ON tenders.location=locations.loccode + WHERE closed=0 + AND tenderid='".$myrow[0]."'"; + $LocationResult=DB_query($LocationSQL, $db); + $MyLocationRow=DB_fetch_row($LocationResult); + echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + for ($i=1; $i<8; $i++) { + if ($MyLocationRow[$i]!='') { + echo $MyLocationRow[$i] . '<br />'; + } + } + echo '</td>'; + echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$myrow[0] . '</font></th>'; + echo '<input type="hidden" value="' . $myrow[0] . '" name="Tender" />'; + echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th></tr>'; + $ItemSQL="SELECT tenderitems.tenderid, + tenderitems.stockid, + stockmaster.description, + stockmaster.decimalplaces, + purchdata.suppliers_partno, + tenderitems.quantity, + tenderitems.units, + tenders.requiredbydate, + purchdata.suppliersuom + FROM tenderitems + LEFT JOIN stockmaster + ON tenderitems.stockid=stockmaster.stockid + LEFT JOIN purchdata + ON tenderitems.stockid=purchdata.stockid + AND purchdata.supplierno='".$_POST['SupplierID']."' + LEFT JOIN tenders + ON tenders.tenderid=tenderitems.tenderid + WHERE tenderitems.tenderid='" . $myrow[0] . "'"; + $ItemResult=DB_query($ItemSQL, $db); + echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Item Description') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Item Code') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Required') . '</th>'; + echo '<th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Required By') . '</th>'; + echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; + echo '<th>' . _('Currency') . '</th>'; + echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; + echo '<th>' . _('Delivery By') . '</th>'; + $i=0; + while ($MyItemRow=DB_fetch_array($ItemResult)) { + echo '<tr><td>' . $MyItemRow['stockid'] . '</td>'; + echo '<td>' . $MyItemRow['description'] . '</td>'; + echo '<input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" />'; + echo '<input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" />'; + echo '<td>' . $MyItemRow['suppliers_partno'] . '</td>'; + echo '<td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td>'; + echo '<td>' . $MyItemRow['units'] . '</td>'; + echo '<td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + if ($MyItemRow['suppliersuom']=='') { + $MyItemRow['suppliersuom']=$MyItemRow['units']; + } + echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td>'; + echo '<input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" />'; + echo '<input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" />'; + echo '<td>' . $MyItemRow['suppliersuom'] . '</td>'; + echo '<td>' . $myrow[1] . '</td>'; + echo '<td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td>'; + echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td>'; + } + echo '</form>'; + } + echo '</table>'; +} + if (isset($_POST['Search'])){ /*ie seach for stock items */ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . - _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; - if ($_POST['Keywords'] AND $_POST['StockCode']) { + 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']) { @@ -471,7 +609,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 && $debug==1){ + if (DB_num_rows($SearchResult)==0 and $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -483,7 +621,7 @@ if (isset($SearchResult)) { - echo "<table cellpadding=1 colspan=7>"; + echo '<table cellpadding="1" colspan="7">'; $tableheader = '<tr> <th>' . _('Code') . '</th> @@ -495,8 +633,8 @@ </tr>'; echo $tableheader; - $j = 1; - $k=0; //row colour counter + $i = 0; + $k = 0; //row colour counter $PartsDisplayed=0; while ($myrow=DB_fetch_array($SearchResult)) { @@ -511,8 +649,7 @@ $filename = $myrow['stockid'] . '.jpg'; if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { - $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . - '.jpg" width="50" height="50">'; + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; } else { $ImageSource = '<i>'._('No Image').'</i>'; @@ -525,7 +662,7 @@ LEFT JOIN unitsofmeasure ON purchdata.suppliersuom=unitsofmeasure.unitid WHERE supplierno='".$_POST['SupplierID']."' - AND stockid='" . $myrow['stockid']. "'"; + AND stockid='" . $myrow['stockid'] . "'"; $uomresult=DB_query($uomsql, $db); if (DB_num_rows($uomresult)... [truncated message content] |
From: <vv...@us...> - 2012-01-20 22:52:52
|
Revision: 4822 http://web-erp.svn.sourceforge.net/web-erp/?rev=4822&view=rev Author: vvs2012 Date: 2012-01-20 22:52:45 +0000 (Fri, 20 Jan 2012) Log Message: ----------- xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php Modified Paths: -------------- trunk/CustomerBranches.php trunk/StockAdjustments.php trunk/WorkOrderEntry.php trunk/doc/Change.log Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Added: svn:ignore + reportwriter Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/CustomerBranches.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -360,8 +360,8 @@ $TotalEnable = 0; $TotalDisable = 0; if ($myrow) { - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="" />' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> + ' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; echo '<table class=selection>'; echo '<tr><th>'._('Code').'</th> @@ -526,11 +526,11 @@ $_POST['DeliverBlind'] = $myrow['deliverblind']; } - echo '<input type=hidden name="SelectedBranch" value="' . $SelectedBranch . '" />'; - echo '<input type=hidden name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; + echo '<input type="hidden" name="SelectedBranch" value="' . $SelectedBranch . '" />'; + echo '<input type="hidden" name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="">' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> + ' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { echo '<div class="centre"><a href=' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } @@ -576,11 +576,11 @@ if (!isset($_POST['BranchCode'])) { $_POST['BranchCode']=''; } - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Add a Branch').'</p>'; + 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> + <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="1" type="text" name="BranchCode" size="12" maxlength="10" value="' . $_POST['BranchCode'] . '" /></td> </tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -592,12 +592,12 @@ 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> + 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> + 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'])) { @@ -631,7 +631,7 @@ if (!isset($_POST['BrAddress5'])) { $_POST['BrAddress5']=''; } - echo '<td><input tabindex="8" type="text" name="BrAddress5" size="21" maxlength="20" value="'. $_POST['BrAddress5'].'"/></td> + echo '<td><input tabindex="8" type="text" name="BrAddress5" size="21" maxlength="20" value="'. $_POST['BrAddress5'].'" /></td> </tr> <tr> <td>'._('Street Address 6').':</td>'; @@ -652,14 +652,14 @@ 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> + 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> <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> + 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>'; @@ -805,7 +805,7 @@ </tr> <tr> <td>'._('Transactions on this branch') . ':</td> - <td><select tabindex=20 name="DisableTrans">'; + <td><select tabindex="20" name="DisableTrans">'; if ($_POST['DisableTrans']==0){ echo '<option selected value=0>' . _('Enabled') . '</option> <option value=1>' . _('Disabled') . '</option>'; @@ -828,7 +828,7 @@ } echo '<tr> <td>'._('Default freight/shipper method') . ':</td> - <td><select tabindex=21 name="DefaultShipVia">'; + <td><select tabindex="21" name="DefaultShipVia">'; while ($myrow=DB_fetch_array($ShipperResults)){ if (isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']){ echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/StockAdjustments.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -58,13 +58,11 @@ $_SESSION['Adjustment']->Quantity = filter_number_format($_POST['Quantity']); } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Inventory Adjustment') . '" alt="" />' . ' ' . _('Inventory Adjustment') . '</p>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory Adjustment') . '" alt="" />' . ' ' . _('Inventory Adjustment') . '</p>'; if (isset($_POST['CheckCode'])) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . - '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; if (mb_strlen($_POST['StockText'])>0) { $sql="SELECT stockid, @@ -352,27 +350,27 @@ $DecimalPlaces = $myrow['decimalplaces']; } echo '<br /><table class=selection>'; -echo '<tr><th colspan=4><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; +echo '<tr><th colspan="4"><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; if (!isset($_GET['Description'])) { $_GET['Description']=''; } echo '<tr><td>'. _('Stock Code'). ':</td><td>'; if (isset($StockID)) { - echo '<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size="21" value="' . $StockID . '" maxlength="20" /></td></tr>'; } else { - echo '<input type="text" name="StockID" size=21 value="" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size="21" value="" maxlength="20" /></td></tr>'; } echo '<tr> <td>'. _('Partial Description'). ':</td> <td><input type="text" name="StockText" size="21" value="' . $_GET['Description'] .'" /> '._('Partial Stock Code'). ':</td> <td>'; if (isset($StockID)) { - echo '<input type="text" name="StockCode" size=21 value="' . $StockID .'" maxlength="20" />'; + echo '<input type="text" name="StockCode" size="21" value="' . $StockID .'" maxlength="20" />'; } else { - echo '<input type="text" name="StockCode" size=21 value="" maxlength="20" />'; + echo '<input type="text" name="StockCode" size="21" value="" maxlength="20" />'; } echo '</td> - <td><input type="submit" name="CheckCode" value="'._('Check Part').'"></td> + <td><input type="submit" name="CheckCode" value="'._('Check Part').'" /></td> </tr>'; if (isset($_SESSION['Adjustment']) AND mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ echo '<tr> @@ -453,7 +451,7 @@ echo '</table> <div class="centre"> <br /> - <input type="submit" name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '"> + <input type="submit" name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '" /> <br />'; if (!isset($_POST['StockLocation'])) { Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/WorkOrderEntry.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -8,8 +8,7 @@ include('includes/SQL_CommonFunctions.inc'); echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title.' + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' </p>'; if (isset($_GET['ReqDate'])){ @@ -533,7 +532,7 @@ echo '<td class="number"><input type="hidden" name="RecdQty' . $i . '" value="' . $_POST['RecdQty' .$i] . '" />' . $_POST['RecdQty' .$i] .'</td> <td class="number">' . locale_number_format(($_POST['OutputQty' . $i] - $_POST['RecdQty' .$i]),$_POST['DecimalPlaces' . $i]) . '</td>'; if ($_POST['Controlled'.$i]==1){ - echo '<td><input type="text" name="NextLotSNRef' .$i . '" value="' . $_POST['NextLotSNRef'.$i] . '"></td>'; + echo '<td><input type="text" name="NextLotSNRef' .$i . '" value="' . $_POST['NextLotSNRef'.$i] . '" /></td>'; if ($_SESSION['DefineControlledOnWOEntry']==1){ if ($_POST['Serialised' . $i]==1){ $LotOrSN = _('S/Ns'); @@ -557,16 +556,16 @@ echo '<input type="hidden" name="HasWOSerialNos' . $i .'" value="' . $_POST['HasWOSerialNos' . $i] . '" />'; } } - echo '<input type=hidden name="NumberOfOutputs" value="' . ($i -1).'" />'; + echo '<input type="hidden" name="NumberOfOutputs" value="' . ($i -1).'" />'; } echo '</table>'; echo '<div class="centre"> <br /> - <input type=submit name="submit" value="' . _('Update') . '" /> + <input type="submit" name="submit" value="' . _('Update') . '" /> <br /> <br /> - <input type=submit name="delete" value="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" /> + <input type="submit" name="delete" value="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" /> <br /> </div>'; @@ -600,11 +599,11 @@ </select></td> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> -<td><input type="text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td> +<td><input type="text" name="Keywords" size="20" maxlength="25" value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>" /></td> </tr> <tr><td></td> - <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><b><?php echo _('OR'); ?> </b><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> + <td><input type="text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>" /></td> </tr> </table> <br /><div class="centre"><input type="submit" name="Search" value="<?php echo _('Search Now'); ?>" /> @@ -635,10 +634,10 @@ if (!in_array($myrow['stockid'],$ItemCodes)){ if (function_exists('imagecreatefrompng') ){ - $ImageSource = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + $ImageSource = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64" />'; } else { if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg')) { - $ImageSource = '<img src="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; + $ImageSource = '<img src="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" />'; } else { $ImageSource = _('No Image'); } @@ -652,9 +651,9 @@ $k=1; } - printf('<td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> + printf('<td><font size="1">%s</font></td> + <td><font size="1">%s</font></td> + <td><font size="1">%s</font></td> <td>%s</td> <td><font size=1><a href="%s">' . _('Add to Work Order') . '</a></font></td> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/doc/Change.log 2012-01-20 22:52:45 UTC (rev 4822) @@ -1,5 +1,6 @@ webERP Change Log +20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php 20/1/12 Tim: Merge tendering system from Tim's branch 20/1/12 Tim: Merge xhtml fixes from Tim's branch: Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php 20/1/12 Tim: Added previously received quantity to stock transfer notes PDFStockLocTransfer.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-20 22:52:52
|
Revision: 4822 http://web-erp.svn.sourceforge.net/web-erp/?rev=4822&view=rev Author: vvs2012 Date: 2012-01-20 22:52:45 +0000 (Fri, 20 Jan 2012) Log Message: ----------- xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php Modified Paths: -------------- trunk/CustomerBranches.php trunk/StockAdjustments.php trunk/WorkOrderEntry.php trunk/doc/Change.log Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Added: svn:ignore + reportwriter Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/CustomerBranches.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -360,8 +360,8 @@ $TotalEnable = 0; $TotalDisable = 0; if ($myrow) { - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="" />' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> + ' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; echo '<table class=selection>'; echo '<tr><th>'._('Code').'</th> @@ -526,11 +526,11 @@ $_POST['DeliverBlind'] = $myrow['deliverblind']; } - echo '<input type=hidden name="SelectedBranch" value="' . $SelectedBranch . '" />'; - echo '<input type=hidden name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; + echo '<input type="hidden" name="SelectedBranch" value="' . $SelectedBranch . '" />'; + echo '<input type="hidden" name="BranchCode" value="' . $_POST['BranchCode'] . '" />'; - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="">' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; + echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> + ' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { echo '<div class="centre"><a href=' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } @@ -576,11 +576,11 @@ if (!isset($_POST['BranchCode'])) { $_POST['BranchCode']=''; } - echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Add a Branch').'</p>'; + 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> + <td><input ' .(in_array('BranchCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="1" type="text" name="BranchCode" size="12" maxlength="10" value="' . $_POST['BranchCode'] . '" /></td> </tr>'; $_POST['DeliverBlind'] = $_SESSION['DefaultBlindPackNote']; } @@ -592,12 +592,12 @@ 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> + 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> + 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'])) { @@ -631,7 +631,7 @@ if (!isset($_POST['BrAddress5'])) { $_POST['BrAddress5']=''; } - echo '<td><input tabindex="8" type="text" name="BrAddress5" size="21" maxlength="20" value="'. $_POST['BrAddress5'].'"/></td> + echo '<td><input tabindex="8" type="text" name="BrAddress5" size="21" maxlength="20" value="'. $_POST['BrAddress5'].'" /></td> </tr> <tr> <td>'._('Street Address 6').':</td>'; @@ -652,14 +652,14 @@ 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> + 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> <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> + 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>'; @@ -805,7 +805,7 @@ </tr> <tr> <td>'._('Transactions on this branch') . ':</td> - <td><select tabindex=20 name="DisableTrans">'; + <td><select tabindex="20" name="DisableTrans">'; if ($_POST['DisableTrans']==0){ echo '<option selected value=0>' . _('Enabled') . '</option> <option value=1>' . _('Disabled') . '</option>'; @@ -828,7 +828,7 @@ } echo '<tr> <td>'._('Default freight/shipper method') . ':</td> - <td><select tabindex=21 name="DefaultShipVia">'; + <td><select tabindex="21" name="DefaultShipVia">'; while ($myrow=DB_fetch_array($ShipperResults)){ if (isset($_POST['DefaultShipVia'])and $myrow['shipper_id']==$_POST['DefaultShipVia']){ echo '<option selected value=' . $myrow['shipper_id'] . '>' . $myrow['shippername'] . '</option>'; Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/StockAdjustments.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -58,13 +58,11 @@ $_SESSION['Adjustment']->Quantity = filter_number_format($_POST['Quantity']); } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Inventory Adjustment') . '" alt="" />' . ' ' . _('Inventory Adjustment') . '</p>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory Adjustment') . '" alt="" />' . ' ' . _('Inventory Adjustment') . '</p>'; if (isset($_POST['CheckCode'])) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . - '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . _('Select Item to Adjust') . '</p>'; if (mb_strlen($_POST['StockText'])>0) { $sql="SELECT stockid, @@ -352,27 +350,27 @@ $DecimalPlaces = $myrow['decimalplaces']; } echo '<br /><table class=selection>'; -echo '<tr><th colspan=4><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; +echo '<tr><th colspan="4"><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; if (!isset($_GET['Description'])) { $_GET['Description']=''; } echo '<tr><td>'. _('Stock Code'). ':</td><td>'; if (isset($StockID)) { - echo '<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size="21" value="' . $StockID . '" maxlength="20" /></td></tr>'; } else { - echo '<input type="text" name="StockID" size=21 value="" maxlength=20></td></tr>'; + echo '<input type="text" name="StockID" size="21" value="" maxlength="20" /></td></tr>'; } echo '<tr> <td>'. _('Partial Description'). ':</td> <td><input type="text" name="StockText" size="21" value="' . $_GET['Description'] .'" /> '._('Partial Stock Code'). ':</td> <td>'; if (isset($StockID)) { - echo '<input type="text" name="StockCode" size=21 value="' . $StockID .'" maxlength="20" />'; + echo '<input type="text" name="StockCode" size="21" value="' . $StockID .'" maxlength="20" />'; } else { - echo '<input type="text" name="StockCode" size=21 value="" maxlength="20" />'; + echo '<input type="text" name="StockCode" size="21" value="" maxlength="20" />'; } echo '</td> - <td><input type="submit" name="CheckCode" value="'._('Check Part').'"></td> + <td><input type="submit" name="CheckCode" value="'._('Check Part').'" /></td> </tr>'; if (isset($_SESSION['Adjustment']) AND mb_strlen($_SESSION['Adjustment']->ItemDescription)>1){ echo '<tr> @@ -453,7 +451,7 @@ echo '</table> <div class="centre"> <br /> - <input type="submit" name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '"> + <input type="submit" name="EnterAdjustment" value="'. _('Enter Stock Adjustment'). '" /> <br />'; if (!isset($_POST['StockLocation'])) { Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/WorkOrderEntry.php 2012-01-20 22:52:45 UTC (rev 4822) @@ -8,8 +8,7 @@ include('includes/SQL_CommonFunctions.inc'); echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title.' + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' </p>'; if (isset($_GET['ReqDate'])){ @@ -533,7 +532,7 @@ echo '<td class="number"><input type="hidden" name="RecdQty' . $i . '" value="' . $_POST['RecdQty' .$i] . '" />' . $_POST['RecdQty' .$i] .'</td> <td class="number">' . locale_number_format(($_POST['OutputQty' . $i] - $_POST['RecdQty' .$i]),$_POST['DecimalPlaces' . $i]) . '</td>'; if ($_POST['Controlled'.$i]==1){ - echo '<td><input type="text" name="NextLotSNRef' .$i . '" value="' . $_POST['NextLotSNRef'.$i] . '"></td>'; + echo '<td><input type="text" name="NextLotSNRef' .$i . '" value="' . $_POST['NextLotSNRef'.$i] . '" /></td>'; if ($_SESSION['DefineControlledOnWOEntry']==1){ if ($_POST['Serialised' . $i]==1){ $LotOrSN = _('S/Ns'); @@ -557,16 +556,16 @@ echo '<input type="hidden" name="HasWOSerialNos' . $i .'" value="' . $_POST['HasWOSerialNos' . $i] . '" />'; } } - echo '<input type=hidden name="NumberOfOutputs" value="' . ($i -1).'" />'; + echo '<input type="hidden" name="NumberOfOutputs" value="' . ($i -1).'" />'; } echo '</table>'; echo '<div class="centre"> <br /> - <input type=submit name="submit" value="' . _('Update') . '" /> + <input type="submit" name="submit" value="' . _('Update') . '" /> <br /> <br /> - <input type=submit name="delete" value="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" /> + <input type="submit" name="delete" value="' . _('Delete This Work Order') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" /> <br /> </div>'; @@ -600,11 +599,11 @@ </select></td> <td><?php echo _('Enter text extracts in the'); ?> <b><?php echo _('description'); ?></b>:</td> -<td><input type="text" name="Keywords" size=20 maxlength=25 value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td> +<td><input type="text" name="Keywords" size="20" maxlength="25" value="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>" /></td> </tr> <tr><td></td> - <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><b><?php echo _('OR'); ?> </b><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> + <td><input type="text" name="StockCode" size="15" maxlength="18" value="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>" /></td> </tr> </table> <br /><div class="centre"><input type="submit" name="Search" value="<?php echo _('Search Now'); ?>" /> @@ -635,10 +634,10 @@ if (!in_array($myrow['stockid'],$ItemCodes)){ if (function_exists('imagecreatefrompng') ){ - $ImageSource = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64">'; + $ImageSource = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC&StockID=' . urlencode($myrow['stockid']). '&text=&width=64&height=64" />'; } else { if(file_exists($_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg')) { - $ImageSource = '<img src="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg">'; + $ImageSource = '<img src="' .$_SERVER['DOCUMENT_ROOT'] . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" />'; } else { $ImageSource = _('No Image'); } @@ -652,9 +651,9 @@ $k=1; } - printf('<td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> - <td><font size=1>%s</font></td> + printf('<td><font size="1">%s</font></td> + <td><font size="1">%s</font></td> + <td><font size="1">%s</font></td> <td>%s</td> <td><font size=1><a href="%s">' . _('Add to Work Order') . '</a></font></td> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-20 13:48:53 UTC (rev 4821) +++ trunk/doc/Change.log 2012-01-20 22:52:45 UTC (rev 4822) @@ -1,5 +1,6 @@ webERP Change Log +20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php 20/1/12 Tim: Merge tendering system from Tim's branch 20/1/12 Tim: Merge xhtml fixes from Tim's branch: Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php 20/1/12 Tim: Added previously received quantity to stock transfer notes PDFStockLocTransfer.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-20 22:56:05
|
Revision: 4823 http://web-erp.svn.sourceforge.net/web-erp/?rev=4823&view=rev Author: vvs2012 Date: 2012-01-20 22:55:59 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php Modified Paths: -------------- trunk/Z_ChangeStockCode.php trunk/doc/Change.log Modified: trunk/Z_ChangeStockCode.php =================================================================== --- trunk/Z_ChangeStockCode.php 2012-01-20 22:52:45 UTC (rev 4822) +++ trunk/Z_ChangeStockCode.php 2012-01-20 22:55:59 UTC (rev 4823) @@ -134,7 +134,7 @@ //check if MRP tables exist before assuming $result = DB_query("SELECT COUNT(*) FROM mrpplannedorders",$db,'','',false,false); - if ($DB_error_no($db)==0) { + if (DB_error_no($db)==0) { echo '<br />' . _('Changing MRP planned orders information'); $sql = "UPDATE mrpplannedorders SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'"; $ErrMsg = _('The SQL to update the mrpplannedorders records failed'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-20 22:52:45 UTC (rev 4822) +++ trunk/doc/Change.log 2012-01-20 22:55:59 UTC (rev 4823) @@ -1,5 +1,6 @@ webERP Change Log +20/1/12 Vitaly: Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php 20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php 20/1/12 Tim: Merge tendering system from Tim's branch 20/1/12 Tim: Merge xhtml fixes from Tim's branch: Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-20 22:56:05
|
Revision: 4823 http://web-erp.svn.sourceforge.net/web-erp/?rev=4823&view=rev Author: vvs2012 Date: 2012-01-20 22:55:59 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php Modified Paths: -------------- trunk/Z_ChangeStockCode.php trunk/doc/Change.log Modified: trunk/Z_ChangeStockCode.php =================================================================== --- trunk/Z_ChangeStockCode.php 2012-01-20 22:52:45 UTC (rev 4822) +++ trunk/Z_ChangeStockCode.php 2012-01-20 22:55:59 UTC (rev 4823) @@ -134,7 +134,7 @@ //check if MRP tables exist before assuming $result = DB_query("SELECT COUNT(*) FROM mrpplannedorders",$db,'','',false,false); - if ($DB_error_no($db)==0) { + if (DB_error_no($db)==0) { echo '<br />' . _('Changing MRP planned orders information'); $sql = "UPDATE mrpplannedorders SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'"; $ErrMsg = _('The SQL to update the mrpplannedorders records failed'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-20 22:52:45 UTC (rev 4822) +++ trunk/doc/Change.log 2012-01-20 22:55:59 UTC (rev 4823) @@ -1,5 +1,6 @@ webERP Change Log +20/1/12 Vitaly: Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php 20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php 20/1/12 Tim: Merge tendering system from Tim's branch 20/1/12 Tim: Merge xhtml fixes from Tim's branch: Labels.php TaxGroups.php GLCodesInquiry.php CustomerInquiry.php SalesByTypePeriodInquiry.php ContractBOM.php Shippers.php MRPPlannedWorkOrders.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-20 23:10:26
|
Revision: 4824 http://web-erp.svn.sourceforge.net/web-erp/?rev=4824&view=rev Author: daintree Date: 2012-01-20 23:10:18 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/SupplierTenderCreate.php trunk/SupplierTenders.php trunk/UpgradeDatabase.php trunk/api/api_stock.php trunk/api/api_xml-rpc.php trunk/includes/DefineOfferClass.php trunk/includes/DefineTenderClass.php trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/SupplierTenderCreate.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,5 +1,5 @@ <?php -/* $Id$*/ +/* $Id: SupplierTenderCreate.php 4821 2012-01-20 13:48:53Z tim_schofield $ */ include('includes/DefineTenderClass.php'); include('includes/SQL_CommonFunctions.inc'); @@ -7,11 +7,11 @@ $Maximum_Number_Of_Parts_To_Show=50; -if (isset($_GET['New']) and isset($_SESSION['tender'])) { +if (isset($_GET['New']) AND isset($_SESSION['tender'])) { unset($_SESSION['tender']); } -if (isset($_GET['New']) and $_SESSION['CanCreateTender']==0) { +if (isset($_GET['New']) AND $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -21,7 +21,7 @@ exit; } -if (isset($_GET['Edit']) and $_SESSION['CanCreateTender']==0) { +if (isset($_GET['Edit']) AND $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -188,7 +188,7 @@ $ShowTender = 1; } -if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { +if (isset($_POST['NewItem']) AND !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -315,7 +315,7 @@ $LocnResult = DB_query($sql,$db); while ($LocnRow=DB_fetch_array($LocnResult)){ - if ((isset($_SESSION['tender']->Location) and $_SESSION['tender']->Location == $LocnRow['loccode'])){ + if ((isset($_SESSION['tender']->Location) AND $_SESSION['tender']->Location == $LocnRow['loccode'])){ echo '<option selected="True" value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } else { echo '<option value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; @@ -402,7 +402,7 @@ echo '<div class="centre"><input type="submit" name="Suppliers" value="' . _('Select Suppliers') . '" />'; echo '<input type="submit" name="Items" value="' . _('Select Item Details') . '" /></div><br />'; - if ($_SESSION['tender']->LinesOnTender > 0 and $_SESSION['tender']->SuppliersOnTender > 0) { + if ($_SESSION['tender']->LinesOnTender > 0 AND $_SESSION['tender']->SuppliersOnTender > 0) { echo '<div class="centre"><input type="submit" name="Save" value="' . _('Save Tender') . '" /></div>'; } echo '</form>'; @@ -527,18 +527,20 @@ echo '<br />'; } echo '<input type="hidden" name="Search" value="' . _('Search Now') . '" />'; - echo '<br /><br />'; - echo '<br /><table cellpadding="2" colspan="7">'; - $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Supplier Name') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Address 1') . '</th> - <th>' . _('Address 2') . '</th> - <th>' . _('Address 3') . '</th> - <th>' . _('Address 4') . '</th> - </tr>'; - echo $tableheader; + echo '<br /> + <br /> + <br /> + <table cellpadding="2" colspan="7">'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Address 1') . '</th> + <th>' . _('Address 2') . '</th> + <th>' . _('Address 3') . '</th> + <th>' . _('Address 4') . '</th> + </tr>'; + echo $TableHeader; $j = 1; $k = 0; //row counter to determine background colour $RowIndex = 0; @@ -575,9 +577,9 @@ 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 Inventory Items') . '</p>'; $sql = "SELECT categoryid, - categorydescription - FROM stockcategory - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0) { echo '<br /><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . @@ -585,11 +587,11 @@ echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; exit; } - echo '<table class="selection"><tr>'; - echo '<td>' . _('In Stock Category') . ':'; - echo '<select name="StockCat">'; + echo '<table class="selection"> + <tr> + <td>' . _('In Stock Category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])) { - $_POST['StockCat'] = ""; + $_POST['StockCat'] = ''; } if ($_POST['StockCat'] == 'All') { echo '<option selected="True" value="All">' . _('All') . '</option>'; @@ -603,25 +605,34 @@ echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } } - echo '</select>'; - echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td><td>'; + echo '</select></td> + <td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</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></tr><tr><td></td>'; - echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; - echo '<td>'; + echo '</td> + </tr> + <tr> + <td></td> + <td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td> + <td>'; if (isset($_POST['StockCode'])) { echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } - echo '</td></tr></table><br />'; - echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '</td></tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Search" value="' . _('Search Now') . '" /> + </div> + <br /> + </form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; - echo '</form>'; } if (isset($_POST['Search'])){ /*ie seach for stock items */ @@ -638,29 +649,29 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } elseif ($_POST['StockCode']){ @@ -669,55 +680,55 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -725,7 +736,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 and $debug==1){ + if (DB_num_rows($SearchResult)==0 AND $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -739,14 +750,14 @@ echo '<table cellpadding="1" colspan="7">'; - $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('Image') . '</th> - <th>' . _('Quantity') . '</th> - </tr>'; - echo $tableheader; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; + echo $TableHeader; $i = 0; $k = 0; //row colour counter @@ -761,8 +772,8 @@ $k=1; } - $filename = $myrow['stockid'] . '.jpg'; - if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + $FileName = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; @@ -770,14 +781,13 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - $uom=$myrow['units']; echo '<td>'.$myrow['stockid'].'</td> <td>'.$myrow['description'].'</td> - <td>'.$uom.'</td> + <td>'.$myrow['units'].'</td> <td>'.$ImageSource.'</td> <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> - <input type="hidden" value="'.$uom.'" name="UOM'.$i.'" /> + <input type="hidden" value="'.$myrow['units'].'" name="UOM'.$i.'" /> <input type="hidden" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> </tr>'; @@ -797,7 +807,11 @@ prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Tender" /></div>'; + echo '<a name="end"></a> + <br /> + <div class="centre"> + <input type="submit" name="NewItem" value="' . _('Add to Tender') . '" /> + </div>'; }#end if SearchResults to show echo '</form>'; Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/SupplierTenders.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -64,15 +64,14 @@ $ItemCode=$value; $Quantity=$_POST['Qty'.$Index]; $Price=$_POST['Price'.$Index]; - $_SESSION['offer']->add_to_offer( - $LineNo, - $ItemCode, - $Quantity, - $_POST['ItemDescription'.$Index], - $Price, - $_POST['UOM'.$Index], - $_POST['DecimalPlaces'.$Index], - $_POST['RequiredByDate'.$Index]); + $_SESSION['offer']->add_to_offer($LineNo, + $ItemCode, + $Quantity, + $_POST['ItemDescription'.$Index], + $Price, + $_POST['UOM'.$Index], + $_POST['DecimalPlaces'.$Index], + $_POST['RequiredByDate'.$Index]); $LineNo++; } } @@ -91,16 +90,18 @@ address6, telephone FROM tenders - LEFT JOIN locations + INNER JOIN locations ON tenders.location=locations.loccode WHERE closed=0 AND tenderid='".$_SESSION['offer']->TenderID."'"; $LocationResult=DB_query($LocationSQL, $db); $MyLocationRow=DB_fetch_row($LocationResult); - $CurrencySQL="SELECT decimalplaces from currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; + $CurrencySQL="SELECT decimalplaces FROM currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; $CurrencyResult=DB_query($CurrencySQL, $db); $CurrencyRow=DB_fetch_array($CurrencyResult); - echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + echo '<tr> + <td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td> + <td valign="top" style="background-color:#cccce5">'; for ($i=1; $i<8; $i++) { if ($MyLocationRow[$i]!='') { echo $MyLocationRow[$i] . '<br />'; @@ -109,28 +110,38 @@ echo '</td>'; echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$_SESSION['offer']->TenderID . '</font></th>'; echo '<input type="hidden" value="' . $_SESSION['offer']->TenderID . '" name="Tender" />'; - echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Item Description') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Currency') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; - echo '<th>' . _('Line Value') . '</th>'; - echo '<th>' . _('Delivery By') . '</th>'; + echo '<tr> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '<br />' . _('Offered') . '</th> + <th>' . $Supplier . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Currency') . '</th> + <th>' . $Supplier . '<br />' . _('Price') . '</th> + <th>' . _('Line Value') . '</th> + <th>' . _('Delivery By') . '</th> + </tr>'; + foreach ($_SESSION['offer']->LineItems as $LineItem) { - echo '<tr><td>' . $LineItem->StockID . '</td>'; - echo '<td>' . $LineItem->ItemDescription . '</td>'; - echo '<td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td>'; - echo '<td>' . $LineItem->Units . '</td>'; - echo '<td>' . $_SESSION['offer']->CurrCode . '</td>'; - echo '<td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td>'; - echo '<td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td>'; - echo '<td>' . $LineItem->ExpiryDate . '</td>'; + echo '<tr> + <td>' . $LineItem->StockID . '</td> + <td>' . $LineItem->ItemDescription . '</td> + <td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td> + <td>' . $LineItem->Units . '</td> + <td>' . $_SESSION['offer']->CurrCode . '</td> + <td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td> + <td>' . $LineItem->ExpiryDate . '</td> + </tr>'; } - echo '</table><br />'; - echo '<div class="centre"><input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /><br />'; - echo '<br /><input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /></div>'; - echo '</form>'; + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /> + <br /> + <br /> + <input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /> + </div> + </form>'; include('includes/footer.inc'); exit; } @@ -138,7 +149,7 @@ /* If the supplierID is set then it must be a login from the supplier but if nothing else is * set then the supplier must have just logged in so show them the choices. */ -if (isset($_POST['SupplierID']) and empty($_POST['TenderType']) and empty($_POST['Search']) and empty($_POST['NewItem']) and empty($_GET['Delete'])) { +if (isset($_POST['SupplierID']) AND empty($_POST['TenderType']) AND empty($_POST['Search']) AND empty($_POST['NewItem']) AND empty($_GET['Delete'])) { if (isset($_SESSION['offer'])) { unset($_SESSION['offer']); } @@ -146,18 +157,27 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; echo '<table class="selection">'; - echo'<tr><td>'._('Select option for tendering').'</td>'; - echo '<td><select name="TenderType">'; - echo '<option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; - echo '<option value="2">'._('Create a new offer from').' '.$Supplier .'</option>'; - echo '<option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; - echo '</select></td></tr>'; + echo'<tr> + <td>'._('Select option for tendering').'</td> + <td><select name="TenderType"> + <option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option> + <option value="2">'._('Create a new offer from').' '.$Supplier .'</option> + <option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option> + </select></td> + </tr>'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; - echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '" /></div></td></tr>'; - echo '</table></form>'; + echo '<tr> + <td colspan="2"> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Select') . '" /> + </div> + </td> + </tr> + </table> + </form>'; } -if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { +if (isset($_POST['NewItem']) AND !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -165,7 +185,7 @@ $Quantity=filter_number_format($_POST['Qty'.$Index]); $Price=filter_number_format($_POST['Price'.$Index]); $UOM=$_POST['uom'.$Index]; - if (isset($UOM) and $Quantity>0) { + if (isset($UOM) AND $Quantity>0) { $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); @@ -183,7 +203,7 @@ } } -if (isset($_POST['Refresh']) and !isset($_POST['NewItem'])) { +if (isset($_POST['Refresh']) AND !isset($_POST['NewItem'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -193,11 +213,10 @@ $ExpiryDate=$_POST['expirydate'.$Index]; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $Index, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($Index, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -216,11 +235,10 @@ $ExpiryDate=$value; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $LineNo, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($LineNo, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -244,11 +262,10 @@ $ExpiryDate=$value; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $LineNo, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($LineNo, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -261,7 +278,7 @@ /*The supplier has chosen option 1 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==1 and !isset($_POST['Refresh'])) { +if (isset($_POST['TenderType']) AND $_POST['TenderType']==1 AND !isset($_POST['Refresh'])) { $sql="SELECT offers.offerid, offers.stockid, stockmaster.description, @@ -278,24 +295,23 @@ $_SESSION['offer']=new Offer($_POST['SupplierID']); $_SESSION['offer']->CurrCode=$Currency; while ($myrow=DB_fetch_array($result)) { - $_SESSION['offer']->add_to_offer( - $myrow['offerid'], - $myrow['stockid'], - $myrow['quantity'], - $myrow['description'], - $myrow['price'], - $myrow['uom'], - $myrow['decimalplaces'], - ConvertSQLDate($myrow['expirydate'])); + $_SESSION['offer']->add_to_offer($myrow['offerid'], + $myrow['stockid'], + $myrow['quantity'], + $myrow['description'], + $myrow['price'], + $myrow['uom'], + $myrow['decimalplaces'], + ConvertSQLDate($myrow['expirydate'])); } } -if (isset($_POST['TenderType']) and $_POST['TenderType']!=3 and isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { +if (isset($_POST['TenderType']) AND $_POST['TenderType']!=3 AND isset($_SESSION['offer']) AND $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; - echo '<table>'; - echo '<tr> + echo '<table> + <tr> <th>'._('Stock ID').'</th> <th>'._('Description').'</th> <th>'._('Quantity').'</th> @@ -307,43 +323,53 @@ $k=0; foreach ($_SESSION['offer']->LineItems as $LineItems) { if ($LineItems->Deleted==False) { - if ($k==1){ + if ($LineItems->ExpiryDate < date('Y-m-d')) { + echo '<tr bgcolor="#F7A9A9">'; + } elseif ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; } else { echo '<tr class="OddTableRows">'; $k=1; } - if ($LineItems->ExpiryDate < date('Y-m-d')) { - echo '<tr bgcolor="#F7A9A9">'; - } + echo '<input type="hidden" name="StockID'.$LineItems->LineNo.'" value="'.$LineItems->StockID.'" />'; - echo '<td>'.$LineItems->StockID.'</td>'; - echo '<td>'.$LineItems->ItemDescription.'</td>'; - echo '<td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td>'; - echo '<td>'.$LineItems->Units.'</td>'; - echo '<td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td>'; - echo '<td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; - echo '<td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td></tr>'; - echo '</tr>'; + echo '<td>'.$LineItems->StockID.'</td> + <td>'.$LineItems->ItemDescription.'</td> + <td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td> + <td>'.$LineItems->Units.'</td> + <td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td> + <td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td> + <td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td> + </tr>'; } } echo '</table>'; echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; if ($_POST['TenderType']==1) { - echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer" />'; - echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Update" value="Update offer" /> + <input type="submit" name="Refresh" value="Refresh screen" /> + </div>'; } else if ($_POST['TenderType']==2) { - echo '<br /><div class="centre"><input type="submit" name="Save" value="Save offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Save" value="Save offer"> + <input type="submit" name="Refresh" value="Refresh screen" /> + </div>'; } echo '</form>'; } /*The supplier has chosen option 2 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==2 and !isset($_POST['Search']) or isset($_GET['Delete'])) { +if (isset($_POST['TenderType']) + AND $_POST['TenderType']==2 + AND !isset($_POST['Search']) + OR isset($_GET['Delete'])) { + if (!isset($_SESSION['offer'])) { $_SESSION['offer']=new Offer($_POST['SupplierID']); } @@ -352,9 +378,9 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; $sql = "SELECT categoryid, - categorydescription - FROM stockcategory - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0) { @@ -390,23 +416,37 @@ } echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; - echo '</td></tr><tr><td></td>'; - echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; - echo '<td>'; + echo '</td> + </tr> + <tr> + <td></td> + <td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td> + <td>'; if (isset($_POST['StockCode'])) { echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } - echo '</td></tr></table><br />'; - echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '</td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Search" value="' . _('Search Now') . '" /> + </div> + <br /> + </form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; echo '</form>'; } /*The supplier has chosen option 3 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==3 and !isset($_POST['Search']) or isset($_GET['Delete'])) { +if (isset($_POST['TenderType']) + AND $_POST['TenderType']==3 + AND !isset($_POST['Search']) + OR isset($_GET['Delete'])) { + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Tenders Waiting For Offers').'</p>'; $sql="SELECT DISTINCT tendersuppliers.tenderid, suppliers.currcode @@ -421,7 +461,9 @@ ORDER BY tendersuppliers.tenderid"; $result=DB_query($sql, $db); echo '<table class="selection">'; - echo '<tr><th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th></tr>'; + echo '<tr> + <th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th> + </tr>'; while ($myrow=DB_fetch_row($result)) { echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -436,13 +478,15 @@ address6, telephone FROM tenders - LEFT JOIN locations + INNER JOIN locations ON tenders.location=locations.loccode WHERE closed=0 AND tenderid='".$myrow[0]."'"; $LocationResult=DB_query($LocationSQL, $db); $MyLocationRow=DB_fetch_row($LocationResult); - echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + echo '<tr> + <td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td> + <td valign="top" style="background-color:#cccce5">'; for ($i=1; $i<8; $i++) { if ($MyLocationRow[$i]!='') { echo $MyLocationRow[$i] . '<br />'; @@ -451,7 +495,8 @@ echo '</td>'; echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$myrow[0] . '</font></th>'; echo '<input type="hidden" value="' . $myrow[0] . '" name="Tender" />'; - echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th></tr>'; + echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th> + </tr>'; $ItemSQL="SELECT tenderitems.tenderid, tenderitems.stockid, stockmaster.description, @@ -471,37 +516,42 @@ ON tenders.tenderid=tenderitems.tenderid WHERE tenderitems.tenderid='" . $myrow[0] . "'"; $ItemResult=DB_query($ItemSQL, $db); - echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Item Description') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Required') . '</th>'; - echo '<th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Required By') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Currency') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; - echo '<th>' . _('Delivery By') . '</th>'; + echo '<tr> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . $Supplier . '<br />' . _('Item Code') . '</th> + <th>' . _('Quantity') . '<br />' . _('Required') . '</th> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Required By') . '</th> + <th>' . _('Quantity') . '<br />' . _('Offered') . '</th> + <th>' . $Supplier . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Currency') . '</th> + <th>' . $Supplier . '<br />' . _('Price') . '</th> + <th>' . _('Delivery By') . '</th> + </tr>'; $i=0; while ($MyItemRow=DB_fetch_array($ItemResult)) { - echo '<tr><td>' . $MyItemRow['stockid'] . '</td>'; - echo '<td>' . $MyItemRow['description'] . '</td>'; - echo '<input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" />'; - echo '<input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" />'; - echo '<td>' . $MyItemRow['suppliers_partno'] . '</td>'; - echo '<td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td>'; - echo '<td>' . $MyItemRow['units'] . '</td>'; - echo '<td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + echo '<tr> + <td>' . $MyItemRow['stockid'] . '</td> + <td>' . $MyItemRow['description'] . '</td> + <input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" /> + <input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" /> + <td>' . $MyItemRow['suppliers_partno'] . '</td> + <td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td> + <td>' . $MyItemRow['units'] . '</td> + <td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + if ($MyItemRow['suppliersuom']=='') { $MyItemRow['suppliersuom']=$MyItemRow['units']; } - echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td>'; - echo '<input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" />'; - echo '<input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" />'; - echo '<td>' . $MyItemRow['suppliersuom'] . '</td>'; - echo '<td>' . $myrow[1] . '</td>'; - echo '<td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td>'; - echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td>'; + echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td> + <input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" /> + <input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" /> + <td>' . $MyItemRow['suppliersuom'] . '</td> + <td>' . $myrow[1] . '</td> + <td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td> + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td> + </tr>'; } echo '</form>'; } @@ -513,7 +563,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; - if ($_POST['Keywords'] and $_POST['StockCode']) { + 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']) { @@ -522,29 +572,29 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } elseif ($_POST['StockCode']){ @@ -553,55 +603,55 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -609,7 +659,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 and $debug==1){ + if (DB_num_rows($SearchResult)==0 AND $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -623,7 +673,7 @@ echo '<table cellpadding="1" colspan="7">'; - $tableheader = '<tr> + $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> @@ -631,7 +681,7 @@ <th>' . _('Quantity') . '</th> <th>' . _('Price') .' ('.$Currency.')</th> </tr>'; - echo $tableheader; + echo $TableHeader; $i = 0; $k = 0; //row colour counter @@ -646,8 +696,8 @@ $k=1; } - $filename = $myrow['stockid'] . '.jpg'; - if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + $FileName = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; @@ -655,7 +705,7 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - $uomsql="SELECT conversionfactor, + $UOMsql="SELECT conversionfactor, suppliersuom, unitsofmeasure.unitname FROM purchdata @@ -664,25 +714,25 @@ WHERE supplierno='".$_POST['SupplierID']."' AND stockid='" . $myrow['stockid'] . "'"; - $uomresult=DB_query($uomsql, $db); - if (DB_num_rows($uomresult)>0) { - $uomrow=DB_fetch_array($uomresult); - if (mb_strlen($uomrow['suppliersuom'])>0) { - $uom=$uomrow['unitname']; + $UOMresult=DB_query($UOMsql, $db); + if (DB_num_rows($UOMresult)>0) { + $UOMrow=DB_fetch_array($UOMresult); + if (mb_strlen($UOMrow['suppliersuom'])>0) { + $UOM=$UOMrow['unitname']; } else { - $uom=$myrow['units']; + $UOM=$myrow['units']; } } else { - $uom=$myrow['units']; + $UOM=$myrow['units']; } echo '<td>'.$myrow['stockid'].'</td> <td>'.$myrow['description'].'</td> - <td>'.$uom.'</td> + <td>'.$UOM.'</td> <td>'.$ImageSource.'</td> <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> <td><input class="number" type="text" size="12" value="0" name="Price'.$i.'" /></td> <input type="hidden" size="12" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> - <input type="hidden" value="'.$uom.'" name="uom'.$i.'" /> + <input type="hidden" value="'.$UOM.'" name="uom'.$i.'" /> </tr>'; $i++; $PartsDisplayed++; @@ -696,11 +746,14 @@ if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ /*$Maximum_Number_Of_Parts_To_Show defined in config.php */ - prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Offer" /></div>'; + echo '<a name="end"></a> + <br /> + <div class="centre"> + <input type="submit" name="NewItem" value="Add to Offer" /> + </div>'; }#end if SearchResults to show echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/UpgradeDatabase.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -132,8 +132,8 @@ case '4.06.5': $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06.6': - $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; - case '4.06.7': + $SQLScripts[] = './sql/mysql/upgrade4.06-4.07.sql'; + case '4.07.0': break; } //end switch } Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/api/api_stock.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,5 +1,5 @@ <?php - + /* Check that the stock code*/ function VerifyStockCode($StockCode, $i, $Errors, $db) { $Searchsql = "SELECT count(stockid) @@ -734,8 +734,8 @@ WHERE stockid='" .$StockID. "' AND typeabbrev='" .$SalesType. "' AND currabrev='".$Currency. "' - AND startdate>='". Date('Y-m-d') . "' - (AND enddate<='" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; + AND startdate<='". Date('Y-m-d') . "' + AND (enddate>'" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; $result = DB_Query($sql, $db); $myrow = DB_fetch_row($result); if ($myrow[0]==0) { @@ -746,8 +746,8 @@ WHERE stockid='" .$StockID. "' AND typeabbrev='" .$SalesType. "' AND currabrev='".$Currency. "' - AND startdate>='". Date('Y-m-d') . "' - (AND enddate<='" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; + AND startdate<='". Date('Y-m-d') . "' + AND (enddate>'" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; } $result = DB_Query($sql, $db); $myrow = DB_fetch_row($result); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/api/api_xml-rpc.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1048,7 +1048,7 @@ /*x*/ $xmlrpcmsg->getParam( 2 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 3 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 4 )->scalarval( ))) ); -/*x*/ } else { +/*x*/ } else { //only 3 parameters if login already in session $rtn = new xmlrpcresp( php_xmlrpc_encode(GetStockPrice($xmlrpcmsg->getParam( 0 )->scalarval( ), $xmlrpcmsg->getParam( 1 )->scalarval( ), /*e*/ $xmlrpcmsg->getParam( 2 )->scalarval( ), '', ''))); Modified: trunk/includes/DefineOfferClass.php =================================================================== --- trunk/includes/DefineOfferClass.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/includes/DefineOfferClass.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -30,32 +30,31 @@ FROM suppliers WHERE supplierid='" . $this->SupplierID . "'"; $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - $this->SupplierName = $myrow[0]; - $this->EmailAddress = $myrow[1]; - $this->CurrCode = $myrow[2]; + $myrow=DB_fetch_array($result); + $this->SupplierName = $myrow['suppname']; + $this->EmailAddress = $myrow['email']; + $this->CurrCode = $myrow['currcode']; } - function add_to_offer( - $LineNo, - $StockID, - $Qty, - $ItemDescr, - $Price, - $UOM, - $DecimalPlaces, - $ExpiryDate){ + function add_to_offer( $LineNo, + $StockID, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate){ if (isset($Qty) and $Qty!=0){ $this->LineItems[$LineNo] = new LineDetails($LineNo, - $StockID, - $Qty, - $ItemDescr, - $Price, - $UOM, - $DecimalPlaces, - $ExpiryDate); + $StockID, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate); $this->LinesOnOffer++; Return 1; } @@ -74,25 +73,22 @@ if ($Update=='') { foreach ($this->LineItems as $LineItems) { if ($LineItems->Deleted==False) { - $sql="INSERT INTO offers ( - supplierid, - tenderid, - stockid, - quantity, - uom, - price, - expirydate, - currcode) - VALUES ( - '".$this->SupplierID."', - '".$this->TenderID."', - '".$LineItems->StockID."', - '".$LineItems->Quantity."', - '".$LineItems->Units."', - '".$LineItems->Price."', - '".FormatDateForSQL($LineItems->ExpiryDate)."', - '".$this->CurrCode."' - )"; + $sql="INSERT INTO offers ( supplierid, + tenderid, + stockid, + quantity, + uom, + price, + expirydate, + currcode) + VALUES ('".$this->SupplierID."', + '".$this->TenderID."', + '".$LineItems->StockID."', + '".$LineItems->Quantity."', + '".$LineItems->Units."', + '".$LineItems->Price."', + '".FormatDateForSQL($LineItems->ExpiryDate)."', + '".$this->CurrCode."')"; $ErrMsg = _('The suppliers offer could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -109,11 +105,10 @@ } } else { foreach ($_SESSION['offer']->LineItems as $LineItems) { - $sql="UPDATE offers SET - quantity='".$LineItems->Quantity."', - price='".$LineItems->Price."', - expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' - WHERE offerid='".$LineItems->LineNo . "'"; + $sql="UPDATE offers SET quantity='".$LineItems->Quantity."', + price='".$LineItems->Price."', + expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' + WHERE offerid='".$LineItems->LineNo . "'"; $ErrMsg = _('The suppliers offer could not be updated on the database because'); $DbgMsg = _('The SQL statement used to update the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -140,9 +135,9 @@ } function update_offer_item($LineNo, - $Qty, - $Price, - $ExpiryDate){ + $Qty, + $Price, + $ExpiryDate){ $this->LineItems[$LineNo]->Quantity = $Qty; $this->LineItems[$LineNo]->Price = $Price; @@ -175,23 +170,21 @@ var $Deleted; var $ExpiryDate; - function LineDetails ( - $LineNo, - $StockItem, - $Qty, - $ItemDescr, - $Prc, - $UOM, - $DecimalPlaces, - $ExpiryDate) - { + function LineDetails ($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate) { /* Constructor function to add a new LineDetail object with passed params */ $this->LineNo = $LineNo; $this->StockID =$StockItem; $this->ItemDescription = $ItemDescr; $this->Quantity = $Qty; - $this->Price = $Prc; + $this->Price = $Price; $this->Units = $UOM; $this->DecimalPlaces = $DecimalPlaces; $this->ExpiryDate = $ExpiryDate; Modified: trunk/includes/DefineTenderClass.php =================================================================== --- trunk/includes/DefineTenderClass.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/includes/DefineTenderClass.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,9 +1,8 @@ <?php -/* $Id$ */ +/* $Id: DefineTenderClass.php 4821 2012-01-20 13:48:53Z tim_schofield $ */ /* Definition of the tender class to hold all the information for a supplier tender */ - Class Tender { var $TenderId; @@ -58,62 +57,55 @@ */ if ($this->TenderId=='') { $this->TenderId = GetNextTransNo(37, $db); - $HeaderSQL="INSERT INTO tenders ( - tenderid, - location, - address1, - address2, - address3, - address4, - address5, - address6, - telephone, - requiredbydate) - VALUES ( - '" . $this->TenderId . "', - '" . $this->Location . "', - '" . $this->DelAdd1 . "', - '" . $this->DelAdd2 . "', - '" . $this->DelAdd3 . "', - '" . $this->DelAdd4 . "', - '" . $this->DelAdd5 . "', - '" . $this->DelAdd6 . "', - '" . $this->Telephone . "', - '" . FormatDateForSQL($this->RequiredByDate) . "')"; + $HeaderSQL="INSERT INTO tenders (tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone, + requiredbydate) + VALUES ('" . $this->TenderId . "', + '" . $this->Location . "', + '" . $this->DelAdd1 . "', + '" . $this->DelAdd2 . "', + '" . $this->DelAdd3 . "', + '" . $this->DelAdd4 . "', + '" . $this->DelAdd5 . "', + '" . $this->DelAdd6 . "', + '" . $this->Telephone . "', + '" . FormatDateForSQL($this->RequiredByDate) . "')"; foreach ($this->Suppliers as $Supplier) { - $SuppliersSQL[]="INSERT INTO tendersuppliers ( - tenderid, - supplierid, - email) - VALUES ( - '" . $this->TenderId . "', - '" . $Supplier->SupplierCode . "', - '" . $Supplier->EmailAddress . "')"; + $SuppliersSQL[]="INSERT INTO tendersuppliers (tenderid, + supplierid, + email) + VALUES ('" . $this->TenderId . "', + '" . $Supplier->SupplierCode . "', + '" . $Supplier->EmailAddress . "')"; } foreach ($this->LineItems as $LineItem) { - $ItemsSQL[]="INSERT INTO tenderitems ( - tenderid, - stockid, - quantity, - units) - VALUES ( - '" . $this->TenderId . "', - '" . $LineItem->StockID . "', - '" . $LineItem->Quantity . "', - '" . $LineItem->Units . "')"; + $ItemsSQL[]="INSERT INTO tenderitems (tenderid, + stockid, + quantity, + units) + VALUES ('" . $this->TenderId . "', + '" . $LineItem->StockID . "', + '" . $LineItem->Quantity . "', + '" . $LineItem->Units . "')"; } } else { - $HeaderSQL="UPDATE tenders - SET location='" . $this->Location . "', - address1='" . $this->DelAdd1 . "', - address2='" . $this->DelAdd2 . "', - address3='" . $this->DelAdd3 . "', - address4='" . $this->DelAdd4 . "', - address5='" . $this->DelAdd5 . "', - address6='" . $this->DelAdd6 . "', - telephone='" . $this->Telephone . "', - requiredbydate='" . FormatDateForSQL($this->RequiredByDate) . "' - WHERE tenderid = '" . $this->TenderId . "'"; + $HeaderSQL="UPDATE tenders SET location='" . $this->Location . "', + address1='" . $this->DelAdd1 . "', + address2='" . $this->DelAdd2 . "', + address3='" . $this->DelAdd3 . "', + address4='" . $this->DelAdd4 . "', + address5='" . $this->DelAdd5 . "', + address6='" . $this->DelAdd6 . "', + telephone='" . $this->Telephone . "', + requiredbydate='" . FormatDateForSQL($this->RequiredByDate) . "' + WHERE tenderid = '" . $this->TenderId . "'"; foreach ($this->Suppliers as $Supplier) { $sql="DELETE FROM tendersuppliers WHERE tenderid='" . $this->TenderId . "'"; @@ -122,25 +114,22 @@ tenderid, supplierid, email) - VALUES ( - '" . $this->TenderId . "', - '" . $Supplier->SupplierCode . "', - '" . $Supplier->EmailAddress . "')"; + VALUES ('" . $this->TenderId . "', + '" . $Supplier->SupplierCode . "', + '" . $Supplier->EmailAddress . "')"; } foreach ($this->LineItems as $LineItem) { $sql="DELETE FROM tenderitems - WHERE tenderid='" . $this->TenderId . "'"; + WHERE tenderid='" . $this->TenderId . "'"; $result=DB_query($sql, $db); - $ItemsSQL[]="INSERT INTO tenderitems ( - tenderid, - stockid, - quantity, - units) - VALUES ( - '" . $this->TenderId . "', - '" . $LineItem->StockID . "', - '" . $LineItem->Quantity . "', - '" . $LineItem->Units . "')"; + $ItemsSQL[]="INSERT INTO tenderitems (tenderid, + stockid, + quantity, + units) + ... [truncated message content] |
From: <dai...@us...> - 2012-01-20 23:10:26
|
Revision: 4824 http://web-erp.svn.sourceforge.net/web-erp/?rev=4824&view=rev Author: daintree Date: 2012-01-20 23:10:18 +0000 (Fri, 20 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/SupplierTenderCreate.php trunk/SupplierTenders.php trunk/UpgradeDatabase.php trunk/api/api_stock.php trunk/api/api_xml-rpc.php trunk/includes/DefineOfferClass.php trunk/includes/DefineTenderClass.php trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/SupplierTenderCreate.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,5 +1,5 @@ <?php -/* $Id$*/ +/* $Id: SupplierTenderCreate.php 4821 2012-01-20 13:48:53Z tim_schofield $ */ include('includes/DefineTenderClass.php'); include('includes/SQL_CommonFunctions.inc'); @@ -7,11 +7,11 @@ $Maximum_Number_Of_Parts_To_Show=50; -if (isset($_GET['New']) and isset($_SESSION['tender'])) { +if (isset($_GET['New']) AND isset($_SESSION['tender'])) { unset($_SESSION['tender']); } -if (isset($_GET['New']) and $_SESSION['CanCreateTender']==0) { +if (isset($_GET['New']) AND $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -21,7 +21,7 @@ exit; } -if (isset($_GET['Edit']) and $_SESSION['CanCreateTender']==0) { +if (isset($_GET['Edit']) AND $_SESSION['CanCreateTender']==0) { $title = _('Authorisation Problem'); include('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . $title . '" alt="" /> '.$title . '</p>'; @@ -188,7 +188,7 @@ $ShowTender = 1; } -if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { +if (isset($_POST['NewItem']) AND !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -315,7 +315,7 @@ $LocnResult = DB_query($sql,$db); while ($LocnRow=DB_fetch_array($LocnResult)){ - if ((isset($_SESSION['tender']->Location) and $_SESSION['tender']->Location == $LocnRow['loccode'])){ + if ((isset($_SESSION['tender']->Location) AND $_SESSION['tender']->Location == $LocnRow['loccode'])){ echo '<option selected="True" value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; } else { echo '<option value="' . $LocnRow['loccode'] . '">' . $LocnRow['locationname'] . '</option>'; @@ -402,7 +402,7 @@ echo '<div class="centre"><input type="submit" name="Suppliers" value="' . _('Select Suppliers') . '" />'; echo '<input type="submit" name="Items" value="' . _('Select Item Details') . '" /></div><br />'; - if ($_SESSION['tender']->LinesOnTender > 0 and $_SESSION['tender']->SuppliersOnTender > 0) { + if ($_SESSION['tender']->LinesOnTender > 0 AND $_SESSION['tender']->SuppliersOnTender > 0) { echo '<div class="centre"><input type="submit" name="Save" value="' . _('Save Tender') . '" /></div>'; } echo '</form>'; @@ -527,18 +527,20 @@ echo '<br />'; } echo '<input type="hidden" name="Search" value="' . _('Search Now') . '" />'; - echo '<br /><br />'; - echo '<br /><table cellpadding="2" colspan="7">'; - $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Supplier Name') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Address 1') . '</th> - <th>' . _('Address 2') . '</th> - <th>' . _('Address 3') . '</th> - <th>' . _('Address 4') . '</th> - </tr>'; - echo $tableheader; + echo '<br /> + <br /> + <br /> + <table cellpadding="2" colspan="7">'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Address 1') . '</th> + <th>' . _('Address 2') . '</th> + <th>' . _('Address 3') . '</th> + <th>' . _('Address 4') . '</th> + </tr>'; + echo $TableHeader; $j = 1; $k = 0; //row counter to determine background colour $RowIndex = 0; @@ -575,9 +577,9 @@ 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 Inventory Items') . '</p>'; $sql = "SELECT categoryid, - categorydescription - FROM stockcategory - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0) { echo '<br /><font size="4" color="red">' . _('Problem Report') . ':</font><br />' . @@ -585,11 +587,11 @@ echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; exit; } - echo '<table class="selection"><tr>'; - echo '<td>' . _('In Stock Category') . ':'; - echo '<select name="StockCat">'; + echo '<table class="selection"> + <tr> + <td>' . _('In Stock Category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])) { - $_POST['StockCat'] = ""; + $_POST['StockCat'] = ''; } if ($_POST['StockCat'] == 'All') { echo '<option selected="True" value="All">' . _('All') . '</option>'; @@ -603,25 +605,34 @@ echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } } - echo '</select>'; - echo '<td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</td><td>'; + echo '</select></td> + <td>' . _('Enter partial') . '<b> ' . _('Description') . '</b>:</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></tr><tr><td></td>'; - echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; - echo '<td>'; + echo '</td> + </tr> + <tr> + <td></td> + <td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td> + <td>'; if (isset($_POST['StockCode'])) { echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } - echo '</td></tr></table><br />'; - echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '</td></tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Search" value="' . _('Search Now') . '" /> + </div> + <br /> + </form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; - echo '</form>'; } if (isset($_POST['Search'])){ /*ie seach for stock items */ @@ -638,29 +649,29 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } elseif ($_POST['StockCode']){ @@ -669,55 +680,55 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -725,7 +736,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 and $debug==1){ + if (DB_num_rows($SearchResult)==0 AND $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -739,14 +750,14 @@ echo '<table cellpadding="1" colspan="7">'; - $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('Image') . '</th> - <th>' . _('Quantity') . '</th> - </tr>'; - echo $tableheader; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> + </tr>'; + echo $TableHeader; $i = 0; $k = 0; //row colour counter @@ -761,8 +772,8 @@ $k=1; } - $filename = $myrow['stockid'] . '.jpg'; - if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + $FileName = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; @@ -770,14 +781,13 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - $uom=$myrow['units']; echo '<td>'.$myrow['stockid'].'</td> <td>'.$myrow['description'].'</td> - <td>'.$uom.'</td> + <td>'.$myrow['units'].'</td> <td>'.$ImageSource.'</td> <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> - <input type="hidden" value="'.$uom.'" name="UOM'.$i.'" /> + <input type="hidden" value="'.$myrow['units'].'" name="UOM'.$i.'" /> <input type="hidden" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> </tr>'; @@ -797,7 +807,11 @@ prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Tender" /></div>'; + echo '<a name="end"></a> + <br /> + <div class="centre"> + <input type="submit" name="NewItem" value="' . _('Add to Tender') . '" /> + </div>'; }#end if SearchResults to show echo '</form>'; Modified: trunk/SupplierTenders.php =================================================================== --- trunk/SupplierTenders.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/SupplierTenders.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -64,15 +64,14 @@ $ItemCode=$value; $Quantity=$_POST['Qty'.$Index]; $Price=$_POST['Price'.$Index]; - $_SESSION['offer']->add_to_offer( - $LineNo, - $ItemCode, - $Quantity, - $_POST['ItemDescription'.$Index], - $Price, - $_POST['UOM'.$Index], - $_POST['DecimalPlaces'.$Index], - $_POST['RequiredByDate'.$Index]); + $_SESSION['offer']->add_to_offer($LineNo, + $ItemCode, + $Quantity, + $_POST['ItemDescription'.$Index], + $Price, + $_POST['UOM'.$Index], + $_POST['DecimalPlaces'.$Index], + $_POST['RequiredByDate'.$Index]); $LineNo++; } } @@ -91,16 +90,18 @@ address6, telephone FROM tenders - LEFT JOIN locations + INNER JOIN locations ON tenders.location=locations.loccode WHERE closed=0 AND tenderid='".$_SESSION['offer']->TenderID."'"; $LocationResult=DB_query($LocationSQL, $db); $MyLocationRow=DB_fetch_row($LocationResult); - $CurrencySQL="SELECT decimalplaces from currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; + $CurrencySQL="SELECT decimalplaces FROM currencies WHERE currabrev='".$_SESSION['offer']->CurrCode."'"; $CurrencyResult=DB_query($CurrencySQL, $db); $CurrencyRow=DB_fetch_array($CurrencyResult); - echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + echo '<tr> + <td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td> + <td valign="top" style="background-color:#cccce5">'; for ($i=1; $i<8; $i++) { if ($MyLocationRow[$i]!='') { echo $MyLocationRow[$i] . '<br />'; @@ -109,28 +110,38 @@ echo '</td>'; echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$_SESSION['offer']->TenderID . '</font></th>'; echo '<input type="hidden" value="' . $_SESSION['offer']->TenderID . '" name="Tender" />'; - echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Item Description') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Currency') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; - echo '<th>' . _('Line Value') . '</th>'; - echo '<th>' . _('Delivery By') . '</th>'; + echo '<tr> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '<br />' . _('Offered') . '</th> + <th>' . $Supplier . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Currency') . '</th> + <th>' . $Supplier . '<br />' . _('Price') . '</th> + <th>' . _('Line Value') . '</th> + <th>' . _('Delivery By') . '</th> + </tr>'; + foreach ($_SESSION['offer']->LineItems as $LineItem) { - echo '<tr><td>' . $LineItem->StockID . '</td>'; - echo '<td>' . $LineItem->ItemDescription . '</td>'; - echo '<td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td>'; - echo '<td>' . $LineItem->Units . '</td>'; - echo '<td>' . $_SESSION['offer']->CurrCode . '</td>'; - echo '<td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td>'; - echo '<td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td>'; - echo '<td>' . $LineItem->ExpiryDate . '</td>'; + echo '<tr> + <td>' . $LineItem->StockID . '</td> + <td>' . $LineItem->ItemDescription . '</td> + <td class="number"> ' .locale_number_format($LineItem->Quantity, $LineItem->DecimalPlaces) . '</td> + <td>' . $LineItem->Units . '</td> + <td>' . $_SESSION['offer']->CurrCode . '</td> + <td class="number">' . locale_number_format($LineItem->Price, $CurrencyRow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($LineItem->Price*$LineItem->Quantity,$CurrencyRow['decimalplaces']) . '</td> + <td>' . $LineItem->ExpiryDate . '</td> + </tr>'; } - echo '</table><br />'; - echo '<div class="centre"><input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /><br />'; - echo '<br /><input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /></div>'; - echo '</form>'; + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="Confirm" value="' . _('Confirm and Send Email') . '" /> + <br /> + <br /> + <input type="submit" name="Cancel" value="' . _('Cancel Offer') . '" /> + </div> + </form>'; include('includes/footer.inc'); exit; } @@ -138,7 +149,7 @@ /* If the supplierID is set then it must be a login from the supplier but if nothing else is * set then the supplier must have just logged in so show them the choices. */ -if (isset($_POST['SupplierID']) and empty($_POST['TenderType']) and empty($_POST['Search']) and empty($_POST['NewItem']) and empty($_GET['Delete'])) { +if (isset($_POST['SupplierID']) AND empty($_POST['TenderType']) AND empty($_POST['Search']) AND empty($_POST['NewItem']) AND empty($_GET['Delete'])) { if (isset($_SESSION['offer'])) { unset($_SESSION['offer']); } @@ -146,18 +157,27 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Create or View Offers from') . ' '.$Supplier.'</p>'; echo '<table class="selection">'; - echo'<tr><td>'._('Select option for tendering').'</td>'; - echo '<td><select name="TenderType">'; - echo '<option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option>'; - echo '<option value="2">'._('Create a new offer from').' '.$Supplier .'</option>'; - echo '<option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option>'; - echo '</select></td></tr>'; + echo'<tr> + <td>'._('Select option for tendering').'</td> + <td><select name="TenderType"> + <option value="1">'._('View or Amend outstanding offers from').' '.$Supplier .'</option> + <option value="2">'._('Create a new offer from').' '.$Supplier .'</option> + <option value="3">'._('View any open tenders without an offer from').' '.$Supplier .'</option> + </select></td> + </tr>'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; - echo '<tr><td colspan="2"><div class="centre"><input type="submit" name="submit" value="' . _('Select') . '" /></div></td></tr>'; - echo '</table></form>'; + echo '<tr> + <td colspan="2"> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Select') . '" /> + </div> + </td> + </tr> + </table> + </form>'; } -if (isset($_POST['NewItem']) and !isset($_POST['Refresh'])) { +if (isset($_POST['NewItem']) AND !isset($_POST['Refresh'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -165,7 +185,7 @@ $Quantity=filter_number_format($_POST['Qty'.$Index]); $Price=filter_number_format($_POST['Price'.$Index]); $UOM=$_POST['uom'.$Index]; - if (isset($UOM) and $Quantity>0) { + if (isset($UOM) AND $Quantity>0) { $sql="SELECT description, decimalplaces FROM stockmaster WHERE stockid='".$StockID."'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); @@ -183,7 +203,7 @@ } } -if (isset($_POST['Refresh']) and !isset($_POST['NewItem'])) { +if (isset($_POST['Refresh']) AND !isset($_POST['NewItem'])) { foreach ($_POST as $key => $value) { if (mb_substr($key,0,7)=='StockID') { $Index = mb_substr($key,7,mb_strlen($key)-7); @@ -193,11 +213,10 @@ $ExpiryDate=$_POST['expirydate'.$Index]; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $Index, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($Index, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -216,11 +235,10 @@ $ExpiryDate=$value; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $LineNo, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($LineNo, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -244,11 +262,10 @@ $ExpiryDate=$value; } if (isset($ExpiryDate)) { - $_SESSION['offer']->update_offer_item( - $LineNo, - $Quantity, - $Price, - $ExpiryDate); + $_SESSION['offer']->update_offer_item($LineNo, + $Quantity, + $Price, + $ExpiryDate); unset($ExpiryDate); } } @@ -261,7 +278,7 @@ /*The supplier has chosen option 1 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==1 and !isset($_POST['Refresh'])) { +if (isset($_POST['TenderType']) AND $_POST['TenderType']==1 AND !isset($_POST['Refresh'])) { $sql="SELECT offers.offerid, offers.stockid, stockmaster.description, @@ -278,24 +295,23 @@ $_SESSION['offer']=new Offer($_POST['SupplierID']); $_SESSION['offer']->CurrCode=$Currency; while ($myrow=DB_fetch_array($result)) { - $_SESSION['offer']->add_to_offer( - $myrow['offerid'], - $myrow['stockid'], - $myrow['quantity'], - $myrow['description'], - $myrow['price'], - $myrow['uom'], - $myrow['decimalplaces'], - ConvertSQLDate($myrow['expirydate'])); + $_SESSION['offer']->add_to_offer($myrow['offerid'], + $myrow['stockid'], + $myrow['quantity'], + $myrow['description'], + $myrow['price'], + $myrow['uom'], + $myrow['decimalplaces'], + ConvertSQLDate($myrow['expirydate'])); } } -if (isset($_POST['TenderType']) and $_POST['TenderType']!=3 and isset($_SESSION['offer']) and $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { +if (isset($_POST['TenderType']) AND $_POST['TenderType']!=3 AND isset($_SESSION['offer']) AND $_SESSION['offer']->LinesOnOffer>0 or isset($_POST['Update'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Items to offer from').' '.$Supplier .'</p>'; - echo '<table>'; - echo '<tr> + echo '<table> + <tr> <th>'._('Stock ID').'</th> <th>'._('Description').'</th> <th>'._('Quantity').'</th> @@ -307,43 +323,53 @@ $k=0; foreach ($_SESSION['offer']->LineItems as $LineItems) { if ($LineItems->Deleted==False) { - if ($k==1){ + if ($LineItems->ExpiryDate < date('Y-m-d')) { + echo '<tr bgcolor="#F7A9A9">'; + } elseif ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; } else { echo '<tr class="OddTableRows">'; $k=1; } - if ($LineItems->ExpiryDate < date('Y-m-d')) { - echo '<tr bgcolor="#F7A9A9">'; - } + echo '<input type="hidden" name="StockID'.$LineItems->LineNo.'" value="'.$LineItems->StockID.'" />'; - echo '<td>'.$LineItems->StockID.'</td>'; - echo '<td>'.$LineItems->ItemDescription.'</td>'; - echo '<td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td>'; - echo '<td>'.$LineItems->Units.'</td>'; - echo '<td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td>'; - echo '<td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td>'; - echo '<td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td></tr>'; - echo '</tr>'; + echo '<td>'.$LineItems->StockID.'</td> + <td>'.$LineItems->ItemDescription.'</td> + <td><input type="text" class="number" name="Qty'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Quantity,$LineItems->DecimalPlaces).'" /></td> + <td>'.$LineItems->Units.'</td> + <td><input type="text" class="number" name="Price'.$LineItems->LineNo.'" value="'.locale_number_format($LineItems->Price,2,'.','').'" /></td> + <td class="number">'.locale_number_format($LineItems->Price*$LineItems->Quantity,2).'</td> + <td><input type="text" size="11" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="expirydate'.$LineItems->LineNo.'" value="'.$LineItems->ExpiryDate.'" /></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LineItems->LineNo . '&Type=' . $_POST['TenderType'] . '">' . _('Remove') . '</a></td> + </tr>'; } } echo '</table>'; echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; if ($_POST['TenderType']==1) { - echo '<br /><div class="centre"><input type="submit" name="Update" value="Update offer" />'; - echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Update" value="Update offer" /> + <input type="submit" name="Refresh" value="Refresh screen" /> + </div>'; } else if ($_POST['TenderType']==2) { - echo '<br /><div class="centre"><input type="submit" name="Save" value="Save offer">'; - echo '<input type="submit" name="Refresh" value="Refresh screen" /></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Save" value="Save offer"> + <input type="submit" name="Refresh" value="Refresh screen" /> + </div>'; } echo '</form>'; } /*The supplier has chosen option 2 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==2 and !isset($_POST['Search']) or isset($_GET['Delete'])) { +if (isset($_POST['TenderType']) + AND $_POST['TenderType']==2 + AND !isset($_POST['Search']) + OR isset($_GET['Delete'])) { + if (!isset($_SESSION['offer'])) { $_SESSION['offer']=new Offer($_POST['SupplierID']); } @@ -352,9 +378,9 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items') . '</p>'; $sql = "SELECT categoryid, - categorydescription - FROM stockcategory - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + ORDER BY categorydescription"; $result = DB_query($sql, $db); if (DB_num_rows($result) == 0) { @@ -390,23 +416,37 @@ } echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; - echo '</td></tr><tr><td></td>'; - echo '<td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td>'; - echo '<td>'; + echo '</td> + </tr> + <tr> + <td></td> + <td><font size="3"><b>' . _('OR') . ' ' . '</b></font>' . _('Enter partial') . ' <b>' . _('Stock Code') . '</b>:</td> + <td>'; if (isset($_POST['StockCode'])) { echo '<input type="text" name="StockCode" value="' . $_POST['StockCode'] . '" size="15" maxlength="18" />'; } else { echo '<input type="text" name="StockCode" size="15" maxlength="18" />'; } - echo '</td></tr></table><br />'; - echo '<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /></div><br /></form>'; + echo '</td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Search" value="' . _('Search Now') . '" /> + </div> + <br /> + </form>'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockCode);</script>'; echo '</form>'; } /*The supplier has chosen option 3 */ -if (isset($_POST['TenderType']) and $_POST['TenderType']==3 and !isset($_POST['Search']) or isset($_GET['Delete'])) { +if (isset($_POST['TenderType']) + AND $_POST['TenderType']==3 + AND !isset($_POST['Search']) + OR isset($_GET['Delete'])) { + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Tenders Waiting For Offers').'</p>'; $sql="SELECT DISTINCT tendersuppliers.tenderid, suppliers.currcode @@ -421,7 +461,9 @@ ORDER BY tendersuppliers.tenderid"; $result=DB_query($sql, $db); echo '<table class="selection">'; - echo '<tr><th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th></tr>'; + echo '<tr> + <th colspan="13"><font size="3" color="#616161">' . _('Outstanding Tenders Waiting For Offer') . '</font></th> + </tr>'; while ($myrow=DB_fetch_row($result)) { echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -436,13 +478,15 @@ address6, telephone FROM tenders - LEFT JOIN locations + INNER JOIN locations ON tenders.location=locations.loccode WHERE closed=0 AND tenderid='".$myrow[0]."'"; $LocationResult=DB_query($LocationSQL, $db); $MyLocationRow=DB_fetch_row($LocationResult); - echo '<tr><td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td><td valign="top" style="background-color:#cccce5">'; + echo '<tr> + <td valign="top" style="background-color:#cccce5">' . _('Deliver To') . ':</td> + <td valign="top" style="background-color:#cccce5">'; for ($i=1; $i<8; $i++) { if ($MyLocationRow[$i]!='') { echo $MyLocationRow[$i] . '<br />'; @@ -451,7 +495,8 @@ echo '</td>'; echo '<th colspan="8" style="vertical-align:top"><font size="2" color="#616161">' . _('Tender Number') . ': ' .$myrow[0] . '</font></th>'; echo '<input type="hidden" value="' . $myrow[0] . '" name="Tender" />'; - echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th></tr>'; + echo '<th><input type="submit" value="' . _('Process') . "\n" . _('Tender') . '" name="Process" /></th> + </tr>'; $ItemSQL="SELECT tenderitems.tenderid, tenderitems.stockid, stockmaster.description, @@ -471,37 +516,42 @@ ON tenders.tenderid=tenderitems.tenderid WHERE tenderitems.tenderid='" . $myrow[0] . "'"; $ItemResult=DB_query($ItemSQL, $db); - echo '<tr><th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Item Description') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Item Code') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Required') . '</th>'; - echo '<th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Required By') . '</th>'; - echo '<th>' . _('Quantity') . '<br />' . _('Offered') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Units of Measure') . '</th>'; - echo '<th>' . _('Currency') . '</th>'; - echo '<th>' . $Supplier . '<br />' . _('Price') . '</th>'; - echo '<th>' . _('Delivery By') . '</th>'; + echo '<tr> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . $Supplier . '<br />' . _('Item Code') . '</th> + <th>' . _('Quantity') . '<br />' . _('Required') . '</th> + <th>' . stripslashes($_SESSION['CompanyRecord']['coyname']) . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Required By') . '</th> + <th>' . _('Quantity') . '<br />' . _('Offered') . '</th> + <th>' . $Supplier . '<br />' . _('Units of Measure') . '</th> + <th>' . _('Currency') . '</th> + <th>' . $Supplier . '<br />' . _('Price') . '</th> + <th>' . _('Delivery By') . '</th> + </tr>'; $i=0; while ($MyItemRow=DB_fetch_array($ItemResult)) { - echo '<tr><td>' . $MyItemRow['stockid'] . '</td>'; - echo '<td>' . $MyItemRow['description'] . '</td>'; - echo '<input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" />'; - echo '<input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" />'; - echo '<td>' . $MyItemRow['suppliers_partno'] . '</td>'; - echo '<td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td>'; - echo '<td>' . $MyItemRow['units'] . '</td>'; - echo '<td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + echo '<tr> + <td>' . $MyItemRow['stockid'] . '</td> + <td>' . $MyItemRow['description'] . '</td> + <input type="hidden" name="StockID'. $i . '" value="' . $MyItemRow['stockid'] . '" /> + <input type="hidden" name="ItemDescription'. $i . '" value="' . $MyItemRow['description'] . '" /> + <td>' . $MyItemRow['suppliers_partno'] . '</td> + <td class="number">' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '</td> + <td>' . $MyItemRow['units'] . '</td> + <td>' . ConvertSQLDate($MyItemRow['requiredbydate']) . '</td>'; + if ($MyItemRow['suppliersuom']=='') { $MyItemRow['suppliersuom']=$MyItemRow['units']; } - echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td>'; - echo '<input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" />'; - echo '<input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" />'; - echo '<td>' . $MyItemRow['suppliersuom'] . '</td>'; - echo '<td>' . $myrow[1] . '</td>'; - echo '<td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td>'; - echo '<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td>'; + echo '<td><input type="text" class="number" size="10" name="Qty'. $i . '" value="' . locale_number_format($MyItemRow['quantity'], $MyItemRow['decimalplaces']) . '" /></td> + <input type="hidden" name="UOM'. $i . '" value="' . $MyItemRow['units'] . '" /> + <input type="hidden" name="DecimalPlaces'. $i . '" value="' . $MyItemRow['decimalplaces'] . '" /> + <td>' . $MyItemRow['suppliersuom'] . '</td> + <td>' . $myrow[1] . '</td> + <td><input type="text" class="number" size="10" name="Price'. $i . '" value="0.00" /></td> + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" name="RequiredByDate'. $i . '" size="11" value="' . ConvertSQLDate($MyItemRow['requiredbydate']) . '" /></td> + </tr>'; } echo '</form>'; } @@ -513,7 +563,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/supplier.png" title="' . _('Tenders') . '" alt="" />' . ' ' . _('Select items to offer from').' '.$Supplier .'</p>'; - if ($_POST['Keywords'] and $_POST['StockCode']) { + 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']) { @@ -522,29 +572,29 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } elseif ($_POST['StockCode']){ @@ -553,55 +603,55 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -609,7 +659,7 @@ $DbgMsg = _('The SQL statement that failed was'); $SearchResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); - if (DB_num_rows($SearchResult)==0 and $debug==1){ + if (DB_num_rows($SearchResult)==0 AND $debug==1){ prnMsg( _('There are no products to display matching the criteria provided'),'warn'); } if (DB_num_rows($SearchResult)==1){ @@ -623,7 +673,7 @@ echo '<table cellpadding="1" colspan="7">'; - $tableheader = '<tr> + $TableHeader = '<tr> <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Units') . '</th> @@ -631,7 +681,7 @@ <th>' . _('Quantity') . '</th> <th>' . _('Price') .' ('.$Currency.')</th> </tr>'; - echo $tableheader; + echo $TableHeader; $i = 0; $k = 0; //row colour counter @@ -646,8 +696,8 @@ $k=1; } - $filename = $myrow['stockid'] . '.jpg'; - if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { + $FileName = $myrow['stockid'] . '.jpg'; + if (file_exists( $_SESSION['part_pics_dir'] . '/' . $FileName) ) { $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50" />'; @@ -655,7 +705,7 @@ $ImageSource = '<i>'._('No Image').'</i>'; } - $uomsql="SELECT conversionfactor, + $UOMsql="SELECT conversionfactor, suppliersuom, unitsofmeasure.unitname FROM purchdata @@ -664,25 +714,25 @@ WHERE supplierno='".$_POST['SupplierID']."' AND stockid='" . $myrow['stockid'] . "'"; - $uomresult=DB_query($uomsql, $db); - if (DB_num_rows($uomresult)>0) { - $uomrow=DB_fetch_array($uomresult); - if (mb_strlen($uomrow['suppliersuom'])>0) { - $uom=$uomrow['unitname']; + $UOMresult=DB_query($UOMsql, $db); + if (DB_num_rows($UOMresult)>0) { + $UOMrow=DB_fetch_array($UOMresult); + if (mb_strlen($UOMrow['suppliersuom'])>0) { + $UOM=$UOMrow['unitname']; } else { - $uom=$myrow['units']; + $UOM=$myrow['units']; } } else { - $uom=$myrow['units']; + $UOM=$myrow['units']; } echo '<td>'.$myrow['stockid'].'</td> <td>'.$myrow['description'].'</td> - <td>'.$uom.'</td> + <td>'.$UOM.'</td> <td>'.$ImageSource.'</td> <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /></td> <td><input class="number" type="text" size="12" value="0" name="Price'.$i.'" /></td> <input type="hidden" size="12" value="'.$myrow['stockid'].'" name="StockID'.$i.'" /> - <input type="hidden" value="'.$uom.'" name="uom'.$i.'" /> + <input type="hidden" value="'.$UOM.'" name="uom'.$i.'" /> </tr>'; $i++; $PartsDisplayed++; @@ -696,11 +746,14 @@ if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){ /*$Maximum_Number_Of_Parts_To_Show defined in config.php */ - prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<a name="end"></a><br /><div class="centre"><input type="submit" name="NewItem" value="Add to Offer" /></div>'; + echo '<a name="end"></a> + <br /> + <div class="centre"> + <input type="submit" name="NewItem" value="Add to Offer" /> + </div>'; }#end if SearchResults to show echo '<input type="hidden" name="TenderType" value="'.$_POST['TenderType'].'" />'; echo '<input type="hidden" name="SupplierID" value="'.$_POST['SupplierID'].'" />'; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/UpgradeDatabase.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -132,8 +132,8 @@ case '4.06.5': $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06.6': - $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; - case '4.06.7': + $SQLScripts[] = './sql/mysql/upgrade4.06-4.07.sql'; + case '4.07.0': break; } //end switch } Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/api/api_stock.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,5 +1,5 @@ <?php - + /* Check that the stock code*/ function VerifyStockCode($StockCode, $i, $Errors, $db) { $Searchsql = "SELECT count(stockid) @@ -734,8 +734,8 @@ WHERE stockid='" .$StockID. "' AND typeabbrev='" .$SalesType. "' AND currabrev='".$Currency. "' - AND startdate>='". Date('Y-m-d') . "' - (AND enddate<='" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; + AND startdate<='". Date('Y-m-d') . "' + AND (enddate>'" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; $result = DB_Query($sql, $db); $myrow = DB_fetch_row($result); if ($myrow[0]==0) { @@ -746,8 +746,8 @@ WHERE stockid='" .$StockID. "' AND typeabbrev='" .$SalesType. "' AND currabrev='".$Currency. "' - AND startdate>='". Date('Y-m-d') . "' - (AND enddate<='" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; + AND startdate<='". Date('Y-m-d') . "' + AND (enddate>'" . Date('Y-m-d') . "' OR enddate='0000-00-00')"; } $result = DB_Query($sql, $db); $myrow = DB_fetch_row($result); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/api/api_xml-rpc.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1048,7 +1048,7 @@ /*x*/ $xmlrpcmsg->getParam( 2 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 3 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 4 )->scalarval( ))) ); -/*x*/ } else { +/*x*/ } else { //only 3 parameters if login already in session $rtn = new xmlrpcresp( php_xmlrpc_encode(GetStockPrice($xmlrpcmsg->getParam( 0 )->scalarval( ), $xmlrpcmsg->getParam( 1 )->scalarval( ), /*e*/ $xmlrpcmsg->getParam( 2 )->scalarval( ), '', ''))); Modified: trunk/includes/DefineOfferClass.php =================================================================== --- trunk/includes/DefineOfferClass.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/includes/DefineOfferClass.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -30,32 +30,31 @@ FROM suppliers WHERE supplierid='" . $this->SupplierID . "'"; $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - $this->SupplierName = $myrow[0]; - $this->EmailAddress = $myrow[1]; - $this->CurrCode = $myrow[2]; + $myrow=DB_fetch_array($result); + $this->SupplierName = $myrow['suppname']; + $this->EmailAddress = $myrow['email']; + $this->CurrCode = $myrow['currcode']; } - function add_to_offer( - $LineNo, - $StockID, - $Qty, - $ItemDescr, - $Price, - $UOM, - $DecimalPlaces, - $ExpiryDate){ + function add_to_offer( $LineNo, + $StockID, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate){ if (isset($Qty) and $Qty!=0){ $this->LineItems[$LineNo] = new LineDetails($LineNo, - $StockID, - $Qty, - $ItemDescr, - $Price, - $UOM, - $DecimalPlaces, - $ExpiryDate); + $StockID, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate); $this->LinesOnOffer++; Return 1; } @@ -74,25 +73,22 @@ if ($Update=='') { foreach ($this->LineItems as $LineItems) { if ($LineItems->Deleted==False) { - $sql="INSERT INTO offers ( - supplierid, - tenderid, - stockid, - quantity, - uom, - price, - expirydate, - currcode) - VALUES ( - '".$this->SupplierID."', - '".$this->TenderID."', - '".$LineItems->StockID."', - '".$LineItems->Quantity."', - '".$LineItems->Units."', - '".$LineItems->Price."', - '".FormatDateForSQL($LineItems->ExpiryDate)."', - '".$this->CurrCode."' - )"; + $sql="INSERT INTO offers ( supplierid, + tenderid, + stockid, + quantity, + uom, + price, + expirydate, + currcode) + VALUES ('".$this->SupplierID."', + '".$this->TenderID."', + '".$LineItems->StockID."', + '".$LineItems->Quantity."', + '".$LineItems->Units."', + '".$LineItems->Price."', + '".FormatDateForSQL($LineItems->ExpiryDate)."', + '".$this->CurrCode."')"; $ErrMsg = _('The suppliers offer could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -109,11 +105,10 @@ } } else { foreach ($_SESSION['offer']->LineItems as $LineItems) { - $sql="UPDATE offers SET - quantity='".$LineItems->Quantity."', - price='".$LineItems->Price."', - expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' - WHERE offerid='".$LineItems->LineNo . "'"; + $sql="UPDATE offers SET quantity='".$LineItems->Quantity."', + price='".$LineItems->Price."', + expirydate='".FormatDateForSQL($LineItems->ExpiryDate)."' + WHERE offerid='".$LineItems->LineNo . "'"; $ErrMsg = _('The suppliers offer could not be updated on the database because'); $DbgMsg = _('The SQL statement used to update the suppliers offer record and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -140,9 +135,9 @@ } function update_offer_item($LineNo, - $Qty, - $Price, - $ExpiryDate){ + $Qty, + $Price, + $ExpiryDate){ $this->LineItems[$LineNo]->Quantity = $Qty; $this->LineItems[$LineNo]->Price = $Price; @@ -175,23 +170,21 @@ var $Deleted; var $ExpiryDate; - function LineDetails ( - $LineNo, - $StockItem, - $Qty, - $ItemDescr, - $Prc, - $UOM, - $DecimalPlaces, - $ExpiryDate) - { + function LineDetails ($LineNo, + $StockItem, + $Qty, + $ItemDescr, + $Price, + $UOM, + $DecimalPlaces, + $ExpiryDate) { /* Constructor function to add a new LineDetail object with passed params */ $this->LineNo = $LineNo; $this->StockID =$StockItem; $this->ItemDescription = $ItemDescr; $this->Quantity = $Qty; - $this->Price = $Prc; + $this->Price = $Price; $this->Units = $UOM; $this->DecimalPlaces = $DecimalPlaces; $this->ExpiryDate = $ExpiryDate; Modified: trunk/includes/DefineTenderClass.php =================================================================== --- trunk/includes/DefineTenderClass.php 2012-01-20 22:55:59 UTC (rev 4823) +++ trunk/includes/DefineTenderClass.php 2012-01-20 23:10:18 UTC (rev 4824) @@ -1,9 +1,8 @@ <?php -/* $Id$ */ +/* $Id: DefineTenderClass.php 4821 2012-01-20 13:48:53Z tim_schofield $ */ /* Definition of the tender class to hold all the information for a supplier tender */ - Class Tender { var $TenderId; @@ -58,62 +57,55 @@ */ if ($this->TenderId=='') { $this->TenderId = GetNextTransNo(37, $db); - $HeaderSQL="INSERT INTO tenders ( - tenderid, - location, - address1, - address2, - address3, - address4, - address5, - address6, - telephone, - requiredbydate) - VALUES ( - '" . $this->TenderId . "', - '" . $this->Location . "', - '" . $this->DelAdd1 . "', - '" . $this->DelAdd2 . "', - '" . $this->DelAdd3 . "', - '" . $this->DelAdd4 . "', - '" . $this->DelAdd5 . "', - '" . $this->DelAdd6 . "', - '" . $this->Telephone . "', - '" . FormatDateForSQL($this->RequiredByDate) . "')"; + $HeaderSQL="INSERT INTO tenders (tenderid, + location, + address1, + address2, + address3, + address4, + address5, + address6, + telephone, + requiredbydate) + VALUES ('" . $this->TenderId . "', + '" . $this->Location . "', + '" . $this->DelAdd1 . "', + '" . $this->DelAdd2 . "', + '" . $this->DelAdd3 . "', + '" . $this->DelAdd4 . "', + '" . $this->DelAdd5 . "', + '" . $this->DelAdd6 . "', + '" . $this->Telephone . "', + '" . FormatDateForSQL($this->RequiredByDate) . "')"; foreach ($this->Suppliers as $Supplier) { - $SuppliersSQL[]="INSERT INTO tendersuppliers ( - tenderid, - supplierid, - email) - VALUES ( - '" . $this->TenderId . "', - '" . $Supplier->SupplierCode . "', - '" . $Supplier->EmailAddress . "')"; + $SuppliersSQL[]="INSERT INTO tendersuppliers (tenderid, + supplierid, + email) + VALUES ('" . $this->TenderId . "', + '" . $Supplier->SupplierCode . "', + '" . $Supplier->EmailAddress . "')"; } foreach ($this->LineItems as $LineItem) { - $ItemsSQL[]="INSERT INTO tenderitems ( - tenderid, - stockid, - quantity, - units) - VALUES ( - '" . $this->TenderId . "', - '" . $LineItem->StockID . "', - '" . $LineItem->Quantity . "', - '" . $LineItem->Units . "')"; + $ItemsSQL[]="INSERT INTO tenderitems (tenderid, + stockid, + quantity, + units) + VALUES ('" . $this->TenderId . "', + '" . $LineItem->StockID . "', + '" . $LineItem->Quantity . "', + '" . $LineItem->Units . "')"; } } else { - $HeaderSQL="UPDATE tenders - SET location='" . $this->Location . "', - address1='" . $this->DelAdd1 . "', - address2='" . $this->DelAdd2 . "', - address3='" . $this->DelAdd3 . "', - address4='" . $this->DelAdd4 . "', - address5='" . $this->DelAdd5 . "', - address6='" . $this->DelAdd6 . "', - telephone='" . $this->Telephone . "', - requiredbydate='" . FormatDateForSQL($this->RequiredByDate) . "' - WHERE tenderid = '" . $this->TenderId . "'"; + $HeaderSQL="UPDATE tenders SET location='" . $this->Location . "', + address1='" . $this->DelAdd1 . "', + address2='" . $this->DelAdd2 . "', + address3='" . $this->DelAdd3 . "', + address4='" . $this->DelAdd4 . "', + address5='" . $this->DelAdd5 . "', + address6='" . $this->DelAdd6 . "', + telephone='" . $this->Telephone . "', + requiredbydate='" . FormatDateForSQL($this->RequiredByDate) . "' + WHERE tenderid = '" . $this->TenderId . "'"; foreach ($this->Suppliers as $Supplier) { $sql="DELETE FROM tendersuppliers WHERE tenderid='" . $this->TenderId . "'"; @@ -122,25 +114,22 @@ tenderid, supplierid, email) - VALUES ( - '" . $this->TenderId . "', - '" . $Supplier->SupplierCode . "', - '" . $Supplier->EmailAddress . "')"; + VALUES ('" . $this->TenderId . "', + '" . $Supplier->SupplierCode . "', + '" . $Supplier->EmailAddress . "')"; } foreach ($this->LineItems as $LineItem) { $sql="DELETE FROM tenderitems - WHERE tenderid='" . $this->TenderId . "'"; + WHERE tenderid='" . $this->TenderId . "'"; $result=DB_query($sql, $db); - $ItemsSQL[]="INSERT INTO tenderitems ( - tenderid, - stockid, - quantity, - units) - VALUES ( - '" . $this->TenderId . "', - '" . $LineItem->StockID . "', - '" . $LineItem->Quantity . "', - '" . $LineItem->Units . "')"; + $ItemsSQL[]="INSERT INTO tenderitems (tenderid, + stockid, + quantity, + units) + ... [truncated message content] |
From: <dai...@us...> - 2012-01-21 00:49:51
|
Revision: 4826 http://web-erp.svn.sourceforge.net/web-erp/?rev=4826&view=rev Author: daintree Date: 2012-01-21 00:49:44 +0000 (Sat, 21 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/CustomerBranches.php trunk/StockAdjustments.php trunk/doc/Change.log Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2012-01-20 23:11:00 UTC (rev 4825) +++ trunk/CustomerBranches.php 2012-01-21 00:49:44 UTC (rev 4826) @@ -85,9 +85,9 @@ if (!isset($_POST['EstDeliveryDays'])) { $_POST['EstDeliveryDays']=1; } - if (!isset($latitude)) { - $latitude=0.0; - $longitude=0.0; + if (!isset($Latitude)) { + $Latitude=0.0; + $Longitude=0.0; } if ($_SESSION['geocode_integration']==1 ){ // Get the lat/long from our geocoding host @@ -110,8 +110,8 @@ $coordinates = $xml->Response->Placemark->Point->coordinates; $coordinatesSplit = explode(",", $coordinates); // Format: Longitude, Latitude, Altitude - $latitude = $coordinatesSplit[1]; - $longitude = $coordinatesSplit[0]; + $Latitude = $coordinatesSplit[1]; + $Longitude = $coordinatesSplit[0]; $status = $xml->Response->Status->code; if (strcmp($status, '200') == 0) { @@ -120,8 +120,8 @@ $coordinates = $xml->Response->Placemark->Point->coordinates; $coordinatesSplit = explode(",", $coordinates); // Format: Longitude, Latitude, Altitude - $latitude = $coordinatesSplit[1]; - $longitude = $coordinatesSplit[0]; + $Latitude = $coordinatesSplit[1]; + $Longitude = $coordinatesSplit[0]; } else { // failure to geocode $geocode_pending = false; @@ -141,8 +141,8 @@ braddress4 = '" . $_POST['BrAddress4'] . "', braddress5 = '" . $_POST['BrAddress5'] . "', braddress6 = '" . $_POST['BrAddress6'] . "', - lat = '" . $latitude . "', - lng = '" . $longitude . "', + lat = '" . $Latitude . "', + lng = '" . $Longitude . "', specialinstructions = '" . $_POST['SpecialInstructions'] . "', phoneno='" . $_POST['PhoneNo'] . "', faxno='" . $_POST['FaxNo'] . "', @@ -209,8 +209,8 @@ '" . $_POST['BrAddress4'] . "', '" . $_POST['BrAddress5'] . "', '" . $_POST['BrAddress6'] . "', - '" . $latitude . "', - '" . $longitude . "', + '" . $Latitude . "', + '" . $Longitude . "', '" . $_POST['SpecialInstructions'] . "', '" . filter_number_format($_POST['EstDeliveryDays']) . "', '" . $_POST['FwdDate'] . "', @@ -362,9 +362,9 @@ if ($myrow) { echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> ' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; - echo '<table class=selection>'; - - echo '<tr><th>'._('Code').'</th> + echo '<table class="selection"> + <tr> + <th>'._('Code').'</th> <th>'._('Name').'</th> <th>'._('Branch Contact').'</th> <th>'._('Salesman').'</th> @@ -373,7 +373,8 @@ <th>'._('Fax No').'</th> <th>'._('Email').'</th> <th>'._('Tax Group').'</th> - <th>'._('Enabled?').'</th></tr>'; + <th>'._('Enabled?').'</th> + </tr>'; $k=0; do { @@ -425,10 +426,16 @@ } while ($myrow = DB_fetch_row($result)); //END WHILE LIST LOOP - echo '</table><br /><table class=selection><tr><td><div class="centre">'; + echo '</table> + <br /> + <table class="selection"> + <tr> + <td><div class="centre">'; echo '<b>'.$TotalEnable.'</b> ' . _('Branches are enabled.') . '<br />'; echo '<b>'.$TotalDisable.'</b> ' . _('Branches are disabled.') . '<br />'; - echo '<b>'.($TotalEnable+$TotalDisable). '</b> ' . _('Total Branches') . '</div></td></tr></table>'; + echo '<b>'.($TotalEnable+$TotalDisable). '</b> ' . _('Total Branches') . '</div></td> + </tr> + </table>'; } else { $sql = "SELECT debtorsmaster.name, address1, @@ -577,7 +584,7 @@ $_POST['BranchCode']=''; } 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> + 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> Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2012-01-20 23:11:00 UTC (rev 4825) +++ trunk/StockAdjustments.php 2012-01-21 00:49:44 UTC (rev 4826) @@ -349,8 +349,11 @@ $_SESSION['Adjustment']->StandardCost=$myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost']; $DecimalPlaces = $myrow['decimalplaces']; } -echo '<br /><table class=selection>'; -echo '<tr><th colspan="4"><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; +echo '<br /> + <table class="selection"> + <tr> + <th colspan="4"><font color=blue size="3">'._('Adjustment Details').'</font></th> + </tr>'; if (!isset($_GET['Description'])) { $_GET['Description']=''; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-20 23:11:00 UTC (rev 4825) +++ trunk/doc/Change.log 2012-01-21 00:49:44 UTC (rev 4826) @@ -1,5 +1,6 @@ webERP Change Log +20/1/12 Phil: Fixed GetStockPrice API function for effectivty dates 20/1/12 Vitaly: Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php 20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php 20/1/12 Tim: Merge tendering system from Tim's branch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2012-01-21 00:49:50
|
Revision: 4826 http://web-erp.svn.sourceforge.net/web-erp/?rev=4826&view=rev Author: daintree Date: 2012-01-21 00:49:44 +0000 (Sat, 21 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/CustomerBranches.php trunk/StockAdjustments.php trunk/doc/Change.log Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2012-01-20 23:11:00 UTC (rev 4825) +++ trunk/CustomerBranches.php 2012-01-21 00:49:44 UTC (rev 4826) @@ -85,9 +85,9 @@ if (!isset($_POST['EstDeliveryDays'])) { $_POST['EstDeliveryDays']=1; } - if (!isset($latitude)) { - $latitude=0.0; - $longitude=0.0; + if (!isset($Latitude)) { + $Latitude=0.0; + $Longitude=0.0; } if ($_SESSION['geocode_integration']==1 ){ // Get the lat/long from our geocoding host @@ -110,8 +110,8 @@ $coordinates = $xml->Response->Placemark->Point->coordinates; $coordinatesSplit = explode(",", $coordinates); // Format: Longitude, Latitude, Altitude - $latitude = $coordinatesSplit[1]; - $longitude = $coordinatesSplit[0]; + $Latitude = $coordinatesSplit[1]; + $Longitude = $coordinatesSplit[0]; $status = $xml->Response->Status->code; if (strcmp($status, '200') == 0) { @@ -120,8 +120,8 @@ $coordinates = $xml->Response->Placemark->Point->coordinates; $coordinatesSplit = explode(",", $coordinates); // Format: Longitude, Latitude, Altitude - $latitude = $coordinatesSplit[1]; - $longitude = $coordinatesSplit[0]; + $Latitude = $coordinatesSplit[1]; + $Longitude = $coordinatesSplit[0]; } else { // failure to geocode $geocode_pending = false; @@ -141,8 +141,8 @@ braddress4 = '" . $_POST['BrAddress4'] . "', braddress5 = '" . $_POST['BrAddress5'] . "', braddress6 = '" . $_POST['BrAddress6'] . "', - lat = '" . $latitude . "', - lng = '" . $longitude . "', + lat = '" . $Latitude . "', + lng = '" . $Longitude . "', specialinstructions = '" . $_POST['SpecialInstructions'] . "', phoneno='" . $_POST['PhoneNo'] . "', faxno='" . $_POST['FaxNo'] . "', @@ -209,8 +209,8 @@ '" . $_POST['BrAddress4'] . "', '" . $_POST['BrAddress5'] . "', '" . $_POST['BrAddress6'] . "', - '" . $latitude . "', - '" . $longitude . "', + '" . $Latitude . "', + '" . $Longitude . "', '" . $_POST['SpecialInstructions'] . "', '" . filter_number_format($_POST['EstDeliveryDays']) . "', '" . $_POST['FwdDate'] . "', @@ -362,9 +362,9 @@ if ($myrow) { echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" /> ' . ' ' . _('Branches defined for'). ' '. $DebtorNo . ' - ' . $myrow[0] . '</p>'; - echo '<table class=selection>'; - - echo '<tr><th>'._('Code').'</th> + echo '<table class="selection"> + <tr> + <th>'._('Code').'</th> <th>'._('Name').'</th> <th>'._('Branch Contact').'</th> <th>'._('Salesman').'</th> @@ -373,7 +373,8 @@ <th>'._('Fax No').'</th> <th>'._('Email').'</th> <th>'._('Tax Group').'</th> - <th>'._('Enabled?').'</th></tr>'; + <th>'._('Enabled?').'</th> + </tr>'; $k=0; do { @@ -425,10 +426,16 @@ } while ($myrow = DB_fetch_row($result)); //END WHILE LIST LOOP - echo '</table><br /><table class=selection><tr><td><div class="centre">'; + echo '</table> + <br /> + <table class="selection"> + <tr> + <td><div class="centre">'; echo '<b>'.$TotalEnable.'</b> ' . _('Branches are enabled.') . '<br />'; echo '<b>'.$TotalDisable.'</b> ' . _('Branches are disabled.') . '<br />'; - echo '<b>'.($TotalEnable+$TotalDisable). '</b> ' . _('Total Branches') . '</div></td></tr></table>'; + echo '<b>'.($TotalEnable+$TotalDisable). '</b> ' . _('Total Branches') . '</div></td> + </tr> + </table>'; } else { $sql = "SELECT debtorsmaster.name, address1, @@ -577,7 +584,7 @@ $_POST['BranchCode']=''; } 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> + 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> Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2012-01-20 23:11:00 UTC (rev 4825) +++ trunk/StockAdjustments.php 2012-01-21 00:49:44 UTC (rev 4826) @@ -349,8 +349,11 @@ $_SESSION['Adjustment']->StandardCost=$myrow['materialcost']+$myrow['labourcost']+$myrow['overheadcost']; $DecimalPlaces = $myrow['decimalplaces']; } -echo '<br /><table class=selection>'; -echo '<tr><th colspan="4"><font color=blue size=3>'._('Adjustment Details').'</font></th></tr>'; +echo '<br /> + <table class="selection"> + <tr> + <th colspan="4"><font color=blue size="3">'._('Adjustment Details').'</font></th> + </tr>'; if (!isset($_GET['Description'])) { $_GET['Description']=''; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-20 23:11:00 UTC (rev 4825) +++ trunk/doc/Change.log 2012-01-21 00:49:44 UTC (rev 4826) @@ -1,5 +1,6 @@ webERP Change Log +20/1/12 Phil: Fixed GetStockPrice API function for effectivty dates 20/1/12 Vitaly: Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php 20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php 20/1/12 Tim: Merge tendering system from Tim's branch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-21 15:41:58
|
Revision: 4827 http://web-erp.svn.sourceforge.net/web-erp/?rev=4827&view=rev Author: vvs2012 Date: 2012-01-21 15:41:50 +0000 (Sat, 21 Jan 2012) Log Message: ----------- xhtml fixes in multiple files Modified Paths: -------------- trunk/AuditTrail.php trunk/FixedAssetDepreciation.php trunk/FixedAssetLocations.php trunk/GLAccountInquiry.php trunk/PDFCustTransListing.php trunk/PcClaimExpensesFromTab.php trunk/PurchData.php trunk/SelectCompletedOrder.php trunk/StockCostUpdate.php trunk/StockLocStatus.php trunk/StockTransfers.php trunk/SuppLoginSetup.php trunk/SupplierInvoice.php trunk/WorkOrderEntry.php trunk/Z_ImportGLAccountGroups.php trunk/Z_ImportPartCodes.php trunk/Z_poEditLangModule.php trunk/doc/Change.log Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/AuditTrail.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -39,9 +39,9 @@ echo '<table class="selection">'; echo '<tr><td>'. _('From Date') . ' ' . $_SESSION['DefaultDateFormat'] .'</td> - <td><input tabindex="1" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="11" maxlength="10" value=' .$_POST['FromDate'].'></td></tr>'; + <td><input tabindex="1" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="11" maxlength="10" value="' .$_POST['FromDate']. '" /></td></tr>'; echo '<tr><td>'. _('To Date') . ' ' . $_SESSION['DefaultDateFormat'] .'</td> - <td><input tabindex="2" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="11" maxlength="10" value=' . $_POST['ToDate'] . '></td></tr>'; + <td><input tabindex="2" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="11" maxlength="10" value="' . $_POST['ToDate'] . '" /></td></tr>'; // Show user selections echo '<tr><td>'. _('User ID'). '</td> @@ -74,11 +74,11 @@ } // Show the text echo '<tr><td>' . _('Containing text') . ':</td>'; -echo '<td><input type="text" name="ContainingText" size=20 maxlength=20 value="'. $_POST['ContainingText'] . '"></td></tr>'; +echo '<td><input type="text" name="ContainingText" size="20" maxlength="20" value="'. $_POST['ContainingText'] . '" /></td></tr>'; echo '</table><br />'; -echo '<div class="centre"><input tabindex="5" type="submit" name="View" value="' . _('View') . '"></div>'; +echo '<div class="centre"><input tabindex="5" type="submit" name="View" value="' . _('View') . '" /></div>'; echo '</form>'; // View the audit trail Modified: trunk/FixedAssetDepreciation.php =================================================================== --- trunk/FixedAssetDepreciation.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/FixedAssetDepreciation.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -109,11 +109,11 @@ while ($AssetRow=DB_fetch_array($AssetsResult)) { if ($AssetCategoryDescription != $AssetRow['categorydescription'] OR $AssetCategoryDescription =='0'){ if ($AssetCategoryDescription !='0'){ //then print totals - echo '<tr><th colspan=3 align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> + echo '<tr><th colspan="3" align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> <th class="number">' . locale_number_format($TotalCategoryCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th class="number">' . locale_number_format($TotalCategoryAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th class="number">' . locale_number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th colspan=2></th> + <th colspan="2"></th> <th class="number">' . locale_number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr>'; } Modified: trunk/FixedAssetLocations.php =================================================================== --- trunk/FixedAssetLocations.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/FixedAssetLocations.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -115,10 +115,10 @@ <tr> <th style="text-align:left">'._('Location ID').'</th>'; if (isset($_GET['SelectedLocation'])) { - echo '<input type="hidden" name=LocationID value="'.$LocationID.'" />'; + echo '<input type="hidden" name="LocationID" value="'.$LocationID.'" />'; echo '<td>'.$LocationID.'</td>'; } else { - echo '<td><input type="text" name=LocationID size=6 value="'.$LocationID.'" /></td> + echo '<td><input type="text" name="LocationID" size="6" value="'.$LocationID.'" /></td> </tr>'; } Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/GLAccountInquiry.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -74,7 +74,7 @@ } } echo '</select></td></tr><table>'; -echo '<p><div class="centre"><input type=submit name="Show" value="'._('Show Account Transactions').'"></div></form>'; +echo '<p><div class="centre"><input type="submit" name="Show" value="'._('Show Account Transactions').'" /></div></form>'; /* End of the Form rest of script is what happens if the show button is hit*/ @@ -145,7 +145,7 @@ echo '<br /><table class=selection>'; - echo '<tr><th colspan=8><b>' ._('Transactions for account').' '.$SelectedAccount. ' - '. $SelectedAccountName.'</b></th></tr>'; + echo '<tr><th colspan="8"><b>' ._('Transactions for account').' '.$SelectedAccount. ' - '. $SelectedAccountName.'</b></th></tr>'; $TableHeader = '<tr> <th>' . _('Type') . '</th> <th>' . _('Number') . '</th> @@ -178,16 +178,16 @@ $RunningTotal =$ChartDetailRow['bfwd']; if ($RunningTotal < 0 ){ //its a credit balance b/fwd echo '<tr bgcolor="#FDFEEF"> - <td colspan=3><b>' . _('Brought Forward Balance') . '</b><td> + <td colspan="3"><b>' . _('Brought Forward Balance') . '</b><td> </td></td> - <td class=number><b>' . locale_number_format(-$RunningTotal,2) . '</b></td> + <td class="number"><b>' . locale_number_format(-$RunningTotal,2) . '</b></td> <td></td> </tr>'; } else { //its a debit balance b/fwd echo '<tr bgcolor="#FDFEEF"> - <td colspan=3><b>' . _('Brought Forward Balance') . '</b></td> - <td class=number><b>' . locale_number_format($RunningTotal,2) . '</b></td> - <td colspan=2></td> + <td colspan="3"><b>' . _('Brought Forward Balance') . '</b></td> + <td class="number"><b>' . locale_number_format($RunningTotal,2) . '</b></td> + <td colspan="2"></td> </tr>'; } } @@ -214,21 +214,21 @@ $ChartDetailRow = DB_fetch_array($ChartDetailsResult); echo '<tr bgcolor="#FDFEEF"> - <td colspan=3><b>' . _('Total for period') . ' ' . $PeriodNo . '</b></td>'; + <td colspan="3"><b>' . _('Total for period') . ' ' . $PeriodNo . '</b></td>'; if ($PeriodTotal < 0 ){ //its a credit balance b/fwd if ($PandLAccount==True) { $RunningTotal = 0; } echo '<td></td> - <td class=number><b>' . locale_number_format(-$PeriodTotal,2) . '</b></td> + <td class="number"><b>' . locale_number_format(-$PeriodTotal,2) . '</b></td> <td></td> </tr>'; } else { //its a debit balance b/fwd if ($PandLAccount==True) { $RunningTotal = 0; } - echo '<td class=number><b>' . locale_number_format($PeriodTotal,2) . '</b></td> - <td colspan=2></td> + echo '<td class="number"><b>' . locale_number_format($PeriodTotal,2) . '</b></td> + <td colspan="2"></td> </tr>'; } $IntegrityReport .= '<br />' . _('Period') . ': ' . $PeriodNo . _('Account movement per transaction') . ': ' . locale_number_format($PeriodTotal,2) . ' ' . _('Movement per ChartDetails record') . ': ' . locale_number_format($ChartDetailRow['actual'],2) . ' ' . _('Period difference') . ': ' . locale_number_format($PeriodTotal -$ChartDetailRow['actual'],3); @@ -290,7 +290,7 @@ } - echo '<tr bgcolor="#FDFEEF"><td colspan=3><b>'; + echo '<tr bgcolor="#FDFEEF"><td colspan="3"><b>'; if ($PandLAccount==True){ echo _('Total Period Movement'); } else { /*its a balance sheet account*/ @@ -299,9 +299,9 @@ echo '</b></td>'; if ($RunningTotal >0){ - echo '<td class=number><b>' . locale_number_format(($RunningTotal),2) . '</b></td><td colspan=2></td></tr>'; + echo '<td class="number"><b>' . locale_number_format(($RunningTotal),2) . '</b></td><td colspan="2"></td></tr>'; }else { - echo '<td></td><td class=number><b>' . locale_number_format((-$RunningTotal),2) . '</b></td><td colspan=2></td></tr>'; + echo '<td></td><td class="number"><b>' . locale_number_format((-$RunningTotal),2) . '</b></td><td colspan="2"></td></tr>'; } echo '</table>'; } /* end of if Show button hit */ Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/PDFCustTransListing.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -19,7 +19,7 @@ echo '<div class="centre"> <p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' ' . _('Customer Transaction Listing'). + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Customer Transaction Listing'). '</p>'; if ($InputError==1){ @@ -31,7 +31,7 @@ echo '<table class="selection"> <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> - <td><input type="text" name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + <td><input type="text" name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td> </tr>'; echo '<tr><td>' . _('Transaction type') . '</td> @@ -46,7 +46,7 @@ </table> <br /> <div class="centre"> - <input type="submit" name="Go" value="' . _('Create PDF') . '"> + <input type="submit" name="Go" value="' . _('Create PDF') . '" /> </div>'; include('includes/footer.inc'); Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/PcClaimExpensesFromTab.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -164,14 +164,14 @@ echo '</select></td></tr>'; echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type="submit" name="Process" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type="submit" name="Process" value="' . _('Accept') . '"><input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; echo '</form>'; } else { // isset($SelectedTabs) - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Petty Cash Claim Entry') - . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Petty Cash Claim Entry') . '" alt="" /> + ' . ' ' . $title . '</p>'; echo '<p><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Select another tab') . '</a></div></p>'; @@ -320,9 +320,9 @@ $_POST['Notes'] = $myrow['notes']; $_POST['Receipt'] = $myrow['receipt']; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; - echo '<input type=hidden name="SelectedIndex" value="' . $SelectedIndex. '">'; - echo '<input type=hidden name="Days" value="' .$Days. '">'; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; + echo '<input type="hidden" name="SelectedIndex" value="' . $SelectedIndex. '" />'; + echo '<input type="hidden" name="Days" value="' .$Days. '" />'; }//end of Get Edit @@ -331,7 +331,7 @@ } echo '<tr><td>' . _('Date Of Expense') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="Date" size=10 maxlength=10 value="' . $_POST['Date']. '"></td></tr>'; + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="Date" size="10" maxlength="10" value="' . $_POST['Date']. '" /></td></tr>'; echo '<tr><td>' . _('Code Of Expense') . ':</td><td><select name="SelectedExpense">'; DB_free_result($result); @@ -363,26 +363,26 @@ } echo '<tr><td>' . _('Amount') . ':</td> - <td><input type="text" class="number" name="amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '"></td></tr>'; + <td><input type="text" class="number" name="amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '" /></td></tr>'; if (!isset($_POST['Notes'])) { $_POST['Notes']=''; } echo '<tr><td>' . _('Notes') . ':</td> - <td><input type="text" name="Notes" size="50" maxlength="49" value="' . $_POST['Notes'] . '"></td></tr>'; + <td><input type="text" name="Notes" size="50" maxlength="49" value="' . $_POST['Notes'] . '" /></td></tr>'; if (!isset($_POST['Receipt'])) { $_POST['Receipt']=''; } echo '<tr><td>' . _('Receipt') . ':</td> - <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '"></td></tr>'; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; - echo '<input type="hidden" name="Days" value="' .$Days. '">'; + <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '" /></td></tr>'; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; + echo '<input type="hidden" name="Days" value="' .$Days. '" />'; echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '" /><input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; echo '</form>'; } // end if user wish to delete Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/PurchData.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -1,4 +1,4 @@ -<?php +<?php /* $Id$*/ include ('includes/session.inc'); @@ -160,7 +160,7 @@ prnMsg(_('There is no purchasing data set up for the part selected'), 'info'); $NoPurchasingData=1; } else if ($StockID != '') { - echo '<table cellpadding=2 class=selection>'; + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<tr><th>' . _('Supplier') . '</th> <th>' . _('Price') . '</th> <th>' . _('Supplier Unit') . '</th> @@ -263,11 +263,11 @@ <tr>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="StockID" value="' . $StockID . '" />'; - echo '<td>' . _('Text in the Supplier') . ' <b>' . _('NAME') . '</b>:</font></td>'; + echo '<td>' . _('Text in the Supplier') . ' <b>' . _('NAME') . '</b>:</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>' . _('Text in Supplier') . ' <b>' . _('CODE') . '</b>:</font></td>'; - echo '<td><input type="text" name="SupplierCode" size=15 maxlength=18></td>'; + echo '<td><b>' . _('OR') . '</b></td>'; + echo '<td>' . _('Text in Supplier') . ' <b>' . _('CODE') . '</b>:</td>'; + echo '<td><input type="text" name="SupplierCode" size="15" maxlength="18" /></td>'; echo '</tr></table><br />'; echo '<div class="centre"> <input type="submit" name="SearchSupplier" value="' . _('Find Suppliers Now') . '" /> @@ -334,7 +334,7 @@ include ('includes/footer.inc'); exit; } else { - // echo '<br /><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('In Units of') . ' ' . $myrow[1] . ' )</font>'; + // echo '<br /><b>' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('In Units of') . ' ' . $myrow[1] . ' )'; } } else { prnMsg(_('Stock Item') . ' - ' . $StockID . ' ' . _('is not defined in the database'), 'warn'); @@ -364,12 +364,12 @@ echo '<tr class="OddTableRows">'; $k++; } - printf('<td><font size=1><input type="submit" name="SupplierID" value="%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> - <td><font size=1>%s</font></td> + printf('<td><input type="submit" name="SupplierID" value="%s" /></td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> </tr>', $myrow['supplierid'], $myrow['suppname'], @@ -440,23 +440,23 @@ } if (isset($_GET['Edit'])) { echo '<tr><td>' . _('Supplier Name') . ':</td> - <td><input type="hidden" name="SupplierID" value="' . $SupplierID . '" />' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" value="' . $myrow['effectivefrom'] . '" /></td> + <td><input type="hidden" name="SupplierID" value="' . $SupplierID . '" />' . $SupplierID . ' - ' . $SuppName . '<input type="hidden" name="WasEffectiveFrom" value="' . $myrow['effectivefrom'] . '" /></td> </tr>'; } else { echo '<tr> <td>' . _('Supplier Name') . ':</td> - <input type="hidden" name="SupplierID" maxlength=10 size=11 value="' . $SupplierID . '" />'; + <input type="hidden" name="SupplierID" maxlength="10" size="11" value="' . $SupplierID . '" />'; if ($SupplierID!='') { echo '<td>'.$SuppName; } if (!isset($SuppName) OR $SuppName = "") { - echo '<font size=1>' . '(' . _('A search facility is available below if necessary') . ')'; + echo '(' . _('A search facility is available below if necessary') . ')'; } else { echo '<td>'.$SuppName; } echo '</td></tr>'; } - echo '<td><input type="hidden" name="StockID" maxlength=10 size=11 value="' . $StockID . '" />'; + echo '<td><input type="hidden" name="StockID" maxlength="10" size="11" value="' . $StockID . '" />'; if (!isset($CurrCode)) { $CurrCode = ''; } @@ -479,11 +479,11 @@ $_POST['MinOrderQty'] = '1'; } echo '<tr><td>' . _('Currency') . ':</td> - <td><input type="hidden" name="CurrCode" . value="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; + <td><input type="hidden" name="CurrCode" . value="' . $CurrCode . '" />' . $CurrCode . '</td></tr>'; echo '<tr><td>' . _('Price') . ' (' . _('in Supplier Currency') . '):</td> <td><input type="text" class="number" name="Price" maxlength="12" size="12" value=' . $_POST['Price'] . ' /></td></tr>'; echo '<tr><td>' . _('Date Updated') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength="10" size="11" value="' . $_POST['EffectiveFrom'] . '"></td></tr>'; + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength="10" size="11" value="' . $_POST['EffectiveFrom'] . '" /></td></tr>'; echo '<tr><td>' . _('Our Unit of Measure') . ':</td>'; if (isset($SupplierID)) { echo '<td>' . $StockUOM . '</td></tr>'; @@ -496,18 +496,18 @@ $_POST['ConversionFactor'] = 1; } echo '<tr><td>' . _('Conversion Factor (to our UOM)') . ':</td> - <td><input type="text" class="number" name="ConversionFactor" maxlength="12" size="12" value=' . $_POST['ConversionFactor'] . '></td></tr>'; + <td><input type="text" class="number" name="ConversionFactor" maxlength="12" size="12" value="' . $_POST['ConversionFactor'] . '" /></td></tr>'; echo '<tr><td>' . _('Supplier Stock Code') . ':</td> - <td><input type="text" name="SupplierCode" maxlength="15" size="15" value="' . $_POST['SupplierCode'] . '"></td></tr>'; + <td><input type="text" name="SupplierCode" maxlength="15" size="15" value="' . $_POST['SupplierCode'] . '" /></td></tr>'; echo '<tr><td>' . _('MinOrderQty') . ':</td> - <td><input type="text" class="number" name="MinOrderQty" maxlength=15 size=15 value="' . $_POST['MinOrderQty'] . '"></td></tr>'; + <td><input type="text" class="number" name="MinOrderQty" maxlength="15" size="15" value="' . $_POST['MinOrderQty'] . '" /></td></tr>'; echo '<tr><td>' . _('Supplier Stock Description') . ':</td> - <td><input type="text" name="SupplierDescription" maxlength="50" size="51" value="' . $_POST['SupplierDescription'] . '"></td></tr>'; + <td><input type="text" name="SupplierDescription" maxlength="50" size="51" value="' . $_POST['SupplierDescription'] . '" /></td></tr>'; if (!isset($_POST['LeadTime']) OR $_POST['LeadTime'] == "") { $_POST['LeadTime'] = 1; } echo '<tr><td>' . _('Lead Time') . ' (' . _('in days from date of order') . '):</td> - <td><input type="text" class=number name="LeadTime" maxlength=4 size=5 value=' . $_POST['LeadTime'] . '></td></tr>'; + <td><input type="text" class=number name="LeadTime" maxlength="4" size="5" value="' . $_POST['LeadTime'] . '" /></td></tr>'; echo '<tr><td>' . _('Preferred Supplier') . ':</td> <td><select name="Preferred">'; if ($_POST['Preferred'] == 1) { @@ -519,9 +519,9 @@ } echo '</select></td></tr></table><br /><div class="centre">'; if (isset($_GET['Edit'])) { - echo '<input type=submit name="UpdateRecord" value="' . _('Update') . '" />'; + echo '<input type="submit" name="UpdateRecord" value="' . _('Update') . '" />'; } else { - echo '<input type=submit name="AddRecord" value="' . _('Add') . '" />'; + echo '<input type="submit" name="AddRecord" value="' . _('Add') . '" />'; } echo '</div>'; echo '<div class="centre">'; Modified: trunk/SelectCompletedOrder.php =================================================================== --- trunk/SelectCompletedOrder.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/SelectCompletedOrder.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -8,8 +8,8 @@ include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . - '" alt="" />' . ' ' . _('Search Sales Orders') . '</p>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" /> + ' . ' ' . _('Search Sales Orders') . '</p>'; echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -60,8 +60,8 @@ } if (isset($OrderNumber)) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Sales Order') . - '" alt="" />' . ' ' . _('Order Number') . ' - ' . $OrderNumber . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Sales Order') . '" alt="" /> + ' . ' ' . _('Order Number') . ' - ' . $OrderNumber . '</p>'; if (mb_strlen($_SESSION['UserBranch'])>1){ echo _('For customer') . ': ' . $SelectedCustomer; echo '<input type="hidden" name="SelectedCustomer" value="' . $SelectedCustomer .'" />'; @@ -506,10 +506,10 @@ ORDER BY categorydescription",$db); echo '<br />'; - echo '<div class="page_help_text"><font size=1>' . _('To search for sales orders for a specific part use the part selection facilities below') . ' </font></div>'; + echo '<div class="page_help_text">' . _('To search for sales orders for a specific part use the part selection facilities below') . '</div>'; echo '<br /> <table class="selection">'; - echo '<tr><td><font size="1">' . _('Select a stock category') . ':</font>'; + echo '<tr><td>' . _('Select a stock category') . ':'; echo '<select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { @@ -521,15 +521,15 @@ } echo '</select> - <td><font size="1">' . _('Enter text extracts in the description') . ':</font></td> + <td>' . _('Enter text extracts in the description') . ':</td> <td><input type="text" name="Keywords" size="20" maxlength="25" /></td> </tr> <tr> <td></td> - <td><font size=3><b> ' ._('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . ':</font></td> + <td><b> ' ._('OR') . ' </b>' . _('Enter extract of the Stock Code') . ':</td> <td><input type="text" name="StockCode" size="15" maxlength="18" /></td> </tr> - <tr><td colspan=4><div class="centre"><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '" />'; + <tr><td colspan="4"><div class="centre"><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '" />'; if (count($_SESSION['AllowedPageSecurityTokens'])>1){ echo '<input type="submit" name="ResetPart" value="' . _('Show All') . '" /></div>'; @@ -569,12 +569,12 @@ $k++; } - printf('<td><font size=1><input type="submit" name="SelectedStockItem" value="%s" /></font></td> - <td><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td><font size=1>%s</font></td></tr>', + printf('<td><input type="submit" name="SelectedStockItem" value="%s" /></td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td>%s</td></tr>', $myrow['stockid'], $myrow['description'], locale_number_format($myrow['qoh'],$myrow['decimalplaces']), Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/StockCostUpdate.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -17,8 +17,9 @@ echo '<a href="' . $rootpath . '/SelectProduct.php">' . _('Back to Items') . '</a><br />'; -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Inventory Adjustment') . '" alt="" />' . ' ' . $title . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory Adjustment') . '" alt="" /> + ' . ' ' . $title . '</p>'; if (isset($_POST['UpdateData'])){ @@ -157,7 +158,7 @@ } else { if ($myrow['mbflag']=='M'){ - echo '<input type=hidden name="MaterialCost" value=' . $myrow['materialcost'] . '>'; + echo '<input type="hidden" name="MaterialCost" value=' . $myrow['materialcost'] . ' />'; echo '<tr><td>' . _('Standard Material Cost Per Unit') .':</td> <td class="number">' . locale_number_format($myrow['materialcost'],4) . '</td> </tr>'; @@ -175,8 +176,8 @@ <td class="number"><input type="text" class="number" name="MaterialCost" value="' . locale_number_format($myrow['materialcost'],4) . '" /></td> </tr>'; } else { - echo '<input type="hidden" name="LabourCost" value=0>'; - echo '<input type="hidden" name="OverheadCost" value=0>'; + echo '<input type="hidden" name="LabourCost" value=0 />'; + echo '<input type="hidden" name="OverheadCost" value=0 />'; } echo '</table> <br /> Modified: trunk/StockLocStatus.php =================================================================== --- trunk/StockLocStatus.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/StockLocStatus.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -24,9 +24,8 @@ $resultStkLocs = DB_query($sql,$db); echo '<p class="page_title_text"> - <img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title.' - </p>'; + <img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' + </p>'; echo '<table class="selection"> <tr><td>' . _('From Stock Location') . ':</td> Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/StockTransfers.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -24,9 +24,9 @@ if (isset($_POST['CheckCode'])) { echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . - '" alt="" />' . ' ' . _('Select Item to Transfer') . ' - </p>'; + <img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" /> + ' . ' ' . _('Select Item to Transfer') . ' + </p>'; if (mb_strlen($_POST['StockText'])>0) { $sql="SELECT stockid, @@ -444,9 +444,8 @@ } echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . - '" alt="" />' . ' ' . $title . ' - </p>'; + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . $title . ' + </p>'; echo '<form action="'. htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -471,7 +470,7 @@ } else { echo '<input type="text" name="StockCode" size="21" value="" maxlength="20" />'; } -echo '</td><td><input type=submit name="CheckCode" value="'._('Check Part').'" /></td></tr>'; +echo '</td><td><input type="submit" name="CheckCode" value="'._('Check Part').'" /></td></tr>'; if (isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription) AND mb_strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ @@ -536,9 +535,9 @@ echo '<td class="number"><input type="hidden" name="Quantity" value=' . locale_number_format($_SESSION['Transfer']->TransferItem[0]->Quantity) . '/><a href="' . $rootpath .'/StockTransferControlled.php?StockLocationFrom='.$_SESSION['Transfer']->StockLocationFrom.'">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; } elseif (isset($_SESSION['Transfer']->TransferItem[0]->Controlled)){ - echo '<td><input type="text" class="number" name="Quantity" size="12" maxlength="12" value=' . locale_number_format($_SESSION['Transfer']->TransferItem[0]->Quantity) . '></td></tr>'; + echo '<td><input type="text" class="number" name="Quantity" size="12" maxlength="12" value="' . locale_number_format($_SESSION['Transfer']->TransferItem[0]->Quantity) . '" /></td></tr>'; } else { - echo '<td><input type="text" class="number" name="Quantity" size="12" maxlength="12" value="0"></td> + echo '<td><input type="text" class="number" name="Quantity" size="12" maxlength="12" value="0" /></td> </tr>'; } Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/SuppLoginSetup.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -133,7 +133,7 @@ } echo '<tr> <td>' . _('Password') . ':</td> - <td><input type="password" name="Password" size="22" maxlength="20" value="' . $_POST['Password'] . '"> + <td><input type="password" name="Password" size="22" maxlength="20" value="' . $_POST['Password'] . '" /> </tr> <tr> <td>' . _('Full Name') . ':</td> Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/SupplierInvoice.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -26,7 +26,8 @@ $SupplierName=$_SESSION['SuppTrans']->SupplierName; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Supplier Invoice') . '" alt="">' . ' ' . _('Enter Supplier Invoice:') . ' ' . $SupplierName; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Supplier Invoice') . '" alt="" /> + ' . ' ' . _('Enter Supplier Invoice:') . ' ' . $SupplierName; echo '</p>'; if (isset($_GET['SupplierID']) and $_GET['SupplierID']!=''){ @@ -252,7 +253,7 @@ echo '<tr> <td>' . _('Supplier Invoice Reference') . ':</td> - <td><input type="text" size="20" maxlength="20" name="SuppReference" value="' . $_SESSION['SuppTrans']->SuppReference . '"></td>'; + <td><input type="text" size="20" maxlength="20" name="SuppReference" value="' . $_SESSION['SuppTrans']->SuppReference . '" /></td>'; if (!isset($_SESSION['SuppTrans']->TranDate)){ $_SESSION['SuppTrans']->TranDate= Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))); @@ -491,7 +492,7 @@ <table class="selection"> <tr> <td>' . _('Amount in supplier currency') . ':</td> - <td colspan=2 class="number"><input type="text" size="12" maxlength="10" name="OvAmount" value="' . locale_number_format( $_SESSION['SuppTrans']->OvAmount,$_SESSION['SuppTrans']->CurrDecimalPlaces) . '" /></td> + <td colspan="2" class="number"><input type="text" size="12" maxlength="10" name="OvAmount" value="' . locale_number_format( $_SESSION['SuppTrans']->OvAmount,$_SESSION['SuppTrans']->CurrDecimalPlaces) . '" /></td> </tr>'; } Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/WorkOrderEntry.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -651,12 +651,11 @@ $k=1; } - printf('<td><font size="1">%s</font></td> - <td><font size="1">%s</font></td> - <td><font size="1">%s</font></td> + printf('<td>%s</td> <td>%s</td> - <td><font size=1><a href="%s">' - . _('Add to Work Order') . '</a></font></td> + <td>%s</td> + <td>%s</td> + <td><a href="%s">' . _('Add to Work Order') . '</a></td> </tr>', $myrow['stockid'], $myrow['description'], Modified: trunk/Z_ImportGLAccountGroups.php =================================================================== --- trunk/Z_ImportGLAccountGroups.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/Z_ImportGLAccountGroups.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -69,8 +69,8 @@ echo '<form name="ItemForm" enctype="multipart/form-data" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' .SID .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table><tr><td>'._('File to import').'</td>'. - '<td><input type="file" id="ImportFile" name="ImportFile"></td></tr></table>'; - echo '<div class="centre"><input type="submit" name="update" value="Process"></div>'; + '<td><input type="file" id="ImportFile" name="ImportFile" /></td></tr></table>'; + echo '<div class="centre"><input type="submit" name="update" value="Process" /></div>'; echo '</form>'; } Modified: trunk/Z_ImportPartCodes.php =================================================================== --- trunk/Z_ImportPartCodes.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/Z_ImportPartCodes.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -80,8 +80,8 @@ echo '<form name="ItemForm" enctype="multipart/form-data" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' .SID .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table><tr><td>'._('File to import').'</td>'. - '<td><input type="file" id="ImportFile" name="ImportFile"></td></tr></table>'; - echo '<div class="centre"><input type="submit" name="update" value="Process"></div>'; + '<td><input type="file" id="ImportFile" name="ImportFile" /></td></tr></table>'; + echo '<div class="centre"><input type="submit" name="update" value="Process" /></div>'; echo '</form>'; } } Modified: trunk/Z_poEditLangModule.php =================================================================== --- trunk/Z_poEditLangModule.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/Z_poEditLangModule.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -152,8 +152,8 @@ } else { echo '<tr>'; echo '<td VALIGN="top"><I>' . $DefaultText[$i] . '</I></td>'; - echo '<td VALIGN="top"><input type="text" size="60" name="moduletext_' . $msgstr[$i] . '" VALUE="' . $ModuleText[$i] . '"></td>'; - echo '<td VALIGN="top">' . $AlsoIn[$i] . '<input type="hidden" name="msgstr_' . $msgstr[$i] . '" VALUE="' . $msgstr[$i] . '"></td>'; + echo '<td VALIGN="top"><input type="text" size="60" name="moduletext_' . $msgstr[$i] . '" VALUE="' . $ModuleText[$i] . '" /></td>'; + echo '<td VALIGN="top">' . $AlsoIn[$i] . '<input type="hidden" name="msgstr_' . $msgstr[$i] . '" VALUE="' . $msgstr[$i] . '" /></td>'; echo '</tr>'; echo '<tr><th colspan="3"></th></tr>'; } @@ -165,8 +165,8 @@ echo '</td></tr>'; echo '</table>'; echo '<br /><div class="centre">'; - echo '<input type="Submit" name="submit" VALUE="' . _('Modify') . '"> '; - echo '<input type="hidden" name="module" VALUE="' . $_POST['module'] . '">'; + echo '<input type="submit" name="submit" VALUE="' . _('Modify') . '" /> '; + echo '<input type="hidden" name="module" VALUE="' . $_POST['module'] . '" />'; echo '</form>'; echo '</div>'; @@ -229,8 +229,8 @@ echo '</tr></table>'; echo '<br />'; echo '<div class="centre">'; - echo '<input type="Submit" name="proceed" VALUE="' . _('Proceed') . '"> '; - echo '<br /><br /><input type="Submit" name="ReMergePO" VALUE="' . _('Refresh messages with latest strings') . '">'; + echo '<input type="submit" name="proceed" VALUE="' . _('Proceed') . '" /> '; + echo '<br /><br /><input type="submit" name="ReMergePO" VALUE="' . _('Refresh messages with latest strings') . '">'; echo '</div>'; echo '</form>'; echo '</td></tr></table>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/doc/Change.log 2012-01-21 15:41:50 UTC (rev 4827) @@ -1,5 +1,6 @@ webERP Change Log +21/1/12 Vitaly: xhtml fixes in multiple files. 20/1/12 Phil: Fixed GetStockPrice API function for effectivty dates 20/1/12 Vitaly: Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php 20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-21 15:41:58
|
Revision: 4827 http://web-erp.svn.sourceforge.net/web-erp/?rev=4827&view=rev Author: vvs2012 Date: 2012-01-21 15:41:50 +0000 (Sat, 21 Jan 2012) Log Message: ----------- xhtml fixes in multiple files Modified Paths: -------------- trunk/AuditTrail.php trunk/FixedAssetDepreciation.php trunk/FixedAssetLocations.php trunk/GLAccountInquiry.php trunk/PDFCustTransListing.php trunk/PcClaimExpensesFromTab.php trunk/PurchData.php trunk/SelectCompletedOrder.php trunk/StockCostUpdate.php trunk/StockLocStatus.php trunk/StockTransfers.php trunk/SuppLoginSetup.php trunk/SupplierInvoice.php trunk/WorkOrderEntry.php trunk/Z_ImportGLAccountGroups.php trunk/Z_ImportPartCodes.php trunk/Z_poEditLangModule.php trunk/doc/Change.log Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/AuditTrail.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -39,9 +39,9 @@ echo '<table class="selection">'; echo '<tr><td>'. _('From Date') . ' ' . $_SESSION['DefaultDateFormat'] .'</td> - <td><input tabindex="1" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="11" maxlength="10" value=' .$_POST['FromDate'].'></td></tr>'; + <td><input tabindex="1" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="11" maxlength="10" value="' .$_POST['FromDate']. '" /></td></tr>'; echo '<tr><td>'. _('To Date') . ' ' . $_SESSION['DefaultDateFormat'] .'</td> - <td><input tabindex="2" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="11" maxlength="10" value=' . $_POST['ToDate'] . '></td></tr>'; + <td><input tabindex="2" type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="11" maxlength="10" value="' . $_POST['ToDate'] . '" /></td></tr>'; // Show user selections echo '<tr><td>'. _('User ID'). '</td> @@ -74,11 +74,11 @@ } // Show the text echo '<tr><td>' . _('Containing text') . ':</td>'; -echo '<td><input type="text" name="ContainingText" size=20 maxlength=20 value="'. $_POST['ContainingText'] . '"></td></tr>'; +echo '<td><input type="text" name="ContainingText" size="20" maxlength="20" value="'. $_POST['ContainingText'] . '" /></td></tr>'; echo '</table><br />'; -echo '<div class="centre"><input tabindex="5" type="submit" name="View" value="' . _('View') . '"></div>'; +echo '<div class="centre"><input tabindex="5" type="submit" name="View" value="' . _('View') . '" /></div>'; echo '</form>'; // View the audit trail Modified: trunk/FixedAssetDepreciation.php =================================================================== --- trunk/FixedAssetDepreciation.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/FixedAssetDepreciation.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -109,11 +109,11 @@ while ($AssetRow=DB_fetch_array($AssetsResult)) { if ($AssetCategoryDescription != $AssetRow['categorydescription'] OR $AssetCategoryDescription =='0'){ if ($AssetCategoryDescription !='0'){ //then print totals - echo '<tr><th colspan=3 align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> + echo '<tr><th colspan="3" align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> <th class="number">' . locale_number_format($TotalCategoryCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th class="number">' . locale_number_format($TotalCategoryAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> <th class="number">' . locale_number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th colspan=2></th> + <th colspan="2"></th> <th class="number">' . locale_number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr>'; } Modified: trunk/FixedAssetLocations.php =================================================================== --- trunk/FixedAssetLocations.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/FixedAssetLocations.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -115,10 +115,10 @@ <tr> <th style="text-align:left">'._('Location ID').'</th>'; if (isset($_GET['SelectedLocation'])) { - echo '<input type="hidden" name=LocationID value="'.$LocationID.'" />'; + echo '<input type="hidden" name="LocationID" value="'.$LocationID.'" />'; echo '<td>'.$LocationID.'</td>'; } else { - echo '<td><input type="text" name=LocationID size=6 value="'.$LocationID.'" /></td> + echo '<td><input type="text" name="LocationID" size="6" value="'.$LocationID.'" /></td> </tr>'; } Modified: trunk/GLAccountInquiry.php =================================================================== --- trunk/GLAccountInquiry.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/GLAccountInquiry.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -74,7 +74,7 @@ } } echo '</select></td></tr><table>'; -echo '<p><div class="centre"><input type=submit name="Show" value="'._('Show Account Transactions').'"></div></form>'; +echo '<p><div class="centre"><input type="submit" name="Show" value="'._('Show Account Transactions').'" /></div></form>'; /* End of the Form rest of script is what happens if the show button is hit*/ @@ -145,7 +145,7 @@ echo '<br /><table class=selection>'; - echo '<tr><th colspan=8><b>' ._('Transactions for account').' '.$SelectedAccount. ' - '. $SelectedAccountName.'</b></th></tr>'; + echo '<tr><th colspan="8"><b>' ._('Transactions for account').' '.$SelectedAccount. ' - '. $SelectedAccountName.'</b></th></tr>'; $TableHeader = '<tr> <th>' . _('Type') . '</th> <th>' . _('Number') . '</th> @@ -178,16 +178,16 @@ $RunningTotal =$ChartDetailRow['bfwd']; if ($RunningTotal < 0 ){ //its a credit balance b/fwd echo '<tr bgcolor="#FDFEEF"> - <td colspan=3><b>' . _('Brought Forward Balance') . '</b><td> + <td colspan="3"><b>' . _('Brought Forward Balance') . '</b><td> </td></td> - <td class=number><b>' . locale_number_format(-$RunningTotal,2) . '</b></td> + <td class="number"><b>' . locale_number_format(-$RunningTotal,2) . '</b></td> <td></td> </tr>'; } else { //its a debit balance b/fwd echo '<tr bgcolor="#FDFEEF"> - <td colspan=3><b>' . _('Brought Forward Balance') . '</b></td> - <td class=number><b>' . locale_number_format($RunningTotal,2) . '</b></td> - <td colspan=2></td> + <td colspan="3"><b>' . _('Brought Forward Balance') . '</b></td> + <td class="number"><b>' . locale_number_format($RunningTotal,2) . '</b></td> + <td colspan="2"></td> </tr>'; } } @@ -214,21 +214,21 @@ $ChartDetailRow = DB_fetch_array($ChartDetailsResult); echo '<tr bgcolor="#FDFEEF"> - <td colspan=3><b>' . _('Total for period') . ' ' . $PeriodNo . '</b></td>'; + <td colspan="3"><b>' . _('Total for period') . ' ' . $PeriodNo . '</b></td>'; if ($PeriodTotal < 0 ){ //its a credit balance b/fwd if ($PandLAccount==True) { $RunningTotal = 0; } echo '<td></td> - <td class=number><b>' . locale_number_format(-$PeriodTotal,2) . '</b></td> + <td class="number"><b>' . locale_number_format(-$PeriodTotal,2) . '</b></td> <td></td> </tr>'; } else { //its a debit balance b/fwd if ($PandLAccount==True) { $RunningTotal = 0; } - echo '<td class=number><b>' . locale_number_format($PeriodTotal,2) . '</b></td> - <td colspan=2></td> + echo '<td class="number"><b>' . locale_number_format($PeriodTotal,2) . '</b></td> + <td colspan="2"></td> </tr>'; } $IntegrityReport .= '<br />' . _('Period') . ': ' . $PeriodNo . _('Account movement per transaction') . ': ' . locale_number_format($PeriodTotal,2) . ' ' . _('Movement per ChartDetails record') . ': ' . locale_number_format($ChartDetailRow['actual'],2) . ' ' . _('Period difference') . ': ' . locale_number_format($PeriodTotal -$ChartDetailRow['actual'],3); @@ -290,7 +290,7 @@ } - echo '<tr bgcolor="#FDFEEF"><td colspan=3><b>'; + echo '<tr bgcolor="#FDFEEF"><td colspan="3"><b>'; if ($PandLAccount==True){ echo _('Total Period Movement'); } else { /*its a balance sheet account*/ @@ -299,9 +299,9 @@ echo '</b></td>'; if ($RunningTotal >0){ - echo '<td class=number><b>' . locale_number_format(($RunningTotal),2) . '</b></td><td colspan=2></td></tr>'; + echo '<td class="number"><b>' . locale_number_format(($RunningTotal),2) . '</b></td><td colspan="2"></td></tr>'; }else { - echo '<td></td><td class=number><b>' . locale_number_format((-$RunningTotal),2) . '</b></td><td colspan=2></td></tr>'; + echo '<td></td><td class="number"><b>' . locale_number_format((-$RunningTotal),2) . '</b></td><td colspan="2"></td></tr>'; } echo '</table>'; } /* end of if Show button hit */ Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/PDFCustTransListing.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -19,7 +19,7 @@ echo '<div class="centre"> <p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' ' . _('Customer Transaction Listing'). + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . _('Customer Transaction Listing'). '</p>'; if ($InputError==1){ @@ -31,7 +31,7 @@ echo '<table class="selection"> <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> - <td><input type="text" name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + <td><input type="text" name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td> </tr>'; echo '<tr><td>' . _('Transaction type') . '</td> @@ -46,7 +46,7 @@ </table> <br /> <div class="centre"> - <input type="submit" name="Go" value="' . _('Create PDF') . '"> + <input type="submit" name="Go" value="' . _('Create PDF') . '" /> </div>'; include('includes/footer.inc'); Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/PcClaimExpensesFromTab.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -164,14 +164,14 @@ echo '</select></td></tr>'; echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type="submit" name="Process" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type="submit" name="Process" value="' . _('Accept') . '"><input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; echo '</form>'; } else { // isset($SelectedTabs) - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Petty Cash Claim Entry') - . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Petty Cash Claim Entry') . '" alt="" /> + ' . ' ' . $title . '</p>'; echo '<p><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Select another tab') . '</a></div></p>'; @@ -320,9 +320,9 @@ $_POST['Notes'] = $myrow['notes']; $_POST['Receipt'] = $myrow['receipt']; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; - echo '<input type=hidden name="SelectedIndex" value="' . $SelectedIndex. '">'; - echo '<input type=hidden name="Days" value="' .$Days. '">'; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; + echo '<input type="hidden" name="SelectedIndex" value="' . $SelectedIndex. '" />'; + echo '<input type="hidden" name="Days" value="' .$Days. '" />'; }//end of Get Edit @@ -331,7 +331,7 @@ } echo '<tr><td>' . _('Date Of Expense') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="Date" size=10 maxlength=10 value="' . $_POST['Date']. '"></td></tr>'; + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="Date" size="10" maxlength="10" value="' . $_POST['Date']. '" /></td></tr>'; echo '<tr><td>' . _('Code Of Expense') . ':</td><td><select name="SelectedExpense">'; DB_free_result($result); @@ -363,26 +363,26 @@ } echo '<tr><td>' . _('Amount') . ':</td> - <td><input type="text" class="number" name="amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '"></td></tr>'; + <td><input type="text" class="number" name="amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '" /></td></tr>'; if (!isset($_POST['Notes'])) { $_POST['Notes']=''; } echo '<tr><td>' . _('Notes') . ':</td> - <td><input type="text" name="Notes" size="50" maxlength="49" value="' . $_POST['Notes'] . '"></td></tr>'; + <td><input type="text" name="Notes" size="50" maxlength="49" value="' . $_POST['Notes'] . '" /></td></tr>'; if (!isset($_POST['Receipt'])) { $_POST['Receipt']=''; } echo '<tr><td>' . _('Receipt') . ':</td> - <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '"></td></tr>'; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; - echo '<input type="hidden" name="Days" value="' .$Days. '">'; + <td><input type="text" name="Receipt" size="50" maxlength="49" value="' . $_POST['Receipt'] . '" /></td></tr>'; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; + echo '<input type="hidden" name="Days" value="' .$Days. '" />'; echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '"><input type=submit name="Cancel" value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '" /><input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; echo '</form>'; } // end if user wish to delete Modified: trunk/PurchData.php =================================================================== --- trunk/PurchData.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/PurchData.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -1,4 +1,4 @@ -<?php +<?php /* $Id$*/ include ('includes/session.inc'); @@ -160,7 +160,7 @@ prnMsg(_('There is no purchasing data set up for the part selected'), 'info'); $NoPurchasingData=1; } else if ($StockID != '') { - echo '<table cellpadding=2 class=selection>'; + echo '<table cellpadding="2" class="selection">'; $TableHeader = '<tr><th>' . _('Supplier') . '</th> <th>' . _('Price') . '</th> <th>' . _('Supplier Unit') . '</th> @@ -263,11 +263,11 @@ <tr>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="StockID" value="' . $StockID . '" />'; - echo '<td>' . _('Text in the Supplier') . ' <b>' . _('NAME') . '</b>:</font></td>'; + echo '<td>' . _('Text in the Supplier') . ' <b>' . _('NAME') . '</b>:</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>' . _('Text in Supplier') . ' <b>' . _('CODE') . '</b>:</font></td>'; - echo '<td><input type="text" name="SupplierCode" size=15 maxlength=18></td>'; + echo '<td><b>' . _('OR') . '</b></td>'; + echo '<td>' . _('Text in Supplier') . ' <b>' . _('CODE') . '</b>:</td>'; + echo '<td><input type="text" name="SupplierCode" size="15" maxlength="18" /></td>'; echo '</tr></table><br />'; echo '<div class="centre"> <input type="submit" name="SearchSupplier" value="' . _('Find Suppliers Now') . '" /> @@ -334,7 +334,7 @@ include ('includes/footer.inc'); exit; } else { - // echo '<br /><font color=BLUE size=3><b>' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('In Units of') . ' ' . $myrow[1] . ' )</font>'; + // echo '<br /><b>' . $StockID . ' - ' . $myrow[0] . ' </b> (' . _('In Units of') . ' ' . $myrow[1] . ' )'; } } else { prnMsg(_('Stock Item') . ' - ' . $StockID . ' ' . _('is not defined in the database'), 'warn'); @@ -364,12 +364,12 @@ echo '<tr class="OddTableRows">'; $k++; } - printf('<td><font size=1><input type="submit" name="SupplierID" value="%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> - <td><font size=1>%s</font></td> + printf('<td><input type="submit" name="SupplierID" value="%s" /></td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> </tr>', $myrow['supplierid'], $myrow['suppname'], @@ -440,23 +440,23 @@ } if (isset($_GET['Edit'])) { echo '<tr><td>' . _('Supplier Name') . ':</td> - <td><input type="hidden" name="SupplierID" value="' . $SupplierID . '" />' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" value="' . $myrow['effectivefrom'] . '" /></td> + <td><input type="hidden" name="SupplierID" value="' . $SupplierID . '" />' . $SupplierID . ' - ' . $SuppName . '<input type="hidden" name="WasEffectiveFrom" value="' . $myrow['effectivefrom'] . '" /></td> </tr>'; } else { echo '<tr> <td>' . _('Supplier Name') . ':</td> - <input type="hidden" name="SupplierID" maxlength=10 size=11 value="' . $SupplierID . '" />'; + <input type="hidden" name="SupplierID" maxlength="10" size="11" value="' . $SupplierID . '" />'; if ($SupplierID!='') { echo '<td>'.$SuppName; } if (!isset($SuppName) OR $SuppName = "") { - echo '<font size=1>' . '(' . _('A search facility is available below if necessary') . ')'; + echo '(' . _('A search facility is available below if necessary') . ')'; } else { echo '<td>'.$SuppName; } echo '</td></tr>'; } - echo '<td><input type="hidden" name="StockID" maxlength=10 size=11 value="' . $StockID . '" />'; + echo '<td><input type="hidden" name="StockID" maxlength="10" size="11" value="' . $StockID . '" />'; if (!isset($CurrCode)) { $CurrCode = ''; } @@ -479,11 +479,11 @@ $_POST['MinOrderQty'] = '1'; } echo '<tr><td>' . _('Currency') . ':</td> - <td><input type="hidden" name="CurrCode" . value="' . $CurrCode . '">' . $CurrCode . '</td></tr>'; + <td><input type="hidden" name="CurrCode" . value="' . $CurrCode . '" />' . $CurrCode . '</td></tr>'; echo '<tr><td>' . _('Price') . ' (' . _('in Supplier Currency') . '):</td> <td><input type="text" class="number" name="Price" maxlength="12" size="12" value=' . $_POST['Price'] . ' /></td></tr>'; echo '<tr><td>' . _('Date Updated') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength="10" size="11" value="' . $_POST['EffectiveFrom'] . '"></td></tr>'; + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength="10" size="11" value="' . $_POST['EffectiveFrom'] . '" /></td></tr>'; echo '<tr><td>' . _('Our Unit of Measure') . ':</td>'; if (isset($SupplierID)) { echo '<td>' . $StockUOM . '</td></tr>'; @@ -496,18 +496,18 @@ $_POST['ConversionFactor'] = 1; } echo '<tr><td>' . _('Conversion Factor (to our UOM)') . ':</td> - <td><input type="text" class="number" name="ConversionFactor" maxlength="12" size="12" value=' . $_POST['ConversionFactor'] . '></td></tr>'; + <td><input type="text" class="number" name="ConversionFactor" maxlength="12" size="12" value="' . $_POST['ConversionFactor'] . '" /></td></tr>'; echo '<tr><td>' . _('Supplier Stock Code') . ':</td> - <td><input type="text" name="SupplierCode" maxlength="15" size="15" value="' . $_POST['SupplierCode'] . '"></td></tr>'; + <td><input type="text" name="SupplierCode" maxlength="15" size="15" value="' . $_POST['SupplierCode'] . '" /></td></tr>'; echo '<tr><td>' . _('MinOrderQty') . ':</td> - <td><input type="text" class="number" name="MinOrderQty" maxlength=15 size=15 value="' . $_POST['MinOrderQty'] . '"></td></tr>'; + <td><input type="text" class="number" name="MinOrderQty" maxlength="15" size="15" value="' . $_POST['MinOrderQty'] . '" /></td></tr>'; echo '<tr><td>' . _('Supplier Stock Description') . ':</td> - <td><input type="text" name="SupplierDescription" maxlength="50" size="51" value="' . $_POST['SupplierDescription'] . '"></td></tr>'; + <td><input type="text" name="SupplierDescription" maxlength="50" size="51" value="' . $_POST['SupplierDescription'] . '" /></td></tr>'; if (!isset($_POST['LeadTime']) OR $_POST['LeadTime'] == "") { $_POST['LeadTime'] = 1; } echo '<tr><td>' . _('Lead Time') . ' (' . _('in days from date of order') . '):</td> - <td><input type="text" class=number name="LeadTime" maxlength=4 size=5 value=' . $_POST['LeadTime'] . '></td></tr>'; + <td><input type="text" class=number name="LeadTime" maxlength="4" size="5" value="' . $_POST['LeadTime'] . '" /></td></tr>'; echo '<tr><td>' . _('Preferred Supplier') . ':</td> <td><select name="Preferred">'; if ($_POST['Preferred'] == 1) { @@ -519,9 +519,9 @@ } echo '</select></td></tr></table><br /><div class="centre">'; if (isset($_GET['Edit'])) { - echo '<input type=submit name="UpdateRecord" value="' . _('Update') . '" />'; + echo '<input type="submit" name="UpdateRecord" value="' . _('Update') . '" />'; } else { - echo '<input type=submit name="AddRecord" value="' . _('Add') . '" />'; + echo '<input type="submit" name="AddRecord" value="' . _('Add') . '" />'; } echo '</div>'; echo '<div class="centre">'; Modified: trunk/SelectCompletedOrder.php =================================================================== --- trunk/SelectCompletedOrder.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/SelectCompletedOrder.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -8,8 +8,8 @@ include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . - '" alt="" />' . ' ' . _('Search Sales Orders') . '</p>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" /> + ' . ' ' . _('Search Sales Orders') . '</p>'; echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -60,8 +60,8 @@ } if (isset($OrderNumber)) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Sales Order') . - '" alt="" />' . ' ' . _('Order Number') . ' - ' . $OrderNumber . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Sales Order') . '" alt="" /> + ' . ' ' . _('Order Number') . ' - ' . $OrderNumber . '</p>'; if (mb_strlen($_SESSION['UserBranch'])>1){ echo _('For customer') . ': ' . $SelectedCustomer; echo '<input type="hidden" name="SelectedCustomer" value="' . $SelectedCustomer .'" />'; @@ -506,10 +506,10 @@ ORDER BY categorydescription",$db); echo '<br />'; - echo '<div class="page_help_text"><font size=1>' . _('To search for sales orders for a specific part use the part selection facilities below') . ' </font></div>'; + echo '<div class="page_help_text">' . _('To search for sales orders for a specific part use the part selection facilities below') . '</div>'; echo '<br /> <table class="selection">'; - echo '<tr><td><font size="1">' . _('Select a stock category') . ':</font>'; + echo '<tr><td>' . _('Select a stock category') . ':'; echo '<select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { @@ -521,15 +521,15 @@ } echo '</select> - <td><font size="1">' . _('Enter text extracts in the description') . ':</font></td> + <td>' . _('Enter text extracts in the description') . ':</td> <td><input type="text" name="Keywords" size="20" maxlength="25" /></td> </tr> <tr> <td></td> - <td><font size=3><b> ' ._('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . ':</font></td> + <td><b> ' ._('OR') . ' </b>' . _('Enter extract of the Stock Code') . ':</td> <td><input type="text" name="StockCode" size="15" maxlength="18" /></td> </tr> - <tr><td colspan=4><div class="centre"><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '" />'; + <tr><td colspan="4"><div class="centre"><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '" />'; if (count($_SESSION['AllowedPageSecurityTokens'])>1){ echo '<input type="submit" name="ResetPart" value="' . _('Show All') . '" /></div>'; @@ -569,12 +569,12 @@ $k++; } - printf('<td><font size=1><input type="submit" name="SelectedStockItem" value="%s" /></font></td> - <td><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td><font size=1>%s</font></td></tr>', + printf('<td><input type="submit" name="SelectedStockItem" value="%s" /></td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td>%s</td></tr>', $myrow['stockid'], $myrow['description'], locale_number_format($myrow['qoh'],$myrow['decimalplaces']), Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/StockCostUpdate.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -17,8 +17,9 @@ echo '<a href="' . $rootpath . '/SelectProduct.php">' . _('Back to Items') . '</a><br />'; -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Inventory Adjustment') . '" alt="" />' . ' ' . $title . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory Adjustment') . '" alt="" /> + ' . ' ' . $title . '</p>'; if (isset($_POST['UpdateData'])){ @@ -157,7 +158,7 @@ } else { if ($myrow['mbflag']=='M'){ - echo '<input type=hidden name="MaterialCost" value=' . $myrow['materialcost'] . '>'; + echo '<input type="hidden" name="MaterialCost" value=' . $myrow['materialcost'] . ' />'; echo '<tr><td>' . _('Standard Material Cost Per Unit') .':</td> <td class="number">' . locale_number_format($myrow['materialcost'],4) . '</td> </tr>'; @@ -175,8 +176,8 @@ <td class="number"><input type="text" class="number" name="MaterialCost" value="' . locale_number_format($myrow['materialcost'],4) . '" /></td> </tr>'; } else { - echo '<input type="hidden" name="LabourCost" value=0>'; - echo '<input type="hidden" name="OverheadCost" value=0>'; + echo '<input type="hidden" name="LabourCost" value=0 />'; + echo '<input type="hidden" name="OverheadCost" value=0 />'; } echo '</table> <br /> Modified: trunk/StockLocStatus.php =================================================================== --- trunk/StockLocStatus.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/StockLocStatus.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -24,9 +24,8 @@ $resultStkLocs = DB_query($sql,$db); echo '<p class="page_title_text"> - <img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title.' - </p>'; + <img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' + </p>'; echo '<table class="selection"> <tr><td>' . _('From Stock Location') . ':</td> Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/StockTransfers.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -24,9 +24,9 @@ if (isset($_POST['CheckCode'])) { echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . - '" alt="" />' . ' ' . _('Select Item to Transfer') . ' - </p>'; + <img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" /> + ' . ' ' . _('Select Item to Transfer') . ' + </p>'; if (mb_strlen($_POST['StockText'])>0) { $sql="SELECT stockid, @@ -444,9 +444,8 @@ } echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . - '" alt="" />' . ' ' . $title . ' - </p>'; + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . $title . ' + </p>'; echo '<form action="'. htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -471,7 +470,7 @@ } else { echo '<input type="text" name="StockCode" size="21" value="" maxlength="20" />'; } -echo '</td><td><input type=submit name="CheckCode" value="'._('Check Part').'" /></td></tr>'; +echo '</td><td><input type="submit" name="CheckCode" value="'._('Check Part').'" /></td></tr>'; if (isset($_SESSION['Transfer']->TransferItem[0]->ItemDescription) AND mb_strlen($_SESSION['Transfer']->TransferItem[0]->ItemDescription)>1){ @@ -536,9 +535,9 @@ echo '<td class="number"><input type="hidden" name="Quantity" value=' . locale_number_format($_SESSION['Transfer']->TransferItem[0]->Quantity) . '/><a href="' . $rootpath .'/StockTransferControlled.php?StockLocationFrom='.$_SESSION['Transfer']->StockLocationFrom.'">' . $_SESSION['Transfer']->TransferItem[0]->Quantity . '</a></td></tr>'; } elseif (isset($_SESSION['Transfer']->TransferItem[0]->Controlled)){ - echo '<td><input type="text" class="number" name="Quantity" size="12" maxlength="12" value=' . locale_number_format($_SESSION['Transfer']->TransferItem[0]->Quantity) . '></td></tr>'; + echo '<td><input type="text" class="number" name="Quantity" size="12" maxlength="12" value="' . locale_number_format($_SESSION['Transfer']->TransferItem[0]->Quantity) . '" /></td></tr>'; } else { - echo '<td><input type="text" class="number" name="Quantity" size="12" maxlength="12" value="0"></td> + echo '<td><input type="text" class="number" name="Quantity" size="12" maxlength="12" value="0" /></td> </tr>'; } Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/SuppLoginSetup.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -133,7 +133,7 @@ } echo '<tr> <td>' . _('Password') . ':</td> - <td><input type="password" name="Password" size="22" maxlength="20" value="' . $_POST['Password'] . '"> + <td><input type="password" name="Password" size="22" maxlength="20" value="' . $_POST['Password'] . '" /> </tr> <tr> <td>' . _('Full Name') . ':</td> Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/SupplierInvoice.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -26,7 +26,8 @@ $SupplierName=$_SESSION['SuppTrans']->SupplierName; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Supplier Invoice') . '" alt="">' . ' ' . _('Enter Supplier Invoice:') . ' ' . $SupplierName; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Supplier Invoice') . '" alt="" /> + ' . ' ' . _('Enter Supplier Invoice:') . ' ' . $SupplierName; echo '</p>'; if (isset($_GET['SupplierID']) and $_GET['SupplierID']!=''){ @@ -252,7 +253,7 @@ echo '<tr> <td>' . _('Supplier Invoice Reference') . ':</td> - <td><input type="text" size="20" maxlength="20" name="SuppReference" value="' . $_SESSION['SuppTrans']->SuppReference . '"></td>'; + <td><input type="text" size="20" maxlength="20" name="SuppReference" value="' . $_SESSION['SuppTrans']->SuppReference . '" /></td>'; if (!isset($_SESSION['SuppTrans']->TranDate)){ $_SESSION['SuppTrans']->TranDate= Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))); @@ -491,7 +492,7 @@ <table class="selection"> <tr> <td>' . _('Amount in supplier currency') . ':</td> - <td colspan=2 class="number"><input type="text" size="12" maxlength="10" name="OvAmount" value="' . locale_number_format( $_SESSION['SuppTrans']->OvAmount,$_SESSION['SuppTrans']->CurrDecimalPlaces) . '" /></td> + <td colspan="2" class="number"><input type="text" size="12" maxlength="10" name="OvAmount" value="' . locale_number_format( $_SESSION['SuppTrans']->OvAmount,$_SESSION['SuppTrans']->CurrDecimalPlaces) . '" /></td> </tr>'; } Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/WorkOrderEntry.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -651,12 +651,11 @@ $k=1; } - printf('<td><font size="1">%s</font></td> - <td><font size="1">%s</font></td> - <td><font size="1">%s</font></td> + printf('<td>%s</td> <td>%s</td> - <td><font size=1><a href="%s">' - . _('Add to Work Order') . '</a></font></td> + <td>%s</td> + <td>%s</td> + <td><a href="%s">' . _('Add to Work Order') . '</a></td> </tr>', $myrow['stockid'], $myrow['description'], Modified: trunk/Z_ImportGLAccountGroups.php =================================================================== --- trunk/Z_ImportGLAccountGroups.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/Z_ImportGLAccountGroups.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -69,8 +69,8 @@ echo '<form name="ItemForm" enctype="multipart/form-data" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' .SID .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table><tr><td>'._('File to import').'</td>'. - '<td><input type="file" id="ImportFile" name="ImportFile"></td></tr></table>'; - echo '<div class="centre"><input type="submit" name="update" value="Process"></div>'; + '<td><input type="file" id="ImportFile" name="ImportFile" /></td></tr></table>'; + echo '<div class="centre"><input type="submit" name="update" value="Process" /></div>'; echo '</form>'; } Modified: trunk/Z_ImportPartCodes.php =================================================================== --- trunk/Z_ImportPartCodes.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/Z_ImportPartCodes.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -80,8 +80,8 @@ echo '<form name="ItemForm" enctype="multipart/form-data" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' .SID .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table><tr><td>'._('File to import').'</td>'. - '<td><input type="file" id="ImportFile" name="ImportFile"></td></tr></table>'; - echo '<div class="centre"><input type="submit" name="update" value="Process"></div>'; + '<td><input type="file" id="ImportFile" name="ImportFile" /></td></tr></table>'; + echo '<div class="centre"><input type="submit" name="update" value="Process" /></div>'; echo '</form>'; } } Modified: trunk/Z_poEditLangModule.php =================================================================== --- trunk/Z_poEditLangModule.php 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/Z_poEditLangModule.php 2012-01-21 15:41:50 UTC (rev 4827) @@ -152,8 +152,8 @@ } else { echo '<tr>'; echo '<td VALIGN="top"><I>' . $DefaultText[$i] . '</I></td>'; - echo '<td VALIGN="top"><input type="text" size="60" name="moduletext_' . $msgstr[$i] . '" VALUE="' . $ModuleText[$i] . '"></td>'; - echo '<td VALIGN="top">' . $AlsoIn[$i] . '<input type="hidden" name="msgstr_' . $msgstr[$i] . '" VALUE="' . $msgstr[$i] . '"></td>'; + echo '<td VALIGN="top"><input type="text" size="60" name="moduletext_' . $msgstr[$i] . '" VALUE="' . $ModuleText[$i] . '" /></td>'; + echo '<td VALIGN="top">' . $AlsoIn[$i] . '<input type="hidden" name="msgstr_' . $msgstr[$i] . '" VALUE="' . $msgstr[$i] . '" /></td>'; echo '</tr>'; echo '<tr><th colspan="3"></th></tr>'; } @@ -165,8 +165,8 @@ echo '</td></tr>'; echo '</table>'; echo '<br /><div class="centre">'; - echo '<input type="Submit" name="submit" VALUE="' . _('Modify') . '"> '; - echo '<input type="hidden" name="module" VALUE="' . $_POST['module'] . '">'; + echo '<input type="submit" name="submit" VALUE="' . _('Modify') . '" /> '; + echo '<input type="hidden" name="module" VALUE="' . $_POST['module'] . '" />'; echo '</form>'; echo '</div>'; @@ -229,8 +229,8 @@ echo '</tr></table>'; echo '<br />'; echo '<div class="centre">'; - echo '<input type="Submit" name="proceed" VALUE="' . _('Proceed') . '"> '; - echo '<br /><br /><input type="Submit" name="ReMergePO" VALUE="' . _('Refresh messages with latest strings') . '">'; + echo '<input type="submit" name="proceed" VALUE="' . _('Proceed') . '" /> '; + echo '<br /><br /><input type="submit" name="ReMergePO" VALUE="' . _('Refresh messages with latest strings') . '">'; echo '</div>'; echo '</form>'; echo '</td></tr></table>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2012-01-21 00:49:44 UTC (rev 4826) +++ trunk/doc/Change.log 2012-01-21 15:41:50 UTC (rev 4827) @@ -1,5 +1,6 @@ webERP Change Log +21/1/12 Vitaly: xhtml fixes in multiple files. 20/1/12 Phil: Fixed GetStockPrice API function for effectivty dates 20/1/12 Vitaly: Changed $DB_error_no($db) to DB_error_no($db) in Z_ChangeStockCode.php 20/1/12 Vitaly: xhtml fixes in CustomerBranches.php StockAdjustments.php WorkOrderEntry.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <vv...@us...> - 2012-01-21 22:05:20
|
Revision: 4828 http://web-erp.svn.sourceforge.net/web-erp/?rev=4828&view=rev Author: vvs2012 Date: 2012-01-21 22:05:14 +0000 (Sat, 21 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/AccountGroups.php trunk/CustomerReceipt.php trunk/PDFPriceList.php trunk/PricesBasedOnMarkUp.php trunk/SpecialOrder.php trunk/StockCategories.php trunk/StockSerialItemResearch.php trunk/Z_CreateCompanyTemplateFile.php trunk/Z_ImportGLAccountSections.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2012-01-21 15:41:50 UTC (rev 4827) +++ trunk/AccountGroups.php 2012-01-21 22:05:14 UTC (rev 4828) @@ -276,7 +276,7 @@ echo '<br /><form method="post" id="AccountGroups" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - + echo '<table class="selection"><tr><td>'; if (isset($_GET['SelectedAccountGroup'])) { //editing an existing account group @@ -304,7 +304,6 @@ $_POST['PandL'] = $myrow['pandl']; $_POST['ParentGroupName'] = $myrow['parentgroupname']; - echo '<table class="selection"><tr><td>'; echo '<input type="hidden" name="SelectedAccountGroup" value="' . $_GET['SelectedAccountGroup'] . '" />'; echo '<input type="hidden" name="GroupName" value="' . $_POST['GroupName'] . '" />'; @@ -330,7 +329,6 @@ $_POST['PandL']=''; } - echo '<br /><table class="selection"><tr><td>'; echo '<input type="hidden" name="SelectedAccountGroup" value="' . $_POST['SelectedAccountGroup'] . '" />'; echo _('Account Group Name') . ':' . '</td><td> <input tabindex="1" ' . (in_array('GroupName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="GroupName" size="50" maxlength="50" value="' . $_POST['GroupName'] . '" /></td></tr>'; Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2012-01-21 15:41:50 UTC (rev 4827) +++ trunk/CustomerReceipt.php 2012-01-21 22:05:14 UTC (rev 4828) @@ -544,8 +544,8 @@ echo '<br />'; prnMsg( _('Receipt batch') . ' ' . $_SESSION['ReceiptBatch']->BatchNo . ' ' . _('has been successfully entered into the database'),'success'); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="">' . ' ' . '<a href="' . $rootpath . '/PDFBankingSummary.php?BatchNo=' . $_SESSION['ReceiptBatch']->BatchNo . '">' . _('Print PDF Batch Summary') . '</a></p>'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/allocation.png" title="' . _('Allocate') . '" alt="">' . ' ' . '<a href="' . $rootpath . '/CustomerAllocations.php">' . _('Allocate Receipts') . '</a></p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a href="' . $rootpath . '/PDFBankingSummary.php?BatchNo=' . $_SESSION['ReceiptBatch']->BatchNo . '">' . _('Print PDF Batch Summary') . '</a></p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/allocation.png" title="' . _('Allocate') . '" alt="" />' . ' ' . '<a href="' . $rootpath . '/CustomerAllocations.php">' . _('Allocate Receipts') . '</a></p>'; echo '<p class="page_title_text"><a href="' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a> </p>'; @@ -743,9 +743,9 @@ $AccountsResults = DB_query($SQL,$db,$ErrMsg,$DbgMsg); if (isset($_POST['GLEntry'])) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Enter Receipt') . '" alt="">' . ' ' . _('General Ledger Receipt Entry') . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Enter Receipt') . '" alt="" />' . ' ' . _('General Ledger Receipt Entry') . '</p>'; } else { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Enter Receipt') . '" alt="">' . ' ' . _('Enter Customer Receipt') . '</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Enter Receipt') . '" alt="" />' . ' ' . _('Enter Customer Receipt') . '</p>'; echo '<div class="page_help_text">' . _('To enter a payment TO a customer (ie. to pay out a credit note), enter a negative payment amount.') . '</div>'; } echo '<br /> @@ -782,7 +782,7 @@ echo '<tr> <td>' . _('Date Banked') . ':</td> - <td><input tabindex="2" type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DateBanked" maxlength="10" size="10" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['ReceiptBatch']->DateBanked . '"></td> + <td><input tabindex="2" type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DateBanked" maxlength="10" size="10" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['ReceiptBatch']->DateBanked . '" /></td> </tr> <tr> <td>' . _('Currency') . ':</td> @@ -887,8 +887,8 @@ if (isset($_SESSION['ReceiptBatch'])){ /* Now show the entries made so far */ if (!$BankAccountEmpty) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Banked') . - '" alt="">' . ' ' . $_SESSION['ReceiptBatch']->ReceiptType . ' - ' . _('Banked into the') . " " . + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Banked') . '" alt="" /> + ' . ' ' . $_SESSION['ReceiptBatch']->ReceiptType . ' - ' . _('Banked into the') . " " . $_SESSION['ReceiptBatch']->BankAccountName . ' ' . _('on') . ' ' . $_SESSION['ReceiptBatch']->DateBanked . '</p>'; } @@ -1072,7 +1072,7 @@ <td>' . _('Amount of Discount') . ':</td> <td><input tabindex="10" type="text" name="Discount" maxlength="12" size="13" class="number" value="' . $_POST['Discount'] . '" /> ' . _('agreed prompt payment discount is') . ' ' . $DisplayDiscountPercent . '</td></tr>'; } else { - echo '<input tabindex=11 type="hidden" name="Discount" value="0" />'; + echo '<input tabindex="11" type="hidden" name="Discount" value="0" />'; } echo '<tr> @@ -1080,7 +1080,7 @@ <td><input tabindex="12" type="text" name="PayeeBankDetail" maxlength="22" size="20" value="' . $_POST['PayeeBankDetail'] . '" /></td> </tr>'; // echo '<tr><td>' . _('Narrative') . ':</td> -// <td><input tabindex=13 type="text" name="Narrative" maxlength=30 size=32 value="' . $_POST['Narrative'] . '"></td></tr>'; +// <td><input tabindex="13" type="text" name="Narrative" maxlength="30" size="32" value="' . $_POST['Narrative'] . '" /></td></tr>'; echo '<td>' . _('Narrative') . ':</td> <td><textarea name="Narrative" cols="40" rows="1"></textarea></td> </tr> @@ -1098,7 +1098,7 @@ echo '<br />'; echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Select a Customer') . '</b> + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Select a Customer') . '</b> <table class="selection"> <tr> <td>' . _('Text in the Customer') . ' ' . '<b>' . _('name') . '</b>:</td> @@ -1140,7 +1140,7 @@ echo '<tr class="EvenTableRows">'; $k=1; } - printf('<td><font size=1><input tabindex="'. strval(12+$j).'" type="submit" name="Select" value="%s" /></font></td> + printf('<td><input tabindex="'. strval(12+$j).'" type="submit" name="Select" value="%s" /></td> <td>%s</td> </tr>', $myrow['debtorno'], Modified: trunk/PDFPriceList.php =================================================================== --- trunk/PDFPriceList.php 2012-01-21 15:41:50 UTC (rev 4827) +++ trunk/PDFPriceList.php 2012-01-21 22:05:14 UTC (rev 4828) @@ -251,8 +251,8 @@ $title= _('Price Listing'); include('includes/header.inc'); - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . - _('Price List') . '" alt="" />' . ' ' . _('Print a price list') . '</p>'; + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . _('Price List') . '" alt="" /> + ' . ' ' . _('Print a price list') . '</p>'; if (!isset($_POST['FromCriteria']) or !isset($_POST['ToCriteria'])) { @@ -302,7 +302,9 @@ echo '<option Value="Full Description">'. _('Full Description') . '</option>'; echo '</select></td></tr>'; - echo '<tr><td>' . _('Effective As At') . ':</td><td><input type="text" size=11 class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveDate" value="' . Date($_SESSION['DefaultDateFormat']) . '">'; + echo '<tr><td>' . _('Effective As At') . ':</td>'; + echo '<td><input type="text" size="11" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveDate" value="' . Date($_SESSION['DefaultDateFormat']) . '" />'; + echo '</td></tr>'; echo '</table><br /><div class="centre"><input type=Submit Name="PrintPDF" Value="'. _('Print PDF'). '"></div>'; } Modified: trunk/PricesBasedOnMarkUp.php =================================================================== --- trunk/PricesBasedOnMarkUp.php 2012-01-21 15:41:50 UTC (rev 4827) +++ trunk/PricesBasedOnMarkUp.php 2012-01-21 22:05:14 UTC (rev 4828) @@ -5,8 +5,7 @@ $title=_('Update Pricing'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . - '" alt="" />' . $title.'</p>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . '" alt="" />' . $title.'</p>'; echo '<br /><div class="page_help_text">' . _('This page adds new prices or updates already existing prices for a specified sales type (price list) and currency for the stock category selected - based on a percentage mark up from cost prices or from preferred supplier cost data or from another price list. The rounding factor ensures that prices are at least this amount or a multiple of it. A rounding factor of 5 would mean that prices would be a minimum of 5 and other prices would be expressed as multiples of 5.') . '</div><br /><div class="centre">'; @@ -145,13 +144,13 @@ } echo '<tr><td>' . _('Rounding Factor') . ':</td> - <td><input type="text" class=number name="RoundingFactor" size="6" maxlength="6" value=' . $_POST['RoundingFactor'] . '></td></tr>'; + <td><input type="text" class="number" name="RoundingFactor" size="6" maxlength="6" value="' . $_POST['RoundingFactor'] . '" /></td></tr>'; echo '<tr><td>' . _('New Price To Be Effective From') . ':</td> - <td><input type="text" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceStartDate" size="10" maxlength="10" value="' . $_POST['PriceStartDate'] . '"></td></tr>'; + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceStartDate" size="10" maxlength="10" value="' . $_POST['PriceStartDate'] . '" /></td></tr>'; echo '<tr><td>' . _('New Price To Be Effective To (Blank = No End Date)') . ':</td> - <td><input type="text" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceEndDate" size="10" maxlength="10" value="' . $_POST['PriceEndDate'] . '"></td></tr>'; + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="PriceEndDate" size="10" maxlength="10" value="' . $_POST['PriceEndDate'] . '" /></td></tr>'; if (!isset($_POST['IncreasePercent'])){ $_POST['IncreasePercent']=0; @@ -161,7 +160,7 @@ <td><input type="text" name="IncreasePercent" class="number" size="4" maxlength="4" value="' . $_POST['IncreasePercent'] . '"></td></tr></table>'; -echo '<p><div class="centre"><input type="submit" name="UpdatePrices" value="' . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update or add all the prices according to the criteria selected?') . '\');"></div>'; +echo '<p><div class="centre"><input type="submit" name="UpdatePrices" value="' . _('Update Prices') . '\' onclick="return confirm(\'' . _('Are you sure you wish to update or add all the prices according to the criteria selected?') . '\');" /></div>'; echo '</form>'; Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2012-01-21 15:41:50 UTC (rev 4827) +++ trunk/SpecialOrder.php 2012-01-21 22:05:14 UTC (rev 4828) @@ -740,10 +740,10 @@ <input type="submit" name="EnterLine" value="' . _('Add Item to Order') . '" /> <br /> <br /> - <input type="submit" name="Cancel" value="' . _('Start Again') . '"> + <input type="submit" name="Cancel" value="' . _('Start Again') . '" /> <br /> <br /> - <input type="submit" name="Commit" value="' . _('Process This Order') . '"> + <input type="submit" name="Commit" value="' . _('Process This Order') . '" /> </div> </form>'; Modified: trunk/StockCategories.php =================================================================== --- trunk/StockCategories.php 2012-01-21 15:41:50 UTC (rev 4827) +++ trunk/StockCategories.php 2012-01-21 22:05:14 UTC (rev 4828) @@ -8,8 +8,7 @@ include('includes/header.inc'); echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Inventory Adjustment') . '" alt="" />' . ' ' . $title . ' + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory Adjustment') . '" alt="" />' . ' ' . $title . ' </p>'; if (isset($_GET['SelectedCategory'])){ @@ -350,7 +349,7 @@ echo '<tr> <td>' . _('Category Description') . ':</td> - <td><input type="text" name="CategoryDescription" size=22 maxlength=20 value="' . $_POST['CategoryDescription'] . '" /></td></tr>'; + <td><input type="text" name="CategoryDescription" size="22" maxlength="20" value="' . $_POST['CategoryDescription'] . '" /></td></tr>'; echo '<tr> @@ -535,28 +534,26 @@ } else { echo '<option value="2">' . _('Check Box') . '</option>'; } - echo '</select></td> - <td><input type="textbox" name="PropDefault' . $PropertyCounter . '" value="' . $myrow['defaultvalue'] . '"></td> - <td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '"'; - - if ($myrow['numericvalue'] ==1){ - echo 'checked'; - } - echo '"></td> - <td><input type="textbox" class="number" name="PropMinimum' . $PropertyCounter . '" value="' . locale_number_format($myrow['minimumvalue'],'Variable') . '" /></td> - <td><input type="textbox" class="number" name="PropMaximum' . $PropertyCounter . '" value="' . locale_number_format($myrow['maximumvalue'],'Variable') . '" /></td>'; + echo '</select></td>'; + + echo '<td><input type="textbox" name="PropDefault' . $PropertyCounter . '" value="' . $myrow['defaultvalue'] . '" /></td>'; + echo '<td><input type="checkbox" name="PropNumeric' . $PropertyCounter . '"'; + if ($myrow['numericvalue'] == 1){ + echo ' checked="checked"'; + } + echo ' /></td>'; + + echo '<td><input type="textbox" class="number" name="PropMinimum' . $PropertyCounter . '" value="' . locale_number_format($myrow['minimumvalue'],'Variable') . '" /></td>'; + echo '<td><input type="textbox" class="number" name="PropMaximum' . $PropertyCounter . '" value="' . locale_number_format($myrow['maximumvalue'],'Variable') . '" /></td>'; echo '<td align="center"><input type="checkbox" name="PropReqSO' . $PropertyCounter .'"'; + if ($myrow['reqatsalesorder']==1){ + echo ' checked="checked"'; + } + echo ' /></td>'; + + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DeleteProperty=' . $myrow['stkcatpropid'] .'&SelectedCategory=' . $SelectedCategory . '" onclick=\'return confirm("' . _('Are you sure you wish to delete this property? All properties of this type set up for stock items will also be deleted.') . '");\'>' . _('Delete') . '</td>'; + echo '</tr>'; - if ($myrow['reqatsalesorder']==1){ - echo 'checked'; - } else { - echo ''; - } - - echo ' /></td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DeleteProperty=' . $myrow['stkcatpropid'] .'&SelectedCategory=' . $SelectedCategory . '" onclick=\'return confirm("' . _('Are you sure you wish to delete this property? All properties of this type set up for stock items will also be deleted.') . '");\'>' . _('Delete') . '</td> - </tr>'; - $PropertyCounter++; } //end loop around defined properties for this category echo '<input type="hidden" name="PropID' . $PropertyCounter .'" value="NewProperty" />'; Modified: trunk/StockSerialItemResearch.php =================================================================== --- trunk/StockSerialItemResearch.php 2012-01-21 15:41:50 UTC (rev 4827) +++ trunk/StockSerialItemResearch.php 2012-01-21 22:05:14 UTC (rev 4828) @@ -6,9 +6,8 @@ include('includes/header.inc'); echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . -'" alt="" /><b>' . $title. '</b> - </p>'; + <img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" /><b>' . $title. '</b> + </p>'; //validate the submission Modified: trunk/Z_CreateCompanyTemplateFile.php =================================================================== --- trunk/Z_CreateCompanyTemplateFile.php 2012-01-21 15:41:50 UTC (rev 4827) +++ trunk/Z_CreateCompanyTemplateFile.php 2012-01-21 22:05:14 UTC (rev 4828) @@ -218,7 +218,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; prnMsg(_('Running the create a new company template script will export all account groups, account codes and tax set up tables including tax groups, tax authorities, tax rates etc. However, no transactions or private data will be exported. There is opportunity to prevent specific general ledger accounts from being exported where these are considered private - again no transactional or balance data is exported and you can inspect the contents of the sql file. The template file will be emailed automatically to the webERP project'),'info'); -echo _('Enter the name of the template to be created') . ':<input type="text" name="TemplateName">'; +echo _('Enter the name of the template to be created') . ':<input type="text" name="TemplateName" />'; prnMsg(_('Warning: All selected accounts will be exported - please de-select the accounts you do not wish to export to the new template file'),'warn'); @@ -233,14 +233,14 @@ while ($ChartRow = DB_fetch_array($ChartResult)){ echo '<tr><td>' . $ChartRow['accountcode'] . '</td> <td>' . $ChartRow['accountname'] . '</td> - <td><input type="checkbox" name="IncludeAccount_' . $i . '" CHECKED></td> + <td><input type="checkbox" name="IncludeAccount_' . $i . '" checked="checked" /></td> </tr>'; $i++; } echo '</table>'; echo '<hr>'; -echo '<center><input type="submit" name="CreateTemplate" value="' . _('Create Template and Email') . '"></center>'; +echo '<center><input type="submit" name="CreateTemplate" value="' . _('Create Template and Email') . '" /></center>'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/Z_ImportGLAccountSections.php =================================================================== --- trunk/Z_ImportGLAccountSections.php 2012-01-21 15:41:50 UTC (rev 4827) +++ trunk/Z_ImportGLAccountSections.php 2012-01-21 22:05:14 UTC (rev 4828) @@ -73,8 +73,8 @@ echo '<form name="ItemForm" enctype="multipart/form-data" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' .SID .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table><tr><td>'._('File to import').'</td>'. - '<td><input type="file" id="ImportFile" name="ImportFile"></td></tr></table>'; - echo '<div class= "centre"><input type="submit" name="update" value="Process"></div>'; + '<td><input type="file" id="ImportFile" name="ImportFile" /></td></tr></table>'; + echo '<div class= "centre"><input type="submit" name="update" value="Process" /></div>'; echo '</form>'; } include('includes/footer.inc'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |