From: <tim...@us...> - 2010-07-22 09:10:36
|
Revision: 3653 http://web-erp.svn.sourceforge.net/web-erp/?rev=3653&view=rev Author: tim_schofield Date: 2010-07-22 09:10:30 +0000 (Thu, 22 Jul 2010) Log Message: ----------- Layout changes, and sql quoting Modified Paths: -------------- trunk/PcAuthorizeExpenses.php trunk/doc/Change.log.html Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2010-07-22 09:10:08 UTC (rev 3652) +++ trunk/PcAuthorizeExpenses.php 2010-07-22 09:10:30 UTC (rev 3653) @@ -34,23 +34,24 @@ if (isset($SelectedTabs)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Petty Cash') . - '" alt="">' . ' <a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Authorization Of Petty Cash Expenses ') . ''.$SelectedTabs.'<a/>'; + '" alt="">' . _('Authorization Of Petty Cash Expenses ') . ''.$SelectedTabs.'</p>'; } else { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Petty Cash') . - '" alt="">' . ' <a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Authorization Of Petty Cash Expenses ') . '<a/>'; + '" alt="">' . _('Authorization Of Petty Cash Expenses ') . '</p>'; } if (isset($_POST['submit']) or isset($_POST['update']) OR isset($SelectedTabs) OR isset ($_POST['GO'])) { echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; - echo "<div class='centre'><p>" . _('Detail Of Movement For Last ') .': '; if(!isset ($Days)){ $Days=30; } echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + echo '<br><table class=selection>'; + echo "<tr><th colspan=7>" . _('Detail Of Movement For Last ') .': '; echo "<input type=text class=number name='Days' VALUE=" . $Days . " MAXLENGTH =3 size=4> Days "; - echo '<input type=submit name="Go" value="' . _('Go') . '">'; - echo '<p></div></form>'; + echo '<input type=submit name="Go" value="' . _('Go') . '"></tr></th>'; + echo '</form>'; $sql = "SELECT pcashdetails.counterindex, pcashdetails.tabcode, @@ -69,13 +70,12 @@ FROM pcashdetails, pctabs, currencies WHERE pcashdetails.tabcode = pctabs.tabcode AND pctabs.currency = currencies.currabrev - AND pcashdetails.tabcode = '$SelectedTabs' - AND pcashdetails.date >= DATE_SUB(CURDATE(), INTERVAL ".$Days." DAY) + AND pcashdetails.tabcode = '" . $SelectedTabs . "' + AND pcashdetails.date >= DATE_SUB(CURDATE(), INTERVAL '".$Days."' DAY) ORDER BY pcashdetails.date, pcashdetails.counterindex ASC"; $result = DB_query($sql,$db); - echo '<br><table BORDER=1>'; echo "<tr> <th>" . _('Date') . "</th> <th>" . _('Expense Code') . "</th> @@ -124,6 +124,7 @@ //build narrative $narrative= "PettyCash - ".$myrow['tabcode']." - ".$myrow['codeexpense']." - ".$myrow['notes']." - ".$myrow['receipt'].""; //insert to gltrans + DB_Txn_Begin($db); $sqlFrom="INSERT INTO `gltrans` (`counterindex`, @@ -151,7 +152,7 @@ '', 0)"; - $ResultFrom = DB_Query($sqlFrom, $db); + $ResultFrom = DB_Query($sqlFrom, $db, '', '', true); $sqlTo="INSERT INTO `gltrans` (`counterindex`, @@ -179,12 +180,12 @@ '', 0)"; - $ResultTo = DB_Query($sqlTo, $db); + $ResultTo = DB_Query($sqlTo, $db, '', '', true); if ($myrow['codeexpense'] == 'ASSIGNCASH'){ // if it's a cash assignation we need to updated banktrans table as well. $ReceiptTransNo = GetNextTransNo( 2, $db); - $SQLBank= 'INSERT INTO banktrans (transno, + $SQLBank= "INSERT INTO banktrans (transno, type, bankact, ref, @@ -194,15 +195,15 @@ banktranstype, amount, currcode) - VALUES (' . $ReceiptTransNo . ', + VALUES ('". $ReceiptTransNo . "', 1, - ' . $AccountFrom . ", '" - . $narrative . " ', + '" . $AccountFrom . "', + '" . $narrative . "', 1, - " . $myrow['rate'] . ", + '" . $myrow['rate'] . "', '" . $myrow['date'] . "', 'Cash', - " . -$myrow['amount'] . ", + '" . -$myrow['amount'] . "', '" . $myrow['currency'] . "' )"; $ErrMsg = _('Cannot insert a bank transaction because'); @@ -215,7 +216,8 @@ SET authorized = '".Date('Y-m-d')."', posted = 1 WHERE counterindex = '".$myrow['counterindex']."'"; - $resultupdate = DB_query($sql,$db); + $resultupdate = DB_query($sql,$db, '', '', true); + DB_Txn_Commit($db); } if ($k==1){ @@ -261,8 +263,7 @@ echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; - echo '<p><table border=1>'; //Main table - echo '<td><table>'; // First column + echo '<p><table class=selection>'; //Main table echo '<tr><td>' . _('Authorize expenses to Petty Cash Tab') . ":</td><td><select name='SelectedTabs'>"; @@ -285,12 +286,11 @@ echo '</select></td></tr>'; - echo '</table>'; // close table in first column - echo '</td></tr></table>'; // close main table + 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 '</form>'; } /*end of else not submit */ include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-22 09:10:08 UTC (rev 3652) +++ trunk/doc/Change.log.html 2010-07-22 09:10:30 UTC (rev 3653) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>20/07/10 Tim: PcAuthoriseExpenses.php - Layout changes, and sql quoting</p> <p>20/07/10 Tim: FixedAssetRegister.php - Layout changes, correctly export to csv, and sql quoting</p> <p>20/07/10 Tim: StockLocStatus.php - Add a filter to only show stock with available balances</p> <p>20/07/10 Tim: StockLocMovements.php - Add in the new quantity on hand field</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |