From: <dai...@us...> - 2011-05-13 10:50:51
|
Revision: 4565 http://web-erp.svn.sourceforge.net/web-erp/?rev=4565&view=rev Author: daintree Date: 2011-05-13 10:50:42 +0000 (Fri, 13 May 2011) Log Message: ----------- various Modified Paths: -------------- trunk/BOMs.php trunk/Factors.php trunk/GLJournal.php trunk/GLTags.php trunk/GoodsReceived.php trunk/MRPDemands.php trunk/OffersReceived.php trunk/PO_AuthorisationLevels.php trunk/PO_AuthoriseMyOrders.php trunk/PO_SelectPurchOrder.php trunk/Payments.php trunk/PcAssignCashToTab.php trunk/PcClaimExpensesFromTab.php trunk/PcTabs.php trunk/Prices.php trunk/Prices_Customer.php trunk/SalesCategories.php trunk/SalesTypes.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSalesOrder.php trunk/SupplierAllocations.php trunk/includes/header.inc Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/BOMs.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -131,20 +131,20 @@ } else { $QuantityOnHand = number_format($myrow[10],$myrow[11]); } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> - <td>%s</td> <td>%s</td> <td>%s</td> + <td>%s</td> <td class=number>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td class=number>%s</td> - <td><a href=\"%s&Select=%s&SelectedComponent=%s\">" . _('Edit') . "</a></td> - <td>".$DrillText."</a></td> - <td><a href=\"%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s\">" . _('Delete') . "</a></td> - </tr>", + <td><a href="%s&Select=%s&SelectedComponent=%s">' . _('Edit') . '</a></td> + <td>'.$DrillText.'</a></td> + <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s">' . _('Delete') . '</a></td> + </tr>', $Level1, $myrow[0], $myrow[1], @@ -789,7 +789,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title; echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . - '<div class="page_help_text">'. _('Select a manufactured part') . " (" . _('or Assembly or Kit part') . ") " . + '<div class="page_help_text">'. _('Select a manufactured part') . ' (' . _('or Assembly or Kit part') . ') ' . _('to maintain the bill of material for using the options below') . '<br /><font size=1>' . _('Parts must be defined in the stock item entry') . '/' . _('modification screen as manufactured') . ', ' . _('kits or assemblies to be available for construction of a bill of material') .'</div>'. @@ -806,7 +806,7 @@ <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '"></div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -if (isset($_POST['Search']) and isset($result) AND !isset($SelectedParent)) { +if (isset($_POST['Search']) AND isset($result) AND !isset($SelectedParent)) { echo '<br /><table cellpadding=2 colspan=7 class=selection>'; $TableHeader = '<tr><th>' . _('Code') . '</th> Modified: trunk/Factors.php =================================================================== --- trunk/Factors.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/Factors.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -1,6 +1,6 @@ <?php -//$PageSecurity = 5; +/* $Id$*/ include('includes/session.inc'); @@ -10,7 +10,7 @@ if (isset($_GET['FactorID'])){ $FactorID = strtoupper($_GET['FactorID']); - $_POST['amend']=True; + $_POST['Amend']=True; } elseif (isset($_POST['FactorID'])){ $FactorID = strtoupper($_POST['FactorID']); } else { @@ -19,7 +19,7 @@ if (isset($_POST['Create'])) { $FactorID = 0; - $_POST['New'] = "Yes"; + $_POST['New'] = 'Yes'; }; echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' @@ -31,22 +31,25 @@ //initialise no input errors assumed initially before we test $InputError = 0; -if (isset($_POST['submit']) or isset($_POST['update']) or isset($_POST['delete'])) { +if (isset($_POST['Submit']) OR isset($_POST['Update'])) { if (strlen($_POST['FactorName']) > 40 or strlen($_POST['FactorName']) == 0 or $_POST['FactorName'] == '') { $InputError = 1; prnMsg(_('The factoring company name must be entered and be forty characters or less long'),'error'); } - + if (strlen($_POST['Email'])>0 AND !IsEmailAddress($_POST['Email'])){ + prnMsg(_('The email address entered does not appear to be a valid email address format'),'error'); + $InputError = 1; + } // But if errors were found in the input if ($InputError>0) { - prnMsg(_('Validation failed') . _('no updates or deletes took place'),'warn'); + prnMsg(_('Validation failed no insert or update took place'),'warn'); include('includes/footer.inc'); exit; } - + /* If no input errors have been recieved */ - if ($InputError == 0 and isset($_POST['submit'])){ + if ($InputError == 0 and isset($_POST['Submit'])){ //And if its not a new part then update existing one $sql = "INSERT INTO factorcompanies (id, @@ -81,22 +84,7 @@ prnMsg(_('A new factoring company for') . ' ' . $_POST['FactorName'] . ' ' . _('has been added to the database'),'success'); - unset ($FactorID); - unset($_POST['FactorName']); - unset($_POST['Address1']); - unset($_POST['Address2']); - unset($_POST['Address3']); - unset($_POST['Address4']); - unset($_POST['Address5']); - unset($_POST['Address6']); - unset($_POST['ContactName']); - unset($_POST['Telephone']); - unset($_POST['Fax']); - unset($_POST['Email']); - - } - - if ($InputError == 0 and isset($_POST['update'])) { + }elseif ($InputError == 0 and isset($_POST['Update'])) { $sql = "UPDATE factorcompanies SET coyname='" . $_POST['FactorName'] . "', address1='" . $_POST['Address1'] . "', address2='" . $_POST['Address2'] . "', @@ -118,105 +106,50 @@ //If it is a new part then insert it } + unset ($FactorID); + unset($_POST['FactorName']); + unset($_POST['Address1']); + unset($_POST['Address2']); + unset($_POST['Address3']); + unset($_POST['Address4']); + unset($_POST['Address5']); + unset($_POST['Address6']); + unset($_POST['ContactName']); + unset($_POST['Telephone']); + unset($_POST['Fax']); + unset($_POST['Email']); +} +if (isset($_POST['Delete'])) { - /* If neither the Update or Insert buttons were pushed was it the delete button? */ + $CancelDelete = 0; - if (isset($_POST['delete'])) { + // PREVENT DELETES IF DEPENDENT RECORDS IN 'SuppTrans' , PurchOrders, SupplierContacts - $CancelDelete = 0; + $sql= "SELECT COUNT(*) FROM suppliers WHERE factorcompanyid='".$FactorID."'"; + $result = DB_query($sql, $db); + $myrow = DB_fetch_row($result); + if ($myrow[0] > 0) { + $CancelDelete = 1; + prnMsg(_('Cannot delete this factor because there are suppliers using them'),'warn'); + echo '<br />' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers using this factor company'); + } - // PREVENT DELETES IF DEPENDENT RECORDS IN 'SuppTrans' , PurchOrders, SupplierContacts - - $sql= "SELECT COUNT(*) FROM suppliers WHERE factorcompanyid='".$FactorID."'"; + if ($CancelDelete == 0) { + $sql="DELETE FROM factorcompanies WHERE id='".$FactorID."'"; $result = DB_query($sql, $db); - $myrow = DB_fetch_row($result); - if ($myrow[0] > 0) { - $CancelDelete = 1; - prnMsg(_('Cannot delete this factor because there are suppliers using them'),'warn'); - echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('suppliers using this factor company'); - } - - if ($CancelDelete == 0) { - $sql="DELETE FROM factorcompanies WHERE id='".$FactorID."'"; - $result = DB_query($sql, $db); - prnMsg(_('Factoring company record record for') . ' ' . $_POST['FactorName'] . ' ' . _('has been deleted'),'success'); - echo '<br>'; - unset($_SESSION['FactorID']); - } //end if Delete factor - } + prnMsg(_('Factoring company record record for') . ' ' . $_POST['FactorName'] . ' ' . _('has been deleted'),'success'); + echo '<br />'; + unset($_SESSION['FactorID']); + } //end if Delete factor unset($FactorID); } -/* So the page hasn't called itself with the input/update/delete/buttons */ -/* If it didn't come with a $FactorID it must be a completely fresh start, so choose a new $factorID or give the - option to create a new one*/ -if (empty($FactorID)) { +/* So the page hasn't called itself with the input/update/delete/buttons */ - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "?" . SID . "'>"; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type='hidden' name='New' VALUE='No'>"; - echo '<table class=selection><tr>'; - echo '<th>' . _('ID') . '</th>'; - echo '<th>' . _('Company Name').'</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>' . _('Contact').'</th>'; - echo '<th>' . _('Telephone').'</th>'; - echo '<th>' . _('Fax Number').'</th>'; - echo '<th>' . _('Email').'</th></tr>'; - $sql = "SELECT id, - coyname, - address1, - address2, - address3, - address4, - address5, - address6, - contact, - telephone, - fax, - email - FROM factorcompanies"; - $result=DB_query($sql, $db); - $j=1; - while ($myrow = DB_fetch_array($result)) { - if ($j==1) { - echo '<tr class="OddTableRows">'; - $j=0; - } else { - echo '<tr class="EvenTableRows">'; - $j++; - } - echo '<td>' . $myrow['id'] . '</td>'; - echo '<td>' . $myrow['coyname'].'</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['contact'].'</td>'; - echo '<td>' . $myrow['telephone'].'</td>'; - echo '<td>' . $myrow['fax'].'</td>'; - echo '<td>' . $myrow['email'].'</td>'; - echo '<td><a href="'.$rootpath . '/Factors.php?' . SID . '&FactorID='.$myrow['id'].'">'._('Edit').'</a></td></tr>'; - } - echo "</table><p><div class='centre'>"; - echo "<br><input tabindex=3 type='Submit' name='Create' value='" . _('Create New Factor') . "'>"; - echo '</div></form>'; - include('includes/footer.inc'); - exit; +if (isset($FactorID) and isset($_POST['Amend'])) { -} - -if (isset($FactorID) and isset($_POST['amend'])) { - $sql = "SELECT id, coyname, address1, @@ -261,37 +194,119 @@ $_POST['Email'] = ''; } -if (isset($_POST['amend']) or isset($_POST['Create'])) { +if (isset($_POST['Amend']) or isset($_POST['Create'])) { // its a new factor being added - echo "<form method='post' action='" . $_SERVER['PHP_SELF'] . "?" . SID . "'>"; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo "<input type=hidden name='FactorID' value='".$FactorID."'>"; + echo '<input type="hidden" name="FactorID" value="' . $FactorID .'">'; echo '<table class=selection>'; - echo "<input type=hidden name='New' value='Yes'>"; - echo '<tr><td>' . _('Factor company Name') . ":</td><td><input tabindex=1 type='text' name='FactorName' size=42 maxlength=40 value='".$_POST['FactorName']."'></td></tr>"; - echo '<tr><td>' . _('Address Line 1') . ":</td><td><input tabindex=2 type='text' name='Address1' size=42 maxlength=40 value='".$_POST['Address1']."'></td></tr>"; - echo '<tr><td>' . _('Address Line 2') . ":</td><td><input tabindex=3 type='text' name='Address2' size=42 maxlength=40 value='".$_POST['Address2']."'></td></tr>"; - echo '<tr><td>' . _('Address Line 3') . ":</td><td><input tabindex=4 type='text' name='Address3' size=42 maxlength=40 value='".$_POST['Address3']."'></td></tr>"; - echo '<tr><td>' . _('Address Line 4') . ":</td><td><input tabindex=5 type='text' name='Address4' size=42 maxlength=40 value='".$_POST['Address4']."'></td></tr>"; - echo '<tr><td>' . _('Address Line 5') . ":</td><td><input tabindex=6 type='text' name='Address5' size=42 maxlength=40 value='".$_POST['Address5']."'></td></tr>"; - echo '<tr><td>' . _('Address Line 6') . ":</td><td><input tabindex=7 type='text' name='Address6' size=42 maxlength=40 value='".$_POST['Address6']."'></td></tr>"; - echo '<tr><td>' . _('Contact Name') . ":</td><td><input tabindex=8 type='text' name='ContactName' size=13 maxlength=25 value='".$_POST['ContactName']."'></td></tr>"; - echo '<tr><td>' . _('Telephone') . ":</td><td><input tabindex=9 type='text' name='Telephone' size=13 maxlength=25 value='".$_POST['Telephone']."'></td></tr>"; - echo '<tr><td>' . _('Fax') . ":</td><td><input tabindex=10 type='text' name='Fax' VALUE=0 size=13 maxlength=25 value='".$_POST['Fax']."'></td></tr>"; - echo '<tr><td>' . _('Email') . ":</td><td><input tabindex=11 type='text' name='Email' size=55 maxlength=55 value='".$_POST['Email']."'></td></tr>"; + echo '<input type="hidden" name="New" value="Yes">'; + echo '<tr><td>' . _('Factor company Name') . ':</td> + <td><input tabindex=1 type="text" name="FactorName" size=42 maxlength=40 value="' .$_POST['FactorName'].'"></td></tr>'; + echo '<tr><td>' . _('Address Line 1') . ':</td> + <td><input tabindex=2 type="text" name="Address1" size=42 maxlength=40 value="' . $_POST['Address1'] .'"></td></tr>'; + echo '<tr><td>' . _('Address Line 2') . ':</td> + <td><input tabindex=3 type="text" name="Address2" size=42 maxlength=40 value="' . $_POST['Address2'] .'"></td></tr>'; + + echo '<tr><td>' . _('Address Line 3') . ':</td> + <td><input tabindex=4 type="text" name="Address3" size=42 maxlength=40 value="' .$_POST['Address3'] .'"></td></tr>'; + echo '<tr><td>' . _('Address Line 4') . ':</td> + <td><input tabindex=5 type="text" name="Address4" size=42 maxlength=40 value="' . $_POST['Address4'].'"></td></tr>'; + echo '<tr><td>' . _('Address Line 5') . ':</td> + <td><input tabindex=6 type="text" name="Address5" size=42 maxlength=40 value="' . $_POST['Address5'] .'"></td></tr>'; + echo '<tr><td>' . _('Address Line 6') . ':</td> + <td><input tabindex=7 type="text" name="Address6" size=42 maxlength=40 value="' .$_POST['Address6'] . '"></td></tr>'; + echo '<tr><td>' . _('Contact Name') . ':</td> + <td><input tabindex=8 type="text" name="ContactName" size=13 maxlength=25 value="' . $_POST['ContactName'] .'"></td></tr>'; + echo '<tr><td>' . _('Telephone') . ':</td> + <td><input tabindex=9 type="text" name="Telephone" size=13 maxlength=25 value="' .$_POST['Telephone'].'"></td></tr>'; + echo '<tr><td>' . _('Fax') . ':</td> + <td><input tabindex=10 type="text" name="Fax" value=0 size=13 maxlength=25 value="' . $_POST['Fax'] .'"></td></tr>'; + echo '<tr><td>' . _('Email') . ':</td> + <td><input tabindex=11 type="text" name="Email" size=55 maxlength=55 value="' . $_POST['Email'] . '"></td></tr>'; echo '</form>'; } if (isset($_POST['Create'])) { - echo "</table><p><div class='centre'><input tabindex=12 type='Submit' name='submit' VALUE='" . _('Insert New Factor') . "'></div>"; -} else if (isset($_POST['amend'])) { - echo "</table><p><div class='centre'><input tabindex=13 type='Submit' name='update' VALUE='" . _('Update Factor') . "'><p>"; + echo '</table><p><div class="centre"><input tabindex=12 type="submit" name="Submit" value="' . _('Insert New Factor') . '"></div>'; +} else if (isset($_POST['Amend'])) { + echo '</table> + <p><div class="centre"><input tabindex=13 type="submit" name="Update" value="' . _('Update Factor') . '"><p>'; prnMsg ( _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no suppliers are using this factor before the deletion is processed'), 'warn'); - echo "<p><input tabindex=14 type='Submit' name='delete' VALUE='" . _('Delete Factor') . "' onclick=\"return confirm('" . _('Are you sure you wish to delete this factoring company?') . "');\"></form></div>"; + echo '<p><input tabindex=14 type="submit" name="Delete" value="' . _('Delete Factor') . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this factoring company?') . '\');"></form></div>'; } +/* If it didn't come with a $FactorID it must be a completely fresh start, so choose a new $factorID or give the + option to create a new one*/ + +if (empty($FactorID) AND !isset($_POST['Create']) AND !isset($_POST['Amend'])) { + + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + echo '<input type="hidden" name="New" value="No">'; + echo '<table class=selection><tr> + <th>' . _('ID') . '</th> + <th>' . _('Company Name').'</th> + <th>' . _('Address 1').'</th> + <th>' . _('Address 2').'</th> + <th>' . _('Address 3').'</th> + <th>' . _('Address 4').'</th> + <th>' . _('Address 5').'</th> + <th>' . _('Address 6').'</th> + <th>' . _('Contact').'</th> + <th>' . _('Telephone').'</th> + <th>' . _('Fax Number').'</th> + <th>' . _('Email').'</th></tr>'; + $sql = "SELECT id, + coyname, + address1, + address2, + address3, + address4, + address5, + address6, + contact, + telephone, + fax, + email + FROM factorcompanies"; + $result=DB_query($sql, $db); + $j=1; + while ($myrow = DB_fetch_array($result)) { + if ($j==1) { + echo '<tr class="OddTableRows">'; + $j=0; + } else { + echo '<tr class="EvenTableRows">'; + $j++; + } + echo '<td>' . $myrow['id'] . '</td> + <td>' . $myrow['coyname'].'</td> + <td>' . $myrow['address1'].'</td> + <td>' . $myrow['address2'].'</td> + <td>' . $myrow['address3'].'</td> + <td>' . $myrow['address4'].'</td> + <td>' . $myrow['address5'].'</td> + <td>' . $myrow['address6'].'</td> + <td>' . $myrow['contact'].'</td> + <td>' . $myrow['telephone'].'</td> + <td>' . $myrow['fax'].'</td> + <td>' . $myrow['email'].'</td> + <td><a href="'.$rootpath . '/Factors.php?FactorID='.$myrow['id'].'">'._('Edit').'</a></td> + </tr>'; + } + echo '</table><p><div class="centre">'; + echo '<br /><input tabindex=3 type="submit" name="Create" value="' . _('Create New Factor') . '">'; + echo '</div></form>'; + include('includes/footer.inc'); + exit; + +} + + include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/GLJournal.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -235,9 +235,8 @@ } echo '<table><tr> - <td colspan="5"><table class="selection"><tr><td>'._('Date to Process Journal').":</td> - <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='JournalProcessDate' maxlength='10' size='11' value='" . - $_SESSION['JournalDetail']->JnlDate . "' /></td>"; + <td colspan="5"><table class="selection"><tr><td>'._('Date to Process Journal') . ':</td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="JournalProcessDate" maxlength="10" size="11" value="' . $_SESSION['JournalDetail']->JnlDate . '" /></td>'; echo '<td>' . _('Type') . ':</td> <td><select name="JournalType">'; @@ -261,9 +260,9 @@ echo '<tr><th colspan="3"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Line Entry') . '</b></font></div></th></tr>'; /*now set up a GLCode field to select from avaialble GL accounts */ -echo '<tr><th>' . _('GL Tag') . '</th>'; -echo '<th>' . _('GL Account Code') . '</th>'; -echo '<th>' . _('Select GL Account') . '</th></tr>'; +echo '<tr><th>' . _('GL Tag') . '</th> + <th>' . _('GL Account Code') . '</th> + <th>' . _('Select GL Account') . '</th></tr>'; /* Set upthe form for the transaction entry for a GL Payment Analysis item */ @@ -321,19 +320,17 @@ $_POST['Debit'] = ''; } -echo '</tr><tr><th>' . _('Debit') . '</th><td><input type="text" class="number" name = "Debit" ' . - 'onChange="eitherOr(this, '.'Credit'.')"'. - ' Maxlength="12" size="10" value="' . $_POST['Debit'] . '" /></td>'; -echo '</tr><tr><th>' . _('Credit') . '</th><td><input type="text" class="number" Name = "Credit" ' . - 'onChange="eitherOr(this, '.'Debit'.')"'. - ' Maxlength="12" size="10" value="' . $_POST['Credit'] . '" /></td>'; +echo '</tr><tr><th>' . _('Debit') . '</th> + <td><input type="text" class="number" name = "Debit" onChange="eitherOr(this, '.'Credit'.')" maxlength="12" size="10" value="' . $_POST['Debit'] . '" /></td>'; +echo '</tr><tr><th>' . _('Credit') . '</th> + <td><input type="text" class="number" Name = "Credit" onChange="eitherOr(this, '.'Debit'.')" maxlength="12" size="10" value="' . $_POST['Credit'] . '" /></td>'; echo '</tr><tr><td></td><td></td><th>'. _('Narrative'). '</th>'; echo '</tr><tr><th></th><th>' . _('GL Narrative') . '</th>'; echo '<td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td>'; echo '</tr></table><br />'; /*Close the main table */ -echo '<div class="centre"><input type="submi2t" name="Process" value="' . _('Accept') . '" /></div><br /><br />'; +echo '<div class="centre"><input type="submit" name="Process" value="' . _('Accept') . '" /></div><br /><br />'; echo '<table class="selection" width="85%">'; @@ -369,8 +366,8 @@ } else { $TagDescription=$myrow[0]; } - echo '<td>' . $JournalItem->tag . ' - ' . $TagDescription . '</td>'; - echo '<td>' . $JournalItem->GLCode . ' - ' . $JournalItem->GLActName . '</td>'; + echo '<td>' . $JournalItem->tag . ' - ' . $TagDescription . '</td> + <td>' . $JournalItem->GLCode . ' - ' . $JournalItem->GLActName . '</td>'; if ($JournalItem->Amount>0) { echo '<td class="number">' . number_format($JournalItem->Amount,$_SESSION['CompanyRecord']['decimalplaces']) . '</td><td></td>'; $DebitTotal=$DebitTotal+$JournalItem->Amount; @@ -402,7 +399,7 @@ echo '</table>'; if (ABS($_SESSION['JournalDetail']->JournalTotal)<0.001 AND $_SESSION['JournalDetail']->GLItemCounter > 0){ - echo "<br /><br /><div class='centre'><input type='submit' name='CommitBatch' value='"._('Accept and Process Journal')."' /></div>"; + echo '<br /><br /><div class="centre"><input type="submit" name="CommitBatch" value="' ._('Accept and Process Journal').'" /></div>'; } elseif(count($_SESSION['JournalDetail']->GLEntries)>0) { echo '<br /><br />'; prnMsg(_('The journal must balance ie debits equal to credits before it can be processed'),'warn'); Modified: trunk/GLTags.php =================================================================== --- trunk/GLTags.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/GLTags.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -80,7 +80,7 @@ echo '<tr><td>' . $myrow['tagref'].'</td> <td>' . $myrow['tagdescription'].'</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedTag=' . $myrow['tagref'] . '&Action=edit">' . _('Edit') . '</a></td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedTag=' . $myrow['tagref'] . '&Action=delete">' . _('Delete') . '</a></td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedTag=' . $myrow['tagref'] . '&Action=delete" onclick="return confirm(\'' . _('Are you sure you wish to delete this GL tag?') . '\');">' . _('Delete') . '</a></td> </tr>'; } Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/GoodsReceived.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -79,10 +79,10 @@ echo '<table cellpadding=2 class=selection> <tr><th colspan="2"></th> - <th align="centre" colspan="3"><b>' . _('Supplier Units') . '</b></th> - <th></th> - <th align="centre" colspan="5"><b>' . _('Our Receiving Units') . '</b></th> - </tr> + <th align="centre" colspan="3"><b>' . _('Supplier Units') . '</b></th> + <th></th> + <th align="centre" colspan="5"><b>' . _('Our Receiving Units') . '</b></th> + </tr> <tr><th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('Quantity') . '<br />' . _('Ordered') . '</th> Modified: trunk/MRPDemands.php =================================================================== --- trunk/MRPDemands.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/MRPDemands.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -1,6 +1,7 @@ <?php -/* $Revision: 1.5 $ */ + /* $Id$*/ + // Add, Edit, Delete, and List MRP demand records. Table is mrpdemands. // Have separate functions for each routine. Use pass-by-reference - (&$db,&$StockID) - // to pass values of $db and $StockID to functions. - when just used $db as variable, Modified: trunk/OffersReceived.php =================================================================== --- trunk/OffersReceived.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/OffersReceived.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -87,19 +87,20 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Supplier Offers') . '" alt="" />' . ' ' . _('Supplier Offers') . '</p>'; - echo '<table class=selection>'; - echo '<tr><th>'._('Offer ID').'</th>'; - echo '<th>'._('Supplier').'</th>'; - echo '<th>'._('Stock Item').'</th>'; - echo '<th>'._('Quantity').'</th>'; - echo '<th>'._('Units').'</th>'; - echo '<th>'._('Price').'</th>'; - echo '<th>'._('Total').'</th>'; - echo '<th>'._('Currency').'</th>'; - echo '<th>'._('Offer Expires').'</th>'; - echo '<th>'._('Accept').'</th>'; - echo '<th>'._('Reject').'</th>'; - echo '<th>'._('Defer').'</th></tr>'; + echo '<table class=selection> + <tr> + <th>'._('Offer ID').'</th> + <th>'._('Supplier').'</th> + <th>'._('Stock Item').'</th> + <th>'._('Quantity').'</th> + <th>'._('Units').'</th> + <th>'._('Price').'</th> + <th>'._('Total').'</th> + <th>'._('Currency').'</th> + <th>'._('Offer Expires').'</th> + <th>'._('Accept').'</th> + <th>'._('Reject').'</th> + <th>'._('Defer').'</th></tr>'; $k=0; while ($myrow=DB_fetch_array($result)) { @@ -110,22 +111,22 @@ echo '<tr class="OddTableRows">'; $k++; } - echo '<td>'.$myrow['offerid'].'</td>'; - echo '<td>'.$myrow['suppname'].'</td>'; - echo '<td>'.$myrow['description'].'</td>'; - echo '<td class=number>'.number_format($myrow['quantity'],$myrow['decimalplaces']).'</td>'; - echo '<td>'.$myrow['uom'].'</td>'; - echo '<td class=number>'.number_format($myrow['price'],2).'</td>'; - echo '<td class=number>'.number_format($myrow['price']*$myrow['quantity'],2).'</td>'; - echo '<td>'.$myrow['currcode'].'</td>'; - echo '<td>'.$myrow['expirydate'].'</td>'; - echo '<td><input type="radio" name="action'.$myrow['offerid'].'" value="1"></td>'; - echo '<td><input type="radio" name="action'.$myrow['offerid'].'" value="2"></td>'; - echo '<td><input type="radio" checked name="action'.$myrow['offerid'].'" value="3"></td>'; - echo '<td><input type="hidden" name="supplierid" value="'.$myrow['supplierid'].'"></td>'; - echo '</tr>'; + echo '<td>'.$myrow['offerid'].'</td> + <td>'.$myrow['suppname'].'</td> + <td>'.$myrow['description'].'</td> + <td class=number>'.number_format($myrow['quantity'],$myrow['decimalplaces']).'</td> + <td>'.$myrow['uom'].'</td> + <td class=number>'.number_format($myrow['price'],2).'</td> + <td class=number>'.number_format($myrow['price']*$myrow['quantity'],2).'</td> + <td>'.$myrow['currcode'].'</td> + <td>'.$myrow['expirydate'].'</td> + <td><input type="radio" name="action'.$myrow['offerid'].'" value="1"></td> + <td><input type="radio" name="action'.$myrow['offerid'].'" value="2"></td> + <td><input type="radio" checked name="action'.$myrow['offerid'].'" value="3"></td> + <td><input type="hidden" name="supplierid" value="'.$myrow['supplierid'].'"></td> + </tr>'; } - echo '<tr><td colspan=12><div class="centre"><input type=Submit name=submit value=' . _('Enter Information') . '></div></td></tr>'; + echo '<tr><td colspan=12><div class="centre"><input type="submit" name="submit" value=' . _('Enter Information') . '></div></td></tr>'; echo '</form></table>'; } else if(isset($_POST['submit']) and isset($_POST['supplierid'])) { include ('includes/htmlMimeMail.php'); @@ -203,7 +204,6 @@ unitprice, actprice, quantityord, - itemno, suppliersunit) VALUES ( '".$OrderNo."', @@ -213,7 +213,6 @@ '".$myrow['price']."', '".$myrow['price']."', '".$myrow['quantity']."', - '".$myrow['stockid']."', '".$myrow['uom']."')"; $result=DB_query($sql, $db); $sql="DELETE FROM offers WHERE offerid='".$AcceptID."'"; @@ -226,7 +225,7 @@ $result = $mail->send(array($Email), 'smtp'); prnMsg(_('The accepted offers from').' '.$SupplierName.' '._('have been converted to purchase orders and an email sent to') .' '.$Email."\n"._('Please review the order contents').' '.'<a href="'.$rootpath . - "/PO_Header.php?ModifyOrderNumber=" . $OrderNo.'">'._('here').'</a>"', 'success'); + '/PO_Header.php?ModifyOrderNumber=' . $OrderNo.'">'._('here').'</a>', 'success'); } if (sizeOf($rejects)>0){ $MailText=_('This email has been automatically generated by the webERP installation at').' '. @@ -259,4 +258,4 @@ } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/PO_AuthorisationLevels.php =================================================================== --- trunk/PO_AuthorisationLevels.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/PO_AuthorisationLevels.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -67,8 +67,8 @@ cancreate='".$CanCreate."', offhold='".$OffHold."', authlevel='".$_POST['AuthLevel']."' - WHERE userid='".$_POST['UserID']."' - AND currabrev='".$_POST['CurrCode']."'"; + WHERE userid='".$_POST['UserID']."' + AND currabrev='".$_POST['CurrCode']."'"; $ErrMsg = _('The authentication details cannot be updated because'); $Result=DB_query($sql,$db,$ErrMsg); @@ -88,8 +88,8 @@ offhold, authlevel FROM purchorderauth - WHERE userid='".$_GET['UserID']."' - AND currabrev='".$_GET['Currency']."'"; + WHERE userid='".$_GET['UserID']."' + AND currabrev='".$_GET['Currency']."'"; $ErrMsg = _('The authentication details cannot be retrieved because'); $result=DB_query($sql,$db,$ErrMsg); $myrow=DB_fetch_array($result); @@ -100,7 +100,7 @@ $AuthLevel=$myrow['authlevel']; } -$sql='SELECT purchorderauth.userid, +$sql="SELECT purchorderauth.userid, www_users.realname, currencies.currabrev, currencies.currency, @@ -110,7 +110,7 @@ FROM purchorderauth INNER JOIN www_users ON purchorderauth.userid=www_users.userid INNER JOIN currencies - ON purchorderauth.currabrev=currencies.currabrev'; + ON purchorderauth.currabrev=currencies.currabrev"; $ErrMsg = _('The authentication details cannot be retrieved because'); $Result=DB_query($sql,$db,$ErrMsg); @@ -134,17 +134,18 @@ } else { $OffHold=_('No'); } - echo '<tr><td>' . $myrow['userid'] . '</td> - <td>' . $myrow['realname'] . '</td> - <td>' . $myrow['currency'] . '</td> - <td>' . $CanCreate . '</td> - <td>' . $OffHold . '</td> - <td class="number">'.number_format($myrow['authlevel'],2).'</td> - <td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?Edit=Yes&UserID=' . $myrow['userid'] . -'&Currency='.$myrow['currabrev'].'">'._('Edit').'</td> - <td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?Delete=Yes&UserID=' . $myrow['userid'] . -'&Currency='.$myrow['currabrev'].'">'._('Delete').'</td> - </tr>'; + echo '<tr> + <td>' . $myrow['userid'] . '</td> + <td>' . $myrow['realname'] . '</td> + <td>' . $myrow['currency'] . '</td> + <td>' . $CanCreate . '</td> + <td>' . $OffHold . '</td> + <td class="number">'.number_format($myrow['authlevel'],2).'</td> + <td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?Edit=Yes&UserID=' . $myrow['userid'] . + '&Currency='.$myrow['currabrev'].'">'._('Edit').'</td> + <td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?Delete=Yes&UserID=' . $myrow['userid'] . + '&Currency='.$myrow['currabrev'].'" onclick="return confirm(\'' . _('Are you sure you wish to delete this authorisation level?') . '\');">'._('Delete').'</td> + </tr>'; } echo '</table><br><br>'; @@ -158,7 +159,7 @@ echo '<input type=hidden name=UserID value="'.$UserID.'"'; } else { echo '<tr><td>'._('User ID').'</td><td><select name=UserID>'; - $usersql='SELECT userid FROM www_users'; + $usersql="SELECT userid FROM www_users"; $userresult=DB_query($usersql,$db); while ($myrow=DB_fetch_array($userresult)) { if ($myrow['userid']==$UserID) { @@ -174,12 +175,14 @@ $CurrencySQL="SELECT currency FROM currencies WHERE currabrev='".$Currency."'"; $CurrencyResult=DB_query($CurrencySQL,$db); $myrow=DB_fetch_array($CurrencyResult); - echo '<tr><td>'._('Currency').'</td> - <td>' . $myrow['currency'] . '</td></tr>'; + echo '<tr> + <td>'._('Currency').'</td> + <td>' . $myrow['currency'] . '</td> + </tr>'; echo '<input type=hidden name="currabrev" value="'.$Currency.'"'; } else { echo '<tr><td>'._('Currency').'</td><td><select name="CurrCode">'; - $currencysql='SELECT currabrev,currency FROM currencies'; + $currencysql="SELECT currabrev,currency FROM currencies"; $currencyresult=DB_query($currencysql,$db); while ($myrow=DB_fetch_array($currencyresult)) { if ($myrow['currabrev']==$Currency) { Modified: trunk/PO_AuthoriseMyOrders.php =================================================================== --- trunk/PO_AuthoriseMyOrders.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/PO_AuthoriseMyOrders.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -1,7 +1,7 @@ <?php /* $Id$*/ -//$PageSecurity = 4; + include('includes/session.inc'); $title = _('Authorise Purchase Orders'); @@ -11,22 +11,22 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="" />' . ' ' . $title . '</p>'; -$emailsql="SELECT email FROM www_users WHERE userid='".$_SESSION['UserID']."'"; -$emailresult=DB_query($emailsql, $db); -$emailrow=DB_fetch_array($emailresult); +$EmailSQL="SELECT email FROM www_users WHERE userid='".$_SESSION['UserID']."'"; +$EmailResult=DB_query($EmailSQL, $db); +$EmailRow=DB_fetch_array($EmailResult); -if (isset($_POST['updateall'])) { +if (isset($_POST['UpdateAll'])) { foreach ($_POST as $key => $value) { if (substr($key,0,6)=='status') { - $orderno=substr($key,6); - $status=$_POST['status'.$orderno]; - $comment=date($_SESSION['DefaultDateFormat']).' - '._('Authorised by').' '.'<a href="mailto:'. - $emailrow['email'].'">'.$_SESSION['UserID'].'</a><br>'.$_POST['comment']; + $OrderNo=substr($key,6); + $Status=$_POST['status'.$OrderNo]; + $Comment=date($_SESSION['DefaultDateFormat']).' - '._('Authorised by').' '.'<a href="mailto:' . $EmailRow['email'].'">'.$_SESSION['UserID'].'</a> + <br />' . $_POST['comment']; $sql="UPDATE purchorders - SET status='".$status."', - stat_comment='".$comment."', - allowprint=1 - WHERE orderno='".$orderno."'"; + SET status='".$Status."', + stat_comment='".$Comment."', + allowprint=1 + WHERE orderno='".$OrderNo."'"; $result=DB_query($sql, $db); } } @@ -38,91 +38,98 @@ suppliers.suppname, suppliers.currcode, www_users.realname, - www_users.email - FROM purchorders - LEFT JOIN suppliers + www_users.email, + currencies.decimalplaces + FROM purchorders INNER JOIN suppliers ON suppliers.supplierid=purchorders.supplierno - LEFT JOIN www_users + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + INNER JOIN www_users ON www_users.userid=purchorders.initiator WHERE status='Pending'"; $result=DB_query($sql, $db); echo '<form method=post action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection><tr>'; +echo '<table class="selection">'; /* Create the table for the purchase order header */ -echo '<th>'._('Order Number').'</th>'; -echo '<th>'._('Supplier').'</th>'; -echo '<th>'._('Date Ordered').'</th>'; -echo '<th>'._('Initiator').'</th>'; -echo '<th>'._('Delivery Date').'</th>'; -echo '<th>'._('Status').'</th>'; -echo '</tr>'; +echo '<tr> + <th>'._('Order Number').'</th> + <th>'._('Supplier').'</th> + <th>'._('Date Ordered').'</th> + <th>'._('Initiator').'</th> + <th>'._('Delivery Date').'</th> + <th>'._('Status').'</th> + </tr>'; while ($myrow=DB_fetch_array($result)) { - $authsql="SELECT authlevel FROM purchorderauth + $AuthSQL="SELECT authlevel FROM purchorderauth WHERE userid='".$_SESSION['UserID']."' AND currabrev='".$myrow['currcode']."'"; - $authresult=DB_query($authsql, $db); - $myauthrow=DB_fetch_array($authresult); - $authlevel=$myauthrow['authlevel']; + $AuthResult=DB_query($AuthSQL, $db); + $myauthrow=DB_fetch_array($AuthResult); + $AuthLevel=$myauthrow['authlevel']; - $ordervaluesql="SELECT sum(unitprice*quantityord) as ordervalue + $OrderValueSQL="SELECT sum(unitprice*quantityord) as ordervalue FROM purchorderdetails WHERE orderno='".$myrow['orderno'] . "'"; - $ordervalueresult=DB_query($ordervaluesql, $db); - $myordervaluerow=DB_fetch_array($ordervalueresult); - $ordervalue=$myordervaluerow['ordervalue']; + $OrderValueResult=DB_query($OrderValueSQL, $db); + $MyOrderValueRow=DB_fetch_array($OrderValueResult); + $OrderValue=$MyOrderValueRow['ordervalue']; - if ($authlevel>=$ordervalue) { - echo '<tr>'; - echo '<td>'.$myrow['orderno'].'</td>'; - echo '<td>'.$myrow['suppname'].'</td>'; - echo '<td>'.ConvertSQLDate($myrow['orddate']).'</td>'; - echo '<td><a href="mailto:'.$myrow['email'].'">'.$myrow['realname'].'</td>'; - echo '<td>'.ConvertSQLDate($myrow['deliverydate']).'</td>'; - echo '<td><select name=status'.$myrow['orderno'].'>'; - echo '<option selected value="Pending">'._('Pending').'</option>'; - echo '<option value="Authorised">'._('Authorised').'</option>'; - echo '<option value="Rejected">'._('Rejected').'</option>'; - echo '<option value="Cancelled">'._('Cancelled').'</option>'; - echo '</select></td>'; - echo '</tr>'; + if ($AuthLevel>=$OrderValue) { + echo '<tr> + <td>'.$myrow['orderno'].'</td> + <td>'.$myrow['suppname'].'</td> + <td>'.ConvertSQLDate($myrow['orddate']).'</td> + <td><a href="mailto:'.$myrow['email'].'">'.$myrow['realname'].'</td> + <td>'.ConvertSQLDate($myrow['deliverydate']).'</td> + <td><select name=status'.$myrow['orderno'].'> + <option selected value="Pending">'._('Pending').'</option> + <option value="Authorised">'._('Authorised').'</option> + <option value="Rejected">'._('Rejected').'</option> + <option value="Cancelled">'._('Cancelled').'</option> + </select></td> + </tr>'; echo "<input type='hidden' name='comment' value='".$myrow['stat_comment']."'>"; - $linesql="SELECT purchorderdetails.*, + $LineSQL="SELECT purchorderdetails.*, stockmaster.description FROM purchorderdetails LEFT JOIN stockmaster ON stockmaster.stockid=purchorderdetails.itemcode WHERE orderno='".$myrow['orderno'] . "'"; - $lineresult=DB_query($linesql, $db); + $LineResult=DB_query($LineSQL, $db); - echo '<tr><td></td><td colspan=5 align=left><table class=selection align=left>'; - echo '<th>'._('Product').'</th>'; - echo '<th>'._('Quantity Ordered').'</th>'; - echo '<th>'._('Currency').'</th>'; - echo '<th>'._('Price').'</th>'; - echo '<th>'._('Line Total').'</th>'; - echo '</tr>'; + echo '<tr> + <td></td> + <td colspan="5" align="left"> + <table class="selection" align="left"> + <tr> + <th>'._('Product').'</th> + <th>'._('Quantity Ordered').'</th> + <th>'._('Currency').'</th> + <th>'._('Price').'</th> + <th>'._('Line Total').'</th> + </tr>'; - while ($linerow=DB_fetch_array($lineresult)) { - echo '<tr>'; - echo '<td>'.$linerow['description'].'</td>'; - echo '<td class="number">'.number_format($linerow['quantityord'],2).'</td>'; - echo '<td>'.$myrow['currcode'].'</td>'; - echo '<td class="number">'.number_format($linerow['unitprice'],2).'</td>'; - echo '<td class="number">'.number_format($linerow['unitprice']*$linerow['quantityord'],2).'</td>'; - echo '</tr>'; + while ($linerow=DB_fetch_array($LineResult)) { + echo '<tr> + <td>'.$linerow['description'].'</td> + <td class="number">'.number_format($linerow['quantityord'],2).'</td> + <td>'.$myrow['currcode'].'</td> + <td class="number">'.number_format($linerow['unitprice'],$myrow['decimalplaces']).'</td> + <td class="number">'.number_format($linerow['unitprice']*$linerow['quantityord'],$myrow['decimalplaces']).'</td> + </tr>'; } // end while order line detail echo '</table></td></tr>'; } } //end while header loop echo '</table>'; -echo '<br><div class="centre"><input type="submit" name="updateall" value="' . _('Update'). '"></form>'; +echo '<br><div class="centre"><input type="submit" name="UpdateAll" value="' . _('Update'). '"></form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PO_SelectPurchOrder.php =================================================================== --- trunk/PO_SelectPurchOrder.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/PO_SelectPurchOrder.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -1,6 +1,6 @@ <?php /* $Id$*/ -//$PageSecurity = 2; + include ('includes/session.inc'); $title = _('Search Purchase Orders'); include ('includes/header.inc'); @@ -110,14 +110,14 @@ while ($myrow = DB_fetch_array($resultStkLocs)) { if (isset($_POST['StockLocation'])) { if ($myrow['loccode'] == $_POST['StockLocation']) { - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode'] == $_SESSION['UserStockLocation']) { - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } echo '</select> ' . _('Order Status:') .' <select name="Status">'; @@ -160,9 +160,9 @@ echo '<tr><td><font size=1>' . _('Select a stock category') . ':</font><select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { if (isset($_POST['StockCat']) and $myrow1['categoryid'] == $_POST['StockCat']) { - echo "<option selected value='" . $myrow1['categoryid'] . "'>" . $myrow1['categorydescription']; + echo '<option selected value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } else { - echo "<option value='" . $myrow1['categoryid'] . "'>" . $myrow1['categorydescription']; + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } } echo '</select><td><font size=1>' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td>'; @@ -191,12 +191,12 @@ echo '<tr bgcolor="#EEEEEE">'; $k = 1; } - echo "<td><input type=submit name='SelectedStockItem' value='" . $myrow['stockid'] . "'</td> - <td>" . $myrow['description'] . "</td> - <td class=number>" . $myrow['qoh'] . "</td> - <td class=number>" . $myrow['qord'] . "</td> - <td>" . $myrow['units'] . "</td> - </tr>"; + echo '<td><input type="submit" name="SelectedStockItem" value="' . $myrow['stockid'] . '"</td> + <td>' . $myrow['description'] . '</td> + <td class=number>' . $myrow['qoh'] . '</td> + <td class=number>' . $myrow['qord'] . '</td> + <td>' . $myrow['units'] . '</td> + </tr>'; $j++; if ($j == 12) { $j = 1; @@ -234,14 +234,25 @@ purchorders.allowprint, purchorders.status, suppliers.currcode, + currencies.decimalplaces, SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorders.orderno='" . $OrderNumber . "' - GROUP BY purchorders.orderno"; + FROM purchorders + INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE purchorders.orderno='" . $OrderNumber . "' + GROUP BY purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + purchorders.status, + suppliers.currcode, + currencies.decimalplaces"; } else { /* $DateAfterCriteria = FormatDateforSQL($OrdersAfterDate); */ if (empty($_POST['StockLocation'])) { @@ -257,13 +268,16 @@ purchorders.allowprint, purchorders.status, suppliers.currcode, + currencies.decimalplaces, SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorderdetails.itemcode='" . $SelectedStockItem . "' + FROM purchorders + INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE purchorderdetails.itemcode='" . $SelectedStockItem . "' AND purchorders.supplierno='" . $SelectedSupplier . "' AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' " . $StatusCriteria . " @@ -273,7 +287,8 @@ purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, - suppliers.currcode"; + suppliers.currcode, + currencies.decimalplaces"; } else { $SQL = "SELECT purchorders.orderno, suppliers.suppname, @@ -283,13 +298,16 @@ purchorders.allowprint, purchorders.status, suppliers.currcode, + currencies.decimalplaces, SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorders.supplierno='" . $SelectedSupplier . "' + FROM purchorders + INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE purchorders.supplierno='" . $SelectedSupplier . "' AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' " . $StatusCriteria . " GROUP BY purchorders.orderno, @@ -298,7 +316,8 @@ purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, - suppliers.currcode"; + suppliers.currcode, + currencies.decimalplaces"; } } else { //no supplier selected if (isset($SelectedStockItem)) { @@ -310,13 +329,16 @@ purchorders.allowprint, purchorders.status, suppliers.currcode, + currencies.decimalplaces, SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorderdetails.itemcode='" . $SelectedStockItem . "' + FROM purchorders + INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE purchorderdetails.itemcode='" . $SelectedStockItem . "' AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' " . $StatusCriteria . " GROUP BY purchorders.orderno, @@ -325,7 +347,8 @@ purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, - suppliers.currcode"; + suppliers.currcode, + currencies.decimalplaces"; } else { $SQL = "SELECT purchorders.orderno, suppliers.suppname, @@ -335,13 +358,16 @@ purchorders.allowprint, purchorders.status, suppliers.currcode, + currencies.decimalplaces, sum(purchorderdetails.unitprice*purchorderdetails.quantityord) as ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' + FROM purchorders + INNER JOIN purchorderdetails + ON purchorders.orderno = purchorderdetails.orderno + INNER JOIN suppliers + ON purchorders.supplierno = suppliers.supplierid + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' " . $StatusCriteria . " GROUP BY purchorders.orderno, suppliers.suppname, @@ -349,7 +375,8 @@ purchorders.initiator, purchorders.requisitionno, purchorders.allowprint, - suppliers.currcode"; + suppliers.currcode, + currencies.decimalplaces"; } } //end selected supplier @@ -360,15 +387,16 @@ if (DB_num_rows($PurchOrdersResult) > 0) { /*show a table of the orders returned by the SQL */ echo '<table cellpadding=2 colspan=7 width=90% class=selection>'; - $TableHeader = '<tr><th>' . _('View') . '</th> - <th>' . _('Supplier') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Requisition') . '</th> - <th>' . _('Order Date') . '</th> - <th>' . _('Initiator') . '</th> - <th>' . _('Order Total') . '</th> - <th>' . _('Status') . '</th> - </tr>'; + $TableHeader = '<tr> + <th>' . _('View') . '</th> + <th>' . _('Supplier') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Requisition') . '</th> + <th>' . _('Order Date') . '</th> + <th>' . _('Initiator') . '</th> + <th>' . _('Order Total') . '</th> + <th>' . _('Status') . '</th> + </tr>'; echo $TableHeader; $j = 1; $k = 0; //row colour counter @@ -380,9 +408,9 @@ echo '<tr bgcolor="#EEEEEE">'; $k++; } - $ViewPurchOrder = $rootpath . '/PO_OrderDetails.php?' . SID . 'OrderNo=' . $myrow['orderno']; + $ViewPurchOrder = $rootpath . '/PO_OrderDetails.php?OrderNo=' . $myrow['orderno']; $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); - $FormatedOrderValue = number_format($myrow['ordervalue'], 2); + $FormatedOrderValue = number_format($myrow['ordervalue'], $myrow['decimalplaces']); /* View Supplier Currency Requisition Order Date Initiator Order Total ModifyPage, $myrow["orderno"], $myrow["suppname"], $myrow["currcode"], $myrow["requisitionno"] $FormatedOrderDate, $myrow["initiator"] $FormatedOrderValue Order Status*/ echo '<td><a href="' . $ViewPurchOrder . '">' . $myrow['orderno'] . '</a></td> Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/Payments.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -231,10 +231,10 @@ } /*Make an array of the defined bank accounts */ - $SQL = 'SELECT bankaccounts.accountcode + $SQL = "SELECT bankaccounts.accountcode FROM bankaccounts, chartmaster - WHERE bankaccounts.accountcode=chartmaster.accountcode'; + WHERE bankaccounts.accountcode=chartmaster.accountcode"; $result = DB_query($SQL,$db); $BankAccounts = array(); $i=0; @@ -270,8 +270,8 @@ } else { //Start a transaction to do the whole lot inside - $SQL = 'BEGIN'; - $result = DB_query($SQL,$db); + + $result = DB_Txn_Begin($db); if ($_SESSION['PaymentDetail']->SupplierID=='') { @@ -643,7 +643,7 @@ } else if ($_POST['GLCode'] == '') { prnMsg( _('No General Ledger code has been chosen') . ' - ' . _('so this GL analysis item could not be added'),'warn'); } else { - $SQL = "select accountname FROM chartmaster WHERE accountcode='" . $_POST['GLCode'] . "'"; + $SQL = "SELECT accountname FROM chartmaster WHERE accountcode='" . $_POST['GLCode'] . "'"; $Result=DB_query($SQL,$db); $myrow=DB_fetch_array($Result); $_SESSION['PaymentDetail']->add_to_glanalysis($_POST['GLAmount'], @@ -702,7 +702,7 @@ } -echo '<form action=' . $_SERVER['PHP_SELF'] . '?' . SID . ' method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/PcAssignCashToTab.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -49,8 +49,8 @@ } $sqlLimit = "SELECT tablimit - FROM pctabs - WHERE tabcode='" . $SelectedTabs . "'"; + FROM pctabs + WHERE tabcode='" . $SelectedTabs . "'"; $ResultLimit = DB_query($sqlLimit,$db); $Limit=DB_fetch_array($ResultLimit); @@ -63,10 +63,10 @@ $sql = "UPDATE pcashdetails SET date = '".FormatDateForSQL($_POST['Date'])."', - amount = '" . $_POST['Amount'] . "', - authorized = '0000-00-00', - notes = '" . $_POST['Notes'] . "', - receipt = '" . $_POST['Receipt'] . "' + amount = '" . $_POST['Amount'] . "', + authorized = '0000-00-00', + notes = '" . $_POST['Notes'] . "', + receipt = '" . $_POST['Receipt'] . "' WHERE counterindex = '" . $SelectedIndex . "'"; $msg = _('Assignment of cash to PC Tab ') . ' ' . $SelectedTabs . ' ' . _('has been updated'); @@ -163,7 +163,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title. '</p>'; } - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Details Of Petty Cash Tab ') . '' .$SelectedTabs. '<a/></div>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Details Of Petty Cash Tab ') . '' .$SelectedTabs. '<a/></div>'; if (! isset($_GET['edit']) OR isset ($_POST['GO'])){ @@ -263,7 +263,7 @@ } echo '<tr><td colspan="2" style="text-align:right"><b>' . _('Current balance') . ':</b></td> - <td>' . number_format($Amount['0'],2) . '</td></tr>'; + <td>' . number_format($Amount['0'],2) . '</td></tr>'; echo '</table>'; @@ -277,7 +277,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p><table class=selection>'; //Main table + echo '<p><table class="selection">'; //Main table if (isset($_GET['SelectedIndex'])) { echo '<tr><th colspan="2"><font color=blue size=3>'._('Update Cash Assignment').'</font></th></tr>'; } else { Modified: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php 2011-05-11 10:03:40 UTC (rev 4564) +++ trunk/PcClaimExpensesFromTab.php 2011-05-13 10:50:42 UTC (rev 4565) @@ -43,7 +43,7 @@ if ($_POST['amount']==0) { $InputError = 1; - prnMsg('<br>' . _('The Amount must be greater than 0'),'error'); + prnMsg( _('The Amount must be greater than 0'),'error'); $Errors[$i] = 'TabCode'; $i++; } @@ -83,7 +83,7 @@ '" . $_POST['Receipt'] . "' )"; - $msg = _('The Expense Claim on Tab') . ' ' . $_POST["SelectedTabs"] . ' ' . _('has been created'); + $msg = _('The Expense Claim on Tab') . ' ' . $_POST['SelectedTabs'] . ' ' . _('has been created'); } if ( $InputError !=1) { @@ -154,7 +154,7 @@ //end of ifs and buts! if (isset($_POST['process'])OR isset($SelectedTabs)) { - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Petty Cash Tab ') . '' .$SelectedTabs. '<a/></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Petty Cash Tab ') . '' .$SelectedTabs. '<a/></div><p>'; /* RICARD */ if (! isset($_GET['edit']) OR isset ($_POST['GO'])){ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; @@ -186,13 +186,13 @@ echo '<br><table border=1>'; echo '<tr> - <th>' . _('Date Of Expense') . '</th> - <th>' . _('Expense Description') . '</th> - <th>' . _('Amount') . '</th> - <th>' . _('Authorized') . '</th> - <th>' . _('Notes') . '</th> - <th>' . _('Receipt') . '</th> - </tr>'; + <th>' . _('Date Of Expense') . '</th> + <th>' . _('Expense Description') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Authorized') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Receipt') . '</th> + </tr>'; $k=0; //row colour counter @@ -216,17 +216,17 @@ $Description['0']='ASSIGNCASH'; } - if (($myrow['5'] == "0000-00-00") and ($Description['0'] != 'ASSIGNCASH')){ + if (($myrow['5'] == '0000-00-00') and ($Description['0'] != 'ASSIGNCASH')){ // only movements NOT authorized can be modified or deleted - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td class=number>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href='%sSelectedIndex=%s&SelectedTabs=$SelectedTabs&Days=$Days&edit=yes'>" . _('Edit') . "</td> - <td><a href='%sSelectedIndex=%s&SelectedTabs=$SelectedTabs&Days=$Days&delete=yes' onclick=\"return confirm('" . _('Are you sure you wish to delete this code and the expense it may have set up?') . "');\">" . _('Delete') . "</td> - </tr>", + <td><a href="%sSelectedIndex=%s&SelectedTabs=' . $SelectedTabs . '&Days=' . $Days . '&edit=yes">' . _('Edit') . '</td> + <td><a href="%sSelectedIndex=%s&SelectedTabs=' . $SelectedTabs . '&Days=' . $Days . '&delete=yes" onclick=\'return confirm("' . _('Are you sure you wish to delete this code and the expenses it may have set up?') . '");\'>' . _('Delete') . '</td> + </tr>', ConvertSQLDate($myrow['2']), $Description['0'], number_format($myrow['4'],2), @@ -236,13 +236,13 @@ $_SERVER['PHP_SELF'] . '?', $myrow['0'], $_SERVER['PHP_SELF'] . '?', $myrow['0']); } else { - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td class=number>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> - </tr>", + </tr>', ConvertSQLDate($myrow['2']), $Description['0'], number_format($myrow['4'],2), @@ -325,7 +325,7 @@ if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['codeexpense'] . '">' . $myrow['codeexpense'] . ' - ' . $myrow['description'] . '</option>'; @@ -357,7 +357,7 @@ echo '<input type="hidden" name="Days" value="' .$Days. '">'; echo '</table>'; // close table in first column echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><in... [truncated message content] |