From: <tim...@us...> - 2010-07-06 21:59:09
|
Revision: 3575 http://web-erp.svn.sourceforge.net/web-erp/?rev=3575&view=rev Author: tim_schofield Date: 2010-07-06 21:59:02 +0000 (Tue, 06 Jul 2010) Log Message: ----------- Layout changes and correction to sql statement Modified Paths: -------------- trunk/CustWhereAlloc.php trunk/doc/Change.log.html Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2010-07-06 21:58:43 UTC (rev 3574) +++ trunk/CustWhereAlloc.php 2010-07-06 21:59:02 UTC (rev 3575) @@ -9,34 +9,37 @@ echo "<form action='" . $_SERVER['PHP_SELF'] . "' method=post>"; -echo '<table cellpadding=2><tr>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . + _('Customer Where Allocated'). '" alt="">' . $title . '</p>'; +echo '<table class=selection cellpadding=2><tr>'; + echo '<td>' . _('Type') . ":</td><td><select tabindex=1 name='TransType'> "; -$sql = 'SELECT typeid, typename FROM systypes WHERE typeid = 10 OR typeid=12'; +$sql = "SELECT typeid, typename FROM systypes WHERE typeid = 10 OR typeid=12"; $resultTypes = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultTypes)){ - if (isset($_POST['TransType'])){ - if ($myrow['typeid'] == $_POST['TransType']){ - echo "<option selected Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; - } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; - } - } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; - } + if (isset($_POST['TransType'])){ + if ($myrow['typeid'] == $_POST['TransType']){ + echo "<option selected Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + } else { + echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + } + } else { + echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + } } echo '</select></td>'; if (!isset($_POST['TransNo'])) {$_POST['TransNo']='';} echo '<td>'._('Transaction Number').":</td> - <td><input tabindex=2 type=TEXT name='TransNo' maxlength=10 size=10 VALUE=". $_POST['TransNo'] . '></td>'; + <td><input tabindex=2 type=text name='TransNo' maxlength=10 size=10 value=". $_POST['TransNo'] . '></td>'; -echo "</tr></table> - <div class='centre'><input tabindex=3 type=submit name='ShowResults' VALUE="._('Show How Allocated').'></div>'; -echo '<hr>'; +echo "</tr></table><br> + <div class='centre'><input tabindex=3 type=submit name='ShowResults' value="._('Show How Allocated').'></div>'; if (isset($_POST['ShowResults']) AND $_POST['TransNo']==''){ + echo '<br>'; prnMsg(_('The transaction number to be queried must be entered first'),'warn'); } @@ -44,20 +47,19 @@ /*First off get the DebtorTransID of the transaction (invoice normally) selected */ - $sql = 'SELECT id, - ovamount+ovgst AS totamt + $sql = "SELECT id, + ovamount+ovgst AS totamt FROM debtortrans - WHERE type=' . $_POST['TransType'] . ' AND transno = ' . $_POST['TransNo']; + WHERE type='" . $_POST['TransType'] . "' AND transno = '" . $_POST['TransNo']."'"; - $result = DB_query($sql , $db); + $result = DB_query($sql , $db); - if (DB_num_rows($result)==1){ - $myrow = DB_fetch_array($result); - $AllocToID = $myrow['id']; + if (DB_num_rows($result)==1){ + $myrow = DB_fetch_array($result); + $AllocToID = $myrow['id']; - echo '<div class="centre"><font size=3><b><br>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . ' '._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div>'; - $sql = "SELECT type, + $sql = "SELECT type, transno, trandate, debtortrans.debtorno, @@ -67,17 +69,20 @@ custallocns.amt FROM debtortrans INNER JOIN custallocns ON debtortrans.id=custallocns.transid_allocfrom - WHERE custallocns.transid_allocto=". $AllocToID; + WHERE custallocns.transid_allocto='". $AllocToID."'"; - $ErrMsg = _('The customer transactions for the selected criteria could not be retrieved because'); + $ErrMsg = _('The customer transactions for the selected criteria could not be retrieved because'); - $TransResult = DB_query($sql, $db, $ErrMsg); - + $TransResult = DB_query($sql, $db, $ErrMsg); + if (DB_num_rows($TransResult)==0){ prnMsg(_('There are no allocations made against this transaction'),'info'); } else { - echo '<table cellpadding=2 BORDER=2>'; - + echo '<br><table cellpadding=2 class=selection>'; + + echo '<tr><th colspan=6><div class="centre"><font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] + . '<br>'._('Transaction Total').': '. number_format($myrow['totamt'],2) . '</font></b></div></th></tr>'; + $tableheader = "<tr><th>"._('Type')."</th> <th>"._('Number')."</th> <th>"._('Reference')."</th> @@ -86,13 +91,13 @@ <th>"._('Alloc').'</th> </tr>'; echo $tableheader; - + $RowCounter = 1; $k = 0; //row colour counter $AllocsTotal = 0; - + while ($myrow=DB_fetch_array($TransResult)) { - + if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -100,26 +105,20 @@ echo '<tr class="OddTableRows">'; $k++; } - + if ($myrow['type']==11){ $TransType = _('Credit Note'); } else { $TransType = _('Receipt'); } - printf( "<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - </tr>", - $TransType, - $myrow['transno'], - $myrow['reference'], - $myrow['rate'], - $myrow['totalamt'], - $myrow['amt']); - + echo "<td>".$TransType."</td> + <td>".$myrow['transno']."</td> + <td>".$myrow['reference']."</td> + <td>".$myrow['rate']."</td> + <td class=number>".number_format($myrow['totalamt'],2)."</td> + <td class=number>".number_format($myrow['amt'],2)."</td> + </tr>"; + $RowCounter++; If ($RowCounter == 12){ $RowCounter=1; @@ -129,10 +128,11 @@ $AllocsTotal +=$myrow['amt']; } //end of while loop - echo '<tr><td colspan = 6 class=number>' . number_format($AllocsTotal,2) . '</td></tr>'; + echo '<tr><td colspan = 5 class=number>'._('Total allocated').'</td> + <td class=number>' . number_format($AllocsTotal,2) . '</td></tr>'; echo '</table>'; } - } + } } echo '</form>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-07-06 21:58:43 UTC (rev 3574) +++ trunk/doc/Change.log.html 2010-07-06 21:59:02 UTC (rev 3575) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>05/07/10 Tim: CustWhereAlloc.php - Layout changes and correction to sql statement</p> <p>05/07/10 Tim: CustomerTypes.php - Misc minor bug fixes, layout changes and correction to sql statement</p> <p>05/07/10 Tim: Customers.php - Layout changes and correction to sql statement</p> <p>05/07/10 Tim: Customers.php - Layout changes</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |