From: <dai...@us...> - 2011-10-29 06:00:02
|
Revision: 4735 http://web-erp.svn.sourceforge.net/web-erp/?rev=4735&view=rev Author: daintree Date: 2011-10-29 05:59:53 +0000 (Sat, 29 Oct 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/AccountGroups.php trunk/AddCustomerContacts.php trunk/AddCustomerNotes.php trunk/AddCustomerTypeNotes.php trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/BankMatching.php trunk/BankReconciliation.php trunk/COGSGLPostings.php trunk/CompanyPreferences.php trunk/ConfirmDispatchControlled_Invoice.php trunk/ConfirmDispatch_Invoice.php trunk/SelectCustomer.php trunk/doc/Change.log trunk/reportwriter/FormMaker.php trunk/reportwriter/ReportMaker.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-10-29 03:26:27 UTC (rev 4734) +++ trunk/AccountGroups.php 2011-10-29 05:59:53 UTC (rev 4735) @@ -72,6 +72,14 @@ $Errors[$i] = 'GroupName'; $i++; } + if (!is_numeric(filter_number_format($_POST['SequenceInTB']))){ + $InputError = 1; + prnMsg( _('The sequence that the account group is listed in the trial balance is expected to be numeric'),'error'); + $Errors[$i] = 'SequenceInTB'; + $i++; + } else { + $_POST['SequenceInTB'] = filter_number_format($_POST['SequenceInTB']); + } if (mb_strlen($_POST['GroupName'])==0){ $InputError = 1; prnMsg( _('The account group name must be at least one character long'),'error'); @@ -109,20 +117,8 @@ $Errors[$i] = 'SectionInAccounts'; $i++; } - if (!is_long((int) $_POST['SequenceInTB'])) { - $InputError = 1; - prnMsg( _('The sequence in the trial balance must be an integer'),'error'); - $Errors[$i] = 'SequenceInTB'; - $i++; - } - if (!is_numeric($_POST['SequenceInTB']) or $_POST['SequenceInTB'] > 10000) { - $InputError = 1; - prnMsg( _('The sequence in the TB must be numeric and less than') . ' 10,000','error'); - $Errors[$i] = 'SequenceInTB'; - $i++; - } + - if ($_POST['SelectedAccountGroup']!='' AND $InputError !=1) { /*SelectedAccountGroup could also exist if submit had not been clicked this code would not run in this case cos submit is false of course see the delete code below*/ @@ -150,9 +146,9 @@ parentgroupname) VALUES ( '" . $_POST['GroupName'] . "', - " . $_POST['SectionInAccounts'] . ", - " . $_POST['SequenceInTB'] . ", - " . $_POST['PandL'] . ", + '" . $_POST['SectionInAccounts'] . "', + '" . $_POST['SequenceInTB'] . "', + '" . $_POST['PandL'] . "', '" . $_POST['ParentGroupName'] . "' )"; $ErrMsg = _('An error occurred in inserting the account group'); @@ -213,13 +209,13 @@ or deletion of the records*/ $sql = "SELECT groupname, - sectionname, - sequenceintb, - pandl, - parentgroupname - FROM accountgroups - LEFT JOIN accountsection ON sectionid = sectioninaccounts - ORDER BY sequenceintb"; + sectionname, + sequenceintb, + pandl, + parentgroupname + FROM accountgroups + LEFT JOIN accountsection ON sectionid = sectioninaccounts + ORDER BY sequenceintb"; $DbgMsg = _('The sql that was used to retrieve the account group information was '); $ErrMsg = _('Could not get account groups because'); @@ -236,7 +232,7 @@ </tr>'; $k=0; //row colour counter - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -246,7 +242,7 @@ $k++; } - switch ($myrow[3]) { + switch ($myrow['pandl']) { case -1: $PandLText=_('Yes'); break; @@ -257,14 +253,14 @@ $PandLText=_('No'); break; } //end of switch statement - - echo '<td>' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '</td> - <td>' . $myrow[1] . '</td> - <td>' . $myrow[2] . '</td> + + echo '<td>' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '</td> + <td>' . $myrow['sectionname'] . '</td> + <td>' . $myrow['sequenceintb'] . '</td> <td>' . $PandLText . '</td> - <td>' . $myrow[4] . '</td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this account group?') . '\');">' . _('Delete') .'</a></td></tr>'; + <td>' . $myrow['parentgroupname'] . '</td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedAccountGroup=' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedAccountGroup=' . htmlentities($myrow['groupname'], ENT_QUOTES,'UTF-8') . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this account group?') . '\');">' . _('Delete') .'</a></td></tr>'; } //END WHILE LIST LOOP echo '</table>'; @@ -285,12 +281,12 @@ //editing an existing account group $sql = "SELECT groupname, - sectioninaccounts, - sequenceintb, - pandl, - parentgroupname - FROM accountgroups - WHERE groupname='" . $_GET['SelectedAccountGroup'] ."'"; + sectioninaccounts, + sequenceintb, + pandl, + parentgroupname + FROM accountgroups + WHERE groupname='" . $_GET['SelectedAccountGroup'] ."'"; $ErrMsg = _('An error occurred in retrieving the account group information'); $DbgMsg = _('The SQL that was used to retrieve the account group and that failed in the process was'); Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2011-10-29 03:26:27 UTC (rev 4734) +++ trunk/AddCustomerContacts.php 2011-10-29 05:59:53 UTC (rev 4735) @@ -197,14 +197,14 @@ $_POST['ContactNotes'] = $myrow['notes']; $_POST['ContactEmail'] = $myrow['email']; $_POST['DebtorNo'] = $myrow['debtorno']; - echo '<input type=hidden name="Id" value='. $Id .'>'; - echo '<input type=hidden name="Con_ID" value=' . $_POST['Con_ID'] . '>'; - echo '<input type=hidden name="DebtorNo" value=' . $_POST['DebtorNo'] . '>'; + echo '<input type="hidden" name="Id" value="'. $Id .'" />'; + echo '<input type="hidden" name="Con_ID" value="' . $_POST['Con_ID'] . '" />'; + echo '<input type="hidden" name="DebtorNo" value="' . $_POST['DebtorNo'] . '" />'; echo '<br /> <table class="selection"> <tr> - <td>'. _('Contact Code').':</td> - <td>' . $_POST['Con_ID'] . '</td> + <td>'. _('Contact Code').':</td> + <td>' . $_POST['Con_ID'] . '</td> </tr>'; } else { echo '<br /> @@ -213,37 +213,54 @@ echo '<tr><td>'. _('Contact Name') . '</td>'; if (isset($_POST['ContactName'])) { - echo '<td><input type="text" name="ContactName" value="' . $_POST['ContactName']. '" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="ContactName" value="' . $_POST['ContactName']. '" size="35" maxlength="40" /></td> + </tr>'; } else { - echo '<td><input type="text" name="ContactName" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="ContactName" size="35" maxlength="40" /></td> + </tr>'; } - echo '<tr><td>' . _('Role') . '</td>'; + echo '<tr> + <td>' . _('Role') . '</td>'; if (isset($_POST['ContactRole'])) { - echo '<td><input type="text" name="ContactRole" value="'. $_POST['ContactRole']. '" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="ContactRole" value="'. $_POST['ContactRole']. '" size="35" maxlength="40" /></td> + </tr>'; } else { - echo '<td><input type="text" name="ContactRole" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="ContactRole" size="35" maxlength="40" /></td> + </tr>'; } echo '<tr><td>' . _('Phone') . '</td>'; if (isset($_POST['ContactPhone'])) { - echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="ContactPhone" value="' . $_POST['ContactPhone'] . '" size="35" maxlength="40" /></td> + </tr>'; } else { - echo '<td><input type="text" name="ContactPhone" size=35 maxlength=40></td></tr>'; + echo '<td><input type="text" name="ContactPhone" size="35" maxlength="40" /></td> + </tr>'; } - echo '<tr><td>' . _('Email') . '</td>'; + echo '<tr> + <td>' . _('Email') . '</td>'; if (isset($_POST['ContactEmail'])) { - echo '<td><input type="text" name="ContactEmail" value="' . $_POST['ContactEmail'] . '" size=55 maxlength="55"></td></tr>'; + echo '<td><input type="text" name="ContactEmail" value="' . $_POST['ContactEmail'] . '" size="55" maxlength="55" /></td> + </tr>'; } else { - echo '<td><input type="text" name="ContactEmail" size="55" maxlength="55"></td></tr>'; + echo '<td><input type="text" name="ContactEmail" size="55" maxlength="55" /></td> + </tr>'; } - echo '<tr><td>' . _('Notes') . '</td>'; + echo '<tr> + <td>' . _('Notes') . '</td>'; if (isset($_POST['ContactNotes'])) { echo '<td><textarea name="ContactNotes">'. $_POST['ContactNotes'] . '</textarea>'; } else { echo '<td><textarea name="ContactNotes"></textarea>'; } - echo '<tr><td colspan=2><div class="centre"><input type="Submit" name="submit" value="'. _('Enter Information') . '"></div></td></tr>'; - echo '</table>'; - echo '</form>'; + echo '<tr> + <td colspan="2"> + <div class="centre"> + <input type="submit" name="submit" value="'. _('Enter Information') . '" /> + </div> + </td> + </tr> + </table> + </form>'; } //end if record deleted no point displaying form to add record Modified: trunk/AddCustomerNotes.php =================================================================== --- trunk/AddCustomerNotes.php 2011-10-29 03:26:27 UTC (rev 4734) +++ trunk/AddCustomerNotes.php 2011-10-29 05:59:53 UTC (rev 4735) @@ -18,7 +18,9 @@ $DebtorNo = $_GET['DebtorNo']; } -echo '<a href="' . $rootpath . '/SelectCustomer.php?DebtorNo=' . $DebtorNo . '">' . _('Back to Select Customer') . '</a><br />'; +echo '<a href="' . $rootpath . '/SelectCustomer.php?DebtorNo=' . $DebtorNo . '">' . _('Back to Select Customer') . '</a> + <br />'; + if ( isset($_POST['submit']) ) { //initialise no input errors assumed initially before we test @@ -102,18 +104,25 @@ '" alt="" />' . _('Notes for Customer').': <b>' .$row['name'].'</b></p> <br />'; - $sql = "SELECT * FROM custnotes + $sql = "SELECT noteid, + debtorno, + href, + note, + date, + priority + FROM custnotes WHERE debtorno='".$DebtorNo."' ORDER BY date DESC"; $result = DB_query($sql,$db); //echo '<br />'.$sql; - echo '<table class=selection>'; - echo '<tr> + echo '<table class="selection"> + <tr> <th>' . _('Date') . '</th> <th>' . _('Note') . '</th> <th>' . _('WWW') . '</th> - <th>' . _('Priority') . '</th>'; + <th>' . _('Priority') . '</th> + </tr>'; $k=0; //row colour counter @@ -127,40 +136,50 @@ } printf('<td>%s</td> <td>%s</td> + <td><a href="%s">%s</a></td> <td>%s</td> - <td>%s</td> <td><a href="%sId=%s&DebtorNo=%s">'. _('Edit').' </td> - <td><a href="%sId=%s&DebtorNo=%s&delete=1">'. _('Delete'). '</td></tr>', - ConvertSQLDate($myrow[4]), - $myrow[3], - $myrow[2], - $myrow[5], + <td><a href="%sId=%s&DebtorNo=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this customer note?') . '\');">'. _('Delete'). '</td></tr>', + ConvertSQLDate($myrow['date']), + $myrow['note'], + $myrow['href'], + $myrow['href'], + $myrow['priority'], htmlspecialchars($_SERVER['PHP_SELF']) . '?', - $myrow[0], - $myrow[1], + $myrow['noteid'], + $myrow['debtorno'], htmlspecialchars($_SERVER['PHP_SELF']) . '?', - $myrow[0], - $myrow[1]); + $myrow['noteid'], + $myrow['priority']); } //END WHILE LIST LOOP echo '</table>'; } if (isset($Id)) { - echo '<div class="centre"><a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorNo='.$DebtorNo.'">'._('Review all notes for this Customer').'</a></div>'; + echo '<div class="centre"> + <a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorNo='.$DebtorNo.'">'._('Review all notes for this Customer').'</a> + </div>'; } echo '<br />'; if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID . '&DebtorNo='.$DebtorNo.'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorNo='.$DebtorNo.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { //editing an existing - $sql = "SELECT * FROM custnotes WHERE noteid='".$Id."' - and debtorno='".$DebtorNo."'"; + $sql = "SELECT noteid, + debtorno, + href, + note, + date, + priority + FROM custnotes + WHERE noteid='".$Id."' + AND debtorno='".$DebtorNo."'"; $result = DB_query($sql, $db); @@ -172,47 +191,64 @@ $_POST['date'] = $myrow['date']; $_POST['priority'] = $myrow['priority']; $_POST['debtorno'] = $myrow['debtorno']; - echo '<input type=hidden name="Id" value='. $Id .'>'; - echo '<input type=hidden name="Con_ID" value=' . $_POST['noteid'] . '>'; - echo '<input type=hidden name="DebtorNo" value=' . $_POST['debtorno'] . '>'; + echo '<input type=hidden name="Id" value="'. $Id .'" />'; + echo '<input type=hidden name="Con_ID" value="' . $_POST['noteid'] . '" />'; + echo '<input type=hidden name="DebtorNo" value="' . $_POST['debtorno'] . '" />'; echo '<table class="selection"> - <tr> + <tr> <td>'. _('Note ID').':</td> <td>' . $_POST['noteid'] . '</td> - </tr>'; + </tr>'; } else { echo '<table class="selection">'; } - echo '<tr><td>' . _('Contact Note'). '</td>'; + echo '<tr> + <td>' . _('Contact Note'). '</td>'; if (isset($_POST['note'])) { - echo '<td><textarea name="note">' .$_POST['note'] . '</textarea></td></tr>'; + echo '<td><textarea name="note">' .$_POST['note'] . '</textarea></td> + </tr>'; } else { - echo '<td><textarea name="note"></textarea></td></tr>'; + echo '<td><textarea name="note"></textarea></td> + </tr>'; } - echo '<tr><td>'. _('WWW').'</td>'; + echo '<tr> + <td>'. _('WWW').'</td>'; if (isset($_POST['href'])) { - echo '<td><input type="Text" name="href" value="'.$_POST['href'].'" size=35 maxlength=100></td></tr>'; + echo '<td><input type="text" name="href" value="'.$_POST['href'].'" size="35" maxlength="100" /></td> + </tr>'; } else { - echo '<td><input type="Text" name="href" size=35 maxlength=100></td></tr>'; + echo '<td><input type="text" name="href" size="35" maxlength="100" /></td> + </tr>'; } - echo '<tr><td>' . _('Date') .'</td>'; + echo '<tr> + <td>' . _('Date') .'</td>'; if (isset($_POST['date'])) { - echo '<td><input type="text" name="date" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" value="'.ConvertSQLDate($_POST['date']).'" size=10 maxlength=10></td></tr>'; + echo '<td><input type="text" name="date" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" value="'.ConvertSQLDate($_POST['date']).'" size="10" maxlength="10" /></td> + </tr>'; } else { - echo '<td><input type="text" name="date" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" size=10 maxlength=10></td></tr>'; + echo '<td><input type="text" name="date" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" size="10" maxlength="10" /></td> + </tr>'; } - echo '<tr><td>'. _('Priority'). '</td>'; + echo '<tr> + <td>'. _('Priority'). '</td>'; if (isset($_POST['priority'])) { - echo '<td><input type="Text" name="priority" value="' .$_POST['priority']. '" size=1 maxlength=3></td></td>'; + echo '<td><input type="text" name="priority" value="' .$_POST['priority']. '" size="1" maxlength="3" /></td> + </tr>'; } else { - echo '<td><input type="text" name="priority" size=1 maxlength=3></td></td>'; + echo '<td><input type="text" name="priority" size="1" maxlength="3" /></td> + </tr>'; } - echo '<tr><td colspan=2><div class="centre"><input type="Submit" name="submit" value="'._('Enter Information').'"></div></td></tr>'; - echo '</table>'; + echo '<tr> + <td colspan="2"> + <div class="centre"> + <input type="submit" name="submit" value="'._('Enter Information').'" /> + </div> + </td> + </tr> + </table> + </form>'; - echo '</form>'; - } //end if record deleted no point displaying form to add record include('includes/footer.inc'); Modified: trunk/AddCustomerTypeNotes.php =================================================================== --- trunk/AddCustomerTypeNotes.php 2011-10-29 03:26:27 UTC (rev 4734) +++ trunk/AddCustomerTypeNotes.php 2011-10-29 05:59:53 UTC (rev 4735) @@ -17,6 +17,7 @@ $DebtorType = $_GET['DebtorType']; } echo '<a href="' . $rootpath . '/SelectCustomer.php?DebtorType='.$DebtorType.'">' . _('Back to Select Customer') . '</a><br />'; + if (isset($_POST['submit']) ) { //initialise no input errors assumed initially before we test @@ -92,19 +93,23 @@ $SQLname="SELECT * from debtortype where typeid='".$DebtorType."'"; $Result = DB_query($SQLname,$db); $row = DB_fetch_array($Result); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . - '" alt="" />' . _('Notes for Customer Type').': <b>' .$row['typename'].'</b></p><br />'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . + '" alt="" />' . _('Notes for Customer Type').': <b>' .$row['typename'].'</b> + </p> + <br />'; $sql = "SELECT * FROM debtortypenotes where typeid='".$DebtorType."' ORDER BY date DESC"; $result = DB_query($sql,$db); - echo '<table class="selection">'; - echo '<tr> + echo '<table class="selection"> + <tr> <th>' . _('Date') . '</th> <th>' . _('Note') . '</th> <th>' . _('href') . '</th> - <th>' . _('Priority') . '</th>'; + <th>' . _('Priority') . '</th> + </tr>'; $k=0; //row colour counter @@ -121,7 +126,8 @@ <td>%s</td> <td>%s</td> <td><a href="%sId=%s&DebtorType=%s">'. _('Edit').' </td> - <td><a href="%sId=%s&DebtorType=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this customer type note?') . '\');">'. _('Delete'). '</td></tr>', + <td><a href="%sId=%s&DebtorType=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this customer type note?') . '\');">'. _('Delete'). '</td> + </tr>', $myrow[4], $myrow[3], $myrow[2], @@ -137,12 +143,12 @@ //END WHILE LIST LOOP echo '</table>'; } -if (isset($Id)) { ?> - <div class="cantre"><a href="<?php echo htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID .'&DebtorType='.$DebtorType;?>"><?=_('Review all notes for this Customer Type')?></a></div> -<?php } ?> -<p> +if (isset($Id)) { + echo '<div class="centre"> + <a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorType=' . $DebtorType . '">' . _('Review all notes for this Customer Type') .'</a> + </div>'; +} -<?php if (!isset($_GET['delete'])) { echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorType='.$DebtorType.'">'; @@ -164,12 +170,16 @@ $_POST['date'] = $myrow['date']; $_POST['priority'] = $myrow['priority']; $_POST['typeid'] = $myrow['typeid']; - echo '<input type=hidden name="Id" value='. $Id .'>'; - echo '<input type=hidden name="Con_ID" value=' . $_POST['noteid'] . '>'; - echo '<input type=hidden name="DebtorType" value=' . $_POST['typeid'] . '>'; - echo '<table class=selection><tr><td>'. _('Note ID').':</td><td>' . $_POST['noteid'] . '</td></tr>'; + echo '<input type="hidden" name="Id" value="'. $Id .'" />'; + echo '<input type="hidden" name="Con_ID" value="' . $_POST['noteid'] . '" />'; + echo '<input type="hidden" name="DebtorType" value="' . $_POST['typeid'] . '" />'; + echo '<table class="selection"> + <tr> + <td>'. _('Note ID').':</td> + <td>' . $_POST['noteid'] . '</td> + </tr>'; } else { - echo '<table class=selection>'; + echo '<table class="selection">'; $_POST['noteid'] = ''; $_POST['note'] = ''; $_POST['href'] = ''; @@ -178,20 +188,29 @@ $_POST['typeid'] = ''; } - echo '<tr><td>'._('Contact Group Note').':</td>'; - echo '<td><textarea name="note">'. $_POST['note'].'</textarea></td></tr>'; - echo '<tr><td>'. _('Web site').':</td>'; - echo '<td><input type="text" name="href" value="'. $_POST['href'].'" size=35 maxlength=100></td></tr> - <tr><td>'. _('Date').':</td>'; - echo '<td><input type="text" name="date" class=date alt="'.$_SESSION['DefaultDateFormat'].'" value="'. $_POST['date']. - '" size=10 maxlength=10></td></tr>'; - echo '<tr><td>'. _('Priority').':</td>'; - echo '<td><input type="Text" name="priority" value="'. $_POST['priority'].'" size=1 maxlength=3></td></td> - </table>'; - echo '<br /><div class="centre"><input type="Submit" name="submit" value="'. _('Enter Information').'"></div>'; + echo '<tr> + <td>'._('Contact Group Note').':</td> + <td><textarea name="note">'. $_POST['note'].'</textarea></td> + </tr> + <tr> + <td>'. _('Web site').':</td> + <td><input type="text" name="href" value="'. $_POST['href'].'" size="35" maxlength="100" /></td> + </tr> + <tr> + <td>'. _('Date').':</td> + <td><input type="text" name="date" class=date alt="'.$_SESSION['DefaultDateFormat'].'" value="'. $_POST['date']. '" size="10" maxlength="10" /></td> + </tr> + <tr> + <td>'. _('Priority').':</td> + <td><input type="text" name="priority" value="'. $_POST['priority'].'" size="1" maxlength="3" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="Submit" name="submit" value="'. _('Enter Information').'" /> + </div> + </form>'; - echo '</form>'; - } //end if record deleted no point displaying form to add record include('includes/footer.inc'); Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-10-29 03:26:27 UTC (rev 4734) +++ trunk/AgedDebtors.php 2011-10-29 05:59:53 UTC (rev 4735) @@ -287,15 +287,15 @@ $TotOD2=0; $ListCount = DB_num_rows($CustomerResult); - $DecimalPlaces =2; //by default + $CurrDecimalPlaces =2; //by default while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ - $DecimalPlaces = $AgedAnalysis['decimalplaces']; - $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$DecimalPlaces); - $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$DecimalPlaces); - $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$DecimalPlaces); - $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$DecimalPlaces); + $CurrDecimalPlaces = $AgedAnalysis['decimalplaces']; + $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$CurrDecimalPlaces); + $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$CurrDecimalPlaces); + $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$CurrDecimalPlaces); + $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$CurrDecimalPlaces); + $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$CurrDecimalPlaces); $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); @@ -384,11 +384,11 @@ $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+125,$YPos,75,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$DecimalPlaces); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$DecimalPlaces); - $DisplayBalance = locale_number_format($DetailTrans['balance'],$DecimalPlaces); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$DecimalPlaces); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$DecimalPlaces); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$CurrDecimalPlaces); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$CurrDecimalPlaces); + $DisplayBalance = locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$CurrDecimalPlaces); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$CurrDecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -418,11 +418,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = locale_number_format($TotBal,$DecimalPlaces); - $DisplayTotDue = locale_number_format($TotDue,$DecimalPlaces); - $DisplayTotCurrent = locale_number_format($TotCurr,$DecimalPlaces); - $DisplayTotOverdue1 = locale_number_format($TotOD1,$DecimalPlaces); - $DisplayTotOverdue2 = locale_number_format($TotOD2,$DecimalPlaces); + $DisplayTotBalance = locale_number_format($TotBal,$CurrDecimalPlaces); + $DisplayTotDue = locale_number_format($TotDue,$CurrDecimalPlaces); + $DisplayTotCurrent = locale_number_format($TotCurr,$CurrDecimalPlaces); + $DisplayTotOverdue1 = locale_number_format($TotOD1,$CurrDecimalPlaces); + $DisplayTotOverdue2 = locale_number_format($TotOD2,$CurrDecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); @@ -433,10 +433,7 @@ if ($ListCount == 0) { $title = _('Aged Customer Account Analysis') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); - prnMsg(_('There are no customers meeting the criteria specified to list'),'info'); - if ($debug==1){ - prnMsg($SQL,'info'); - } + prnMsg(_('There are no customers meeting the criteria specified with balances to list'),'info'); echo '<br /><a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; @@ -458,26 +455,27 @@ /*if $FromCriteria is not set then show a form to allow input */ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> - <table>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - - echo '<tr><td>' . _('From Customer Code') . ':' . '</font></td> - <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="0"></td> - </tr>'; - echo '<tr><td>' . _('To Customer Code') . ':' . '</td> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <table class="selection"> + <tr> + <td>' . _('From Customer Code') . ':' . '</font></td> + <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="0" /></td> + </tr> + <tr> + <td>' . _('To Customer Code') . ':' . '</td> <td><input tabindex="2" type="text" maxlength="6" size="7" name="ToCriteria" value="zzzzzz" /></td> - </tr>'; - - echo '<tr><td>' . _('All balances or overdues only') . ':' . '</td> + </tr> + <tr> + <td>' . _('All balances or overdues only') . ':' . '</td> <td><select tabindex="3" name="All_Or_Overdues"> <option selected value="All">' . _('All customers with balances') . '</option> <option value="OverduesOnly">' . _('Overdue accounts only') . '</option> <option value="HeldOnly">' . _('Held accounts only') . '</option> </select> </td> - </tr>'; - - echo '<tr><td>' . _('Only Show Customers Of') . ':' . '</td> + </tr> + <tr> + <td>' . _('Only Show Customers Of') . ':' . '</td> <td><select tabindex="4" name="Salesman">'; $sql = "SELECT salesmancode, salesmanname FROM salesman"; @@ -487,9 +485,10 @@ while ($myrow=DB_fetch_array($result)){ echo '<option value="' . $myrow['salesmancode'] . '">' . $myrow['salesmanname'] . '</option>'; } - echo '</select></td></tr>'; - - echo '<tr><td>' . _('Only show customers trading in') . ':' . '</td> + echo '</select></td> + </tr> + <tr> + <td>' . _('Only show customers trading in') . ':' . '</td> <td><select tabindex="5" name="Currency">'; $sql = "SELECT currency, currabrev FROM currencies"; @@ -502,18 +501,22 @@ echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } } - echo '</select></td></tr>'; - - echo '<tr><td>' . _('Summary or detailed report') . ':' . '</td> + echo '</select></td> + </tr> + <tr> + <td>' . _('Summary or detailed report') . ':' . '</td> <td><select tabindex="6" name="DetailedReport"> <option selected value="No">' . _('Summary Report') . '</option> <option value="Yes">' . _('Detailed Report') . '</option> </select> </td> - </tr>'; - - echo '</table><br /><div class="centre"><input tabindex="7" type=submit name="PrintPDF" value="' . _('Print PDF') , '"></div>'; + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="7" type=submit name="PrintPDF" value="' . _('Print PDF') , '" /> + </div>'; } include('includes/footer.inc'); } /*end of else not PrintPDF */ -?> +?> \ No newline at end of file Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2011-10-29 03:26:27 UTC (rev 4734) +++ trunk/AgedSuppliers.php 2011-10-29 05:59:53 UTC (rev 4735) @@ -23,7 +23,8 @@ if ($_POST['All_Or_Overdues']=='All'){ $SQL = "SELECT suppliers.supplierid, suppliers.suppname, - currencies.currency, + currencies.currency, + currencies.decimalplaces AS currdecimalplaces, paymentterms.terms, SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) as balance, SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN @@ -53,6 +54,7 @@ GROUP BY suppliers.supplierid, suppliers.suppname, currencies.currency, + currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth @@ -63,6 +65,7 @@ $SQL = "SELECT suppliers.supplierid, suppliers.suppname, currencies.currency, + currencies.decimalplaces AS currdecimalplaces, paymentterms.terms, SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) AS balance, SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN @@ -92,6 +95,7 @@ GROUP BY suppliers.supplierid, suppliers.suppname, currencies.currency, + currencies.decimalplaces, paymentterms.terms, paymentterms.daysbeforedue, paymentterms.dayinfollowingmonth @@ -121,17 +125,20 @@ $TotCurr = 0; $TotOD1 = 0; $TotOD2 = 0; - + $CurrDecimalPlaces =0; + $ListCount = DB_num_rows($SupplierResult); // UldisN While ($AgedAnalysis = DB_fetch_array($SupplierResult,$db)){ + + $CurrDecimalPlaces = $AgedAnalysis['currdecimalplaces']; + + $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$CurrDecimalPlaces); + $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$CurrDecimalPlaces); + $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$CurrDecimalPlaces); + $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$CurrDecimalPlaces); + $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$CurrDecimalPlaces); - $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],2); - $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],2); - $DisplayBalance = locale_number_format($AgedAnalysis['balance'],2); - $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],2); - $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],2); - $TotBal += $AgedAnalysis['balance']; $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); $TotCurr += ($AgedAnalysis['balance']-$AgedAnalysis['due']); @@ -198,17 +205,17 @@ } while ($DetailTrans = DB_fetch_array($DetailResult)){ - + $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,60,$FontSize,$DetailTrans['typename'],'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+65,$YPos,50,$FontSize,$DetailTrans['suppreference'],'left'); $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); $LeftOvers = $pdf->addTextWrap($Left_Margin+105,$YPos,70,$FontSize,$DisplayTranDate,'left'); - $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],2); - $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],2); - $DisplayBalance = locale_number_format($DetailTrans['balance'],2); - $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],2); - $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],2); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$CurrDecimalPlaces); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$CurrDecimalPlaces); + $DisplayBalance = locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$CurrDecimalPlaces); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$CurrDecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayCurrent,'right'); @@ -238,11 +245,11 @@ $pdf->line($Page_Width-$Right_Margin, $YPos+10 ,220, $YPos+10); } - $DisplayTotBalance = locale_number_format($TotBal,2); - $DisplayTotDue = locale_number_format($TotDue,2); - $DisplayTotCurrent = locale_number_format($TotCurr,2); - $DisplayTotOverdue1 = locale_number_format($TotOD1,2); - $DisplayTotOverdue2 = locale_number_format($TotOD2,2); + $DisplayTotBalance = locale_number_format($TotBal,$CurrDecimalPlaces); + $DisplayTotDue = locale_number_format($TotDue,$CurrDecimalPlaces); + $DisplayTotCurrent = locale_number_format($TotCurr,$CurrDecimalPlaces); + $DisplayTotOverdue1 = locale_number_format($TotOD1,$CurrDecimalPlaces); + $DisplayTotOverdue2 = locale_number_format($TotOD2,$CurrDecimalPlaces); $LeftOvers = $pdf->addTextWrap(220,$YPos,60,$FontSize,$DisplayTotBalance,'right'); $LeftOvers = $pdf->addTextWrap(280,$YPos,60,$FontSize,$DisplayTotCurrent,'right'); @@ -254,7 +261,10 @@ $pdf->line($Page_Width-$Right_Margin, $YPos ,220, $YPos); if ($ListCount == 0) { + $title = _('Aged Supplier Analysis'); + include('includes/header.inc'); prnMsg('There are no results so the PDF is empty'); + include('includes/footer.inc'); } else { $pdf->OutputD($_SESSION['DatabaseName'] . '_AggedSupliers_' . date('Y-m-d').'.pdf'); } @@ -272,25 +282,27 @@ /*if $FromCriteria is not set then show a form to allow input */ echo '<form sction="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> - <table class="selection">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + <table class="selection"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <tr> + <td>' . _('From Supplier Code') . ':</font></td> + <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="1" /></td> + </tr> + <tr> + <td>' . _('To Supplier Code') . ':</td> + <td><input tabindex="2" type="text" maxlength="6" size="7" name="ToCriteria" value="zzzzzz" /></td> + </tr> + <tr> + <td>' . _('All balances or overdues only') . ':' . '</td> + <td><select tabindex="3" name="All_Or_Overdues"> + <option selected value="All">' . _('All suppliers with balances') . '</option> + <option value="OverduesOnly">' . _('Overdue accounts only') . '</option> + </select></td> + </tr> + <tr> + <td>' . _('For suppliers trading in') . ':' . '</td> + <td><select tabindex="4" name="Currency">'; - echo '<tr><td>' . _('From Supplier Code') . ':</font></td> - <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="1"></td> - </tr>'; - echo '<tr><td>' . _('To Supplier Code') . ':</td> - <td><input tabindex="2" type="text" maxlength="6" size="7" name="ToCriteria" value="zzzzzz"></td> - </tr>'; - - echo '<tr><td>' . _('All balances or overdues only') . ':' . '</td> - <td><select tabindex="3" name="All_Or_Overdues">'; - echo '<option selected value="All">' . _('All suppliers with balances') . '</option>'; - echo '<option value="OverduesOnly">' . _('Overdue accounts only') . '</option>'; - echo '</select></td></tr>'; - - echo '<tr><td>' . _('For suppliers trading in') . ':' . '</td> - <td><select tabindex="4" name="Currency">'; - $sql = "SELECT currency, currabrev FROM currencies"; $result=DB_query($sql,$db); @@ -301,15 +313,20 @@ echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } } - echo '</select></td></tr>'; - - echo '<tr><td>' . _('Summary or Detailed Report') . ':' . '</td> - <td><select tabindex="5" name="DetailedReport">'; - echo '<option selected value="No">' . _('Summary Report') . '</option>'; - echo '<option value="Yes">' . _('Detailed Report') . '</option>'; - echo '</select></td></tr>'; - - echo '</table><br /><div class="centre"><input tabindex="6" type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '</select></td> + </tr> + <tr> + <td>' . _('Summary or Detailed Report') . ':' . '</td> + <td><select tabindex="5" name="DetailedReport"> + <option selected value="No">' . _('Summary Report') . '</option> + <option value="Yes">' . _('Detailed Report') . '</option> + </select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="6" type=submit name="PrintPDF" value="' . _('Print PDF') . '" /> + </div>'; } include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-10-29 03:26:27 UTC (rev 4734) +++ trunk/BOMExtendedQty.php 2011-10-29 05:59:53 UTC (rev 4735) @@ -259,37 +259,39 @@ _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; echo '<br /> - <br /> - <form action=' . htmlspecialchars($_SERVER['PHP_SELF']) . ' method="post"> - <table class="selection">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr> + <br /> + <form action=' . htmlspecialchars($_SERVER['PHP_SELF']) . ' method="post"> + <table class="selection"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <tr> <td>' . _('Part') . ':</td> - <td><input type ="text" name="Part" size="20">'; - echo '<tr> + <td><input type ="text" name="Part" size="20" /></td> + </tr> + <tr> <td>' . _('Quantity') . ':</td> - <td><input type="text" class="number" name="Quantity" size="4" /></td></tr>'; - - echo '<tr> + <td><input type="text" class="number" name="Quantity" size="4" /></td> + </tr> + <tr> <td>' . _('Selection Option') . ':</td> <td><select name="Select"> <option selected value="All">' . _('Show All Parts') . '</option> <option value="Shortages">' . _('Only Show Shortages') . '</option> </select></td> - </tr>'; - echo '<tr> + </tr> + <tr> <td>' . _('Print Option') . ':</td> <td><select name="Fill"> <option selected value="yes">' . _('Print With Alternating Highlighted Lines') . '</option> <option value="no">' . _('Plain Print') . '</option> </select></td> - </tr>'; - echo '</table> + </tr> + </table> + <br /> + <br /> + <div class="centre"> <br /> - <br /> - <div class="centre"> - <br /><input type=submit name="PrintPDF" value="' . _('Print PDF') . '" /> - </div>'; + <input type=submit name="PrintPDF" value="' . _('Print PDF') . '" /> + </div>'; include('includes/footer.inc'); @@ -316,7 +318,7 @@ $pdf->addTextWrap($Page_Width-$Right_Margin-140,$YPos,160,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left'); $YPos -=$line_height; - $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('Build Quantity: ') . $_POST['Quantity']); + $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('Build Quantity: ') . locale_number_format($_POST['Quantity'],'Variable'); $YPos -=(2*$line_height); Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-10-29 03:26:27 UTC (rev 4734) +++ trunk/BOMIndented.php 2011-10-29 05:59:53 UTC (rev 4735) @@ -208,7 +208,7 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],'Variable'),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); @@ -235,7 +235,7 @@ include('includes/footer.inc'); exit; } else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_trans_' . date('Y-m-d').'.pdf'); + $pdf->OutputD($_SESSION['DatabaseName'] . '_Bill_Of_Material_Indented_' . date('Y-m-d').'.pdf'); $pdf->__destruct(); } @@ -250,26 +250,32 @@ <form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Part') . ':</td> + echo '<tr> + <td>' . _('Part') . ':</td> <td><input type ="text" name="Part" size="20" /> </tr> - <tr><td>' . _('Levels') . ':</td> + <tr> + <td>' . _('Levels') . ':</td> <td><select name="Levels"> <option selected value="All">' . _('All Levels') . '</option> <option value="One">' . _('One Level') . '</option> </select> </td> - </tr>'; - - echo '<tr><td>' . _('Print Option') . ':</td> + </tr> + <tr> + <td>' . _('Print Option') . ':</td> <td><select name="Fill"> <option selected value="yes">' . _('Print With Alternating Highlighted Lines') . '</option> <option value="no">' . _('Plain Print') . '</option> </select> </td> - </tr>'; - echo '</table> - <p><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div></p>'; + </tr> + </table> + <p> + <div class="centre"> + <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> + </div> + </p>'; include('includes/footer.inc'); Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-10-29 03:26:27 UTC (rev 4734) +++ trunk/BOMIndentedReverse.php 2011-10-29 05:59:53 UTC (rev 4735) @@ -86,29 +86,28 @@ $ComponentCounter = 1; while ($ComponentCounter > 0) { $LevelCounter++; - $sql = "INSERT INTO tempbom ( - parent, - component, - sortpart, - level, - workcentreadded, - loccode, - effectiveafter, - effectiveto, - quantity) - SELECT bom.parent, - bom.component, - CONCAT(passbom.sortpart,bom.parent) AS sortpart, - " . $LevelCounter . " AS level, - bom.workcentreadded, - bom.loccode, - bom.effectiveafter, - bom.effectiveto, - bom.quantity - FROM bom,passbom - WHERE bom.component = passbom.part - AND bom.effectiveto >= NOW() - AND bom.effectiveafter <= NOW()"; + $sql = "INSERT INTO tempbom (parent, + component, + sortpart, + level, + workcentreadded, + loccode, + effectiveafter, + effectiveto, + quantity) + SELECT bom.parent, + bom.component, + CONCAT(passbom.sortpart,bom.parent) AS sortpart, + " . $LevelCounter . " AS level, + bom.workcentreadded, + bom.loccode, + bom.effectiveafter, + bom.effectiveto, + bom.quantity + FROM bom,passbom + WHERE bom.component = passbom.part + AND bom.effectiveto >= NOW() + AND bom.effectiveafter <= NOW()"; $result = DB_query($sql,$db); $result = DB_query("DROP TABLE IF EXISTS passbom2",$db); @@ -157,10 +156,10 @@ WHERE stockid = '" . $_POST['Part'] . "'"; $result = DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); - $assembly = $_POST['Part']; - $assemblydesc = $myrow['description']; + $Assembly = $_POST['Part']; + $AssemblyDesc = $myrow['description']; - PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width,$Right_Margin,$assemblydesc); + PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width,$Right_Margin,$AssemblyDesc); $Tot_Val=0; $fill = false; @@ -168,13 +167,13 @@ $sql = "SELECT tempbom.*, stockmaster.description, stockmaster.mbflag - FROM tempbom,stockmaster - WHERE tempbom.parent = stockmaster.stockid + FROM tempbom INNER JOIN stockmaster + ON tempbom.parent = stockmaster.stockid ORDER BY sortpart"; $result = DB_query($sql,$db); - $ListCount = DB_num_rows($result); // UldisN - + $ListCount = DB_num_rows($result); + While ($myrow = DB_fetch_array($result,$db)){ $YPos -=$line_height; @@ -197,13 +196,13 @@ $pdf->addTextWrap(180,$YPos,180,$FontSize,$myrow['description'],'',0,$fill); $pdf->addTextWrap(360,$YPos,30,$FontSize,$myrow['loccode'],'right',0,$fill); $pdf->addTextWrap(390,$YPos,25,$FontSize,$myrow['workcentreadded'],'right',0,$fill); - $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],2),'right',0,$fill); + $pdf->addTextWrap(415,$YPos,45,$FontSize,locale_number_format($myrow['quantity'],'Variable'),'right',0,$fill); $pdf->addTextWrap(460,$YPos,55,$FontSize,$FormatedEffectiveAfter,'right',0,$fill); $pdf->addTextWrap(515,$YPos,50,$FontSize,$FormatedEffectiveTo,'right',0,$fill); if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$assemblydesc); + $Right_Margin,$AssemblyDesc); } } /*end while loop */ @@ -213,7 +212,7 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$assemblydesc); + $Right_Margin,$AssemblyDesc); } if ($ListCount == 0) { $title = _('Print Reverse Indented BOM Listing Error'); @@ -235,19 +234,27 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; echo '<br /> - <br /> - <form action=' . htmlspecialchars($_SERVER['PHP_SELF']) . ' method="post"> - <table class="selection">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Part') . ':</td> - <td><input type ="text" name="Part" size="20">'; - echo '<tr><td>' . _('Print Option') . ':</td> + <br /> + <form action=' . htmlspecialchars($_SERVER['PHP_SELF']) . ' method="post"> + <table class="selection"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <tr> + <td>' . _('Part') . ':</td> + <td><input type ="text" name="Part" size="20" /></td> + </tr> + <tr> + <td>' . _('Print Option') . ':</td> <td><select name="Fill"> <option selected value="yes">' . _('Print With Alternating Highlighted Lines') . '</option> <option value="no">' . _('Plain Print') . '</option> - </select></td></tr>'; - echo '</table> - <p><div class="centre"><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div></p>'; + </select></td> + </tr> + </table> + <p> + <div class="centre"> + <input type=submit name="PrintPDF" value="' . _('Print PDF') . '" /> + </div> + </p>'; include('includes/footer.inc'); @@ -255,7 +262,7 @@ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$assemblydesc) { + $Page_Width,$Right_Margin,$AssemblyDesc) { $line_height=12; @@ -292,7 +299,7 @@ $pdf->addTextWrap($Left_Margin+1,$YPos,60,$FontSize,_('Component:'),'',0); $pdf->addTextWrap(100,$YPos,100,$FontSize,mb_strtoupper($_POST['Part']),'',0); - $pdf->addTextWrap(200,$YPos,150,$FontSize,$assemblydesc,'',0); + $pdf->addTextWrap(200,$YPos,150,$FontSize,$AssemblyDesc,'',0); $YPos -=(2*$line_height); $Xpos = $Left_Margin+5; $FontSize=8; Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-10-29 03:26:27 UTC (rev 4734) +++ trunk/BOMInquiry.php 2011-10-29 05:59:53 UTC (rev 4735) @@ -13,21 +13,31 @@ } if (!isset($_POST['StockID'])) { - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"><b><br /></b>'. - '<div class="page_help_text">'. _('Select a manufactured part') . ' (' . _('or Assembly or Kit part') . ') ' . - _('to view the costed bill of materials') . '<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>' - .'</font><br /> - <table class="selection" cellpadding="3" colspan="4"> - <tr><td><font size="1">' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td> - <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25"></td> + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> + <b> + <br /> + </b> + <div class="page_help_text"> + '. _('Select a manufactured part') . ' (' . _('or Assembly or Kit part') . ') ' . _('to view the costed bill of materials') . ' + <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') . '</font> + </div> + <br /> + <table class="selection"> + <tr> + <td><font size="1">' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td> + <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25" /></td> <td><font size="3"><b>' . _('OR') . '</b></font></td> <td><font size="1">' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td> - <td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="20"></td> - </tr></table> - <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value=' . _('Search Now') . '></div><br />'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + <td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="20" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '" /> + </div> + <br /> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; } if (isset($_POST['Search'])){ @@ -46,40 +56,41 @@ $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - stockmaster.mbflag, - SUM(locstock.quantity) as totalonhand - FROM stockmaster, - locstock - WHERE stockmaster.stockid = locstock.stockid - AND stockmaster.description " . LIKE . " '$SearchString' - AND (stockmaster.mbflag='M' OR stockmaster.mbflag='K' OR stockmaster.mbflag='A' OR stockmaster.mbflag='G') - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units, - stockmaster.mbflag - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units, + stockmaster.mbflag, + SUM(locstock.quantity) as totalonhand + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid = locstock.stockid + WHERE stockmaster.description " . LIKE . " '$SearchString' + AND (stockmaster.mbflag='M' + OR stockmaster.mbflag='K' + OR stockmaster.mbflag='A' + OR stockmaster.mbflag='G') + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units, + stockmaster.mbflag + ORDER BY stockmaster.stockid"; } elseif (mb_strlen($_POST['StockCode'])>0){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - stockmaster.mbflag, - sum(locstock.quantity) as totalonhand - FROM stockmaster, - locstock - WHERE stockmaster.stockid = locstock.stockid - AND stockmaster.stockid " . LIKE . "'%" . $_POST['StockCode'] . "%' - AND (stockmaster.mbflag='M' - OR stockmaster.mbflag='K' - OR stockmaster.mbflag='G' - OR stockmaster.mbflag='A') - GROUP BY stockmaster.stockid, - stockmaster.description, - stockmaster.units, - stockmaster.mbflag - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units, + stockmaster.mbflag, + sum(locstock.quantity) as totalonhand + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid = locstock.stockid + WHERE stockmaster.stockid " . LIKE . "'%" . $_POST['StockCode'] . "%' + AND (stockmaster.mbflag='M' + OR stockmaster.mbflag='K' + OR stockmaster.mbflag='G' + OR stockmaster.mbflag='A') + GROUP BY stockmaster.stockid, + stockmaster.description, + stockmaster.units, + stockmaster.mbflag + ORDER BY stockmaster.stockid"; } @@ -89,13 +100,16 @@ } //one of keywords or StockCode was more than a zero length string } //end of if search -if (isset($_POST['Search']) and isset($result) AND !isset($SelectedParent)) { +if (isset($_POST['Search']) + AND isset($result) + AND !isset($SelectedParent)) { echo '<br /> <hr> <br /> - <table class="selection" cellpadding="2" colspan="7">'; - $TableHeader = '<tr><th>' . _('Code') . '</th> + <table class="selection">'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('On Hand') . '</th> <th>' . _('Units') . '</th> @@ -121,8 +135,9 @@ $tabindex=$j+4; printf('<td><input tabindex="' .$tabindex . '" type="submit" name="StockID" value="%s"</td> <td>%s</td> - <td class=number>%s</td> - <td>%s</td></tr>', + <td class="number">%s</td> + <td>%s</td> + </tr>', $myrow['stockid'], $myrow['description'], $StockOnHand, @@ -149,17 +164,17 @@ $ParentOverheadCost = $myrow['overheadcost']; $sql = "SELECT bom.parent, - bom.component, - stockmaster.description, - stockmaster.decimalplaces, - stockmaster.materialcost+ stockmaster.labourcost+stockmaster.overheadcost as standardcost, - bom.quantity, - bom.quantity * (stockmaster.materialcost+ stockmaster.labourcost+ stockmaster.overheadcost) AS componentcost - FROM bom INNER JOIN stockmaster - ON bom.component = stockmaster.stockid - WHERE bom.parent = '" . $StockID . "' - AND bom.effectiveafter < Now() - AND bom.effectiveto > Now()"; + bom.component, + stockmaster.description, + stockmaster.decimalplaces, + stockmaster.materialcost+ stockmaster.labourcost+stockmaster.overheadcost as standardcost, + bom.quantity, + bom.quantity * (stockmaster.materialcost+ stockmaster.labourcost+ stockmaster.overheadcost) AS componentcost + FROM bom INNER JOIN stockmaster + ON bom.component = stockmaster.stockid + WHERE bom.parent = '" . $StockID . "' + AND bom.effectiveafter < Now() + AND bom.effectiveto > Now()"; $ErrMsg = _('The bill of material could not be retrieved because'); $BOMResult = DB_query ($sql,$db,$ErrMsg); @@ -168,16 +183,23 @@ prnMsg(_('The bill of material for this part is not set up') . ' - ' . _('there are no components defined for it'),'warn'); } else { echo '<a href="'.$rootpath.'/index.php">'._('Return to Main Menu').'</a>'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' + </p> + <br />'; - echo '<table class="selection" cellpadding="2">'; - echo '<tr><th colspan=5><div class="centre"><font size=4><b>' . $myrow[0] . ' : ' . _('per') . ' ' . $myrow[1] . '</b></font></div></th></tr>'; + echo '<table class="selection">'; + echo '<tr> + <th colspan="5"> + <div class="centre"><font size="4"><b>' . $myrow[0] . ' : ' . _('per') . ' ' . $myrow[1] . '</b></font> + </div></th> + </tr>'; $TableHeader = '<tr> - <th>' . _('Component') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit Cost') . '</th> - <th>' . _('Total Cost') . '</th> + <th>' . _('Component') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit Cost') . '</th> + <th>' . _('Total Cost') . '</th> </tr>'; echo $TableHeader; @@ -201,9 +223,9 @@ /* Component Code Description Quantity Std Cost Total Cost */ printf('<td>%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%.2f</td> - <td class=number>%.2f</td> + <td class="number">%s</td> + <td class="number">%.2f</td> + <td class="number">%.2f</td> </tr>', $ComponentLink, $myrow['description'], @@ -219,15 +241,15 @@ $TotalCost += $ParentLabourCost; echo '<tr> <td colspan="4" class="number"><b>' . _('Labour Cost') . '</b></td> - <td class=number><b>' . locale_number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class="number"><b>' . locale_number_format($ParentLabourCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; $TotalCost += $ParentOverheadCost; echo '<tr><td colspan="4" class="number"><b>' . _('Overhead Cost') . '</b></td> - <td class=number><b>' . locale_number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class="number"><b>' . locale_number_format($ParentOverheadCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; echo '<tr> - <td colspan=4 class=number><b>' . _('Total Cost') . '</b></td> - <td class=number><b>' . locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> - </... [truncated message content] |