From: <dai...@us...> - 2011-10-22 05:19:54
|
Revision: 4729 http://web-erp.svn.sourceforge.net/web-erp/?rev=4729&view=rev Author: daintree Date: 2011-10-22 05:19:43 +0000 (Sat, 22 Oct 2011) Log Message: ----------- number formats Modified Paths: -------------- trunk/GLJournal.php trunk/WOSerialNos.php trunk/WWW_Access.php trunk/WWW_Users.php trunk/WhereUsedInquiry.php trunk/WorkCentres.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/GLJournal.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -10,9 +10,13 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -if (isset($_GET['NewJournal']) and $_GET['NewJournal'] == 'Yes' AND isset($_SESSION['JournalDetail'])){ +if (isset($_GET['NewJournal']) + AND $_GET['NewJournal'] == 'Yes' + AND isset($_SESSION['JournalDetail'])){ + unset($_SESSION['JournalDetail']->GLEntries); unset($_SESSION['JournalDetail']); + } if (!isset($_SESSION['JournalDetail'])){ @@ -44,7 +48,7 @@ $_SESSION['JournalDetail']->JournalType = $_POST['JournalType']; } -if (isset($_POST['CommitBatch']) and $_POST['CommitBatch']==_('Accept and Process Journal')){ +if (isset($_POST['CommitBatch']) AND $_POST['CommitBatch']==_('Accept and Process Journal')){ /* once the GL analysis of the journal is entered process all the data in the session cookie into the DB @@ -60,19 +64,19 @@ foreach ($_SESSION['JournalDetail']->GLEntries as $JournalItem) { $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount, - tag) + typeno, + trandate, + periodno, + account, + narrative, + amount, + tag) VALUES ('0', '" . $TransNo . "', '" . FormatDateForSQL($_SESSION['JournalDetail']->JnlDate) . "', '" . $PeriodNo . "', '" . $JournalItem->GLCode . "', - '" . $JournalItem->Narrative . "', + '" . DB_escape_string($JournalItem->Narrative) . "', '" . $JournalItem->Amount . "', '" . $JournalItem->tag."' )"; @@ -82,19 +86,19 @@ if ($_POST['JournalType']=='Reversing'){ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount, - tag) + typeno, + trandate, + periodno, + account, + narrative, + amount, + tag) VALUES ('0', '" . $TransNo . "', '" . FormatDateForSQL($_SESSION['JournalDetail']->JnlDate) . "', '" . ($PeriodNo + 1) . "', '" . $JournalItem->GLCode . "', - 'Reversal - " . $JournalItem->Narrative . "', + '" . _('Reversal') . " - " . DB_escape_string($JournalItem->Narrative) . "', '" . -($JournalItem->Amount) ."', '".$JournalItem->tag."' )"; @@ -117,7 +121,8 @@ unset($_SESSION['JournalDetail']); /*Set up a newy in case user wishes to enter another */ - echo '<br /><a href="' . $_SERVER['PHP_SELF'] . '?NewJournal=Yes">'._('Enter Another General Ledger Journal').'</a>'; + echo '<br /> + <a href="' . $_SERVER['PHP_SELF'] . '?NewJournal=Yes">'._('Enter Another General Ledger Journal').'</a>'; /*And post the journal too */ include ('includes/GLPostings.inc'); include ('includes/footer.inc'); @@ -128,17 +133,17 @@ /* User hit delete the line from the journal */ $_SESSION['JournalDetail']->Remove_GLEntry($_GET['Delete']); -} elseif (isset($_POST['Process']) and $_POST['Process']==_('Accept')){ //user hit submit a new GL Analysis line into the journal +} elseif (isset($_POST['Process']) AND $_POST['Process']==_('Accept')){ //user hit submit a new GL Analysis line into the journal if ($_POST['GLCode']!='') { $extract = explode(' - ',$_POST['GLCode']); $_POST['GLCode'] = $extract[0]; } if ($_POST['Debit']>0) { - $_POST['GLAmount'] = $_POST['Debit']; + $_POST['GLAmount'] = filter_number_format($_POST['Debit']); } elseif ($_POST['Credit']>0) { - $_POST['GLAmount'] = '-' . $_POST['Credit']; + $_POST['GLAmount'] = -filter_number_format($_POST['Credit']); } - if ($_POST['GLManualCode'] != '' AND is_numeric($_POST['GLManualCode'])){ + if ($_POST['GLManualCode'] != ''){ // If a manual code was entered need to check it exists and isnt a bank account $AllowThisPosting = true; //by default if ($_SESSION['ProhibitJournalsToControlAccounts'] == 1){ @@ -167,17 +172,25 @@ unset($_POST['GLManualCode']); } else { $myrow = DB_fetch_array($Result); - $_SESSION['JournalDetail']->add_to_glanalysis($_POST['GLAmount'], $_POST['GLNarrative'], $_POST['GLManualCode'], $myrow['accountname'], $_POST['tag']); + $_SESSION['JournalDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), + $_POST['GLNarrative'], + $_POST['GLManualCode'], + $myrow['accountname'], + $_POST['tag']); } } } else { $AllowThisPosting =true; //by default if ($_SESSION['ProhibitJournalsToControlAccounts'] == 1){ - if ($_SESSION['CompanyRecord']['gllink_debtors'] == '1' AND $_POST['GLCode'] == $_SESSION['CompanyRecord']['debtorsact']){ + if ($_SESSION['CompanyRecord']['gllink_debtors'] == '1' + AND $_POST['GLCode'] == $_SESSION['CompanyRecord']['debtorsact']){ + prnMsg(_('GL Journals involving the debtors control account cannot be entered. The general ledger debtors ledger (AR) integration is enabled so control accounts are automatically maintained by webERP. This setting can be disabled in System Configuration'),'warn'); $AllowThisPosting = false; } - if ($_SESSION['CompanyRecord']['gllink_creditors'] == '1' AND $_POST['GLCode'] == $_SESSION['CompanyRecord']['creditorsact']){ + if ($_SESSION['CompanyRecord']['gllink_creditors'] == '1' + AND $_POST['GLCode'] == $_SESSION['CompanyRecord']['creditorsact']){ + prnMsg(_('GL Journals involving the creditors control account cannot be entered. The general ledger creditors ledger (AP) integration is enabled so control accounts are automatically maintained by webERP. This setting can be disabled in System Configuration'),'warn'); $AllowThisPosting = false; } @@ -199,7 +212,11 @@ $SQL = "SELECT accountname FROM chartmaster WHERE accountcode='" . $_POST['GLCode'] . "'"; $Result=DB_query($SQL,$db); $myrow=DB_fetch_array($Result); - $_SESSION['JournalDetail']->add_to_glanalysis($_POST['GLAmount'], $_POST['GLNarrative'], $_POST['GLCode'], $myrow['accountname'], $_POST['tag']); + $_SESSION['JournalDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), + $_POST['GLNarrative'], + $_POST['GLCode'], + $myrow['accountname'], + $_POST['tag']); } } @@ -225,7 +242,9 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' + </p>'; // A new table in the first column of the main table @@ -234,18 +253,21 @@ $_SESSION['JournalDetail']->JnlDate = Date($_SESSION['DefaultDateFormat'],mktime(0,0,0,date('m'),0,date('Y'))); } -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>'; -echo '<td>' . _('Type') . ':</td> - <td><select name="JournalType">'; +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>' . _('Type') . ':</td> + <td><select name="JournalType">'; if ($_POST['JournalType'] == 'Reversing'){ - echo '<option selected="True" value = "Reversing">' . _('Reversing').'</option>'; + echo '<option selected value = "Reversing">' . _('Reversing').'</option>'; echo '<option value = "Normal">' . _('Normal').'</option>'; } else { echo '<option value = "Reversing">' . _('Reversing').'</option>'; - echo '<option selected="True" value = "Normal">' . _('Normal') . '</option>'; + echo '<option selected value = "Normal">' . _('Normal') . '</option>'; } echo '</select></td> @@ -257,20 +279,27 @@ echo '<table class="selection" width="70%">'; /* Set upthe form for the transaction entry for a GL Payment Analysis item */ -echo '<tr><th colspan="3"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Line Entry') . '</b></font></div></th></tr>'; +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 '<tr> + <th>' . _('GL Tag') . '</th> <th>' . _('GL Account Code') . '</th> - <th>' . _('Select GL Account') . '</th></tr>'; + <th>' . _('Select GL Account') . '</th> + </tr>'; /* Set upthe form for the transaction entry for a GL Payment Analysis item */ //Select the tag -echo '<tr><td><select name="tag">'; +echo '<tr> + <td><select name="tag">'; $SQL = "SELECT tagref, - tagdescription + tagdescription FROM tags ORDER BY tagref"; @@ -294,9 +323,9 @@ ' value="'. $_POST['GLManualCode'] .'" /></td>'; $sql="SELECT accountcode, - accountname - FROM chartmaster - ORDER BY accountcode"; + accountname + FROM chartmaster + ORDER BY accountcode"; $result=DB_query($sql, $db); echo '<td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; @@ -314,36 +343,51 @@ $_POST['GLNarrative'] = ''; } if (!isset($_POST['Credit'])) { - $_POST['Credit'] = ''; + $_POST['Credit'] = 0; } if (!isset($_POST['Debit'])) { - $_POST['Debit'] = ''; + $_POST['Debit'] = 0; } -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 '</tr> + <tr> + <th>' . _('Debit') . '</th> + <td><input type="text" class="number" name = "Debit" onChange="eitherOr(this, '.'Credit'.')" maxlength="12" size="10" value="' . locale_number_format($_POST['Debit'],$_SESSION['CompanyRecord']['decimalplaces']) . '" /></td> + </tr> + <tr> + <th>' . _('Credit') . '</th> + <td><input type="text" class="number" Name = "Credit" onChange="eitherOr(this, '.'Debit'.')" maxlength="12" size="10" value="' . locale_number_format($_POST['Credit'],$_SESSION['CompanyRecord']['decimalplaces']) . '" /></td> + </tr> + <tr> + <td></td> + <td></td> + <th>'. _('Narrative'). '</th> + </tr> + <tr> + <th></th> + <th>' . _('GL Narrative') . '</th> + <td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td> + </tr> + </table> + <br />'; /*Close the main table */ +echo '<div class="centre"> + <input type="submit" name="Process" value="' . _('Accept') . '" /> + </div> + <br /> + <br />'; -echo '<td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td>'; +echo '<table class="selection" width="85%"> + <tr> + <th colspan="6"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Summary') . '</b></font></div></th> + </tr> + <tr> + <th>'._('GL Tag').'</th> + <th>'._('GL Account').'</th> + <th>'._('Debit').'</th> + <th>'._('Credit').'</th> + <th>'._('Narrative').'</th> + </tr>'; -echo '</tr></table><br />'; /*Close the main table */ -echo '<div class="centre"><input type="submit" name="Process" value="' . _('Accept') . '" /></div><br /><br />'; - - -echo '<table class="selection" width="85%">'; - -echo '<tr><th colspan="6"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Summary') . '</b></font></div></th></tr>'; -echo '<tr> - <th>'._('GL Tag').'</th> - <th>'._('GL Account').'</th> - <th>'._('Debit').'</th> - <th>'._('Credit').'</th> - <th>'._('Narrative').'</th> - </tr>'; - $DebitTotal=0; $CreditTotal=0; $j=0; @@ -369,8 +413,9 @@ echo '<td>' . $JournalItem->tag . ' - ' . $TagDescription . '</td> <td>' . $JournalItem->GLCode . ' - ' . $JournalItem->GLActName . '</td>'; if ($JournalItem->Amount>0) { - echo '<td class="number">' . locale_number_format($JournalItem->Amount,$_SESSION['CompanyRecord']['decimalplaces']) . '</td><td></td>'; - $DebitTotal=$DebitTotal+$JournalItem->Amount; + echo '<td class="number">' . locale_number_format($JournalItem->Amount,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td></td>'; + $DebitTotal += $JournalItem->Amount; } elseif($JournalItem->Amount<0) { $Credit=(-1 * $JournalItem->Amount); echo '<td></td> @@ -384,9 +429,10 @@ } echo '<tr class="EvenTableRows"><td></td> - <td class="number"><b>' . _('Total') . '</b></td> - <td class="number"><b>' . locale_number_format($DebitTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> - <td class="number"><b>' . locale_number_format($CreditTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class="number"><b>' . _('Total') . '</b></td> + <td class="number"><b>' . locale_number_format($DebitTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class="number"><b>' . locale_number_format($CreditTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + </tr>'; if ($DebitTotal!=$CreditTotal) { echo '<td align="center" style="background-color: #fddbdb"><b>' . _('Required to balance') .' - </b>' . locale_number_format(abs($DebitTotal-$CreditTotal),$_SESSION['CompanyRecord']['decimalplaces']); @@ -398,10 +444,15 @@ } 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>'; +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>'; } elseif(count($_SESSION['JournalDetail']->GLEntries)>0) { - echo '<br /><br />'; + echo '<br /> + <br />'; prnMsg(_('The journal must balance ie debits equal to credits before it can be processed'),'warn'); } Modified: trunk/WOSerialNos.php =================================================================== --- trunk/WOSerialNos.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WOSerialNos.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -40,13 +40,15 @@ $NextSerialNo = $_POST['NextSerialNo']; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="" alt="" />' . ' ' . _('For Work Order Number') . ' ' . $WO . ' ' . _('and output item') . ' ' . $StockID . ' - ' . $Description . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="" alt="" />' . ' ' . _('For Work Order Number') . ' ' . $WO . ' ' . _('and output item') . ' ' . $StockID . ' - ' . $Description . ' + </p>'; $DbgMsg = _('The SQL that failed was'); if (isset($_POST['AddControlledItems'])){ if (isset($_POST['NumberToAdd'])){ // Must be adding serial numbers automatically - if (!is_numeric($_POST['NumberToAdd'])){ + if (!is_numeric(filter_number_format($_POST['NumberToAdd']))){ prnMsg(_('The quantity of controlled items to add was not numeric - a number is expected'),'error'); } else { DB_Txn_Begin($db); @@ -62,7 +64,7 @@ '" . $WO . "', '', '' "; - for ($i=0;$i<$_POST['NumberToAdd'];$i++){ + for ($i=0;$i< filter_number_format($_POST['NumberToAdd']);$i++){ $NextItemNumber = $NextSerialNo + $i; $result = DB_query("SELECT serialno FROM woserialnos WHERE wo='" . $WO . "' @@ -93,7 +95,7 @@ $result = DB_query("UPDATE stockmaster SET nextserialno='" . $NextSerialNo . "' WHERE stockid='" . $StockID . "'",$db); - $result = DB_query("UPDATE woitems SET qtyreqd=qtyreqd+" . $_POST['NumberToAdd'] . " + $result = DB_query("UPDATE woitems SET qtyreqd=qtyreqd+" . filter_number_format($_POST['NumberToAdd']) . " WHERE stockid='" . $StockID . "' AND wo='" . $WO . "'",$db,$ErrMsg,$DbgMsg,true); DB_Txn_Commit($db); @@ -105,20 +107,20 @@ prnMsg(_('The batch or serial number reference has not been entered - a reference is required'),'error'); $InputError=true; } - if (!is_numeric($_POST['Quantity'])){ + if (!is_numeric(filter_number_format($_POST['Quantity']))){ prnMsg(_('The quantity for the batch must be numeric'),'error'); $InputError=true; } $result = DB_query("SELECT serialno FROM woserialnos WHERE wo='" . $WO . "' AND stockid='" . $StockID ."' - AND serialno='" . $_POST['Reference'] . "'",$db); + AND serialno='" . DB_escape_string($_POST['Reference']) . "'",$db); if (DB_num_rows($result)!=0){ $InputError=true; prnMsg(_('The serial number or batch reference must be unique to the item - the reference entered is already entered on this work order'),'error'); } $result = DB_query("SELECT serialno FROM stockserialitems - WHERE serialno='" . $_POST['Reference'] . "' + WHERE serialno='" . DB_escape_string($_POST['Reference']) . "' AND stockid='" . $StockID ."'",$db); if (DB_num_rows($result)!=0){ $InputError=true; @@ -128,7 +130,7 @@ DB_Txn_Begin($db); $ErrMsg = _('Could not add a new serial number/batch'); $result = DB_query("UPDATE woitems - SET qtyreqd=qtyreqd+" . $_POST['Quantity'] . " + SET qtyreqd=qtyreqd+" . filter_number_format($_POST['Quantity']) . " WHERE stockid='" . $StockID . "' AND wo='" . $WO . "'",$db,$ErrMsg,$DbgMsg,true); $sql = "INSERT INTO woserialnos (stockid, @@ -139,8 +141,8 @@ VALUES ('" . $StockID . "', '" . $WO . "', '', - '" . $_POST['Quantity'] . "', - '" . $_POST['Reference'] . "')"; + '" . filter_number_format($_POST['Quantity']) . "', + '" . DB_escape_string($_POST['Reference']) . "')"; $ErrMsg = _('Unable to add the batch or serial number requested'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -156,10 +158,10 @@ $result = DB_query("DELETE FROM woserialnos WHERE wo='" . $WO . "' AND stockid='" . $StockID . "' - AND serialno='" . $_GET['Reference'] ."'", + AND serialno='" . DB_escape_string($_GET['Reference']) ."'", $db); - $result = DB_query("UPDATE woitems SET qtyreqd=qtyreqd-" . $_GET['Quantity'] . " + $result = DB_query("UPDATE woitems SET qtyreqd=qtyreqd-" . filter_number_format($_GET['Quantity']) . " WHERE wo='" . $WO . "' AND stockid = '" . $StockID . "'",$db); @@ -183,13 +185,13 @@ $result = DB_query("SELECT serialno FROM woserialnos WHERE wo='" . $WO . "' AND stockid='" . $StockID ."' - AND serialno='" . $_POST['Reference' . $i] . "'",$db); + AND serialno='" . DB_escape_string($_POST['Reference' . $i]) . "'",$db); if (DB_num_rows($result)!=0){ $InputError=true; prnMsg($_POST['Reference' .$i] . ': ' . _('The reference entered is already entered on this work order'),'error'); } $result = DB_query("SELECT serialno FROM stockserialitems - WHERE serialno='" . $_POST['Reference' .$i] . "' + WHERE serialno='" . DB_escape_string($_POST['Reference' .$i]) . "' AND stockid='" . $StockID ."'",$db); if (DB_num_rows($result)!=0){ $InputError=true; @@ -197,13 +199,13 @@ } } if (!$InputError){ - $sql[] = "UPDATE woserialnos SET serialno='" . $_POST['Reference'.$i] . "', - quantity='" . $_POST['Quantity'.$i] ."', - qualitytext='" . $_POST['Notes'.$i] . "' + $sql[] = "UPDATE woserialnos SET serialno='" . DB_escape_string($_POST['Reference'.$i]) . "', + quantity='" . filter_number_format($_POST['Quantity'.$i]) ."', + qualitytext='" . DB_escape_string($_POST['Notes'.$i]) . "' WHERE wo='" . $WO . "' AND stockid='" . $StockID . "' - AND serialno='" . $_POST['OldReference'.$i] . "'"; - $WOQuantityTotal += $_POST['Quantity'.$i]; + AND serialno='" . DB_escape_string($_POST['OldReference'.$i]) . "'"; + $WOQuantityTotal += filter_number_format($_POST['Quantity'.$i]); } else { $WOQuantityTotal += $_POST['OldQuantity'.$i]; } @@ -226,39 +228,44 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<input type="hidden" name="StockID" value="' . $StockID . '">'; -echo '<input type="hidden" name="Description" value="' . $Description . '">'; -echo '<input type="hidden" name="WO" value="' . $WO . '">'; -echo '<input type="hidden" name="Serialised" value="' . $Serialised . '">'; -echo '<input type="hidden" name="NextSerialNo" value="' . $NextSerialNo . '">'; +echo '<input type="hidden" name="StockID" value="' . $StockID . '" />'; +echo '<input type="hidden" name="Description" value="' . $Description . '" />'; +echo '<input type="hidden" name="WO" value="' . $WO . '" />'; +echo '<input type="hidden" name="Serialised" value="' . $Serialised . '" />'; +echo '<input type="hidden" name="NextSerialNo" value="' . $NextSerialNo . '" />'; echo '<table class="selection">'; if ($Serialised==1 AND $NextSerialNo>0){ echo '<tr><td>' . _('Add A Number of New Serial Numbers'); echo ':</td> - <td><input type="text" name="NumberToAdd" size=10 class=number maxlength=10 value="1"></td> + <td><input type="text" name="NumberToAdd" size="10" class="number" maxlength="10" value="1" /></td> <td>' . _('Starting at') . ':</td><td align="right">' . $NextSerialNo . '</td>'; } else { //Need to allow entry of batch or serial number and its a batch a quantity too for individual entry if ($Serialised==1){ - echo '<tr><th></th><th>' . _('Serial No') . '</th></tr> + echo '<tr> + <th></th> + <th>' . _('Serial No') . '</th></tr> <tr><td>'; echo _('Add a single serial number'); } else { - echo '<tr><th></th><th>' . _('Batch/Lot Ref') . '</th><th>' . _('Quantity') . '</th></tr> + echo '<tr> + <th></th> + <th>' . _('Batch/Lot Ref') . '</th><th>' . _('Quantity') . '</th></tr> <tr><td>'; echo _('Add a single batch/lot number'); } - echo '<td><input type="text" name="Reference" maxlength="30" size="30"></td>'; + echo '<td><input type="text" name="Reference" maxlength="30" size="30" /></td>'; if ($Serialised==0){ //also need to add the quantity - echo '<td><input type="text" name="Quantity" size=10 class=number maxlength=10 value="1"></td>'; + echo '<td><input type="text" name="Quantity" size="10" class="number" maxlength="10" value="1" /></td>'; } else { //it will be 1 for a serial item - echo '<input type="hidden" name="Quantity" value=1>'; + echo '<input type="hidden" name="Quantity" value="1" />'; } } -echo '<td><input type="submit" name="AddControlledItems" value="' . _('Add') . '"></td></tr> +echo '<td><input type="submit" name="AddControlledItems" value="' . _('Add') . '" /></td> + </tr> </table> <br />'; @@ -275,11 +282,19 @@ if (DB_num_rows($WOSerialNoResult)==0){ prnMsg(_('There are no serial items or batches yet defined for this work order item. Create new items first'),'info'); } else { - echo '<br /><table class="selection">'; + echo '<br /> + <table class="selection">'; if ($Serialised==1){ - $Header = '<tr><th>' . _('Serial No') . '</th><th>' . _('Notes') . '</th></tr>'; + $Header = '<tr> + <th>' . _('Serial No') . '</th> + <th>' . _('Notes') . '</th> + </tr>'; } else { - $Header = '<tr><th>' . _('Batch Ref') . '</th><th>' . _('Quantity') . '</th><th>' . _('Notes') . '</th></tr>'; + $Header = '<tr> + <th>' . _('Batch Ref') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Notes') . '</th> + </tr>'; } echo $Header; $i = 0; @@ -291,28 +306,29 @@ $j=0; } - echo '<tr><td><input type="text" name="Reference' . $i .'" value="' . $WOSNRow['serialno'] . '"/></td>'; + echo '<tr> + <td><input type="text" name="Reference' . $i .'" value="' . $WOSNRow['serialno'] . '"/></td>'; echo '<input type="hidden" name="OldReference' . $i . '" value="' . $WOSNRow['serialno'] . '"/>'; if ($Serialised==0){ - echo '<td><input type="text" name="Quantity' . $i .'" value="' . $WOSNRow['quantity'] . '" /></td>'; - echo '<input type="hidden" name="OldQuantity' . $i . '" value="' . $WOSNRow['quantity'] . '" />'; + echo '<td><input type="text" name="Quantity' . $i .'" value="' . locale_number_format($WOSNRow['quantity'],'Variable') . '" /></td>'; + echo '<input type="hidden" name="OldQuantity' . $i . '" value="' . locale_number_format($WOSNRow['quantity'],'Variable') . '" />'; } else { - echo '<input type="hidden" name="Quantity' . $i . '" value="1">'; + echo '<input type="hidden" name="Quantity' . $i . '" value="1" />'; } - echo '<td><textarea name="Notes' . $i .'" cols=60 rows=3>' . $WOSNRow['qualitytext'] .'</textarea></td>'; - echo '<td><a href="' . $_SESSION['PHP_SELF'] . '?Delete=1&Reference=' . $WOSNRow['serialno'] . '&Quantity=' . $WOSNRow['quantity'] . '&WO=' . $WO . '&StockID=' . $StockID . '&Description=' . $Description . '&Serialised=' . $Serialised . '&NextSerialNo=' . $NextSerialNo . '">' . _('Delete') . '</td></tr>'; + echo '<td><textarea name="Notes' . $i .'" cols="60" rows="3">' . $WOSNRow['qualitytext'] .'</textarea></td>'; + echo '<td><a href="' . $_SESSION['PHP_SELF'] . '?Delete=1&Reference=' . $WOSNRow['serialno'] . '&Quantity=' . locale_number_format($WOSNRow['quantity'],'Variable') . '&WO=' . $WO . '&StockID=' . $StockID . '&Description=' . $Description . '&Serialised=' . $Serialised . '&NextSerialNo=' . $NextSerialNo . '">' . _('Delete') . '</a></td></tr>'; $i++; $j++; } - echo '<input type="hidden" name="CountOfItems" value=' . $i . '>'; + echo '<input type="hidden" name="CountOfItems" value="' . $i . '" />'; if ($Serialised==0){ echo '<tr><td style="text-align: center" colspan="3">'; } else { echo '<tr><td style="text-align: center" colspan="2">'; } - echo '<input type="submit" name="UpdateItems" value="' . _('Update') . '"></td></tr>'; + echo '<input type="submit" name="UpdateItems" value="' . _('Update') . '" /></td></tr>'; echo '</table>'; } //end of if there are woserialno items defined Modified: trunk/WWW_Access.php =================================================================== --- trunk/WWW_Access.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WWW_Access.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -24,7 +24,7 @@ /* actions to take once the user has clicked the submit button ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['SecRoleName']) && mb_strlen($_POST['SecRoleName'])<4){ + if (isset($_POST['SecRoleName']) AND mb_strlen($_POST['SecRoleName'])<4){ $InputError = 1; prnMsg(_('The role description entered must be at least 4 characters long'),'error'); } @@ -34,12 +34,12 @@ unset($sql); if (isset($_POST['SecRoleName']) ){ // Update or Add Security Headings if(isset($SelectedRole)) { // Update Security Heading - $sql = "UPDATE securityroles SET secrolename = '".$_POST['SecRoleName']."' + $sql = "UPDATE securityroles SET secrolename = '" . DB_escape_string($_POST['SecRoleName']) . "' WHERE secroleid = '".$SelectedRole . "'"; $ErrMsg = _('The update of the security role description failed because'); $ResMsg = _('The Security role description was updated.'); } else { // Add Security Heading - $sql = "INSERT INTO securityroles (secrolename) VALUES ('".$_POST['SecRoleName']."')"; + $sql = "INSERT INTO securityroles (secrolename) VALUES ('" . DB_escape_string($_POST['SecRoleName']) ."')"; $ErrMsg = _('The update of the security role failed because'); $ResMsg = _('The Security role was created.'); } @@ -165,10 +165,16 @@ if (!isset($_POST['SecRoleName'])) { $_POST['SecRoleName']=''; } -echo '<tr><td>' . _('Role') . ':</td> - <td><input type="text" name="SecRoleName" size=40 maxlength=40 value="' . $_POST['SecRoleName'] . '"></tr>'; -echo '</table><br /> - <div class="centre"><input type="submit" name="submit" value="' . _('Enter Role') . '"></div></form>'; +echo '<tr> + <td>' . _('Role') . ':</td> + <td><input type="text" name="SecRoleName" size=40 maxlength=40 value="' . $_POST['SecRoleName'] . '" /> + </tr>'; +echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Role') . '" /> + </div> + </form>'; if (isset($SelectedRole)) { $sql = "SELECT tokenid, tokenname Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WWW_Users.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -388,9 +388,9 @@ $_POST['Blocked'] = $myrow['blocked']; $_POST['PDFLanguage'] = $myrow['pdflanguage']; - echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; - echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; - echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '" /'; + echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '" />'; + echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '" />'; echo '<table class=selection> <tr><td>' . _('User code') . ':</td><td>'; echo $_POST['UserID'] . '</td></tr>'; @@ -400,7 +400,7 @@ echo '<table class="selection"> <tr> <td>' . _('User Login') . ':</td> - <td><input type="text" name="UserID" size="22" maxlength="20"></td></tr>'; + <td><input type="text" name="UserID" size="22" maxlength="20" /></td></tr>'; /*set the default modules to show to all this had trapped a few people previously*/ @@ -668,7 +668,7 @@ echo '</table> <br /> <div class="centre"> - <input type="submit" name="submit" value="' . _('Enter Information') . '"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> </div> </form>'; Modified: trunk/WhereUsedInquiry.php =================================================================== --- trunk/WhereUsedInquiry.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WhereUsedInquiry.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Where Used Inquiry'); include('includes/header.inc'); @@ -14,25 +12,30 @@ $StockID = trim(mb_strtoupper($_POST['StockID'])); } -echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br />'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; +echo '<a href="' . $rootpath . '/SelectProduct.php">' . _('Back to Items') . '</a> + <br /> + <p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . ' + </p>'; if (isset($StockID)){ $result = DB_query("SELECT description, - units, - mbflag - FROM stockmaster - WHERE stockid='".$StockID."'",$db); + units, + mbflag + FROM stockmaster + WHERE stockid='".$StockID."'",$db); $myrow = DB_fetch_row($result); if (DB_num_rows($result)==0){ prnMsg(_('The item code entered') . ' - ' . $StockID . ' ' . _('is not set up as an item in the system') . '. ' . _('Re-enter a valid item code or select from the Select Item link above'),'error'); include('includes/footer.inc'); exit; } - echo "<br /><font color=navy size=3><b>$StockID - $myrow[0] </b> (" . _('in units of') . ' ' . $myrow[1] . ')</font>'; + echo '<br /> + <font color="navy" size="3"><b>' . $StockID . ' - ' . $myrow[0] . '</b> (' . _('in units of') . ' ' . $myrow[1] . ')</font>'; } -echo "<form action='" . $_SERVER['PHP_SELF'] . '?'. SID ."' method=post><div class='centre'>"; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <div class="centre"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($StockID)) { echo _('Enter an Item Code') . ': <input type="text" name="StockID" size="21" maxlength="20" value="' . $StockID . '" />'; @@ -40,19 +43,20 @@ echo _('Enter an Item Code') . ': <input type="text" name="StockID" size="21" maxlength="20" />'; } -echo "<input type=submit name='ShowWhereUsed' value='" . _('Show Where Used') . "'>"; +echo '<input type="submit" name="ShowWhereUsed" value="' . _('Show Where Used') . '" />'; -echo '</div><br />'; +echo '</div> + <br />'; if (isset($StockID)) { $SQL = "SELECT bom.*, - stockmaster.description - FROM bom INNER JOIN stockmaster + stockmaster.description + FROM bom INNER JOIN stockmaster ON bom.parent = stockmaster.stockid - WHERE component='" . $StockID . "' - AND bom.effectiveafter<='" . Date('Y-m-d') . "' - AND bom.effectiveto >='" . Date('Y-m-d') . "'"; + WHERE component='" . $StockID . "' + AND bom.effectiveafter<='" . Date('Y-m-d') . "' + AND bom.effectiveto >='" . Date('Y-m-d') . "'"; $ErrMsg = _('The parents for the selected part could not be retrieved because');; $result = DB_query($SQL,$db,$ErrMsg); @@ -60,45 +64,44 @@ prnMsg(_('The selected item') . ' ' . $StockID . ' ' . _('is not used as a component of any other parts'),'error'); } else { - echo '<table width=97% class=selection>'; + echo '<table width=97% class=selection>'; - $tableheader = '<tr><th>' . _('Used By') . '</th> - <th>' . _('Work Centre') . '</th> - <th>' . _('Location') . '</th> - <th>' . _('Quantity Required') . '</th> - <th>' . _('Effective After') . '</th> - <th>' . _('Effective To') . '</th></tr>'; - echo $tableheader; - $k=0; - while ($myrow=DB_fetch_array($result)) { + $TableHeader = '<tr> + <th>' . _('Used By') . '</th> + <th>' . _('Work Centre') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Quantity Required') . '</th> + <th>' . _('Effective After') . '</th> + <th>' . _('Effective To') . '</th> + </tr>'; + echo $TableHeader; + $k=0; + while ($myrow=DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">';; - $k=1; - } + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">';; + $k=1; + } - echo '<td><a target="_blank" href="' . $rootpath . '/BOMInquiry.php?StockID=' . $myrow['parent'] . '" alt="' . _('Show Bill Of Material') . '">' . $myrow['parent']. ' - ' . $myrow['description']. '</a></td>'; - echo '<td>' . $myrow['workcentreadded']. '</td>'; - echo '<td>' . $myrow['loccode']. '</td>'; - echo '<td>' . $myrow['quantity']. '</td>'; - echo '<td>' . ConvertSQLDate($myrow['effectiveafter']) . '</td>'; - echo '<td>' . ConvertSQLDate($myrow['effectiveto']) . '</td>'; + echo '<td><a target="_blank" href="' . $rootpath . '/BOMInquiry.php?StockID=' . $myrow['parent'] . '" alt="' . _('Show Bill Of Material') . '">' . $myrow['parent']. ' - ' . $myrow['description']. '</a></td> + <td>' . $myrow['workcentreadded']. '</td> + <td>' . $myrow['loccode']. '</td> + <td class="number">' . locale_number_format($myrow['quantity'],'Variable') . '</td> + <td>' . ConvertSQLDate($myrow['effectiveafter']) . '</td> + <td>' . ConvertSQLDate($myrow['effectiveto']) . '</td>'; - //end of page full new headings if - } + //end of page full new headings if + } - echo '</table>'; + echo '</table>'; } } // StockID is set -echo "<script>defaultControl(document.forms[0].StockID);</script>"; +echo '<script>defaultControl(document.forms[0].StockID);</script>'; - echo '</form>'; - include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WorkCentres.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -42,7 +42,7 @@ delete code below*/ $sql = "UPDATE workcentres SET location = '" . $_POST['Location'] . "', - description = '" . $_POST['Description'] . "', + description = '" . DB_escape_string($_POST['Description']) . "', overheadrecoveryact ='" . $_POST['OverheadRecoveryAct'] . "', overheadperhour = '" . $_POST['OverheadPerHour'] . "' WHERE code = '" . $SelectedWC . "'"; @@ -52,13 +52,13 @@ /*Selected work centre is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new work centre form */ $sql = "INSERT INTO workcentres (code, - location, - description, - overheadrecoveryact, - overheadperhour) + location, + description, + overheadrecoveryact, + overheadperhour) VALUES ('" . $_POST['Code'] . "', '" . $_POST['Location'] . "', - '" . $_POST['Description'] . "', + '" . DB_escape_string($_POST['Description']) . "', '" . $_POST['OverheadRecoveryAct'] . "', '" . $_POST['OverheadPerHour'] . "' )"; @@ -107,7 +107,9 @@ then none of the above are true and the list of work centres will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . ' + </p>'; $sql = "SELECT workcentres.code, workcentres.description, @@ -120,31 +122,34 @@ $result = DB_query($sql,$db); echo '<table class="selection"> - <tr bgcolor ="#800000"><th>' . _('WC Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Location') . '</th> - <th>' . _('Overhead GL Account') . '</th> - <th>' . _('Overhead Per Hour') . '</th> + <tr bgcolor ="#800000"> + <th>' . _('WC Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Overhead GL Account') . '</th> + <th>' . _('Overhead Per Hour') . '</th> </tr>'; - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { - printf("<tr><td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td><a href=\"%s&SelectedWC=%s\">" . _('Edit') . "</td> - <td><a href=\"%s&SelectedWC=%s&delete=yes\">" . _('Delete') ."</td> - </tr>", - $myrow[0], - $myrow[1], - $myrow[2], - $myrow[3], - $myrow[4], + printf('<tr> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td><a href="%s&SelectedWC=%s">' . _('Edit') . '</td> + <td><a href="%s&SelectedWC=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this work centre?') . '\');">' . _('Delete') .'</td> + </tr>', + $myrow['code'], + $myrow['description'], + $myrow['locationname'], + $myrow['overheadrecoveryact'], + $myrow['overheadperhour'], $_SERVER['PHP_SELF'] . '?', - $myrow[0], $_SERVER['PHP_SELF'] . '?', - $myrow[0]); + $myrow['code'], + $_SERVER['PHP_SELF'] . '?', + $myrow['code']); } //END WHILE LIST LOOP @@ -158,20 +163,21 @@ echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show all Work Centres') . '</a></div>'; } -echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<br /> + <form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedWC)) { //editing an existing work centre $sql = "SELECT code, - location, - description, - overheadrecoveryact, - overheadperhour - FROM workcentres - WHERE code='" . $SelectedWC . "'"; - + location, + description, + overheadrecoveryact, + overheadperhour + FROM workcentres + WHERE code='" . $SelectedWC . "'"; + $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -181,31 +187,36 @@ $_POST['OverheadRecoveryAct'] = $myrow['overheadrecoveryact']; $_POST['OverheadPerHour'] = $myrow['overheadperhour']; - echo '<input type="hidden" name="SelectedWC" value=' . $SelectedWC . '>'; - echo '<input type="hidden" name="Code" value="' . $_POST['Code'] . '">'; - echo '<table class="selection"><tr><td>' ._('Work Centre Code') . ':</td> - <td>' . $_POST['Code'] . '</td></tr>'; + echo '<input type="hidden" name="SelectedWC" value="' . $SelectedWC . '" /> + <input type="hidden" name="Code" value="' . $_POST['Code'] . '" /> + <table class="selection"> + <tr> + <td>' ._('Work Centre Code') . ':</td> + <td>' . $_POST['Code'] . '</td> + </tr>'; } else { //end of if $SelectedWC only do the else when a new record is being entered if (!isset($_POST['Code'])) { $_POST['Code'] = ''; } - echo '<table class="selection"><tr> - <td>' . _('Work Centre Code') . ':</td> - <td><input type="Text" name="Code" size="6" maxlength="5" value="' . $_POST['Code'] . '"></td> + echo '<table class="selection"> + <tr> + <td>' . _('Work Centre Code') . ':</td> + <td><input type="text" name="Code" size="6" maxlength="5" value="' . $_POST['Code'] . '" /></td> </tr>'; } $SQL = "SELECT locationname, - loccode + loccode FROM locations"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { $_POST['Description'] = ''; } -echo '<tr><td>' . _('Work Centre Description') . ':</td> - <td><input type="Text" name="Description" size="21" maxlength="20" value="' . $_POST['Description'] . '"></td> +echo '<tr> + <td>' . _('Work Centre Description') . ':</td> + <td><input type="Text" name="Description" size="21" maxlength="20" value="' . $_POST['Description'] . '" /></td> </tr> <tr><td>' . _('Location') . ':</td> <td><select name="Location">'; @@ -214,7 +225,7 @@ if (isset($_POST['Location']) and $myrow['loccode']==$_POST['Location']) { echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; @@ -223,13 +234,15 @@ DB_free_result($result); -echo '</select></td></tr> - <tr><td>' . _('Overhead Recovery GL Account') . ':</td> +echo '</select></td> + </tr> + <tr> + <td>' . _('Overhead Recovery GL Account') . ':</td> <td><select name="OverheadRecoveryAct">'; //SQL to poulate account selection boxes $SQL = "SELECT accountcode, - accountname + accountname FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_=accountgroups.groupname WHERE accountgroups.pandl!=0 @@ -253,17 +266,23 @@ } echo '</td></tr>'; -echo '<tr><td>' . _('Overhead Per Hour') . ':</td> - <td><input type="Text" class="number" name="OverheadPerHour" size=6 maxlength=6 value='.$_POST['OverheadPerHour'].'>'; +echo '<tr> + <td>' . _('Overhead Per Hour') . ':</td> + <td><input type="text" class="number" name="OverheadPerHour" size="6" maxlength="6" value="'.$_POST['OverheadPerHour'].'" />'; -echo '</td></tr></table>'; +echo '</td> + </tr> + </table>'; -echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; +echo '<br /> + <div class="centre"> + <input type="Submit" name="submit" value="' . _('Enter Information') . '" /> + </div>'; if (!isset($_GET['SelectedWC']) or $_GET['SelectedWC']=='') { - echo "<script>defaultControl(document.forms[0].Code);</script>"; + echo '<script>defaultControl(document.forms[0].Code);</script>'; } else { - echo "<script>defaultControl(document.forms[0].Description);</script>"; + echo '<script>defaultControl(document.forms[0].Description);</script>'; } echo '</form>'; Modified: trunk/WorkOrderCosting.php =================================================================== --- trunk/WorkOrderCosting.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WorkOrderCosting.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -6,11 +6,13 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br />'; +echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a> + <br /> + <p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . + _('Search') . '" alt="" />' . ' ' . $title . ' + </p>'; -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -47,14 +49,17 @@ $WorkOrderRow = DB_fetch_array($WOResult); -echo '<table cellpadding=2 class=selection> - <tr><td class="label">' . _('Work order') . ':</td> +echo '<table class="selection"> + <tr> + <td class="label">' . _('Work order') . ':</td> <td>' . $_POST['WO'] .'</td> <td class="label">' . _('Manufactured at') . ':</td> <td>' . $WorkOrderRow['locationname'] . '</td> <td class="label">' . _('Required By') . ':</td> - <td>' . ConvertSQLDate($WorkOrderRow['requiredby']) . '</td></tr> - </table><br />'; + <td>' . ConvertSQLDate($WorkOrderRow['requiredby']) . '</td> + </tr> + </table> + <br />'; $WOItemsResult = DB_query("SELECT woitems.stockid, @@ -77,19 +82,23 @@ $db, $ErrMsg); -echo '<table class="selection"><tr><th>' . _('Item') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Quantity Required') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('Quantity Received') . '</th> - <th>' . _('Status') . '</th> - <th>' . _('Receive') . '</th> - <th>' . _('Issue') . '</th></tr>'; +echo '<table class="selection"> + <tr> + <th>' . _('Item') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity Required') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Quantity Received') . '</th> + <th>' . _('Status') . '</th> + <th>' . _('Receive') . '</th> + <th>' . _('Issue') . '</th> + </tr>'; $TotalStdValueRecd =0; while ($WORow = DB_fetch_array($WOItemsResult)){ - echo '<tr><td>' . $WORow['stockid'] . '</td> + echo '<tr> + <td>' . $WORow['stockid'] . '</td> <td>' . $WORow['description'] . '</td> <td class="number">' . locale_number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td> <td>' . $WORow['units'] . '</td> @@ -106,18 +115,18 @@ <br /> <table class="selection">'; +echo '<tr> + <th>' . _('Item') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Qty Reqd') . '</th> + <th>' . _('Cost Reqd') . '</th> + <th>' . _('Date Issued') . '</th> + <th>' . _('Issued Qty') . '</th> + <th>' . _('Issued Cost') . '</th> + <th>' . _('Usage Variance') . '</th> + <th>' . _('Cost Variance') . '</th> + </tr>'; -echo '<tr><th>' . _('Item') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Qty Reqd') . '</th> - <th>' . _('Cost Reqd') . '</th> - <th>' . _('Date Issued') . '</th> - <th>' . _('Issued Qty') . '</th> - <th>' . _('Issued Cost') . '</th> - <th>' . _('Usage Variance') . '</th> - <th>' . _('Cost Variance') . '</th> - </tr>'; - $RequirementsResult = DB_query("SELECT worequirements.stockid, stockmaster.description, stockmaster.decimalplaces, @@ -185,7 +194,8 @@ } else { echo '<tr class="OddTableRows">'; } - echo '<td colspan="9"><hr></td></tr>'; + echo '<td colspan="9"><hr></td> + </tr>'; } if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -201,13 +211,15 @@ /*Required quantity is the quantity required of the component based on the quantity of the finished item received */ $UsageVar =($RequirementsRow['requiredqty']-$IssueQty)*($RequirementsRow['stdcost']); - echo '<td colspan="2"></td><td class="number">' . locale_number_format($RequirementsRow['requiredqty'],$RequirementsRow['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($RequirementsRow['expectedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td></td> - <td class="number">' . locale_number_format($IssueQty,$RequirementsRow['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($IssueCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($UsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($CostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + echo '<td colspan="2"></td> + <td class="number">' . locale_number_format($RequirementsRow['requiredqty'],$RequirementsRow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($RequirementsRow['expectedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td></td> + <td class="number">' . locale_number_format($IssueQty,$RequirementsRow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($IssueCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($UsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; $TotalReqdCost += $RequirementsRow['expectedcost']; $TotalIssuedCost += $IssueCost; $TotalCostVar += $CostVar; @@ -217,26 +229,28 @@ } else { $k++; } - echo '<tr><td colspan="9"><hr></td></tr>'; + echo '<tr> + <td colspan="9"><hr></td> + </tr>'; } //Now need to run through the issues to the work order that weren't in the requirements $sql = "SELECT stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - trandate, - qty, - stockmoves.standardcost - FROM stockmoves INNER JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - WHERE stockmoves.type=28 - AND reference = '" . $_POST['WO'] . "' - AND stockmoves.stockid NOT IN - (SELECT worequirements.stockid - FROM worequirements - WHERE worequirements.wo='" . $_POST['WO'] . "')"; + stockmaster.description, + stockmaster.decimalplaces, + trandate, + qty, + stockmoves.standardcost + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + WHERE stockmoves.type=28 + AND reference = '" . $_POST['WO'] . "' + AND stockmoves.stockid NOT IN + (SELECT worequirements.stockid + FROM worequirements + WHERE worequirements.wo='" . $_POST['WO'] . "')"; $WOIssuesResult = DB_query($sql,$db,_('Could not get issues that were not required by the BOM because')); @@ -251,33 +265,38 @@ } echo '<td>' . $WOIssuesRow['stockid'] . '</td> - <td>' . $WOIssuesRow['description'] . '</td> - <td class="number">0</td> - <td class="number">0</td> - <td>' . ConvertSQLDate($WOIssuesRow['trandate']) . '</td> - <td class="number">' . locale_number_format(-$WOIssuesRow['qty'],$WOIssuesRow['decimalplaces']) .'</td> - <td class="number">' . locale_number_format(-$WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class="number">' . locale_number_format($WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class="number">0</td></tr>'; + <td>' . $WOIssuesRow['description'] . '</td> + <td class="number">0</td> + <td class="number">0</td> + <td>' . ConvertSQLDate($WOIssuesRow['trandate']) . '</td> + <td class="number">' . locale_number_format(-$WOIssuesRow['qty'],$WOIssuesRow['decimalplaces']) .'</td> + <td class="number">' . locale_number_format(-$WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">' . locale_number_format($WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">0</td> + </tr>'; $TotalUsageVar += ($WOIssuesRow['qty']*$WOIssuesRow['standardcost']); } } # <!-- <td colspan="5"></td> --> -echo '<tr><td colspan="3"></td> +echo '<tr> + <td colspan="3"></td> <td><hr/></td> <td colspan="2"></td> <td colspan="3"><hr></td> </tr>'; -echo '<tr><td colspan="2" class="number">' . _('Totals') . '</td> - <td></td> - <td class="number">' . locale_number_format($TotalReqdCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td></td><td></td> - <td class="number">' . locale_number_format($TotalIssuedCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class="number">' . locale_number_format($TotalUsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($TotalCostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; - -echo '<tr><td colspan="3"></td> +echo '<tr> + <td colspan="2" class="number">' . _('Totals') . '</td> + <td></td> + <td class="number">' . locale_number_format($TotalReqdCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td></td><td></td> + <td class="number">' . locale_number_format($TotalIssuedCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">' . locale_number_format($TotalUsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($TotalCostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + +echo '<tr> + <td colspan="3"></td> <td><hr/></td> <td colspan="2"></td> <td colspan="3"><hr></td> @@ -403,12 +422,12 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $TotalUsageVar!=0){ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (29, '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', @@ -422,12 +441,12 @@ $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (29, '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', @@ -445,11 +464,11 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $TotalCostVar!=0){ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, + typeno, + trandate, + periodno, + account, + narrative, amount) VALUES (29, '" . $WOCloseNo . "', @@ -464,12 +483,12 @@ $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (29, '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', @@ -515,12 +534,21 @@ if ($WorkOrderRow['closed']==0){ - echo '<tr><td colspan="9"><div class="centre"><input type=submit name="Close" value="' . _('Close This Work Order') . '" onclick="return confirm(\'' . _('Closing the work order takes the variances to the general ledger (if integrated). The work order will no longer be able to have manufactured goods received entered against it or materials issued to it.') . ' ' . _('Are You Sure?') . '\');"></div></td></tr>'; + echo '<tr> + <td colspan="9"> + <div class="centre"> + <input type=submit name="Close" value="' . _('Close This Work Order') . '" onclick="return confirm(\'' . _('Closing the work order takes the variances to the general ledger (if integrated). The work order will no longer be able to have manufactured goods received entered against it or materials issued to it.') . ' ' . _('Are You Sure?') . '\');"> + </div> + </td> + </tr>'; } else { - echo '<tr><td colspan="9">' . _('This work order is closed and cannot accept additional issues of materials or receipts of manufactured items') . '</td></tr>'; + echo '<tr> + <td colspan="9">' . _('This work order is closed and cannot accept additional issues of materials or receipts of manufactured items') . '</td> + </tr>'; } -echo '</table>'; -echo '</form>'; +echo '</table> + + </form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WorkOrderEntry.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -7,8 +7,10 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title.'</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . + '" alt="" />' . ' ' . $title.' + </p>'; if (isset($_GET['ReqDate'])){ $ReqDate = $_GET['ReqDate']; @@ -68,23 +70,22 @@ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.description " . LIKE . " '$SearchString' AND stockmaster.discontinued=0 AND mbflag='M' ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid... [truncated message content] |
From: <dai...@us...> - 2011-10-22 05:19:53
|
Revision: 4729 http://web-erp.svn.sourceforge.net/web-erp/?rev=4729&view=rev Author: daintree Date: 2011-10-22 05:19:43 +0000 (Sat, 22 Oct 2011) Log Message: ----------- number formats Modified Paths: -------------- trunk/GLJournal.php trunk/WOSerialNos.php trunk/WWW_Access.php trunk/WWW_Users.php trunk/WhereUsedInquiry.php trunk/WorkCentres.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/GLJournal.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -10,9 +10,13 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -if (isset($_GET['NewJournal']) and $_GET['NewJournal'] == 'Yes' AND isset($_SESSION['JournalDetail'])){ +if (isset($_GET['NewJournal']) + AND $_GET['NewJournal'] == 'Yes' + AND isset($_SESSION['JournalDetail'])){ + unset($_SESSION['JournalDetail']->GLEntries); unset($_SESSION['JournalDetail']); + } if (!isset($_SESSION['JournalDetail'])){ @@ -44,7 +48,7 @@ $_SESSION['JournalDetail']->JournalType = $_POST['JournalType']; } -if (isset($_POST['CommitBatch']) and $_POST['CommitBatch']==_('Accept and Process Journal')){ +if (isset($_POST['CommitBatch']) AND $_POST['CommitBatch']==_('Accept and Process Journal')){ /* once the GL analysis of the journal is entered process all the data in the session cookie into the DB @@ -60,19 +64,19 @@ foreach ($_SESSION['JournalDetail']->GLEntries as $JournalItem) { $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount, - tag) + typeno, + trandate, + periodno, + account, + narrative, + amount, + tag) VALUES ('0', '" . $TransNo . "', '" . FormatDateForSQL($_SESSION['JournalDetail']->JnlDate) . "', '" . $PeriodNo . "', '" . $JournalItem->GLCode . "', - '" . $JournalItem->Narrative . "', + '" . DB_escape_string($JournalItem->Narrative) . "', '" . $JournalItem->Amount . "', '" . $JournalItem->tag."' )"; @@ -82,19 +86,19 @@ if ($_POST['JournalType']=='Reversing'){ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount, - tag) + typeno, + trandate, + periodno, + account, + narrative, + amount, + tag) VALUES ('0', '" . $TransNo . "', '" . FormatDateForSQL($_SESSION['JournalDetail']->JnlDate) . "', '" . ($PeriodNo + 1) . "', '" . $JournalItem->GLCode . "', - 'Reversal - " . $JournalItem->Narrative . "', + '" . _('Reversal') . " - " . DB_escape_string($JournalItem->Narrative) . "', '" . -($JournalItem->Amount) ."', '".$JournalItem->tag."' )"; @@ -117,7 +121,8 @@ unset($_SESSION['JournalDetail']); /*Set up a newy in case user wishes to enter another */ - echo '<br /><a href="' . $_SERVER['PHP_SELF'] . '?NewJournal=Yes">'._('Enter Another General Ledger Journal').'</a>'; + echo '<br /> + <a href="' . $_SERVER['PHP_SELF'] . '?NewJournal=Yes">'._('Enter Another General Ledger Journal').'</a>'; /*And post the journal too */ include ('includes/GLPostings.inc'); include ('includes/footer.inc'); @@ -128,17 +133,17 @@ /* User hit delete the line from the journal */ $_SESSION['JournalDetail']->Remove_GLEntry($_GET['Delete']); -} elseif (isset($_POST['Process']) and $_POST['Process']==_('Accept')){ //user hit submit a new GL Analysis line into the journal +} elseif (isset($_POST['Process']) AND $_POST['Process']==_('Accept')){ //user hit submit a new GL Analysis line into the journal if ($_POST['GLCode']!='') { $extract = explode(' - ',$_POST['GLCode']); $_POST['GLCode'] = $extract[0]; } if ($_POST['Debit']>0) { - $_POST['GLAmount'] = $_POST['Debit']; + $_POST['GLAmount'] = filter_number_format($_POST['Debit']); } elseif ($_POST['Credit']>0) { - $_POST['GLAmount'] = '-' . $_POST['Credit']; + $_POST['GLAmount'] = -filter_number_format($_POST['Credit']); } - if ($_POST['GLManualCode'] != '' AND is_numeric($_POST['GLManualCode'])){ + if ($_POST['GLManualCode'] != ''){ // If a manual code was entered need to check it exists and isnt a bank account $AllowThisPosting = true; //by default if ($_SESSION['ProhibitJournalsToControlAccounts'] == 1){ @@ -167,17 +172,25 @@ unset($_POST['GLManualCode']); } else { $myrow = DB_fetch_array($Result); - $_SESSION['JournalDetail']->add_to_glanalysis($_POST['GLAmount'], $_POST['GLNarrative'], $_POST['GLManualCode'], $myrow['accountname'], $_POST['tag']); + $_SESSION['JournalDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), + $_POST['GLNarrative'], + $_POST['GLManualCode'], + $myrow['accountname'], + $_POST['tag']); } } } else { $AllowThisPosting =true; //by default if ($_SESSION['ProhibitJournalsToControlAccounts'] == 1){ - if ($_SESSION['CompanyRecord']['gllink_debtors'] == '1' AND $_POST['GLCode'] == $_SESSION['CompanyRecord']['debtorsact']){ + if ($_SESSION['CompanyRecord']['gllink_debtors'] == '1' + AND $_POST['GLCode'] == $_SESSION['CompanyRecord']['debtorsact']){ + prnMsg(_('GL Journals involving the debtors control account cannot be entered. The general ledger debtors ledger (AR) integration is enabled so control accounts are automatically maintained by webERP. This setting can be disabled in System Configuration'),'warn'); $AllowThisPosting = false; } - if ($_SESSION['CompanyRecord']['gllink_creditors'] == '1' AND $_POST['GLCode'] == $_SESSION['CompanyRecord']['creditorsact']){ + if ($_SESSION['CompanyRecord']['gllink_creditors'] == '1' + AND $_POST['GLCode'] == $_SESSION['CompanyRecord']['creditorsact']){ + prnMsg(_('GL Journals involving the creditors control account cannot be entered. The general ledger creditors ledger (AP) integration is enabled so control accounts are automatically maintained by webERP. This setting can be disabled in System Configuration'),'warn'); $AllowThisPosting = false; } @@ -199,7 +212,11 @@ $SQL = "SELECT accountname FROM chartmaster WHERE accountcode='" . $_POST['GLCode'] . "'"; $Result=DB_query($SQL,$db); $myrow=DB_fetch_array($Result); - $_SESSION['JournalDetail']->add_to_glanalysis($_POST['GLAmount'], $_POST['GLNarrative'], $_POST['GLCode'], $myrow['accountname'], $_POST['tag']); + $_SESSION['JournalDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), + $_POST['GLNarrative'], + $_POST['GLCode'], + $myrow['accountname'], + $_POST['tag']); } } @@ -225,7 +242,9 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' + </p>'; // A new table in the first column of the main table @@ -234,18 +253,21 @@ $_SESSION['JournalDetail']->JnlDate = Date($_SESSION['DefaultDateFormat'],mktime(0,0,0,date('m'),0,date('Y'))); } -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>'; -echo '<td>' . _('Type') . ':</td> - <td><select name="JournalType">'; +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>' . _('Type') . ':</td> + <td><select name="JournalType">'; if ($_POST['JournalType'] == 'Reversing'){ - echo '<option selected="True" value = "Reversing">' . _('Reversing').'</option>'; + echo '<option selected value = "Reversing">' . _('Reversing').'</option>'; echo '<option value = "Normal">' . _('Normal').'</option>'; } else { echo '<option value = "Reversing">' . _('Reversing').'</option>'; - echo '<option selected="True" value = "Normal">' . _('Normal') . '</option>'; + echo '<option selected value = "Normal">' . _('Normal') . '</option>'; } echo '</select></td> @@ -257,20 +279,27 @@ echo '<table class="selection" width="70%">'; /* Set upthe form for the transaction entry for a GL Payment Analysis item */ -echo '<tr><th colspan="3"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Line Entry') . '</b></font></div></th></tr>'; +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 '<tr> + <th>' . _('GL Tag') . '</th> <th>' . _('GL Account Code') . '</th> - <th>' . _('Select GL Account') . '</th></tr>'; + <th>' . _('Select GL Account') . '</th> + </tr>'; /* Set upthe form for the transaction entry for a GL Payment Analysis item */ //Select the tag -echo '<tr><td><select name="tag">'; +echo '<tr> + <td><select name="tag">'; $SQL = "SELECT tagref, - tagdescription + tagdescription FROM tags ORDER BY tagref"; @@ -294,9 +323,9 @@ ' value="'. $_POST['GLManualCode'] .'" /></td>'; $sql="SELECT accountcode, - accountname - FROM chartmaster - ORDER BY accountcode"; + accountname + FROM chartmaster + ORDER BY accountcode"; $result=DB_query($sql, $db); echo '<td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; @@ -314,36 +343,51 @@ $_POST['GLNarrative'] = ''; } if (!isset($_POST['Credit'])) { - $_POST['Credit'] = ''; + $_POST['Credit'] = 0; } if (!isset($_POST['Debit'])) { - $_POST['Debit'] = ''; + $_POST['Debit'] = 0; } -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 '</tr> + <tr> + <th>' . _('Debit') . '</th> + <td><input type="text" class="number" name = "Debit" onChange="eitherOr(this, '.'Credit'.')" maxlength="12" size="10" value="' . locale_number_format($_POST['Debit'],$_SESSION['CompanyRecord']['decimalplaces']) . '" /></td> + </tr> + <tr> + <th>' . _('Credit') . '</th> + <td><input type="text" class="number" Name = "Credit" onChange="eitherOr(this, '.'Debit'.')" maxlength="12" size="10" value="' . locale_number_format($_POST['Credit'],$_SESSION['CompanyRecord']['decimalplaces']) . '" /></td> + </tr> + <tr> + <td></td> + <td></td> + <th>'. _('Narrative'). '</th> + </tr> + <tr> + <th></th> + <th>' . _('GL Narrative') . '</th> + <td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td> + </tr> + </table> + <br />'; /*Close the main table */ +echo '<div class="centre"> + <input type="submit" name="Process" value="' . _('Accept') . '" /> + </div> + <br /> + <br />'; -echo '<td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td>'; +echo '<table class="selection" width="85%"> + <tr> + <th colspan="6"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Summary') . '</b></font></div></th> + </tr> + <tr> + <th>'._('GL Tag').'</th> + <th>'._('GL Account').'</th> + <th>'._('Debit').'</th> + <th>'._('Credit').'</th> + <th>'._('Narrative').'</th> + </tr>'; -echo '</tr></table><br />'; /*Close the main table */ -echo '<div class="centre"><input type="submit" name="Process" value="' . _('Accept') . '" /></div><br /><br />'; - - -echo '<table class="selection" width="85%">'; - -echo '<tr><th colspan="6"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Summary') . '</b></font></div></th></tr>'; -echo '<tr> - <th>'._('GL Tag').'</th> - <th>'._('GL Account').'</th> - <th>'._('Debit').'</th> - <th>'._('Credit').'</th> - <th>'._('Narrative').'</th> - </tr>'; - $DebitTotal=0; $CreditTotal=0; $j=0; @@ -369,8 +413,9 @@ echo '<td>' . $JournalItem->tag . ' - ' . $TagDescription . '</td> <td>' . $JournalItem->GLCode . ' - ' . $JournalItem->GLActName . '</td>'; if ($JournalItem->Amount>0) { - echo '<td class="number">' . locale_number_format($JournalItem->Amount,$_SESSION['CompanyRecord']['decimalplaces']) . '</td><td></td>'; - $DebitTotal=$DebitTotal+$JournalItem->Amount; + echo '<td class="number">' . locale_number_format($JournalItem->Amount,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td></td>'; + $DebitTotal += $JournalItem->Amount; } elseif($JournalItem->Amount<0) { $Credit=(-1 * $JournalItem->Amount); echo '<td></td> @@ -384,9 +429,10 @@ } echo '<tr class="EvenTableRows"><td></td> - <td class="number"><b>' . _('Total') . '</b></td> - <td class="number"><b>' . locale_number_format($DebitTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> - <td class="number"><b>' . locale_number_format($CreditTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td></tr>'; + <td class="number"><b>' . _('Total') . '</b></td> + <td class="number"><b>' . locale_number_format($DebitTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + <td class="number"><b>' . locale_number_format($CreditTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + </tr>'; if ($DebitTotal!=$CreditTotal) { echo '<td align="center" style="background-color: #fddbdb"><b>' . _('Required to balance') .' - </b>' . locale_number_format(abs($DebitTotal-$CreditTotal),$_SESSION['CompanyRecord']['decimalplaces']); @@ -398,10 +444,15 @@ } 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>'; +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>'; } elseif(count($_SESSION['JournalDetail']->GLEntries)>0) { - echo '<br /><br />'; + echo '<br /> + <br />'; prnMsg(_('The journal must balance ie debits equal to credits before it can be processed'),'warn'); } Modified: trunk/WOSerialNos.php =================================================================== --- trunk/WOSerialNos.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WOSerialNos.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -40,13 +40,15 @@ $NextSerialNo = $_POST['NextSerialNo']; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="" alt="" />' . ' ' . _('For Work Order Number') . ' ' . $WO . ' ' . _('and output item') . ' ' . $StockID . ' - ' . $Description . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="" alt="" />' . ' ' . _('For Work Order Number') . ' ' . $WO . ' ' . _('and output item') . ' ' . $StockID . ' - ' . $Description . ' + </p>'; $DbgMsg = _('The SQL that failed was'); if (isset($_POST['AddControlledItems'])){ if (isset($_POST['NumberToAdd'])){ // Must be adding serial numbers automatically - if (!is_numeric($_POST['NumberToAdd'])){ + if (!is_numeric(filter_number_format($_POST['NumberToAdd']))){ prnMsg(_('The quantity of controlled items to add was not numeric - a number is expected'),'error'); } else { DB_Txn_Begin($db); @@ -62,7 +64,7 @@ '" . $WO . "', '', '' "; - for ($i=0;$i<$_POST['NumberToAdd'];$i++){ + for ($i=0;$i< filter_number_format($_POST['NumberToAdd']);$i++){ $NextItemNumber = $NextSerialNo + $i; $result = DB_query("SELECT serialno FROM woserialnos WHERE wo='" . $WO . "' @@ -93,7 +95,7 @@ $result = DB_query("UPDATE stockmaster SET nextserialno='" . $NextSerialNo . "' WHERE stockid='" . $StockID . "'",$db); - $result = DB_query("UPDATE woitems SET qtyreqd=qtyreqd+" . $_POST['NumberToAdd'] . " + $result = DB_query("UPDATE woitems SET qtyreqd=qtyreqd+" . filter_number_format($_POST['NumberToAdd']) . " WHERE stockid='" . $StockID . "' AND wo='" . $WO . "'",$db,$ErrMsg,$DbgMsg,true); DB_Txn_Commit($db); @@ -105,20 +107,20 @@ prnMsg(_('The batch or serial number reference has not been entered - a reference is required'),'error'); $InputError=true; } - if (!is_numeric($_POST['Quantity'])){ + if (!is_numeric(filter_number_format($_POST['Quantity']))){ prnMsg(_('The quantity for the batch must be numeric'),'error'); $InputError=true; } $result = DB_query("SELECT serialno FROM woserialnos WHERE wo='" . $WO . "' AND stockid='" . $StockID ."' - AND serialno='" . $_POST['Reference'] . "'",$db); + AND serialno='" . DB_escape_string($_POST['Reference']) . "'",$db); if (DB_num_rows($result)!=0){ $InputError=true; prnMsg(_('The serial number or batch reference must be unique to the item - the reference entered is already entered on this work order'),'error'); } $result = DB_query("SELECT serialno FROM stockserialitems - WHERE serialno='" . $_POST['Reference'] . "' + WHERE serialno='" . DB_escape_string($_POST['Reference']) . "' AND stockid='" . $StockID ."'",$db); if (DB_num_rows($result)!=0){ $InputError=true; @@ -128,7 +130,7 @@ DB_Txn_Begin($db); $ErrMsg = _('Could not add a new serial number/batch'); $result = DB_query("UPDATE woitems - SET qtyreqd=qtyreqd+" . $_POST['Quantity'] . " + SET qtyreqd=qtyreqd+" . filter_number_format($_POST['Quantity']) . " WHERE stockid='" . $StockID . "' AND wo='" . $WO . "'",$db,$ErrMsg,$DbgMsg,true); $sql = "INSERT INTO woserialnos (stockid, @@ -139,8 +141,8 @@ VALUES ('" . $StockID . "', '" . $WO . "', '', - '" . $_POST['Quantity'] . "', - '" . $_POST['Reference'] . "')"; + '" . filter_number_format($_POST['Quantity']) . "', + '" . DB_escape_string($_POST['Reference']) . "')"; $ErrMsg = _('Unable to add the batch or serial number requested'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); @@ -156,10 +158,10 @@ $result = DB_query("DELETE FROM woserialnos WHERE wo='" . $WO . "' AND stockid='" . $StockID . "' - AND serialno='" . $_GET['Reference'] ."'", + AND serialno='" . DB_escape_string($_GET['Reference']) ."'", $db); - $result = DB_query("UPDATE woitems SET qtyreqd=qtyreqd-" . $_GET['Quantity'] . " + $result = DB_query("UPDATE woitems SET qtyreqd=qtyreqd-" . filter_number_format($_GET['Quantity']) . " WHERE wo='" . $WO . "' AND stockid = '" . $StockID . "'",$db); @@ -183,13 +185,13 @@ $result = DB_query("SELECT serialno FROM woserialnos WHERE wo='" . $WO . "' AND stockid='" . $StockID ."' - AND serialno='" . $_POST['Reference' . $i] . "'",$db); + AND serialno='" . DB_escape_string($_POST['Reference' . $i]) . "'",$db); if (DB_num_rows($result)!=0){ $InputError=true; prnMsg($_POST['Reference' .$i] . ': ' . _('The reference entered is already entered on this work order'),'error'); } $result = DB_query("SELECT serialno FROM stockserialitems - WHERE serialno='" . $_POST['Reference' .$i] . "' + WHERE serialno='" . DB_escape_string($_POST['Reference' .$i]) . "' AND stockid='" . $StockID ."'",$db); if (DB_num_rows($result)!=0){ $InputError=true; @@ -197,13 +199,13 @@ } } if (!$InputError){ - $sql[] = "UPDATE woserialnos SET serialno='" . $_POST['Reference'.$i] . "', - quantity='" . $_POST['Quantity'.$i] ."', - qualitytext='" . $_POST['Notes'.$i] . "' + $sql[] = "UPDATE woserialnos SET serialno='" . DB_escape_string($_POST['Reference'.$i]) . "', + quantity='" . filter_number_format($_POST['Quantity'.$i]) ."', + qualitytext='" . DB_escape_string($_POST['Notes'.$i]) . "' WHERE wo='" . $WO . "' AND stockid='" . $StockID . "' - AND serialno='" . $_POST['OldReference'.$i] . "'"; - $WOQuantityTotal += $_POST['Quantity'.$i]; + AND serialno='" . DB_escape_string($_POST['OldReference'.$i]) . "'"; + $WOQuantityTotal += filter_number_format($_POST['Quantity'.$i]); } else { $WOQuantityTotal += $_POST['OldQuantity'.$i]; } @@ -226,39 +228,44 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<input type="hidden" name="StockID" value="' . $StockID . '">'; -echo '<input type="hidden" name="Description" value="' . $Description . '">'; -echo '<input type="hidden" name="WO" value="' . $WO . '">'; -echo '<input type="hidden" name="Serialised" value="' . $Serialised . '">'; -echo '<input type="hidden" name="NextSerialNo" value="' . $NextSerialNo . '">'; +echo '<input type="hidden" name="StockID" value="' . $StockID . '" />'; +echo '<input type="hidden" name="Description" value="' . $Description . '" />'; +echo '<input type="hidden" name="WO" value="' . $WO . '" />'; +echo '<input type="hidden" name="Serialised" value="' . $Serialised . '" />'; +echo '<input type="hidden" name="NextSerialNo" value="' . $NextSerialNo . '" />'; echo '<table class="selection">'; if ($Serialised==1 AND $NextSerialNo>0){ echo '<tr><td>' . _('Add A Number of New Serial Numbers'); echo ':</td> - <td><input type="text" name="NumberToAdd" size=10 class=number maxlength=10 value="1"></td> + <td><input type="text" name="NumberToAdd" size="10" class="number" maxlength="10" value="1" /></td> <td>' . _('Starting at') . ':</td><td align="right">' . $NextSerialNo . '</td>'; } else { //Need to allow entry of batch or serial number and its a batch a quantity too for individual entry if ($Serialised==1){ - echo '<tr><th></th><th>' . _('Serial No') . '</th></tr> + echo '<tr> + <th></th> + <th>' . _('Serial No') . '</th></tr> <tr><td>'; echo _('Add a single serial number'); } else { - echo '<tr><th></th><th>' . _('Batch/Lot Ref') . '</th><th>' . _('Quantity') . '</th></tr> + echo '<tr> + <th></th> + <th>' . _('Batch/Lot Ref') . '</th><th>' . _('Quantity') . '</th></tr> <tr><td>'; echo _('Add a single batch/lot number'); } - echo '<td><input type="text" name="Reference" maxlength="30" size="30"></td>'; + echo '<td><input type="text" name="Reference" maxlength="30" size="30" /></td>'; if ($Serialised==0){ //also need to add the quantity - echo '<td><input type="text" name="Quantity" size=10 class=number maxlength=10 value="1"></td>'; + echo '<td><input type="text" name="Quantity" size="10" class="number" maxlength="10" value="1" /></td>'; } else { //it will be 1 for a serial item - echo '<input type="hidden" name="Quantity" value=1>'; + echo '<input type="hidden" name="Quantity" value="1" />'; } } -echo '<td><input type="submit" name="AddControlledItems" value="' . _('Add') . '"></td></tr> +echo '<td><input type="submit" name="AddControlledItems" value="' . _('Add') . '" /></td> + </tr> </table> <br />'; @@ -275,11 +282,19 @@ if (DB_num_rows($WOSerialNoResult)==0){ prnMsg(_('There are no serial items or batches yet defined for this work order item. Create new items first'),'info'); } else { - echo '<br /><table class="selection">'; + echo '<br /> + <table class="selection">'; if ($Serialised==1){ - $Header = '<tr><th>' . _('Serial No') . '</th><th>' . _('Notes') . '</th></tr>'; + $Header = '<tr> + <th>' . _('Serial No') . '</th> + <th>' . _('Notes') . '</th> + </tr>'; } else { - $Header = '<tr><th>' . _('Batch Ref') . '</th><th>' . _('Quantity') . '</th><th>' . _('Notes') . '</th></tr>'; + $Header = '<tr> + <th>' . _('Batch Ref') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Notes') . '</th> + </tr>'; } echo $Header; $i = 0; @@ -291,28 +306,29 @@ $j=0; } - echo '<tr><td><input type="text" name="Reference' . $i .'" value="' . $WOSNRow['serialno'] . '"/></td>'; + echo '<tr> + <td><input type="text" name="Reference' . $i .'" value="' . $WOSNRow['serialno'] . '"/></td>'; echo '<input type="hidden" name="OldReference' . $i . '" value="' . $WOSNRow['serialno'] . '"/>'; if ($Serialised==0){ - echo '<td><input type="text" name="Quantity' . $i .'" value="' . $WOSNRow['quantity'] . '" /></td>'; - echo '<input type="hidden" name="OldQuantity' . $i . '" value="' . $WOSNRow['quantity'] . '" />'; + echo '<td><input type="text" name="Quantity' . $i .'" value="' . locale_number_format($WOSNRow['quantity'],'Variable') . '" /></td>'; + echo '<input type="hidden" name="OldQuantity' . $i . '" value="' . locale_number_format($WOSNRow['quantity'],'Variable') . '" />'; } else { - echo '<input type="hidden" name="Quantity' . $i . '" value="1">'; + echo '<input type="hidden" name="Quantity' . $i . '" value="1" />'; } - echo '<td><textarea name="Notes' . $i .'" cols=60 rows=3>' . $WOSNRow['qualitytext'] .'</textarea></td>'; - echo '<td><a href="' . $_SESSION['PHP_SELF'] . '?Delete=1&Reference=' . $WOSNRow['serialno'] . '&Quantity=' . $WOSNRow['quantity'] . '&WO=' . $WO . '&StockID=' . $StockID . '&Description=' . $Description . '&Serialised=' . $Serialised . '&NextSerialNo=' . $NextSerialNo . '">' . _('Delete') . '</td></tr>'; + echo '<td><textarea name="Notes' . $i .'" cols="60" rows="3">' . $WOSNRow['qualitytext'] .'</textarea></td>'; + echo '<td><a href="' . $_SESSION['PHP_SELF'] . '?Delete=1&Reference=' . $WOSNRow['serialno'] . '&Quantity=' . locale_number_format($WOSNRow['quantity'],'Variable') . '&WO=' . $WO . '&StockID=' . $StockID . '&Description=' . $Description . '&Serialised=' . $Serialised . '&NextSerialNo=' . $NextSerialNo . '">' . _('Delete') . '</a></td></tr>'; $i++; $j++; } - echo '<input type="hidden" name="CountOfItems" value=' . $i . '>'; + echo '<input type="hidden" name="CountOfItems" value="' . $i . '" />'; if ($Serialised==0){ echo '<tr><td style="text-align: center" colspan="3">'; } else { echo '<tr><td style="text-align: center" colspan="2">'; } - echo '<input type="submit" name="UpdateItems" value="' . _('Update') . '"></td></tr>'; + echo '<input type="submit" name="UpdateItems" value="' . _('Update') . '" /></td></tr>'; echo '</table>'; } //end of if there are woserialno items defined Modified: trunk/WWW_Access.php =================================================================== --- trunk/WWW_Access.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WWW_Access.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -24,7 +24,7 @@ /* actions to take once the user has clicked the submit button ie the page has called itself with some user input */ //first off validate inputs sensible - if (isset($_POST['SecRoleName']) && mb_strlen($_POST['SecRoleName'])<4){ + if (isset($_POST['SecRoleName']) AND mb_strlen($_POST['SecRoleName'])<4){ $InputError = 1; prnMsg(_('The role description entered must be at least 4 characters long'),'error'); } @@ -34,12 +34,12 @@ unset($sql); if (isset($_POST['SecRoleName']) ){ // Update or Add Security Headings if(isset($SelectedRole)) { // Update Security Heading - $sql = "UPDATE securityroles SET secrolename = '".$_POST['SecRoleName']."' + $sql = "UPDATE securityroles SET secrolename = '" . DB_escape_string($_POST['SecRoleName']) . "' WHERE secroleid = '".$SelectedRole . "'"; $ErrMsg = _('The update of the security role description failed because'); $ResMsg = _('The Security role description was updated.'); } else { // Add Security Heading - $sql = "INSERT INTO securityroles (secrolename) VALUES ('".$_POST['SecRoleName']."')"; + $sql = "INSERT INTO securityroles (secrolename) VALUES ('" . DB_escape_string($_POST['SecRoleName']) ."')"; $ErrMsg = _('The update of the security role failed because'); $ResMsg = _('The Security role was created.'); } @@ -165,10 +165,16 @@ if (!isset($_POST['SecRoleName'])) { $_POST['SecRoleName']=''; } -echo '<tr><td>' . _('Role') . ':</td> - <td><input type="text" name="SecRoleName" size=40 maxlength=40 value="' . $_POST['SecRoleName'] . '"></tr>'; -echo '</table><br /> - <div class="centre"><input type="submit" name="submit" value="' . _('Enter Role') . '"></div></form>'; +echo '<tr> + <td>' . _('Role') . ':</td> + <td><input type="text" name="SecRoleName" size=40 maxlength=40 value="' . $_POST['SecRoleName'] . '" /> + </tr>'; +echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Role') . '" /> + </div> + </form>'; if (isset($SelectedRole)) { $sql = "SELECT tokenid, tokenname Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WWW_Users.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -388,9 +388,9 @@ $_POST['Blocked'] = $myrow['blocked']; $_POST['PDFLanguage'] = $myrow['pdflanguage']; - echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '">'; - echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '">'; - echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '">'; + echo '<input type="hidden" name="SelectedUser" value="' . $SelectedUser . '" /'; + echo '<input type="hidden" name="UserID" value="' . $_POST['UserID'] . '" />'; + echo '<input type="hidden" name="ModulesAllowed" value="' . $_POST['ModulesAllowed'] . '" />'; echo '<table class=selection> <tr><td>' . _('User code') . ':</td><td>'; echo $_POST['UserID'] . '</td></tr>'; @@ -400,7 +400,7 @@ echo '<table class="selection"> <tr> <td>' . _('User Login') . ':</td> - <td><input type="text" name="UserID" size="22" maxlength="20"></td></tr>'; + <td><input type="text" name="UserID" size="22" maxlength="20" /></td></tr>'; /*set the default modules to show to all this had trapped a few people previously*/ @@ -668,7 +668,7 @@ echo '</table> <br /> <div class="centre"> - <input type="submit" name="submit" value="' . _('Enter Information') . '"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> </div> </form>'; Modified: trunk/WhereUsedInquiry.php =================================================================== --- trunk/WhereUsedInquiry.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WhereUsedInquiry.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -2,8 +2,6 @@ /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Where Used Inquiry'); include('includes/header.inc'); @@ -14,25 +12,30 @@ $StockID = trim(mb_strtoupper($_POST['StockID'])); } -echo "<a href='" . $rootpath . '/SelectProduct.php?' . SID . "'>" . _('Back to Items') . '</a><br />'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; +echo '<a href="' . $rootpath . '/SelectProduct.php">' . _('Back to Items') . '</a> + <br /> + <p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . ' + </p>'; if (isset($StockID)){ $result = DB_query("SELECT description, - units, - mbflag - FROM stockmaster - WHERE stockid='".$StockID."'",$db); + units, + mbflag + FROM stockmaster + WHERE stockid='".$StockID."'",$db); $myrow = DB_fetch_row($result); if (DB_num_rows($result)==0){ prnMsg(_('The item code entered') . ' - ' . $StockID . ' ' . _('is not set up as an item in the system') . '. ' . _('Re-enter a valid item code or select from the Select Item link above'),'error'); include('includes/footer.inc'); exit; } - echo "<br /><font color=navy size=3><b>$StockID - $myrow[0] </b> (" . _('in units of') . ' ' . $myrow[1] . ')</font>'; + echo '<br /> + <font color="navy" size="3"><b>' . $StockID . ' - ' . $myrow[0] . '</b> (' . _('in units of') . ' ' . $myrow[1] . ')</font>'; } -echo "<form action='" . $_SERVER['PHP_SELF'] . '?'. SID ."' method=post><div class='centre'>"; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <div class="centre"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($StockID)) { echo _('Enter an Item Code') . ': <input type="text" name="StockID" size="21" maxlength="20" value="' . $StockID . '" />'; @@ -40,19 +43,20 @@ echo _('Enter an Item Code') . ': <input type="text" name="StockID" size="21" maxlength="20" />'; } -echo "<input type=submit name='ShowWhereUsed' value='" . _('Show Where Used') . "'>"; +echo '<input type="submit" name="ShowWhereUsed" value="' . _('Show Where Used') . '" />'; -echo '</div><br />'; +echo '</div> + <br />'; if (isset($StockID)) { $SQL = "SELECT bom.*, - stockmaster.description - FROM bom INNER JOIN stockmaster + stockmaster.description + FROM bom INNER JOIN stockmaster ON bom.parent = stockmaster.stockid - WHERE component='" . $StockID . "' - AND bom.effectiveafter<='" . Date('Y-m-d') . "' - AND bom.effectiveto >='" . Date('Y-m-d') . "'"; + WHERE component='" . $StockID . "' + AND bom.effectiveafter<='" . Date('Y-m-d') . "' + AND bom.effectiveto >='" . Date('Y-m-d') . "'"; $ErrMsg = _('The parents for the selected part could not be retrieved because');; $result = DB_query($SQL,$db,$ErrMsg); @@ -60,45 +64,44 @@ prnMsg(_('The selected item') . ' ' . $StockID . ' ' . _('is not used as a component of any other parts'),'error'); } else { - echo '<table width=97% class=selection>'; + echo '<table width=97% class=selection>'; - $tableheader = '<tr><th>' . _('Used By') . '</th> - <th>' . _('Work Centre') . '</th> - <th>' . _('Location') . '</th> - <th>' . _('Quantity Required') . '</th> - <th>' . _('Effective After') . '</th> - <th>' . _('Effective To') . '</th></tr>'; - echo $tableheader; - $k=0; - while ($myrow=DB_fetch_array($result)) { + $TableHeader = '<tr> + <th>' . _('Used By') . '</th> + <th>' . _('Work Centre') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Quantity Required') . '</th> + <th>' . _('Effective After') . '</th> + <th>' . _('Effective To') . '</th> + </tr>'; + echo $TableHeader; + $k=0; + while ($myrow=DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">';; - $k=1; - } + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">';; + $k=1; + } - echo '<td><a target="_blank" href="' . $rootpath . '/BOMInquiry.php?StockID=' . $myrow['parent'] . '" alt="' . _('Show Bill Of Material') . '">' . $myrow['parent']. ' - ' . $myrow['description']. '</a></td>'; - echo '<td>' . $myrow['workcentreadded']. '</td>'; - echo '<td>' . $myrow['loccode']. '</td>'; - echo '<td>' . $myrow['quantity']. '</td>'; - echo '<td>' . ConvertSQLDate($myrow['effectiveafter']) . '</td>'; - echo '<td>' . ConvertSQLDate($myrow['effectiveto']) . '</td>'; + echo '<td><a target="_blank" href="' . $rootpath . '/BOMInquiry.php?StockID=' . $myrow['parent'] . '" alt="' . _('Show Bill Of Material') . '">' . $myrow['parent']. ' - ' . $myrow['description']. '</a></td> + <td>' . $myrow['workcentreadded']. '</td> + <td>' . $myrow['loccode']. '</td> + <td class="number">' . locale_number_format($myrow['quantity'],'Variable') . '</td> + <td>' . ConvertSQLDate($myrow['effectiveafter']) . '</td> + <td>' . ConvertSQLDate($myrow['effectiveto']) . '</td>'; - //end of page full new headings if - } + //end of page full new headings if + } - echo '</table>'; + echo '</table>'; } } // StockID is set -echo "<script>defaultControl(document.forms[0].StockID);</script>"; +echo '<script>defaultControl(document.forms[0].StockID);</script>'; - echo '</form>'; - include('includes/footer.inc'); - ?> \ No newline at end of file Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WorkCentres.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -42,7 +42,7 @@ delete code below*/ $sql = "UPDATE workcentres SET location = '" . $_POST['Location'] . "', - description = '" . $_POST['Description'] . "', + description = '" . DB_escape_string($_POST['Description']) . "', overheadrecoveryact ='" . $_POST['OverheadRecoveryAct'] . "', overheadperhour = '" . $_POST['OverheadPerHour'] . "' WHERE code = '" . $SelectedWC . "'"; @@ -52,13 +52,13 @@ /*Selected work centre is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new work centre form */ $sql = "INSERT INTO workcentres (code, - location, - description, - overheadrecoveryact, - overheadperhour) + location, + description, + overheadrecoveryact, + overheadperhour) VALUES ('" . $_POST['Code'] . "', '" . $_POST['Location'] . "', - '" . $_POST['Description'] . "', + '" . DB_escape_string($_POST['Description']) . "', '" . $_POST['OverheadRecoveryAct'] . "', '" . $_POST['OverheadPerHour'] . "' )"; @@ -107,7 +107,9 @@ then none of the above are true and the list of work centres will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . ' + </p>'; $sql = "SELECT workcentres.code, workcentres.description, @@ -120,31 +122,34 @@ $result = DB_query($sql,$db); echo '<table class="selection"> - <tr bgcolor ="#800000"><th>' . _('WC Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Location') . '</th> - <th>' . _('Overhead GL Account') . '</th> - <th>' . _('Overhead Per Hour') . '</th> + <tr bgcolor ="#800000"> + <th>' . _('WC Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Overhead GL Account') . '</th> + <th>' . _('Overhead Per Hour') . '</th> </tr>'; - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { - printf("<tr><td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td><a href=\"%s&SelectedWC=%s\">" . _('Edit') . "</td> - <td><a href=\"%s&SelectedWC=%s&delete=yes\">" . _('Delete') ."</td> - </tr>", - $myrow[0], - $myrow[1], - $myrow[2], - $myrow[3], - $myrow[4], + printf('<tr> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td><a href="%s&SelectedWC=%s">' . _('Edit') . '</td> + <td><a href="%s&SelectedWC=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this work centre?') . '\');">' . _('Delete') .'</td> + </tr>', + $myrow['code'], + $myrow['description'], + $myrow['locationname'], + $myrow['overheadrecoveryact'], + $myrow['overheadperhour'], $_SERVER['PHP_SELF'] . '?', - $myrow[0], $_SERVER['PHP_SELF'] . '?', - $myrow[0]); + $myrow['code'], + $_SERVER['PHP_SELF'] . '?', + $myrow['code']); } //END WHILE LIST LOOP @@ -158,20 +163,21 @@ echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show all Work Centres') . '</a></div>'; } -echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<br /> + <form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedWC)) { //editing an existing work centre $sql = "SELECT code, - location, - description, - overheadrecoveryact, - overheadperhour - FROM workcentres - WHERE code='" . $SelectedWC . "'"; - + location, + description, + overheadrecoveryact, + overheadperhour + FROM workcentres + WHERE code='" . $SelectedWC . "'"; + $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -181,31 +187,36 @@ $_POST['OverheadRecoveryAct'] = $myrow['overheadrecoveryact']; $_POST['OverheadPerHour'] = $myrow['overheadperhour']; - echo '<input type="hidden" name="SelectedWC" value=' . $SelectedWC . '>'; - echo '<input type="hidden" name="Code" value="' . $_POST['Code'] . '">'; - echo '<table class="selection"><tr><td>' ._('Work Centre Code') . ':</td> - <td>' . $_POST['Code'] . '</td></tr>'; + echo '<input type="hidden" name="SelectedWC" value="' . $SelectedWC . '" /> + <input type="hidden" name="Code" value="' . $_POST['Code'] . '" /> + <table class="selection"> + <tr> + <td>' ._('Work Centre Code') . ':</td> + <td>' . $_POST['Code'] . '</td> + </tr>'; } else { //end of if $SelectedWC only do the else when a new record is being entered if (!isset($_POST['Code'])) { $_POST['Code'] = ''; } - echo '<table class="selection"><tr> - <td>' . _('Work Centre Code') . ':</td> - <td><input type="Text" name="Code" size="6" maxlength="5" value="' . $_POST['Code'] . '"></td> + echo '<table class="selection"> + <tr> + <td>' . _('Work Centre Code') . ':</td> + <td><input type="text" name="Code" size="6" maxlength="5" value="' . $_POST['Code'] . '" /></td> </tr>'; } $SQL = "SELECT locationname, - loccode + loccode FROM locations"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { $_POST['Description'] = ''; } -echo '<tr><td>' . _('Work Centre Description') . ':</td> - <td><input type="Text" name="Description" size="21" maxlength="20" value="' . $_POST['Description'] . '"></td> +echo '<tr> + <td>' . _('Work Centre Description') . ':</td> + <td><input type="Text" name="Description" size="21" maxlength="20" value="' . $_POST['Description'] . '" /></td> </tr> <tr><td>' . _('Location') . ':</td> <td><select name="Location">'; @@ -214,7 +225,7 @@ if (isset($_POST['Location']) and $myrow['loccode']==$_POST['Location']) { echo '<option selected value="'; } else { - echo '<option VALUE="'; + echo '<option value="'; } echo $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; @@ -223,13 +234,15 @@ DB_free_result($result); -echo '</select></td></tr> - <tr><td>' . _('Overhead Recovery GL Account') . ':</td> +echo '</select></td> + </tr> + <tr> + <td>' . _('Overhead Recovery GL Account') . ':</td> <td><select name="OverheadRecoveryAct">'; //SQL to poulate account selection boxes $SQL = "SELECT accountcode, - accountname + accountname FROM chartmaster INNER JOIN accountgroups ON chartmaster.group_=accountgroups.groupname WHERE accountgroups.pandl!=0 @@ -253,17 +266,23 @@ } echo '</td></tr>'; -echo '<tr><td>' . _('Overhead Per Hour') . ':</td> - <td><input type="Text" class="number" name="OverheadPerHour" size=6 maxlength=6 value='.$_POST['OverheadPerHour'].'>'; +echo '<tr> + <td>' . _('Overhead Per Hour') . ':</td> + <td><input type="text" class="number" name="OverheadPerHour" size="6" maxlength="6" value="'.$_POST['OverheadPerHour'].'" />'; -echo '</td></tr></table>'; +echo '</td> + </tr> + </table>'; -echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; +echo '<br /> + <div class="centre"> + <input type="Submit" name="submit" value="' . _('Enter Information') . '" /> + </div>'; if (!isset($_GET['SelectedWC']) or $_GET['SelectedWC']=='') { - echo "<script>defaultControl(document.forms[0].Code);</script>"; + echo '<script>defaultControl(document.forms[0].Code);</script>'; } else { - echo "<script>defaultControl(document.forms[0].Description);</script>"; + echo '<script>defaultControl(document.forms[0].Description);</script>'; } echo '</form>'; Modified: trunk/WorkOrderCosting.php =================================================================== --- trunk/WorkOrderCosting.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WorkOrderCosting.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -6,11 +6,13 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a><br />'; +echo '<a href="'. $rootpath . '/SelectWorkOrder.php">' . _('Back to Work Orders'). '</a> + <br /> + <p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . + _('Search') . '" alt="" />' . ' ' . $title . ' + </p>'; -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -47,14 +49,17 @@ $WorkOrderRow = DB_fetch_array($WOResult); -echo '<table cellpadding=2 class=selection> - <tr><td class="label">' . _('Work order') . ':</td> +echo '<table class="selection"> + <tr> + <td class="label">' . _('Work order') . ':</td> <td>' . $_POST['WO'] .'</td> <td class="label">' . _('Manufactured at') . ':</td> <td>' . $WorkOrderRow['locationname'] . '</td> <td class="label">' . _('Required By') . ':</td> - <td>' . ConvertSQLDate($WorkOrderRow['requiredby']) . '</td></tr> - </table><br />'; + <td>' . ConvertSQLDate($WorkOrderRow['requiredby']) . '</td> + </tr> + </table> + <br />'; $WOItemsResult = DB_query("SELECT woitems.stockid, @@ -77,19 +82,23 @@ $db, $ErrMsg); -echo '<table class="selection"><tr><th>' . _('Item') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Quantity Required') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('Quantity Received') . '</th> - <th>' . _('Status') . '</th> - <th>' . _('Receive') . '</th> - <th>' . _('Issue') . '</th></tr>'; +echo '<table class="selection"> + <tr> + <th>' . _('Item') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity Required') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Quantity Received') . '</th> + <th>' . _('Status') . '</th> + <th>' . _('Receive') . '</th> + <th>' . _('Issue') . '</th> + </tr>'; $TotalStdValueRecd =0; while ($WORow = DB_fetch_array($WOItemsResult)){ - echo '<tr><td>' . $WORow['stockid'] . '</td> + echo '<tr> + <td>' . $WORow['stockid'] . '</td> <td>' . $WORow['description'] . '</td> <td class="number">' . locale_number_format($WORow['qtyreqd'],$WORow['decimalplaces']) . '</td> <td>' . $WORow['units'] . '</td> @@ -106,18 +115,18 @@ <br /> <table class="selection">'; +echo '<tr> + <th>' . _('Item') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Qty Reqd') . '</th> + <th>' . _('Cost Reqd') . '</th> + <th>' . _('Date Issued') . '</th> + <th>' . _('Issued Qty') . '</th> + <th>' . _('Issued Cost') . '</th> + <th>' . _('Usage Variance') . '</th> + <th>' . _('Cost Variance') . '</th> + </tr>'; -echo '<tr><th>' . _('Item') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Qty Reqd') . '</th> - <th>' . _('Cost Reqd') . '</th> - <th>' . _('Date Issued') . '</th> - <th>' . _('Issued Qty') . '</th> - <th>' . _('Issued Cost') . '</th> - <th>' . _('Usage Variance') . '</th> - <th>' . _('Cost Variance') . '</th> - </tr>'; - $RequirementsResult = DB_query("SELECT worequirements.stockid, stockmaster.description, stockmaster.decimalplaces, @@ -185,7 +194,8 @@ } else { echo '<tr class="OddTableRows">'; } - echo '<td colspan="9"><hr></td></tr>'; + echo '<td colspan="9"><hr></td> + </tr>'; } if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -201,13 +211,15 @@ /*Required quantity is the quantity required of the component based on the quantity of the finished item received */ $UsageVar =($RequirementsRow['requiredqty']-$IssueQty)*($RequirementsRow['stdcost']); - echo '<td colspan="2"></td><td class="number">' . locale_number_format($RequirementsRow['requiredqty'],$RequirementsRow['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($RequirementsRow['expectedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td></td> - <td class="number">' . locale_number_format($IssueQty,$RequirementsRow['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($IssueCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($UsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($CostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + echo '<td colspan="2"></td> + <td class="number">' . locale_number_format($RequirementsRow['requiredqty'],$RequirementsRow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($RequirementsRow['expectedcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td></td> + <td class="number">' . locale_number_format($IssueQty,$RequirementsRow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($IssueCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($UsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($CostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; $TotalReqdCost += $RequirementsRow['expectedcost']; $TotalIssuedCost += $IssueCost; $TotalCostVar += $CostVar; @@ -217,26 +229,28 @@ } else { $k++; } - echo '<tr><td colspan="9"><hr></td></tr>'; + echo '<tr> + <td colspan="9"><hr></td> + </tr>'; } //Now need to run through the issues to the work order that weren't in the requirements $sql = "SELECT stockmoves.stockid, - stockmaster.description, - stockmaster.decimalplaces, - trandate, - qty, - stockmoves.standardcost - FROM stockmoves INNER JOIN stockmaster - ON stockmoves.stockid=stockmaster.stockid - WHERE stockmoves.type=28 - AND reference = '" . $_POST['WO'] . "' - AND stockmoves.stockid NOT IN - (SELECT worequirements.stockid - FROM worequirements - WHERE worequirements.wo='" . $_POST['WO'] . "')"; + stockmaster.description, + stockmaster.decimalplaces, + trandate, + qty, + stockmoves.standardcost + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + WHERE stockmoves.type=28 + AND reference = '" . $_POST['WO'] . "' + AND stockmoves.stockid NOT IN + (SELECT worequirements.stockid + FROM worequirements + WHERE worequirements.wo='" . $_POST['WO'] . "')"; $WOIssuesResult = DB_query($sql,$db,_('Could not get issues that were not required by the BOM because')); @@ -251,33 +265,38 @@ } echo '<td>' . $WOIssuesRow['stockid'] . '</td> - <td>' . $WOIssuesRow['description'] . '</td> - <td class="number">0</td> - <td class="number">0</td> - <td>' . ConvertSQLDate($WOIssuesRow['trandate']) . '</td> - <td class="number">' . locale_number_format(-$WOIssuesRow['qty'],$WOIssuesRow['decimalplaces']) .'</td> - <td class="number">' . locale_number_format(-$WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class="number">' . locale_number_format($WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class="number">0</td></tr>'; + <td>' . $WOIssuesRow['description'] . '</td> + <td class="number">0</td> + <td class="number">0</td> + <td>' . ConvertSQLDate($WOIssuesRow['trandate']) . '</td> + <td class="number">' . locale_number_format(-$WOIssuesRow['qty'],$WOIssuesRow['decimalplaces']) .'</td> + <td class="number">' . locale_number_format(-$WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">' . locale_number_format($WOIssuesRow['qty']*$WOIssuesRow['standardcost'],$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">0</td> + </tr>'; $TotalUsageVar += ($WOIssuesRow['qty']*$WOIssuesRow['standardcost']); } } # <!-- <td colspan="5"></td> --> -echo '<tr><td colspan="3"></td> +echo '<tr> + <td colspan="3"></td> <td><hr/></td> <td colspan="2"></td> <td colspan="3"><hr></td> </tr>'; -echo '<tr><td colspan="2" class="number">' . _('Totals') . '</td> - <td></td> - <td class="number">' . locale_number_format($TotalReqdCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td></td><td></td> - <td class="number">' . locale_number_format($TotalIssuedCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> - <td class="number">' . locale_number_format($TotalUsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($TotalCostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; - -echo '<tr><td colspan="3"></td> +echo '<tr> + <td colspan="2" class="number">' . _('Totals') . '</td> + <td></td> + <td class="number">' . locale_number_format($TotalReqdCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td></td><td></td> + <td class="number">' . locale_number_format($TotalIssuedCost,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + <td class="number">' . locale_number_format($TotalUsageVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($TotalCostVar,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; + +echo '<tr> + <td colspan="3"></td> <td><hr/></td> <td colspan="2"></td> <td colspan="3"><hr></td> @@ -403,12 +422,12 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $TotalUsageVar!=0){ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (29, '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', @@ -422,12 +441,12 @@ $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (29, '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', @@ -445,11 +464,11 @@ if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $TotalCostVar!=0){ $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, + typeno, + trandate, + periodno, + account, + narrative, amount) VALUES (29, '" . $WOCloseNo . "', @@ -464,12 +483,12 @@ $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); $SQL = "INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (29, '" . $WOCloseNo . "', '" . Date('Y-m-d') . "', @@ -515,12 +534,21 @@ if ($WorkOrderRow['closed']==0){ - echo '<tr><td colspan="9"><div class="centre"><input type=submit name="Close" value="' . _('Close This Work Order') . '" onclick="return confirm(\'' . _('Closing the work order takes the variances to the general ledger (if integrated). The work order will no longer be able to have manufactured goods received entered against it or materials issued to it.') . ' ' . _('Are You Sure?') . '\');"></div></td></tr>'; + echo '<tr> + <td colspan="9"> + <div class="centre"> + <input type=submit name="Close" value="' . _('Close This Work Order') . '" onclick="return confirm(\'' . _('Closing the work order takes the variances to the general ledger (if integrated). The work order will no longer be able to have manufactured goods received entered against it or materials issued to it.') . ' ' . _('Are You Sure?') . '\');"> + </div> + </td> + </tr>'; } else { - echo '<tr><td colspan="9">' . _('This work order is closed and cannot accept additional issues of materials or receipts of manufactured items') . '</td></tr>'; + echo '<tr> + <td colspan="9">' . _('This work order is closed and cannot accept additional issues of materials or receipts of manufactured items') . '</td> + </tr>'; } -echo '</table>'; -echo '</form>'; +echo '</table> + + </form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/WorkOrderEntry.php =================================================================== --- trunk/WorkOrderEntry.php 2011-10-19 09:40:44 UTC (rev 4728) +++ trunk/WorkOrderEntry.php 2011-10-22 05:19:43 UTC (rev 4729) @@ -7,8 +7,10 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title.'</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Search') . + '" alt="" />' . ' ' . $title.' + </p>'; if (isset($_GET['ReqDate'])){ $ReqDate = $_GET['ReqDate']; @@ -68,23 +70,22 @@ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D') AND stockmaster.description " . LIKE . " '$SearchString' AND stockmaster.discontinued=0 AND mbflag='M' ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid... [truncated message content] |
From: <dai...@us...> - 2011-10-23 05:41:44
|
Revision: 4730 http://web-erp.svn.sourceforge.net/web-erp/?rev=4730&view=rev Author: daintree Date: 2011-10-23 05:41:35 +0000 (Sun, 23 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/GLBudgets.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTags.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GoodsReceived.php trunk/GoodsReceivedControlled.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/MRP.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MailInventoryValuation.php trunk/includes/DefineStockAdjustment.php Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLBudgets.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -184,7 +184,7 @@ for ($i=1; $i<=12; $i++) { echo '<tr>'; echo '<th>'. $PeriodEnd[$CurrentYearEndPeriod-(24-$i)] .'</th>'; - echo '<td bgcolor="d2e5e8" class="number">'.locale_number_format($Actual[$CurrentYearEndPeriod-(24-$i)],2).'</td>'; + echo '<td bgcolor="d2e5e8" class="number">'.locale_number_format($Actual[$CurrentYearEndPeriod-(24-$i)],$_SESSION['CompanyRecord']['decimalplaces']).'</td>'; echo '<td><input type="text" class="number" size=14 name="'.$i.'last" value="'.locale_number_format($Budget[$CurrentYearEndPeriod-(24-$i)],$_SESSION['CompanyRecord']['decimalplaces']) .'" /></td>'; echo '<th>'. $PeriodEnd[$CurrentYearEndPeriod-(12-$i)] .'</th>'; echo '<td bgcolor="d2e5e8" class="number">'.locale_number_format($Actual[$CurrentYearEndPeriod-(12-$i)],$_SESSION['CompanyRecord']['decimalplaces']).'</td>'; Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLProfit_Loss.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -12,15 +12,21 @@ $_POST['SelectADifferentPeriod']='Select A Different Period'; } -if ((!isset($_POST['FromPeriod']) AND !isset($_POST['ToPeriod'])) OR isset($_POST['SelectADifferentPeriod'])){ +if ((!isset($_POST['FromPeriod']) + AND !isset($_POST['ToPeriod'])) + OR isset($_POST['SelectADifferentPeriod'])){ include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Profit and Loss Report') . '</p>'; -echo '<div class="page_help_text">' . _('Profit and loss statement (P&L), also called an Income Statment, or Statement of Operations, this is the statement that indicates how the revenue (money received from the sale of products and services before expenses are taken out, also known as the "top line") is transformed into the net income (the result after all revenues and expenses have been accounted for, also known as the "bottom line").') . '<br />' -. _('The purpose of the income statement is to show whether the company made or lost money during the period being reported.') . '<br />' -. _('The P&L represents a period of time. This contrasts with the Balance Sheet, which represents a single moment in time.') . '<br />' -. _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Profit and Loss Report') . ' + </p>'; + echo '<div class="page_help_text">' . _('Profit and loss statement (P&L), also called an Income Statment, or Statement of Operations, this is the statement that indicates how the revenue (money received from the sale of products and services before expenses are taken out, also known as the "top line") is transformed into the net income (the result after all revenues and expenses have been accounted for, also known as the "bottom line").') . + '<br />' + . _('The purpose of the income statement is to show whether the company made or lost money during the period being reported.') . '<br />' + . _('The P&L represents a period of time. This contrasts with the Balance Sheet, which represents a single moment in time.') . '<br />' + . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -37,7 +43,7 @@ /*Show a form to allow input of criteria for profit and loss to show */ echo '<p><table class="selection"> <tr><td>' . _('Select Period From') . ':</td> - <td><select Name="FromPeriod">'; + <td><select name="FromPeriod">'; $sql = "SELECT periodno, lastdate_in_period @@ -49,20 +55,21 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ - echo '<option selected value=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value="' . $myrow['periodno'] . '">' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } else { if($myrow['lastdate_in_period']==$DefaultFromDate){ - echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ $LastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); $sql = "SELECT periodno FROM periods where lastdate_in_period = '" . $LastDate . "'"; @@ -90,19 +97,24 @@ } echo '</select></td></tr>'; - echo '<tr><td>'._('Detail Or Summary').':</td> - <td><select name="Detail"> + echo '<tr> + <td>'._('Detail Or Summary').':</td> + <td><select name="Detail"> <option selected value="Summary">'._('Summary') . '</option> <option selected value="Detailed">'._('All Accounts') . '</option> </select> - </td> - </tr>'; + </td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="ShowPL" value="' ._('Show on Screen (HTML)') . '" /> + </div> + <br /> + <div class="centre"> + <input type="submit" name="PrintPDF" value="'._('Produce PDF Report').'" /> + </div>'; - echo '</table>'; - - echo '<br /><div class="centre"><input type="submit" name="ShowPL" value="' ._('Show on Screen (HTML)') . '"></div>'; - echo '<br /><div class="centre"><input type="submit" name="PrintPDF" value="'._('Produce PDF Report').'"></div>'; - /*Now do the posting while the user is thinking about the period to select */ include ('includes/GLPostings.inc'); @@ -344,7 +356,7 @@ if ($myrow['groupname'] != $ActGrp){ if ($myrow['parentgroupname']==$ActGrp AND $ActGrp !=''){ //adding another level of nesting - $Level++; + $Level++; } $ActGrp = $myrow['groupname']; $ParentGroups[$Level]=$ActGrp; @@ -537,10 +549,10 @@ } else { include('includes/header.inc'); - echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '"> - <input type=hidden name="ToPeriod" value="' . $_POST['ToPeriod'] . '">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '" /> + <input type=hidden name="ToPeriod" value="' . $_POST['ToPeriod'] . '" />'; $NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1; @@ -556,7 +568,6 @@ $myrow = DB_fetch_row($PrdResult); $PeriodToDate = MonthAndYearFromSQLDate($myrow[0]); - $SQL = "SELECT accountgroups.sectioninaccounts, accountgroups.parentgroupname, accountgroups.groupname, @@ -568,20 +579,18 @@ SUM(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, SUM(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, SUM(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails - ON chartmaster.accountcode= chartdetails.accountcode - WHERE accountgroups.pandl=1 - GROUP BY accountgroups.sectioninaccounts, + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails + ON chartmaster.accountcode= chartdetails.accountcode + WHERE accountgroups.pandl=1 + GROUP BY accountgroups.sectioninaccounts, accountgroups.parentgroupname, accountgroups.groupname, chartdetails.accountcode, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, + chartmaster.accountname + ORDER BY accountgroups.sectioninaccounts, accountgroups.sequenceintb, accountgroups.groupname, - accountgroups.sequenceintb, chartdetails.accountcode"; $AccountsResult = DB_query($SQL,$db,_('No general ledger accounts were returned by the SQL because'),_('The SQL that failed was')); @@ -591,22 +600,22 @@ /*show a table of the accounts info returned by the SQL Account Code , Account Name , Month Actual, Month Budget, Period Actual, Period Budget */ - echo '<table cellpadding=2 class=selection>'; + echo '<table class="selection">'; if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> <th>' . _('Account') . '</th> <th>'._('Account Name') .'</th> - <th colspan=2>' . _('Period Actual') .'</th> - <th colspan=2>' . _('Period Budget') .'</th> - <th colspan=2>' . _('Last Year') . '</th> + <th colspan="2">' . _('Period Actual') .'</th> + <th colspan="2">' . _('Period Budget') .'</th> + <th colspan="2">' . _('Last Year') . '</th> </tr>'; } else { /*summary */ $TableHeader = '<tr> - <th colspan=2></th> - <th colspan=2>' . _('Period Actual') .'</th> - <th colspan=2>' . _('Period Budget') . '</th> - <th colspan=2>' . _('Last Year') . '</th> + <th colspan="2"></th> + <th colspan="2">' . _('Period Actual') .'</th> + <th colspan="2">' . _('Period Budget') . '</th> + <th colspan="2">' . _('Last Year') . '</th> </tr>'; } @@ -643,8 +652,8 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -652,13 +661,13 @@ } if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> + <td colspan="2"><font size="2"><i>%s</i></font></td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ActGrpLabel, locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), @@ -666,12 +675,12 @@ locale_number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> + <td colspan="2"><font size=2><i>%s </i></font></td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> </tr>', $ActGrpLabel, @@ -688,8 +697,8 @@ //still need to print out the old group totals if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -698,13 +707,13 @@ if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> + <td colspan="2"><font size=2><i>%s </i></font></td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ActGrpLabel, locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), @@ -712,12 +721,12 @@ locale_number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> + <td colspan="2"><font size=2><i>%s </i></font></td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> </tr>', $ActGrpLabel, @@ -740,21 +749,21 @@ echo '<tr> <td colspan=3></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> + <td colspan="2"><font size=4>%s</font></td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), @@ -765,21 +774,21 @@ $TotalLYIncome = -$SectionPrdLY; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> + <td colspan="2"></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> + <td colspan="2"><font size=4>%s</font></td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), @@ -788,17 +797,17 @@ } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> + <td colspan="2"><font size=4>'._('Gross Profit').'</font></td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', locale_number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), @@ -820,18 +829,18 @@ $LYGPPercent = 0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td colspan="2"><font size=2><i>'._('Gross Profit Percent').'</i></font></td> <td></td> - <td class=number><I>%s</I></td> + <td class="number"><i>%s</i></td> <td></td> - <td class=number><I>%s</I></td> + <td class="number"><i>%s</i></td> <td></td> - <td class=number><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', + <td class="number"><i>%s</i></td> + </tr><tr><td colspan="6"> </td></tr>', locale_number_format($PrdGPPercent,1) . '%', locale_number_format($BudgetGPPercent,1) . '%', locale_number_format($LYGPPercent,1). '%'); @@ -846,7 +855,7 @@ if ($_POST['Detail']=='Detailed'){ printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> + <td colspan="6"><font size=4 color=BLUE><b>%s</b></font></td> </tr>', $Sections[$myrow['sectioninaccounts']]); } @@ -908,11 +917,11 @@ printf('<td>%s</td> <td>%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ActEnquiryURL, $myrow['accountname'], @@ -922,11 +931,11 @@ } else { printf('<td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> </tr>', $ActEnquiryURL, @@ -947,8 +956,8 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -956,32 +965,32 @@ } if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - </tr>', - $ActGrpLabel, - locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format(-$GrpPrdLY[$Level]),$_SESSION['CompanyRecord']['decimalplaces']); + <td colspan="2"><font size=2><i>%s </i></font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + </tr>', + $ActGrpLabel, + locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format(-$GrpPrdLY[$Level]),$_SESSION['CompanyRecord']['decimalplaces']); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - </tr>', - $ActGrpLabel, - locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); + <td colspan="2"><font size=2><i>%s </i></font></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + </tr>', + $ActGrpLabel, + locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -992,8 +1001,8 @@ //still need to print out the old group totals if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -1002,13 +1011,13 @@ if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> + <td colspan="2"><font size=2><i>%s </i></font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> </tr>', $ActGrpLabel, locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), @@ -1016,13 +1025,13 @@ locale_number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> + <td colspan="2"><font size="2"><i>%s </i></font></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> </tr>', $ActGrpLabel, locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), @@ -1043,21 +1052,21 @@ echo '<tr> <td colspan=3></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> + <td colspan="2"><font size=4>%s</font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), @@ -1068,21 +1077,21 @@ $TotalLYIncome = -$SectionPrdLY; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> + <td colspan="2"></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> + <td colspan="2"><font size=4>%s</font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), @@ -1091,17 +1100,17 @@ } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> + <td colspan="2"><font size="4">'._('Gross Profit').'</font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> </tr>', locale_number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), @@ -1123,18 +1132,18 @@ $LYGPPercent = 0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td colspan="2"><font size=2><i>'._('Gross Profit Percent').'</i></font></td> <td></td> - <td class=number><I>%s</I></td> + <td class="number"><i>%s</i></td> <td></td> - <td class=number><I>%s</I></td> + <td class="number"><i>%s</i></td> <td></td> - <td class=number><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', + <td class="number"><i>%s</i></td> + </tr><tr><td colspan="6"> </td></tr>', locale_number_format($PrdGPPercent,1) . '%', locale_number_format($BudgetGPPercent,1) . '%', locale_number_format($LYGPPercent,1). '%'); @@ -1149,7 +1158,7 @@ if ($_POST['Detail']=='Detailed' and isset($Sections[$myrow['sectioninaccounts']])){ printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> + <td colspan="6"><font size=4 color=BLUE><b>%s</b></font></td> </tr>', $Sections[$myrow['sectioninaccounts']]); } @@ -1158,23 +1167,22 @@ } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr bgcolor="#ffffff"> - <td colspan=2><font size="4" color="blue"><b>'._('Profit').' - '._('Loss').'</b></font></td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> + <td colspan="2"><font size="4" color="blue"><b>'._('Profit').' - '._('Loss').'</b></font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> </tr>', locale_number_format(-$PeriodProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format(-$PeriodBudgetProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format(-$PeriodLYProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']) - ); + locale_number_format(-$PeriodLYProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']) ); if ($TotalIncome !=0){ $PrdNPPercent = 100*(-$PeriodProfitLoss)/$TotalIncome; @@ -1193,18 +1201,18 @@ } echo '<tr> <td colspan="2"></td> - <td colspan="6"><hr></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan="2"><font size="2"><I>'._('Net Profit Percent').'</I></font></td> - <td></td> - <td class="number"><I>%s</I></td> - <td></td> - <td class="number"><I>%s</I></td> - <td></td> - <td class="number"><I>%s</I></td> - </tr><tr><td colspan="6"> </td> + <td colspan="2"><font size="2"><i>'._('Net Profit Percent').'</i></font></td> + <td></td> + <td class="number"><i>%s</i></td> + <td></td> + <td class="number"><i>%s</i></td> + <td></td> + <td class="number"><i>%s</i></td> + </tr><tr><td colspan="6"> </td> </tr>', locale_number_format($PrdNPPercent,1) . '%', locale_number_format($BudgetNPPercent,1) . '%', Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLTagProfit_Loss.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -8,7 +8,7 @@ include('includes/AccountSectionsDef.inc'); // This loads the $Sections variable -if (isset($_POST['FromPeriod']) and ($_POST['FromPeriod'] > $_POST['ToPeriod'])){ +if (isset($_POST['FromPeriod']) AND ($_POST['FromPeriod'] > $_POST['ToPeriod'])){ prnMsg(_('The selected period from is actually after the period to') . '! ' . _('Please reselect the reporting period'),'error'); $_POST['SelectADifferentPeriod']='Select A Different Period'; } @@ -18,8 +18,9 @@ include('includes/header.inc'); echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' - . _('Print') . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . $title . ' + </p>'; if (Date('m') > $_SESSION['YearEnd']){ /*Dates in SQL format */ @@ -60,10 +61,11 @@ } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ - $lastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); - $sql = "SELECT periodno FROM periods where lastdate_in_period = '$lastDate'"; + $LastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); + $sql = "SELECT periodno FROM periods where lastdate_in_period = '" . $LastDate . "'"; $MaxPrd = DB_query($sql,$db); $MaxPrdrow = DB_fetch_row($MaxPrd); $DefaultToPeriod = (int) ($MaxPrdrow[0]); @@ -88,7 +90,9 @@ } echo '</select></td></tr>'; //Select the tag - echo '<tr><td>'._('Select tag').'<td><select name="tag">'; + echo '<tr> + <td>'._('Select tag').'</td> + <td><select name="tag">'; $SQL = "SELECT tagref, tagdescription @@ -114,14 +118,15 @@ <option selected value="Detailed">'._('All Accounts') . '</option> </select> </td> - </tr>'; - - echo '</table><br />'; - - echo '<div class="centre"><input type="submit" name="ShowPL" value="'._('Show Statement of Income and Expenditure').'"> + </tr> + </table> <br /> - <br /> - <input type="submit" name="PrintPDF" value="'._('PrintPDF').'" /></div>'; + <div class="centre"> + <input type="submit" name="ShowPL" value="'._('Show Statement of Income and Expenditure').'" /> + <br /> + <br /> + <input type="submit" name="PrintPDF" value="'._('PrintPDF').'" /> + </div>'; /*Now do the posting while the user is thinking about the period to select */ @@ -164,18 +169,18 @@ chartmaster.accountname, Sum(CASE WHEN (gltrans.periodno>='" . $_POST['FromPeriod'] . "' and gltrans.periodno<='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, Sum(CASE WHEN (gltrans.periodno='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans - ON chartmaster.accountcode= gltrans.account - WHERE accountgroups.pandl=1 - AND gltrans.tag='" . $_POST['tag'] . "' - GROUP BY accountgroups.sectioninaccounts, + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans + ON chartmaster.accountcode= gltrans.account + WHERE accountgroups.pandl=1 + AND gltrans.tag='" . $_POST['tag'] . "' + GROUP BY accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, gltrans.account, chartmaster.accountname, accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, + ORDER BY accountgroups.sectioninaccounts, accountgroups.sequenceintb, accountgroups.groupname, gltrans.account"; @@ -458,10 +463,10 @@ } else { include('includes/header.inc'); - echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '" /> - <input type="hidden" name="ToPeriod" value="' . $_POST['ToPeriod'] . '" />'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '" /> + <input type="hidden" name="ToPeriod" value="' . $_POST['ToPeriod'] . '" />'; $NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1; @@ -483,22 +488,21 @@ $SQL = "SELECT accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, - gltrans.account , + gltrans.account, chartmaster.accountname, Sum(CASE WHEN (gltrans.periodno>='" . $_POST['FromPeriod'] . "' AND gltrans.periodno<='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, Sum(CASE WHEN (gltrans.periodno='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans - ON chartmaster.accountcode= gltrans.account - WHERE accountgroups.pandl=1 - AND gltrans.tag='" . $_POST['tag'] . "' - GROUP BY accountgroups.sectioninaccounts, + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans + ON chartmaster.accountcode= gltrans.account + WHERE accountgroups.pandl=1 + AND gltrans.tag='" . $_POST['tag'] . "' + GROUP BY accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, gltrans.account, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, + chartmaster.accountname + ORDER BY accountgroups.sectioninaccounts, accountgroups.sequenceintb, accountgroups.groupname, gltrans.account"; @@ -515,18 +519,24 @@ . _('Print') . '" alt="" />' . ' ' . $title . '</p>'; echo '<table cellpadding="2" class="selection">'; - echo '<tr><th colspan=9><div class="centre"><font size=3 color=blue><b>' . _('Statement of Income and Expenditure for Tag'). ' ' . $myrow[0]._('during the'). ' ' . $NumberOfMonths . ' ' . _('months to'). ' ' . $PeriodToDate . '</b></font></div></th></tr>'; + echo '<tr> + <th colspan="9"> + <div class="centre"> + <font size="3" color="blue"><b>' . _('Statement of Income and Expenditure for Tag'). ' ' . $myrow[0]._('during the'). ' ' . $NumberOfMonths . ' ' . _('months to'). ' ' . $PeriodToDate . '</b></font> + </div> + </th> + </tr>'; if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> <th>' . _('Account') . '</th> <th>' . _('Account Name') . '</th> - <th colspan=2>' . _('Period Actual') . '</th> + <th colspan="2">' . _('Period Actual') . '</th> </tr>'; } else { /*summary */ $TableHeader = '<tr> - <th colspan=2></th> - <th colspan=2>' . _('Period Actual') . '</th> + <th colspan="2"></th> + <th colspan="2">' . _('Period Actual') . '</th> </tr>'; } @@ -551,8 +561,8 @@ $GrpPrdActual = array(0); $GrpPrdLY = array(0); $GrpPrdBudget = array(0); + $TotalIncome =0; - while ($myrow=DB_fetch_array($AccountsResult)) { @@ -561,8 +571,8 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -571,20 +581,20 @@ if ($Section ==3){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class="number">%s</td> - </tr>', - $ActGrpLabel, - locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); + <td colspan="2"><font size="2"><i>%s </i></font></td> + <td></td> + <td class="number">%s</td> + </tr>', + $ActGrpLabel, + locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class="number">%s</td> - <td></td> - </tr>', - $ActGrpLabel, - locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); + <td colspan="2"><font size="2"><i>%s </i></font></td> + <td class="number">%s</td> + <td></td> + </tr>', + $ActGrpLabel, + locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -595,8 +605,8 @@ //still need to print out the old group totals if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -605,17 +615,17 @@ if ($Section ==4){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class="number">%s</td> + <td colspan="2"><font size="2"><i>%s </i></font></td> + <td></td> + <td class="number">%s</td> </tr>', $ActGrpLabel, locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan="2"><font size="2"><I>%s </I></font></td> - <td class="number">%s</td> - <td></td> + <td colspan="2"><font size="2"><i>%s</i></font></td> + <td class="number">%s</td> + <td></td> </tr>', $ActGrpLabel, locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); @@ -632,47 +642,42 @@ if ($Section==4) { /*Income*/ echo '<tr> - <td colspan=3></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; + <td colspan="2"></td> + <td><hr /></td> + <td></td> + <td><hr /></td> + </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> + <td colspan="2"><font size="4">%s</font></td> + <td></td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); - $TotalIncome = -$SectionPrdActual; + $TotalIncome -= $SectionPrdActual; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class="number">%s</td> + <td colspan="2"><font size="4">%s</font></td> + <td></td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="5"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> - <td></td> - <td class="number">%s</td> + <td colspan="2"><font size="4">'._('Gross Profit').'</font></td> + <td></td> + <td class="number">%s</td> </tr>', locale_number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); @@ -682,14 +687,14 @@ $PrdGPPercent =0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td colspan="2"><font size="2"><i>'._('Gross Profit Percent').'</i></font></td> <td></td> - <td class="number"><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', + <td class="number"><i>%s</i></td> + </tr><tr><td colspan="6"> </td></tr>', locale_number_format($PrdGPPercent,1) . '%'); $j++; } @@ -700,9 +705,9 @@ if ($_POST['Detail']=='Detailed'){ printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> - </tr>', - $Sections[$myrow['sectioninaccounts']]); + <td colspan="6"><font size="4" color="blue"><b>%s</b></font></td> + </tr>', + $Sections[$myrow['sectioninaccounts']]); } $j++; @@ -718,10 +723,11 @@ $ActGrp = $myrow['groupname']; if ($_POST['Detail']=='Detailed'){ printf('<tr> - <td colspan=6><font size=2 color=BLUE><b>%s</b></font></td> - </tr>', - $myrow['groupname']); - echo $TableHeader; + <td colspan="6"><font size="2" color="blue"><b>%s</b></font></td> + </tr>', + $myrow['groupname']); + + echo $TableHeader; } } @@ -780,33 +786,24 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="4"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level]; } if ($Section ==4){ /*Income */ - printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> + echo '<tr> + <td colspan="2"><font size="2"><i>' . $ActGrpLabel . '</i></font></td> <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - </tr>', - $ActGrpLabel, - locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); + <td class="number">' . locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; } else { /*Costs */ - printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class="number">%s</td> - <td></td> - </tr>', - $ActGrpLabel, - locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); + echo '<tr> + <td colspan="2"><font size="2"><i>' . $ActGrpLabel . '</i></font></td> + <td class="number">' . locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; } $GrpPrdActual[$Level] = 0; $ParentGroups[$Level] =''; @@ -816,7 +813,7 @@ if ($_POST['Detail']=='Detailed'){ echo '<tr> <td colspan="2"></td> - <td colspan="6"><hr></td> + <td colspan="4"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -825,7 +822,7 @@ if ($Section ==4){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> + <td colspan="2"><font size="2"><i>%s</i></font></td> <td></td> <td class="number">%s</td> </tr>', @@ -833,7 +830,7 @@ locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> + <td colspan="2"><font size="2"><i>%s </i></font></td> <td class="number">%s</td> <td></td> </tr>', @@ -851,54 +848,36 @@ if ($Section==4) { /*Income*/ echo '<tr> - <td colspan=3></td> - <td><hr></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> + </tr> + <tr> + <td colspan="2"><font size="4">' . $Sections[$Section] . '</font></td> <td></td> - <td><hr></td> - <td></td> - <td><hr></td> + <td class="number">' . locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; - - printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class="number">%s</td> - </tr>', - $Sections[$Section], - locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); - $TotalIncome = $SectionPrdActual; + $TotalIncome = $SectionPrdActual; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> + </tr> + <tr> + <td colspan="2"><font size="4">' . $Sections[$Section] . '</font></td> <td></td> - <td><hr></td> - <td></td> - <td><hr></td> + <td class="number">' . locale_number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; - printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class="number">%s</td> - </tr>', - $Sections[$Section], - locale_number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; - printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> + </tr> + <tr> + <td colspan="2"><font size="4">'._('Gross Profit').'</font></td> <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - </tr>', - locale_number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); + <td class="number">' . locale_number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; if ($TotalIncome !=0){ $PrdGPPercent = 100*($TotalIncome - $SectionPrdActual)/$TotalIncome; @@ -906,19 +885,16 @@ $PrdGPPercent =0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; - printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> + </tr> + <tr> + <td colspan="2"><font size="2"><i>'._('Gross Profit Percent').'</i></font></td> <td></td> - <td class="number"><I>%s</I></td> + <td class="number"><i>' . locale_number_format($PrdGPPercent,1) . '%</i></td> <td></td> - <td class="number"><I>%s</I></td> - <td></td> - <td class="number"><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', - locale_number_format($PrdGPPercent,1) . '%'); + </tr>'; + $j++; } @@ -926,19 +902,18 @@ $Section = $myrow['sectioninaccounts']; - if ($_POST['Detail']=='Detailed' and isset($Sections[$myrow['sectioninaccounts']])){ - printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> - </tr>', - $Sections[$myrow['sectioninaccounts']]); + if ($_POST['Detail']=='Detailed' AND isset($Sections[$myrow['sectioninaccounts']])){ + echo '<tr> + <td colspan="6"><font size="4" color="blue"><b>' . $Sections[$myrow['sectioninaccounts']] . '</b></font></td> + </tr>'; } $j++; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr /></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> </tr>'; printf('<tr bgcolor="#ffffff"> @@ -949,12 +924,13 @@ locale_number_format($PeriodProfitLoss,$_SESSION['CompanyRecord']['decimalplaces'])); echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; - - echo '</table>'; - echo '<div class="centre"><input type="submit" name="SelectADifferentPeriod" value="'._('Select A Different Period').'"></div>'; + <td colspan="2"></td> + <td colspan="4"><hr /></td> + </tr> + </table> + <div class="centre"> + <input type="submit" name="SelectADifferentPeriod" value="'._('Select A Different Period').'" /> + </div>'; } echo '</form>'; include('includes/footer.inc'); Modified: trunk/GLTags.php =================================================================== --- trunk/GLTags.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLTags.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -11,24 +11,25 @@ if($_GET['Action']=='delete'){ //first off test there are no transactions created with this tag $Result = DB_query("SELECT counterindex - FROM gltrans - WHERE tag='" . $_GET['SelectedTag'] . "'",$db); + FROM gltrans + WHERE tag='" . $_GET['SelectedTag'] . "'",$db); if (DB_num_rows($Result)>0){ prnMsg(_('This tag cannot be deleted since there are already general ledger transactions created using it.'),'error'); } else { $Result = DB_query("DELETE FROM tags WHERE tagref='" . $_GET['SelectedTag'] . "'",$db); prnMsg(_('The selected tag has been deleted'),'success'); } + $Description=''; } else { $sql="SELECT tagref, - tagdescription - FROM tags - WHERE tagref='".$_GET['SelectedTag']."'"; + tagdescription + FROM tags + WHERE tagref='".$_GET['SelectedTag']."'"; $result= DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); $ref=$myrow['tagref']; - $Description=$myrow['tagdescription']; + $Description = $myrow['tagdescription']; } } else { $Description=''; @@ -36,50 +37,57 @@ } if (isset($_POST['submit'])) { - $sql = "INSERT INTO tags values(NULL, '".$_POST['Description']."')"; + $sql = "INSERT INTO tags values(NULL, '" . DB_escape_string($_POST['Description']) . "')"; $result= DB_query($sql,$db); } if (isset($_POST['update'])) { - $sql = "UPDATE tags SET tagdescription='".$_POST['Description']. "' + $sql = "UPDATE tags SET tagdescription='".DB_escape_string($_POST['Description']). "' WHERE tagref='".$_POST['reference']."'"; $result= DB_query($sql,$db); } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . - _('Print') . '" alt="" />' . ' ' . $title . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . + _('Print') . '" alt="" />' . ' ' . $title . ' + </p>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /> - <table><tr>'; + <table> + <tr> + <td>'. _('Description') . '</td> + <td><input type="text" size="30" maxlength="30" name="Description" value="'.$Description.'"></td> + <td><input type="hidden" name="reference" value="'.$_GET['SelectedTag'].'">'; - -echo '<td>'. _('Description') . '</td> - <td><input type="text" size=30 maxlength=30 name="Description" value="'.$Description.'"></td> - <td><input type="hidden" name="reference" value="'.$_GET['SelectedTag'].'">'; - if (isset($_GET['Action']) AND $_GET['Action']=='edit') { echo '<input type="submit" name="update" value="' . _('Update') . '" />'; } else { echo '<input type="submit" name="submit" value="' . _('Insert') . '" />'; } -echo '</td></tr></table><p></p>'; - -echo '</form>'; - -echo '<table class="selection">'; -echo '<tr> +echo '</td> + </tr> + </table> + <p /> + </form> + <table class="selection"> + <tr> <th>'. _('Tag ID') .'</th> <th>'. _('Description'). '</th> - </tr>'; + </tr>'; -$sql="SELECT tagref, tagdescription FROM tags order by tagref"; +$sql="SELECT tagref, + tagdescription + FROM tags + ORDER BY tagref"; + $result= DB_query($sql,$db); while ($myrow = DB_fetch_array($result,$db)){ - echo '<tr><td>' . $myrow['tagref'].'</td> - <td>' . $myrow['tagdescription'].'</td> + 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" onclick="return confirm(\'' . _('Are you sure you wish to delete this GL tag?') . '\');">' . _('Delete') . '</a></td> </tr>'; Modified: trunk/GLTransInquiry.php =================================================================== --- trunk/GLTransInquiry.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLTransInquiry.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -34,9 +34,11 @@ // echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Print') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<table class=selection>'; //Main table - echo '<tr><th colspan=7><font size=3 color=blue><b>' . $TransName . ' ' . $_GET['TransNo'] . '</b></font></th></tr>'; + echo '<table class="selection">'; //Main table echo '<tr> + <th colspan="7"><font size="3" color="blue"><b>' . $TransName . ' ' . $_GET['TransNo'] . '</b></font></th> + </tr> + <tr> <th>' . _('Date') . '</th> <th>' . _('Period') .'</th> <th>'. _('GL Account') .'</th> @@ -88,14 +90,13 @@ $date = '&TransAfterDate=' . $TranDate; $DetailSQL = "SELECT debtortrans.debtorno, - debtortrans.ovamount, - debtortrans.ovgst, - debtortrans.rate, - debtorsmaster.name - FROM debtortrans, - debtorsmaster - WHERE debtortrans.debtorno = debtorsmaster.debtorno - AND debtortrans.type = '" . $TransRow['type'] . "' + debtortrans.ovamount, + debtortrans.ovgst, + debtortrans.rate, + debtorsmaster.name + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno = debtorsmaster.debtorno + WHERE debtortrans.type = '" . $TransRow['type'] . "' AND debtortrans.transno = '" . $_GET['TransNo']. "'"; $DetailResult = DB_query($DetailSQL,$db); } elseif ( $TransRow['account'] == $_SESSION['CompanyRecord']['creditorsact'] ) { @@ -103,14 +104,13 @@ $date = '&FromDate=' . $TranDate; $DetailSQL = "SELECT supptrans.supplierno, - supptrans.ovamount, - supptrans.ovgst, - supptrans.rate, - suppliers.suppname - FROM supptrans, - suppliers - WHERE supptrans.supplierno = suppliers.supplierid - AND supptrans.type = '" . $TransRow['type'] . "' + supptrans.ovamount, + supptrans.ovgst, + supptrans.rate, + suppliers.suppname + FROM supptrans INNER JOIN suppliers + ON supptrans.supplierno = suppliers.supplierid + WHERE supptrans.type = '" . $TransRow['type'] . "' AND supptrans.transno = '" . $_GET['TransNo'] . "'"; $DetailResult = DB_query($DetailSQL,$db); } else { @@ -120,7 +120,6 @@ $TransRow['narrative'] = ' '; } - if ($j==1) { echo '<tr class="OddTableRows">'; $j=0; @@ -180,17 +179,20 @@ DB_free_result($TransResult); echo '<tr bgcolor="#FFFFFF"> - <td class="number" colspan=3><b>' . _('Total') . '</b></td> + <td class="number" colspan="3"><b>' . _('Total') . '</b></td> <td class="number">' . locale_number_format(($DebitTotal),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format((-$CreditTotal),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td colspan=2> </td> + <td colspan="2"> </td> </tr>'; echo '</table><p>'; } } -echo '</td></tr></table>'; +echo '</td> + </tr> + </table>'; + include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/GLTrialBalance.php =================================================================== --- trunk/GLTrialBalance.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLTrialBalance.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -13,15 +13,22 @@ include('includes/AccountSectionsDef.inc'); //this reads in the Accounts Sections array -if (isset($_POST['FromPeriod']) and isset($_POST['ToPeriod']) and $_POST['FromPeriod'] > $_POST['ToPeriod']){ +if (isset($_POST['FromPeriod']) + AND isset($_POST['ToPeriod']) + AND $_POST['FromPeriod'] > $_POST['ToPeriod']){ + prnMsg(_('The selected period from is actually after the period to! Please re-select the reporting period'),'error'); $_POST['SelectADifferentPeriod']=_('Select A Different Period'); } -if ((! isset($_POST['FromPeriod']) AND ! isset($_POST['ToPeriod'])) OR isset($_POST['SelectADifferentPeriod'])){ +if ((! isset($_POST['FromPeriod']) + AND ! isset($_POST['ToPeriod'])) + OR isset($_POST['SelectADifferentPeriod'])){ include ('includes/header.inc'); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Trial Balance') . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Trial Balance') . '" alt="" />' . ' ' . $title . ' + </p>'; echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -65,7 +72,8 @@ } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ $lastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); $sql = "SELECT periodno @@ -98,8 +106,10 @@ </table> <br />'; - echo '<div class="centre"><input type=submit Name="ShowTB" Value="' . _('Show Trial Balance') .'">'; - echo '<input type="submit" name="PrintPDF" value="'._('PrintPDF').'"></div>'; + echo '<div class="centre"> + <input type="submit" Name="ShowTB" value="' . _('Show Trial Balance') .'" /> + <input type="submit" name="PrintPDF" val... [truncated message content] |
From: <dai...@us...> - 2011-10-23 05:41:44
|
Revision: 4730 http://web-erp.svn.sourceforge.net/web-erp/?rev=4730&view=rev Author: daintree Date: 2011-10-23 05:41:35 +0000 (Sun, 23 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/GLBudgets.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTags.php trunk/GLTransInquiry.php trunk/GLTrialBalance.php trunk/GoodsReceived.php trunk/GoodsReceivedControlled.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/MRP.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MailInventoryValuation.php trunk/includes/DefineStockAdjustment.php Modified: trunk/GLBudgets.php =================================================================== --- trunk/GLBudgets.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLBudgets.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -184,7 +184,7 @@ for ($i=1; $i<=12; $i++) { echo '<tr>'; echo '<th>'. $PeriodEnd[$CurrentYearEndPeriod-(24-$i)] .'</th>'; - echo '<td bgcolor="d2e5e8" class="number">'.locale_number_format($Actual[$CurrentYearEndPeriod-(24-$i)],2).'</td>'; + echo '<td bgcolor="d2e5e8" class="number">'.locale_number_format($Actual[$CurrentYearEndPeriod-(24-$i)],$_SESSION['CompanyRecord']['decimalplaces']).'</td>'; echo '<td><input type="text" class="number" size=14 name="'.$i.'last" value="'.locale_number_format($Budget[$CurrentYearEndPeriod-(24-$i)],$_SESSION['CompanyRecord']['decimalplaces']) .'" /></td>'; echo '<th>'. $PeriodEnd[$CurrentYearEndPeriod-(12-$i)] .'</th>'; echo '<td bgcolor="d2e5e8" class="number">'.locale_number_format($Actual[$CurrentYearEndPeriod-(12-$i)],$_SESSION['CompanyRecord']['decimalplaces']).'</td>'; Modified: trunk/GLProfit_Loss.php =================================================================== --- trunk/GLProfit_Loss.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLProfit_Loss.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -12,15 +12,21 @@ $_POST['SelectADifferentPeriod']='Select A Different Period'; } -if ((!isset($_POST['FromPeriod']) AND !isset($_POST['ToPeriod'])) OR isset($_POST['SelectADifferentPeriod'])){ +if ((!isset($_POST['FromPeriod']) + AND !isset($_POST['ToPeriod'])) + OR isset($_POST['SelectADifferentPeriod'])){ include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Profit and Loss Report') . '</p>'; -echo '<div class="page_help_text">' . _('Profit and loss statement (P&L), also called an Income Statment, or Statement of Operations, this is the statement that indicates how the revenue (money received from the sale of products and services before expenses are taken out, also known as the "top line") is transformed into the net income (the result after all revenues and expenses have been accounted for, also known as the "bottom line").') . '<br />' -. _('The purpose of the income statement is to show whether the company made or lost money during the period being reported.') . '<br />' -. _('The P&L represents a period of time. This contrasts with the Balance Sheet, which represents a single moment in time.') . '<br />' -. _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Profit and Loss Report') . ' + </p>'; + echo '<div class="page_help_text">' . _('Profit and loss statement (P&L), also called an Income Statment, or Statement of Operations, this is the statement that indicates how the revenue (money received from the sale of products and services before expenses are taken out, also known as the "top line") is transformed into the net income (the result after all revenues and expenses have been accounted for, also known as the "bottom line").') . + '<br />' + . _('The purpose of the income statement is to show whether the company made or lost money during the period being reported.') . '<br />' + . _('The P&L represents a period of time. This contrasts with the Balance Sheet, which represents a single moment in time.') . '<br />' + . _('webERP is an "accrual" based system (not a "cash based" system). Accrual systems include items when they are invoiced to the customer, and when expenses are owed based on the supplier invoice date.') . '</div>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -37,7 +43,7 @@ /*Show a form to allow input of criteria for profit and loss to show */ echo '<p><table class="selection"> <tr><td>' . _('Select Period From') . ':</td> - <td><select Name="FromPeriod">'; + <td><select name="FromPeriod">'; $sql = "SELECT periodno, lastdate_in_period @@ -49,20 +55,21 @@ while ($myrow=DB_fetch_array($Periods,$db)){ if(isset($_POST['FromPeriod']) AND $_POST['FromPeriod']!=''){ if( $_POST['FromPeriod']== $myrow['periodno']){ - echo '<option selected value=' . $myrow['periodno'] . '>' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value="' . $myrow['periodno'] . '">' .MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } else { if($myrow['lastdate_in_period']==$DefaultFromDate){ - echo '<option selected value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option value=' . $myrow['periodno'] . '>' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value="' . $myrow['periodno'] . '">' . MonthAndYearFromSQLDate($myrow['lastdate_in_period']) . '</option>'; } } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ $LastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); $sql = "SELECT periodno FROM periods where lastdate_in_period = '" . $LastDate . "'"; @@ -90,19 +97,24 @@ } echo '</select></td></tr>'; - echo '<tr><td>'._('Detail Or Summary').':</td> - <td><select name="Detail"> + echo '<tr> + <td>'._('Detail Or Summary').':</td> + <td><select name="Detail"> <option selected value="Summary">'._('Summary') . '</option> <option selected value="Detailed">'._('All Accounts') . '</option> </select> - </td> - </tr>'; + </td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="ShowPL" value="' ._('Show on Screen (HTML)') . '" /> + </div> + <br /> + <div class="centre"> + <input type="submit" name="PrintPDF" value="'._('Produce PDF Report').'" /> + </div>'; - echo '</table>'; - - echo '<br /><div class="centre"><input type="submit" name="ShowPL" value="' ._('Show on Screen (HTML)') . '"></div>'; - echo '<br /><div class="centre"><input type="submit" name="PrintPDF" value="'._('Produce PDF Report').'"></div>'; - /*Now do the posting while the user is thinking about the period to select */ include ('includes/GLPostings.inc'); @@ -344,7 +356,7 @@ if ($myrow['groupname'] != $ActGrp){ if ($myrow['parentgroupname']==$ActGrp AND $ActGrp !=''){ //adding another level of nesting - $Level++; + $Level++; } $ActGrp = $myrow['groupname']; $ParentGroups[$Level]=$ActGrp; @@ -537,10 +549,10 @@ } else { include('includes/header.inc'); - echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '"> - <input type=hidden name="ToPeriod" value="' . $_POST['ToPeriod'] . '">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '" /> + <input type=hidden name="ToPeriod" value="' . $_POST['ToPeriod'] . '" />'; $NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1; @@ -556,7 +568,6 @@ $myrow = DB_fetch_row($PrdResult); $PeriodToDate = MonthAndYearFromSQLDate($myrow[0]); - $SQL = "SELECT accountgroups.sectioninaccounts, accountgroups.parentgroupname, accountgroups.groupname, @@ -568,20 +579,18 @@ SUM(CASE WHEN chartdetails.period='" . ($_POST['FromPeriod'] - 12) . "' THEN chartdetails.bfwd ELSE 0 END) AS lyfirstprdbfwd, SUM(CASE WHEN chartdetails.period='" . ($_POST['ToPeriod']-12) . "' THEN chartdetails.bfwd + chartdetails.actual ELSE 0 END) AS lylastprdcfwd, SUM(CASE WHEN chartdetails.period='" . $_POST['ToPeriod'] . "' THEN chartdetails.bfwdbudget + chartdetails.budget ELSE 0 END) AS lastprdbudgetcfwd - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails - ON chartmaster.accountcode= chartdetails.accountcode - WHERE accountgroups.pandl=1 - GROUP BY accountgroups.sectioninaccounts, + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname INNER JOIN chartdetails + ON chartmaster.accountcode= chartdetails.accountcode + WHERE accountgroups.pandl=1 + GROUP BY accountgroups.sectioninaccounts, accountgroups.parentgroupname, accountgroups.groupname, chartdetails.accountcode, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, + chartmaster.accountname + ORDER BY accountgroups.sectioninaccounts, accountgroups.sequenceintb, accountgroups.groupname, - accountgroups.sequenceintb, chartdetails.accountcode"; $AccountsResult = DB_query($SQL,$db,_('No general ledger accounts were returned by the SQL because'),_('The SQL that failed was')); @@ -591,22 +600,22 @@ /*show a table of the accounts info returned by the SQL Account Code , Account Name , Month Actual, Month Budget, Period Actual, Period Budget */ - echo '<table cellpadding=2 class=selection>'; + echo '<table class="selection">'; if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> <th>' . _('Account') . '</th> <th>'._('Account Name') .'</th> - <th colspan=2>' . _('Period Actual') .'</th> - <th colspan=2>' . _('Period Budget') .'</th> - <th colspan=2>' . _('Last Year') . '</th> + <th colspan="2">' . _('Period Actual') .'</th> + <th colspan="2">' . _('Period Budget') .'</th> + <th colspan="2">' . _('Last Year') . '</th> </tr>'; } else { /*summary */ $TableHeader = '<tr> - <th colspan=2></th> - <th colspan=2>' . _('Period Actual') .'</th> - <th colspan=2>' . _('Period Budget') . '</th> - <th colspan=2>' . _('Last Year') . '</th> + <th colspan="2"></th> + <th colspan="2">' . _('Period Actual') .'</th> + <th colspan="2">' . _('Period Budget') . '</th> + <th colspan="2">' . _('Last Year') . '</th> </tr>'; } @@ -643,8 +652,8 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -652,13 +661,13 @@ } if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> + <td colspan="2"><font size="2"><i>%s</i></font></td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ActGrpLabel, locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), @@ -666,12 +675,12 @@ locale_number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> + <td colspan="2"><font size=2><i>%s </i></font></td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> </tr>', $ActGrpLabel, @@ -688,8 +697,8 @@ //still need to print out the old group totals if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -698,13 +707,13 @@ if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> + <td colspan="2"><font size=2><i>%s </i></font></td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ActGrpLabel, locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), @@ -712,12 +721,12 @@ locale_number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> + <td colspan="2"><font size=2><i>%s </i></font></td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> </tr>', $ActGrpLabel, @@ -740,21 +749,21 @@ echo '<tr> <td colspan=3></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> + <td colspan="2"><font size=4>%s</font></td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), @@ -765,21 +774,21 @@ $TotalLYIncome = -$SectionPrdLY; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> + <td colspan="2"></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> + <td colspan="2"><font size=4>%s</font></td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), @@ -788,17 +797,17 @@ } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> + <td colspan="2"><font size=4>'._('Gross Profit').'</font></td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', locale_number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), @@ -820,18 +829,18 @@ $LYGPPercent = 0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td colspan="2"><font size=2><i>'._('Gross Profit Percent').'</i></font></td> <td></td> - <td class=number><I>%s</I></td> + <td class="number"><i>%s</i></td> <td></td> - <td class=number><I>%s</I></td> + <td class="number"><i>%s</i></td> <td></td> - <td class=number><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', + <td class="number"><i>%s</i></td> + </tr><tr><td colspan="6"> </td></tr>', locale_number_format($PrdGPPercent,1) . '%', locale_number_format($BudgetGPPercent,1) . '%', locale_number_format($LYGPPercent,1). '%'); @@ -846,7 +855,7 @@ if ($_POST['Detail']=='Detailed'){ printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> + <td colspan="6"><font size=4 color=BLUE><b>%s</b></font></td> </tr>', $Sections[$myrow['sectioninaccounts']]); } @@ -908,11 +917,11 @@ printf('<td>%s</td> <td>%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ActEnquiryURL, $myrow['accountname'], @@ -922,11 +931,11 @@ } else { printf('<td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> </tr>', $ActEnquiryURL, @@ -947,8 +956,8 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -956,32 +965,32 @@ } if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - </tr>', - $ActGrpLabel, - locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format(-$GrpPrdLY[$Level]),$_SESSION['CompanyRecord']['decimalplaces']); + <td colspan="2"><font size=2><i>%s </i></font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + </tr>', + $ActGrpLabel, + locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format(-$GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format(-$GrpPrdLY[$Level]),$_SESSION['CompanyRecord']['decimalplaces']); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - </tr>', - $ActGrpLabel, - locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); + <td colspan="2"><font size=2><i>%s </i></font></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + </tr>', + $ActGrpLabel, + locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($GrpPrdBudget[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -992,8 +1001,8 @@ //still need to print out the old group totals if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -1002,13 +1011,13 @@ if ($Section ==1){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> + <td colspan="2"><font size=2><i>%s </i></font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> </tr>', $ActGrpLabel, locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), @@ -1016,13 +1025,13 @@ locale_number_format(-$GrpPrdLY[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> + <td colspan="2"><font size="2"><i>%s </i></font></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> </tr>', $ActGrpLabel, locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']), @@ -1043,21 +1052,21 @@ echo '<tr> <td colspan=3></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> + <td colspan="2"><font size=4>%s</font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), @@ -1068,21 +1077,21 @@ $TotalLYIncome = -$SectionPrdLY; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> + <td colspan="2"></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> <td></td> - <td><hr></td> + <td><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> + <td colspan="2"><font size=4>%s</font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), @@ -1091,17 +1100,17 @@ } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> + <td colspan="2"><font size="4">'._('Gross Profit').'</font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> </tr>', locale_number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($TotalBudgetIncome - $SectionPrdBudget,$_SESSION['CompanyRecord']['decimalplaces']), @@ -1123,18 +1132,18 @@ $LYGPPercent = 0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td colspan="2"><font size=2><i>'._('Gross Profit Percent').'</i></font></td> <td></td> - <td class=number><I>%s</I></td> + <td class="number"><i>%s</i></td> <td></td> - <td class=number><I>%s</I></td> + <td class="number"><i>%s</i></td> <td></td> - <td class=number><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', + <td class="number"><i>%s</i></td> + </tr><tr><td colspan="6"> </td></tr>', locale_number_format($PrdGPPercent,1) . '%', locale_number_format($BudgetGPPercent,1) . '%', locale_number_format($LYGPPercent,1). '%'); @@ -1149,7 +1158,7 @@ if ($_POST['Detail']=='Detailed' and isset($Sections[$myrow['sectioninaccounts']])){ printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> + <td colspan="6"><font size=4 color=BLUE><b>%s</b></font></td> </tr>', $Sections[$myrow['sectioninaccounts']]); } @@ -1158,23 +1167,22 @@ } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr bgcolor="#ffffff"> - <td colspan=2><font size="4" color="blue"><b>'._('Profit').' - '._('Loss').'</b></font></td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> + <td colspan="2"><font size="4" color="blue"><b>'._('Profit').' - '._('Loss').'</b></font></td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> </tr>', locale_number_format(-$PeriodProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format(-$PeriodBudgetProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format(-$PeriodLYProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']) - ); + locale_number_format(-$PeriodLYProfitLoss,$_SESSION['CompanyRecord']['decimalplaces']) ); if ($TotalIncome !=0){ $PrdNPPercent = 100*(-$PeriodProfitLoss)/$TotalIncome; @@ -1193,18 +1201,18 @@ } echo '<tr> <td colspan="2"></td> - <td colspan="6"><hr></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan="2"><font size="2"><I>'._('Net Profit Percent').'</I></font></td> - <td></td> - <td class="number"><I>%s</I></td> - <td></td> - <td class="number"><I>%s</I></td> - <td></td> - <td class="number"><I>%s</I></td> - </tr><tr><td colspan="6"> </td> + <td colspan="2"><font size="2"><i>'._('Net Profit Percent').'</i></font></td> + <td></td> + <td class="number"><i>%s</i></td> + <td></td> + <td class="number"><i>%s</i></td> + <td></td> + <td class="number"><i>%s</i></td> + </tr><tr><td colspan="6"> </td> </tr>', locale_number_format($PrdNPPercent,1) . '%', locale_number_format($BudgetNPPercent,1) . '%', Modified: trunk/GLTagProfit_Loss.php =================================================================== --- trunk/GLTagProfit_Loss.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLTagProfit_Loss.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -8,7 +8,7 @@ include('includes/AccountSectionsDef.inc'); // This loads the $Sections variable -if (isset($_POST['FromPeriod']) and ($_POST['FromPeriod'] > $_POST['ToPeriod'])){ +if (isset($_POST['FromPeriod']) AND ($_POST['FromPeriod'] > $_POST['ToPeriod'])){ prnMsg(_('The selected period from is actually after the period to') . '! ' . _('Please reselect the reporting period'),'error'); $_POST['SelectADifferentPeriod']='Select A Different Period'; } @@ -18,8 +18,9 @@ include('includes/header.inc'); echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' - . _('Print') . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . $title . ' + </p>'; if (Date('m') > $_SESSION['YearEnd']){ /*Dates in SQL format */ @@ -60,10 +61,11 @@ } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ - $lastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); - $sql = "SELECT periodno FROM periods where lastdate_in_period = '$lastDate'"; + $LastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); + $sql = "SELECT periodno FROM periods where lastdate_in_period = '" . $LastDate . "'"; $MaxPrd = DB_query($sql,$db); $MaxPrdrow = DB_fetch_row($MaxPrd); $DefaultToPeriod = (int) ($MaxPrdrow[0]); @@ -88,7 +90,9 @@ } echo '</select></td></tr>'; //Select the tag - echo '<tr><td>'._('Select tag').'<td><select name="tag">'; + echo '<tr> + <td>'._('Select tag').'</td> + <td><select name="tag">'; $SQL = "SELECT tagref, tagdescription @@ -114,14 +118,15 @@ <option selected value="Detailed">'._('All Accounts') . '</option> </select> </td> - </tr>'; - - echo '</table><br />'; - - echo '<div class="centre"><input type="submit" name="ShowPL" value="'._('Show Statement of Income and Expenditure').'"> + </tr> + </table> <br /> - <br /> - <input type="submit" name="PrintPDF" value="'._('PrintPDF').'" /></div>'; + <div class="centre"> + <input type="submit" name="ShowPL" value="'._('Show Statement of Income and Expenditure').'" /> + <br /> + <br /> + <input type="submit" name="PrintPDF" value="'._('PrintPDF').'" /> + </div>'; /*Now do the posting while the user is thinking about the period to select */ @@ -164,18 +169,18 @@ chartmaster.accountname, Sum(CASE WHEN (gltrans.periodno>='" . $_POST['FromPeriod'] . "' and gltrans.periodno<='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, Sum(CASE WHEN (gltrans.periodno='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans - ON chartmaster.accountcode= gltrans.account - WHERE accountgroups.pandl=1 - AND gltrans.tag='" . $_POST['tag'] . "' - GROUP BY accountgroups.sectioninaccounts, + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans + ON chartmaster.accountcode= gltrans.account + WHERE accountgroups.pandl=1 + AND gltrans.tag='" . $_POST['tag'] . "' + GROUP BY accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, gltrans.account, chartmaster.accountname, accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, + ORDER BY accountgroups.sectioninaccounts, accountgroups.sequenceintb, accountgroups.groupname, gltrans.account"; @@ -458,10 +463,10 @@ } else { include('includes/header.inc'); - echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '" /> - <input type="hidden" name="ToPeriod" value="' . $_POST['ToPeriod'] . '" />'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <input type="hidden" name="FromPeriod" value="' . $_POST['FromPeriod'] . '" /> + <input type="hidden" name="ToPeriod" value="' . $_POST['ToPeriod'] . '" />'; $NumberOfMonths = $_POST['ToPeriod'] - $_POST['FromPeriod'] + 1; @@ -483,22 +488,21 @@ $SQL = "SELECT accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, - gltrans.account , + gltrans.account, chartmaster.accountname, Sum(CASE WHEN (gltrans.periodno>='" . $_POST['FromPeriod'] . "' AND gltrans.periodno<='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalAllPeriods, Sum(CASE WHEN (gltrans.periodno='" . $_POST['ToPeriod'] . "') THEN gltrans.amount ELSE 0 END) AS TotalThisPeriod - FROM chartmaster INNER JOIN accountgroups - ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans - ON chartmaster.accountcode= gltrans.account - WHERE accountgroups.pandl=1 - AND gltrans.tag='" . $_POST['tag'] . "' - GROUP BY accountgroups.sectioninaccounts, + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_ = accountgroups.groupname INNER JOIN gltrans + ON chartmaster.accountcode= gltrans.account + WHERE accountgroups.pandl=1 + AND gltrans.tag='" . $_POST['tag'] . "' + GROUP BY accountgroups.sectioninaccounts, accountgroups.groupname, accountgroups.parentgroupname, gltrans.account, - chartmaster.accountname, - accountgroups.sequenceintb - ORDER BY accountgroups.sectioninaccounts, + chartmaster.accountname + ORDER BY accountgroups.sectioninaccounts, accountgroups.sequenceintb, accountgroups.groupname, gltrans.account"; @@ -515,18 +519,24 @@ . _('Print') . '" alt="" />' . ' ' . $title . '</p>'; echo '<table cellpadding="2" class="selection">'; - echo '<tr><th colspan=9><div class="centre"><font size=3 color=blue><b>' . _('Statement of Income and Expenditure for Tag'). ' ' . $myrow[0]._('during the'). ' ' . $NumberOfMonths . ' ' . _('months to'). ' ' . $PeriodToDate . '</b></font></div></th></tr>'; + echo '<tr> + <th colspan="9"> + <div class="centre"> + <font size="3" color="blue"><b>' . _('Statement of Income and Expenditure for Tag'). ' ' . $myrow[0]._('during the'). ' ' . $NumberOfMonths . ' ' . _('months to'). ' ' . $PeriodToDate . '</b></font> + </div> + </th> + </tr>'; if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> <th>' . _('Account') . '</th> <th>' . _('Account Name') . '</th> - <th colspan=2>' . _('Period Actual') . '</th> + <th colspan="2">' . _('Period Actual') . '</th> </tr>'; } else { /*summary */ $TableHeader = '<tr> - <th colspan=2></th> - <th colspan=2>' . _('Period Actual') . '</th> + <th colspan="2"></th> + <th colspan="2">' . _('Period Actual') . '</th> </tr>'; } @@ -551,8 +561,8 @@ $GrpPrdActual = array(0); $GrpPrdLY = array(0); $GrpPrdBudget = array(0); + $TotalIncome =0; - while ($myrow=DB_fetch_array($AccountsResult)) { @@ -561,8 +571,8 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -571,20 +581,20 @@ if ($Section ==3){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class="number">%s</td> - </tr>', - $ActGrpLabel, - locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); + <td colspan="2"><font size="2"><i>%s </i></font></td> + <td></td> + <td class="number">%s</td> + </tr>', + $ActGrpLabel, + locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class="number">%s</td> - <td></td> - </tr>', - $ActGrpLabel, - locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); + <td colspan="2"><font size="2"><i>%s </i></font></td> + <td class="number">%s</td> + <td></td> + </tr>', + $ActGrpLabel, + locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } $GrpPrdLY[$Level] = 0; $GrpPrdActual[$Level] = 0; @@ -595,8 +605,8 @@ //still need to print out the old group totals if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -605,17 +615,17 @@ if ($Section ==4){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td></td> - <td class="number">%s</td> + <td colspan="2"><font size="2"><i>%s </i></font></td> + <td></td> + <td class="number">%s</td> </tr>', $ActGrpLabel, locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan="2"><font size="2"><I>%s </I></font></td> - <td class="number">%s</td> - <td></td> + <td colspan="2"><font size="2"><i>%s</i></font></td> + <td class="number">%s</td> + <td></td> </tr>', $ActGrpLabel, locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); @@ -632,47 +642,42 @@ if ($Section==4) { /*Income*/ echo '<tr> - <td colspan=3></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; + <td colspan="2"></td> + <td><hr /></td> + <td></td> + <td><hr /></td> + </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> + <td colspan="2"><font size="4">%s</font></td> + <td></td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); - $TotalIncome = -$SectionPrdActual; + $TotalIncome -= $SectionPrdActual; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - <td><hr></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class="number">%s</td> + <td colspan="2"><font size="4">%s</font></td> + <td></td> + <td class="number">%s</td> </tr>', $Sections[$Section], locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="5"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> - <td></td> - <td class="number">%s</td> + <td colspan="2"><font size="4">'._('Gross Profit').'</font></td> + <td></td> + <td class="number">%s</td> </tr>', locale_number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); @@ -682,14 +687,14 @@ $PrdGPPercent =0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="6"><hr /></td> </tr>'; printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td colspan="2"><font size="2"><i>'._('Gross Profit Percent').'</i></font></td> <td></td> - <td class="number"><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', + <td class="number"><i>%s</i></td> + </tr><tr><td colspan="6"> </td></tr>', locale_number_format($PrdGPPercent,1) . '%'); $j++; } @@ -700,9 +705,9 @@ if ($_POST['Detail']=='Detailed'){ printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> - </tr>', - $Sections[$myrow['sectioninaccounts']]); + <td colspan="6"><font size="4" color="blue"><b>%s</b></font></td> + </tr>', + $Sections[$myrow['sectioninaccounts']]); } $j++; @@ -718,10 +723,11 @@ $ActGrp = $myrow['groupname']; if ($_POST['Detail']=='Detailed'){ printf('<tr> - <td colspan=6><font size=2 color=BLUE><b>%s</b></font></td> - </tr>', - $myrow['groupname']); - echo $TableHeader; + <td colspan="6"><font size="2" color="blue"><b>%s</b></font></td> + </tr>', + $myrow['groupname']); + + echo $TableHeader; } } @@ -780,33 +786,24 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0) { if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> + <td colspan="2"></td> + <td colspan="4"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level]; } if ($Section ==4){ /*Income */ - printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> + echo '<tr> + <td colspan="2"><font size="2"><i>' . $ActGrpLabel . '</i></font></td> <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - </tr>', - $ActGrpLabel, - locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); + <td class="number">' . locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; } else { /*Costs */ - printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> - <td class="number">%s</td> - <td></td> - </tr>', - $ActGrpLabel, - locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); + echo '<tr> + <td colspan="2"><font size="2"><i>' . $ActGrpLabel . '</i></font></td> + <td class="number">' . locale_number_format($GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; } $GrpPrdActual[$Level] = 0; $ParentGroups[$Level] =''; @@ -816,7 +813,7 @@ if ($_POST['Detail']=='Detailed'){ echo '<tr> <td colspan="2"></td> - <td colspan="6"><hr></td> + <td colspan="4"><hr /></td> </tr>'; $ActGrpLabel = str_repeat('___',$Level) . $ParentGroups[$Level] . ' ' . _('total'); } else { @@ -825,7 +822,7 @@ if ($Section ==4){ /*Income */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> + <td colspan="2"><font size="2"><i>%s</i></font></td> <td></td> <td class="number">%s</td> </tr>', @@ -833,7 +830,7 @@ locale_number_format(-$GrpPrdActual[$Level],$_SESSION['CompanyRecord']['decimalplaces'])); } else { /*Costs */ printf('<tr> - <td colspan=2><font size=2><I>%s </I></font></td> + <td colspan="2"><font size="2"><i>%s </i></font></td> <td class="number">%s</td> <td></td> </tr>', @@ -851,54 +848,36 @@ if ($Section==4) { /*Income*/ echo '<tr> - <td colspan=3></td> - <td><hr></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> + </tr> + <tr> + <td colspan="2"><font size="4">' . $Sections[$Section] . '</font></td> <td></td> - <td><hr></td> - <td></td> - <td><hr></td> + <td class="number">' . locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; - - printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class="number">%s</td> - </tr>', - $Sections[$Section], - locale_number_format($SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); - $TotalIncome = $SectionPrdActual; + $TotalIncome = $SectionPrdActual; } else { echo '<tr> - <td colspan=2></td> - <td><hr></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> + </tr> + <tr> + <td colspan="2"><font size="4">' . $Sections[$Section] . '</font></td> <td></td> - <td><hr></td> - <td></td> - <td><hr></td> + <td class="number">' . locale_number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; - printf('<tr> - <td colspan=2><font size=4>%s</font></td> - <td></td> - <td class="number">%s</td> - </tr>', - $Sections[$Section], - locale_number_format(-$SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); } if ($Section==2){ /*Cost of Sales - need sub total for Gross Profit*/ echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; - printf('<tr> - <td colspan=2><font size=4>'._('Gross Profit').'</font></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> + </tr> + <tr> + <td colspan="2"><font size="4">'._('Gross Profit').'</font></td> <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - <td></td> - <td class="number">%s</td> - </tr>', - locale_number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces'])); + <td class="number">' . locale_number_format($TotalIncome - $SectionPrdActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; if ($TotalIncome !=0){ $PrdGPPercent = 100*($TotalIncome - $SectionPrdActual)/$TotalIncome; @@ -906,19 +885,16 @@ $PrdGPPercent =0; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; - printf('<tr> - <td colspan=2><font size=2><I>'._('Gross Profit Percent').'</I></font></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> + </tr> + <tr> + <td colspan="2"><font size="2"><i>'._('Gross Profit Percent').'</i></font></td> <td></td> - <td class="number"><I>%s</I></td> + <td class="number"><i>' . locale_number_format($PrdGPPercent,1) . '%</i></td> <td></td> - <td class="number"><I>%s</I></td> - <td></td> - <td class="number"><I>%s</I></td> - </tr><tr><td colspan=6> </td></tr>', - locale_number_format($PrdGPPercent,1) . '%'); + </tr>'; + $j++; } @@ -926,19 +902,18 @@ $Section = $myrow['sectioninaccounts']; - if ($_POST['Detail']=='Detailed' and isset($Sections[$myrow['sectioninaccounts']])){ - printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> - </tr>', - $Sections[$myrow['sectioninaccounts']]); + if ($_POST['Detail']=='Detailed' AND isset($Sections[$myrow['sectioninaccounts']])){ + echo '<tr> + <td colspan="6"><font size="4" color="blue"><b>' . $Sections[$myrow['sectioninaccounts']] . '</b></font></td> + </tr>'; } $j++; } echo '<tr> - <td colspan=2></td> - <td colspan=6><hr /></td> + <td colspan="2"></td> + <td colspan="2"><hr /></td> </tr>'; printf('<tr bgcolor="#ffffff"> @@ -949,12 +924,13 @@ locale_number_format($PeriodProfitLoss,$_SESSION['CompanyRecord']['decimalplaces'])); echo '<tr> - <td colspan=2></td> - <td colspan=6><hr></td> - </tr>'; - - echo '</table>'; - echo '<div class="centre"><input type="submit" name="SelectADifferentPeriod" value="'._('Select A Different Period').'"></div>'; + <td colspan="2"></td> + <td colspan="4"><hr /></td> + </tr> + </table> + <div class="centre"> + <input type="submit" name="SelectADifferentPeriod" value="'._('Select A Different Period').'" /> + </div>'; } echo '</form>'; include('includes/footer.inc'); Modified: trunk/GLTags.php =================================================================== --- trunk/GLTags.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLTags.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -11,24 +11,25 @@ if($_GET['Action']=='delete'){ //first off test there are no transactions created with this tag $Result = DB_query("SELECT counterindex - FROM gltrans - WHERE tag='" . $_GET['SelectedTag'] . "'",$db); + FROM gltrans + WHERE tag='" . $_GET['SelectedTag'] . "'",$db); if (DB_num_rows($Result)>0){ prnMsg(_('This tag cannot be deleted since there are already general ledger transactions created using it.'),'error'); } else { $Result = DB_query("DELETE FROM tags WHERE tagref='" . $_GET['SelectedTag'] . "'",$db); prnMsg(_('The selected tag has been deleted'),'success'); } + $Description=''; } else { $sql="SELECT tagref, - tagdescription - FROM tags - WHERE tagref='".$_GET['SelectedTag']."'"; + tagdescription + FROM tags + WHERE tagref='".$_GET['SelectedTag']."'"; $result= DB_query($sql,$db); $myrow = DB_fetch_array($result,$db); $ref=$myrow['tagref']; - $Description=$myrow['tagdescription']; + $Description = $myrow['tagdescription']; } } else { $Description=''; @@ -36,50 +37,57 @@ } if (isset($_POST['submit'])) { - $sql = "INSERT INTO tags values(NULL, '".$_POST['Description']."')"; + $sql = "INSERT INTO tags values(NULL, '" . DB_escape_string($_POST['Description']) . "')"; $result= DB_query($sql,$db); } if (isset($_POST['update'])) { - $sql = "UPDATE tags SET tagdescription='".$_POST['Description']. "' + $sql = "UPDATE tags SET tagdescription='".DB_escape_string($_POST['Description']). "' WHERE tagref='".$_POST['reference']."'"; $result= DB_query($sql,$db); } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . - _('Print') . '" alt="" />' . ' ' . $title . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . + _('Print') . '" alt="" />' . ' ' . $title . ' + </p>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /> - <table><tr>'; + <table> + <tr> + <td>'. _('Description') . '</td> + <td><input type="text" size="30" maxlength="30" name="Description" value="'.$Description.'"></td> + <td><input type="hidden" name="reference" value="'.$_GET['SelectedTag'].'">'; - -echo '<td>'. _('Description') . '</td> - <td><input type="text" size=30 maxlength=30 name="Description" value="'.$Description.'"></td> - <td><input type="hidden" name="reference" value="'.$_GET['SelectedTag'].'">'; - if (isset($_GET['Action']) AND $_GET['Action']=='edit') { echo '<input type="submit" name="update" value="' . _('Update') . '" />'; } else { echo '<input type="submit" name="submit" value="' . _('Insert') . '" />'; } -echo '</td></tr></table><p></p>'; - -echo '</form>'; - -echo '<table class="selection">'; -echo '<tr> +echo '</td> + </tr> + </table> + <p /> + </form> + <table class="selection"> + <tr> <th>'. _('Tag ID') .'</th> <th>'. _('Description'). '</th> - </tr>'; + </tr>'; -$sql="SELECT tagref, tagdescription FROM tags order by tagref"; +$sql="SELECT tagref, + tagdescription + FROM tags + ORDER BY tagref"; + $result= DB_query($sql,$db); while ($myrow = DB_fetch_array($result,$db)){ - echo '<tr><td>' . $myrow['tagref'].'</td> - <td>' . $myrow['tagdescription'].'</td> + 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" onclick="return confirm(\'' . _('Are you sure you wish to delete this GL tag?') . '\');">' . _('Delete') . '</a></td> </tr>'; Modified: trunk/GLTransInquiry.php =================================================================== --- trunk/GLTransInquiry.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLTransInquiry.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -34,9 +34,11 @@ // echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Print') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<table class=selection>'; //Main table - echo '<tr><th colspan=7><font size=3 color=blue><b>' . $TransName . ' ' . $_GET['TransNo'] . '</b></font></th></tr>'; + echo '<table class="selection">'; //Main table echo '<tr> + <th colspan="7"><font size="3" color="blue"><b>' . $TransName . ' ' . $_GET['TransNo'] . '</b></font></th> + </tr> + <tr> <th>' . _('Date') . '</th> <th>' . _('Period') .'</th> <th>'. _('GL Account') .'</th> @@ -88,14 +90,13 @@ $date = '&TransAfterDate=' . $TranDate; $DetailSQL = "SELECT debtortrans.debtorno, - debtortrans.ovamount, - debtortrans.ovgst, - debtortrans.rate, - debtorsmaster.name - FROM debtortrans, - debtorsmaster - WHERE debtortrans.debtorno = debtorsmaster.debtorno - AND debtortrans.type = '" . $TransRow['type'] . "' + debtortrans.ovamount, + debtortrans.ovgst, + debtortrans.rate, + debtorsmaster.name + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno = debtorsmaster.debtorno + WHERE debtortrans.type = '" . $TransRow['type'] . "' AND debtortrans.transno = '" . $_GET['TransNo']. "'"; $DetailResult = DB_query($DetailSQL,$db); } elseif ( $TransRow['account'] == $_SESSION['CompanyRecord']['creditorsact'] ) { @@ -103,14 +104,13 @@ $date = '&FromDate=' . $TranDate; $DetailSQL = "SELECT supptrans.supplierno, - supptrans.ovamount, - supptrans.ovgst, - supptrans.rate, - suppliers.suppname - FROM supptrans, - suppliers - WHERE supptrans.supplierno = suppliers.supplierid - AND supptrans.type = '" . $TransRow['type'] . "' + supptrans.ovamount, + supptrans.ovgst, + supptrans.rate, + suppliers.suppname + FROM supptrans INNER JOIN suppliers + ON supptrans.supplierno = suppliers.supplierid + WHERE supptrans.type = '" . $TransRow['type'] . "' AND supptrans.transno = '" . $_GET['TransNo'] . "'"; $DetailResult = DB_query($DetailSQL,$db); } else { @@ -120,7 +120,6 @@ $TransRow['narrative'] = ' '; } - if ($j==1) { echo '<tr class="OddTableRows">'; $j=0; @@ -180,17 +179,20 @@ DB_free_result($TransResult); echo '<tr bgcolor="#FFFFFF"> - <td class="number" colspan=3><b>' . _('Total') . '</b></td> + <td class="number" colspan="3"><b>' . _('Total') . '</b></td> <td class="number">' . locale_number_format(($DebitTotal),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format((-$CreditTotal),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td colspan=2> </td> + <td colspan="2"> </td> </tr>'; echo '</table><p>'; } } -echo '</td></tr></table>'; +echo '</td> + </tr> + </table>'; + include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/GLTrialBalance.php =================================================================== --- trunk/GLTrialBalance.php 2011-10-22 05:19:43 UTC (rev 4729) +++ trunk/GLTrialBalance.php 2011-10-23 05:41:35 UTC (rev 4730) @@ -13,15 +13,22 @@ include('includes/AccountSectionsDef.inc'); //this reads in the Accounts Sections array -if (isset($_POST['FromPeriod']) and isset($_POST['ToPeriod']) and $_POST['FromPeriod'] > $_POST['ToPeriod']){ +if (isset($_POST['FromPeriod']) + AND isset($_POST['ToPeriod']) + AND $_POST['FromPeriod'] > $_POST['ToPeriod']){ + prnMsg(_('The selected period from is actually after the period to! Please re-select the reporting period'),'error'); $_POST['SelectADifferentPeriod']=_('Select A Different Period'); } -if ((! isset($_POST['FromPeriod']) AND ! isset($_POST['ToPeriod'])) OR isset($_POST['SelectADifferentPeriod'])){ +if ((! isset($_POST['FromPeriod']) + AND ! isset($_POST['ToPeriod'])) + OR isset($_POST['SelectADifferentPeriod'])){ include ('includes/header.inc'); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Trial Balance') . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Trial Balance') . '" alt="" />' . ' ' . $title . ' + </p>'; echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -65,7 +72,8 @@ } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; if (!isset($_POST['ToPeriod']) OR $_POST['ToPeriod']==''){ $lastDate = date('Y-m-d',mktime(0,0,0,Date('m')+1,0,Date('Y'))); $sql = "SELECT periodno @@ -98,8 +106,10 @@ </table> <br />'; - echo '<div class="centre"><input type=submit Name="ShowTB" Value="' . _('Show Trial Balance') .'">'; - echo '<input type="submit" name="PrintPDF" value="'._('PrintPDF').'"></div>'; + echo '<div class="centre"> + <input type="submit" Name="ShowTB" value="' . _('Show Trial Balance') .'" /> + <input type="submit" name="PrintPDF" val... [truncated message content] |
From: <dai...@us...> - 2011-10-25 07:38:29
|
Revision: 4731 http://web-erp.svn.sourceforge.net/web-erp/?rev=4731&view=rev Author: daintree Date: 2011-10-25 07:38:22 +0000 (Tue, 25 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/Locations.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPCreateDemands.php trunk/MRPDemandTypes.php trunk/MRPDemands.php Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/Locations.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -55,17 +55,17 @@ } $sql = "UPDATE locations SET loccode='" . $_POST['LocCode'] . "', - locationname='" . $_POST['LocationName'] . "', - deladd1='" . $_POST['DelAdd1'] . "', - deladd2='" . $_POST['DelAdd2'] . "', - deladd3='" . $_POST['DelAdd3'] . "', - deladd4='" . $_POST['DelAdd4'] . "', - deladd5='" . $_POST['DelAdd5'] . "', - deladd6='" . $_POST['DelAdd6'] . "', - tel='" . $_POST['Tel'] . "', - fax='" . $_POST['Fax'] . "', - email='" . $_POST['Email'] . "', - contact='" . $_POST['Contact'] . "', + locationname='" . DB_escape_string($_POST['LocationName']) . "', + deladd1='" . DB_escape_string($_POST['DelAdd1']) . "', + deladd2='" . DB_escape_string($_POST['DelAdd2']) . "', + deladd3='" . DB_escape_string($_POST['DelAdd3']) . "', + deladd4='" . DB_escape_string($_POST['DelAdd4']) . "', + deladd5='" . DB_escape_string($_POST['DelAdd5']) . "', + deladd6='" . DB_escape_string($_POST['DelAdd6']) . "', + tel='" . DB_escape_string($_POST['Tel']) . "', + fax='" . DB_escape_string($_POST['Fax']) . "', + email='" . DB_escape_string($_POST['Email']) . "', + contact='" . DB_escape_string($_POST['Contact']) . "', taxprovinceid = '" . $_POST['TaxProvince'] . "', cashsalecustomer ='" . $_POST['CashSaleCustomer'] . "', cashsalebranch ='" . $_POST['CashSaleBranch'] . "', @@ -124,18 +124,18 @@ cashsalecustomer, cashsalebranch, managed ) - VALUES ('" . $_POST['LocCode'] . "', - '" . $_POST['LocationName'] . "', - '" . $_POST['DelAdd1'] ."', - '" . $_POST['DelAdd2'] ."', - '" . $_POST['DelAdd3'] . "', - '" . $_POST['DelAdd4'] . "', - '" . $_POST['DelAdd5'] . "', - '" . $_POST['DelAdd6'] . "', - '" . $_POST['Tel'] . "', - '" . $_POST['Fax'] . "', - '" . $_POST['Email'] . "', - '" . $_POST['Contact'] . "', + VALUES ('" . DB_escape_string($_POST['LocCode']) . "', + '" . DB_escape_string($_POST['LocationName']) . "', + '" . DB_escape_string($_POST['DelAdd1']) ."', + '" . DB_escape_string($_POST['DelAdd2']) ."', + '" . DB_escape_string($_POST['DelAdd3']) . "', + '" . DB_escape_string($_POST['DelAdd4']) . "', + '" . DB_escape_string($_POST['DelAdd5']) . "', + '" . DB_escape_string($_POST['DelAdd6']) . "', + '" . DB_escape_string($_POST['Tel']) . "', + '" . DB_escape_string($_POST['Fax']) . "', + '" . DB_escape_string($_POST['Email']) . "', + '" . DB_escape_string($_POST['Contact']) . "', '" . $_POST['TaxProvince'] . "', '" . $_POST['CashSaleCustomer'] . "', '" . $_POST['CashSaleBranch'] . "', @@ -353,8 +353,9 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<table class=selection>'; - echo '<tr><th>' . _('Location Code') . '</th> + echo '<table class="selection">'; + echo '<tr> + <th>' . _('Location Code') . '</th> <th>' . _('Location Name') . '</th> <th>' . _('Tax Province') . '</th> </tr>'; @@ -458,19 +459,21 @@ echo '<tr> <th colspan=2><font size=3 color=blue>'._('Amend Location details').'</font></th> </tr>'; - echo '<tr><td>' . _('Location Code') . ':</td><td>'; - echo $_POST['LocCode'] . '</td></tr>'; + echo '<tr> + <td>' . _('Location Code') . ':</td> + <td>' . $_POST['LocCode'] . '</td> + </tr>'; } else { //end of if $SelectedLocation only do the else when a new record is being entered if (!isset($_POST['LocCode'])) { $_POST['LocCode'] = ''; } echo '<table class="selection"> <tr> - <th colspan=2><font size=3 color=blue>'._('New Location details').'</font></th> + <th colspan="2"><font size="3" color="blue">'._('New Location details').'</font></th> </tr>'; echo '<tr> <td>' . _('Location Code') . ':</td> - <td><input type="Text" name="LocCode" value="' . $_POST['LocCode'] . '" size=5 maxlength=5></td> + <td><input type="text" name="LocCode" value="' . $_POST['LocCode'] . '" size="5" maxlength="5" /></td> </tr>'; } if (!isset($_POST['LocationName'])) { @@ -516,31 +519,54 @@ $_POST['Managed'] = 0; } - echo '<tr><td>' . _('Location Name') . ':' . '</td>'; - echo '<td><input type="text" name="LocationName" value="'. $_POST['LocationName'] . '" size=51 maxlength="50" /></td></tr>'; - echo '<tr><td>' . _('Contact for deliveries') . ':' . '</td>'; - echo '<td><input type="text" name="Contact" value="' . $_POST['Contact'] . '" size="31" maxlength="30" /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 1') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd1" value="' . $_POST['DelAdd1'] . '" size="41" maxlength="40" /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 2') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd2" value="' . $_POST['DelAdd2'] . '" size="41" maxlength="40" /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 3') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd3" value="' . $_POST['DelAdd3'] . '" size="41" maxlength="40" /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 4') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd4" value="' . $_POST['DelAdd4'] . '" size="41" maxlength=40 /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 5') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd5" value="' . $_POST['DelAdd5'] . '" size="21" maxlength="20" /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 6') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd6" value="' . $_POST['DelAdd6'] . '" size="16" maxlength="15" /></td></tr>'; - echo '<tr><td>' . _('Telephone No') . ':' . '</td>'; - echo '<td><input type="text" name="Tel" value="' . $_POST['Tel'] . '" size="31" maxlength="30" /></td></tr>'; - echo '<tr><td>' . _('Facsimile No') . ':' . '</td>'; - echo '<td><input type="text" name="Fax" value="' . $_POST['Fax'] . '" size="31" maxlength="30" /></td></tr>'; - echo '<tr><td>' . _('Email') . ':' . '</td>'; - echo '<td><input type="text" name="Email" value="' . $_POST['Email'] . '" size="31" maxlength="55" /></td></tr>'; + echo '<tr> + <td>' . _('Location Name') . ':' . '</td> + <td><input type="text" name="LocationName" value="'. $_POST['LocationName'] . '" size="51" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Contact for deliveries') . ':' . '</td> + <td><input type="text" name="Contact" value="' . $_POST['Contact'] . '" size="31" maxlength="30" /></td> + </tr> + <tr> + <td>' . _('Delivery Address 1') . ':' . '</td> + <td><input type="text" name="DelAdd1" value="' . $_POST['DelAdd1'] . '" size="41" maxlength="40" /></td> + </tr> + <tr> + <td>' . _('Delivery Address 2') . ':' . '</td> + <td><input type="text" name="DelAdd2" value="' . $_POST['DelAdd2'] . '" size="41" maxlength="40" /></td> + </tr> + <tr> + <td>' . _('Delivery Address 3') . ':' . '</td> + <td><input type="text" name="DelAdd3" value="' . $_POST['DelAdd3'] . '" size="41" maxlength="40" /></td> + </tr> + <tr> + <td>' . _('Delivery Address 4') . ':' . '</td> + <td><input type="text" name="DelAdd4" value="' . $_POST['DelAdd4'] . '" size="41" maxlength=40 /></td> + </tr> + <tr> + <td>' . _('Delivery Address 5') . ':' . '</td> + <td><input type="text" name="DelAdd5" value="' . $_POST['DelAdd5'] . '" size="21" maxlength="20" /></td> + </tr> + <tr> + <td>' . _('Delivery Address 6') . ':' . '</td> + <td><input type="text" name="DelAdd6" value="' . $_POST['DelAdd6'] . '" size="16" maxlength="15" /></td> + </tr> + <tr> + <td>' . _('Telephone No') . ':' . '</td> + <td><input type="text" name="Tel" value="' . $_POST['Tel'] . '" size="31" maxlength="30" /></td> + </tr> + <tr> + <td>' . _('Facsimile No') . ':' . '</td> + <td><input type="text" name="Fax" value="' . $_POST['Fax'] . '" size="31" maxlength="30" /></td> + </tr> + <tr> + <td>' . _('Email') . ':' . '</td> + <td><input type="text" name="Email" value="' . $_POST['Email'] . '" size="31" maxlength="55" /></td> + </tr> + <tr> + <td>' . _('Tax Province') . ':' . '</td> + <td><select name="TaxProvince">'; - echo '<td>' . _('Tax Province') . ':' . '</td><td><select name="TaxProvince">'; - $TaxProvinceResult = DB_query("SELECT taxprovinceid, taxprovincename FROM taxprovinces",$db); while ($myrow=DB_fetch_array($TaxProvinceResult)){ if ($_POST['TaxProvince']==$myrow['taxprovinceid']){ @@ -550,24 +576,28 @@ } } - echo '</select></td></tr>'; - echo '<tr><td>' . _('Default Counter Sales Customer Code') . ':' . '</td>'; - echo '<td><input type="text" name="CashSaleCustomer" value="' . $_POST['CashSaleCustomer'] . - '" size="11" maxlength="10" /></td></tr>'; - echo '<tr><td>' . _('Counter Sales Branch Code') . ':' . '</td>'; - echo '<td><input type="text" name="CashSaleBranch" value="' . $_POST['CashSaleBranch'] . - '" size="11" maxlength="10" /></td></tr>'; + echo '</select></td> + </tr> + <tr> + <td>' . _('Default Counter Sales Customer Code') . ':' . '</td> + <td><input type="text" name="CashSaleCustomer" value="' . $_POST['CashSaleCustomer'] . '" size="11" maxlength="10" /></td> + </tr> + <tr> + <td>' . _('Counter Sales Branch Code') . ':' . '</td> + <td><input type="text" name="CashSaleBranch" value="' . $_POST['CashSaleBranch'] . '" size="11" maxlength="10" /></td> + </tr>'; /* This functionality is not written yet ... <tr><td><?php echo _('Enable Warehouse Management') . ':'; ?></td> <td><input type='checkbox' name='Managed'<?php if($_POST['Managed'] == 1) echo ' checked';?>></td></tr> */ - echo '</table><br />'; + echo '</table> + <br /> + <div class="centre"> + <input type="Submit" name="submit" value="' . _('Enter Information') . '"> + </div> + </form>'; - echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; - - echo '</form>'; - } //end if record deleted no point displaying form to add record include('includes/footer.inc'); Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/MRP.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -8,7 +8,7 @@ if (isset($_POST['submit'])) { - if (!$_POST['Leeway'] || !is_numeric($_POST['Leeway'])) { + if (!isset($_POST['Leeway']) OR !is_numeric(filter_number_format($_POST['Leeway']))) { $_POST['Leeway'] = 0; } @@ -508,7 +508,7 @@ '" . $_POST['shrinkageflag'] . "', '" . $_POST['eoqflag'] . "', '" . $_POST['usemrpdemands'] . "', - '" . $_POST['Leeway'] . "')"; + '" . filter_number_format($_POST['Leeway']) . "')"; $result = DB_query($sql,$db); } else { // End of if submit isset @@ -540,28 +540,49 @@ if ($myrow['shrinkageflag'] == 'y') { $useshrinkage = _('Yes'); } - echo '<table cellpadding=5><tr><td valign=top>'; - echo '<table class=selection>'; - echo '<tr><th colspan=3><font color=blue size=3>'._('Last Run Details').'</font></th></tr>'; - echo '<tr>'; - echo '<td>' . _('Last Run Time') . ':  </td><td>' . $myrow['runtime'] . '</td></tr>'; - echo '<td>' . _('Location') . ':  </td><td>' . $myrow['location'] . '</td></tr>'; - echo '<td>' . _('Days Leeway') . ':  </td><td>' . $leeway . '</td></tr>'; - echo '<td>' . _('Use MRP Demands') . ':  </td><td>' . $usemrpdemands . '</td></tr>'; - echo '<td>' . _('Use EOQ') . ':  </td><td>' . $useeoq . '</td></tr>'; - echo '<td>' . _('Use Pan Size') . ':  </td><td>' . $usepansize . '</td></tr>'; - echo '<td>' . _('Use Shrinkage') . ':  </td><td>' . $useshrinkage . '</td></tr>'; - echo '</table></td>'; + echo '<table class="selection"> + <tr> + <th colspan="3"><font color="blue" size="3">'._('Last Run Details').'</font></th> + </tr> + <tr> + <td>' . _('Last Run Time') . ':</td><td>' . $myrow['runtime'] . '</td> + </tr> + <tr> + <td>' . _('Location') . ':</td> + <td>' . $myrow['location'] . '</td> + </tr> + <tr> + <td>' . _('Days Leeway') . ':</td> + <td>' . $leeway . '</td> + </tr> + <tr> + <td>' . _('Use MRP Demands') . ':</td> + <td>' . $usemrpdemands . '</td> + </tr> + <tr> + <td>' . _('Use EOQ') . ':</td> + <td>' . $useeoq . '</td> + </tr> + <tr> + <td>' . _('Use Pan Size') . ':</td> + <td>' . $usepansize . '</td> + </tr> + <tr> + <td>' . _('Use Shrinkage') . ':</td> + <td>' . $useshrinkage . '</td> + </tr> + </table>'; } echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; - // Generate selections for Location - echo '<tr><th colspan="3"><font color=blue size=3>'._('This Run Details').'</font></th></tr>'; - echo '<tr> - <td>' . _('Location') . '</td> - <td><select name="location[]" multiple> - <option value="All" selected>' . _('All') . '</option>'; + echo '<table class="selection"> + <tr> + <th colspan="3"><font color="blue" size="3">'._('This Run Details').'</font></th> + </tr> + <tr> + <td>' . _('Location') . '</td> + <td><select name="location[]" multiple> + <option value="All" selected>' . _('All') . '</option>'; $sql = "SELECT loccode, locationname FROM locations"; @@ -575,17 +596,33 @@ $leeway =0; } - echo '<tr><td>' . _('Days Leeway') . ':</td><td><input type="text" name="Leeway" class=number size="4" value=' . $leeway . '>'; - echo '<tr><td>' ._('Use MRP Demands?') . ':</td>'; - echo '<td><input type="checkbox" name="usemrpdemands" value="y" checked></td></tr>'; - echo '<tr><td>' ._('Use EOQ?') . ':</td>'; - echo '<td><input type="checkbox" name="eoqflag" value="y" checked></td></tr>'; - echo '<tr><td>' ._('Use Pan Size?') . ':</td>'; - echo '<td><input type="checkbox" name="pansizeflag" value="y" checked></td></tr>'; - echo '<tr><td>' ._('Use Shrinkage?') . ':</td>'; - echo '<td><input type="checkbox" name="shrinkageflag" value="y" checked></td></tr>'; - echo '</table></td></tr></table><div class="centre"><br /><br /><input type="submit" name="submit" value="' . _('Run MRP') . '"></div>'; - echo '</form>'; + echo '<tr> + <td>' . _('Days Leeway') . ':</td> + <td><input type="text" name="Leeway" class=number size="4" value="' . $leeway . '" /> + </tr> + <tr> + <td>' ._('Use MRP Demands?') . ':</td> + <td><input type="checkbox" name="usemrpdemands" value="y" checked /></td> + </tr> + <tr> + <td>' ._('Use EOQ?') . ':</td> + <td><input type="checkbox" name="eoqflag" value="y" checked /></td> + </tr> + <tr> + <td>' ._('Use Pan Size?') . ':</td> + <td><input type="checkbox" name="pansizeflag" value="y" checked /></td> + </tr> + <tr> + <td>' ._('Use Shrinkage?') . ':</td> + <td><input type="checkbox" name="shrinkageflag" value="y" checked /></td> + </tr> + </table> + <div class="centre"> + <br /> + <br /> + <input type="submit" name="submit" value="' . _('Run MRP') . '" /> + </div> + </form>'; } // End of Main program logic ------------------------------------------------------- @@ -640,7 +677,7 @@ $ReqDate = ConvertSQLDate($Requirements[$reqi]['daterequired']); $DateDiff = DateDiff($DueDate,$ReqDate,'d'); //if ($Supplies[$supi]['duedate'] > $Requirements[$reqi]['daterequired']) { - if ($DateDiff > abs($_POST['Leeway'])) { + if ($DateDiff > abs(filter_number_format($_POST['Leeway']))) { $sql = "UPDATE mrpsupplies SET mrpdate = '" . $Requirements[$reqi]['daterequired'] . "' WHERE id = '" . $Supplies[$supi]['id'] . "' AND duedate = mrpdate"; $result = DB_query($sql,$db); Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/MRPCalendar.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -16,8 +16,10 @@ $ChangeDate =trim(mb_strtoupper($_GET['ChangeDate'])); } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . - _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . + _('Inventory') . '" alt="" />' . ' ' . $title . ' + </p>'; if (isset($_POST['submit'])) { submit($db,$ChangeDate); @@ -60,12 +62,11 @@ $ConvertToDate = ConvertSQLDate($FormatToDate); $DateGreater = Date1GreaterThanDate2($_POST['ToDate'],$_POST['FromDate']); - $DateDiff = DateDiff($ConvertToDate,$ConvertFromDate,"d"); // Date1 minus Date2 + $DateDiff = DateDiff($ConvertToDate,$ConvertFromDate,'d'); // Date1 minus Date2 if ($DateDiff < 1) { $InputError = 1; prnMsg(_('To Date Must Be Greater Than From Date'),'error'); - } if ($InputError == 1) { @@ -87,9 +88,10 @@ $i = 0; - // $DaysTextArray used so can get text of day based on the value get from DayOfWeekFromSQLDate of - // the calendar date. See if that text is in the ExcludeDays array - $DaysTextArray = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); + /* $DaysTextArray used so can get text of day based on the value get from DayOfWeekFromSQLDate of + the calendar date. See if that text is in the ExcludeDays array note no gettext here hard coded english days from $_POST + * $DaysTextArray = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); + */ $ExcludeDays = array($_POST['Sunday'],$_POST['Monday'],$_POST['Tuesday'],$_POST['Wednesday'], $_POST['Thursday'],$_POST['Friday'],$_POST['Saturday']); @@ -132,7 +134,7 @@ WHERE calendardate = '" . $CalDate . "'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } - prnMsg(_("The MRP Calendar has been created"),'succes'); + prnMsg(_('The MRP Calendar has been created'),'success'); display($db,$ChangeDate); } // End of function submit() @@ -168,10 +170,10 @@ $newmanufacturingflag = 1; } $sql = "UPDATE mrpcalendar SET manufacturingflag = '".$newmanufacturingflag."' - WHERE calendardate = '".$CalDate."'"; + WHERE calendardate = '".$CalDate."'"; $ErrMsg = _('Cannot update the MRP Calendar'); $resultupdate = DB_query($sql,$db,$ErrMsg); - prnMsg(_("The MRP calendar record for $ChangeDate has been updated"),'success'); + prnMsg(_('The MRP calendar record for') . ' ' . $ChangeDate . ' ' . _('has been updated'),'success'); unset ($ChangeDate); display($db,$ChangeDate); @@ -204,14 +206,15 @@ daynumber, manufacturingflag, DAYNAME(calendardate) as dayname - FROM mrpcalendar - WHERE calendardate >='" . $FromDate . "' - AND calendardate <='" . $ToDate . "'"; + FROM mrpcalendar + WHERE calendardate >='" . $FromDate . "' + AND calendardate <='" . $ToDate . "'"; $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - echo '<br /><table class="selection"> + echo '<br /> + <table class="selection"> <tr bgcolor ="#800000"> <th>' . _('Date') . '</th> <th>' . _('Manufacturing Date') . '</th> @@ -258,57 +261,62 @@ echo '<tr> <td>' . _('From Date') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] . '"></td></tr> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] . '" /></td></tr> <tr></tr><td>' . _('To Date') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '" /></td> </tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td>'._('Exclude The Following Days').'</td></tr> <tr> <td>' . _('Saturday') . ':</td> - <td><input type="checkbox" name="Saturday" value="Saturday"></td> + <td><input type="checkbox" name="Saturday" value="Saturday" /></td> </tr> <tr> <td>' . _('Sunday') . ':</td> - <td><input type="checkbox" name="Sunday" value="Sunday"></td> + <td><input type="checkbox" name="Sunday" value="Sunday" /></td> </tr> <tr> <td>' . _('Monday') . ':</td> - <td><input type="checkbox" name="Monday" value="Monday"></td> + <td><input type="checkbox" name="Monday" value="Monday" /></td> </tr> <tr> <td>' . _('Tuesday') . ':</td> - <td><input type="checkbox" name="Tuesday" value="Tuesday"></td> + <td><input type="checkbox" name="Tuesday" value="Tuesday" /></td> </tr> <tr> <td>' . _('Wednesday') . ':</td> - <td><input type="checkbox" name="Wednesday" value="Wednesday"></td> + <td><input type="checkbox" name="Wednesday" value="Wednesday" /></td> </tr> <tr> <td>' . _('Thursday') . ':</td> - <td><input type="checkbox" name="Thursday" value="Thursday"></td> + <td><input type="checkbox" name="Thursday" value="Thursday" /></td> </tr> <tr> <td>' . _('Friday') . ':</td> - <td><input type="checkbox" name="Friday" value="Friday"></td> + <td><input type="checkbox" name="Friday" value="Friday" /></td> </tr> </table><br /> - <div class=centre><input type="submit" name="submit" value="' . _('Create Calendar') . '"> - <input type="submit" name="listall" value="' . _('List Date Range') . '"></div>'; + <div class="centre"> + <input type="submit" name="submit" value="' . _('Create Calendar') . '" /> + <input type="submit" name="listall" value="' . _('List Date Range') . '"> + </div>'; if (!isset($_POST['ChangeDate'])) { $_POST['ChangeDate']=date($_SESSION['DefaultDateFormat']); } - echo '<br /><table class="selection">'; - echo '<tr> + echo '<br /> + <table class="selection"> + <tr> <td>' . _('Change Date Status') . ':</td> - <td><input type="text" name="ChangeDate" class="date" alt="' . $_SESSION['DefaultDateFormat'] . - '" size="12" maxlength="12" value="' . $_POST['ChangeDate'] . '"></td> - <td><input type="submit" name="update" value="' . _('Update') . '"></td></tr></table>'; - echo '<br /><br /><div class="centre"></div>'; - echo '</form>'; + <td><input type="text" name="ChangeDate" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" size="12" maxlength="12" value="' . $_POST['ChangeDate'] . '" /></td> + <td><input type="submit" name="update" value="' . _('Update') . '" /></td> + </tr> + </table> + <br /> + <br /> + </form>'; } // End of function display() Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/MRPCreateDemands.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -33,6 +33,14 @@ $InputError=1; unset($_POST['DistDate']); } + if (!is_numeric(filter_number_format($_POST['ExcludeQuantity']))){ + $msg = _('The quantity below which no demand will be created must be numeric'); + $InputError=1; + } + if (!is_numeric(filter_number_format($_POST['Multiplier']))){ + $msg = _('The multiplier is expected to be a positive number'); + $InputError=1; + } if ($InputError==1){ prnMsg($msg,'error'); @@ -68,17 +76,23 @@ // number quantity into each entry of the periodqty array, and add 1 to the periodqty array // until the remainder number is used up. Then create an mrpdemands records for everything // in the array - $multiplier = $_POST['Multiplier']; - if ($_POST['Multiplier'] < 1) { - $multiplier = 1; + + if (filter_number_format($_POST['Multiplier']) < 1) { + $Multiplier = 1; + } else { + $Multiplier = filter_number_format($_POST['Multiplier']); } - $excludeqty = $_POST['Excludeqty']; - if ($_POST['Excludeqty'] < 1) { - $excludeqty = 1; + + if ($_POST['ExcludeQuantity'] < 1) { + $ExcludeQty = 1; + } else { + $ExcludeQty = filter_number_format($_POST['ExcludeQuantity']); } - $excludeamt = $_POST['Excludeamt']; - if ($_POST['Excludeamt'] < 1) { - $excludeamt = 0; + + if ($_POST['ExcludeAmount'] < 1) { + $ExcludeAmount = 0; + } else { + $ExcludeAmount = filter_number_format($_POST['ExcludeAmount']); } // Create array of dates based on DistDate and adding either weeks or months @@ -137,10 +151,10 @@ $TotalRecords = 0; while ($myrow = DB_fetch_array($result)) { - if (($myrow['totqty'] >= $excludeqty) and ($myrow['totextqty'] >= $excludeamt)) { + if (($myrow['totqty'] >= $ExcludeQty) AND ($myrow['totextqty'] >= $ExcludeAmount)) { unset($PeriodQty); $PeriodQty[] = ' '; - $TotalQty = $myrow['totqtyinvoiced'] * $multiplier; + $TotalQty = $myrow['totqtyinvoiced'] * $Multiplier; $WholeNumber = floor($TotalQty / $_POST['PeriodNumber']); $Remainder = ($TotalQty % $_POST['PeriodNumber']); if ($WholeNumber > 0) { @@ -169,7 +183,7 @@ $TotalRecords++; } // end of foreach for INSERT - } // end of if that checks exludeqty, excludeamt + } // end of if that checks exludeqty, ExcludeAmount } //end while loop @@ -179,10 +193,12 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><b><br /></b>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; -echo '<tr><td>' . _('Demand Type') . ':</td><td><select name="MRPDemandtype">'; +echo '<table class="selection"> + <tr> + <td>' . _('Demand Type') . ':</td> + <td><select name="MRPDemandtype">'; $sql = "SELECT mrpdemandtype, description FROM mrpdemandtypes"; @@ -223,36 +239,42 @@ if (!isset($_POST['DistDate'])) { $_POST['DistDate']=date($_SESSION['DefaultDateFormat']); } -echo '<tr><td>' . _('From Sales Date') . ':</td> - <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="10" value="' . $_POST['FromDate'] . '" />'; -echo ' '. _('To Sales Date') . ':<input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="10" value="' . $_POST['ToDate'] . '" /></td> - </tr>'; -echo '<tr><td>' . _('Start Date For Distribution') . ':</td> +echo '<tr> + <td>' . _('From Sales Date') . ':</td> + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="10" value="' . $_POST['FromDate'] . '" /> '. _('To Sales Date') . ':<input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="10" value="' . $_POST['ToDate'] . '" /></td> + </tr> + <tr> + <td>' . _('Start Date For Distribution') . ':</td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="DistDate" size="10" value="' . $_POST['DistDate'] . '" /></td> - </tr>'; -echo '<tr><td>' . _('Distribution Period') . ':</td> - <td><select name="Period">'; -echo '<option selected value="weekly">' . _('Weekly') . '</option> - <option value="monthly">' . _('Monthly') .'</option> - </select></td> - </tr>'; -echo '<tr><td>' . _('Number of Periods') .':</td> + </tr> + <tr> + <td>' . _('Distribution Period') . ':</td> + <td><select name="Period"> + <option selected value="weekly">' . _('Weekly') . '</option> + <option value="monthly">' . _('Monthly') .'</option> + </select></td> + </tr> + <tr> + <td>' . _('Number of Periods') .':</td> <td><input type ="text" class="number" name="PeriodNumber" size="4" value="1" /></td> - </tr>'; -echo '<tr><td>' . _('Exclude Total Quantity Less Than') . ':</td> - <td><input type ="text" class="number" name="Excludeqty" size="4" value="1">'; -echo '<tr><td>' . _('Exclude Total Dollars Less Than') . ':</td> - <td><input type ="text" class="number" name="Excludeamt" size="8" value="0"></td> - </tr>'; -echo '<tr><td>' . _('Multiplier') .':</td> + </tr> + <tr> + <td>' . _('Exclude Total Quantity Less Than') . ':</td> + <td><input type ="text" class="number" name="ExcludeQuantity" size="4" value="1" /> + <tr> + <td>' . _('Exclude Total Dollars Less Than') . ':</td> + <td><input type ="text" class="number" name="ExcludeAmount" size="8" value="0" /></td> + </tr> + <tr> + <td>' . _('Multiplier') .':</td> <td><input type="text" class="number" name="Multiplier" size="2" value="1" /></td> - </tr> - <tr> + </tr> + <tr> <td></td> - </tr> - </table>'; -echo '<br /> - <div class=centre> + </tr> + </table> + <br /> + <div class="centre"> <input type="submit" name="submit" value="' . _('Submit') . '" /> </div>'; Modified: trunk/MRPDemandTypes.php =================================================================== --- trunk/MRPDemandTypes.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/MRPDemandTypes.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -58,7 +58,7 @@ $sql = "INSERT INTO mrpdemandtypes (mrpdemandtype, description) VALUES ('" . trim(mb_strtoupper($_POST['MRPDemandType'])) . "', - '" . $_POST['Description'] . "' + '" . DB_escape_string($_POST['Description']) . "' )"; $msg = _('The new demand type has been added to the database'); } @@ -169,7 +169,7 @@ echo '<table class="selection"> <tr> <td>' . _('Demand Type') . ':</td> - <td><input type="text" name="MRPDemandType" size="6" maxlength="5" value="' . $_POST['MRPDemandType'] . '"></td> + <td><input type="text" name="MRPDemandType" size="6" maxlength="5" value="' . $_POST['MRPDemandType'] . '" /></td> </tr>' ; } @@ -177,13 +177,16 @@ $_POST['Description'] = ''; } -echo '<tr><td>' . _('Demand Type Description') . ':</td> - <td><input type="text" name="Description" size="31" maxlength="30" value="' . $_POST['Description'] . '"></td> - </tr> - </table>'; - -echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; - -echo '</form>'; +echo '<tr> + <td>' . _('Demand Type Description') . ':</td> + <td><input type="text" name="Description" size="31" maxlength="30" value="' . $_POST['Description'] . '" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> + </div> + </form>'; + include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRPDemands.php =================================================================== --- trunk/MRPDemands.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/MRPDemands.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -136,11 +136,11 @@ //first off validate inputs sensible - if (!is_numeric($_POST['Quantity'])) { + if (!is_numeric(filter_number_format($_POST['Quantity']))) { $InputError = 1; prnMsg(_('Quantity must be numeric'),'error'); } - if ($_POST['Quantity'] <= 0) { + if (filter_number_format($_POST['Quantity']) <= 0) { $InputError = 1; prnMsg(_('Quantity must be greater than 0'),'error'); } @@ -190,7 +190,7 @@ if ($myrow[0]>0) { //If $myrow[0] > 0, it means this is an edit, so do an update - $sql = "UPDATE mrpdemands SET quantity = '" . $_POST['Quantity'] . "', + $sql = "UPDATE mrpdemands SET quantity = '" . filter_number_format($_POST['Quantity']) . "', mrpdemandtype = '" . trim(mb_strtoupper($_POST['MRPDemandtype'])) . "', duedate = '" . $FormatedDuedate . "' WHERE demandid = '" . $DemandID . "'"; @@ -204,7 +204,7 @@ duedate) VALUES ('" . $StockID . "', '" . trim(mb_strtoupper($_POST['MRPDemandtype'])) . "', - '" . $_POST['Quantity'] . "', + '" . filter_number_format($_POST['Quantity']) . "', '" . $FormatedDuedate . "' )"; $msg = _('A new MRP demand record has been added to the database for') . ' ' . $StockID; @@ -277,7 +277,8 @@ mrpdemands.mrpdemandtype, mrpdemands.quantity, mrpdemands.duedate, - stockmaster.description + stockmaster.description, + stockmaster.decimalplaces FROM mrpdemands LEFT JOIN stockmaster on mrpdemands.stockid = stockmaster.stockid" . $where . " ORDER BY mrpdemands.stockid, mrpdemands.duedate"; @@ -294,16 +295,16 @@ <th>' . _('Due Date') . '</th> </tr>'; $ctr = 0; - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { $displaydate = ConvertSQLDate($myrow[4]); $ctr++; - echo '<tr><td>' . $myrow[1] . '</td> - <td>' . $myrow[5] . '</td> - <td>' . $myrow[2] . '</td> - <td>' . $myrow[3] . '</td> + echo '<tr><td>' . $myrow['stockid'] . '</td> + <td>' . $myrow['description'] . '</td> + <td>' . $myrow['mrpdemandtype'] . '</td> + <td>' . locale_number_format($myrow['quantity'],$myrow['decimalplaces']) . '</td> <td>' . $displaydate . '</td> - <td><a href="' .$_SERVER['PHP_SELF'] .'?DemandID=' . $myrow[0] . '&StockID=' . $myrow[1] . '">' . _('Edit') . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?DemandID=' . $myrow[0] . '&StockID=' . $myrow[1].'&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this demand?') . '\');">' . _('Delete') .'</td> + <td><a href="' .$_SERVER['PHP_SELF'] .'?DemandID=' . $myrow['demandid'] . '&StockID=' . $myrow['stockid'] . '">' . _('Edit') . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?DemandID=' . $myrow['demandid'] . '&StockID=' . $myrow['stockid'].'&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this demand?') . '\');">' . _('Delete') .'</td> </tr>'; } @@ -354,21 +355,27 @@ $_POST['DemandID'] = $myrow['demandid']; $_POST['StockID'] = $myrow['stockid']; $_POST['MRPDemandtype'] = $myrow['mrpdemandtype']; - $_POST['Quantity'] = $myrow['quantity']; + $_POST['Quantity'] = locale_number_format($myrow['quantity'],'Variable'); $_POST['Duedate'] = ConvertSQLDate($myrow['duedate']); } - echo '<input type="hidden" name="DemandID" value=' . $_POST['DemandID'] . '>'; - echo '<input type="hidden" name="StockID" value="' . $_POST['StockID'] . '">'; - echo '<table class=selection><tr><td>' ._('Part Number') . ':</td><td>' . $_POST['StockID'] . '</td></tr>'; + echo '<input type="hidden" name="DemandID" value="' . $_POST['DemandID'] . '" />'; + echo '<input type="hidden" name="StockID" value="' . $_POST['StockID'] . '" />'; + echo '<table class="selection"> + <tr> + <td>' ._('Part Number') . ':</td> + <td>' . $_POST['StockID'] . '</td> + </tr>'; } else { if (!isset($_POST['StockID'])) { $_POST['StockID'] = ''; } - echo '<table class=selection><tr> - <td>' . _('Part Number') . ':</td> - <td><input type="Text" name="StockID" size=21 maxlength=20 value="' . $_POST['StockID'] . '"></td></tr>'; + echo '<table class="selection"> + <tr> + <td>' . _('Part Number') . ':</td> + <td><input type="text" name="StockID" size="21" maxlength="20" value="' . $_POST['StockID'] . '" /></td> + </tr>'; } @@ -381,11 +388,11 @@ } echo '<tr><td>' . _('Quantity') . ':</td> - <td><input type="text" name="Quantity" class="number" size="6" maxlength="6" value=' . $_POST['Quantity'] . '></td> + <td><input type="text" name="Quantity" class="number" size="6" maxlength="6" value="' . $_POST['Quantity'] . '" /></td> </tr> <tr> <td>' . _('Due Date') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="Duedate" size="12" maxlength="12" value="' . $_POST['Duedate'] . '"></td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="Duedate" size="12" maxlength="12" value="' . $_POST['Duedate'] . '" /></td> </tr>'; // Generate selections for Demand Type echo '<tr> @@ -404,19 +411,21 @@ } echo $myrow['mrpdemandtype'] . '">' . $myrow['mrpdemandtype'] . ' - ' .$myrow['description'] . '</option>'; } //end while loop - echo '</select></td></tr>'; - - echo '</table>'; - echo '<br /> - <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '" />  '; - echo '<input type="submit" name="listsome" value="' . _('List Selection') . '" />  '; - echo '<input type="submit" name="deletesome" value="' . _('Delete Demand Type') . '" />'; + echo '</select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" />   + <input type="submit" name="listsome" value="' . _('List Selection') . '" />   + <input type="submit" name="deletesome" value="' . _('Delete Demand Type') . '" />'; // If mrpdemand record exists, display option to delete it if ((isset($DemandID)) AND (DB_num_rows($result) > 0)) { echo '<br/><br/><a href=" ' . $_SERVER['PHP_SELF'] . '?delete=yes&StockID='.$StockID.'&DemandID=' . $DemandID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this demand?') . '\');">' . _('Or Delete Record') ; } } - echo '</form>'; + echo '</div> + </form>'; } // End of function display() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-25 07:38:33
|
Revision: 4731 http://web-erp.svn.sourceforge.net/web-erp/?rev=4731&view=rev Author: daintree Date: 2011-10-25 07:38:22 +0000 (Tue, 25 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/Locations.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPCreateDemands.php trunk/MRPDemandTypes.php trunk/MRPDemands.php Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/Locations.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -55,17 +55,17 @@ } $sql = "UPDATE locations SET loccode='" . $_POST['LocCode'] . "', - locationname='" . $_POST['LocationName'] . "', - deladd1='" . $_POST['DelAdd1'] . "', - deladd2='" . $_POST['DelAdd2'] . "', - deladd3='" . $_POST['DelAdd3'] . "', - deladd4='" . $_POST['DelAdd4'] . "', - deladd5='" . $_POST['DelAdd5'] . "', - deladd6='" . $_POST['DelAdd6'] . "', - tel='" . $_POST['Tel'] . "', - fax='" . $_POST['Fax'] . "', - email='" . $_POST['Email'] . "', - contact='" . $_POST['Contact'] . "', + locationname='" . DB_escape_string($_POST['LocationName']) . "', + deladd1='" . DB_escape_string($_POST['DelAdd1']) . "', + deladd2='" . DB_escape_string($_POST['DelAdd2']) . "', + deladd3='" . DB_escape_string($_POST['DelAdd3']) . "', + deladd4='" . DB_escape_string($_POST['DelAdd4']) . "', + deladd5='" . DB_escape_string($_POST['DelAdd5']) . "', + deladd6='" . DB_escape_string($_POST['DelAdd6']) . "', + tel='" . DB_escape_string($_POST['Tel']) . "', + fax='" . DB_escape_string($_POST['Fax']) . "', + email='" . DB_escape_string($_POST['Email']) . "', + contact='" . DB_escape_string($_POST['Contact']) . "', taxprovinceid = '" . $_POST['TaxProvince'] . "', cashsalecustomer ='" . $_POST['CashSaleCustomer'] . "', cashsalebranch ='" . $_POST['CashSaleBranch'] . "', @@ -124,18 +124,18 @@ cashsalecustomer, cashsalebranch, managed ) - VALUES ('" . $_POST['LocCode'] . "', - '" . $_POST['LocationName'] . "', - '" . $_POST['DelAdd1'] ."', - '" . $_POST['DelAdd2'] ."', - '" . $_POST['DelAdd3'] . "', - '" . $_POST['DelAdd4'] . "', - '" . $_POST['DelAdd5'] . "', - '" . $_POST['DelAdd6'] . "', - '" . $_POST['Tel'] . "', - '" . $_POST['Fax'] . "', - '" . $_POST['Email'] . "', - '" . $_POST['Contact'] . "', + VALUES ('" . DB_escape_string($_POST['LocCode']) . "', + '" . DB_escape_string($_POST['LocationName']) . "', + '" . DB_escape_string($_POST['DelAdd1']) ."', + '" . DB_escape_string($_POST['DelAdd2']) ."', + '" . DB_escape_string($_POST['DelAdd3']) . "', + '" . DB_escape_string($_POST['DelAdd4']) . "', + '" . DB_escape_string($_POST['DelAdd5']) . "', + '" . DB_escape_string($_POST['DelAdd6']) . "', + '" . DB_escape_string($_POST['Tel']) . "', + '" . DB_escape_string($_POST['Fax']) . "', + '" . DB_escape_string($_POST['Email']) . "', + '" . DB_escape_string($_POST['Contact']) . "', '" . $_POST['TaxProvince'] . "', '" . $_POST['CashSaleCustomer'] . "', '" . $_POST['CashSaleBranch'] . "', @@ -353,8 +353,9 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<table class=selection>'; - echo '<tr><th>' . _('Location Code') . '</th> + echo '<table class="selection">'; + echo '<tr> + <th>' . _('Location Code') . '</th> <th>' . _('Location Name') . '</th> <th>' . _('Tax Province') . '</th> </tr>'; @@ -458,19 +459,21 @@ echo '<tr> <th colspan=2><font size=3 color=blue>'._('Amend Location details').'</font></th> </tr>'; - echo '<tr><td>' . _('Location Code') . ':</td><td>'; - echo $_POST['LocCode'] . '</td></tr>'; + echo '<tr> + <td>' . _('Location Code') . ':</td> + <td>' . $_POST['LocCode'] . '</td> + </tr>'; } else { //end of if $SelectedLocation only do the else when a new record is being entered if (!isset($_POST['LocCode'])) { $_POST['LocCode'] = ''; } echo '<table class="selection"> <tr> - <th colspan=2><font size=3 color=blue>'._('New Location details').'</font></th> + <th colspan="2"><font size="3" color="blue">'._('New Location details').'</font></th> </tr>'; echo '<tr> <td>' . _('Location Code') . ':</td> - <td><input type="Text" name="LocCode" value="' . $_POST['LocCode'] . '" size=5 maxlength=5></td> + <td><input type="text" name="LocCode" value="' . $_POST['LocCode'] . '" size="5" maxlength="5" /></td> </tr>'; } if (!isset($_POST['LocationName'])) { @@ -516,31 +519,54 @@ $_POST['Managed'] = 0; } - echo '<tr><td>' . _('Location Name') . ':' . '</td>'; - echo '<td><input type="text" name="LocationName" value="'. $_POST['LocationName'] . '" size=51 maxlength="50" /></td></tr>'; - echo '<tr><td>' . _('Contact for deliveries') . ':' . '</td>'; - echo '<td><input type="text" name="Contact" value="' . $_POST['Contact'] . '" size="31" maxlength="30" /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 1') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd1" value="' . $_POST['DelAdd1'] . '" size="41" maxlength="40" /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 2') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd2" value="' . $_POST['DelAdd2'] . '" size="41" maxlength="40" /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 3') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd3" value="' . $_POST['DelAdd3'] . '" size="41" maxlength="40" /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 4') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd4" value="' . $_POST['DelAdd4'] . '" size="41" maxlength=40 /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 5') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd5" value="' . $_POST['DelAdd5'] . '" size="21" maxlength="20" /></td></tr>'; - echo '<tr><td>' . _('Delivery Address 6') . ':' . '</td>'; - echo '<td><input type="text" name="DelAdd6" value="' . $_POST['DelAdd6'] . '" size="16" maxlength="15" /></td></tr>'; - echo '<tr><td>' . _('Telephone No') . ':' . '</td>'; - echo '<td><input type="text" name="Tel" value="' . $_POST['Tel'] . '" size="31" maxlength="30" /></td></tr>'; - echo '<tr><td>' . _('Facsimile No') . ':' . '</td>'; - echo '<td><input type="text" name="Fax" value="' . $_POST['Fax'] . '" size="31" maxlength="30" /></td></tr>'; - echo '<tr><td>' . _('Email') . ':' . '</td>'; - echo '<td><input type="text" name="Email" value="' . $_POST['Email'] . '" size="31" maxlength="55" /></td></tr>'; + echo '<tr> + <td>' . _('Location Name') . ':' . '</td> + <td><input type="text" name="LocationName" value="'. $_POST['LocationName'] . '" size="51" maxlength="50" /></td> + </tr> + <tr> + <td>' . _('Contact for deliveries') . ':' . '</td> + <td><input type="text" name="Contact" value="' . $_POST['Contact'] . '" size="31" maxlength="30" /></td> + </tr> + <tr> + <td>' . _('Delivery Address 1') . ':' . '</td> + <td><input type="text" name="DelAdd1" value="' . $_POST['DelAdd1'] . '" size="41" maxlength="40" /></td> + </tr> + <tr> + <td>' . _('Delivery Address 2') . ':' . '</td> + <td><input type="text" name="DelAdd2" value="' . $_POST['DelAdd2'] . '" size="41" maxlength="40" /></td> + </tr> + <tr> + <td>' . _('Delivery Address 3') . ':' . '</td> + <td><input type="text" name="DelAdd3" value="' . $_POST['DelAdd3'] . '" size="41" maxlength="40" /></td> + </tr> + <tr> + <td>' . _('Delivery Address 4') . ':' . '</td> + <td><input type="text" name="DelAdd4" value="' . $_POST['DelAdd4'] . '" size="41" maxlength=40 /></td> + </tr> + <tr> + <td>' . _('Delivery Address 5') . ':' . '</td> + <td><input type="text" name="DelAdd5" value="' . $_POST['DelAdd5'] . '" size="21" maxlength="20" /></td> + </tr> + <tr> + <td>' . _('Delivery Address 6') . ':' . '</td> + <td><input type="text" name="DelAdd6" value="' . $_POST['DelAdd6'] . '" size="16" maxlength="15" /></td> + </tr> + <tr> + <td>' . _('Telephone No') . ':' . '</td> + <td><input type="text" name="Tel" value="' . $_POST['Tel'] . '" size="31" maxlength="30" /></td> + </tr> + <tr> + <td>' . _('Facsimile No') . ':' . '</td> + <td><input type="text" name="Fax" value="' . $_POST['Fax'] . '" size="31" maxlength="30" /></td> + </tr> + <tr> + <td>' . _('Email') . ':' . '</td> + <td><input type="text" name="Email" value="' . $_POST['Email'] . '" size="31" maxlength="55" /></td> + </tr> + <tr> + <td>' . _('Tax Province') . ':' . '</td> + <td><select name="TaxProvince">'; - echo '<td>' . _('Tax Province') . ':' . '</td><td><select name="TaxProvince">'; - $TaxProvinceResult = DB_query("SELECT taxprovinceid, taxprovincename FROM taxprovinces",$db); while ($myrow=DB_fetch_array($TaxProvinceResult)){ if ($_POST['TaxProvince']==$myrow['taxprovinceid']){ @@ -550,24 +576,28 @@ } } - echo '</select></td></tr>'; - echo '<tr><td>' . _('Default Counter Sales Customer Code') . ':' . '</td>'; - echo '<td><input type="text" name="CashSaleCustomer" value="' . $_POST['CashSaleCustomer'] . - '" size="11" maxlength="10" /></td></tr>'; - echo '<tr><td>' . _('Counter Sales Branch Code') . ':' . '</td>'; - echo '<td><input type="text" name="CashSaleBranch" value="' . $_POST['CashSaleBranch'] . - '" size="11" maxlength="10" /></td></tr>'; + echo '</select></td> + </tr> + <tr> + <td>' . _('Default Counter Sales Customer Code') . ':' . '</td> + <td><input type="text" name="CashSaleCustomer" value="' . $_POST['CashSaleCustomer'] . '" size="11" maxlength="10" /></td> + </tr> + <tr> + <td>' . _('Counter Sales Branch Code') . ':' . '</td> + <td><input type="text" name="CashSaleBranch" value="' . $_POST['CashSaleBranch'] . '" size="11" maxlength="10" /></td> + </tr>'; /* This functionality is not written yet ... <tr><td><?php echo _('Enable Warehouse Management') . ':'; ?></td> <td><input type='checkbox' name='Managed'<?php if($_POST['Managed'] == 1) echo ' checked';?>></td></tr> */ - echo '</table><br />'; + echo '</table> + <br /> + <div class="centre"> + <input type="Submit" name="submit" value="' . _('Enter Information') . '"> + </div> + </form>'; - echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; - - echo '</form>'; - } //end if record deleted no point displaying form to add record include('includes/footer.inc'); Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/MRP.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -8,7 +8,7 @@ if (isset($_POST['submit'])) { - if (!$_POST['Leeway'] || !is_numeric($_POST['Leeway'])) { + if (!isset($_POST['Leeway']) OR !is_numeric(filter_number_format($_POST['Leeway']))) { $_POST['Leeway'] = 0; } @@ -508,7 +508,7 @@ '" . $_POST['shrinkageflag'] . "', '" . $_POST['eoqflag'] . "', '" . $_POST['usemrpdemands'] . "', - '" . $_POST['Leeway'] . "')"; + '" . filter_number_format($_POST['Leeway']) . "')"; $result = DB_query($sql,$db); } else { // End of if submit isset @@ -540,28 +540,49 @@ if ($myrow['shrinkageflag'] == 'y') { $useshrinkage = _('Yes'); } - echo '<table cellpadding=5><tr><td valign=top>'; - echo '<table class=selection>'; - echo '<tr><th colspan=3><font color=blue size=3>'._('Last Run Details').'</font></th></tr>'; - echo '<tr>'; - echo '<td>' . _('Last Run Time') . ':  </td><td>' . $myrow['runtime'] . '</td></tr>'; - echo '<td>' . _('Location') . ':  </td><td>' . $myrow['location'] . '</td></tr>'; - echo '<td>' . _('Days Leeway') . ':  </td><td>' . $leeway . '</td></tr>'; - echo '<td>' . _('Use MRP Demands') . ':  </td><td>' . $usemrpdemands . '</td></tr>'; - echo '<td>' . _('Use EOQ') . ':  </td><td>' . $useeoq . '</td></tr>'; - echo '<td>' . _('Use Pan Size') . ':  </td><td>' . $usepansize . '</td></tr>'; - echo '<td>' . _('Use Shrinkage') . ':  </td><td>' . $useshrinkage . '</td></tr>'; - echo '</table></td>'; + echo '<table class="selection"> + <tr> + <th colspan="3"><font color="blue" size="3">'._('Last Run Details').'</font></th> + </tr> + <tr> + <td>' . _('Last Run Time') . ':</td><td>' . $myrow['runtime'] . '</td> + </tr> + <tr> + <td>' . _('Location') . ':</td> + <td>' . $myrow['location'] . '</td> + </tr> + <tr> + <td>' . _('Days Leeway') . ':</td> + <td>' . $leeway . '</td> + </tr> + <tr> + <td>' . _('Use MRP Demands') . ':</td> + <td>' . $usemrpdemands . '</td> + </tr> + <tr> + <td>' . _('Use EOQ') . ':</td> + <td>' . $useeoq . '</td> + </tr> + <tr> + <td>' . _('Use Pan Size') . ':</td> + <td>' . $usepansize . '</td> + </tr> + <tr> + <td>' . _('Use Shrinkage') . ':</td> + <td>' . $useshrinkage . '</td> + </tr> + </table>'; } echo '<p><form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; - // Generate selections for Location - echo '<tr><th colspan="3"><font color=blue size=3>'._('This Run Details').'</font></th></tr>'; - echo '<tr> - <td>' . _('Location') . '</td> - <td><select name="location[]" multiple> - <option value="All" selected>' . _('All') . '</option>'; + echo '<table class="selection"> + <tr> + <th colspan="3"><font color="blue" size="3">'._('This Run Details').'</font></th> + </tr> + <tr> + <td>' . _('Location') . '</td> + <td><select name="location[]" multiple> + <option value="All" selected>' . _('All') . '</option>'; $sql = "SELECT loccode, locationname FROM locations"; @@ -575,17 +596,33 @@ $leeway =0; } - echo '<tr><td>' . _('Days Leeway') . ':</td><td><input type="text" name="Leeway" class=number size="4" value=' . $leeway . '>'; - echo '<tr><td>' ._('Use MRP Demands?') . ':</td>'; - echo '<td><input type="checkbox" name="usemrpdemands" value="y" checked></td></tr>'; - echo '<tr><td>' ._('Use EOQ?') . ':</td>'; - echo '<td><input type="checkbox" name="eoqflag" value="y" checked></td></tr>'; - echo '<tr><td>' ._('Use Pan Size?') . ':</td>'; - echo '<td><input type="checkbox" name="pansizeflag" value="y" checked></td></tr>'; - echo '<tr><td>' ._('Use Shrinkage?') . ':</td>'; - echo '<td><input type="checkbox" name="shrinkageflag" value="y" checked></td></tr>'; - echo '</table></td></tr></table><div class="centre"><br /><br /><input type="submit" name="submit" value="' . _('Run MRP') . '"></div>'; - echo '</form>'; + echo '<tr> + <td>' . _('Days Leeway') . ':</td> + <td><input type="text" name="Leeway" class=number size="4" value="' . $leeway . '" /> + </tr> + <tr> + <td>' ._('Use MRP Demands?') . ':</td> + <td><input type="checkbox" name="usemrpdemands" value="y" checked /></td> + </tr> + <tr> + <td>' ._('Use EOQ?') . ':</td> + <td><input type="checkbox" name="eoqflag" value="y" checked /></td> + </tr> + <tr> + <td>' ._('Use Pan Size?') . ':</td> + <td><input type="checkbox" name="pansizeflag" value="y" checked /></td> + </tr> + <tr> + <td>' ._('Use Shrinkage?') . ':</td> + <td><input type="checkbox" name="shrinkageflag" value="y" checked /></td> + </tr> + </table> + <div class="centre"> + <br /> + <br /> + <input type="submit" name="submit" value="' . _('Run MRP') . '" /> + </div> + </form>'; } // End of Main program logic ------------------------------------------------------- @@ -640,7 +677,7 @@ $ReqDate = ConvertSQLDate($Requirements[$reqi]['daterequired']); $DateDiff = DateDiff($DueDate,$ReqDate,'d'); //if ($Supplies[$supi]['duedate'] > $Requirements[$reqi]['daterequired']) { - if ($DateDiff > abs($_POST['Leeway'])) { + if ($DateDiff > abs(filter_number_format($_POST['Leeway']))) { $sql = "UPDATE mrpsupplies SET mrpdate = '" . $Requirements[$reqi]['daterequired'] . "' WHERE id = '" . $Supplies[$supi]['id'] . "' AND duedate = mrpdate"; $result = DB_query($sql,$db); Modified: trunk/MRPCalendar.php =================================================================== --- trunk/MRPCalendar.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/MRPCalendar.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -16,8 +16,10 @@ $ChangeDate =trim(mb_strtoupper($_GET['ChangeDate'])); } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . - _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . + _('Inventory') . '" alt="" />' . ' ' . $title . ' + </p>'; if (isset($_POST['submit'])) { submit($db,$ChangeDate); @@ -60,12 +62,11 @@ $ConvertToDate = ConvertSQLDate($FormatToDate); $DateGreater = Date1GreaterThanDate2($_POST['ToDate'],$_POST['FromDate']); - $DateDiff = DateDiff($ConvertToDate,$ConvertFromDate,"d"); // Date1 minus Date2 + $DateDiff = DateDiff($ConvertToDate,$ConvertFromDate,'d'); // Date1 minus Date2 if ($DateDiff < 1) { $InputError = 1; prnMsg(_('To Date Must Be Greater Than From Date'),'error'); - } if ($InputError == 1) { @@ -87,9 +88,10 @@ $i = 0; - // $DaysTextArray used so can get text of day based on the value get from DayOfWeekFromSQLDate of - // the calendar date. See if that text is in the ExcludeDays array - $DaysTextArray = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); + /* $DaysTextArray used so can get text of day based on the value get from DayOfWeekFromSQLDate of + the calendar date. See if that text is in the ExcludeDays array note no gettext here hard coded english days from $_POST + * $DaysTextArray = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); + */ $ExcludeDays = array($_POST['Sunday'],$_POST['Monday'],$_POST['Tuesday'],$_POST['Wednesday'], $_POST['Thursday'],$_POST['Friday'],$_POST['Saturday']); @@ -132,7 +134,7 @@ WHERE calendardate = '" . $CalDate . "'"; $resultupdate = DB_query($sql,$db,$ErrMsg); } - prnMsg(_("The MRP Calendar has been created"),'succes'); + prnMsg(_('The MRP Calendar has been created'),'success'); display($db,$ChangeDate); } // End of function submit() @@ -168,10 +170,10 @@ $newmanufacturingflag = 1; } $sql = "UPDATE mrpcalendar SET manufacturingflag = '".$newmanufacturingflag."' - WHERE calendardate = '".$CalDate."'"; + WHERE calendardate = '".$CalDate."'"; $ErrMsg = _('Cannot update the MRP Calendar'); $resultupdate = DB_query($sql,$db,$ErrMsg); - prnMsg(_("The MRP calendar record for $ChangeDate has been updated"),'success'); + prnMsg(_('The MRP calendar record for') . ' ' . $ChangeDate . ' ' . _('has been updated'),'success'); unset ($ChangeDate); display($db,$ChangeDate); @@ -204,14 +206,15 @@ daynumber, manufacturingflag, DAYNAME(calendardate) as dayname - FROM mrpcalendar - WHERE calendardate >='" . $FromDate . "' - AND calendardate <='" . $ToDate . "'"; + FROM mrpcalendar + WHERE calendardate >='" . $FromDate . "' + AND calendardate <='" . $ToDate . "'"; $ErrMsg = _('The SQL to find the parts selected failed with the message'); $result = DB_query($sql,$db,$ErrMsg); - echo '<br /><table class="selection"> + echo '<br /> + <table class="selection"> <tr bgcolor ="#800000"> <th>' . _('Date') . '</th> <th>' . _('Manufacturing Date') . '</th> @@ -258,57 +261,62 @@ echo '<tr> <td>' . _('From Date') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] . '"></td></tr> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="FromDate" size="10" maxlength="10" value="' . $_POST['FromDate'] . '" /></td></tr> <tr></tr><td>' . _('To Date') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '"></td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="ToDate" size="10" maxlength="10" value="' . $_POST['ToDate'] . '" /></td> </tr> <tr><td></td></tr> <tr><td></td></tr> <tr><td>'._('Exclude The Following Days').'</td></tr> <tr> <td>' . _('Saturday') . ':</td> - <td><input type="checkbox" name="Saturday" value="Saturday"></td> + <td><input type="checkbox" name="Saturday" value="Saturday" /></td> </tr> <tr> <td>' . _('Sunday') . ':</td> - <td><input type="checkbox" name="Sunday" value="Sunday"></td> + <td><input type="checkbox" name="Sunday" value="Sunday" /></td> </tr> <tr> <td>' . _('Monday') . ':</td> - <td><input type="checkbox" name="Monday" value="Monday"></td> + <td><input type="checkbox" name="Monday" value="Monday" /></td> </tr> <tr> <td>' . _('Tuesday') . ':</td> - <td><input type="checkbox" name="Tuesday" value="Tuesday"></td> + <td><input type="checkbox" name="Tuesday" value="Tuesday" /></td> </tr> <tr> <td>' . _('Wednesday') . ':</td> - <td><input type="checkbox" name="Wednesday" value="Wednesday"></td> + <td><input type="checkbox" name="Wednesday" value="Wednesday" /></td> </tr> <tr> <td>' . _('Thursday') . ':</td> - <td><input type="checkbox" name="Thursday" value="Thursday"></td> + <td><input type="checkbox" name="Thursday" value="Thursday" /></td> </tr> <tr> <td>' . _('Friday') . ':</td> - <td><input type="checkbox" name="Friday" value="Friday"></td> + <td><input type="checkbox" name="Friday" value="Friday" /></td> </tr> </table><br /> - <div class=centre><input type="submit" name="submit" value="' . _('Create Calendar') . '"> - <input type="submit" name="listall" value="' . _('List Date Range') . '"></div>'; + <div class="centre"> + <input type="submit" name="submit" value="' . _('Create Calendar') . '" /> + <input type="submit" name="listall" value="' . _('List Date Range') . '"> + </div>'; if (!isset($_POST['ChangeDate'])) { $_POST['ChangeDate']=date($_SESSION['DefaultDateFormat']); } - echo '<br /><table class="selection">'; - echo '<tr> + echo '<br /> + <table class="selection"> + <tr> <td>' . _('Change Date Status') . ':</td> - <td><input type="text" name="ChangeDate" class="date" alt="' . $_SESSION['DefaultDateFormat'] . - '" size="12" maxlength="12" value="' . $_POST['ChangeDate'] . '"></td> - <td><input type="submit" name="update" value="' . _('Update') . '"></td></tr></table>'; - echo '<br /><br /><div class="centre"></div>'; - echo '</form>'; + <td><input type="text" name="ChangeDate" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" size="12" maxlength="12" value="' . $_POST['ChangeDate'] . '" /></td> + <td><input type="submit" name="update" value="' . _('Update') . '" /></td> + </tr> + </table> + <br /> + <br /> + </form>'; } // End of function display() Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/MRPCreateDemands.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -33,6 +33,14 @@ $InputError=1; unset($_POST['DistDate']); } + if (!is_numeric(filter_number_format($_POST['ExcludeQuantity']))){ + $msg = _('The quantity below which no demand will be created must be numeric'); + $InputError=1; + } + if (!is_numeric(filter_number_format($_POST['Multiplier']))){ + $msg = _('The multiplier is expected to be a positive number'); + $InputError=1; + } if ($InputError==1){ prnMsg($msg,'error'); @@ -68,17 +76,23 @@ // number quantity into each entry of the periodqty array, and add 1 to the periodqty array // until the remainder number is used up. Then create an mrpdemands records for everything // in the array - $multiplier = $_POST['Multiplier']; - if ($_POST['Multiplier'] < 1) { - $multiplier = 1; + + if (filter_number_format($_POST['Multiplier']) < 1) { + $Multiplier = 1; + } else { + $Multiplier = filter_number_format($_POST['Multiplier']); } - $excludeqty = $_POST['Excludeqty']; - if ($_POST['Excludeqty'] < 1) { - $excludeqty = 1; + + if ($_POST['ExcludeQuantity'] < 1) { + $ExcludeQty = 1; + } else { + $ExcludeQty = filter_number_format($_POST['ExcludeQuantity']); } - $excludeamt = $_POST['Excludeamt']; - if ($_POST['Excludeamt'] < 1) { - $excludeamt = 0; + + if ($_POST['ExcludeAmount'] < 1) { + $ExcludeAmount = 0; + } else { + $ExcludeAmount = filter_number_format($_POST['ExcludeAmount']); } // Create array of dates based on DistDate and adding either weeks or months @@ -137,10 +151,10 @@ $TotalRecords = 0; while ($myrow = DB_fetch_array($result)) { - if (($myrow['totqty'] >= $excludeqty) and ($myrow['totextqty'] >= $excludeamt)) { + if (($myrow['totqty'] >= $ExcludeQty) AND ($myrow['totextqty'] >= $ExcludeAmount)) { unset($PeriodQty); $PeriodQty[] = ' '; - $TotalQty = $myrow['totqtyinvoiced'] * $multiplier; + $TotalQty = $myrow['totqtyinvoiced'] * $Multiplier; $WholeNumber = floor($TotalQty / $_POST['PeriodNumber']); $Remainder = ($TotalQty % $_POST['PeriodNumber']); if ($WholeNumber > 0) { @@ -169,7 +183,7 @@ $TotalRecords++; } // end of foreach for INSERT - } // end of if that checks exludeqty, excludeamt + } // end of if that checks exludeqty, ExcludeAmount } //end while loop @@ -179,10 +193,12 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . '" alt="" />' . ' ' . $title . '</p>'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><b><br /></b>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class=selection>'; -echo '<tr><td>' . _('Demand Type') . ':</td><td><select name="MRPDemandtype">'; +echo '<table class="selection"> + <tr> + <td>' . _('Demand Type') . ':</td> + <td><select name="MRPDemandtype">'; $sql = "SELECT mrpdemandtype, description FROM mrpdemandtypes"; @@ -223,36 +239,42 @@ if (!isset($_POST['DistDate'])) { $_POST['DistDate']=date($_SESSION['DefaultDateFormat']); } -echo '<tr><td>' . _('From Sales Date') . ':</td> - <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="10" value="' . $_POST['FromDate'] . '" />'; -echo ' '. _('To Sales Date') . ':<input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="10" value="' . $_POST['ToDate'] . '" /></td> - </tr>'; -echo '<tr><td>' . _('Start Date For Distribution') . ':</td> +echo '<tr> + <td>' . _('From Sales Date') . ':</td> + <td><input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="FromDate" size="10" value="' . $_POST['FromDate'] . '" /> '. _('To Sales Date') . ':<input type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ToDate" size="10" value="' . $_POST['ToDate'] . '" /></td> + </tr> + <tr> + <td>' . _('Start Date For Distribution') . ':</td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="DistDate" size="10" value="' . $_POST['DistDate'] . '" /></td> - </tr>'; -echo '<tr><td>' . _('Distribution Period') . ':</td> - <td><select name="Period">'; -echo '<option selected value="weekly">' . _('Weekly') . '</option> - <option value="monthly">' . _('Monthly') .'</option> - </select></td> - </tr>'; -echo '<tr><td>' . _('Number of Periods') .':</td> + </tr> + <tr> + <td>' . _('Distribution Period') . ':</td> + <td><select name="Period"> + <option selected value="weekly">' . _('Weekly') . '</option> + <option value="monthly">' . _('Monthly') .'</option> + </select></td> + </tr> + <tr> + <td>' . _('Number of Periods') .':</td> <td><input type ="text" class="number" name="PeriodNumber" size="4" value="1" /></td> - </tr>'; -echo '<tr><td>' . _('Exclude Total Quantity Less Than') . ':</td> - <td><input type ="text" class="number" name="Excludeqty" size="4" value="1">'; -echo '<tr><td>' . _('Exclude Total Dollars Less Than') . ':</td> - <td><input type ="text" class="number" name="Excludeamt" size="8" value="0"></td> - </tr>'; -echo '<tr><td>' . _('Multiplier') .':</td> + </tr> + <tr> + <td>' . _('Exclude Total Quantity Less Than') . ':</td> + <td><input type ="text" class="number" name="ExcludeQuantity" size="4" value="1" /> + <tr> + <td>' . _('Exclude Total Dollars Less Than') . ':</td> + <td><input type ="text" class="number" name="ExcludeAmount" size="8" value="0" /></td> + </tr> + <tr> + <td>' . _('Multiplier') .':</td> <td><input type="text" class="number" name="Multiplier" size="2" value="1" /></td> - </tr> - <tr> + </tr> + <tr> <td></td> - </tr> - </table>'; -echo '<br /> - <div class=centre> + </tr> + </table> + <br /> + <div class="centre"> <input type="submit" name="submit" value="' . _('Submit') . '" /> </div>'; Modified: trunk/MRPDemandTypes.php =================================================================== --- trunk/MRPDemandTypes.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/MRPDemandTypes.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -58,7 +58,7 @@ $sql = "INSERT INTO mrpdemandtypes (mrpdemandtype, description) VALUES ('" . trim(mb_strtoupper($_POST['MRPDemandType'])) . "', - '" . $_POST['Description'] . "' + '" . DB_escape_string($_POST['Description']) . "' )"; $msg = _('The new demand type has been added to the database'); } @@ -169,7 +169,7 @@ echo '<table class="selection"> <tr> <td>' . _('Demand Type') . ':</td> - <td><input type="text" name="MRPDemandType" size="6" maxlength="5" value="' . $_POST['MRPDemandType'] . '"></td> + <td><input type="text" name="MRPDemandType" size="6" maxlength="5" value="' . $_POST['MRPDemandType'] . '" /></td> </tr>' ; } @@ -177,13 +177,16 @@ $_POST['Description'] = ''; } -echo '<tr><td>' . _('Demand Type Description') . ':</td> - <td><input type="text" name="Description" size="31" maxlength="30" value="' . $_POST['Description'] . '"></td> - </tr> - </table>'; - -echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; - -echo '</form>'; +echo '<tr> + <td>' . _('Demand Type Description') . ':</td> + <td><input type="text" name="Description" size="31" maxlength="30" value="' . $_POST['Description'] . '" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> + </div> + </form>'; + include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/MRPDemands.php =================================================================== --- trunk/MRPDemands.php 2011-10-23 05:41:35 UTC (rev 4730) +++ trunk/MRPDemands.php 2011-10-25 07:38:22 UTC (rev 4731) @@ -136,11 +136,11 @@ //first off validate inputs sensible - if (!is_numeric($_POST['Quantity'])) { + if (!is_numeric(filter_number_format($_POST['Quantity']))) { $InputError = 1; prnMsg(_('Quantity must be numeric'),'error'); } - if ($_POST['Quantity'] <= 0) { + if (filter_number_format($_POST['Quantity']) <= 0) { $InputError = 1; prnMsg(_('Quantity must be greater than 0'),'error'); } @@ -190,7 +190,7 @@ if ($myrow[0]>0) { //If $myrow[0] > 0, it means this is an edit, so do an update - $sql = "UPDATE mrpdemands SET quantity = '" . $_POST['Quantity'] . "', + $sql = "UPDATE mrpdemands SET quantity = '" . filter_number_format($_POST['Quantity']) . "', mrpdemandtype = '" . trim(mb_strtoupper($_POST['MRPDemandtype'])) . "', duedate = '" . $FormatedDuedate . "' WHERE demandid = '" . $DemandID . "'"; @@ -204,7 +204,7 @@ duedate) VALUES ('" . $StockID . "', '" . trim(mb_strtoupper($_POST['MRPDemandtype'])) . "', - '" . $_POST['Quantity'] . "', + '" . filter_number_format($_POST['Quantity']) . "', '" . $FormatedDuedate . "' )"; $msg = _('A new MRP demand record has been added to the database for') . ' ' . $StockID; @@ -277,7 +277,8 @@ mrpdemands.mrpdemandtype, mrpdemands.quantity, mrpdemands.duedate, - stockmaster.description + stockmaster.description, + stockmaster.decimalplaces FROM mrpdemands LEFT JOIN stockmaster on mrpdemands.stockid = stockmaster.stockid" . $where . " ORDER BY mrpdemands.stockid, mrpdemands.duedate"; @@ -294,16 +295,16 @@ <th>' . _('Due Date') . '</th> </tr>'; $ctr = 0; - while ($myrow = DB_fetch_row($result)) { + while ($myrow = DB_fetch_array($result)) { $displaydate = ConvertSQLDate($myrow[4]); $ctr++; - echo '<tr><td>' . $myrow[1] . '</td> - <td>' . $myrow[5] . '</td> - <td>' . $myrow[2] . '</td> - <td>' . $myrow[3] . '</td> + echo '<tr><td>' . $myrow['stockid'] . '</td> + <td>' . $myrow['description'] . '</td> + <td>' . $myrow['mrpdemandtype'] . '</td> + <td>' . locale_number_format($myrow['quantity'],$myrow['decimalplaces']) . '</td> <td>' . $displaydate . '</td> - <td><a href="' .$_SERVER['PHP_SELF'] .'?DemandID=' . $myrow[0] . '&StockID=' . $myrow[1] . '">' . _('Edit') . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?DemandID=' . $myrow[0] . '&StockID=' . $myrow[1].'&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this demand?') . '\');">' . _('Delete') .'</td> + <td><a href="' .$_SERVER['PHP_SELF'] .'?DemandID=' . $myrow['demandid'] . '&StockID=' . $myrow['stockid'] . '">' . _('Edit') . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?DemandID=' . $myrow['demandid'] . '&StockID=' . $myrow['stockid'].'&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this demand?') . '\');">' . _('Delete') .'</td> </tr>'; } @@ -354,21 +355,27 @@ $_POST['DemandID'] = $myrow['demandid']; $_POST['StockID'] = $myrow['stockid']; $_POST['MRPDemandtype'] = $myrow['mrpdemandtype']; - $_POST['Quantity'] = $myrow['quantity']; + $_POST['Quantity'] = locale_number_format($myrow['quantity'],'Variable'); $_POST['Duedate'] = ConvertSQLDate($myrow['duedate']); } - echo '<input type="hidden" name="DemandID" value=' . $_POST['DemandID'] . '>'; - echo '<input type="hidden" name="StockID" value="' . $_POST['StockID'] . '">'; - echo '<table class=selection><tr><td>' ._('Part Number') . ':</td><td>' . $_POST['StockID'] . '</td></tr>'; + echo '<input type="hidden" name="DemandID" value="' . $_POST['DemandID'] . '" />'; + echo '<input type="hidden" name="StockID" value="' . $_POST['StockID'] . '" />'; + echo '<table class="selection"> + <tr> + <td>' ._('Part Number') . ':</td> + <td>' . $_POST['StockID'] . '</td> + </tr>'; } else { if (!isset($_POST['StockID'])) { $_POST['StockID'] = ''; } - echo '<table class=selection><tr> - <td>' . _('Part Number') . ':</td> - <td><input type="Text" name="StockID" size=21 maxlength=20 value="' . $_POST['StockID'] . '"></td></tr>'; + echo '<table class="selection"> + <tr> + <td>' . _('Part Number') . ':</td> + <td><input type="text" name="StockID" size="21" maxlength="20" value="' . $_POST['StockID'] . '" /></td> + </tr>'; } @@ -381,11 +388,11 @@ } echo '<tr><td>' . _('Quantity') . ':</td> - <td><input type="text" name="Quantity" class="number" size="6" maxlength="6" value=' . $_POST['Quantity'] . '></td> + <td><input type="text" name="Quantity" class="number" size="6" maxlength="6" value="' . $_POST['Quantity'] . '" /></td> </tr> <tr> <td>' . _('Due Date') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="Duedate" size="12" maxlength="12" value="' . $_POST['Duedate'] . '"></td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="Duedate" size="12" maxlength="12" value="' . $_POST['Duedate'] . '" /></td> </tr>'; // Generate selections for Demand Type echo '<tr> @@ -404,19 +411,21 @@ } echo $myrow['mrpdemandtype'] . '">' . $myrow['mrpdemandtype'] . ' - ' .$myrow['description'] . '</option>'; } //end while loop - echo '</select></td></tr>'; - - echo '</table>'; - echo '<br /> - <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '" />  '; - echo '<input type="submit" name="listsome" value="' . _('List Selection') . '" />  '; - echo '<input type="submit" name="deletesome" value="' . _('Delete Demand Type') . '" />'; + echo '</select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" />   + <input type="submit" name="listsome" value="' . _('List Selection') . '" />   + <input type="submit" name="deletesome" value="' . _('Delete Demand Type') . '" />'; // If mrpdemand record exists, display option to delete it if ((isset($DemandID)) AND (DB_num_rows($result) > 0)) { echo '<br/><br/><a href=" ' . $_SERVER['PHP_SELF'] . '?delete=yes&StockID='.$StockID.'&DemandID=' . $DemandID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this demand?') . '\');">' . _('Or Delete Record') ; } } - echo '</form>'; + echo '</div> + </form>'; } // End of function display() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-25 07:55:01
|
Revision: 4732 http://web-erp.svn.sourceforge.net/web-erp/?rev=4732&view=rev Author: daintree Date: 2011-10-25 07:54:55 +0000 (Tue, 25 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/MRPReschedules.php trunk/MRPShortages.php trunk/OffersReceived.php trunk/OutstandingGRNs.php Modified: trunk/MRPReschedules.php =================================================================== --- trunk/MRPReschedules.php 2011-10-25 07:38:22 UTC (rev 4731) +++ trunk/MRPReschedules.php 2011-10-25 07:54:55 UTC (rev 4732) @@ -121,23 +121,36 @@ $title=_('MRP Reschedule Reporting'); include('includes/header.inc'); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' - . _('Stock') . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' + . _('Stock') . '" alt="" />' . ' ' . $title . ' + </p>'; - echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"> - <table class=selection>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Print Option') . ':</td><td><select name="Fill">'; - echo '<option selected value="yes">' . _('Print With Alternating Highlighted Lines'); - echo '<option value="no">' . _('Plain Print'); - echo '</select></td></tr>'; - echo '<tr><td>' . _('Selection') . ':</td><td><select name="Selection">'; - echo '<option selected value="All">' . _('All').'</option>'; - echo '<option value="WO">' . _('Work Orders Only').'</option>'; - echo '<option value="PO">' . _('Purchase Orders Only').'</option>'; - echo '</select></td></tr>'; - echo '</table><br />'; - echo '<div class="centre"><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '<br /> + <br /> + <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <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> + <tr> + <td>' . _('Selection') . ':</td> + <td><select name="Selection"> + <option selected value="All">' . _('All').'</option> + <option value="WO">' . _('Work Orders Only').'</option> + <option value="PO">' . _('Purchase Orders Only').'</option> + </select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type=submit name="PrintPDF" value="' . _('Print PDF') . '"> + </div>'; include('includes/footer.inc'); Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-10-25 07:38:22 UTC (rev 4731) +++ trunk/MRPShortages.php 2011-10-25 07:54:55 UTC (rev 4732) @@ -323,7 +323,7 @@ $YPos -=$line_height; if ($_POST['ReportType'] == 'Shortage'){ -$pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('MRP Shortages Report')); + $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('MRP Shortages Report')); }else{ $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('MRP Excess Report')); } @@ -350,8 +350,8 @@ $pdf->addTextWrap(360,$YPos,50,$FontSize,_('Supply'), 'right'); $pdf->addTextWrap(410,$YPos,50,$FontSize,_('Demand'), 'right'); if ($_POST['ReportType'] == 'Shortage'){ -$pdf->addTextWrap(460,$YPos,50,$FontSize,_('Shortage'), 'right'); -$pdf->addTextWrap(510,$YPos,60,$FontSize,_('Ext. Shortage'), 'right'); + $pdf->addTextWrap(460,$YPos,50,$FontSize,_('Shortage'), 'right'); + $pdf->addTextWrap(510,$YPos,60,$FontSize,_('Ext. Shortage'), 'right'); }else{ $pdf->addTextWrap(460,$YPos,50,$FontSize,_('Excess'), 'right'); $pdf->addTextWrap(510,$YPos,60,$FontSize,_('Ext. Excess'), 'right'); Modified: trunk/OffersReceived.php =================================================================== --- trunk/OffersReceived.php 2011-10-25 07:38:22 UTC (rev 4731) +++ trunk/OffersReceived.php 2011-10-25 07:54:55 UTC (rev 4732) @@ -42,52 +42,62 @@ _('Select Supplier') . '" alt="" />' . ' ' . _('Select Supplier') . '</p>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; - echo '<tr><td>'._('Select Supplier').'</td>'; - echo '<td><select name=supplierid>'; + echo '<table class="selection"> + <tr> + <td>'._('Select Supplier').'</td> + <td><select name=supplierid>'; while ($myrow=DB_fetch_array($result)) { echo '<option value="'.$myrow['supplierid'].'">'.$myrow['suppname'].'</option>'; } - echo '</select></td></tr>'; - echo '<tr><td colspan=12><div class="centre"><input type=submit name=select value=' . _('Enter Information') . '></div></td></tr>'; - echo '</table>'; - echo '</form>'; + echo '</select></td> + </tr> + <tr><td colspan="12"> + <div class="centre"> + <input type=submit name=select value=' . _('Enter Information') . '> + </div> + </td> + </tr> + </table> + </form>'; } } if (!isset($_POST['submit']) and isset($_POST['supplierid'])) { $sql = "SELECT offers.offerid, - offers.tenderid, - offers.supplierid, - suppliers.suppname, - offers.stockid, - stockmaster.description, - offers.quantity, - offers.uom, - offers.price, - offers.expirydate, - offers.currcode, - stockmaster.decimalplaces - FROM offers - LEFT JOIN purchorderauth - ON offers.currcode=purchorderauth.currabrev - LEFT JOIN suppliers - ON suppliers.supplierid=offers.supplierid - LEFT JOIN stockmaster - ON stockmaster.stockid=offers.stockid - WHERE purchorderauth.userid='".$_SESSION['UserID']."' - AND offers.expirydate>'".date('Y-m-d')."' - AND offers.supplierid='".$_POST['supplierid']."' - ORDER BY offerid"; + offers.tenderid, + offers.supplierid, + suppliers.suppname, + offers.stockid, + stockmaster.description, + offers.quantity, + offers.uom, + offers.price, + offers.expirydate, + offers.currcode, + stockmaster.decimalplaces, + currencies.decimalplaces AS currdecimalplaces + FROM offers INNER JOIN purchorderauth + ON offers.currcode=purchorderauth.currabrev + INNER JOIN suppliers + ON suppliers.supplierid=offers.supplierid + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + LEFT JOIN stockmaster + ON stockmaster.stockid=offers.stockid + WHERE purchorderauth.userid='" . $_SESSION['UserID'] . "' + AND offers.expirydate>'" . date('Y-m-d') . "' + AND offers.supplierid='" . $_POST['supplierid'] . "' + ORDER BY offerid"; $result=DB_query($sql, $db); echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Supplier Offers') . '" alt="" />' . ' ' . _('Supplier Offers') . '</p>'; + 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 '<table class="selection"> <tr> <th>'._('Offer ID').'</th> <th>'._('Supplier').'</th> @@ -100,7 +110,8 @@ <th>'._('Offer Expires').'</th> <th>'._('Accept').'</th> <th>'._('Reject').'</th> - <th>'._('Defer').'</th></tr>'; + <th>'._('Defer').'</th> + </tr>'; $k=0; while ($myrow=DB_fetch_array($result)) { @@ -114,20 +125,27 @@ echo '<td>'.$myrow['offerid'].'</td> <td>'.$myrow['suppname'].'</td> <td>'.$myrow['description'].'</td> - <td class=number>'.locale_number_format($myrow['quantity'],$myrow['decimalplaces']).'</td> + <td class="number">'.locale_number_format($myrow['quantity'],$myrow['decimalplaces']).'</td> <td>'.$myrow['uom'].'</td> - <td class=number>'.locale_number_format($myrow['price'],2).'</td> - <td class=number>'.locale_number_format($myrow['price']*$myrow['quantity'],2).'</td> + <td class="number">'.locale_number_format($myrow['price'],$myrow['currdecimalplaces']).'</td> + <td class="number">'.locale_number_format($myrow['price']*$myrow['quantity'],$myrow['currdecimalplaces']).'</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> + <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 '</form></table>'; + echo '<tr> + <td colspan="12"> + <div class="centre"> + <input type="submit" name="submit" value=' . _('Enter Information') . '> + </div> + </td> + </tr> + </form> + </table>'; } else if(isset($_POST['submit']) and isset($_POST['supplierid'])) { include ('includes/htmlMimeMail.php'); $accepts=array(); @@ -196,24 +214,22 @@ $myrow=DB_fetch_array($result); $MailText.=$myrow['description']."\t"._('Quantity').' '.$myrow['quantity']."\t"._('Price').' '. locale_number_format($myrow['price'])."\n"; - $sql="INSERT INTO purchorderdetails ( - orderno, - itemcode, - deliverydate, - itemdescription, - unitprice, - actprice, - quantityord, - suppliersunit) - VALUES ( - '".$OrderNo."', - '".$myrow['stockid']."', - '".date('Y-m-d')."', - '".$myrow['description']."', - '".$myrow['price']."', - '".$myrow['price']."', - '".$myrow['quantity']."', - '".$myrow['uom']."')"; + $sql="INSERT INTO purchorderdetails (orderno, + itemcode, + deliverydate, + itemdescription, + unitprice, + actprice, + quantityord, + suppliersunit) + VALUES ('".$OrderNo."', + '".$myrow['stockid']."', + '".date('Y-m-d')."', + '".$myrow['description']."', + '".$myrow['price']."', + '".$myrow['price']."', + '".$myrow['quantity']."', + '".$myrow['uom']."')"; $result=DB_query($sql, $db); $sql="DELETE FROM offers WHERE offerid='".$AcceptID."'"; $result=DB_query($sql, $db); Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2011-10-25 07:38:22 UTC (rev 4731) +++ trunk/OutstandingGRNs.php 2011-10-25 07:54:55 UTC (rev 4732) @@ -164,13 +164,20 @@ <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Supplier Code') . ':</td> - <td><input type="text" name="FromCriteria" value="0"></td></tr>'; - echo '<tr><td>' . _('To Supplier Code'). ':</td> - <td><input type="text" name="ToCriteria" value="zzzzzzz"></td></tr>'; + echo '<tr> + <td>' . _('From Supplier Code') . ':</td> + <td><input type="text" name="FromCriteria" value="0"></td> + </tr> + <tr> + <td>' . _('To Supplier Code'). ':</td> + <td><input type="text" name="ToCriteria" value="zzzzzzz"></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type=Submit Name="PrintPDF" value="' . _('Print PDF') . '"> + </div>'; - echo '</table><br /><div class="centre"><input type=Submit Name="PrintPDF" value="' . _('Print PDF') . '"></div>'; - include('includes/footer.inc'); } /*end of else not PrintPDF */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-25 07:55:01
|
Revision: 4732 http://web-erp.svn.sourceforge.net/web-erp/?rev=4732&view=rev Author: daintree Date: 2011-10-25 07:54:55 +0000 (Tue, 25 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/MRPReschedules.php trunk/MRPShortages.php trunk/OffersReceived.php trunk/OutstandingGRNs.php Modified: trunk/MRPReschedules.php =================================================================== --- trunk/MRPReschedules.php 2011-10-25 07:38:22 UTC (rev 4731) +++ trunk/MRPReschedules.php 2011-10-25 07:54:55 UTC (rev 4732) @@ -121,23 +121,36 @@ $title=_('MRP Reschedule Reporting'); include('includes/header.inc'); - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' - . _('Stock') . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' + . _('Stock') . '" alt="" />' . ' ' . $title . ' + </p>'; - echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"> - <table class=selection>'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('Print Option') . ':</td><td><select name="Fill">'; - echo '<option selected value="yes">' . _('Print With Alternating Highlighted Lines'); - echo '<option value="no">' . _('Plain Print'); - echo '</select></td></tr>'; - echo '<tr><td>' . _('Selection') . ':</td><td><select name="Selection">'; - echo '<option selected value="All">' . _('All').'</option>'; - echo '<option value="WO">' . _('Work Orders Only').'</option>'; - echo '<option value="PO">' . _('Purchase Orders Only').'</option>'; - echo '</select></td></tr>'; - echo '</table><br />'; - echo '<div class="centre"><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '<br /> + <br /> + <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <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> + <tr> + <td>' . _('Selection') . ':</td> + <td><select name="Selection"> + <option selected value="All">' . _('All').'</option> + <option value="WO">' . _('Work Orders Only').'</option> + <option value="PO">' . _('Purchase Orders Only').'</option> + </select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type=submit name="PrintPDF" value="' . _('Print PDF') . '"> + </div>'; include('includes/footer.inc'); Modified: trunk/MRPShortages.php =================================================================== --- trunk/MRPShortages.php 2011-10-25 07:38:22 UTC (rev 4731) +++ trunk/MRPShortages.php 2011-10-25 07:54:55 UTC (rev 4732) @@ -323,7 +323,7 @@ $YPos -=$line_height; if ($_POST['ReportType'] == 'Shortage'){ -$pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('MRP Shortages Report')); + $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('MRP Shortages Report')); }else{ $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('MRP Excess Report')); } @@ -350,8 +350,8 @@ $pdf->addTextWrap(360,$YPos,50,$FontSize,_('Supply'), 'right'); $pdf->addTextWrap(410,$YPos,50,$FontSize,_('Demand'), 'right'); if ($_POST['ReportType'] == 'Shortage'){ -$pdf->addTextWrap(460,$YPos,50,$FontSize,_('Shortage'), 'right'); -$pdf->addTextWrap(510,$YPos,60,$FontSize,_('Ext. Shortage'), 'right'); + $pdf->addTextWrap(460,$YPos,50,$FontSize,_('Shortage'), 'right'); + $pdf->addTextWrap(510,$YPos,60,$FontSize,_('Ext. Shortage'), 'right'); }else{ $pdf->addTextWrap(460,$YPos,50,$FontSize,_('Excess'), 'right'); $pdf->addTextWrap(510,$YPos,60,$FontSize,_('Ext. Excess'), 'right'); Modified: trunk/OffersReceived.php =================================================================== --- trunk/OffersReceived.php 2011-10-25 07:38:22 UTC (rev 4731) +++ trunk/OffersReceived.php 2011-10-25 07:54:55 UTC (rev 4732) @@ -42,52 +42,62 @@ _('Select Supplier') . '" alt="" />' . ' ' . _('Select Supplier') . '</p>'; echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; - echo '<tr><td>'._('Select Supplier').'</td>'; - echo '<td><select name=supplierid>'; + echo '<table class="selection"> + <tr> + <td>'._('Select Supplier').'</td> + <td><select name=supplierid>'; while ($myrow=DB_fetch_array($result)) { echo '<option value="'.$myrow['supplierid'].'">'.$myrow['suppname'].'</option>'; } - echo '</select></td></tr>'; - echo '<tr><td colspan=12><div class="centre"><input type=submit name=select value=' . _('Enter Information') . '></div></td></tr>'; - echo '</table>'; - echo '</form>'; + echo '</select></td> + </tr> + <tr><td colspan="12"> + <div class="centre"> + <input type=submit name=select value=' . _('Enter Information') . '> + </div> + </td> + </tr> + </table> + </form>'; } } if (!isset($_POST['submit']) and isset($_POST['supplierid'])) { $sql = "SELECT offers.offerid, - offers.tenderid, - offers.supplierid, - suppliers.suppname, - offers.stockid, - stockmaster.description, - offers.quantity, - offers.uom, - offers.price, - offers.expirydate, - offers.currcode, - stockmaster.decimalplaces - FROM offers - LEFT JOIN purchorderauth - ON offers.currcode=purchorderauth.currabrev - LEFT JOIN suppliers - ON suppliers.supplierid=offers.supplierid - LEFT JOIN stockmaster - ON stockmaster.stockid=offers.stockid - WHERE purchorderauth.userid='".$_SESSION['UserID']."' - AND offers.expirydate>'".date('Y-m-d')."' - AND offers.supplierid='".$_POST['supplierid']."' - ORDER BY offerid"; + offers.tenderid, + offers.supplierid, + suppliers.suppname, + offers.stockid, + stockmaster.description, + offers.quantity, + offers.uom, + offers.price, + offers.expirydate, + offers.currcode, + stockmaster.decimalplaces, + currencies.decimalplaces AS currdecimalplaces + FROM offers INNER JOIN purchorderauth + ON offers.currcode=purchorderauth.currabrev + INNER JOIN suppliers + ON suppliers.supplierid=offers.supplierid + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + LEFT JOIN stockmaster + ON stockmaster.stockid=offers.stockid + WHERE purchorderauth.userid='" . $_SESSION['UserID'] . "' + AND offers.expirydate>'" . date('Y-m-d') . "' + AND offers.supplierid='" . $_POST['supplierid'] . "' + ORDER BY offerid"; $result=DB_query($sql, $db); echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Supplier Offers') . '" alt="" />' . ' ' . _('Supplier Offers') . '</p>'; + 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 '<table class="selection"> <tr> <th>'._('Offer ID').'</th> <th>'._('Supplier').'</th> @@ -100,7 +110,8 @@ <th>'._('Offer Expires').'</th> <th>'._('Accept').'</th> <th>'._('Reject').'</th> - <th>'._('Defer').'</th></tr>'; + <th>'._('Defer').'</th> + </tr>'; $k=0; while ($myrow=DB_fetch_array($result)) { @@ -114,20 +125,27 @@ echo '<td>'.$myrow['offerid'].'</td> <td>'.$myrow['suppname'].'</td> <td>'.$myrow['description'].'</td> - <td class=number>'.locale_number_format($myrow['quantity'],$myrow['decimalplaces']).'</td> + <td class="number">'.locale_number_format($myrow['quantity'],$myrow['decimalplaces']).'</td> <td>'.$myrow['uom'].'</td> - <td class=number>'.locale_number_format($myrow['price'],2).'</td> - <td class=number>'.locale_number_format($myrow['price']*$myrow['quantity'],2).'</td> + <td class="number">'.locale_number_format($myrow['price'],$myrow['currdecimalplaces']).'</td> + <td class="number">'.locale_number_format($myrow['price']*$myrow['quantity'],$myrow['currdecimalplaces']).'</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> + <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 '</form></table>'; + echo '<tr> + <td colspan="12"> + <div class="centre"> + <input type="submit" name="submit" value=' . _('Enter Information') . '> + </div> + </td> + </tr> + </form> + </table>'; } else if(isset($_POST['submit']) and isset($_POST['supplierid'])) { include ('includes/htmlMimeMail.php'); $accepts=array(); @@ -196,24 +214,22 @@ $myrow=DB_fetch_array($result); $MailText.=$myrow['description']."\t"._('Quantity').' '.$myrow['quantity']."\t"._('Price').' '. locale_number_format($myrow['price'])."\n"; - $sql="INSERT INTO purchorderdetails ( - orderno, - itemcode, - deliverydate, - itemdescription, - unitprice, - actprice, - quantityord, - suppliersunit) - VALUES ( - '".$OrderNo."', - '".$myrow['stockid']."', - '".date('Y-m-d')."', - '".$myrow['description']."', - '".$myrow['price']."', - '".$myrow['price']."', - '".$myrow['quantity']."', - '".$myrow['uom']."')"; + $sql="INSERT INTO purchorderdetails (orderno, + itemcode, + deliverydate, + itemdescription, + unitprice, + actprice, + quantityord, + suppliersunit) + VALUES ('".$OrderNo."', + '".$myrow['stockid']."', + '".date('Y-m-d')."', + '".$myrow['description']."', + '".$myrow['price']."', + '".$myrow['price']."', + '".$myrow['quantity']."', + '".$myrow['uom']."')"; $result=DB_query($sql, $db); $sql="DELETE FROM offers WHERE offerid='".$AcceptID."'"; $result=DB_query($sql, $db); Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2011-10-25 07:38:22 UTC (rev 4731) +++ trunk/OutstandingGRNs.php 2011-10-25 07:54:55 UTC (rev 4732) @@ -164,13 +164,20 @@ <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Supplier Code') . ':</td> - <td><input type="text" name="FromCriteria" value="0"></td></tr>'; - echo '<tr><td>' . _('To Supplier Code'). ':</td> - <td><input type="text" name="ToCriteria" value="zzzzzzz"></td></tr>'; + echo '<tr> + <td>' . _('From Supplier Code') . ':</td> + <td><input type="text" name="FromCriteria" value="0"></td> + </tr> + <tr> + <td>' . _('To Supplier Code'). ':</td> + <td><input type="text" name="ToCriteria" value="zzzzzzz"></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type=Submit Name="PrintPDF" value="' . _('Print PDF') . '"> + </div>'; - echo '</table><br /><div class="centre"><input type=Submit Name="PrintPDF" value="' . _('Print PDF') . '"></div>'; - include('includes/footer.inc'); } /*end of else not PrintPDF */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-28 05:07:11
|
Revision: 4733 http://web-erp.svn.sourceforge.net/web-erp/?rev=4733&view=rev Author: daintree Date: 2011-10-28 05:07:04 +0000 (Fri, 28 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/OrderDetails.php trunk/OutstandingGRNs.php trunk/Payments.php Modified: trunk/OrderDetails.php =================================================================== --- trunk/OrderDetails.php 2011-10-25 07:54:55 UTC (rev 4732) +++ trunk/OrderDetails.php 2011-10-28 05:07:04 UTC (rev 4733) @@ -52,67 +52,74 @@ $GetOrdHdrResult = DB_query($OrderHeaderSQL,$db, $ErrMsg, $DbgMsg); if (DB_num_rows($GetOrdHdrResult)==1) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Order Details') . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Order Details') . '" alt="" />' . ' ' . $title . ' + </p>'; $myrow = DB_fetch_array($GetOrdHdrResult); $CurrDecimalPlaces = $myrow['decimalplaces']; - echo '<table class="selection">'; - echo '<tr><th colspan=4><font color=blue>'._('Order Header Details For Order No').' '.$_GET['OrderNumber'].'</font></th></tr>'; - echo '<tr> - <th style="text-align: left">' . _('Customer Code') . ':</th> - <td class="OddTableRows"><font><a href="' . $rootpath . '/SelectCustomer.php?Select=' . $myrow['debtorno'] . '">' . $myrow['debtorno'] . '</a></td> - <th style="text-align: left">' . _('Customer Name') . ':</th><td><font>' . $myrow['name'] . '</td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Customer Reference') . ':</th> - <td class="OddTableRows"><font>' . $myrow['customerref'] . '</font></td> - <th style="text-align: left">' . _('Deliver To') . ':</th><td><font>' . $myrow['deliverto'] . '</td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Ordered On') . ':</th> - <td class="OddTableRows"><font>' . ConvertSQLDate($myrow['orddate']) . '</font></td> - <th style="text-align: left">' . _('Delivery Address 1') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd1'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Requested Delivery') . ':</th> - <td class="OddTableRows"><font>' . ConvertSQLDate($myrow['deliverydate']) . '</font></td> - <th style="text-align: left">' . _('Delivery Address 2') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd2'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left"h>' . _('Order Currency') . ':</th> - <td class="OddTableRows"><font>' . $myrow['currcode'] . '</font></td> - <th style="text-align: left">' . _('Delivery Address 3') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd3'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Deliver From Location') . ':</th> - <td class="OddTableRows"><font>' . $myrow['fromstkloc'] . '</font></td> - <th style="text-align: left">' . _('Delivery Address 4') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd4'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Telephone') . ':</th> - <td class="OddTableRows"><font>' . $myrow['contactphone'] . '</font></td> - <th style="text-align: left">' . _('Delivery Address 5') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd5'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Email') . ':</th> - <td class="OddTableRows"><font><a href="mailto:' . $myrow['contactemail'] . '">' . $myrow['contactemail'] . '</a></font></td> - <th style="text-align: left">' . _('Delivery Address 6') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd6'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Freight Cost') . ':</th> - <td class="OddTableRows"><font>' . $myrow['freightcost'] . '</font></td> - </tr>'; - echo '<tr><th style="text-align: left">'._('Comments'). ': '; - echo '</th><td colspan=3>'.$myrow['comments'] . '</td></tr>'; - echo '</table>'; + echo '<table class="selection"> + <tr> + <th colspan="4"><font color="blue">'._('Order Header Details For Order No').' '.$_GET['OrderNumber'].'</font></th> + </tr> + <tr> + <th style="text-align: left">' . _('Customer Code') . ':</th> + <td class="OddTableRows"><a href="' . $rootpath . '/SelectCustomer.php?Select=' . $myrow['debtorno'] . '">' . $myrow['debtorno'] . '</a></td> + <th style="text-align: left">' . _('Customer Name') . ':</th> + <th>' . $myrow['name'] . '</th> + </tr> + <tr> + <th style="text-align: left">' . _('Customer Reference') . ':</th> + <td class="OddTableRows">' . $myrow['customerref'] . '</td> + <th style="text-align: left">' . _('Deliver To') . ':</th> + <th>' . $myrow['deliverto'] . '</th> + </tr> + <tr> + <th style="text-align: left">' . _('Ordered On') . ':</th> + <td class="OddTableRows">' . ConvertSQLDate($myrow['orddate']) . '</td> + <th style="text-align: left">' . _('Delivery Address 1') . ':</th> + <td class="OddTableRows">' . $myrow['deladd1'] . '</td> + </tr> + <tr> + <th style="text-align: left">' . _('Requested Delivery') . ':</th> + <td class="OddTableRows">' . ConvertSQLDate($myrow['deliverydate']) . '</td> + <th style="text-align: left">' . _('Delivery Address 2') . ':</th> + <td class="OddTableRows">' . $myrow['deladd2'] . '</td> + </tr> + <tr> + <th style="text-align: left"h>' . _('Order Currency') . ':</th> + <td class="OddTableRows">' . $myrow['currcode'] . '</td> + <th style="text-align: left">' . _('Delivery Address 3') . ':</th> + <td class="OddTableRows">' . $myrow['deladd3'] . '</td> + </tr> + <tr> + <th style="text-align: left">' . _('Deliver From Location') . ':</th> + <td class="OddTableRows">' . $myrow['fromstkloc'] . '</td> + <th style="text-align: left">' . _('Delivery Address 4') . ':</th> + <td class="OddTableRows">' . $myrow['deladd4'] . '</td> + </tr> + <tr> + <th style="text-align: left">' . _('Telephone') . ':</th> + <td class="OddTableRows">' . $myrow['contactphone'] . '</td> + <th style="text-align: left">' . _('Delivery Address 5') . ':</th> + <td class="OddTableRows">' . $myrow['deladd5'] . '</td> + </tr> + <tr> + <th style="text-align: left">' . _('Email') . ':</th> + <td class="OddTableRows"><a href="mailto:' . $myrow['contactemail'] . '">' . $myrow['contactemail'] . '</a></td> + <th style="text-align: left">' . _('Delivery Address 6') . ':</th> + <td class="OddTableRows">' . $myrow['deladd6'] . '</td> + </tr> + <tr> + <th style="text-align: left">' . _('Freight Cost') . ':</th> + <td class="OddTableRows">' . $myrow['freightcost'] . '</td> + </tr> + <tr> + <th style="text-align: left">'._('Comments'). ': </th> + <td colspan="3">'.$myrow['comments'] . '</td> + </tr> + </table>'; } /*Now get the line items */ @@ -146,9 +153,12 @@ $OrderTotalVolume = 0; $OrderTotalWeight = 0; - echo '<br /><table cellpadding=2 colspan=9 class=selection>'; - echo '<tr><th colspan=9><font color=blue>'._('Order Line Details For Order No').' '.$_GET['OrderNumber'].'</font></th></tr>'; - echo '<tr> + echo '<br /> + <table class="selection"> + <tr> + <th colspan="9"><font color="blue">'._('Order Line Details For Order No').' '.$_GET['OrderNumber'].'</font></th> + </tr> + <tr> <th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> <th>' . _('Quantity') . '</th> @@ -178,18 +188,18 @@ echo '<td>' . $myrow['stkcode'] . '</td> <td>' . $myrow['description'] . '</td> - <td class=number>' . $myrow['quantity'] . '</td> + <td class="number">' . $myrow['quantity'] . '</td> <td>' . $myrow['units'] . '</td> - <td class=number>' . locale_number_format($myrow['unitprice'],$CurrDecimalPlaces) . '</td> - <td class=number>' . locale_number_format(($myrow['discountpercent'] * 100),2) . '%' . '</td> - <td class=number>' . locale_number_format($myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent']),$CurrDecimalPlaces) . '</td> - <td class=number>' . locale_number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($myrow['unitprice'],$CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format(($myrow['discountpercent'] * 100),2) . '%' . '</td> + <td class="number">' . locale_number_format($myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent']),$CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']) . '</td> <td>' . $DisplayActualDeliveryDate . '</td> </tr>'; - $OrderTotal = $OrderTotal + $myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent']); - $OrderTotalVolume = $OrderTotalVolume + $myrow['quantity'] * $myrow['volume']; - $OrderTotalWeight = $OrderTotalWeight + $myrow['quantity'] * $myrow['kgs']; + $OrderTotal += ($myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent'])); + $OrderTotalVolume += ($myrow['quantity'] * $myrow['volume']); + $OrderTotalWeight += ($myrow['quantity'] * $myrow['kgs']); } $DisplayTotal = locale_number_format($OrderTotal,$CurrDecimalPlaces); @@ -197,12 +207,13 @@ $DisplayWeight = locale_number_format($OrderTotalWeight,2); echo '<tr> - <td colspan=5 class=number><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> - <td colspan=2 class=number>' . $DisplayTotal . '</td> + <td colspan="5" class="number"><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> + <td colspan="2" class="number">' . $DisplayTotal . '</td> </tr> - </table>'; + </table>'; - echo '<br /><table class=selection> + echo '<br /> + <table class="selection"> <tr> <td>' . _('Total Weight') . ':</td> <td>' . $DisplayWeight . '</td> Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2011-10-25 07:54:55 UTC (rev 4732) +++ trunk/OutstandingGRNs.php 2011-10-28 05:07:04 UTC (rev 4733) @@ -160,22 +160,22 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr> <td>' . _('From Supplier Code') . ':</td> - <td><input type="text" name="FromCriteria" value="0"></td> + <td><input type="text" name="FromCriteria" value="0" /></td> </tr> <tr> <td>' . _('To Supplier Code'). ':</td> - <td><input type="text" name="ToCriteria" value="zzzzzzz"></td> + <td><input type="text" name="ToCriteria" value="zzzzzzz" /></td> </tr> </table> <br /> <div class="centre"> - <input type=Submit Name="PrintPDF" value="' . _('Print PDF') . '"> + <input type=Submit Name="PrintPDF" value="' . _('Print PDF') . '" /> </div>'; include('includes/footer.inc'); Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-10-25 07:54:55 UTC (rev 4732) +++ trunk/Payments.php 2011-10-28 05:07:04 UTC (rev 4733) @@ -36,11 +36,13 @@ $BankAccountEmpty=FALSE; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Payment Entry') - . '" alt="" />' . ' ' . _('Payment Entry') . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Payment Entry') +. '" alt="" />' . ' ' . _('Payment Entry') . ' + </p>'; echo '<div class="page_help_text">' . _('Use this screen to enter payments FROM your bank account. <br />Note: To enter a payment FROM a supplier, first select the Supplier, click Enter a Payment to, or Receipt from the Supplier, and use a negative Payment amount on this form.') . '</div> - <br /> - <div class="centre">'; + <br /> + <div class="centre">'; if (isset($_GET['SupplierID'])){ /*The page was called with a supplierID check it is valid and default the inputs for Supplier Name and currency of payment */ @@ -94,7 +96,7 @@ $FactorResult = DB_query($factorsql, $db); $myfactorrow = DB_fetch_array($FactorResult); - $_SESSION['PaymentDetail']->SuppName = $myrow['suppname'] . _(' care of ') . $myfactorrow['coyname']; + $_SESSION['PaymentDetail']->SuppName = $myrow['suppname'] . ' ' . _('care of') . ' ' . $myfactorrow['coyname']; $_SESSION['PaymentDetail']->Address1 = $myfactorrow['address1']; $_SESSION['PaymentDetail']->Address2 = $myfactorrow['address2']; $_SESSION['PaymentDetail']->Address3 = $myfactorrow['address3']; @@ -150,12 +152,12 @@ if ($_POST['Currency']==$_SESSION['PaymentDetail']->AccountCurrency){ $_POST['ExRate']=1; - $_SESSION['PaymentDetail']->ExRate=$_POST['ExRate']; //ex rate between payment currency and account currency + $_SESSION['PaymentDetail']->ExRate=filter_number_format($_POST['ExRate']); //ex rate between payment currency and account currency $SuggestedExRate=1; } if ($_SESSION['PaymentDetail']->AccountCurrency==$_SESSION['CompanyRecord']['currencydefault']){ $_POST['FunctionalExRate']=1; - $_SESSION['PaymentDetail']->FunctionalExRate=$_POST['FunctionalExRate']; + $_SESSION['PaymentDetail']->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); $SuggestedFunctionalExRate =1; $SuggestedExRate = $tableExRate; @@ -196,7 +198,7 @@ } } if (isset($_POST['Discount']) AND $_POST['Discount']!=''){ - $_SESSION['PaymentDetail']->Discount=$_POST['Discount']; + $_SESSION['PaymentDetail']->Discount=filter_number_format($_POST['Discount']); } else { if (!isset($_SESSION['PaymentDetail']->Discount)) { $_SESSION['PaymentDetail']->Discount=0; @@ -450,7 +452,7 @@ $DbgMsg = _('Cannot update the supplier record for the date of the last payment made using the SQL'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - $_SESSION['PaymentDetail']->Narrative = $_SESSION['PaymentDetail']->SupplierID . "-" . $_SESSION['PaymentDetail']->Narrative; + $_SESSION['PaymentDetail']->Narrative = $_SESSION['PaymentDetail']->SupplierID . '-' . $_SESSION['PaymentDetail']->Narrative; if ($_SESSION['CompanyRecord']['gllink_creditors']==1){ /* then do the supplier control GLTrans */ /* Now debit creditors account with payment + discount */ @@ -507,14 +509,14 @@ periodno, account, narrative, - amount) "; - $SQL = $SQL . "VALUES ('" . $Transtype . "', - '" . $TransNo . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - '" . $PeriodNo . "', - '" . $_SESSION['PaymentDetail']->Account . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . (-$_SESSION['PaymentDetail']->Amount/$_SESSION['PaymentDetail']->ExRate/$_SESSION['PaymentDetail']->FunctionalExRate) . "')"; + amount) + VALUES ('" . $Transtype . "', + '" . $TransNo . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . $PeriodNo . "', + '" . $_SESSION['PaymentDetail']->Account . "', + '" . $_SESSION['PaymentDetail']->Narrative . "', + '" . (-$_SESSION['PaymentDetail']->Amount/$_SESSION['PaymentDetail']->ExRate/$_SESSION['PaymentDetail']->FunctionalExRate) . "')"; $ErrMsg = _('Cannot insert a GL transaction for the bank account credit because'); $DbgMsg = _('Cannot insert a GL transaction for the bank account credit using the SQL'); @@ -534,8 +536,8 @@ transdate, banktranstype, amount, - currcode) "; - $SQL= $SQL . "VALUES ('" . $TransNo . "', + currcode) + VALUES ('" . $TransNo . "', '" . $Transtype . "', '" . $_SESSION['PaymentDetail']->Account . "', '" . $_SESSION['PaymentDetail']->Narrative . "', @@ -561,18 +563,17 @@ transdate, banktranstype, amount, - currcode) "; - $SQL= $SQL . "VALUES ('" . $TransNo . "', - '" . $Transtype . "', - '" . $_SESSION['PaymentDetail']->Account . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . $_SESSION['PaymentDetail']->ExRate . "', - '" . $_SESSION['PaymentDetail']->FunctionalExRate . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - '" . $_SESSION['PaymentDetail']->Paymenttype . "', - '" . -$PaymentItem->Amount . "', - '" . $_SESSION['PaymentDetail']->Currency . "' - )"; + currcode) + VALUES ('" . $TransNo . "', + '" . $Transtype . "', + '" . $_SESSION['PaymentDetail']->Account . "', + '" . $_SESSION['PaymentDetail']->Narrative . "', + '" . $_SESSION['PaymentDetail']->ExRate . "', + '" . $_SESSION['PaymentDetail']->FunctionalExRate . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . $_SESSION['PaymentDetail']->Paymenttype . "', + '" . -$PaymentItem->Amount . "', + '" . $_SESSION['PaymentDetail']->Currency . "' )"; $ErrMsg = _('Cannot insert a bank transaction because'); $DbgMsg = _('Cannot insert a bank transaction using the SQL'); @@ -635,7 +636,7 @@ prnMsg( _('The Cheque/Voucher number has already been used') . ' - ' . _('This GL analysis item could not be added'),'error'); } else { $myrow = DB_fetch_array($Result); - $_SESSION['PaymentDetail']->add_to_glanalysis($_POST['GLAmount'], + $_SESSION['PaymentDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), $_POST['GLNarrative'], $_POST['GLManualCode'], $myrow['accountname'], @@ -651,7 +652,7 @@ $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'], + $_SESSION['PaymentDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), $_POST['GLNarrative'], $_POST['GLCode'], $myrow['accountname'], @@ -675,7 +676,10 @@ $_POST['DatePaid'] = ''; } -if (isset($_POST['DatePaid']) AND ($_POST['DatePaid']=='' OR !Is_Date($_SESSION['PaymentDetail']->DatePaid))){ +if (isset($_POST['DatePaid']) + AND ($_POST['DatePaid']=='' + OR !Is_Date($_SESSION['PaymentDetail']->DatePaid))){ + $_POST['DatePaid']= Date($_SESSION['DefaultDateFormat']); $_SESSION['PaymentDetail']->DatePaid = $_POST['DatePaid']; } @@ -706,8 +710,7 @@ } } - -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class="selection">'; @@ -734,11 +737,15 @@ $DbgMsg = _('The SQL used to retrieve the bank accounts was'); $AccountsResults = DB_query($SQL,$db,$ErrMsg,$DbgMsg); -echo '<tr><td>' . _('Bank Account') . ':</td> +echo '<tr> + <td>' . _('Bank Account') . ':</td> <td><select name="BankAccount" onChange="ReloadForm(UpdateHeader)">'; if (DB_num_rows($AccountsResults)==0){ - echo '</select></td></tr></table><p>'; + echo '</select></td> + </tr> + </table> + <p />'; prnMsg( _('Bank Accounts have not yet been defined. You must first') . ' <a href="' . $rootpath . '/BankAccounts.php">' . _('define the bank accounts') . '</a> ' . _('and general ledger accounts to be affected'),'warn'); include('includes/footer.inc'); exit; @@ -752,11 +759,13 @@ echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } -echo '<tr><td>' . _('Date Paid') . ':</td> - <td><input type="text" name="DatePaid" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['PaymentDetail']->DatePaid . '"></td> +echo '<tr> + <td>' . _('Date Paid') . ':</td> + <td><input type="text" name="DatePaid" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['PaymentDetail']->DatePaid . '" /></td> </tr>'; @@ -767,7 +776,8 @@ $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; prnMsg( _('No currencies are defined yet. Payments cannot be entered until a currency is defined'),'error'); } else { while ($myrow=DB_fetch_array($result)){ @@ -777,17 +787,22 @@ echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } } - echo '</select></td><td><i>' . _('The transaction currency does not need to be the same as the bank account currency') . '</i></td></tr>'; + echo '</select></td> + <td><i>' . _('The transaction currency does not need to be the same as the bank account currency') . '</i></td> + </tr>'; } } else { /*its a supplier payment so it must be in the suppliers currency */ - echo '<tr><td>' . _('Supplier Currency') . ':</td><td>' . $_SESSION['PaymentDetail']->Currency . '</td></tr>'; - echo '<input type="hidden" name="Currency" value="' . $_SESSION['PaymentDetail']->Currency . '">'; + echo '<tr> + <td>' . _('Supplier Currency') . ':</td> + <td>' . $_SESSION['PaymentDetail']->Currency . '</td> + </tr>'; + echo '<input type="hidden" name="Currency" value="' . $_SESSION['PaymentDetail']->Currency . '" />'; /*get the default rate from the currency table if it has not been set */ if (!isset($_POST['ExRate']) OR $_POST['ExRate']==''){ $SQL = "SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency ."'"; $Result=DB_query($SQL,$db); $myrow=DB_fetch_row($Result); - $_POST['ExRate']=$myrow[0]; + $_POST['ExRate']=locale_number_format($myrow[0],'Variable'); } } @@ -801,33 +816,38 @@ } if ($_SESSION['PaymentDetail']->AccountCurrency!=$_SESSION['PaymentDetail']->Currency AND isset($_SESSION['PaymentDetail']->AccountCurrency)){ if (isset($SuggestedExRate)){ - $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,4) . '</b>'; + $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,6) . '</b>'; } else { $SuggestedExRateText =''; } if ($_POST['ExRate']==1 AND isset($SuggestedExRate)){ $_POST['ExRate'] = $SuggestedExRate; } - echo '<tr><td>' . _('Payment Exchange Rate') . ':</td> - <td><input class=number type="text" name="ExRate" maxlength=10 size=12 value="' . $_POST['ExRate'] . '"></td> - <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the payment') . '. 1 ' . $_SESSION['PaymentDetail']->AccountCurrency . ' = ? ' . $_SESSION['PaymentDetail']->Currency . '</i></td></tr>'; + echo '<tr> + <td>' . _('Payment Exchange Rate') . ':</td> + <td><input class="number" type="text" name="ExRate" maxlength="10" size="12" value="' . $_POST['ExRate'] . '" /></td> + <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the payment') . '. 1 ' . $_SESSION['PaymentDetail']->AccountCurrency . ' = ? ' . $_SESSION['PaymentDetail']->Currency . '</i></td> + </tr>'; } if ($_SESSION['PaymentDetail']->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] AND isset($_SESSION['PaymentDetail']->AccountCurrency)){ if (isset($SuggestedFunctionalExRate)){ - $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,4) . '</b>'; + $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,6) . '</b>'; } else { $SuggestedFunctionalExRateText =''; } if ($_POST['FunctionalExRate']==1 AND isset($SuggestedFunctionalExRate)){ - $_POST['FunctionalExRate'] = $SuggestedFunctionalExRate; + $_POST['FunctionalExRate'] = locale_number_format($SuggestedFunctionalExRate,'Variable'); } - echo '<tr><td>' . _('Functional Exchange Rate') . ':</td> - <td><input type="text" name="FunctionalExRate" maxlength=10 size=12 value="' . $_POST['FunctionalExRate'] . '" /></td> - <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail']->AccountCurrency . '</i></td></tr>'; + echo '<tr> + <td>' . _('Functional Exchange Rate') . ':</td> + <td><input type="text" name="FunctionalExRate" maxlength="10" size="12" value="' . $_POST['FunctionalExRate'] . '" /></td> + <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail']->AccountCurrency . '</i></td> + </tr>'; } -echo '<tr><td>' . _('Payment type') . ':</td> +echo '<tr> + <td>' . _('Payment type') . ':</td> <td><select name="Paymenttype">'; include('includes/GetPaymentMethods.php'); @@ -842,13 +862,15 @@ echo '<option value="' . $PaytType . '">' . $PaytType . '</option>'; } } //end foreach -echo '</select></td></tr>'; +echo '</select></td> + </tr>'; if (!isset($_POST['ChequeNum'])) { $_POST['ChequeNum']=''; } -echo '<tr><td>' . _('Cheque Number') . ':</td> +echo '<tr> + <td>' . _('Cheque Number') . ':</td> <td><input type="text" name="ChequeNum" maxlength="8" size="10" value="' . $_POST['ChequeNum'] . '" /> ' . _('(if using pre-printed stationery)') . '</td> </tr>'; @@ -856,10 +878,13 @@ $_POST['Narrative']=''; } -echo '<tr><td>' . _('Reference / Narrative') . ':</td> - <td colspan=2><input type="text" name="Narrative" maxlength=80 size=82 value="' . $_POST['Narrative'] . '" /> ' . _('(Max. length 80 characters)') . '</td> - </tr>'; -echo '<tr><td colspan=3><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '" /></td></tr>'; +echo '<tr> + <td>' . _('Reference / Narrative') . ':</td> + <td colspan="2"><input type="text" name="Narrative" maxlength="80" size="82" value="' . $_POST['Narrative'] . '" /> ' . _('(Max. length 80 characters)') . '</td> + </tr>'; +echo '<tr> + <td colspan="3"><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '" /></td> + </tr>'; echo '</table><br />'; @@ -872,7 +897,9 @@ echo '<tr><th colspan="2"><font size="3" color="blue">' . _('General Ledger Payment Analysis Entry') . '</font></th></tr>'; //Select the tag - echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; + echo '<tr> + <td>' . _('Select Tag') . ':</td> + <td><select name="tag">'; $SQL = "SELECT tagref, tagdescription @@ -888,20 +915,25 @@ echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; // End select tag /*now set up a GLCode field to select from avaialble GL accounts */ if (isset($_POST['GLManualCode'])) { - echo '<tr><td>' . _('Enter GL Account Manually') . ':</td> - <td><input type=Text class="number" Name="GLManualCode" maxlength=12 size=12 onChange="return inArray(this, GLCode.options,'. "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . ' value='. $_POST['GLManualCode'] .' ></td></tr>'; + echo '<tr> + <td>' . _('Enter GL Account Manually') . ':</td> + <td><input type="text" class="number" name="GLManualCode" maxlength="12" size="12" onChange="return inArray(this, GLCode.options,'. "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . ' value='. $_POST['GLManualCode'] .' ></td> + </tr>'; } else { - echo '<tr><td>' . _('Enter GL Account Manually') . ':</td> - <td><input type=Text class="number" Name="GLManualCode" Maxlength=12 size=12 onChange="return inArray(this, GLCode.options,'. "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"></td></tr>'; + echo '<tr> + <td>' . _('Enter GL Account Manually') . ':</td> + <td><input type="text" class="number" Name="GLManualCode" maxlength="12" size="12" onChange="return inArray(this, GLCode.options,'. "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"></td></tr>'; } - echo '<tr><td>' . _('Select GL Group') . ':</td> - <td><select name="GLGroup" onChange="return ReloadForm(UpdateCodes)">'; + echo '<tr> + <td>' . _('Select GL Group') . ':</td> + <td><select name="GLGroup" onChange="return ReloadForm(UpdateCodes)">'; $SQL = "SELECT groupname FROM accountgroups @@ -909,7 +941,8 @@ $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; prnMsg(_('No General ledger account groups have been set up yet') . ' - ' . _('payments cannot be analysed against GL accounts until the GL accounts are set up'),'error'); } else { echo '<option value=""></option>'; @@ -920,7 +953,9 @@ echo '<option value="' . $myrow['groupname'] . '">' . $myrow['groupname'] . '</option>'; } } - echo '</select><input type="submit" name="UpdateCodes" value="Select" /></td></tr>'; + echo '</select> + <input type="submit" name="UpdateCodes" value="Select" /></td> + </tr>'; } if (isset($_POST['GLGroup']) AND $_POST['GLGroup']!='') { @@ -937,8 +972,9 @@ } - echo '<tr><td>' . _('Select GL Account') . ':</td> - <td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; + echo '<tr> + <td>' . _('Select GL Account') . ':</td> + <td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -956,27 +992,31 @@ echo '</select></td></tr>'; } - echo '<tr><td>'. _('Cheque/Voucher Number') .'</td> - <td><input type="text" name="cheque" maxlength="12" size="12"></td> + echo '<tr> + <td>'. _('Cheque/Voucher Number') .'</td> + <td><input type="text" name="cheque" maxlength="12" size="12" /></td> </tr>'; if (isset($_POST['GLNarrative'])) { - echo '<tr><td>' . _('GL Narrative') . ':</td> + echo '<tr> + <td>' . _('GL Narrative') . ':</td> <td><input type="text" name="GLNarrative" maxlength="50" size="52" value="' . $_POST['GLNarrative'] . '" /></td> </tr>'; } else { - echo '<tr><td>' . _('GL Narrative') . ':</td> + echo '<tr> + <td>' . _('GL Narrative') . ':</td> <td><input type="text" name="GLNarrative" maxlength="50" size="52" /></td> </tr>'; } if (isset($_POST['GLAmount'])) { - echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> - <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" value=' . $_POST['GLAmount'] . '></td> + echo '<tr> + <td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> + <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" value="' . $_POST['GLAmount'] . '" /></td> </tr>'; } else { echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> - <td><input type="text" name="GLAmount" Maxlength="12" size="12" class="number"></td> + <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" /></td> </tr>'; } @@ -1010,7 +1050,7 @@ echo '<tr> <td align=left>' . $PaymentItem->cheque . '</td> - <td class=number>' . locale_number_format($PaymentItem->Amount,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($PaymentItem->Amount,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</td> <td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td> <td>' . stripslashes($PaymentItem->Narrative) . '</td> <td>' . $PaymentItem->tag . ' - ' . $TagName . '</td> @@ -1018,20 +1058,33 @@ </tr>'; $PaymentTotal += $PaymentItem->Amount; } - echo '<tr><td></td><td class=number><b>' . locale_number_format($PaymentTotal,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</b></td><td></td><td></td><td></td></tr></table><br />'; - echo '<input type=submit name="CommitBatch" value="' . _('Accept and Process Payment') . '">'; + echo '<tr> + <td></td> + <td class="number"><b>' . locale_number_format($PaymentTotal,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</b></td> + <td></td> + <td></td> + <td></td> + </tr> + </table> + <br />'; + echo '<input type="submit" name="CommitBatch" value="' . _('Accept and Process Payment') . '" />'; } } else { /*a supplier is selected or the GL link is not active then set out the fields for entry of receipt amt and disc */ - echo '<table class=selection><tr><td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail']->Currency . ':</td> - <td><input class=number type="text" name="Amount" maxlength=12 size=13 value=' . $_SESSION['PaymentDetail']->Amount . '></td></tr>'; + echo '<table class="selection"> + <tr> + <td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail']->Currency . ':</td> + <td><input class="number" type="text" name="Amount" maxlength=12 size=13 value=' . $_SESSION['PaymentDetail']->Amount . '></td> + </tr>'; if (isset($_SESSION['PaymentDetail']->SupplierID)){ /*So it is a supplier payment so show the discount entry item */ - echo '<tr><td>' . _('Amount of Discount') . ':</td> - <td><input class=number type="text" name="Discount" maxlength=12 size=13 value="' . $_SESSION['PaymentDetail']->Discount . '" /></td></tr>'; + echo '<tr> + <td>' . _('Amount of Discount') . ':</td> + <td><input class="number" type="text" name="Discount" maxlength="12" size="13" value="' . $_SESSION['PaymentDetail']->Discount . '" /></td> + </tr>'; echo '<input type="hidden" name="SuppName" value="' . $_SESSION['PaymentDetail']->SuppName . '" />'; } else { echo '<input type="hidden" name="discount" Value="0" />'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-28 05:07:11
|
Revision: 4733 http://web-erp.svn.sourceforge.net/web-erp/?rev=4733&view=rev Author: daintree Date: 2011-10-28 05:07:04 +0000 (Fri, 28 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/OrderDetails.php trunk/OutstandingGRNs.php trunk/Payments.php Modified: trunk/OrderDetails.php =================================================================== --- trunk/OrderDetails.php 2011-10-25 07:54:55 UTC (rev 4732) +++ trunk/OrderDetails.php 2011-10-28 05:07:04 UTC (rev 4733) @@ -52,67 +52,74 @@ $GetOrdHdrResult = DB_query($OrderHeaderSQL,$db, $ErrMsg, $DbgMsg); if (DB_num_rows($GetOrdHdrResult)==1) { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Order Details') . '" alt="" />' . ' ' . $title . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Order Details') . '" alt="" />' . ' ' . $title . ' + </p>'; $myrow = DB_fetch_array($GetOrdHdrResult); $CurrDecimalPlaces = $myrow['decimalplaces']; - echo '<table class="selection">'; - echo '<tr><th colspan=4><font color=blue>'._('Order Header Details For Order No').' '.$_GET['OrderNumber'].'</font></th></tr>'; - echo '<tr> - <th style="text-align: left">' . _('Customer Code') . ':</th> - <td class="OddTableRows"><font><a href="' . $rootpath . '/SelectCustomer.php?Select=' . $myrow['debtorno'] . '">' . $myrow['debtorno'] . '</a></td> - <th style="text-align: left">' . _('Customer Name') . ':</th><td><font>' . $myrow['name'] . '</td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Customer Reference') . ':</th> - <td class="OddTableRows"><font>' . $myrow['customerref'] . '</font></td> - <th style="text-align: left">' . _('Deliver To') . ':</th><td><font>' . $myrow['deliverto'] . '</td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Ordered On') . ':</th> - <td class="OddTableRows"><font>' . ConvertSQLDate($myrow['orddate']) . '</font></td> - <th style="text-align: left">' . _('Delivery Address 1') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd1'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Requested Delivery') . ':</th> - <td class="OddTableRows"><font>' . ConvertSQLDate($myrow['deliverydate']) . '</font></td> - <th style="text-align: left">' . _('Delivery Address 2') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd2'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left"h>' . _('Order Currency') . ':</th> - <td class="OddTableRows"><font>' . $myrow['currcode'] . '</font></td> - <th style="text-align: left">' . _('Delivery Address 3') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd3'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Deliver From Location') . ':</th> - <td class="OddTableRows"><font>' . $myrow['fromstkloc'] . '</font></td> - <th style="text-align: left">' . _('Delivery Address 4') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd4'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Telephone') . ':</th> - <td class="OddTableRows"><font>' . $myrow['contactphone'] . '</font></td> - <th style="text-align: left">' . _('Delivery Address 5') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd5'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Email') . ':</th> - <td class="OddTableRows"><font><a href="mailto:' . $myrow['contactemail'] . '">' . $myrow['contactemail'] . '</a></font></td> - <th style="text-align: left">' . _('Delivery Address 6') . ':</th> - <td class="OddTableRows"><font>' . $myrow['deladd6'] . '</font></td> - </tr>'; - echo '<tr> - <th style="text-align: left">' . _('Freight Cost') . ':</th> - <td class="OddTableRows"><font>' . $myrow['freightcost'] . '</font></td> - </tr>'; - echo '<tr><th style="text-align: left">'._('Comments'). ': '; - echo '</th><td colspan=3>'.$myrow['comments'] . '</td></tr>'; - echo '</table>'; + echo '<table class="selection"> + <tr> + <th colspan="4"><font color="blue">'._('Order Header Details For Order No').' '.$_GET['OrderNumber'].'</font></th> + </tr> + <tr> + <th style="text-align: left">' . _('Customer Code') . ':</th> + <td class="OddTableRows"><a href="' . $rootpath . '/SelectCustomer.php?Select=' . $myrow['debtorno'] . '">' . $myrow['debtorno'] . '</a></td> + <th style="text-align: left">' . _('Customer Name') . ':</th> + <th>' . $myrow['name'] . '</th> + </tr> + <tr> + <th style="text-align: left">' . _('Customer Reference') . ':</th> + <td class="OddTableRows">' . $myrow['customerref'] . '</td> + <th style="text-align: left">' . _('Deliver To') . ':</th> + <th>' . $myrow['deliverto'] . '</th> + </tr> + <tr> + <th style="text-align: left">' . _('Ordered On') . ':</th> + <td class="OddTableRows">' . ConvertSQLDate($myrow['orddate']) . '</td> + <th style="text-align: left">' . _('Delivery Address 1') . ':</th> + <td class="OddTableRows">' . $myrow['deladd1'] . '</td> + </tr> + <tr> + <th style="text-align: left">' . _('Requested Delivery') . ':</th> + <td class="OddTableRows">' . ConvertSQLDate($myrow['deliverydate']) . '</td> + <th style="text-align: left">' . _('Delivery Address 2') . ':</th> + <td class="OddTableRows">' . $myrow['deladd2'] . '</td> + </tr> + <tr> + <th style="text-align: left"h>' . _('Order Currency') . ':</th> + <td class="OddTableRows">' . $myrow['currcode'] . '</td> + <th style="text-align: left">' . _('Delivery Address 3') . ':</th> + <td class="OddTableRows">' . $myrow['deladd3'] . '</td> + </tr> + <tr> + <th style="text-align: left">' . _('Deliver From Location') . ':</th> + <td class="OddTableRows">' . $myrow['fromstkloc'] . '</td> + <th style="text-align: left">' . _('Delivery Address 4') . ':</th> + <td class="OddTableRows">' . $myrow['deladd4'] . '</td> + </tr> + <tr> + <th style="text-align: left">' . _('Telephone') . ':</th> + <td class="OddTableRows">' . $myrow['contactphone'] . '</td> + <th style="text-align: left">' . _('Delivery Address 5') . ':</th> + <td class="OddTableRows">' . $myrow['deladd5'] . '</td> + </tr> + <tr> + <th style="text-align: left">' . _('Email') . ':</th> + <td class="OddTableRows"><a href="mailto:' . $myrow['contactemail'] . '">' . $myrow['contactemail'] . '</a></td> + <th style="text-align: left">' . _('Delivery Address 6') . ':</th> + <td class="OddTableRows">' . $myrow['deladd6'] . '</td> + </tr> + <tr> + <th style="text-align: left">' . _('Freight Cost') . ':</th> + <td class="OddTableRows">' . $myrow['freightcost'] . '</td> + </tr> + <tr> + <th style="text-align: left">'._('Comments'). ': </th> + <td colspan="3">'.$myrow['comments'] . '</td> + </tr> + </table>'; } /*Now get the line items */ @@ -146,9 +153,12 @@ $OrderTotalVolume = 0; $OrderTotalWeight = 0; - echo '<br /><table cellpadding=2 colspan=9 class=selection>'; - echo '<tr><th colspan=9><font color=blue>'._('Order Line Details For Order No').' '.$_GET['OrderNumber'].'</font></th></tr>'; - echo '<tr> + echo '<br /> + <table class="selection"> + <tr> + <th colspan="9"><font color="blue">'._('Order Line Details For Order No').' '.$_GET['OrderNumber'].'</font></th> + </tr> + <tr> <th>' . _('Item Code') . '</th> <th>' . _('Item Description') . '</th> <th>' . _('Quantity') . '</th> @@ -178,18 +188,18 @@ echo '<td>' . $myrow['stkcode'] . '</td> <td>' . $myrow['description'] . '</td> - <td class=number>' . $myrow['quantity'] . '</td> + <td class="number">' . $myrow['quantity'] . '</td> <td>' . $myrow['units'] . '</td> - <td class=number>' . locale_number_format($myrow['unitprice'],$CurrDecimalPlaces) . '</td> - <td class=number>' . locale_number_format(($myrow['discountpercent'] * 100),2) . '%' . '</td> - <td class=number>' . locale_number_format($myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent']),$CurrDecimalPlaces) . '</td> - <td class=number>' . locale_number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($myrow['unitprice'],$CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format(($myrow['discountpercent'] * 100),2) . '%' . '</td> + <td class="number">' . locale_number_format($myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent']),$CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($myrow['qtyinvoiced'],$myrow['decimalplaces']) . '</td> <td>' . $DisplayActualDeliveryDate . '</td> </tr>'; - $OrderTotal = $OrderTotal + $myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent']); - $OrderTotalVolume = $OrderTotalVolume + $myrow['quantity'] * $myrow['volume']; - $OrderTotalWeight = $OrderTotalWeight + $myrow['quantity'] * $myrow['kgs']; + $OrderTotal += ($myrow['quantity'] * $myrow['unitprice'] * (1 - $myrow['discountpercent'])); + $OrderTotalVolume += ($myrow['quantity'] * $myrow['volume']); + $OrderTotalWeight += ($myrow['quantity'] * $myrow['kgs']); } $DisplayTotal = locale_number_format($OrderTotal,$CurrDecimalPlaces); @@ -197,12 +207,13 @@ $DisplayWeight = locale_number_format($OrderTotalWeight,2); echo '<tr> - <td colspan=5 class=number><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> - <td colspan=2 class=number>' . $DisplayTotal . '</td> + <td colspan="5" class="number"><b>' . _('TOTAL Excl Tax/Freight') . '</b></td> + <td colspan="2" class="number">' . $DisplayTotal . '</td> </tr> - </table>'; + </table>'; - echo '<br /><table class=selection> + echo '<br /> + <table class="selection"> <tr> <td>' . _('Total Weight') . ':</td> <td>' . $DisplayWeight . '</td> Modified: trunk/OutstandingGRNs.php =================================================================== --- trunk/OutstandingGRNs.php 2011-10-25 07:54:55 UTC (rev 4732) +++ trunk/OutstandingGRNs.php 2011-10-28 05:07:04 UTC (rev 4733) @@ -160,22 +160,22 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr> <td>' . _('From Supplier Code') . ':</td> - <td><input type="text" name="FromCriteria" value="0"></td> + <td><input type="text" name="FromCriteria" value="0" /></td> </tr> <tr> <td>' . _('To Supplier Code'). ':</td> - <td><input type="text" name="ToCriteria" value="zzzzzzz"></td> + <td><input type="text" name="ToCriteria" value="zzzzzzz" /></td> </tr> </table> <br /> <div class="centre"> - <input type=Submit Name="PrintPDF" value="' . _('Print PDF') . '"> + <input type=Submit Name="PrintPDF" value="' . _('Print PDF') . '" /> </div>'; include('includes/footer.inc'); Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2011-10-25 07:54:55 UTC (rev 4732) +++ trunk/Payments.php 2011-10-28 05:07:04 UTC (rev 4733) @@ -36,11 +36,13 @@ $BankAccountEmpty=FALSE; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Payment Entry') - . '" alt="" />' . ' ' . _('Payment Entry') . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Payment Entry') +. '" alt="" />' . ' ' . _('Payment Entry') . ' + </p>'; echo '<div class="page_help_text">' . _('Use this screen to enter payments FROM your bank account. <br />Note: To enter a payment FROM a supplier, first select the Supplier, click Enter a Payment to, or Receipt from the Supplier, and use a negative Payment amount on this form.') . '</div> - <br /> - <div class="centre">'; + <br /> + <div class="centre">'; if (isset($_GET['SupplierID'])){ /*The page was called with a supplierID check it is valid and default the inputs for Supplier Name and currency of payment */ @@ -94,7 +96,7 @@ $FactorResult = DB_query($factorsql, $db); $myfactorrow = DB_fetch_array($FactorResult); - $_SESSION['PaymentDetail']->SuppName = $myrow['suppname'] . _(' care of ') . $myfactorrow['coyname']; + $_SESSION['PaymentDetail']->SuppName = $myrow['suppname'] . ' ' . _('care of') . ' ' . $myfactorrow['coyname']; $_SESSION['PaymentDetail']->Address1 = $myfactorrow['address1']; $_SESSION['PaymentDetail']->Address2 = $myfactorrow['address2']; $_SESSION['PaymentDetail']->Address3 = $myfactorrow['address3']; @@ -150,12 +152,12 @@ if ($_POST['Currency']==$_SESSION['PaymentDetail']->AccountCurrency){ $_POST['ExRate']=1; - $_SESSION['PaymentDetail']->ExRate=$_POST['ExRate']; //ex rate between payment currency and account currency + $_SESSION['PaymentDetail']->ExRate=filter_number_format($_POST['ExRate']); //ex rate between payment currency and account currency $SuggestedExRate=1; } if ($_SESSION['PaymentDetail']->AccountCurrency==$_SESSION['CompanyRecord']['currencydefault']){ $_POST['FunctionalExRate']=1; - $_SESSION['PaymentDetail']->FunctionalExRate=$_POST['FunctionalExRate']; + $_SESSION['PaymentDetail']->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); $SuggestedFunctionalExRate =1; $SuggestedExRate = $tableExRate; @@ -196,7 +198,7 @@ } } if (isset($_POST['Discount']) AND $_POST['Discount']!=''){ - $_SESSION['PaymentDetail']->Discount=$_POST['Discount']; + $_SESSION['PaymentDetail']->Discount=filter_number_format($_POST['Discount']); } else { if (!isset($_SESSION['PaymentDetail']->Discount)) { $_SESSION['PaymentDetail']->Discount=0; @@ -450,7 +452,7 @@ $DbgMsg = _('Cannot update the supplier record for the date of the last payment made using the SQL'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); - $_SESSION['PaymentDetail']->Narrative = $_SESSION['PaymentDetail']->SupplierID . "-" . $_SESSION['PaymentDetail']->Narrative; + $_SESSION['PaymentDetail']->Narrative = $_SESSION['PaymentDetail']->SupplierID . '-' . $_SESSION['PaymentDetail']->Narrative; if ($_SESSION['CompanyRecord']['gllink_creditors']==1){ /* then do the supplier control GLTrans */ /* Now debit creditors account with payment + discount */ @@ -507,14 +509,14 @@ periodno, account, narrative, - amount) "; - $SQL = $SQL . "VALUES ('" . $Transtype . "', - '" . $TransNo . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - '" . $PeriodNo . "', - '" . $_SESSION['PaymentDetail']->Account . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . (-$_SESSION['PaymentDetail']->Amount/$_SESSION['PaymentDetail']->ExRate/$_SESSION['PaymentDetail']->FunctionalExRate) . "')"; + amount) + VALUES ('" . $Transtype . "', + '" . $TransNo . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . $PeriodNo . "', + '" . $_SESSION['PaymentDetail']->Account . "', + '" . $_SESSION['PaymentDetail']->Narrative . "', + '" . (-$_SESSION['PaymentDetail']->Amount/$_SESSION['PaymentDetail']->ExRate/$_SESSION['PaymentDetail']->FunctionalExRate) . "')"; $ErrMsg = _('Cannot insert a GL transaction for the bank account credit because'); $DbgMsg = _('Cannot insert a GL transaction for the bank account credit using the SQL'); @@ -534,8 +536,8 @@ transdate, banktranstype, amount, - currcode) "; - $SQL= $SQL . "VALUES ('" . $TransNo . "', + currcode) + VALUES ('" . $TransNo . "', '" . $Transtype . "', '" . $_SESSION['PaymentDetail']->Account . "', '" . $_SESSION['PaymentDetail']->Narrative . "', @@ -561,18 +563,17 @@ transdate, banktranstype, amount, - currcode) "; - $SQL= $SQL . "VALUES ('" . $TransNo . "', - '" . $Transtype . "', - '" . $_SESSION['PaymentDetail']->Account . "', - '" . $_SESSION['PaymentDetail']->Narrative . "', - '" . $_SESSION['PaymentDetail']->ExRate . "', - '" . $_SESSION['PaymentDetail']->FunctionalExRate . "', - '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', - '" . $_SESSION['PaymentDetail']->Paymenttype . "', - '" . -$PaymentItem->Amount . "', - '" . $_SESSION['PaymentDetail']->Currency . "' - )"; + currcode) + VALUES ('" . $TransNo . "', + '" . $Transtype . "', + '" . $_SESSION['PaymentDetail']->Account . "', + '" . $_SESSION['PaymentDetail']->Narrative . "', + '" . $_SESSION['PaymentDetail']->ExRate . "', + '" . $_SESSION['PaymentDetail']->FunctionalExRate . "', + '" . FormatDateForSQL($_SESSION['PaymentDetail']->DatePaid) . "', + '" . $_SESSION['PaymentDetail']->Paymenttype . "', + '" . -$PaymentItem->Amount . "', + '" . $_SESSION['PaymentDetail']->Currency . "' )"; $ErrMsg = _('Cannot insert a bank transaction because'); $DbgMsg = _('Cannot insert a bank transaction using the SQL'); @@ -635,7 +636,7 @@ prnMsg( _('The Cheque/Voucher number has already been used') . ' - ' . _('This GL analysis item could not be added'),'error'); } else { $myrow = DB_fetch_array($Result); - $_SESSION['PaymentDetail']->add_to_glanalysis($_POST['GLAmount'], + $_SESSION['PaymentDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), $_POST['GLNarrative'], $_POST['GLManualCode'], $myrow['accountname'], @@ -651,7 +652,7 @@ $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'], + $_SESSION['PaymentDetail']->add_to_glanalysis(filter_number_format($_POST['GLAmount']), $_POST['GLNarrative'], $_POST['GLCode'], $myrow['accountname'], @@ -675,7 +676,10 @@ $_POST['DatePaid'] = ''; } -if (isset($_POST['DatePaid']) AND ($_POST['DatePaid']=='' OR !Is_Date($_SESSION['PaymentDetail']->DatePaid))){ +if (isset($_POST['DatePaid']) + AND ($_POST['DatePaid']=='' + OR !Is_Date($_SESSION['PaymentDetail']->DatePaid))){ + $_POST['DatePaid']= Date($_SESSION['DefaultDateFormat']); $_SESSION['PaymentDetail']->DatePaid = $_POST['DatePaid']; } @@ -706,8 +710,7 @@ } } - -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class="selection">'; @@ -734,11 +737,15 @@ $DbgMsg = _('The SQL used to retrieve the bank accounts was'); $AccountsResults = DB_query($SQL,$db,$ErrMsg,$DbgMsg); -echo '<tr><td>' . _('Bank Account') . ':</td> +echo '<tr> + <td>' . _('Bank Account') . ':</td> <td><select name="BankAccount" onChange="ReloadForm(UpdateHeader)">'; if (DB_num_rows($AccountsResults)==0){ - echo '</select></td></tr></table><p>'; + echo '</select></td> + </tr> + </table> + <p />'; prnMsg( _('Bank Accounts have not yet been defined. You must first') . ' <a href="' . $rootpath . '/BankAccounts.php">' . _('define the bank accounts') . '</a> ' . _('and general ledger accounts to be affected'),'warn'); include('includes/footer.inc'); exit; @@ -752,11 +759,13 @@ echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname'] . ' - ' . $myrow['currcode'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } -echo '<tr><td>' . _('Date Paid') . ':</td> - <td><input type="text" name="DatePaid" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['PaymentDetail']->DatePaid . '"></td> +echo '<tr> + <td>' . _('Date Paid') . ':</td> + <td><input type="text" name="DatePaid" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['PaymentDetail']->DatePaid . '" /></td> </tr>'; @@ -767,7 +776,8 @@ $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; prnMsg( _('No currencies are defined yet. Payments cannot be entered until a currency is defined'),'error'); } else { while ($myrow=DB_fetch_array($result)){ @@ -777,17 +787,22 @@ echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; } } - echo '</select></td><td><i>' . _('The transaction currency does not need to be the same as the bank account currency') . '</i></td></tr>'; + echo '</select></td> + <td><i>' . _('The transaction currency does not need to be the same as the bank account currency') . '</i></td> + </tr>'; } } else { /*its a supplier payment so it must be in the suppliers currency */ - echo '<tr><td>' . _('Supplier Currency') . ':</td><td>' . $_SESSION['PaymentDetail']->Currency . '</td></tr>'; - echo '<input type="hidden" name="Currency" value="' . $_SESSION['PaymentDetail']->Currency . '">'; + echo '<tr> + <td>' . _('Supplier Currency') . ':</td> + <td>' . $_SESSION['PaymentDetail']->Currency . '</td> + </tr>'; + echo '<input type="hidden" name="Currency" value="' . $_SESSION['PaymentDetail']->Currency . '" />'; /*get the default rate from the currency table if it has not been set */ if (!isset($_POST['ExRate']) OR $_POST['ExRate']==''){ $SQL = "SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency ."'"; $Result=DB_query($SQL,$db); $myrow=DB_fetch_row($Result); - $_POST['ExRate']=$myrow[0]; + $_POST['ExRate']=locale_number_format($myrow[0],'Variable'); } } @@ -801,33 +816,38 @@ } if ($_SESSION['PaymentDetail']->AccountCurrency!=$_SESSION['PaymentDetail']->Currency AND isset($_SESSION['PaymentDetail']->AccountCurrency)){ if (isset($SuggestedExRate)){ - $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,4) . '</b>'; + $SuggestedExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedExRate,6) . '</b>'; } else { $SuggestedExRateText =''; } if ($_POST['ExRate']==1 AND isset($SuggestedExRate)){ $_POST['ExRate'] = $SuggestedExRate; } - echo '<tr><td>' . _('Payment Exchange Rate') . ':</td> - <td><input class=number type="text" name="ExRate" maxlength=10 size=12 value="' . $_POST['ExRate'] . '"></td> - <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the payment') . '. 1 ' . $_SESSION['PaymentDetail']->AccountCurrency . ' = ? ' . $_SESSION['PaymentDetail']->Currency . '</i></td></tr>'; + echo '<tr> + <td>' . _('Payment Exchange Rate') . ':</td> + <td><input class="number" type="text" name="ExRate" maxlength="10" size="12" value="' . $_POST['ExRate'] . '" /></td> + <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the payment') . '. 1 ' . $_SESSION['PaymentDetail']->AccountCurrency . ' = ? ' . $_SESSION['PaymentDetail']->Currency . '</i></td> + </tr>'; } if ($_SESSION['PaymentDetail']->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] AND isset($_SESSION['PaymentDetail']->AccountCurrency)){ if (isset($SuggestedFunctionalExRate)){ - $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,4) . '</b>'; + $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,6) . '</b>'; } else { $SuggestedFunctionalExRateText =''; } if ($_POST['FunctionalExRate']==1 AND isset($SuggestedFunctionalExRate)){ - $_POST['FunctionalExRate'] = $SuggestedFunctionalExRate; + $_POST['FunctionalExRate'] = locale_number_format($SuggestedFunctionalExRate,'Variable'); } - echo '<tr><td>' . _('Functional Exchange Rate') . ':</td> - <td><input type="text" name="FunctionalExRate" maxlength=10 size=12 value="' . $_POST['FunctionalExRate'] . '" /></td> - <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail']->AccountCurrency . '</i></td></tr>'; + echo '<tr> + <td>' . _('Functional Exchange Rate') . ':</td> + <td><input type="text" name="FunctionalExRate" maxlength="10" size="12" value="' . $_POST['FunctionalExRate'] . '" /></td> + <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['PaymentDetail']->AccountCurrency . '</i></td> + </tr>'; } -echo '<tr><td>' . _('Payment type') . ':</td> +echo '<tr> + <td>' . _('Payment type') . ':</td> <td><select name="Paymenttype">'; include('includes/GetPaymentMethods.php'); @@ -842,13 +862,15 @@ echo '<option value="' . $PaytType . '">' . $PaytType . '</option>'; } } //end foreach -echo '</select></td></tr>'; +echo '</select></td> + </tr>'; if (!isset($_POST['ChequeNum'])) { $_POST['ChequeNum']=''; } -echo '<tr><td>' . _('Cheque Number') . ':</td> +echo '<tr> + <td>' . _('Cheque Number') . ':</td> <td><input type="text" name="ChequeNum" maxlength="8" size="10" value="' . $_POST['ChequeNum'] . '" /> ' . _('(if using pre-printed stationery)') . '</td> </tr>'; @@ -856,10 +878,13 @@ $_POST['Narrative']=''; } -echo '<tr><td>' . _('Reference / Narrative') . ':</td> - <td colspan=2><input type="text" name="Narrative" maxlength=80 size=82 value="' . $_POST['Narrative'] . '" /> ' . _('(Max. length 80 characters)') . '</td> - </tr>'; -echo '<tr><td colspan=3><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '" /></td></tr>'; +echo '<tr> + <td>' . _('Reference / Narrative') . ':</td> + <td colspan="2"><input type="text" name="Narrative" maxlength="80" size="82" value="' . $_POST['Narrative'] . '" /> ' . _('(Max. length 80 characters)') . '</td> + </tr>'; +echo '<tr> + <td colspan="3"><div class="centre"><input type="submit" name="UpdateHeader" value="' . _('Update'). '" /></td> + </tr>'; echo '</table><br />'; @@ -872,7 +897,9 @@ echo '<tr><th colspan="2"><font size="3" color="blue">' . _('General Ledger Payment Analysis Entry') . '</font></th></tr>'; //Select the tag - echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; + echo '<tr> + <td>' . _('Select Tag') . ':</td> + <td><select name="tag">'; $SQL = "SELECT tagref, tagdescription @@ -888,20 +915,25 @@ echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; // End select tag /*now set up a GLCode field to select from avaialble GL accounts */ if (isset($_POST['GLManualCode'])) { - echo '<tr><td>' . _('Enter GL Account Manually') . ':</td> - <td><input type=Text class="number" Name="GLManualCode" maxlength=12 size=12 onChange="return inArray(this, GLCode.options,'. "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . ' value='. $_POST['GLManualCode'] .' ></td></tr>'; + echo '<tr> + <td>' . _('Enter GL Account Manually') . ':</td> + <td><input type="text" class="number" name="GLManualCode" maxlength="12" size="12" onChange="return inArray(this, GLCode.options,'. "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . ' value='. $_POST['GLManualCode'] .' ></td> + </tr>'; } else { - echo '<tr><td>' . _('Enter GL Account Manually') . ':</td> - <td><input type=Text class="number" Name="GLManualCode" Maxlength=12 size=12 onChange="return inArray(this, GLCode.options,'. "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"></td></tr>'; + echo '<tr> + <td>' . _('Enter GL Account Manually') . ':</td> + <td><input type="text" class="number" Name="GLManualCode" maxlength="12" size="12" onChange="return inArray(this, GLCode.options,'. "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"></td></tr>'; } - echo '<tr><td>' . _('Select GL Group') . ':</td> - <td><select name="GLGroup" onChange="return ReloadForm(UpdateCodes)">'; + echo '<tr> + <td>' . _('Select GL Group') . ':</td> + <td><select name="GLGroup" onChange="return ReloadForm(UpdateCodes)">'; $SQL = "SELECT groupname FROM accountgroups @@ -909,7 +941,8 @@ $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; prnMsg(_('No General ledger account groups have been set up yet') . ' - ' . _('payments cannot be analysed against GL accounts until the GL accounts are set up'),'error'); } else { echo '<option value=""></option>'; @@ -920,7 +953,9 @@ echo '<option value="' . $myrow['groupname'] . '">' . $myrow['groupname'] . '</option>'; } } - echo '</select><input type="submit" name="UpdateCodes" value="Select" /></td></tr>'; + echo '</select> + <input type="submit" name="UpdateCodes" value="Select" /></td> + </tr>'; } if (isset($_POST['GLGroup']) AND $_POST['GLGroup']!='') { @@ -937,8 +972,9 @@ } - echo '<tr><td>' . _('Select GL Account') . ':</td> - <td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; + echo '<tr> + <td>' . _('Select GL Account') . ':</td> + <td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ @@ -956,27 +992,31 @@ echo '</select></td></tr>'; } - echo '<tr><td>'. _('Cheque/Voucher Number') .'</td> - <td><input type="text" name="cheque" maxlength="12" size="12"></td> + echo '<tr> + <td>'. _('Cheque/Voucher Number') .'</td> + <td><input type="text" name="cheque" maxlength="12" size="12" /></td> </tr>'; if (isset($_POST['GLNarrative'])) { - echo '<tr><td>' . _('GL Narrative') . ':</td> + echo '<tr> + <td>' . _('GL Narrative') . ':</td> <td><input type="text" name="GLNarrative" maxlength="50" size="52" value="' . $_POST['GLNarrative'] . '" /></td> </tr>'; } else { - echo '<tr><td>' . _('GL Narrative') . ':</td> + echo '<tr> + <td>' . _('GL Narrative') . ':</td> <td><input type="text" name="GLNarrative" maxlength="50" size="52" /></td> </tr>'; } if (isset($_POST['GLAmount'])) { - echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> - <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" value=' . $_POST['GLAmount'] . '></td> + echo '<tr> + <td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> + <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" value="' . $_POST['GLAmount'] . '" /></td> </tr>'; } else { echo '<tr><td>' . _('Amount') . ' (' . $_SESSION['PaymentDetail']->Currency . '):</td> - <td><input type="text" name="GLAmount" Maxlength="12" size="12" class="number"></td> + <td><input type="text" name="GLAmount" maxlength="12" size="12" class="number" /></td> </tr>'; } @@ -1010,7 +1050,7 @@ echo '<tr> <td align=left>' . $PaymentItem->cheque . '</td> - <td class=number>' . locale_number_format($PaymentItem->Amount,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($PaymentItem->Amount,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</td> <td>' . $PaymentItem->GLCode . ' - ' . $PaymentItem->GLActName . '</td> <td>' . stripslashes($PaymentItem->Narrative) . '</td> <td>' . $PaymentItem->tag . ' - ' . $TagName . '</td> @@ -1018,20 +1058,33 @@ </tr>'; $PaymentTotal += $PaymentItem->Amount; } - echo '<tr><td></td><td class=number><b>' . locale_number_format($PaymentTotal,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</b></td><td></td><td></td><td></td></tr></table><br />'; - echo '<input type=submit name="CommitBatch" value="' . _('Accept and Process Payment') . '">'; + echo '<tr> + <td></td> + <td class="number"><b>' . locale_number_format($PaymentTotal,$_SESSION['PaymentDetail']->CurrDecimalPlaces) . '</b></td> + <td></td> + <td></td> + <td></td> + </tr> + </table> + <br />'; + echo '<input type="submit" name="CommitBatch" value="' . _('Accept and Process Payment') . '" />'; } } else { /*a supplier is selected or the GL link is not active then set out the fields for entry of receipt amt and disc */ - echo '<table class=selection><tr><td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail']->Currency . ':</td> - <td><input class=number type="text" name="Amount" maxlength=12 size=13 value=' . $_SESSION['PaymentDetail']->Amount . '></td></tr>'; + echo '<table class="selection"> + <tr> + <td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail']->Currency . ':</td> + <td><input class="number" type="text" name="Amount" maxlength=12 size=13 value=' . $_SESSION['PaymentDetail']->Amount . '></td> + </tr>'; if (isset($_SESSION['PaymentDetail']->SupplierID)){ /*So it is a supplier payment so show the discount entry item */ - echo '<tr><td>' . _('Amount of Discount') . ':</td> - <td><input class=number type="text" name="Discount" maxlength=12 size=13 value="' . $_SESSION['PaymentDetail']->Discount . '" /></td></tr>'; + echo '<tr> + <td>' . _('Amount of Discount') . ':</td> + <td><input class="number" type="text" name="Discount" maxlength="12" size="13" value="' . $_SESSION['PaymentDetail']->Discount . '" /></td> + </tr>'; echo '<input type="hidden" name="SuppName" value="' . $_SESSION['PaymentDetail']->SuppName . '" />'; } else { echo '<input type="hidden" name="discount" Value="0" />'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-29 03:26:38
|
Revision: 4734 http://web-erp.svn.sourceforge.net/web-erp/?rev=4734&view=rev Author: daintree Date: 2011-10-29 03:26:27 +0000 (Sat, 29 Oct 2011) Log Message: ----------- security fixes per adv...@ht... Modified Paths: -------------- trunk/AccountGroups.php trunk/AccountSections.php trunk/AddCustomerContacts.php trunk/AddCustomerNotes.php trunk/AddCustomerTypeNotes.php trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/Areas.php trunk/AuditTrail.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/BOMListing.php trunk/BOMs.php trunk/BackupDatabase.php trunk/BankAccounts.php trunk/BankMatching.php trunk/BankReconciliation.php trunk/COGSGLPostings.php trunk/CompanyPreferences.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/CounterSales.php trunk/CreditStatus.php trunk/Credit_Invoice.php trunk/Currencies.php trunk/CustEDISetup.php trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerAllocations.php trunk/CustomerBranches.php trunk/CustomerInquiry.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/CustomerTypes.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/DiscountCategories.php trunk/DiscountMatrix.php trunk/EDIMessageFormat.php trunk/EmailCustTrans.php trunk/ExchangeRateTrend.php trunk/FTP_RadioBeacon.php trunk/Factors.php trunk/FixedAssetCategories.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/FixedAssetLocations.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/FormDesigner.php trunk/FreightCosts.php trunk/GLAccountCSV.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLAccounts.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLJournal.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTags.php trunk/GLTrialBalance.php trunk/GLTrialBalance_csv.php trunk/GeocodeSetup.php trunk/GoodsReceived.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/Labels.php trunk/Locations.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPCreateDemands.php trunk/MRPDemandTypes.php trunk/MRPDemands.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/OffersReceived.php trunk/OutstandingGRNs.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFRemittanceAdvice.php trunk/PDFStockCheckComparison.php trunk/PDFStockLocTransfer.php trunk/PDFStockTransfer.php trunk/PDFSuppTransListing.php trunk/POReport.php trunk/PO_AuthorisationLevels.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Header.php trunk/PO_Items.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PageSecurity.php trunk/PaymentMethods.php trunk/PaymentTerms.php trunk/Payments.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcExpensesTypeTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/PcTypeTabs.php trunk/Prices.php trunk/PricesBasedOnMarkUp.php trunk/PricesByCost.php trunk/Prices_Customer.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PurchData.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SMTPServer.php trunk/SalesAnalReptCols.php trunk/SalesAnalRepts.php trunk/SalesByTypePeriodInquiry.php trunk/SalesCategories.php trunk/SalesCategoryPeriodInquiry.php trunk/SalesGLPostings.php trunk/SalesGraph.php trunk/SalesInquiry.php trunk/SalesPeople.php trunk/SalesTopItemsInquiry.php trunk/SalesTypes.php trunk/SecurityTokens.php trunk/SelectCompletedOrder.php trunk/SelectContract.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectGLAccount.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/SelectWorkOrder.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/Shippers.php trunk/Shipt_Select.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCategories.php trunk/StockCheck.php trunk/StockCostUpdate.php trunk/StockCounts.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItemResearch.php trunk/StockStatus.php trunk/StockTransfers.php trunk/StockUsage.php trunk/Stocks.php trunk/SuppContractChgs.php trunk/SuppCreditGRNs.php trunk/SuppFixedAssetChgs.php trunk/SuppInvGRNs.php trunk/SuppLoginSetup.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SupplierAllocations.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierContacts.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierTenders.php trunk/SupplierTransInquiry.php trunk/SupplierTypes.php trunk/Suppliers.php trunk/SystemParameters.php trunk/Tax.php trunk/TaxAuthorities.php trunk/TaxAuthorityRates.php trunk/TaxCategories.php trunk/TaxGroups.php trunk/TaxProvinces.php trunk/TopItems.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php trunk/UserSettings.php trunk/WOSerialNos.php trunk/WWW_Access.php trunk/WWW_Users.php trunk/WhereUsedInquiry.php trunk/WorkCentres.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/Z_BottomUpCosts.php trunk/Z_ChangeBranchCode.php trunk/Z_ChangeCustomerCode.php trunk/Z_ChangeStockCategory.php trunk/Z_ChangeStockCode.php trunk/Z_CheckDebtorsControl.php trunk/Z_CreateCompanyTemplateFile.php trunk/Z_DataExport.php trunk/Z_DeleteSalesTransActions.php trunk/Z_ImportChartOfAccounts.php trunk/Z_ImportGLAccountGroups.php trunk/Z_ImportGLAccountSections.php trunk/Z_ImportPartCodes.php trunk/Z_MakeNewCompany.php trunk/Z_ReApplyCostToSA.php trunk/Z_RePostGLFromPeriod.php trunk/Z_ReverseSuppPaymentRun.php trunk/Z_UpdateChartDetailsBFwd.php trunk/Z_Upgrade3.10.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/Z_poAddLanguage.php trunk/Z_poEditLangHeader.php trunk/Z_poEditLangModule.php trunk/Z_poEditLangRemaining.php trunk/Z_poRebuildDefault.php trunk/api/api_session.inc trunk/config.distrib.php trunk/doc/Manual/ManualContents.php trunk/doc/Manual/ManualGettingStarted.html trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsExisting.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/InputSerialItemsSequential.php trunk/includes/Login.php trunk/includes/OutputSerialItems.php trunk/includes/header.inc trunk/includes/session.inc trunk/includes/tcpdf/config/tcpdf_config.php trunk/includes/tcpdf/config/tcpdf_config_alt.php trunk/index.php trunk/install/save.php trunk/locale/de_DE.utf8/Manual/ManualContents.php trunk/locale/de_DE.utf8/Manual/ManualGettingStarted.html trunk/locale/zh_CN.utf8/Manual/ManualContents.php trunk/locale/zh_CN.utf8/Manual/ManualGettingStarted.html trunk/locale/zh_HK.utf8/Manual/ManualContents.php trunk/locale/zh_HK.utf8/Manual/ManualGettingStarted.html trunk/reportwriter/FormMaker.php trunk/reportwriter/ReportMaker.php Removed Paths: ------------- trunk/phpinfo.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AccountGroups.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -263,8 +263,8 @@ <td>' . $myrow[2] . '</td> <td>' . $PandLText . '</td> <td>' . $myrow[4] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_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>'; + 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>'; } //END WHILE LIST LOOP echo '</table>'; @@ -272,12 +272,12 @@ if (isset($_POST['SelectedAccountGroup']) OR isset($_GET['SelectedAccountGroup'])) { - echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review Account Groups') . '</a></div>'; + echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) .'">' . _('Review Account Groups') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo '<br /><form method="post" id="AccountGroups" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<br /><form method="post" id="AccountGroups" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AccountSections.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -193,11 +193,11 @@ } echo '<td>' . $myrow[0] . '</td><td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; if ( $myrow[0] == '1' || $myrow[0] == '2' ) { echo '<td><b>'._('Restricted').'</b></td>'; } else { - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; } echo '</tr>'; } //END WHILE LIST LOOP @@ -206,12 +206,12 @@ if (isset($_POST['SelectedSectionID']) or isset($_GET['SelectedSectionID'])) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Account Sections') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Review Account Sections') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo '<form method="post" name="AccountSections" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" name="AccountSections" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedSectionID'])) { Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AddCustomerContacts.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -154,10 +154,10 @@ $myrow['email'], $myrow['email'], $myrow['notes'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['contid'], $myrow['debtorno'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['contid'], $myrow['debtorno']); @@ -166,12 +166,12 @@ echo '</table>'; } if (isset($Id)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo .'">' . _('Review all contacts for this Customer') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorNo='.$DebtorNo .'">' . _('Review all contacts for this Customer') . '</a></div>'; } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?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)) { Modified: trunk/AddCustomerNotes.php =================================================================== --- trunk/AddCustomerNotes.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AddCustomerNotes.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -135,10 +135,10 @@ $myrow[3], $myrow[2], $myrow[5], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0], $myrow[1]); @@ -147,13 +147,13 @@ echo '</table>'; } if (isset($Id)) { - echo '<div class="centre"><a href="'.$_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="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DebtorNo='.$DebtorNo.'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID . '&DebtorNo='.$DebtorNo.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { Modified: trunk/AddCustomerTypeNotes.php =================================================================== --- trunk/AddCustomerTypeNotes.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AddCustomerTypeNotes.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -126,10 +126,10 @@ $myrow[3], $myrow[2], $myrow[5], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0], $myrow[1]); @@ -138,14 +138,14 @@ echo '</table>'; } if (isset($Id)) { ?> - <div class="cantre"><a href="<?php echo $_SERVER['PHP_SELF'] . '?' . SID .'&DebtorType='.$DebtorType;?>"><?=_('Review all notes for this Customer Type')?></a></div> + <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> <?php if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?DebtorType='.$DebtorType.'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorType='.$DebtorType.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AgedDebtors.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -457,7 +457,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> <table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AgedSuppliers.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -271,7 +271,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form sction="' . $_SERVER['PHP_SELF'] . '" method="post"> + echo '<form sction="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/Areas.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -161,8 +161,8 @@ } echo '<td>' . $myrow[0] . '</td> <td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedArea=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedArea=' . $myrow[0] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this sales area?') . '\');">' . _('Delete') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedArea=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedArea=' . $myrow[0] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this sales area?') . '\');">' . _('Delete') . '</a></td>'; echo '<td><a href="SelectCustomer.php'. '?Area=' . $myrow[0] . '">' . _('View Customers from this Area') . '</a></td>'; } //END WHILE LIST LOOP @@ -172,13 +172,13 @@ //end of ifs and buts! if (isset($SelectedArea)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Areas Defined') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Review Areas Defined') . '</a></div>'; } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><br />'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '"><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedArea)) { Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AuditTrail.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -34,7 +34,7 @@ // Get list of users $UserResult = DB_query("SELECT userid FROM www_users",$db); -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMExtendedQty.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -260,7 +260,7 @@ echo '<br /> <br /> - <form action=' . $_SERVER['PHP_SELF'] . ' method="post"> + <form action=' . htmlspecialchars($_SERVER['PHP_SELF']) . ' method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr> Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMIndented.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -247,7 +247,7 @@ echo '<br /> <br /> - <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <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> Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMIndentedReverse.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -236,7 +236,7 @@ _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; echo '<br /> <br /> - <form action=' . $_SERVER['PHP_SELF'] . ' method="post"> + <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> Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMInquiry.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -13,7 +13,7 @@ } if (!isset($_POST['StockID'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><b><br /></b>'. + 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') . Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMListing.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -112,7 +112,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="POST"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMs.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -113,7 +113,7 @@ $DrillID=''; } else { $DrillText = '<a href="%s&Select=%s">' . _('Drill Down'); - $DrillLink = $_SERVER['PHP_SELF'] . '?'; + $DrillLink = htmlspecialchars($_SERVER['PHP_SELF']) . '?'; $DrillID=$myrow[0]; } if ($ParentMBflag!='M' AND $ParentMBflag!='G'){ @@ -155,12 +155,12 @@ ConvertSQLDate($myrow[6]), $AutoIssue, $QuantityOnHand, - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $Parent, $myrow[0], $DrillLink, $DrillID, - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $Parent, $myrow[0], $UltimateParent); @@ -413,7 +413,7 @@ break; } - echo '<br /><div class=centre><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Select a Different BOM') . '</a></div><br />'; + echo '<br /><div class=centre><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Select a Different BOM') . '</a></div><br />'; echo '<table class="selection">'; // Display Manufatured Parent Items $sql = "SELECT bom.parent, @@ -432,7 +432,7 @@ if( DB_num_rows($result) > 0 ) { echo '<tr><td><div class="centre">'._('Manufactured parent items').' : '; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -455,7 +455,7 @@ echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Assembly parent items').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -477,7 +477,7 @@ echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Kit sets').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -499,7 +499,7 @@ echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Phantom').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -559,7 +559,7 @@ if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?Select=' . $SelectedParent .'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Select=' . $SelectedParent .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedComponent']) and $InputError !=1) { @@ -825,7 +825,7 @@ if (!isset($SelectedParent)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title . '</p>'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . '<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>'. '</font> <br /> <table class="selection" cellpadding="3" colspan="4"> Modified: trunk/BackupDatabase.php =================================================================== --- trunk/BackupDatabase.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BackupDatabase.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -44,7 +44,7 @@ prnMsg(_('Once you have downloaded the database backup file to your local machine you should use the link below to delete it - backup files can consume a lot of space on your hosting account and will accumulate if not deleted - they also contain sensitive information which would otherwise be available for others to download!'),'info'); echo '<br /> <br /> - <a href="'. $_SERVER['PHP_SELF'] . '?BackupFile=' .$BackupFile .'">' . _('Delete the backup file off the server') . '</a>'; + <a href="'. htmlspecialchars($_SERVER['PHP_SELF']) . '?BackupFile=' .$BackupFile .'">' . _('Delete the backup file off the server') . '</a>'; } else { prnMsg(_('There was some problem producing a backup using mysqldump. Normally this relates to a permissions issue - the web-server user must have permission to write to the companies directory'),'error'); } Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BankAccounts.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -231,9 +231,9 @@ $myrow['bankaddress'], $myrow['currcode'], $DefaultBankAccount, - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $myrow['accountcode'], - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $myrow['accountcode']); } @@ -245,11 +245,11 @@ if (isset($SelectedBankAccount)) { echo '<br />'; - echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Bank Accounts Defined') . '</a></div>'; + echo '<div class="centre"><p><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show All Bank Accounts Defined') . '</a></div>'; echo '<br />'; } -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBankAccount) AND !isset($_GET['delete'])) { Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BankMatching.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -77,7 +77,7 @@ echo '<div class="page_help_text">' . _('Use this screen to match webERP Receipts and Payments to your Bank Statement. Check your bank statement and click the check-box when you find the matching transaction.') . '</div><br />'; -echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<form action="'. htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="Type" value="' . $Type . '">'; Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BankReconciliation.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -8,7 +8,7 @@ include('includes/header.inc'); -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; Modified: trunk/COGSGLPostings.php =================================================================== --- trunk/COGSGLPostings.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/COGSGLPostings.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -110,9 +110,9 @@ $myrow['stkcat'], $myrow['salestype'], $myrow['accountname'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['id'], - $_SERVER['PHP_SELF']. '?', + htmlspecialchars($_SERVER['PHP_SELF']). '?', $myrow['id']); }//end while echo '</table>'; @@ -208,9 +208,9 @@ $myrow['stkcat'], $myrow['salestype'], $myrow['salestype'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['id'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['id']); }//END WHILE LIST LOOP @@ -220,12 +220,12 @@ //end of ifs and buts! if (isset($SelectedCOGSPostingID)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Show all cost of sales posting records') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) .'">' . _('Show all cost of sales posting records') . '</a></div>'; } echo '<br />'; -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedCOGSPostingID)) { Modified: trunk/CompanyPreferences.php =================================================================== --- trunk/CompanyPreferences.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CompanyPreferences.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -153,7 +153,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/ConfirmDispatch_Invoice.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -252,7 +252,7 @@ </table> <br />'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*************************************************************** Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/ContractBOM.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -219,7 +219,7 @@ /* This is where the order as selected should be displayed reflecting any deletions or insertions*/ -echo '<form name="ContractBOMForm" action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '" method="post">'; +echo '<form name="ContractBOMForm" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (count($_SESSION['Contract'.$identifier]->ContractBOM)>0){ @@ -263,7 +263,7 @@ <td>' . $ContractComponent->UOM . '</td> <td class="number">' . $ContractComponent->ItemCost . '</td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/ContractCosting.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -428,7 +428,7 @@ if ($_SESSION['Contract'.$identifier]->Status ==2){//the contract is an order being processed now - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' .SID .'&SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' .SID .'&SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><div class="centre"><input type="submit" name="CloseContract" value="' . _('Close Contract') . '" onclick="return confirm(\'' . _('Closing the contract will prevent further stock being issued to it and charges being made against it. Variances will be taken to the profit and loss account. Are You Sure?') . '\');" /></div>'; echo '</form>'; Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/ContractOtherReqts.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -75,7 +75,7 @@ /* This is where the other requirement as entered/modified should be displayed reflecting any deletions or insertions*/ -echo '<form name="ContractReqtsForm" action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '" method="post">'; +echo '<form name="ContractReqtsForm" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract Other Requirements') . '" alt="" /> ' . _('Contract Other Requirements') . ' - ' . $_SESSION['Contract'.$identifier]->CustomerName.'</p>'; @@ -114,7 +114,7 @@ <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . $ContractComponent->Quantity . '" /></td> <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . $ContractComponent->CostPerUnit . '" /></td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID . 'identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/Contracts.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -748,7 +748,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract') . '" alt="" />' . ' ' . _('Contract: Select Customer') . '</p>'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier .'" name="CustomerSelection" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier=' . $identifier .'" name="CustomerSelection" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding="3" colspan="4" class="selection"> @@ -816,7 +816,7 @@ //end if RequireCustomerSelection } else { /*A customer is already selected so get into the contract setup proper */ - echo '<form name="ContractEntry" enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post">'; + echo '<form name="ContractEntry" enctype="multipart/form-data" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier=' . $identifier . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"> Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CounterSales.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -213,7 +213,7 @@ echo '<br /><br />'; prnMsg(_('This sale has been cancelled as requested'),'success'); - echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a>'; + echo '<br /><br /><a href="' .htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Start a new Counter Sale') . '</a>'; include('includes/footer.inc'); exit; @@ -362,7 +362,7 @@ /* Always do the stuff below */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" name="SelectParts" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier . '" name="SelectParts" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; //Get The exchange rate used for GPPercent calculations on adding or amending items @@ -809,7 +809,7 @@ $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; echo '<td class="number">' . locale_number_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; echo '<td class="number">' . locale_number_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ echo $RowStarter; @@ -1970,7 +1970,7 @@ } else { echo '<img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$rootpath.'/PrintCustTransPortrait.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">'. _('Print this invoice'). ' (' . _('Portrait') . ')</a><br /><br />'; } - echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a></div>'; + echo '<br /><br /><a href="' .htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Start a new Counter Sale') . '</a></div>'; } // There were input errors so don't process nuffin @@ -2186,7 +2186,7 @@ if (isset($SearchResult)) { $j = 1; - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . '" method="post" name="orderform">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID .'identifier='.$identifier . '" method="post" name="orderform">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; echo '<tr><td><input type="hidden" name="previous" value="'.strval($Offset-1).'" /><input tabindex="'.strval($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; Modified: trunk/CreditStatus.php =================================================================== --- trunk/CreditStatus.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CreditStatus.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -175,9 +175,9 @@ $myrow['reasoncode'], $myrow['reasondescription'], $DissallowText, - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $myrow['reasoncode'], - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $myrow['reasoncode']); } //END WHILE LIST LOOP @@ -186,12 +186,12 @@ } //end of ifs and buts! if (isset($SelectedReason)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show Defined Credit Status Codes') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show Defined Credit Status Codes') . '</a></div>'; } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedReason) and ($InputError!=1)) { Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/Credit_Invoice.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -256,7 +256,7 @@ if (!isset($_POST['ProcessCredit'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] .'" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) .'" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -378,7 +378,7 @@ echo '<td class="number">' . $DisplayTaxAmount . '</td> <td class="number">' . $DisplayGrossLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $LnItm->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this item from the credit?') . '\');">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LnItm->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this item from the credit?') . '\');">' . _('Delete') . '</a></td></tr>'; echo '<tr' . $RowStarter . '><td colspan="12"><textarea tabindex=' . $j .' name="Narrative_' . $LnItm->LineNumber . '" cols=100% rows=1>' . $LnItm->Narrative . '</textarea><br /><hr></td></tr>'; $j++; Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/Currencies.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -264,10 +264,10 @@ $myrow['decimalplaces'], locale_number_format($myrow['rate'],5), locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['currabrev'], _('Edit'), - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['currabrev'], _('Delete'), $rootpath, @@ -298,14 +298,14 @@ if (isset($SelectedCurrency)) { - echo '<div class="centre"><a href="' .$_SERVER['PHP_SELF'] . '">'._('Show all currency definitions').'</a></div>'; + echo '<div class="centre"><a href="' .htmlspecialchars($_SERVER['PHP_SELF']) . '">'._('Show all currency definitions').'</a></div>'; } echo '<br />'; if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedCurrency) AND $SelectedCurrency!='') { Modified: trunk/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustEDISetup.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -69,7 +69,7 @@ } } -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class="selection">'; Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustLoginSetup.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -112,7 +112,7 @@ } -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection"> Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustWhereAlloc.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -6,7 +6,7 @@ $title = _('Customer How Paid Inquiry'); include('includes/header.inc'); -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerAllocations.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -336,7 +336,7 @@ if (isset($_POST['AllocTrans'])) { // Page called with trans number - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type=hidden name="AllocTrans" value="' . $_POST['AllocTrans'] . '" />'; @@ -473,7 +473,7 @@ <td>' . ConvertSQLDate($myrow['trandate']) . '</td> <td class=number>' . locale_number_format($myrow['total'],2) . '</td> <td class=number>' . locale_number_format($myrow['total']-$myrow['alloc'],2) . '</td>'; - echo '<td><a href=' . $_SERVER['PHP_SELF']. '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; + echo '<td><a href=' . htmlspecialchars($_SERVER['PHP_SELF']). '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; } DB_free_result($result); echo '</table><p>'; @@ -511,7 +511,7 @@ $k=0; while ($myrow = DB_fetch_array($result)) { - $allocate = '<a href=' . $_SERVER['PHP_SELF']. '?' . SID . '&AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a>'; + $allocate = '<a href=' . htmlspecialchars($_SERVER['PHP_SELF']). '?' . SID . '&AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a>'; if ( $curDebtor != $myrow['debtorno'] ) { if ( $curTrans > 1 ) { Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerBranches.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -408,11 +408,11 @@ $myrow[8], $myrow[9], ($myrow[11]?_('No'):_('Yes')), - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $DebtorNo, urlencode($myrow[1]), _('Edit'), - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $DebtorNo, urlencode($myrow[1]), _('Delete Branch')); @@ -456,7 +456,7 @@ } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBranch)) { @@ -532,7 +532,7 @@ echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { - echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; + echo '<div class="centre"><a href=' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } echo '<br /><table class="selection">'; echo '<tr><th colspan=2><div class="centre"><b>'._('Change Branch').'</b></th></tr>'; Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerInquiry.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -147,7 +147,7 @@ </tr> </table>'; -echo '<br /><div class="centre"><form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<br /><div class="centre"><form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo _('Show all transactions after') . ': <input tabindex=1 type="text" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" name="TransAfterDate" value="' . $_POST['TransAfterDate'] . '" maxlength =10 size=12>' . '<input tabindex=2 type="submit" name="Refresh Inquiry" value="' . _('Refresh Inquiry') . '"></div> </form> Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerReceipt.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -702,7 +702,7 @@ /*set up the form whatever */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?Type='.$_GET['Type'] . '" method="post" name="form1">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Type='.$_GET['Type'] . '" method="post" name="form1">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*show the batch header details and the entries in the batch so far */ @@ -862,7 +862,7 @@ <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> <td>'.$ReceiptItem->Narrative . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $ReceiptItem->ID . '&Type=' . $_GET['Type']. '">' . _('Delete') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $ReceiptItem->ID . '&Type=' . $_GET['Type']. '">' . _('Delete') . '</a></td> </tr>'; $BatchTotal= $BatchTotal + $ReceiptItem->Amount; } Modified: trunk/CustomerTransInquiry.php =================================================================== --- trunk/CustomerTransInquiry.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerTransInquiry.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -10,7 +10,7 @@ echo '<div class="page_help_text">' . _('Choose which type of transaction to report on.') . '</div> <br />'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding=2 class=selection><tr>'; Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerTypes.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -204,9 +204,9 @@ </tr>', $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0]); } //END WHILE LIST LOOP @@ -216,11 +216,11 @@ //end of ifs and buts! if (isset($SelectedType)) { - echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Types Defined') . '</a></div><p>'; + echo '<div class="centre"><p><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show All Types Defined') . '</a></div><p>'; } if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/Customers.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -443,11 +443,11 @@ } if ($SetupErrors>0) { - echo '<br /><div class=centre><a href="'.$_SERVER['PHP_SELF'] .'" >'._('Click here to continue').'</a></div>'; + echo '<br /><div class=centre><a href="'.htmlspecialchars($_SERVER['PHP_SELF']) .'" >'._('Click here to continue').'</a></div>'; include('includes/footer.inc'); exit; } - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="New" value="Yes" />'; @@ -618,7 +618,7 @@ //DebtorNo exists - either passed when calling the form or from the form itself - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection cellspacing=4> <tr><td valign=top><table class=selection>'; @@ -981,7 +981,7 @@ $myrow['notes'], $myrow['contid'], $myrow['debtorno'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['contid'], $myrow['debtorno']); } Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/DailyBankTransactions.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -10,7 +10,7 @@ _('Search') . '" alt="" />' . ' ' . $title.'</p>'; if (!isset($_POST['Show'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -132,7 +132,7 @@ echo '</table>'; } //end if no bank trans in the range to show - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><div class="centre"><input type="submit" name="Return" value="' . _('Select Another Date'). '"></div>'; echo '</form>'; Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/DailySalesInquiry.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -10,7 +10,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Daily Sales') . '" alt="" />' . ' ' . _('Daily Sales') . '</p>'; echo '<div class="page_help_text">' . _('Select the month to show daily sales for') . '</div><br />'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding=2 class=selection><tr>'; Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/DebtorsAtPeriodEnd.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -129,7 +129,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/DeliveryDetails.php =================================================================== --- ... [truncated message content] |
From: <dai...@us...> - 2011-10-29 03:26:39
|
Revision: 4734 http://web-erp.svn.sourceforge.net/web-erp/?rev=4734&view=rev Author: daintree Date: 2011-10-29 03:26:27 +0000 (Sat, 29 Oct 2011) Log Message: ----------- security fixes per adv...@ht... Modified Paths: -------------- trunk/AccountGroups.php trunk/AccountSections.php trunk/AddCustomerContacts.php trunk/AddCustomerNotes.php trunk/AddCustomerTypeNotes.php trunk/AgedDebtors.php trunk/AgedSuppliers.php trunk/Areas.php trunk/AuditTrail.php trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMInquiry.php trunk/BOMListing.php trunk/BOMs.php trunk/BackupDatabase.php trunk/BankAccounts.php trunk/BankMatching.php trunk/BankReconciliation.php trunk/COGSGLPostings.php trunk/CompanyPreferences.php trunk/ConfirmDispatch_Invoice.php trunk/ContractBOM.php trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/CounterSales.php trunk/CreditStatus.php trunk/Credit_Invoice.php trunk/Currencies.php trunk/CustEDISetup.php trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerAllocations.php trunk/CustomerBranches.php trunk/CustomerInquiry.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/CustomerTypes.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DeliveryDetails.php trunk/DiscountCategories.php trunk/DiscountMatrix.php trunk/EDIMessageFormat.php trunk/EmailCustTrans.php trunk/ExchangeRateTrend.php trunk/FTP_RadioBeacon.php trunk/Factors.php trunk/FixedAssetCategories.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/FixedAssetLocations.php trunk/FixedAssetRegister.php trunk/FixedAssetTransfer.php trunk/FormDesigner.php trunk/FreightCosts.php trunk/GLAccountCSV.php trunk/GLAccountInquiry.php trunk/GLAccountReport.php trunk/GLAccounts.php trunk/GLBalanceSheet.php trunk/GLBudgets.php trunk/GLJournal.php trunk/GLProfit_Loss.php trunk/GLTagProfit_Loss.php trunk/GLTags.php trunk/GLTrialBalance.php trunk/GLTrialBalance_csv.php trunk/GeocodeSetup.php trunk/GoodsReceived.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryQuantities.php trunk/InventoryValuation.php trunk/Labels.php trunk/Locations.php trunk/MRP.php trunk/MRPCalendar.php trunk/MRPCreateDemands.php trunk/MRPDemandTypes.php trunk/MRPDemands.php trunk/MRPPlannedPurchaseOrders.php trunk/MRPPlannedWorkOrders.php trunk/MRPReport.php trunk/MRPReschedules.php trunk/MRPShortages.php trunk/OffersReceived.php trunk/OutstandingGRNs.php trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFRemittanceAdvice.php trunk/PDFStockCheckComparison.php trunk/PDFStockLocTransfer.php trunk/PDFStockTransfer.php trunk/PDFSuppTransListing.php trunk/POReport.php trunk/PO_AuthorisationLevels.php trunk/PO_AuthoriseMyOrders.php trunk/PO_Header.php trunk/PO_Items.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PageSecurity.php trunk/PaymentMethods.php trunk/PaymentTerms.php trunk/Payments.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcExpensesTypeTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/PcTypeTabs.php trunk/Prices.php trunk/PricesBasedOnMarkUp.php trunk/PricesByCost.php trunk/Prices_Customer.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PurchData.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SMTPServer.php trunk/SalesAnalReptCols.php trunk/SalesAnalRepts.php trunk/SalesByTypePeriodInquiry.php trunk/SalesCategories.php trunk/SalesCategoryPeriodInquiry.php trunk/SalesGLPostings.php trunk/SalesGraph.php trunk/SalesInquiry.php trunk/SalesPeople.php trunk/SalesTopItemsInquiry.php trunk/SalesTypes.php trunk/SecurityTokens.php trunk/SelectCompletedOrder.php trunk/SelectContract.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/SelectGLAccount.php trunk/SelectOrderItems.php trunk/SelectProduct.php trunk/SelectRecurringSalesOrder.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/SelectWorkOrder.php trunk/ShipmentCosting.php trunk/Shipments.php trunk/Shippers.php trunk/Shipt_Select.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCategories.php trunk/StockCheck.php trunk/StockCostUpdate.php trunk/StockCounts.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItemResearch.php trunk/StockStatus.php trunk/StockTransfers.php trunk/StockUsage.php trunk/Stocks.php trunk/SuppContractChgs.php trunk/SuppCreditGRNs.php trunk/SuppFixedAssetChgs.php trunk/SuppInvGRNs.php trunk/SuppLoginSetup.php trunk/SuppPaymentRun.php trunk/SuppPriceList.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SupplierAllocations.php trunk/SupplierBalsAtPeriodEnd.php trunk/SupplierContacts.php trunk/SupplierCredit.php trunk/SupplierInquiry.php trunk/SupplierInvoice.php trunk/SupplierTenders.php trunk/SupplierTransInquiry.php trunk/SupplierTypes.php trunk/Suppliers.php trunk/SystemParameters.php trunk/Tax.php trunk/TaxAuthorities.php trunk/TaxAuthorityRates.php trunk/TaxCategories.php trunk/TaxGroups.php trunk/TaxProvinces.php trunk/TopItems.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php trunk/UserSettings.php trunk/WOSerialNos.php trunk/WWW_Access.php trunk/WWW_Users.php trunk/WhereUsedInquiry.php trunk/WorkCentres.php trunk/WorkOrderCosting.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/Z_BottomUpCosts.php trunk/Z_ChangeBranchCode.php trunk/Z_ChangeCustomerCode.php trunk/Z_ChangeStockCategory.php trunk/Z_ChangeStockCode.php trunk/Z_CheckDebtorsControl.php trunk/Z_CreateCompanyTemplateFile.php trunk/Z_DataExport.php trunk/Z_DeleteSalesTransActions.php trunk/Z_ImportChartOfAccounts.php trunk/Z_ImportGLAccountGroups.php trunk/Z_ImportGLAccountSections.php trunk/Z_ImportPartCodes.php trunk/Z_MakeNewCompany.php trunk/Z_ReApplyCostToSA.php trunk/Z_RePostGLFromPeriod.php trunk/Z_ReverseSuppPaymentRun.php trunk/Z_UpdateChartDetailsBFwd.php trunk/Z_Upgrade3.10.php trunk/Z_Upgrade_3.04-3.05.php trunk/Z_Upgrade_3.05-3.06.php trunk/Z_Upgrade_3.07-3.08.php trunk/Z_Upgrade_3.08-3.09.php trunk/Z_Upgrade_3.09-3.10.php trunk/Z_Upgrade_3.10-3.11.php trunk/Z_Upgrade_3.11-4.00.php trunk/Z_poAddLanguage.php trunk/Z_poEditLangHeader.php trunk/Z_poEditLangModule.php trunk/Z_poEditLangRemaining.php trunk/Z_poRebuildDefault.php trunk/api/api_session.inc trunk/config.distrib.php trunk/doc/Manual/ManualContents.php trunk/doc/Manual/ManualGettingStarted.html trunk/includes/InputSerialItems.php trunk/includes/InputSerialItemsExisting.php trunk/includes/InputSerialItemsKeyed.php trunk/includes/InputSerialItemsSequential.php trunk/includes/Login.php trunk/includes/OutputSerialItems.php trunk/includes/header.inc trunk/includes/session.inc trunk/includes/tcpdf/config/tcpdf_config.php trunk/includes/tcpdf/config/tcpdf_config_alt.php trunk/index.php trunk/install/save.php trunk/locale/de_DE.utf8/Manual/ManualContents.php trunk/locale/de_DE.utf8/Manual/ManualGettingStarted.html trunk/locale/zh_CN.utf8/Manual/ManualContents.php trunk/locale/zh_CN.utf8/Manual/ManualGettingStarted.html trunk/locale/zh_HK.utf8/Manual/ManualContents.php trunk/locale/zh_HK.utf8/Manual/ManualGettingStarted.html trunk/reportwriter/FormMaker.php trunk/reportwriter/ReportMaker.php Removed Paths: ------------- trunk/phpinfo.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AccountGroups.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -263,8 +263,8 @@ <td>' . $myrow[2] . '</td> <td>' . $PandLText . '</td> <td>' . $myrow[4] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_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>'; + 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>'; } //END WHILE LIST LOOP echo '</table>'; @@ -272,12 +272,12 @@ if (isset($_POST['SelectedAccountGroup']) OR isset($_GET['SelectedAccountGroup'])) { - echo '<br /><div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review Account Groups') . '</a></div>'; + echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) .'">' . _('Review Account Groups') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo '<br /><form method="post" id="AccountGroups" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<br /><form method="post" id="AccountGroups" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/AccountSections.php =================================================================== --- trunk/AccountSections.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AccountSections.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -193,11 +193,11 @@ } echo '<td>' . $myrow[0] . '</td><td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedSectionID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; if ( $myrow[0] == '1' || $myrow[0] == '2' ) { echo '<td><b>'._('Restricted').'</b></td>'; } else { - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedSectionID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; } echo '</tr>'; } //END WHILE LIST LOOP @@ -206,12 +206,12 @@ if (isset($_POST['SelectedSectionID']) or isset($_GET['SelectedSectionID'])) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Account Sections') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Review Account Sections') . '</a></div>'; } if (! isset($_GET['delete'])) { - echo '<form method="post" name="AccountSections" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" name="AccountSections" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedSectionID'])) { Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AddCustomerContacts.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -154,10 +154,10 @@ $myrow['email'], $myrow['email'], $myrow['notes'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['contid'], $myrow['debtorno'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['contid'], $myrow['debtorno']); @@ -166,12 +166,12 @@ echo '</table>'; } if (isset($Id)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?DebtorNo='.$DebtorNo .'">' . _('Review all contacts for this Customer') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorNo='.$DebtorNo .'">' . _('Review all contacts for this Customer') . '</a></div>'; } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?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)) { Modified: trunk/AddCustomerNotes.php =================================================================== --- trunk/AddCustomerNotes.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AddCustomerNotes.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -135,10 +135,10 @@ $myrow[3], $myrow[2], $myrow[5], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0], $myrow[1]); @@ -147,13 +147,13 @@ echo '</table>'; } if (isset($Id)) { - echo '<div class="centre"><a href="'.$_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="' . $_SERVER['PHP_SELF'] . '?' . SID . '&DebtorNo='.$DebtorNo.'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID . '&DebtorNo='.$DebtorNo.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { Modified: trunk/AddCustomerTypeNotes.php =================================================================== --- trunk/AddCustomerTypeNotes.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AddCustomerTypeNotes.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -126,10 +126,10 @@ $myrow[3], $myrow[2], $myrow[5], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0], $myrow[1]); @@ -138,14 +138,14 @@ echo '</table>'; } if (isset($Id)) { ?> - <div class="cantre"><a href="<?php echo $_SERVER['PHP_SELF'] . '?' . SID .'&DebtorType='.$DebtorType;?>"><?=_('Review all notes for this Customer Type')?></a></div> + <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> <?php if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?DebtorType='.$DebtorType.'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorType='.$DebtorType.'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($Id)) { Modified: trunk/AgedDebtors.php =================================================================== --- trunk/AgedDebtors.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AgedDebtors.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -457,7 +457,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> <table>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/AgedSuppliers.php =================================================================== --- trunk/AgedSuppliers.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AgedSuppliers.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -271,7 +271,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form sction="' . $_SERVER['PHP_SELF'] . '" method="post"> + echo '<form sction="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/Areas.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -161,8 +161,8 @@ } echo '<td>' . $myrow[0] . '</td> <td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedArea=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedArea=' . $myrow[0] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this sales area?') . '\');">' . _('Delete') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedArea=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedArea=' . $myrow[0] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this sales area?') . '\');">' . _('Delete') . '</a></td>'; echo '<td><a href="SelectCustomer.php'. '?Area=' . $myrow[0] . '">' . _('View Customers from this Area') . '</a></td>'; } //END WHILE LIST LOOP @@ -172,13 +172,13 @@ //end of ifs and buts! if (isset($SelectedArea)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Areas Defined') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Review Areas Defined') . '</a></div>'; } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"><br />'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '"><br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedArea)) { Modified: trunk/AuditTrail.php =================================================================== --- trunk/AuditTrail.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/AuditTrail.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -34,7 +34,7 @@ // Get list of users $UserResult = DB_query("SELECT userid FROM www_users",$db); -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMExtendedQty.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -260,7 +260,7 @@ echo '<br /> <br /> - <form action=' . $_SERVER['PHP_SELF'] . ' method="post"> + <form action=' . htmlspecialchars($_SERVER['PHP_SELF']) . ' method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr> Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMIndented.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -247,7 +247,7 @@ echo '<br /> <br /> - <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <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> Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMIndentedReverse.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -236,7 +236,7 @@ _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; echo '<br /> <br /> - <form action=' . $_SERVER['PHP_SELF'] . ' method="post"> + <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> Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMInquiry.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -13,7 +13,7 @@ } if (!isset($_POST['StockID'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><b><br /></b>'. + 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') . Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMListing.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -112,7 +112,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"> + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="POST"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BOMs.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -113,7 +113,7 @@ $DrillID=''; } else { $DrillText = '<a href="%s&Select=%s">' . _('Drill Down'); - $DrillLink = $_SERVER['PHP_SELF'] . '?'; + $DrillLink = htmlspecialchars($_SERVER['PHP_SELF']) . '?'; $DrillID=$myrow[0]; } if ($ParentMBflag!='M' AND $ParentMBflag!='G'){ @@ -155,12 +155,12 @@ ConvertSQLDate($myrow[6]), $AutoIssue, $QuantityOnHand, - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $Parent, $myrow[0], $DrillLink, $DrillID, - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $Parent, $myrow[0], $UltimateParent); @@ -413,7 +413,7 @@ break; } - echo '<br /><div class=centre><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Select a Different BOM') . '</a></div><br />'; + echo '<br /><div class=centre><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Select a Different BOM') . '</a></div><br />'; echo '<table class="selection">'; // Display Manufatured Parent Items $sql = "SELECT bom.parent, @@ -432,7 +432,7 @@ if( DB_num_rows($result) > 0 ) { echo '<tr><td><div class="centre">'._('Manufactured parent items').' : '; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -455,7 +455,7 @@ echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Assembly parent items').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -477,7 +477,7 @@ echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Kit sets').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -499,7 +499,7 @@ echo (($reqnl)?'<br />':'').'<tr><td><div class="centre">'._('Phantom').' : '; $ix = 0; while ($myrow = DB_fetch_array($result)){ - echo (($ix)?', ':'').'<a href="'.$_SERVER['PHP_SELF'] . '?Select='.$myrow['parent'].'">'. + echo (($ix)?', ':'').'<a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?Select='.$myrow['parent'].'">'. $myrow['description'].' ('.$myrow['parent'].')</a>'; $ix++; } //end while loop @@ -559,7 +559,7 @@ if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?Select=' . $SelectedParent .'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Select=' . $SelectedParent .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['SelectedComponent']) and $InputError !=1) { @@ -825,7 +825,7 @@ if (!isset($SelectedParent)) { echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="">' . ' ' . $title . '</p>'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">' . + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">' . '<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>'. '</font> <br /> <table class="selection" cellpadding="3" colspan="4"> Modified: trunk/BackupDatabase.php =================================================================== --- trunk/BackupDatabase.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BackupDatabase.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -44,7 +44,7 @@ prnMsg(_('Once you have downloaded the database backup file to your local machine you should use the link below to delete it - backup files can consume a lot of space on your hosting account and will accumulate if not deleted - they also contain sensitive information which would otherwise be available for others to download!'),'info'); echo '<br /> <br /> - <a href="'. $_SERVER['PHP_SELF'] . '?BackupFile=' .$BackupFile .'">' . _('Delete the backup file off the server') . '</a>'; + <a href="'. htmlspecialchars($_SERVER['PHP_SELF']) . '?BackupFile=' .$BackupFile .'">' . _('Delete the backup file off the server') . '</a>'; } else { prnMsg(_('There was some problem producing a backup using mysqldump. Normally this relates to a permissions issue - the web-server user must have permission to write to the companies directory'),'error'); } Modified: trunk/BankAccounts.php =================================================================== --- trunk/BankAccounts.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BankAccounts.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -231,9 +231,9 @@ $myrow['bankaddress'], $myrow['currcode'], $DefaultBankAccount, - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $myrow['accountcode'], - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $myrow['accountcode']); } @@ -245,11 +245,11 @@ if (isset($SelectedBankAccount)) { echo '<br />'; - echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Bank Accounts Defined') . '</a></div>'; + echo '<div class="centre"><p><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show All Bank Accounts Defined') . '</a></div>'; echo '<br />'; } -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBankAccount) AND !isset($_GET['delete'])) { Modified: trunk/BankMatching.php =================================================================== --- trunk/BankMatching.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BankMatching.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -77,7 +77,7 @@ echo '<div class="page_help_text">' . _('Use this screen to match webERP Receipts and Payments to your Bank Statement. Check your bank statement and click the check-box when you find the matching transaction.') . '</div><br />'; -echo '<form action="'. $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<form action="'. htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="Type" value="' . $Type . '">'; Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/BankReconciliation.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -8,7 +8,7 @@ include('includes/header.inc'); -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; Modified: trunk/COGSGLPostings.php =================================================================== --- trunk/COGSGLPostings.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/COGSGLPostings.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -110,9 +110,9 @@ $myrow['stkcat'], $myrow['salestype'], $myrow['accountname'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['id'], - $_SERVER['PHP_SELF']. '?', + htmlspecialchars($_SERVER['PHP_SELF']). '?', $myrow['id']); }//end while echo '</table>'; @@ -208,9 +208,9 @@ $myrow['stkcat'], $myrow['salestype'], $myrow['salestype'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['id'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['id']); }//END WHILE LIST LOOP @@ -220,12 +220,12 @@ //end of ifs and buts! if (isset($SelectedCOGSPostingID)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Show all cost of sales posting records') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) .'">' . _('Show all cost of sales posting records') . '</a></div>'; } echo '<br />'; -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedCOGSPostingID)) { Modified: trunk/CompanyPreferences.php =================================================================== --- trunk/CompanyPreferences.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CompanyPreferences.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -153,7 +153,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/ConfirmDispatch_Invoice.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -252,7 +252,7 @@ </table> <br />'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*************************************************************** Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/ContractBOM.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -219,7 +219,7 @@ /* This is where the order as selected should be displayed reflecting any deletions or insertions*/ -echo '<form name="ContractBOMForm" action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '" method="post">'; +echo '<form name="ContractBOMForm" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (count($_SESSION['Contract'.$identifier]->ContractBOM)>0){ @@ -263,7 +263,7 @@ <td>' . $ContractComponent->UOM . '</td> <td class="number">' . $ContractComponent->ItemCost . '</td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/ContractCosting.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -428,7 +428,7 @@ if ($_SESSION['Contract'.$identifier]->Status ==2){//the contract is an order being processed now - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?' .SID .'&SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' .SID .'&SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><div class="centre"><input type="submit" name="CloseContract" value="' . _('Close Contract') . '" onclick="return confirm(\'' . _('Closing the contract will prevent further stock being issued to it and charges being made against it. Variances will be taken to the profit and loss account. Are You Sure?') . '\');" /></div>'; echo '</form>'; Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/ContractOtherReqts.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -75,7 +75,7 @@ /* This is where the other requirement as entered/modified should be displayed reflecting any deletions or insertions*/ -echo '<form name="ContractReqtsForm" action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '" method="post">'; +echo '<form name="ContractReqtsForm" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract Other Requirements') . '" alt="" /> ' . _('Contract Other Requirements') . ' - ' . $_SESSION['Contract'.$identifier]->CustomerName.'</p>'; @@ -114,7 +114,7 @@ <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . $ContractComponent->Quantity . '" /></td> <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . $ContractComponent->CostPerUnit . '" /></td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID . 'identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/Contracts.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -748,7 +748,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract') . '" alt="" />' . ' ' . _('Contract: Select Customer') . '</p>'; - echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier .'" name="CustomerSelection" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier=' . $identifier .'" name="CustomerSelection" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding="3" colspan="4" class="selection"> @@ -816,7 +816,7 @@ //end if RequireCustomerSelection } else { /*A customer is already selected so get into the contract setup proper */ - echo '<form name="ContractEntry" enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method="post">'; + echo '<form name="ContractEntry" enctype="multipart/form-data" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier=' . $identifier . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"> Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CounterSales.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -213,7 +213,7 @@ echo '<br /><br />'; prnMsg(_('This sale has been cancelled as requested'),'success'); - echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a>'; + echo '<br /><br /><a href="' .htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Start a new Counter Sale') . '</a>'; include('includes/footer.inc'); exit; @@ -362,7 +362,7 @@ /* Always do the stuff below */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '" name="SelectParts" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier . '" name="SelectParts" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; //Get The exchange rate used for GPPercent calculations on adding or amending items @@ -809,7 +809,7 @@ $_SESSION['Items'.$identifier]->TaxGLCodes=$TaxGLCodes; echo '<td class="number">' . locale_number_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; echo '<td class="number">' . locale_number_format($SubTotal + $TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces) . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier . '&Delete=' . $OrderLine->LineNumber . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">' . _('Delete') . '</a></td></tr>'; if ($_SESSION['AllowOrderLineItemNarrative'] == 1){ echo $RowStarter; @@ -1970,7 +1970,7 @@ } else { echo '<img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . '<a target="_blank" href="'.$rootpath.'/PrintCustTransPortrait.php?FromTransNo='.$InvoiceNo.'&InvOrCredit=Invoice&PrintPDF=True">'. _('Print this invoice'). ' (' . _('Portrait') . ')</a><br /><br />'; } - echo '<br /><br /><a href="' .$_SERVER['PHP_SELF'] . '">' . _('Start a new Counter Sale') . '</a></div>'; + echo '<br /><br /><a href="' .htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Start a new Counter Sale') . '</a></div>'; } // There were input errors so don't process nuffin @@ -2186,7 +2186,7 @@ if (isset($SearchResult)) { $j = 1; - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . '" method="post" name="orderform">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID .'identifier='.$identifier . '" method="post" name="orderform">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="table1">'; echo '<tr><td><input type="hidden" name="previous" value="'.strval($Offset-1).'" /><input tabindex="'.strval($j+7).'" type="submit" name="Prev" value="'._('Prev').'" /></td>'; Modified: trunk/CreditStatus.php =================================================================== --- trunk/CreditStatus.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CreditStatus.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -175,9 +175,9 @@ $myrow['reasoncode'], $myrow['reasondescription'], $DissallowText, - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $myrow['reasoncode'], - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $myrow['reasoncode']); } //END WHILE LIST LOOP @@ -186,12 +186,12 @@ } //end of ifs and buts! if (isset($SelectedReason)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show Defined Credit Status Codes') . '</a></div>'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show Defined Credit Status Codes') . '</a></div>'; } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedReason) and ($InputError!=1)) { Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/Credit_Invoice.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -256,7 +256,7 @@ if (!isset($_POST['ProcessCredit'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] .'" method="post">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) .'" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; @@ -378,7 +378,7 @@ echo '<td class="number">' . $DisplayTaxAmount . '</td> <td class="number">' . $DisplayGrossLineTotal . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $LnItm->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this item from the credit?') . '\');">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $LnItm->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this item from the credit?') . '\');">' . _('Delete') . '</a></td></tr>'; echo '<tr' . $RowStarter . '><td colspan="12"><textarea tabindex=' . $j .' name="Narrative_' . $LnItm->LineNumber . '" cols=100% rows=1>' . $LnItm->Narrative . '</textarea><br /><hr></td></tr>'; $j++; Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/Currencies.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -264,10 +264,10 @@ $myrow['decimalplaces'], locale_number_format($myrow['rate'],5), locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['currabrev'], _('Edit'), - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['currabrev'], _('Delete'), $rootpath, @@ -298,14 +298,14 @@ if (isset($SelectedCurrency)) { - echo '<div class="centre"><a href="' .$_SERVER['PHP_SELF'] . '">'._('Show all currency definitions').'</a></div>'; + echo '<div class="centre"><a href="' .htmlspecialchars($_SERVER['PHP_SELF']) . '">'._('Show all currency definitions').'</a></div>'; } echo '<br />'; if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedCurrency) AND $SelectedCurrency!='') { Modified: trunk/CustEDISetup.php =================================================================== --- trunk/CustEDISetup.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustEDISetup.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -69,7 +69,7 @@ } } -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class="selection">'; Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustLoginSetup.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -112,7 +112,7 @@ } -echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection"> Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustWhereAlloc.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -6,7 +6,7 @@ $title = _('Customer How Paid Inquiry'); include('includes/header.inc'); -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerAllocations.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -336,7 +336,7 @@ if (isset($_POST['AllocTrans'])) { // Page called with trans number - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type=hidden name="AllocTrans" value="' . $_POST['AllocTrans'] . '" />'; @@ -473,7 +473,7 @@ <td>' . ConvertSQLDate($myrow['trandate']) . '</td> <td class=number>' . locale_number_format($myrow['total'],2) . '</td> <td class=number>' . locale_number_format($myrow['total']-$myrow['alloc'],2) . '</td>'; - echo '<td><a href=' . $_SERVER['PHP_SELF']. '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; + echo '<td><a href=' . htmlspecialchars($_SERVER['PHP_SELF']). '?AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a></td></tr>'; } DB_free_result($result); echo '</table><p>'; @@ -511,7 +511,7 @@ $k=0; while ($myrow = DB_fetch_array($result)) { - $allocate = '<a href=' . $_SERVER['PHP_SELF']. '?' . SID . '&AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a>'; + $allocate = '<a href=' . htmlspecialchars($_SERVER['PHP_SELF']). '?' . SID . '&AllocTrans=' . $myrow['id'] . '>' . _('Allocate') . '</a>'; if ( $curDebtor != $myrow['debtorno'] ) { if ( $curTrans > 1 ) { Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerBranches.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -408,11 +408,11 @@ $myrow[8], $myrow[9], ($myrow[11]?_('No'):_('Yes')), - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $DebtorNo, urlencode($myrow[1]), _('Edit'), - $_SERVER['PHP_SELF'], + htmlspecialchars($_SERVER['PHP_SELF']), $DebtorNo, urlencode($myrow[1]), _('Delete Branch')); @@ -456,7 +456,7 @@ } if (!isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] .'">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) .'">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($SelectedBranch)) { @@ -532,7 +532,7 @@ echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Change Details for Branch'). ' '. $SelectedBranch . '</p>'; if (isset($SelectedBranch)) { - echo '<div class="centre"><a href=' . $_SERVER['PHP_SELF'] . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; + echo '<div class="centre"><a href=' . htmlspecialchars($_SERVER['PHP_SELF']) . '?DebtorNo=' . $DebtorNo. '>' . _('Show all branches defined for'). ' '. $DebtorNo . '</a></div>'; } echo '<br /><table class="selection">'; echo '<tr><th colspan=2><div class="centre"><b>'._('Change Branch').'</b></th></tr>'; Modified: trunk/CustomerInquiry.php =================================================================== --- trunk/CustomerInquiry.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerInquiry.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -147,7 +147,7 @@ </tr> </table>'; -echo '<br /><div class="centre"><form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<br /><div class="centre"><form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo _('Show all transactions after') . ': <input tabindex=1 type="text" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" id="datepicker" name="TransAfterDate" value="' . $_POST['TransAfterDate'] . '" maxlength =10 size=12>' . '<input tabindex=2 type="submit" name="Refresh Inquiry" value="' . _('Refresh Inquiry') . '"></div> </form> Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerReceipt.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -702,7 +702,7 @@ /*set up the form whatever */ -echo '<form action="' . $_SERVER['PHP_SELF'] . '?Type='.$_GET['Type'] . '" method="post" name="form1">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Type='.$_GET['Type'] . '" method="post" name="form1">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; /*show the batch header details and the entries in the batch so far */ @@ -862,7 +862,7 @@ <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> <td>'.$ReceiptItem->Narrative . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $ReceiptItem->ID . '&Type=' . $_GET['Type']. '">' . _('Delete') . '</a></td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=' . $ReceiptItem->ID . '&Type=' . $_GET['Type']. '">' . _('Delete') . '</a></td> </tr>'; $BatchTotal= $BatchTotal + $ReceiptItem->Amount; } Modified: trunk/CustomerTransInquiry.php =================================================================== --- trunk/CustomerTransInquiry.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerTransInquiry.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -10,7 +10,7 @@ echo '<div class="page_help_text">' . _('Choose which type of transaction to report on.') . '</div> <br />'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding=2 class=selection><tr>'; Modified: trunk/CustomerTypes.php =================================================================== --- trunk/CustomerTypes.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/CustomerTypes.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -204,9 +204,9 @@ </tr>', $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow[0]); } //END WHILE LIST LOOP @@ -216,11 +216,11 @@ //end of ifs and buts! if (isset($SelectedType)) { - echo '<div class="centre"><p><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Types Defined') . '</a></div><p>'; + echo '<div class="centre"><p><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show All Types Defined') . '</a></div><p>'; } if (! isset($_GET['delete'])) { - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/Customers.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -443,11 +443,11 @@ } if ($SetupErrors>0) { - echo '<br /><div class=centre><a href="'.$_SERVER['PHP_SELF'] .'" >'._('Click here to continue').'</a></div>'; + echo '<br /><div class=centre><a href="'.htmlspecialchars($_SERVER['PHP_SELF']) .'" >'._('Click here to continue').'</a></div>'; include('includes/footer.inc'); exit; } - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="New" value="Yes" />'; @@ -618,7 +618,7 @@ //DebtorNo exists - either passed when calling the form or from the form itself - echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection cellspacing=4> <tr><td valign=top><table class=selection>'; @@ -981,7 +981,7 @@ $myrow['notes'], $myrow['contid'], $myrow['debtorno'], - $_SERVER['PHP_SELF'] . '?', + htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['contid'], $myrow['debtorno']); } Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/DailyBankTransactions.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -10,7 +10,7 @@ _('Search') . '" alt="" />' . ' ' . $title.'</p>'; if (!isset($_POST['Show'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class=selection>'; @@ -132,7 +132,7 @@ echo '</table>'; } //end if no bank trans in the range to show - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><div class="centre"><input type="submit" name="Return" value="' . _('Select Another Date'). '"></div>'; echo '</form>'; Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/DailySalesInquiry.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -10,7 +10,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Daily Sales') . '" alt="" />' . ' ' . _('Daily Sales') . '</p>'; echo '<div class="page_help_text">' . _('Select the month to show daily sales for') . '</div><br />'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding=2 class=selection><tr>'; Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-10-28 05:07:04 UTC (rev 4733) +++ trunk/DebtorsAtPeriodEnd.php 2011-10-29 03:26:27 UTC (rev 4734) @@ -129,7 +129,7 @@ /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post"> <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; Modified: trunk/DeliveryDetails.php =================================================================== --- ... [truncated message content] |
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] |
From: <dai...@us...> - 2011-10-29 06:00:03
|
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] |
From: <dai...@us...> - 2011-10-29 09:52:00
|
Revision: 4736 http://web-erp.svn.sourceforge.net/web-erp/?rev=4736&view=rev Author: daintree Date: 2011-10-29 09:51:53 +0000 (Sat, 29 Oct 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/PO_PDFPurchOrder.php trunk/doc/Change.log trunk/doc/Manual/ManualContributors.html trunk/includes/Contract_Readin.php trunk/includes/DefineContractClass.php Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/ContractCosting.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -29,6 +29,7 @@ $sql = "SELECT stockmoves.stockid, stockmaster.description, stockmaster.units, + stockmaster.decimalplaces, SUM(stockmoves.qty) AS quantity, SUM(stockmoves.qty*stockmoves.standardcost) AS totalcost FROM stockmoves INNER JOIN stockmaster @@ -37,7 +38,8 @@ AND stockmoves.reference='" . $_SESSION['Contract'.$identifier]->WO . "' GROUP BY stockmoves.stockid, stockmaster.description, - stockmaster.units"; + stockmaster.units, + stockmaster.decimalplaces"; $ErrMsg = _('Could not get the inventory issues for this contract because'); $InventoryIssuesResult = DB_query($sql,$db,$ErrMsg); $InventoryIssues = array(); @@ -47,7 +49,9 @@ $InventoryIssues[$InventoryIssuesRow['stockid']]->Quantity = $InventoryIssuesRow['quantity']; $InventoryIssues[$InventoryIssuesRow['stockid']]->TotalCost = $InventoryIssuesRow['totalcost']; $InventoryIssues[$InventoryIssuesRow['stockid']]->Units = $InventoryIssuesRow['units']; + $InventoryIssues[$InventoryIssuesRow['stockid']]->DecimalPlaces = $InventoryIssuesRow['decimalplaces']; $InventoryIssues[$InventoryIssuesRow['stockid']]->Matched = 0; + } echo '<p class="page_title_text"> @@ -92,7 +96,7 @@ echo '<tr> <td>' . $Component->StockID . '</td> <td>' . $Component->ItemDescription . '</td> - <td class="number">' . $Component->Quantity . '</td> + <td class="number">' . locale_number_format($Component->Quantity,$Component->DecimalPlaces) . '</td> <td>' . $Component->UOM . '</td> <td class="number">' . locale_number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; @@ -102,7 +106,7 @@ if (isset($InventoryIssues[$Component->StockID])){ $InventoryIssues[$Component->StockID]->Matched=1; echo '<td colspan="2" align="center">' . _('Actual usage') . '</td> - <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td> + <td class="number">' . locale_number_format(-$InventoryIssues[$Component->StockID]->Quantity,$Component->DecimalPlaces) . '</td> <td>' . $InventoryIssues[$Component->StockID]->Units . '</td> <td class="number">' . locale_number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . locale_number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> @@ -120,7 +124,7 @@ <td colspan="6"></td> <td>' . $Component->StockID . '</td> <td>' . $Component->Description . '</td> - <td class="number">' . -$Component->Quantity . '</td> + <td class="number">' . locale_number_format(-$Component->Quantity,$Component->DecimalPlaces) . '</td> <td>' . $Component->Units . '</td> <td class="number">' . locale_number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> @@ -152,13 +156,13 @@ foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $Requirement) { echo '<tr><td>' . $Requirement->Requirement . '</td> - <td class="number">' . $Requirement->Quantity . '</td> - <td class="number">' . $Requirement->CostPerUnit . '</td> + <td class="number">' . locale_number_format($Requirement->Quantity,'Variable') . '</td> + <td class="number">' . locale_number_format($Requirement->CostPerUnit,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $OtherReqtsBudget += ($Requirement->CostPerUnit * $Requirement->Quantity); } -echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsBudget,2) . '</b></th></tr> +echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> </table></td>'; //Now other requirements actual in a sub table @@ -428,10 +432,13 @@ if ($_SESSION['Contract'.$identifier]->Status ==2){//the contract is an order being processed now - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' .SID .'&SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br /><div class="centre"><input type="submit" name="CloseContract" value="' . _('Close Contract') . '" onclick="return confirm(\'' . _('Closing the contract will prevent further stock being issued to it and charges being made against it. Variances will be taken to the profit and loss account. Are You Sure?') . '\');" /></div>'; - echo '</form>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="CloseContract" value="' . _('Close Contract') . '" onclick="return confirm(\'' . _('Closing the contract will prevent further stock being issued to it and charges being made against it. Variances will be taken to the profit and loss account. Are You Sure?') . '\');" /> + </div> + </form>'; } include('includes/footer.inc'); Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/ContractOtherReqts.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -88,10 +88,10 @@ } echo '<tr> - <th>' . _('Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit Cost') . '</th> - <th>' . _('Sub-total') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit Cost') . '</th> + <th>' . _('Sub-total') . '</th> </tr>'; $_SESSION['Contract'.$identifier]->total = 0; @@ -111,17 +111,25 @@ } echo '<td><textarea name="Requirement' . $ContractReqtID . '" cols="30" rows="3">' . $ContractComponent->Requirement . '</textarea></td> - <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . $ContractComponent->Quantity . '" /></td> - <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . $ContractComponent->CostPerUnit . '" /></td> + <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . locale_number_format($ContractComponent->Quantity,'Variable') . '" /></td> + <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . locale_number_format($ContractComponent->CostPerUnit,$_SESSION['CompanyRecord']['decimalplaces']) . '" /></td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID . 'identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '&Delete=' . $ContractReqtID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this contract requirement?') . '\');">' . _('Delete') . '</a></td> + </tr>'; $TotalCost += $LineTotal; } - $DisplayTotal = locale_number_format($TotalCost,2); - echo '<tr><td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; - echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" />'; - echo ' <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /></div>'; + $DisplayTotal = locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']); + echo '<tr> + <td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td> + <td class="number"><b>' . $DisplayTotal . '</b></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" /> + <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /> + </div>'; } /*Only display the contract other requirements lines if there are any !! */ @@ -133,17 +141,30 @@ $_POST['CostPerUnit']=0; } echo '<table class="selection"> - <tr><th colspan="2">' . _('Enter New Requirements') . '</th></tr> - <tr><td>' . _('Requirement Description') . '</td> - <td><textarea name="RequirementDescription" cols="30" rows="3">' . $_POST['RequirementDescription'] . '</textarea></td></tr>'; -echo '<tr><td>' . _('Quantity Required') . ':</td> - <td><input type="text" class="number" name="Quantity" size="10" maxlength="10" value="' . $_POST['Quantity'] . '" /></td></tr>'; -echo '<tr><td>' . _('Cost Per Unit') . ':</td> - <td><input type="text" class="number" name="CostPerUnit" size="10" maxlength="10" value="' . $_POST['CostPerUnit'] . '" /></td></tr>'; -echo '</table>'; - -echo '<br /><div class="centre"><input type="submit" name="EnterNewRequirement" value="' . _('Enter New Contract Requirement') . '" /></div>'; - -echo '</form>'; + <tr> + <th colspan="2">' . _('Enter New Requirements') . '</th> + </tr> + <tr> + <td>' . _('Requirement Description') . '</td> + <td><textarea name="RequirementDescription" cols="30" rows="3">' . $_POST['RequirementDescription'] . '</textarea></td> + </tr> + <tr> + <td>' . _('Quantity Required') . ':</td> + <td><input type="text" class="number" name="Quantity" size="10" maxlength="10" value="' . $_POST['Quantity'] . '" /></td> + </tr> + <tr> + <td>' . _('Cost Per Unit') . ':</td> + <td><input type="text" class="number" name="CostPerUnit" size="10" maxlength="10" value="' . $_POST['CostPerUnit'] . '" /></td> + </tr> + + </table> + + <br /> + <div class="centre"> + <input type="submit" name="EnterNewRequirement" value="' . _('Enter New Contract Requirement') . '" /> + </div> + + </form>'; + include('includes/footer.inc'); ?> Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/Contracts.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -65,9 +65,9 @@ $_SESSION['Contract'.$identifier]->CategoryID = $_POST['CategoryID']; $_SESSION['Contract'.$identifier]->LocCode = $_POST['LocCode']; $_SESSION['Contract'.$identifier]->RequiredDate = $_POST['RequiredDate']; - $_SESSION['Contract'.$identifier]->Margin = $_POST['Margin']; + $_SESSION['Contract'.$identifier]->Margin = filter_number_format($_POST['Margin']); $_SESSION['Contract'.$identifier]->CustomerRef = $_POST['CustomerRef']; - $_SESSION['Contract'.$identifier]->ExRate = $_POST['ExRate']; + $_SESSION['Contract'.$identifier]->ExRate = filter_number_format($_POST['ExRate']); /*User hit the button to enter line items - @@ -254,10 +254,10 @@ $_SESSION['Contract'.$identifier]->CategoryID = $_POST['CategoryID']; $_SESSION['Contract'.$identifier]->LocCode = $_POST['LocCode']; $_SESSION['Contract'.$identifier]->RequiredDate = $_POST['RequiredDate']; - $_SESSION['Contract'.$identifier]->Margin = $_POST['Margin']; + $_SESSION['Contract'.$identifier]->Margin = filter_number_format($_POST['Margin']); $_SESSION['Contract'.$identifier]->Status = $_POST['Status']; $_SESSION['Contract'.$identifier]->CustomerRef = $_POST['CustomerRef']; - $_SESSION['Contract'.$identifier]->ExRate = $_POST['ExRate']; + $_SESSION['Contract'.$identifier]->ExRate = filter_number_format($_POST['ExRate']); /*Get the first work centre for the users location - until we set this up properly */ $result = DB_query("SELECT code FROM workcentres WHERE location='" . $_SESSION['Contract'.$identifier]->LocCode ."'",$db); @@ -305,9 +305,9 @@ $sql = "UPDATE contracts SET categoryid = '" . $_POST['CategoryID'] ."', requireddate = '" . FormatDateForSQL($_POST['RequiredDate']) . "', loccode='" . $_POST['LocCode'] . "', - margin = '" . $_POST['Margin'] . "', + margin = '" . filter_number_format($_POST['Margin']) . "', customerref = '" . $_POST['CustomerRef'] . "', - exrate = '" . $_POST['ExRate'] . "' + exrate = '" . filter_number_format($_POST['ExRate']) . "' WHERE contractref ='" . $_POST['ContractRef'] . "'"; $ErrMsg = _('Cannot update the contract because'); $result = DB_query($sql,$db,$ErrMsg); @@ -404,9 +404,9 @@ '" . $_POST['CategoryID'] . "', '" . $_POST['LocCode'] . "', '" . FormatDateForSQL($_POST['RequiredDate']) . "', - '" . $_POST['Margin'] . "', + '" . filter_number_format($_POST['Margin']) . "', '" . $_POST['CustomerRef'] . "', - '". $_POST['ExRate'] ."')"; + '". filter_number_format($_POST['ExRate']) ."')"; $ErrMsg = _('The new contract could not be added because'); $result = DB_query($sql,$db,$ErrMsg); @@ -895,13 +895,15 @@ $_SESSION['Contract'.$identifier]->Margin =50; } echo '<tr><td>' . _('Gross Profit') . ' %:</td> - <td><input type="text" name="Margin" size="4" maxlength="4" value="' . $_SESSION['Contract'.$identifier]->Margin . '" /></td></tr>'; + <td><input type="text" name="Margin" size="4" maxlength="4" value="' . locale_number_format($_SESSION['Contract'.$identifier]->Margin,2) . '" /></td></tr>'; if ($_SESSION['CompanyRecord']['currencydefault'] != $_SESSION['Contract'.$identifier]->CurrCode){ - echo '<tr><td>' . $_SESSION['Contract'.$identifier]->CurrCode . ' ' . _('Exchange Rate') . ':</td> - <td><input type="text" name="ExRate" size="10" maxlength="10" value="' . $_SESSION['Contract'.$identifier]->ExRate . '" /></td></tr>'; + echo '<tr> + <td>' . $_SESSION['Contract'.$identifier]->CurrCode . ' ' . _('Exchange Rate') . ':</td> + <td><input type="text" name="ExRate" size="10" maxlength="10" value="' . locale_number_format($_SESSION['Contract'.$identifier]->ExRate,'Variable') . '" /></td> + </tr>'; } else { - echo '<input type="hidden" name="ExRate" value="' . $_SESSION['Contract'.$identifier]->ExRate . '" />'; + echo '<input type="hidden" name="ExRate" value="' . locale_number_format($_SESSION['Contract'.$identifier]->ExRate,'Variable') . '" />'; } echo '<tr><td>' . _('Contract Status') . ':</td><td>'; Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/PO_PDFPurchOrder.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -127,7 +127,7 @@ if ($POHeader['status'] != 'Authorised' AND $POHeader['status'] != 'Printed') { include('includes/header.inc'); - prnMsg( _('Purchase orders can only be printed once they have been authorised') . '. ' . _('This order is currently at a status of') . ' ' . _($OrderStatus),'warn'); + prnMsg( _('Purchase orders can only be printed once they have been authorised') . '. ' . _('This order is currently at a status of') . ' ' . _($POHeader['status']),'warn'); include('includes/footer.inc'); exit; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/doc/Change.log 2011-10-29 09:51:53 UTC (rev 4736) @@ -9,7 +9,7 @@ 22/9/11 Exson: fixed the bug in GLAccountReport.php for typename from the right table (systypes) in SQL and change locale_number_format for multinational. 17/9/11 Phil: Added WindowsLocale element to LanguagesArray.php and modified UserSettings.php and WWW_Users.php to use the new array definition. Also modified includes/LanguageSetup.php to use the windows locale string in the LanguagesArray as required for proper setting of the locale under windows. 17/9/11 Felix Lim: added serialised field into PrintCustTransPortrait.php to reinstate possiblity for printing serialised items on invoice - not possible in landscape version (PrintCustTrans.php) -12/9/11 Phil/Exson/Tom: Change all scripts to allow display and input of numbers in the format of the selected users locale +12/9/11-31/10/11 Phil/Exson/Tom: Change all scripts to allow display and input of numbers in the format of the selected users locale 5/9/11 Phil: Fixed supplier payment exchange rate ... was being calculated incorrectly from functional exchange rate and the exchange rate between the currency of the bank account and currency of payment. 5/9/11 Phil: GLTransInquiry posted was not retrieved correctly - now fixed 4/9/11 Phil: Removed the stock code from form entities in SelectOrderItems.php and PO_Items.php to prevent issues with some characters in stock codes as suggested by Tim Modified: trunk/doc/Manual/ManualContributors.html =================================================================== --- trunk/doc/Manual/ManualContributors.html 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/doc/Manual/ManualContributors.html 2011-10-29 09:51:53 UTC (rev 4736) @@ -41,6 +41,8 @@ <br /><br /> Richard Heyes (html.mime.mail) <br /><br /> +High-Tech Bridge SA Security Research Lab +<br /><br /> Hindra Joshua <br /><br /> Alan Jones @@ -57,6 +59,8 @@ <br /><br /> Ditesh Kumar <br /><br /> +Felix Lim +<br /><br /> David Luo <br /><br /> Wayne McDougall @@ -103,6 +107,8 @@ <br /><br /> Jurgen Schopenhouer <br /><br /> +Fred Schuettler (aguapop - theme) +<br /><br /> Danilo Segan (php-gettext) <br /><br /> Gjergj Sheldija @@ -111,6 +117,8 @@ <br /><br /> Vitaliy Shevkunov <br /><br /> +Marcos Skambraks +<br /><br /> Jake Stride <br /><br /> Matt Taylor Modified: trunk/includes/Contract_Readin.php =================================================================== --- trunk/includes/Contract_Readin.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/includes/Contract_Readin.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -3,28 +3,28 @@ /*Contract_Readin.php is used by the modify existing Contract in Contracts.php and also by ContractCosting.php */ $ContractHeaderSQL = "SELECT contractdescription, - contracts.debtorno, - contracts.branchcode, - contracts.loccode, - status, - categoryid, - orderno, - margin, - wo, - requireddate, - drawing, - exrate, - debtorsmaster.name, - custbranch.brname, - debtorsmaster.currcode - FROM contracts INNER JOIN debtorsmaster - ON contracts.debtorno=debtorsmaster.debtorno - INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev - INNER JOIN custbranch - ON debtorsmaster.debtorno=custbranch.debtorno - AND contracts.branchcode=custbranch.branchcode - WHERE contractref= '" . $ContractRef . "'"; + contracts.debtorno, + contracts.branchcode, + contracts.loccode, + status, + categoryid, + orderno, + margin, + wo, + requireddate, + drawing, + exrate, + debtorsmaster.name, + custbranch.brname, + debtorsmaster.currcode + FROM contracts INNER JOIN debtorsmaster + ON contracts.debtorno=debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + INNER JOIN custbranch + ON debtorsmaster.debtorno=custbranch.debtorno + AND contracts.branchcode=custbranch.branchcode + WHERE contractref= '" . $ContractRef . "'"; $ErrMsg = _('The contract cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used and failed was'); @@ -55,14 +55,15 @@ /*now populate the contract BOM array with the items required for the contract */ $ContractBOMsql = "SELECT contractbom.stockid, - stockmaster.description, - contractbom.workcentreadded, - contractbom.quantity, - stockmaster.units, - stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost - FROM contractbom INNER JOIN stockmaster - ON contractbom.stockid=stockmaster.stockid - WHERE contractref ='" . $ContractRef . "'"; + stockmaster.description, + contractbom.workcentreadded, + contractbom.quantity, + stockmaster.units, + stockmaster.decimalplaces, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost + FROM contractbom INNER JOIN stockmaster + ON contractbom.stockid=stockmaster.stockid + WHERE contractref ='" . $ContractRef . "'"; $ErrMsg = _('The bill of material cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used to retrieve the contract bill of material was'); @@ -75,17 +76,18 @@ $myrow['workcentreadded'], $myrow['quantity'], $myrow['cost'], - $myrow['units']); + $myrow['units'], + $myrow['decimalplaces']); } /* add contract bill of materials BOM lines*/ } //end is there was a contract BOM to add //Now add the contract requirments $ContractReqtsSQL = "SELECT requirement, - quantity, - costperunit, - contractreqid - FROM contractreqts - WHERE contractref ='" . $ContractRef . "' - ORDER BY contractreqid"; + quantity, + costperunit, + contractreqid + FROM contractreqts + WHERE contractref ='" . $ContractRef . "' + ORDER BY contractreqid"; $ErrMsg = _('The other contract requirementscannot be retrieved because'); $DbgMsg = _('The SQL statement that was used to retrieve the other contract requirments was'); Modified: trunk/includes/DefineContractClass.php =================================================================== --- trunk/includes/DefineContractClass.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/includes/DefineContractClass.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -38,20 +38,22 @@ } function Add_To_ContractBOM($StockID, - $ItemDescription, - $WorkCentre, - $Quantity, - $ItemCost, - $UOM){ + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces){ if (isset($StockID) AND $Quantity!=0){ $this->ContractBOM[$this->BOMComponentCounter] = new ContractComponent($this->BOMComponentCounter, - $StockID, - $ItemDescription, - $WorkCentre, - $Quantity, - $ItemCost, - $UOM); + $StockID, + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces); $this->BOMComponentCounter++; Return 1; } @@ -70,7 +72,11 @@ /*Requirments Methods */ -function Add_To_ContractRequirements($Requirement, $Quantity, $CostPerUnit,$ContractReqID=0){ +function Add_To_ContractRequirements($Requirement, + $Quantity, + $CostPerUnit, + $ContractReqID=0){ + if (isset($Requirement) AND $Quantity!=0 AND $CostPerUnit!=0){ $this->ContractReqts[$this->RequirementsCounter] = new ContractRequirement($Requirement, $Quantity, $CostPerUnit,$ContractReqID); $this->RequirementsCounter++; @@ -95,15 +101,17 @@ var $Quantity; var $ItemCost; var $UOM; + var $DecimalPlaces; function ContractComponent ($ComponentID, - $StockID, - $ItemDescription, - $WorkCentre, - $Quantity, - $ItemCost, - $UOM){ - + $StockID, + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces=0){ + /* Constructor function to add a new Contract Component object with passed params */ $this->ComponentID = $ComponentID; $this->StockID = $StockID; @@ -112,6 +120,7 @@ $this->Quantity = $Quantity; $this->ItemCost= $ItemCost; $this->UOM = $UOM; + $this->DecimalPlaces = $DecimalPlaces; } } @@ -123,9 +132,9 @@ var $CostPerUnit; function ContractRequirement ($Requirement, - $Quantity, - $CostPerUnit, - $ContractReqID=0){ + $Quantity, + $CostPerUnit, + $ContractReqID=0){ /* Constructor function to add a new Contract Component object with passed params */ $this->Requirement = $Requirement; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-29 09:52:00
|
Revision: 4736 http://web-erp.svn.sourceforge.net/web-erp/?rev=4736&view=rev Author: daintree Date: 2011-10-29 09:51:53 +0000 (Sat, 29 Oct 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/ContractCosting.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/PO_PDFPurchOrder.php trunk/doc/Change.log trunk/doc/Manual/ManualContributors.html trunk/includes/Contract_Readin.php trunk/includes/DefineContractClass.php Modified: trunk/ContractCosting.php =================================================================== --- trunk/ContractCosting.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/ContractCosting.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -29,6 +29,7 @@ $sql = "SELECT stockmoves.stockid, stockmaster.description, stockmaster.units, + stockmaster.decimalplaces, SUM(stockmoves.qty) AS quantity, SUM(stockmoves.qty*stockmoves.standardcost) AS totalcost FROM stockmoves INNER JOIN stockmaster @@ -37,7 +38,8 @@ AND stockmoves.reference='" . $_SESSION['Contract'.$identifier]->WO . "' GROUP BY stockmoves.stockid, stockmaster.description, - stockmaster.units"; + stockmaster.units, + stockmaster.decimalplaces"; $ErrMsg = _('Could not get the inventory issues for this contract because'); $InventoryIssuesResult = DB_query($sql,$db,$ErrMsg); $InventoryIssues = array(); @@ -47,7 +49,9 @@ $InventoryIssues[$InventoryIssuesRow['stockid']]->Quantity = $InventoryIssuesRow['quantity']; $InventoryIssues[$InventoryIssuesRow['stockid']]->TotalCost = $InventoryIssuesRow['totalcost']; $InventoryIssues[$InventoryIssuesRow['stockid']]->Units = $InventoryIssuesRow['units']; + $InventoryIssues[$InventoryIssuesRow['stockid']]->DecimalPlaces = $InventoryIssuesRow['decimalplaces']; $InventoryIssues[$InventoryIssuesRow['stockid']]->Matched = 0; + } echo '<p class="page_title_text"> @@ -92,7 +96,7 @@ echo '<tr> <td>' . $Component->StockID . '</td> <td>' . $Component->ItemDescription . '</td> - <td class="number">' . $Component->Quantity . '</td> + <td class="number">' . locale_number_format($Component->Quantity,$Component->DecimalPlaces) . '</td> <td>' . $Component->UOM . '</td> <td class="number">' . locale_number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>'; @@ -102,7 +106,7 @@ if (isset($InventoryIssues[$Component->StockID])){ $InventoryIssues[$Component->StockID]->Matched=1; echo '<td colspan="2" align="center">' . _('Actual usage') . '</td> - <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td> + <td class="number">' . locale_number_format(-$InventoryIssues[$Component->StockID]->Quantity,$Component->DecimalPlaces) . '</td> <td>' . $InventoryIssues[$Component->StockID]->Units . '</td> <td class="number">' . locale_number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td>' . locale_number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> @@ -120,7 +124,7 @@ <td colspan="6"></td> <td>' . $Component->StockID . '</td> <td>' . $Component->Description . '</td> - <td class="number">' . -$Component->Quantity . '</td> + <td class="number">' . locale_number_format(-$Component->Quantity,$Component->DecimalPlaces) . '</td> <td>' . $Component->Units . '</td> <td class="number">' . locale_number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> @@ -152,13 +156,13 @@ foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $Requirement) { echo '<tr><td>' . $Requirement->Requirement . '</td> - <td class="number">' . $Requirement->Quantity . '</td> - <td class="number">' . $Requirement->CostPerUnit . '</td> + <td class="number">' . locale_number_format($Requirement->Quantity,'Variable') . '</td> + <td class="number">' . locale_number_format($Requirement->CostPerUnit,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $OtherReqtsBudget += ($Requirement->CostPerUnit * $Requirement->Quantity); } -echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsBudget,2) . '</b></th></tr> +echo '<tr><th colspan="3" align="right"><b>' . _('Budgeted Other Costs') . '</b></th><th class="number"><b>' . locale_number_format($OtherReqtsBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th></tr> </table></td>'; //Now other requirements actual in a sub table @@ -428,10 +432,13 @@ if ($_SESSION['Contract'.$identifier]->Status ==2){//the contract is an order being processed now - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' .SID .'&SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedContract=' . $_SESSION['Contract'.$identifier]->ContractRef . '&identifier=' . $identifier . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<br /><div class="centre"><input type="submit" name="CloseContract" value="' . _('Close Contract') . '" onclick="return confirm(\'' . _('Closing the contract will prevent further stock being issued to it and charges being made against it. Variances will be taken to the profit and loss account. Are You Sure?') . '\');" /></div>'; - echo '</form>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="CloseContract" value="' . _('Close Contract') . '" onclick="return confirm(\'' . _('Closing the contract will prevent further stock being issued to it and charges being made against it. Variances will be taken to the profit and loss account. Are You Sure?') . '\');" /> + </div> + </form>'; } include('includes/footer.inc'); Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/ContractOtherReqts.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -88,10 +88,10 @@ } echo '<tr> - <th>' . _('Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Unit Cost') . '</th> - <th>' . _('Sub-total') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Unit Cost') . '</th> + <th>' . _('Sub-total') . '</th> </tr>'; $_SESSION['Contract'.$identifier]->total = 0; @@ -111,17 +111,25 @@ } echo '<td><textarea name="Requirement' . $ContractReqtID . '" cols="30" rows="3">' . $ContractComponent->Requirement . '</textarea></td> - <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . $ContractComponent->Quantity . '" /></td> - <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . $ContractComponent->CostPerUnit . '" /></td> + <td><input type="text" class="number" name="Qty' . $ContractReqtID . '" size="11" value="' . locale_number_format($ContractComponent->Quantity,'Variable') . '" /></td> + <td><input type="text" class="number" name="CostPerUnit' . $ContractReqtID . '" size="11" value="' . locale_number_format($ContractComponent->CostPerUnit,$_SESSION['CompanyRecord']['decimalplaces']) . '" /></td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID . 'identifier='.$identifier. '&Delete=' . $ContractReqtID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '&Delete=' . $ContractReqtID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this contract requirement?') . '\');">' . _('Delete') . '</a></td> + </tr>'; $TotalCost += $LineTotal; } - $DisplayTotal = locale_number_format($TotalCost,2); - echo '<tr><td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td><td class="number"><b>' . $DisplayTotal . '</b></td></tr></table>'; - echo '<br /><div class="centre"><input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" />'; - echo ' <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /></div>'; + $DisplayTotal = locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']); + echo '<tr> + <td colspan="4" class="number">' . _('Total Other Requirements Cost') . '</td> + <td class="number"><b>' . $DisplayTotal . '</b></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="UpdateLines" value="' . _('Update Other Requirements Lines') . '" /> + <input type="submit" name="BackToHeader" value="' . _('Back To Contract Header') . '" /> + </div>'; } /*Only display the contract other requirements lines if there are any !! */ @@ -133,17 +141,30 @@ $_POST['CostPerUnit']=0; } echo '<table class="selection"> - <tr><th colspan="2">' . _('Enter New Requirements') . '</th></tr> - <tr><td>' . _('Requirement Description') . '</td> - <td><textarea name="RequirementDescription" cols="30" rows="3">' . $_POST['RequirementDescription'] . '</textarea></td></tr>'; -echo '<tr><td>' . _('Quantity Required') . ':</td> - <td><input type="text" class="number" name="Quantity" size="10" maxlength="10" value="' . $_POST['Quantity'] . '" /></td></tr>'; -echo '<tr><td>' . _('Cost Per Unit') . ':</td> - <td><input type="text" class="number" name="CostPerUnit" size="10" maxlength="10" value="' . $_POST['CostPerUnit'] . '" /></td></tr>'; -echo '</table>'; - -echo '<br /><div class="centre"><input type="submit" name="EnterNewRequirement" value="' . _('Enter New Contract Requirement') . '" /></div>'; - -echo '</form>'; + <tr> + <th colspan="2">' . _('Enter New Requirements') . '</th> + </tr> + <tr> + <td>' . _('Requirement Description') . '</td> + <td><textarea name="RequirementDescription" cols="30" rows="3">' . $_POST['RequirementDescription'] . '</textarea></td> + </tr> + <tr> + <td>' . _('Quantity Required') . ':</td> + <td><input type="text" class="number" name="Quantity" size="10" maxlength="10" value="' . $_POST['Quantity'] . '" /></td> + </tr> + <tr> + <td>' . _('Cost Per Unit') . ':</td> + <td><input type="text" class="number" name="CostPerUnit" size="10" maxlength="10" value="' . $_POST['CostPerUnit'] . '" /></td> + </tr> + + </table> + + <br /> + <div class="centre"> + <input type="submit" name="EnterNewRequirement" value="' . _('Enter New Contract Requirement') . '" /> + </div> + + </form>'; + include('includes/footer.inc'); ?> Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/Contracts.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -65,9 +65,9 @@ $_SESSION['Contract'.$identifier]->CategoryID = $_POST['CategoryID']; $_SESSION['Contract'.$identifier]->LocCode = $_POST['LocCode']; $_SESSION['Contract'.$identifier]->RequiredDate = $_POST['RequiredDate']; - $_SESSION['Contract'.$identifier]->Margin = $_POST['Margin']; + $_SESSION['Contract'.$identifier]->Margin = filter_number_format($_POST['Margin']); $_SESSION['Contract'.$identifier]->CustomerRef = $_POST['CustomerRef']; - $_SESSION['Contract'.$identifier]->ExRate = $_POST['ExRate']; + $_SESSION['Contract'.$identifier]->ExRate = filter_number_format($_POST['ExRate']); /*User hit the button to enter line items - @@ -254,10 +254,10 @@ $_SESSION['Contract'.$identifier]->CategoryID = $_POST['CategoryID']; $_SESSION['Contract'.$identifier]->LocCode = $_POST['LocCode']; $_SESSION['Contract'.$identifier]->RequiredDate = $_POST['RequiredDate']; - $_SESSION['Contract'.$identifier]->Margin = $_POST['Margin']; + $_SESSION['Contract'.$identifier]->Margin = filter_number_format($_POST['Margin']); $_SESSION['Contract'.$identifier]->Status = $_POST['Status']; $_SESSION['Contract'.$identifier]->CustomerRef = $_POST['CustomerRef']; - $_SESSION['Contract'.$identifier]->ExRate = $_POST['ExRate']; + $_SESSION['Contract'.$identifier]->ExRate = filter_number_format($_POST['ExRate']); /*Get the first work centre for the users location - until we set this up properly */ $result = DB_query("SELECT code FROM workcentres WHERE location='" . $_SESSION['Contract'.$identifier]->LocCode ."'",$db); @@ -305,9 +305,9 @@ $sql = "UPDATE contracts SET categoryid = '" . $_POST['CategoryID'] ."', requireddate = '" . FormatDateForSQL($_POST['RequiredDate']) . "', loccode='" . $_POST['LocCode'] . "', - margin = '" . $_POST['Margin'] . "', + margin = '" . filter_number_format($_POST['Margin']) . "', customerref = '" . $_POST['CustomerRef'] . "', - exrate = '" . $_POST['ExRate'] . "' + exrate = '" . filter_number_format($_POST['ExRate']) . "' WHERE contractref ='" . $_POST['ContractRef'] . "'"; $ErrMsg = _('Cannot update the contract because'); $result = DB_query($sql,$db,$ErrMsg); @@ -404,9 +404,9 @@ '" . $_POST['CategoryID'] . "', '" . $_POST['LocCode'] . "', '" . FormatDateForSQL($_POST['RequiredDate']) . "', - '" . $_POST['Margin'] . "', + '" . filter_number_format($_POST['Margin']) . "', '" . $_POST['CustomerRef'] . "', - '". $_POST['ExRate'] ."')"; + '". filter_number_format($_POST['ExRate']) ."')"; $ErrMsg = _('The new contract could not be added because'); $result = DB_query($sql,$db,$ErrMsg); @@ -895,13 +895,15 @@ $_SESSION['Contract'.$identifier]->Margin =50; } echo '<tr><td>' . _('Gross Profit') . ' %:</td> - <td><input type="text" name="Margin" size="4" maxlength="4" value="' . $_SESSION['Contract'.$identifier]->Margin . '" /></td></tr>'; + <td><input type="text" name="Margin" size="4" maxlength="4" value="' . locale_number_format($_SESSION['Contract'.$identifier]->Margin,2) . '" /></td></tr>'; if ($_SESSION['CompanyRecord']['currencydefault'] != $_SESSION['Contract'.$identifier]->CurrCode){ - echo '<tr><td>' . $_SESSION['Contract'.$identifier]->CurrCode . ' ' . _('Exchange Rate') . ':</td> - <td><input type="text" name="ExRate" size="10" maxlength="10" value="' . $_SESSION['Contract'.$identifier]->ExRate . '" /></td></tr>'; + echo '<tr> + <td>' . $_SESSION['Contract'.$identifier]->CurrCode . ' ' . _('Exchange Rate') . ':</td> + <td><input type="text" name="ExRate" size="10" maxlength="10" value="' . locale_number_format($_SESSION['Contract'.$identifier]->ExRate,'Variable') . '" /></td> + </tr>'; } else { - echo '<input type="hidden" name="ExRate" value="' . $_SESSION['Contract'.$identifier]->ExRate . '" />'; + echo '<input type="hidden" name="ExRate" value="' . locale_number_format($_SESSION['Contract'.$identifier]->ExRate,'Variable') . '" />'; } echo '<tr><td>' . _('Contract Status') . ':</td><td>'; Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/PO_PDFPurchOrder.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -127,7 +127,7 @@ if ($POHeader['status'] != 'Authorised' AND $POHeader['status'] != 'Printed') { include('includes/header.inc'); - prnMsg( _('Purchase orders can only be printed once they have been authorised') . '. ' . _('This order is currently at a status of') . ' ' . _($OrderStatus),'warn'); + prnMsg( _('Purchase orders can only be printed once they have been authorised') . '. ' . _('This order is currently at a status of') . ' ' . _($POHeader['status']),'warn'); include('includes/footer.inc'); exit; } Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/doc/Change.log 2011-10-29 09:51:53 UTC (rev 4736) @@ -9,7 +9,7 @@ 22/9/11 Exson: fixed the bug in GLAccountReport.php for typename from the right table (systypes) in SQL and change locale_number_format for multinational. 17/9/11 Phil: Added WindowsLocale element to LanguagesArray.php and modified UserSettings.php and WWW_Users.php to use the new array definition. Also modified includes/LanguageSetup.php to use the windows locale string in the LanguagesArray as required for proper setting of the locale under windows. 17/9/11 Felix Lim: added serialised field into PrintCustTransPortrait.php to reinstate possiblity for printing serialised items on invoice - not possible in landscape version (PrintCustTrans.php) -12/9/11 Phil/Exson/Tom: Change all scripts to allow display and input of numbers in the format of the selected users locale +12/9/11-31/10/11 Phil/Exson/Tom: Change all scripts to allow display and input of numbers in the format of the selected users locale 5/9/11 Phil: Fixed supplier payment exchange rate ... was being calculated incorrectly from functional exchange rate and the exchange rate between the currency of the bank account and currency of payment. 5/9/11 Phil: GLTransInquiry posted was not retrieved correctly - now fixed 4/9/11 Phil: Removed the stock code from form entities in SelectOrderItems.php and PO_Items.php to prevent issues with some characters in stock codes as suggested by Tim Modified: trunk/doc/Manual/ManualContributors.html =================================================================== --- trunk/doc/Manual/ManualContributors.html 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/doc/Manual/ManualContributors.html 2011-10-29 09:51:53 UTC (rev 4736) @@ -41,6 +41,8 @@ <br /><br /> Richard Heyes (html.mime.mail) <br /><br /> +High-Tech Bridge SA Security Research Lab +<br /><br /> Hindra Joshua <br /><br /> Alan Jones @@ -57,6 +59,8 @@ <br /><br /> Ditesh Kumar <br /><br /> +Felix Lim +<br /><br /> David Luo <br /><br /> Wayne McDougall @@ -103,6 +107,8 @@ <br /><br /> Jurgen Schopenhouer <br /><br /> +Fred Schuettler (aguapop - theme) +<br /><br /> Danilo Segan (php-gettext) <br /><br /> Gjergj Sheldija @@ -111,6 +117,8 @@ <br /><br /> Vitaliy Shevkunov <br /><br /> +Marcos Skambraks +<br /><br /> Jake Stride <br /><br /> Matt Taylor Modified: trunk/includes/Contract_Readin.php =================================================================== --- trunk/includes/Contract_Readin.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/includes/Contract_Readin.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -3,28 +3,28 @@ /*Contract_Readin.php is used by the modify existing Contract in Contracts.php and also by ContractCosting.php */ $ContractHeaderSQL = "SELECT contractdescription, - contracts.debtorno, - contracts.branchcode, - contracts.loccode, - status, - categoryid, - orderno, - margin, - wo, - requireddate, - drawing, - exrate, - debtorsmaster.name, - custbranch.brname, - debtorsmaster.currcode - FROM contracts INNER JOIN debtorsmaster - ON contracts.debtorno=debtorsmaster.debtorno - INNER JOIN currencies - ON debtorsmaster.currcode=currencies.currabrev - INNER JOIN custbranch - ON debtorsmaster.debtorno=custbranch.debtorno - AND contracts.branchcode=custbranch.branchcode - WHERE contractref= '" . $ContractRef . "'"; + contracts.debtorno, + contracts.branchcode, + contracts.loccode, + status, + categoryid, + orderno, + margin, + wo, + requireddate, + drawing, + exrate, + debtorsmaster.name, + custbranch.brname, + debtorsmaster.currcode + FROM contracts INNER JOIN debtorsmaster + ON contracts.debtorno=debtorsmaster.debtorno + INNER JOIN currencies + ON debtorsmaster.currcode=currencies.currabrev + INNER JOIN custbranch + ON debtorsmaster.debtorno=custbranch.debtorno + AND contracts.branchcode=custbranch.branchcode + WHERE contractref= '" . $ContractRef . "'"; $ErrMsg = _('The contract cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used and failed was'); @@ -55,14 +55,15 @@ /*now populate the contract BOM array with the items required for the contract */ $ContractBOMsql = "SELECT contractbom.stockid, - stockmaster.description, - contractbom.workcentreadded, - contractbom.quantity, - stockmaster.units, - stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost - FROM contractbom INNER JOIN stockmaster - ON contractbom.stockid=stockmaster.stockid - WHERE contractref ='" . $ContractRef . "'"; + stockmaster.description, + contractbom.workcentreadded, + contractbom.quantity, + stockmaster.units, + stockmaster.decimalplaces, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost + FROM contractbom INNER JOIN stockmaster + ON contractbom.stockid=stockmaster.stockid + WHERE contractref ='" . $ContractRef . "'"; $ErrMsg = _('The bill of material cannot be retrieved because'); $DbgMsg = _('The SQL statement that was used to retrieve the contract bill of material was'); @@ -75,17 +76,18 @@ $myrow['workcentreadded'], $myrow['quantity'], $myrow['cost'], - $myrow['units']); + $myrow['units'], + $myrow['decimalplaces']); } /* add contract bill of materials BOM lines*/ } //end is there was a contract BOM to add //Now add the contract requirments $ContractReqtsSQL = "SELECT requirement, - quantity, - costperunit, - contractreqid - FROM contractreqts - WHERE contractref ='" . $ContractRef . "' - ORDER BY contractreqid"; + quantity, + costperunit, + contractreqid + FROM contractreqts + WHERE contractref ='" . $ContractRef . "' + ORDER BY contractreqid"; $ErrMsg = _('The other contract requirementscannot be retrieved because'); $DbgMsg = _('The SQL statement that was used to retrieve the other contract requirments was'); Modified: trunk/includes/DefineContractClass.php =================================================================== --- trunk/includes/DefineContractClass.php 2011-10-29 05:59:53 UTC (rev 4735) +++ trunk/includes/DefineContractClass.php 2011-10-29 09:51:53 UTC (rev 4736) @@ -38,20 +38,22 @@ } function Add_To_ContractBOM($StockID, - $ItemDescription, - $WorkCentre, - $Quantity, - $ItemCost, - $UOM){ + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces){ if (isset($StockID) AND $Quantity!=0){ $this->ContractBOM[$this->BOMComponentCounter] = new ContractComponent($this->BOMComponentCounter, - $StockID, - $ItemDescription, - $WorkCentre, - $Quantity, - $ItemCost, - $UOM); + $StockID, + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces); $this->BOMComponentCounter++; Return 1; } @@ -70,7 +72,11 @@ /*Requirments Methods */ -function Add_To_ContractRequirements($Requirement, $Quantity, $CostPerUnit,$ContractReqID=0){ +function Add_To_ContractRequirements($Requirement, + $Quantity, + $CostPerUnit, + $ContractReqID=0){ + if (isset($Requirement) AND $Quantity!=0 AND $CostPerUnit!=0){ $this->ContractReqts[$this->RequirementsCounter] = new ContractRequirement($Requirement, $Quantity, $CostPerUnit,$ContractReqID); $this->RequirementsCounter++; @@ -95,15 +101,17 @@ var $Quantity; var $ItemCost; var $UOM; + var $DecimalPlaces; function ContractComponent ($ComponentID, - $StockID, - $ItemDescription, - $WorkCentre, - $Quantity, - $ItemCost, - $UOM){ - + $StockID, + $ItemDescription, + $WorkCentre, + $Quantity, + $ItemCost, + $UOM, + $DecimalPlaces=0){ + /* Constructor function to add a new Contract Component object with passed params */ $this->ComponentID = $ComponentID; $this->StockID = $StockID; @@ -112,6 +120,7 @@ $this->Quantity = $Quantity; $this->ItemCost= $ItemCost; $this->UOM = $UOM; + $this->DecimalPlaces = $DecimalPlaces; } } @@ -123,9 +132,9 @@ var $CostPerUnit; function ContractRequirement ($Requirement, - $Quantity, - $CostPerUnit, - $ContractReqID=0){ + $Quantity, + $CostPerUnit, + $ContractReqID=0){ /* Constructor function to add a new Contract Component object with passed params */ $this->Requirement = $Requirement; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-30 05:51:00
|
Revision: 4737 http://web-erp.svn.sourceforge.net/web-erp/?rev=4737&view=rev Author: daintree Date: 2011-10-30 05:50:51 +0000 (Sun, 30 Oct 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/BOMs.php trunk/ContractBOM.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/CreditStatus.php trunk/Currencies.php trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerAllocations.php trunk/CustomerBranches.php trunk/CustomerInquiry.php trunk/SalesPeople.php trunk/Stocks.php trunk/doc/Change.log trunk/includes/DefineCustAllocsClass.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/BOMs.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -9,7 +9,7 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -function display_children($parent, $level, &$BOMTree) { +function display_children($Parent, $Level, &$BOMTree) { global $db; global $i; @@ -17,25 +17,25 @@ // retrive all children of parent $c_result = DB_query("SELECT parent, component - FROM bom WHERE parent='" . $parent. "'" + FROM bom WHERE parent='" . $Parent. "'" ,$db); if (DB_num_rows($c_result) > 0) { while ($row = DB_fetch_array($c_result)) { - //echo '<br />Parent: ' . $parent . ' Level: ' . $level . ' row[component]: ' . $row['component'] .'<br />'; - if ($parent != $row['component']) { + //echo '<br />Parent: ' . $Parent . ' Level: ' . $Level . ' row[component]: ' . $row['component'] .'<br />'; + if ($Parent != $row['component']) { // indent and display the title of this child - $BOMTree[$i]['Level'] = $level; // Level - if ($level > 15) { + $BOMTree[$i]['Level'] = $Level; // Level + if ($Level > 15) { prnMsg(_('A maximum of 15 levels of bill of materials only can be displayed'),'error'); exit; } - $BOMTree[$i]['Parent'] = $parent; // Assemble + $BOMTree[$i]['Parent'] = $Parent; // Assemble $BOMTree[$i]['Component'] = $row['component']; // Component // call this function again to display this // child's children $i++; - display_children($row['component'], $level + 1, $BOMTree); + display_children($row['component'], $Level + 1, $BOMTree); } } } @@ -53,11 +53,11 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($result)!=0) { - while ($myrow=DB_fetch_row($result)){ - if ($myrow[0]==$UltimateParent){ + while ($myrow=DB_fetch_array($result)){ + if ($myrow['component']==$UltimateParent){ return 1; } - if (CheckForRecursiveBOM($UltimateParent, $myrow[0],$db)){ + if (CheckForRecursiveBOM($UltimateParent, $myrow['component'],$db)){ return 1; } } //(while loop) @@ -70,11 +70,10 @@ function DisplayBOMItems($UltimateParent, $Parent, $Component,$Level, $db) { global $ParentMBflag; - // Modified by POPAD&T $sql = "SELECT bom.component, - stockmaster.description, + stockmaster.description as itemdescription, locations.locationname, - workcentres.description, + workcentres.description as workcentrename, bom.quantity, bom.effectiveafter, bom.effectiveto, @@ -83,19 +82,17 @@ stockmaster.controlled, locstock.quantity AS qoh, stockmaster.decimalplaces - FROM bom, - stockmaster, - locations, - workcentres, - locstock - WHERE bom.component='".$Component."' - AND bom.parent = '".$Parent."' - AND bom.component=stockmaster.stockid - AND bom.loccode = locations.loccode - AND locstock.loccode=bom.loccode - AND bom.component = locstock.stockid - AND bom.workcentreadded=workcentres.code - AND stockmaster.stockid=bom.component"; + FROM bom INNER JOIN stockmaster + ON bom.component=stockmaster.stockid + INNER JOIN locations ON + bom.loccode = locations.loccode + INNER JOIN workcentres + ON bom.workcentreadded=workcentres.code + INNER JOIN locstock + ON bom.loccode=locstock.loccode + AND bom.component = locstock.stockid + WHERE bom.component='".$Component."' + AND bom.parent = '".$Parent."'"; $ErrMsg = _('Could not retrieve the BOM components because'); $DbgMsg = _('The SQL used to retrieve the components was'); @@ -104,33 +101,41 @@ //echo $TableHeader; $RowCounter =0; - while ($myrow=DB_fetch_row($result)) { + while ($myrow=DB_fetch_array($result)) { $Level1 = str_repeat('- ',$Level-1).$Level; - if( $myrow[7]=='B' OR $myrow[7]=='K' OR $myrow[7]=='D') { + if( $myrow['mbflag']=='B' + OR $myrow['mbflag']=='K' + OR $myrow['mbflag']=='D') { + $DrillText = '%s%s'; $DrillLink = '<div class="centre">'._('No lower levels').'</div>'; $DrillID=''; } else { $DrillText = '<a href="%s&Select=%s">' . _('Drill Down'); $DrillLink = htmlspecialchars($_SERVER['PHP_SELF']) . '?'; - $DrillID=$myrow[0]; + $DrillID=$myrow['component']; } if ($ParentMBflag!='M' AND $ParentMBflag!='G'){ $AutoIssue = _('N/A'); - } elseif ($myrow[9]==0 AND $myrow[8]==1){//autoissue and not controlled + } elseif ($myrow['controlled']==0 AND $myrow['autoissue']==1){//autoissue and not controlled $AutoIssue = _('Yes'); - } elseif ($myrow[9]==0) { + } elseif ($myrow['controlled']==1) { $AutoIssue = _('No'); } else { $AutoIssue = _('N/A'); } - if ($myrow[7]=='D' OR $myrow[7]=='K' OR $myrow[7]=='A' OR $myrow[7]=='G'){ + if ($myrow['mbflag']=='D' //dummy orservice + OR $myrow['mbflag']=='K' //kit-set + OR $myrow['mbflag']=='A' // assembly + OR $myrow['mbflag']=='G') /* ghost */ { + $QuantityOnHand = _('N/A'); } else { - $QuantityOnHand = locale_number_format($myrow[10],$myrow[11]); - } + $QuantityOnHand = locale_number_format($myrow['qoh'],$myrow['decimalplaces']); + } + printf('<td>%s</td> <td>%s</td> <td>%s</td> @@ -146,23 +151,23 @@ <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this component from the bill of material?') . '\');">' . _('Delete') . '</a></td> </tr>', $Level1, - $myrow[0], - $myrow[1], - $myrow[2], - $myrow[3], - locale_number_format($myrow[4],'Variable'), - ConvertSQLDate($myrow[5]), - ConvertSQLDate($myrow[6]), + $myrow['component'], + $myrow['itemdescription'], + $myrow['locationname'], + $myrow['workcentrename'], + locale_number_format($myrow['quantity'],'Variable'), + ConvertSQLDate($myrow['effectiveafter']), + ConvertSQLDate($myrow['effectiveto']), $AutoIssue, $QuantityOnHand, htmlspecialchars($_SERVER['PHP_SELF']) . '?', $Parent, - $myrow[0], + $myrow['component'], $DrillLink, $DrillID, htmlspecialchars($_SERVER['PHP_SELF']) . '?', $Parent, - $myrow[0], + $myrow['component'], $UltimateParent); } //END WHILE LIST LOOP @@ -246,7 +251,7 @@ $Errors[$i] = 'EffectiveTo'; $i++; } - if($_POST['AutoIssue']==1 and isset($_POST['Component'])){ + if($_POST['AutoIssue']==1 AND isset($_POST['Component'])){ $sql = "SELECT controlled FROM stockmaster WHERE stockid='" . $_POST['Component'] . "'"; $CheckControlledResult = DB_query($sql,$db); $CheckControlledRow = DB_fetch_row($CheckControlledResult); Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/ContractBOM.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -14,7 +14,7 @@ */ if (!isset($_SESSION['Contract'.$identifier])){ - header('Location:' . $rootpath . '/Contracts.php?' . SID); + header('Location:' . $rootpath . '/Contracts.php'); exit; } include('includes/header.inc'); @@ -22,11 +22,11 @@ if (isset($_POST['UpdateLines']) OR isset($_POST['BackToHeader'])) { if($_SESSION['Contract'.$identifier]->Status!=2){ //dont do anything if the customer has committed to the contract foreach ($_SESSION['Contract'.$identifier]->ContractBOM as $ContractComponent) { - if ($_POST['Qty'.$ContractComponent->ComponentID]==0){ + if (filter_number_format($_POST['Qty'.$ContractComponent->ComponentID])==0){ //this is the same as deleting the line - so delete it $_SESSION['Contract'.$identifier]->Remove_ContractComponent($ContractComponent->ComponentID); } else { - $_SESSION['Contract'.$identifier]->ContractBOM[$ContractComponent->ComponentID]->Quantity=$_POST['Qty'.$ContractComponent->ComponentID]; + $_SESSION['Contract'.$identifier]->ContractBOM[$ContractComponent->ComponentID]->Quantity=filter_number_format($_POST['Qty'.$ContractComponent->ComponentID]); } } // end loop around the items on the contract BOM } // end if the contract is not currently committed to by the customer @@ -53,29 +53,29 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } elseif ($_POST['StockCode']){ @@ -84,55 +84,55 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -160,52 +160,48 @@ } } - - if (isset($_POST['NewItem'])){ /* NewItem is set from the part selection list as the part code selected */ -/* take the form entries and enter the data from the form into the PurchOrder class variable */ - foreach ($_POST as $ItemCode => $Quantity) { - if (mb_substr($ItemCode, 0, 3)=='Qty') { - $ItemCode=mb_substr($ItemCode, 3, mb_strlen($ItemCode)-3); - $AlreadyOnThisBOM = 0; - + for ($i=0;$i < $_POST['CountOfItems'];$i++) { + $AlreadyOnThisBOM = 0; + if (filter_number_format($_POST['Qty'.$i])>0){ if (count($_SESSION['Contract'.$identifier]->ContractBOM)!=0){ - + foreach ($_SESSION['Contract'.$identifier]->ContractBOM AS $Component) { - + /* do a loop round the items on the order to see that the item is not already on this order */ - if ($Component->StockID == $ItemCode) { + if ($Component->StockID == trim($_POST['StockID'.$i])) { $AlreadyOnThisBOM = 1; - prnMsg( _('The item') . ' ' . $ItemCode . ' ' . _('is already in the bill of material for this contract. The system will not allow the same item on the contract more than once. However you can change the quantity required for the item.'),'error'); + prnMsg( _('The item') . ' ' . trim($_POST['StockID'.$i]) . ' ' . _('is already in the bill of material for this contract. The system will not allow the same item on the contract more than once. However you can change the quantity required for the item.'),'error'); } } /* end of the foreach loop to look for preexisting items of the same code */ } - - if ($AlreadyOnThisBOM!=1 and $Quantity>0){ - + + if ($AlreadyOnThisBOM!=1){ + $sql = "SELECT stockmaster.description, stockmaster.stockid, stockmaster.units, stockmaster.decimalplaces, stockmaster.materialcost+labourcost+overheadcost AS unitcost FROM stockmaster - WHERE stockmaster.stockid = '". $ItemCode . "'"; - + WHERE stockmaster.stockid = '". trim($_POST['StockID'.$i]) . "'"; + $ErrMsg = _('The item details could not be retrieved'); $DbgMsg = _('The SQL used to retrieve the item details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); - + if ($myrow = DB_fetch_array($result1)){ - - $_SESSION['Contract'.$identifier]->Add_To_ContractBOM ($ItemCode, + + $_SESSION['Contract'.$identifier]->Add_To_ContractBOM (trim($_POST['StockID'.$i]), $myrow['description'], - $DefaultWorkCentre, - $Quantity, /* Qty */ + '', + filter_number_format($_POST['Qty'.$i]), /* Qty */ $myrow['unitcost'], - $myrow['units']); + $myrow['units'], + $myrow['decimalplaces']); } else { - prnMsg (_('The item code') . ' ' . $ItemCode . ' ' . _('does not exist in the database and therefore cannot be added to the contract BOM'),'error'); + prnMsg (_('The item code') . ' ' . trim($_POST['StockID'.$i]) . ' ' . _('does not exist in the database and therefore cannot be added to the contract BOM'),'error'); if ($debug==1){ echo '<br />' . $sql; } @@ -213,7 +209,7 @@ exit; } } /* end of if not already on the contract BOM */ - } + } /* the quantity of the item is > 0 */ } } /* end of if its a new item */ @@ -223,21 +219,25 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (count($_SESSION['Contract'.$identifier]->ContractBOM)>0){ - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract Bill of Material') . '" alt="" /> '.$_SESSION['Contract'.$identifier]->CustomerName . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract Bill of Material') . '" alt="" /> '.$_SESSION['Contract'.$identifier]->CustomerName . ' + </p>'; - echo '<table cellpadding="2" class="selection">'; + echo '<table class="selection">'; if (isset($_SESSION['Contract'.$identifier]->ContractRef)) { - echo '<tr><th colspan="7"><font color="navy" size="2">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</font></th></tr>'; + echo '<tr> + <th colspan="7"><font color="navy" size="2">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</font></th> + </tr>'; } echo '<tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('UOM') .'</th> - <th>' . _('Unit Cost') . '</th> - <th>' . _('Sub-total') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('UOM') .'</th> + <th>' . _('Unit Cost') . '</th> + <th>' . _('Sub-total') . '</th> </tr>'; $_SESSION['Contract'.$identifier]->total = 0; @@ -247,7 +247,7 @@ $LineTotal = $ContractComponent->Quantity * $ContractComponent->ItemCost; - $DisplayLineTotal = locale_number_format($LineTotal,2); + $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -259,17 +259,17 @@ echo '<td>' . $ContractComponent->StockID . '</td> <td>' . $ContractComponent->ItemDescription . '</td> - <td><input type="text" class="number" name="Qty' . $ContractComponent->ComponentID . '" size="11" value="' . $ContractComponent->Quantity . '" /></td> + <td><input type="text" class="number" name="Qty' . $ContractComponent->ComponentID . '" size="11" value="' . locale_number_format($ContractComponent->Quantity,$ContractComponent->DecimalPlaces) . '" /></td> <td>' . $ContractComponent->UOM . '</td> - <td class="number">' . $ContractComponent->ItemCost . '</td> + <td class="number">' . locale_number_format($ContractComponent->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this item from the contract BOM?') . '\');">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } - $DisplayTotal = locale_number_format($TotalCost,2); + $DisplayTotal = locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']); echo '<tr> - <td colspan="6" class="number">' . _('Total Cost') . '</td> + <td colspan="5" class="number">' . _('Total Cost') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> </tr> </table>'; @@ -281,11 +281,11 @@ if (!isset($_GET['Edit'])) { $sql="SELECT categoryid, - categorydescription - FROM stockcategory - WHERE stocktype<>'L' - AND stocktype<>'D' - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + WHERE stocktype<>'L' + AND stocktype<>'D' + ORDER BY categorydescription"; $ErrMsg = _('The supplier category details could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -316,21 +316,25 @@ } echo '</select></td> - <td><font size="2">' . _('Enter text extracts in the description') . ':</font></td> - <td><input type="text" name="Keywords" size="20" maxlength="25" value="' . $_POST['Keywords'] . '" /></td></tr> - <tr><td></td> - <td><font size="3"> <b>' . _('OR') . ' </b></font><font size="2">' . _('Enter extract of the Stock Code') . - ':</font></td> - <td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '" /></td> + <td><font size="2">' . _('Enter text extracts in the description') . ':</font></td> + <td><input type="text" name="Keywords" size="20" maxlength="25" value="' . $_POST['Keywords'] . '" /></td> </tr> - <tr><td></td> - <td><font size="3"><b>' . _('OR') . ' </b></font><font size="2"><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></font></td></tr> - </table><br /> - <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /> - </div><br />'; + <tr> + <td></td> + <td><font size="3"> <b>' . _('OR') . ' </b></font><font size="2">' . _('Enter extract of the Stock Code') . ':</font></td> + <td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '" /></td> + </tr> + <tr> + <td></td> + <td><font size="3"><b>' . _('OR') . ' </b></font><font size="2"><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></font></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Search" value="' . _('Search Now') . '" /> + </div> + <br />'; - - $PartsDisplayed =0; } if (isset($SearchResult)) { @@ -338,17 +342,16 @@ echo '<table cellpadding="1" colspan="7">'; $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('Image') . '</th> - <th>' . _('Quantity') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> </tr>'; echo $TableHeader; - $j = 1; $k=0; //row colour counter - + $i=0; while ($myrow=DB_fetch_array($SearchResult)) { if ($k==1){ @@ -366,31 +369,34 @@ } echo '<td>'.$myrow['stockid'].'</td> - <td>'.$myrow['description'].'</td> - <td>'.$myrow['units'] . '</td> - <td>'.$ImageSource.'</td> - <td><input class="number" type="text" size="6" value="0" name="Qty'.$myrow['stockid'].'" /></td> + <td>'.$myrow['description'].'</td> + <td>'.$myrow['units'] . '</td> + <td>'.$ImageSource.'</td> + <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /> + <input type="hidden" name="StockID'.$i.'" value="' . $myrow['stockid'] . '" /> + </td> </tr>'; - - $PartsDisplayed++; - if ($PartsDisplayed == $_SESSION['DisplayRecordsMax']){ + $i++; + if ($i == $_SESSION['DisplayRecordsMax']){ break; } #end of page full new headings if } + #end of while loop - echo '</table>'; - if ($PartsDisplayed == $_SESSION['DisplayRecordsMax']){ + echo '</table> + <input type="hidden" name="CountOfItems" value="'. $i . '" />'; + if ($i == $_SESSION['DisplayRecordsMax']){ - - prnMsg( _('Only the first') . ' ' . $_SESSION['DisplayRecordsMax'] . ' ' . _('can be displayed') . '. ' . - _('Please restrict your search to only the parts required'),'info'); + prnMsg( _('Only the first') . ' ' . $_SESSION['DisplayRecordsMax'] . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<br /><div class="centre"><input type="submit" name="NewItem" value="' . _('Add to Contract Bill Of Material') .'" /></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="NewItem" value="' . _('Add to Contract Bill Of Material') .'" /> + </div>'; }#end if SearchResults to show -echo '<hr />'; - -echo '</form>'; +echo '<hr /> + </form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/ContractOtherReqts.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -24,7 +24,7 @@ if($_SESSION['Contract'.$identifier]->Status!=2){ //dont do anything if the customer has committed to the contract foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $ContractComponentID => $ContractRequirementItem) { - if ($_POST['Qty'.$ContractComponentID]==0){ + if (filter_number_format($_POST['Qty'.$ContractComponentID])==0){ //this is the same as deleting the line - so delete it $_SESSION['Contract'.$identifier]->Remove_ContractRequirement($ContractComponentID); } else { @@ -81,10 +81,12 @@ if (count($_SESSION['Contract'.$identifier]->ContractReqts)>0){ - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table class="selection">'; if (isset($_SESSION['Contract'.$identifier]->ContractRef)) { - echo '<tr><th colspan="5">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</th></tr>'; + echo '<tr> + <th colspan="5">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</th> + </tr>'; } echo '<tr> Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/Contracts.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -276,7 +276,6 @@ $WorkCentre = $_SESSION['Contract'.$identifier]->LocCode; } /*The above is a bit of a hack to get a default workcentre for a location based on the users default location*/ - } $sql = "SELECT contractref, @@ -542,22 +541,22 @@ quotation) VALUES ( '". $OrderNo . "', - '" . DB_escape_string($_SESSION['Contract'.$identifier]->DebtorNo) . "', - '" . DB_escape_string($_SESSION['Contract'.$identifier]->BranchCode) . "', - '". DB_escape_string($_SESSION['Contract'.$identifier]->CustomerRef) ."', - '" . DB_escape_string(Date('Y-m-d H:i')) . "', - '" . DB_escape_string($CustomerDetailsRow['salestype']) . "', - '" . DB_escape_string($CustomerDetailsRow['defaultshipvia']) ."', - '". DB_escape_string($CustomerDetailsRow['brname']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress1']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress2']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress3']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress4']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress5']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress6']) . "', - '" . DB_escape_string($CustomerDetailsRow['phoneno']) . "', - '" . DB_escape_string($CustomerDetailsRow['email']) . "', - '" . DB_escape_string($_SESSION['Contract'.$identifier]->LocCode) ."', + '" . $_SESSION['Contract'.$identifier]->DebtorNo . "', + '" . $_SESSION['Contract'.$identifier]->BranchCode . "', + '". $_SESSION['Contract'.$identifier]->CustomerRef ."', + '" . Date('Y-m-d H:i') . "', + '" . $CustomerDetailsRow['salestype'] . "', + '" . $CustomerDetailsRow['defaultshipvia'] ."', + '". $CustomerDetailsRow['brname'] . "', + '" . $CustomerDetailsRow['braddress1'] . "', + '" . $CustomerDetailsRow['braddress2'] . "', + '" . $CustomerDetailsRow['braddress3'] . "', + '" . $CustomerDetailsRow['braddress4'] . "', + '" . $CustomerDetailsRow['braddress5'] . "', + '" . $CustomerDetailsRow['braddress6'] . "', + '" . $CustomerDetailsRow['phoneno'] . "', + '" . $CustomerDetailsRow['email'] . "', + '" . $_SESSION['Contract'.$identifier]->LocCode ."', '" . FormatDateForSQL($_SESSION['Contract'.$identifier]->RequiredDate) . "', '" . Date('Y-m-d') . "', '1' )"; @@ -573,10 +572,10 @@ itemdue) VALUES ('0', '" . $OrderNo . "', - '" . DB_escape_string($_SESSION['Contract'.$identifier]->ContractRef) . "', + '" . $_SESSION['Contract'.$identifier]->ContractRef . "', '" . ($ContractPrice * $_SESSION['Contract'.$identifier]->ExRate) . "', '1', - '" . DB_escape_string($_SESSION['Contract'.$identifier]->CustomerRef) . "', + '" . $_SESSION['Contract'.$identifier]->CustomerRef . "', '" . FormatDateForSQL($_SESSION['Contract'.$identifier]->RequiredDate) . "')"; $DbgMsg = _('The SQL that failed was'); $ErrMsg = _('Unable to add the quotation line'); @@ -586,7 +585,7 @@ //make the status of the contract 1 - to indicate that it is now quoted $sql = "UPDATE contracts SET orderno='" . $OrderNo . "', status='" . 1 . "' - WHERE contractref='" . DB_escape_string($_SESSION['Contract'.$identifier]->ContractRef) . "'"; + WHERE contractref='" . $_SESSION['Contract'.$identifier]->ContractRef . "'"; $ErrMsg = _('Unable to update the contract status and order number because'); $UpdContractResult = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); $Result = DB_Txn_Commit($db); @@ -597,7 +596,6 @@ } //end of if making a quotation - if (isset($_POST['SearchCustomers'])){ if (($_POST['CustKeywords']!='') AND (($_POST['CustCode']!='') OR ($_POST['CustPhone']!=''))) { @@ -624,7 +622,7 @@ FROM custbranch LEFT JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.brname " . LIKE . " '$SearchString' + WHERE custbranch.brname " . LIKE . " '" . $SearchString . "' AND custbranch.disabletrans=0 ORDER BY custbranch.debtorno, custbranch.branchcode"; @@ -832,8 +830,10 @@ /*Set up form for entry of contract header stuff */ - echo '<table class="selection">'; - echo '<tr><td>' . _('Contract Reference') . ':</td><td>'; + echo '<table class="selection"> + <tr> + <td>' . _('Contract Reference') . ':</td> + <td>'; if ($_SESSION['Contract'.$identifier]->Status==0) { /*Then the contract has not become an order yet and we can allow changes to the ContractRef */ echo '<input type="text" name="ContractRef" size="21" maxlength="20" value="' . $_SESSION['Contract'.$identifier]->ContractRef . '" />'; @@ -875,27 +875,36 @@ } } - echo '</select></td></tr>'; + echo '</select></td> + </tr> + <tr> + <td>' . _('Contract Description') . ':</td> + <td><textarea name="ContractDescription" style="width:100%" rows="5">' . $_SESSION['Contract'.$identifier]->ContractDescription . '</textarea></td> + </tr><tr> + <td>'. _('Drawing File') . ' .jpg' . ' ' . _('format only') .':</td> + <td><input type="file" id="Drawing" name="Drawing" /></td> + </tr>'; - echo '<tr><td>' . _('Contract Description'); - echo ':</td><td><textarea name="ContractDescription" style="width:100%" rows="5">' . $_SESSION['Contract'.$identifier]->ContractDescription . '</textarea></td></tr>'; - - echo '<tr><td>'. _('Drawing File') . ' .jpg' . ' ' . _('format only') .':</td><td><input type="file" id="Drawing" name="Drawing" /></td></tr>'; - if (!isset($_SESSION['Contract'.$identifier]->RequiredDate)) { $_SESSION['Contract'.$identifier]->RequiredDate = DateAdd(date($_SESSION['DefaultDateFormat']),'m',1); } - echo '<tr><td>' . _('Required Date') . ':</td> - <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredDate" size="11" value="' . $_SESSION['Contract'.$identifier]->RequiredDate . '" /></td></tr>'; + echo '<tr> + <td>' . _('Required Date') . ':</td> + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredDate" size="11" value="' . $_SESSION['Contract'.$identifier]->RequiredDate . '" /></td> + </tr>'; - echo '<tr><td>' . _('Customer Reference') . ':</td> - <td><input type="text" name="CustomerRef" size="21" maxlength="20" value="' . $_SESSION['Contract'.$identifier]->CustomerRef . '" /></td></tr>'; + echo '<tr> + <td>' . _('Customer Reference') . ':</td> + <td><input type="text" name="CustomerRef" size="21" maxlength="20" value="' . $_SESSION['Contract'.$identifier]->CustomerRef . '" /></td> + </tr>'; if (!isset($_SESSION['Contract'.$identifier]->Margin)){ $_SESSION['Contract'.$identifier]->Margin =50; } - echo '<tr><td>' . _('Gross Profit') . ' %:</td> - <td><input type="text" name="Margin" size="4" maxlength="4" value="' . locale_number_format($_SESSION['Contract'.$identifier]->Margin,2) . '" /></td></tr>'; + echo '<tr> + <td>' . _('Gross Profit') . ' %:</td> + <td><input type="text" name="Margin" size="4" maxlength="4" value="' . locale_number_format($_SESSION['Contract'.$identifier]->Margin,2) . '" /></td> + </tr>'; if ($_SESSION['CompanyRecord']['currencydefault'] != $_SESSION['Contract'.$identifier]->CurrCode){ echo '<tr> @@ -906,7 +915,9 @@ echo '<input type="hidden" name="ExRate" value="' . locale_number_format($_SESSION['Contract'.$identifier]->ExRate,'Variable') . '" />'; } - echo '<tr><td>' . _('Contract Status') . ':</td><td>'; + echo '<tr> + <td>' . _('Contract Status') . ':</td> + <td>'; $StatusText = array(); $StatusText[0] = _('Setup'); @@ -920,19 +931,29 @@ echo _('Order Placed'); } echo '<input type="hidden" name="Status" value="'.$_SESSION['Contract'.$identifier]->Status.'" />'; - echo '</td></tr>'; + echo '</td> + </tr>'; if ($_SESSION['Contract'.$identifier]->Status >=1) { - echo '<tr><td>' . _('Quotation Reference/Sales Order No') . ':</td> - <td><a href="' . $rootpath . '/SelectSalesOrder.php?OrderNumber=' . $_SESSION['Contract'.$identifier]->OrderNo . '&Quotations=Quotes_Only">' . $_SESSION['Contract'.$identifier]->OrderNo . '</a></td></tr>'; + echo '<tr> + <td>' . _('Quotation Reference/Sales Order No') . ':</td> + <td><a href="' . $rootpath . '/SelectSalesOrder.php?OrderNumber=' . $_SESSION['Contract'.$identifier]->OrderNo . '&Quotations=Quotes_Only">' . $_SESSION['Contract'.$identifier]->OrderNo . '</a></td> + </tr>'; } if ($_SESSION['Contract'.$identifier]->Status!=2 and isset($_SESSION['Contract'.$identifier]->WO)) { - echo '<tr><td>' . _('Contract Work Order Ref') . ':</td> - <td>' . $_SESSION['Contract'.$identifier]->WO . '</td></tr>'; + echo '<tr> + <td>' . _('Contract Work Order Ref') . ':</td> + <td>' . $_SESSION['Contract'.$identifier]->WO . '</td> + </tr>'; } echo '</table><br />'; - echo '<table><tr><td> - <table class="selection"><tr><th colspan="6">' . _('Stock Items Required') . '</th></tr>'; + echo '<table> + <tr> + <td> + <table class="selection"> + <tr> + <th colspan="6">' . _('Stock Items Required') . '</th> + </tr>'; $ContractBOMCost = 0; if (count($_SESSION['Contract'.$identifier]->ContractBOM)!=0){ echo '<tr><th>' . _('Item Code') . '</th> @@ -944,29 +965,30 @@ </tr>'; foreach ($_SESSION['Contract'.$identifier]->ContractBOM as $Component) { - echo '<tr><td>' . $Component->StockID . '</td> + echo '<tr> + <td>' . $Component->StockID . '</td> <td>' . $Component->ItemDescription . '</td> - <td class="number">' . $Component->Quantity . '</td> + <td class="number">' . locale_number_format($Component->Quantity,$Component->DecimalPlaces) . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . locale_number_format($Component->ItemCost,2) . '</td> - <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> + <td class="number">' . locale_number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $ContractBOMCost += ($Component->ItemCost * $Component->Quantity); } echo '<tr> <th colspan="5"><b>' . _('Total stock cost') . '</b></th> - <th class="number"><b>' . locale_number_format($ContractBOMCost,2) . '</b></th> + <th class="number"><b>' . locale_number_format($ContractBOMCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th> </tr>'; } else { //there are no items set up against this contract echo '<tr> <td colspan="6"><i>' . _('None Entered') . '</i></td> - </tr>'; + </tr>'; } echo '</table></td>'; //end of contract BOM table echo '<td valign="top"> <table class="selection"> <tr> - <th colspan="4">' . _('Other Requirements') . '</th> + <th colspan="4">' . _('Other Requirements') . '</th> </tr>'; $ContractReqtsCost = 0; if (count($_SESSION['Contract'.$identifier]->ContractReqts)!=0){ @@ -979,28 +1001,35 @@ foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $Requirement) { echo '<tr> <td>' . $Requirement->Requirement . '</td> - <td class="number">' . $Requirement->Quantity . '</td> - <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> + <td class="number">' . locale_number_format($Requirement->Quantity,'Variable') . '</td> + <td class="number">' . locale_number_format($Requirement->CostPerUnit,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $ContractReqtsCost += ($Requirement->CostPerUnit * $Requirement->Quantity); } - echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . locale_number_format($ContractReqtsCost,2) . '</b></th></tr>'; + echo '<tr> + <th colspan="3"><b>' . _('Total other costs') . '</b></th> + <th class="number"><b>' . locale_number_format($ContractReqtsCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th> + </tr>'; } else { //there are no items set up against this contract - echo '<tr><td colspan="4"><i>' . _('None Entered') . '</i></td></tr>'; + echo '<tr> + <td colspan="4"><i>' . _('None Entered') . '</i></td> + </tr>'; } echo '</table></td></tr></table>'; echo '<br />'; echo'<table class="selection"> - <tr><th>' . _('Total Contract Cost') . '</th> - <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th>' . _('Contract Price') . '</th> - <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <tr> + <th>' . _('Total Contract Cost') . '</th> + <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th>' . _('Contract Price') . '</th> + <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr> - </table>'; + </table>'; echo'<p></p>'; - echo '<div class="centre"><input type="submit" name="EnterContractBOM" value="' . _('Enter Items Required') . '" /> + echo '<div class="centre"> + <input type="submit" name="EnterContractBOM" value="' . _('Enter Items Required') . '" /> <input type="submit" name="EnterContractRequirements" value="' . _('Enter Other Requirements') .'" />'; if($_SESSION['Contract'.$identifier]->Status==0){ // not yet quoted echo '<input type="submit" name="CommitContract" value="' . _('Commit Changes') .'" />'; @@ -1008,12 +1037,17 @@ echo '<input type="submit" name="CommitContract" value="' . _('Update Quotation') .'" />'; } if($_SESSION['Contract'.$identifier]->Status==0){ //not yet quoted - echo ' <input type="submit" name="CreateQuotation" value="' . _('Create Quotation') .'" /></div>'; + echo ' <input type="submit" name="CreateQuotation" value="' . _('Create Quotation') .'" /> + </div>'; } else { echo '</div>'; } if ($_SESSION['Contract'.$identifier]->Status!=2) { - echo '<p><div class="centre"><input type="submit" name="CancelContract" value="' . _('Cancel and Delete Contract') . '" /></div></p>'; + echo '<p> + <div class="centre"> + <input type="submit" name="CancelContract" value="' . _('Cancel and Delete Contract') . '" /> + </div> + </p>'; } echo '</form>'; } /*end of if customer selected and entering contract header*/ Modified: trunk/CreditStatus.php =================================================================== --- trunk/CreditStatus.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/CreditStatus.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -17,7 +17,9 @@ } $Errors = array(); $InputError = 0; -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p> +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' + </p> <br />'; if (isset($_POST['submit'])) { @@ -141,14 +143,14 @@ links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = 'SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons'; + $sql = "SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons"; $result = DB_query($sql, $db); - echo '<table class=selection>'; - echo '<tr> - <th>'. _('Status Code') .'</th> - <th>'. _('Description') .'</th> - <th>'. _('Disallow Invoices') .'</th>'; + echo '<table class="selection"> + <tr> + <th>'. _('Status Code') .'</th> + <th>'. _('Description') .'</th> + <th>'. _('Disallow Invoices') .'</th>'; $k=0; //row colour counter while ($myrow=DB_fetch_array($result)) { @@ -186,7 +188,9 @@ } //end of ifs and buts! if (isset($SelectedReason)) { - echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show Defined Credit Status Codes') . '</a></div>'; + echo '<div class="centre"> + <a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show Defined Credit Status Codes') . '</a> + </div>'; } if (!isset($_GET['delete'])) { @@ -210,8 +214,8 @@ $_POST['ReasonDescription'] = $myrow['reasondescription']; $_POST['DisallowInvoices'] = $myrow['dissallowinvoices']; - echo '<input type="hidden" name="SelectedReason" value="' . $SelectedReason . '">'; - echo '<input type="hidden" name="ReasonCode" value="' . $_POST['ReasonCode'] . '">'; + echo '<input type="hidden" name="SelectedReason" value="' . $SelectedReason . '" />'; + echo '<input type="hidden" name="ReasonCode" value="' . $_POST['ReasonCode'] . '" />'; echo '<table class="selection"> <tr> <td>'. _('Status Code') .':</td> @@ -226,7 +230,7 @@ <table class="selection"> <tr> <td>'. _('Status Code') .':</td> - <td><input ' . (in_array('ReasonCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex=1 type="text" name="ReasonCode" value="'. $_POST['ReasonCode'] .'" size=3 maxlength=2></td> + <td><input ' . (in_array('ReasonCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="1" type="text" name="ReasonCode" value="'. $_POST['ReasonCode'] .'" size="3" maxlength="2" /></td> </tr>'; } @@ -241,13 +245,17 @@ <tr> <td>'. _('Disallow Invoices') . '</td>'; if (isset($_POST['DisallowInvoices']) and $_POST['DisallowInvoices']==1) { - echo '<td><input tabindex=3 type="checkbox" checked name="DisallowInvoices"></td></tr>'; + echo '<td><input tabindex="3" type="checkbox" checked name="DisallowInvoices" /></td> + </tr>'; } else { - echo '<td><input tabindex=3 type="checkbox" name="DisallowInvoices"></td></tr>'; + echo '<td><input tabindex=3 type="checkbox" name="DisallowInvoices" /></td> + </tr>'; } echo '</table> <br /> - <div class="centre"><input tabindex=4 type="submit" name="submit" value="' . _('Enter Information') . '"></div> + <div class="centre"> + <input tabindex="4" type="submit" name="submit" value="' . _('Enter Information') . '" /> + </div> </form>'; } //end if record deleted no point displaying form to add record include('includes/footer.inc'); Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/Currencies.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -40,7 +40,9 @@ $i=1; $sql="SELECT count(currabrev) - FROM currencies WHERE currabrev='".$_POST['Abbreviation']."'"; + FROM currencies + WHERE currabrev='".$_POST['Abbreviation']."'"; + $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); @@ -56,23 +58,23 @@ $Errors[$i] = 'Abbreviation'; $i++; } - if (!is_numeric($_POST['ExchangeRate'])){ + if (!is_numeric(filter_number_format($_POST['ExchangeRate']))){ $InputError = 1; prnMsg(_('The exchange rate must be numeric'),'error'); $Errors[$i] = 'ExchangeRate'; $i++; } - if (!is_numeric($_POST['DecimalPlaces'])){ + if (!is_numeric(filter_number_format($_POST['DecimalPlaces']))){ $InputError = 1; prnMsg(_('The number of decimal places to display for amounts in this currency must be numeric'),'error'); $Errors[$i] = 'DecimalPlaces'; $i++; - }elseif ($_POST['DecimalPlaces']<=0){ + }elseif (filter_number_format($_POST['DecimalPlaces'])<=0){ $InputError = 1; prnMsg(_('The number of decimal places to display for amounts in this currency must be positive or zero'),'error'); $Errors[$i] = 'DecimalPlaces'; $i++; - } elseif ($_POST['DecimalPlaces']>2){ + } elseif (filter_number_format($_POST['DecimalPlaces'])>2){ $InputError = 1; prnMsg(_('The number of decimal places to display for amounts in this currency is expected to be 2 or less'),'error'); $Errors[$i] = 'DecimalPlaces'; @@ -113,8 +115,8 @@ $sql = "UPDATE currencies SET currency='" . $_POST['CurrencyName'] . "', country='". $_POST['Country']. "', hundredsname='" . $_POST['HundredsName'] . "', - decimalplaces='" . $_POST['DecimalPlaces'] . "', - rate='" .$_POST['ExchangeRate'] . "' + decimalplaces='" . filter_number_format($_POST['DecimalPlaces']) . "', + rate='" .filter_number_format($_POST['ExchangeRate']) . "' WHERE currabrev = '" . $SelectedCurrency . "'"; $msg = _('The currency definition record has been updated'); @@ -131,8 +133,8 @@ '" . $_POST['Abbreviation'] . "', '" . $_POST['Country'] . "', '" . $_POST['HundredsName'] . "', - '" . $_POST['DecimalPlaces'] . "', - '" . $_POST['ExchangeRate'] . "')"; + '" . filter_number_format($_POST['DecimalPlaces']) . "', + '" . filter_number_format($_POST['ExchangeRate']) . "')"; $msg = _('The currency definition record has been added'); } @@ -208,7 +210,8 @@ $result = DB_query($sql, $db); echo '<table class="selection">'; - echo '<tr><td></td> + echo '<tr> + <td></td> <th>' . _('ISO4217 Code') . '</th> <th>' . _('Currency Name') . '</th> <th>' . _('Country') . '</th> @@ -216,7 +219,7 @@ <th>' . _('Decimal Places') . '</th> <th>' . _('Exchange Rate') . '</th> <th>' . _('Ex Rate - ECB') .'</th> - </tr>'; + </tr>'; $k=0; //row colour counter /*Get published currency rates from Eurpoean Central Bank */ @@ -249,9 +252,9 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> <td><a href="%s&SelectedCurrency=%s">%s</a></td> <td><a href="%s&SelectedCurrency=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this currency?') . '\');">%s</a></td> <td><a href="%s/ExchangeRateTrend.php?%s">' . _('Graph') . '</a></td> @@ -261,9 +264,9 @@ $myrow['currency'], $myrow['country'], $myrow['hundredsname'], - $myrow['decimalplaces'], - locale_number_format($myrow['rate'],5), - locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), + locale_number_format($myrow['decimalplaces'],0), + locale_number_format($myrow['rate'],6), + locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),6), htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['currabrev'], _('Edit'), @@ -280,14 +283,14 @@ <td>%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td colspan=4>%s</td> + <td colspan="4">%s</td> </tr>', $ImageFile, $myrow['currabrev'], $myrow['currency'], $myrow['country'], $myrow['hundredsname'], - $myrow['decimalplaces'], + locale_number_format($myrow['decimalplaces'],0), 1, _('Functional Currency')); } @@ -312,11 +315,11 @@ //editing an existing payment terms $sql = "SELECT currency, - currabrev, - country, - hundredsname, - decimalplaces, - rate + currabrev, + country, + hundredsname, + decimalplaces, + rate FROM currencies WHERE currabrev='" . $SelectedCurrency . "'"; @@ -329,71 +332,76 @@ $_POST['CurrencyName'] = $myrow['currency']; $_POST['Country'] = $myrow['country']; $_POST['HundredsName'] = $myrow['hundredsname']; - $_POST['ExchangeRate'] = $myrow['rate']; - $_POST['DecimalPlaces'] = $myrow['decimalplaces']; + $_POST['ExchangeRate'] = locale_number_format($myrow['rate'],6); + $_POST['DecimalPlaces'] = locale_number_format($myrow['decimalplaces'],0); - echo '<input type="hidden" name="SelectedCurrency" value="' . $SelectedCurrency . '">'; - echo '<input type="hidden" name="Abbreviation" value="' . $_POST['Abbreviation'] . '">'; + echo '<input type="hidden" name="SelectedCurrency" value="' . $SelectedCurrency . '" />'; + echo '<input type="hidden" name="Abbreviation" value="' . $_POST['Abbreviation'] . '" />'; echo '<table class="selection"> <tr> - <td>' . _('ISO 4217 Currency Code').':</td> - <td>' . $_POST['Abbreviation'] . '</td> + <td>' . _('ISO 4217 Currency Code').':</td> + <td>' . $_POST['Abbreviation'] . '</td> </tr>'; } else { //end of if $SelectedCurrency only do the else when a new record is being entered if (!isset($_POST['Abbreviation'])) {$_POST['Abbreviation']='';} echo '<table class="selection"> <tr> - <td>' ._('Currency Abbreviation') . ':</td> - <td><input ' . (in_array('Abbreviation',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Abbreviation" value="' . $_POST['Abbreviation'] . '" size=4 maxlength=3></td></tr>'; + <td>' ._('Currency Abbreviation') . ':</td> + <td><input ' . (in_array('Abbreviation',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Abbreviation" value="' . $_POST['Abbreviation'] . '" size="4" maxlength="3" /></td> + </tr>'; } - echo '<tr><td>'._('Currency Name').':</td>'; - echo '<td>'; + echo '<tr> + <td>'._('Currency Name').':</td> + <td>'; if (!isset($_POST['CurrencyName'])) { $_POST['CurrencyName']=''; } - echo '<input ' . (in_array('CurrencyName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="CurrencyName" size=20 maxlength=20 value="' . $_POST['CurrencyName'] . '">'; - echo '</td></tr>'; - echo '<tr><td>'._('Country').':</td>'; - echo '<td>'; + echo '<input ' . (in_array('CurrencyName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="CurrencyName" size="20" maxlength="20" value="' . $_POST['CurrencyName'] . '" /></td> + </tr> + <tr> + <td>'._('Country').':</td> + <td>'; if (!isset($_POST['Country'])) { $_POST['Country']=''; } - echo '<input ' . (in_array('Country',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Country" size=30 maxlength=50 value="' . $_POST['Country'] . '">'; - echo '</td></tr>'; - - echo '<tr><td>'._('Hundredths Name').':</td>'; - echo '<td>'; + echo '<input ' . (in_array('Country',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Country" size="30" maxlength="50" value="' . $_POST['Country'] . '" /></td> + </tr> + <tr> + <td>'._('Hundredths Name').':</td> + <td>'; if (!isset($_POST['HundredsName'])) { $_POST['HundredsName']=''; } - echo '<input ' . (in_array('HundredsName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="HundredsName" size=10 maxlength=15 value="'. $_POST['HundredsName'].'">'; - echo '</td></tr>'; - - echo '<tr><td>'._('Decimal Places to Display').':</td>'; - echo '<td>'; + echo '<input ' . (in_array('HundredsName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="HundredsName" size="10" maxlength="15" value="'. $_POST['HundredsName'].'" /></td> + </tr> + <tr> + <td>'._('Decimal Places to Display').':</td> + <td>'; if (!isset($_POST['DecimalPlaces'])) { $_POST['DecimalPlaces']=''; } - echo '<input ' . (in_array('DecimalPlaces',$Errors) ? 'class="inputerror"' : 'class="number"' ) .' type="text" name="DecimalPlaces" size="2" maxlength="2" value="'. $_POST['DecimalPlaces'].'">'; - echo '</td></tr>'; - - echo '<tr><td>'._('Exchange Rate').':</td>'; - echo '<td>'; + echo '<input ' . (in_array('DecimalPlaces',$Errors) ? 'class="inputerror"' : 'class="number"' ) .' type="text" name="DecimalPlaces" size="2" maxlength="2" value="'. $_POST['DecimalPlaces'].'" /></td> + </tr> + <tr> + <td>'._('Exchange Rate').':</td> + <td>'; if (!isset($_POST['ExchangeRate'])) { $_POST['ExchangeRate']=''; } - echo '<input ' . (in_array('ExchangeRate',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class=number name="ExchangeRate" size=10 maxlength=9 value='. $_POST['ExchangeRate'].'>'; - echo '</td></tr>'; - echo '</table>'; + echo '<input ' . (in_array('ExchangeRate',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="ExchangeRate" size="10" maxlength="9" value="'. $_POST['ExchangeRate'].'"></td> + </tr> + </table>'; - echo '<br /><div class="centre"><input type="Submit" name="submit" value='._('Enter Information').'></div>'; + echo '<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/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/CustLoginSetup.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -134,22 +134,27 @@ $_POST['Email']=''; } -echo '<tr><td>' . _('Password') . ':</td> - <td><input type="password" name="Password" size=22 maxlength=20 value="' . $_POST['Password'] . '"></tr>'; -echo '<tr><td>' . _('Full Name') . ':</td> - <td><input type="text" name="RealName" value="' . $_POST['RealName'] . '" size=36 maxlength=35></td></tr>'; -echo '<tr><td>' . _('Telephone No') . ':</td> - <td><input type="text" name="Phone" value="' . $_POST['Phone'] . '" size=32 maxlength=30></td></tr>'; -echo '<tr><td>' . _('Email Address') .':</td> - <td><input type="text" name="Email" value="' . $_POST['Email'] .'" size=32 maxlength=55></td></tr>'; -echo '<input type="hidden" name="Access" value="1">'; +echo '<tr> + <td>' . _('Password') . ':</td> + <td><input type="password" name="Password" size="22" maxlength="20" value="' . $_POST['Password'] . '" /> + </tr> + <tr> + <td>' . _('Full Name') . ':</td> + <td><input type="text" name="RealName" value="' . $_POST['RealName'] . '" size="36" maxlength="35" /></td> + </tr> + <tr> + <td>' . _('Telephone No') . ':</td> + <td><input type="text" name="Phone" value="' . $_POST['Phone'] . '" size="32" maxlength="30" /></td> + </tr> + <tr> + <td>' . _('Email Address') .':</td> + <td><input type="text" name="Email" value="' . $_POST['Email'] .'" size="32" maxlength="55" /></td> + </tr> + <input type="hidden" name="Access" value="1" /> + <tr> + <td>' . _('Branch Code') . ':</td> + <td><select name="BranchCode">'; - -//Customer is fixed by selection of customer - -echo '<tr><td>' . _('Branch Code') . ':</td> - <td><select name="BranchCode">'; - $sql = "SELECT branchcode FROM custbranch WHERE debtorno = '" . $_SESSION['CustomerID'] . "'"; $result = DB_query($sql,$db); @@ -163,7 +168,7 @@ if (isset($_POST['BranchCode']) and $myrow['branchcode'] == $_POST['BranchCode']){ echo '<option selected value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; } else { - echo '<option Value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; + echo '<option value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; } } @@ -211,15 +216,14 @@ echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } -echo '</select></td></tr>'; +echo '</select></td> + </tr> + <tr> + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; -echo '<tr> - <td>' . _('Theme') . ':</td> - <td><select name="Theme">'; - $ThemeDirectory = dir('css/'); - while (false != ($ThemeName = $ThemeDirectory->read())){ if (is_dir('css/' . $ThemeName) AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ @@ -234,13 +238,12 @@ } } -echo '</select></td></tr>'; +echo '</select></td> + </tr> + <tr> + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; - -echo '<tr> - <td>' . _('Language') . ':</td> - <td><select name="UserLanguage">'; - foreach ($LanguagesArray as $LanguageEntry => $LanguageName){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; @@ -250,11 +253,13 @@ echo '<option value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; } } -echo '</select></td></tr>'; - - -echo '</table><br /> - <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div> +echo '</select></t... [truncated message content] |
From: <dai...@us...> - 2011-10-30 05:51:00
|
Revision: 4737 http://web-erp.svn.sourceforge.net/web-erp/?rev=4737&view=rev Author: daintree Date: 2011-10-30 05:50:51 +0000 (Sun, 30 Oct 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/BOMs.php trunk/ContractBOM.php trunk/ContractOtherReqts.php trunk/Contracts.php trunk/CreditStatus.php trunk/Currencies.php trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerAllocations.php trunk/CustomerBranches.php trunk/CustomerInquiry.php trunk/SalesPeople.php trunk/Stocks.php trunk/doc/Change.log trunk/includes/DefineCustAllocsClass.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/BOMs.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -9,7 +9,7 @@ include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); -function display_children($parent, $level, &$BOMTree) { +function display_children($Parent, $Level, &$BOMTree) { global $db; global $i; @@ -17,25 +17,25 @@ // retrive all children of parent $c_result = DB_query("SELECT parent, component - FROM bom WHERE parent='" . $parent. "'" + FROM bom WHERE parent='" . $Parent. "'" ,$db); if (DB_num_rows($c_result) > 0) { while ($row = DB_fetch_array($c_result)) { - //echo '<br />Parent: ' . $parent . ' Level: ' . $level . ' row[component]: ' . $row['component'] .'<br />'; - if ($parent != $row['component']) { + //echo '<br />Parent: ' . $Parent . ' Level: ' . $Level . ' row[component]: ' . $row['component'] .'<br />'; + if ($Parent != $row['component']) { // indent and display the title of this child - $BOMTree[$i]['Level'] = $level; // Level - if ($level > 15) { + $BOMTree[$i]['Level'] = $Level; // Level + if ($Level > 15) { prnMsg(_('A maximum of 15 levels of bill of materials only can be displayed'),'error'); exit; } - $BOMTree[$i]['Parent'] = $parent; // Assemble + $BOMTree[$i]['Parent'] = $Parent; // Assemble $BOMTree[$i]['Component'] = $row['component']; // Component // call this function again to display this // child's children $i++; - display_children($row['component'], $level + 1, $BOMTree); + display_children($row['component'], $Level + 1, $BOMTree); } } } @@ -53,11 +53,11 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); if (DB_num_rows($result)!=0) { - while ($myrow=DB_fetch_row($result)){ - if ($myrow[0]==$UltimateParent){ + while ($myrow=DB_fetch_array($result)){ + if ($myrow['component']==$UltimateParent){ return 1; } - if (CheckForRecursiveBOM($UltimateParent, $myrow[0],$db)){ + if (CheckForRecursiveBOM($UltimateParent, $myrow['component'],$db)){ return 1; } } //(while loop) @@ -70,11 +70,10 @@ function DisplayBOMItems($UltimateParent, $Parent, $Component,$Level, $db) { global $ParentMBflag; - // Modified by POPAD&T $sql = "SELECT bom.component, - stockmaster.description, + stockmaster.description as itemdescription, locations.locationname, - workcentres.description, + workcentres.description as workcentrename, bom.quantity, bom.effectiveafter, bom.effectiveto, @@ -83,19 +82,17 @@ stockmaster.controlled, locstock.quantity AS qoh, stockmaster.decimalplaces - FROM bom, - stockmaster, - locations, - workcentres, - locstock - WHERE bom.component='".$Component."' - AND bom.parent = '".$Parent."' - AND bom.component=stockmaster.stockid - AND bom.loccode = locations.loccode - AND locstock.loccode=bom.loccode - AND bom.component = locstock.stockid - AND bom.workcentreadded=workcentres.code - AND stockmaster.stockid=bom.component"; + FROM bom INNER JOIN stockmaster + ON bom.component=stockmaster.stockid + INNER JOIN locations ON + bom.loccode = locations.loccode + INNER JOIN workcentres + ON bom.workcentreadded=workcentres.code + INNER JOIN locstock + ON bom.loccode=locstock.loccode + AND bom.component = locstock.stockid + WHERE bom.component='".$Component."' + AND bom.parent = '".$Parent."'"; $ErrMsg = _('Could not retrieve the BOM components because'); $DbgMsg = _('The SQL used to retrieve the components was'); @@ -104,33 +101,41 @@ //echo $TableHeader; $RowCounter =0; - while ($myrow=DB_fetch_row($result)) { + while ($myrow=DB_fetch_array($result)) { $Level1 = str_repeat('- ',$Level-1).$Level; - if( $myrow[7]=='B' OR $myrow[7]=='K' OR $myrow[7]=='D') { + if( $myrow['mbflag']=='B' + OR $myrow['mbflag']=='K' + OR $myrow['mbflag']=='D') { + $DrillText = '%s%s'; $DrillLink = '<div class="centre">'._('No lower levels').'</div>'; $DrillID=''; } else { $DrillText = '<a href="%s&Select=%s">' . _('Drill Down'); $DrillLink = htmlspecialchars($_SERVER['PHP_SELF']) . '?'; - $DrillID=$myrow[0]; + $DrillID=$myrow['component']; } if ($ParentMBflag!='M' AND $ParentMBflag!='G'){ $AutoIssue = _('N/A'); - } elseif ($myrow[9]==0 AND $myrow[8]==1){//autoissue and not controlled + } elseif ($myrow['controlled']==0 AND $myrow['autoissue']==1){//autoissue and not controlled $AutoIssue = _('Yes'); - } elseif ($myrow[9]==0) { + } elseif ($myrow['controlled']==1) { $AutoIssue = _('No'); } else { $AutoIssue = _('N/A'); } - if ($myrow[7]=='D' OR $myrow[7]=='K' OR $myrow[7]=='A' OR $myrow[7]=='G'){ + if ($myrow['mbflag']=='D' //dummy orservice + OR $myrow['mbflag']=='K' //kit-set + OR $myrow['mbflag']=='A' // assembly + OR $myrow['mbflag']=='G') /* ghost */ { + $QuantityOnHand = _('N/A'); } else { - $QuantityOnHand = locale_number_format($myrow[10],$myrow[11]); - } + $QuantityOnHand = locale_number_format($myrow['qoh'],$myrow['decimalplaces']); + } + printf('<td>%s</td> <td>%s</td> <td>%s</td> @@ -146,23 +151,23 @@ <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this component from the bill of material?') . '\');">' . _('Delete') . '</a></td> </tr>', $Level1, - $myrow[0], - $myrow[1], - $myrow[2], - $myrow[3], - locale_number_format($myrow[4],'Variable'), - ConvertSQLDate($myrow[5]), - ConvertSQLDate($myrow[6]), + $myrow['component'], + $myrow['itemdescription'], + $myrow['locationname'], + $myrow['workcentrename'], + locale_number_format($myrow['quantity'],'Variable'), + ConvertSQLDate($myrow['effectiveafter']), + ConvertSQLDate($myrow['effectiveto']), $AutoIssue, $QuantityOnHand, htmlspecialchars($_SERVER['PHP_SELF']) . '?', $Parent, - $myrow[0], + $myrow['component'], $DrillLink, $DrillID, htmlspecialchars($_SERVER['PHP_SELF']) . '?', $Parent, - $myrow[0], + $myrow['component'], $UltimateParent); } //END WHILE LIST LOOP @@ -246,7 +251,7 @@ $Errors[$i] = 'EffectiveTo'; $i++; } - if($_POST['AutoIssue']==1 and isset($_POST['Component'])){ + if($_POST['AutoIssue']==1 AND isset($_POST['Component'])){ $sql = "SELECT controlled FROM stockmaster WHERE stockid='" . $_POST['Component'] . "'"; $CheckControlledResult = DB_query($sql,$db); $CheckControlledRow = DB_fetch_row($CheckControlledResult); Modified: trunk/ContractBOM.php =================================================================== --- trunk/ContractBOM.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/ContractBOM.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -14,7 +14,7 @@ */ if (!isset($_SESSION['Contract'.$identifier])){ - header('Location:' . $rootpath . '/Contracts.php?' . SID); + header('Location:' . $rootpath . '/Contracts.php'); exit; } include('includes/header.inc'); @@ -22,11 +22,11 @@ if (isset($_POST['UpdateLines']) OR isset($_POST['BackToHeader'])) { if($_SESSION['Contract'.$identifier]->Status!=2){ //dont do anything if the customer has committed to the contract foreach ($_SESSION['Contract'.$identifier]->ContractBOM as $ContractComponent) { - if ($_POST['Qty'.$ContractComponent->ComponentID]==0){ + if (filter_number_format($_POST['Qty'.$ContractComponent->ComponentID])==0){ //this is the same as deleting the line - so delete it $_SESSION['Contract'.$identifier]->Remove_ContractComponent($ContractComponent->ComponentID); } else { - $_SESSION['Contract'.$identifier]->ContractBOM[$ContractComponent->ComponentID]->Quantity=$_POST['Qty'.$ContractComponent->ComponentID]; + $_SESSION['Contract'.$identifier]->ContractBOM[$ContractComponent->ComponentID]->Quantity=filter_number_format($_POST['Qty'.$ContractComponent->ComponentID]); } } // end loop around the items on the contract BOM } // end if the contract is not currently committed to by the customer @@ -53,29 +53,29 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.description " . LIKE . " '$SearchString' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + and stockmaster.discontinued!=1 + AND stockmaster.description " . LIKE . " '$SearchString' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } elseif ($_POST['StockCode']){ @@ -84,55 +84,55 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + ORDER BY stockmaster.stockid"; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag!='D' - AND stockmaster.mbflag!='A' - AND stockmaster.mbflag!='K' - and stockmaster.discontinued!=1 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + WHERE stockmaster.mbflag!='D' + AND stockmaster.mbflag!='A' + AND stockmaster.mbflag!='K' + AND stockmaster.discontinued!=1 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -160,52 +160,48 @@ } } - - if (isset($_POST['NewItem'])){ /* NewItem is set from the part selection list as the part code selected */ -/* take the form entries and enter the data from the form into the PurchOrder class variable */ - foreach ($_POST as $ItemCode => $Quantity) { - if (mb_substr($ItemCode, 0, 3)=='Qty') { - $ItemCode=mb_substr($ItemCode, 3, mb_strlen($ItemCode)-3); - $AlreadyOnThisBOM = 0; - + for ($i=0;$i < $_POST['CountOfItems'];$i++) { + $AlreadyOnThisBOM = 0; + if (filter_number_format($_POST['Qty'.$i])>0){ if (count($_SESSION['Contract'.$identifier]->ContractBOM)!=0){ - + foreach ($_SESSION['Contract'.$identifier]->ContractBOM AS $Component) { - + /* do a loop round the items on the order to see that the item is not already on this order */ - if ($Component->StockID == $ItemCode) { + if ($Component->StockID == trim($_POST['StockID'.$i])) { $AlreadyOnThisBOM = 1; - prnMsg( _('The item') . ' ' . $ItemCode . ' ' . _('is already in the bill of material for this contract. The system will not allow the same item on the contract more than once. However you can change the quantity required for the item.'),'error'); + prnMsg( _('The item') . ' ' . trim($_POST['StockID'.$i]) . ' ' . _('is already in the bill of material for this contract. The system will not allow the same item on the contract more than once. However you can change the quantity required for the item.'),'error'); } } /* end of the foreach loop to look for preexisting items of the same code */ } - - if ($AlreadyOnThisBOM!=1 and $Quantity>0){ - + + if ($AlreadyOnThisBOM!=1){ + $sql = "SELECT stockmaster.description, stockmaster.stockid, stockmaster.units, stockmaster.decimalplaces, stockmaster.materialcost+labourcost+overheadcost AS unitcost FROM stockmaster - WHERE stockmaster.stockid = '". $ItemCode . "'"; - + WHERE stockmaster.stockid = '". trim($_POST['StockID'.$i]) . "'"; + $ErrMsg = _('The item details could not be retrieved'); $DbgMsg = _('The SQL used to retrieve the item details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); - + if ($myrow = DB_fetch_array($result1)){ - - $_SESSION['Contract'.$identifier]->Add_To_ContractBOM ($ItemCode, + + $_SESSION['Contract'.$identifier]->Add_To_ContractBOM (trim($_POST['StockID'.$i]), $myrow['description'], - $DefaultWorkCentre, - $Quantity, /* Qty */ + '', + filter_number_format($_POST['Qty'.$i]), /* Qty */ $myrow['unitcost'], - $myrow['units']); + $myrow['units'], + $myrow['decimalplaces']); } else { - prnMsg (_('The item code') . ' ' . $ItemCode . ' ' . _('does not exist in the database and therefore cannot be added to the contract BOM'),'error'); + prnMsg (_('The item code') . ' ' . trim($_POST['StockID'.$i]) . ' ' . _('does not exist in the database and therefore cannot be added to the contract BOM'),'error'); if ($debug==1){ echo '<br />' . $sql; } @@ -213,7 +209,7 @@ exit; } } /* end of if not already on the contract BOM */ - } + } /* the quantity of the item is > 0 */ } } /* end of if its a new item */ @@ -223,21 +219,25 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (count($_SESSION['Contract'.$identifier]->ContractBOM)>0){ - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract Bill of Material') . '" alt="" /> '.$_SESSION['Contract'.$identifier]->CustomerName . '</p>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('Contract Bill of Material') . '" alt="" /> '.$_SESSION['Contract'.$identifier]->CustomerName . ' + </p>'; - echo '<table cellpadding="2" class="selection">'; + echo '<table class="selection">'; if (isset($_SESSION['Contract'.$identifier]->ContractRef)) { - echo '<tr><th colspan="7"><font color="navy" size="2">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</font></th></tr>'; + echo '<tr> + <th colspan="7"><font color="navy" size="2">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</font></th> + </tr>'; } echo '<tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('UOM') .'</th> - <th>' . _('Unit Cost') . '</th> - <th>' . _('Sub-total') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('UOM') .'</th> + <th>' . _('Unit Cost') . '</th> + <th>' . _('Sub-total') . '</th> </tr>'; $_SESSION['Contract'.$identifier]->total = 0; @@ -247,7 +247,7 @@ $LineTotal = $ContractComponent->Quantity * $ContractComponent->ItemCost; - $DisplayLineTotal = locale_number_format($LineTotal,2); + $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CompanyRecord']['decimalplaces']); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -259,17 +259,17 @@ echo '<td>' . $ContractComponent->StockID . '</td> <td>' . $ContractComponent->ItemDescription . '</td> - <td><input type="text" class="number" name="Qty' . $ContractComponent->ComponentID . '" size="11" value="' . $ContractComponent->Quantity . '" /></td> + <td><input type="text" class="number" name="Qty' . $ContractComponent->ComponentID . '" size="11" value="' . locale_number_format($ContractComponent->Quantity,$ContractComponent->DecimalPlaces) . '" /></td> <td>' . $ContractComponent->UOM . '</td> - <td class="number">' . $ContractComponent->ItemCost . '</td> + <td class="number">' . locale_number_format($ContractComponent->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . $DisplayLineTotal . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '">' . _('Delete') . '</a></td></tr>'; + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?identifier='.$identifier. '&Delete=' . $ContractComponent->ComponentID . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this item from the contract BOM?') . '\');">' . _('Delete') . '</a></td></tr>'; $TotalCost += $LineTotal; } - $DisplayTotal = locale_number_format($TotalCost,2); + $DisplayTotal = locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']); echo '<tr> - <td colspan="6" class="number">' . _('Total Cost') . '</td> + <td colspan="5" class="number">' . _('Total Cost') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> </tr> </table>'; @@ -281,11 +281,11 @@ if (!isset($_GET['Edit'])) { $sql="SELECT categoryid, - categorydescription - FROM stockcategory - WHERE stocktype<>'L' - AND stocktype<>'D' - ORDER BY categorydescription"; + categorydescription + FROM stockcategory + WHERE stocktype<>'L' + AND stocktype<>'D' + ORDER BY categorydescription"; $ErrMsg = _('The supplier category details could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -316,21 +316,25 @@ } echo '</select></td> - <td><font size="2">' . _('Enter text extracts in the description') . ':</font></td> - <td><input type="text" name="Keywords" size="20" maxlength="25" value="' . $_POST['Keywords'] . '" /></td></tr> - <tr><td></td> - <td><font size="3"> <b>' . _('OR') . ' </b></font><font size="2">' . _('Enter extract of the Stock Code') . - ':</font></td> - <td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '" /></td> + <td><font size="2">' . _('Enter text extracts in the description') . ':</font></td> + <td><input type="text" name="Keywords" size="20" maxlength="25" value="' . $_POST['Keywords'] . '" /></td> </tr> - <tr><td></td> - <td><font size="3"><b>' . _('OR') . ' </b></font><font size="2"><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></font></td></tr> - </table><br /> - <div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '" /> - </div><br />'; + <tr> + <td></td> + <td><font size="3"> <b>' . _('OR') . ' </b></font><font size="2">' . _('Enter extract of the Stock Code') . ':</font></td> + <td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '" /></td> + </tr> + <tr> + <td></td> + <td><font size="3"><b>' . _('OR') . ' </b></font><font size="2"><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></font></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Search" value="' . _('Search Now') . '" /> + </div> + <br />'; - - $PartsDisplayed =0; } if (isset($SearchResult)) { @@ -338,17 +342,16 @@ echo '<table cellpadding="1" colspan="7">'; $TableHeader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Units') . '</th> - <th>' . _('Image') . '</th> - <th>' . _('Quantity') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Units') . '</th> + <th>' . _('Image') . '</th> + <th>' . _('Quantity') . '</th> </tr>'; echo $TableHeader; - $j = 1; $k=0; //row colour counter - + $i=0; while ($myrow=DB_fetch_array($SearchResult)) { if ($k==1){ @@ -366,31 +369,34 @@ } echo '<td>'.$myrow['stockid'].'</td> - <td>'.$myrow['description'].'</td> - <td>'.$myrow['units'] . '</td> - <td>'.$ImageSource.'</td> - <td><input class="number" type="text" size="6" value="0" name="Qty'.$myrow['stockid'].'" /></td> + <td>'.$myrow['description'].'</td> + <td>'.$myrow['units'] . '</td> + <td>'.$ImageSource.'</td> + <td><input class="number" type="text" size="6" value="0" name="Qty'.$i.'" /> + <input type="hidden" name="StockID'.$i.'" value="' . $myrow['stockid'] . '" /> + </td> </tr>'; - - $PartsDisplayed++; - if ($PartsDisplayed == $_SESSION['DisplayRecordsMax']){ + $i++; + if ($i == $_SESSION['DisplayRecordsMax']){ break; } #end of page full new headings if } + #end of while loop - echo '</table>'; - if ($PartsDisplayed == $_SESSION['DisplayRecordsMax']){ + echo '</table> + <input type="hidden" name="CountOfItems" value="'. $i . '" />'; + if ($i == $_SESSION['DisplayRecordsMax']){ - - prnMsg( _('Only the first') . ' ' . $_SESSION['DisplayRecordsMax'] . ' ' . _('can be displayed') . '. ' . - _('Please restrict your search to only the parts required'),'info'); + prnMsg( _('Only the first') . ' ' . $_SESSION['DisplayRecordsMax'] . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } - echo '<br /><div class="centre"><input type="submit" name="NewItem" value="' . _('Add to Contract Bill Of Material') .'" /></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="NewItem" value="' . _('Add to Contract Bill Of Material') .'" /> + </div>'; }#end if SearchResults to show -echo '<hr />'; - -echo '</form>'; +echo '<hr /> + </form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/ContractOtherReqts.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -24,7 +24,7 @@ if($_SESSION['Contract'.$identifier]->Status!=2){ //dont do anything if the customer has committed to the contract foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $ContractComponentID => $ContractRequirementItem) { - if ($_POST['Qty'.$ContractComponentID]==0){ + if (filter_number_format($_POST['Qty'.$ContractComponentID])==0){ //this is the same as deleting the line - so delete it $_SESSION['Contract'.$identifier]->Remove_ContractRequirement($ContractComponentID); } else { @@ -81,10 +81,12 @@ if (count($_SESSION['Contract'.$identifier]->ContractReqts)>0){ - echo '<table cellpadding="2" colspan="7" class="selection">'; + echo '<table class="selection">'; if (isset($_SESSION['Contract'.$identifier]->ContractRef)) { - echo '<tr><th colspan="5">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</th></tr>'; + echo '<tr> + <th colspan="5">' . _('Contract Reference:') .' '. $_SESSION['Contract'.$identifier]->ContractRef.'</th> + </tr>'; } echo '<tr> Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/Contracts.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -276,7 +276,6 @@ $WorkCentre = $_SESSION['Contract'.$identifier]->LocCode; } /*The above is a bit of a hack to get a default workcentre for a location based on the users default location*/ - } $sql = "SELECT contractref, @@ -542,22 +541,22 @@ quotation) VALUES ( '". $OrderNo . "', - '" . DB_escape_string($_SESSION['Contract'.$identifier]->DebtorNo) . "', - '" . DB_escape_string($_SESSION['Contract'.$identifier]->BranchCode) . "', - '". DB_escape_string($_SESSION['Contract'.$identifier]->CustomerRef) ."', - '" . DB_escape_string(Date('Y-m-d H:i')) . "', - '" . DB_escape_string($CustomerDetailsRow['salestype']) . "', - '" . DB_escape_string($CustomerDetailsRow['defaultshipvia']) ."', - '". DB_escape_string($CustomerDetailsRow['brname']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress1']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress2']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress3']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress4']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress5']) . "', - '" . DB_escape_string($CustomerDetailsRow['braddress6']) . "', - '" . DB_escape_string($CustomerDetailsRow['phoneno']) . "', - '" . DB_escape_string($CustomerDetailsRow['email']) . "', - '" . DB_escape_string($_SESSION['Contract'.$identifier]->LocCode) ."', + '" . $_SESSION['Contract'.$identifier]->DebtorNo . "', + '" . $_SESSION['Contract'.$identifier]->BranchCode . "', + '". $_SESSION['Contract'.$identifier]->CustomerRef ."', + '" . Date('Y-m-d H:i') . "', + '" . $CustomerDetailsRow['salestype'] . "', + '" . $CustomerDetailsRow['defaultshipvia'] ."', + '". $CustomerDetailsRow['brname'] . "', + '" . $CustomerDetailsRow['braddress1'] . "', + '" . $CustomerDetailsRow['braddress2'] . "', + '" . $CustomerDetailsRow['braddress3'] . "', + '" . $CustomerDetailsRow['braddress4'] . "', + '" . $CustomerDetailsRow['braddress5'] . "', + '" . $CustomerDetailsRow['braddress6'] . "', + '" . $CustomerDetailsRow['phoneno'] . "', + '" . $CustomerDetailsRow['email'] . "', + '" . $_SESSION['Contract'.$identifier]->LocCode ."', '" . FormatDateForSQL($_SESSION['Contract'.$identifier]->RequiredDate) . "', '" . Date('Y-m-d') . "', '1' )"; @@ -573,10 +572,10 @@ itemdue) VALUES ('0', '" . $OrderNo . "', - '" . DB_escape_string($_SESSION['Contract'.$identifier]->ContractRef) . "', + '" . $_SESSION['Contract'.$identifier]->ContractRef . "', '" . ($ContractPrice * $_SESSION['Contract'.$identifier]->ExRate) . "', '1', - '" . DB_escape_string($_SESSION['Contract'.$identifier]->CustomerRef) . "', + '" . $_SESSION['Contract'.$identifier]->CustomerRef . "', '" . FormatDateForSQL($_SESSION['Contract'.$identifier]->RequiredDate) . "')"; $DbgMsg = _('The SQL that failed was'); $ErrMsg = _('Unable to add the quotation line'); @@ -586,7 +585,7 @@ //make the status of the contract 1 - to indicate that it is now quoted $sql = "UPDATE contracts SET orderno='" . $OrderNo . "', status='" . 1 . "' - WHERE contractref='" . DB_escape_string($_SESSION['Contract'.$identifier]->ContractRef) . "'"; + WHERE contractref='" . $_SESSION['Contract'.$identifier]->ContractRef . "'"; $ErrMsg = _('Unable to update the contract status and order number because'); $UpdContractResult = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); $Result = DB_Txn_Commit($db); @@ -597,7 +596,6 @@ } //end of if making a quotation - if (isset($_POST['SearchCustomers'])){ if (($_POST['CustKeywords']!='') AND (($_POST['CustCode']!='') OR ($_POST['CustPhone']!=''))) { @@ -624,7 +622,7 @@ FROM custbranch LEFT JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.brname " . LIKE . " '$SearchString' + WHERE custbranch.brname " . LIKE . " '" . $SearchString . "' AND custbranch.disabletrans=0 ORDER BY custbranch.debtorno, custbranch.branchcode"; @@ -832,8 +830,10 @@ /*Set up form for entry of contract header stuff */ - echo '<table class="selection">'; - echo '<tr><td>' . _('Contract Reference') . ':</td><td>'; + echo '<table class="selection"> + <tr> + <td>' . _('Contract Reference') . ':</td> + <td>'; if ($_SESSION['Contract'.$identifier]->Status==0) { /*Then the contract has not become an order yet and we can allow changes to the ContractRef */ echo '<input type="text" name="ContractRef" size="21" maxlength="20" value="' . $_SESSION['Contract'.$identifier]->ContractRef . '" />'; @@ -875,27 +875,36 @@ } } - echo '</select></td></tr>'; + echo '</select></td> + </tr> + <tr> + <td>' . _('Contract Description') . ':</td> + <td><textarea name="ContractDescription" style="width:100%" rows="5">' . $_SESSION['Contract'.$identifier]->ContractDescription . '</textarea></td> + </tr><tr> + <td>'. _('Drawing File') . ' .jpg' . ' ' . _('format only') .':</td> + <td><input type="file" id="Drawing" name="Drawing" /></td> + </tr>'; - echo '<tr><td>' . _('Contract Description'); - echo ':</td><td><textarea name="ContractDescription" style="width:100%" rows="5">' . $_SESSION['Contract'.$identifier]->ContractDescription . '</textarea></td></tr>'; - - echo '<tr><td>'. _('Drawing File') . ' .jpg' . ' ' . _('format only') .':</td><td><input type="file" id="Drawing" name="Drawing" /></td></tr>'; - if (!isset($_SESSION['Contract'.$identifier]->RequiredDate)) { $_SESSION['Contract'.$identifier]->RequiredDate = DateAdd(date($_SESSION['DefaultDateFormat']),'m',1); } - echo '<tr><td>' . _('Required Date') . ':</td> - <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredDate" size="11" value="' . $_SESSION['Contract'.$identifier]->RequiredDate . '" /></td></tr>'; + echo '<tr> + <td>' . _('Required Date') . ':</td> + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" name="RequiredDate" size="11" value="' . $_SESSION['Contract'.$identifier]->RequiredDate . '" /></td> + </tr>'; - echo '<tr><td>' . _('Customer Reference') . ':</td> - <td><input type="text" name="CustomerRef" size="21" maxlength="20" value="' . $_SESSION['Contract'.$identifier]->CustomerRef . '" /></td></tr>'; + echo '<tr> + <td>' . _('Customer Reference') . ':</td> + <td><input type="text" name="CustomerRef" size="21" maxlength="20" value="' . $_SESSION['Contract'.$identifier]->CustomerRef . '" /></td> + </tr>'; if (!isset($_SESSION['Contract'.$identifier]->Margin)){ $_SESSION['Contract'.$identifier]->Margin =50; } - echo '<tr><td>' . _('Gross Profit') . ' %:</td> - <td><input type="text" name="Margin" size="4" maxlength="4" value="' . locale_number_format($_SESSION['Contract'.$identifier]->Margin,2) . '" /></td></tr>'; + echo '<tr> + <td>' . _('Gross Profit') . ' %:</td> + <td><input type="text" name="Margin" size="4" maxlength="4" value="' . locale_number_format($_SESSION['Contract'.$identifier]->Margin,2) . '" /></td> + </tr>'; if ($_SESSION['CompanyRecord']['currencydefault'] != $_SESSION['Contract'.$identifier]->CurrCode){ echo '<tr> @@ -906,7 +915,9 @@ echo '<input type="hidden" name="ExRate" value="' . locale_number_format($_SESSION['Contract'.$identifier]->ExRate,'Variable') . '" />'; } - echo '<tr><td>' . _('Contract Status') . ':</td><td>'; + echo '<tr> + <td>' . _('Contract Status') . ':</td> + <td>'; $StatusText = array(); $StatusText[0] = _('Setup'); @@ -920,19 +931,29 @@ echo _('Order Placed'); } echo '<input type="hidden" name="Status" value="'.$_SESSION['Contract'.$identifier]->Status.'" />'; - echo '</td></tr>'; + echo '</td> + </tr>'; if ($_SESSION['Contract'.$identifier]->Status >=1) { - echo '<tr><td>' . _('Quotation Reference/Sales Order No') . ':</td> - <td><a href="' . $rootpath . '/SelectSalesOrder.php?OrderNumber=' . $_SESSION['Contract'.$identifier]->OrderNo . '&Quotations=Quotes_Only">' . $_SESSION['Contract'.$identifier]->OrderNo . '</a></td></tr>'; + echo '<tr> + <td>' . _('Quotation Reference/Sales Order No') . ':</td> + <td><a href="' . $rootpath . '/SelectSalesOrder.php?OrderNumber=' . $_SESSION['Contract'.$identifier]->OrderNo . '&Quotations=Quotes_Only">' . $_SESSION['Contract'.$identifier]->OrderNo . '</a></td> + </tr>'; } if ($_SESSION['Contract'.$identifier]->Status!=2 and isset($_SESSION['Contract'.$identifier]->WO)) { - echo '<tr><td>' . _('Contract Work Order Ref') . ':</td> - <td>' . $_SESSION['Contract'.$identifier]->WO . '</td></tr>'; + echo '<tr> + <td>' . _('Contract Work Order Ref') . ':</td> + <td>' . $_SESSION['Contract'.$identifier]->WO . '</td> + </tr>'; } echo '</table><br />'; - echo '<table><tr><td> - <table class="selection"><tr><th colspan="6">' . _('Stock Items Required') . '</th></tr>'; + echo '<table> + <tr> + <td> + <table class="selection"> + <tr> + <th colspan="6">' . _('Stock Items Required') . '</th> + </tr>'; $ContractBOMCost = 0; if (count($_SESSION['Contract'.$identifier]->ContractBOM)!=0){ echo '<tr><th>' . _('Item Code') . '</th> @@ -944,29 +965,30 @@ </tr>'; foreach ($_SESSION['Contract'.$identifier]->ContractBOM as $Component) { - echo '<tr><td>' . $Component->StockID . '</td> + echo '<tr> + <td>' . $Component->StockID . '</td> <td>' . $Component->ItemDescription . '</td> - <td class="number">' . $Component->Quantity . '</td> + <td class="number">' . locale_number_format($Component->Quantity,$Component->DecimalPlaces) . '</td> <td>' . $Component->UOM . '</td> - <td class="number">' . locale_number_format($Component->ItemCost,2) . '</td> - <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),2) . '</td> + <td class="number">' . locale_number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $ContractBOMCost += ($Component->ItemCost * $Component->Quantity); } echo '<tr> <th colspan="5"><b>' . _('Total stock cost') . '</b></th> - <th class="number"><b>' . locale_number_format($ContractBOMCost,2) . '</b></th> + <th class="number"><b>' . locale_number_format($ContractBOMCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th> </tr>'; } else { //there are no items set up against this contract echo '<tr> <td colspan="6"><i>' . _('None Entered') . '</i></td> - </tr>'; + </tr>'; } echo '</table></td>'; //end of contract BOM table echo '<td valign="top"> <table class="selection"> <tr> - <th colspan="4">' . _('Other Requirements') . '</th> + <th colspan="4">' . _('Other Requirements') . '</th> </tr>'; $ContractReqtsCost = 0; if (count($_SESSION['Contract'.$identifier]->ContractReqts)!=0){ @@ -979,28 +1001,35 @@ foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $Requirement) { echo '<tr> <td>' . $Requirement->Requirement . '</td> - <td class="number">' . $Requirement->Quantity . '</td> - <td class="number">' . $Requirement->CostPerUnit . '</td> - <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td> + <td class="number">' . locale_number_format($Requirement->Quantity,'Variable') . '</td> + <td class="number">' . locale_number_format($Requirement->CostPerUnit,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format(($Requirement->CostPerUnit * $Requirement->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td> </tr>'; $ContractReqtsCost += ($Requirement->CostPerUnit * $Requirement->Quantity); } - echo '<tr><th colspan="3"><b>' . _('Total other costs') . '</b></th><th class="number"><b>' . locale_number_format($ContractReqtsCost,2) . '</b></th></tr>'; + echo '<tr> + <th colspan="3"><b>' . _('Total other costs') . '</b></th> + <th class="number"><b>' . locale_number_format($ContractReqtsCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></th> + </tr>'; } else { //there are no items set up against this contract - echo '<tr><td colspan="4"><i>' . _('None Entered') . '</i></td></tr>'; + echo '<tr> + <td colspan="4"><i>' . _('None Entered') . '</i></td> + </tr>'; } echo '</table></td></tr></table>'; echo '<br />'; echo'<table class="selection"> - <tr><th>' . _('Total Contract Cost') . '</th> - <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th>' . _('Contract Price') . '</th> - <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <tr> + <th>' . _('Total Contract Cost') . '</th> + <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th>' . _('Contract Price') . '</th> + <th class="number">' . locale_number_format(($ContractBOMCost+$ContractReqtsCost)/((100-$_SESSION['Contract'.$identifier]->Margin)/100),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr> - </table>'; + </table>'; echo'<p></p>'; - echo '<div class="centre"><input type="submit" name="EnterContractBOM" value="' . _('Enter Items Required') . '" /> + echo '<div class="centre"> + <input type="submit" name="EnterContractBOM" value="' . _('Enter Items Required') . '" /> <input type="submit" name="EnterContractRequirements" value="' . _('Enter Other Requirements') .'" />'; if($_SESSION['Contract'.$identifier]->Status==0){ // not yet quoted echo '<input type="submit" name="CommitContract" value="' . _('Commit Changes') .'" />'; @@ -1008,12 +1037,17 @@ echo '<input type="submit" name="CommitContract" value="' . _('Update Quotation') .'" />'; } if($_SESSION['Contract'.$identifier]->Status==0){ //not yet quoted - echo ' <input type="submit" name="CreateQuotation" value="' . _('Create Quotation') .'" /></div>'; + echo ' <input type="submit" name="CreateQuotation" value="' . _('Create Quotation') .'" /> + </div>'; } else { echo '</div>'; } if ($_SESSION['Contract'.$identifier]->Status!=2) { - echo '<p><div class="centre"><input type="submit" name="CancelContract" value="' . _('Cancel and Delete Contract') . '" /></div></p>'; + echo '<p> + <div class="centre"> + <input type="submit" name="CancelContract" value="' . _('Cancel and Delete Contract') . '" /> + </div> + </p>'; } echo '</form>'; } /*end of if customer selected and entering contract header*/ Modified: trunk/CreditStatus.php =================================================================== --- trunk/CreditStatus.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/CreditStatus.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -17,7 +17,9 @@ } $Errors = array(); $InputError = 0; -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p> +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' + </p> <br />'; if (isset($_POST['submit'])) { @@ -141,14 +143,14 @@ links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ - $sql = 'SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons'; + $sql = "SELECT reasoncode, reasondescription, dissallowinvoices FROM holdreasons"; $result = DB_query($sql, $db); - echo '<table class=selection>'; - echo '<tr> - <th>'. _('Status Code') .'</th> - <th>'. _('Description') .'</th> - <th>'. _('Disallow Invoices') .'</th>'; + echo '<table class="selection"> + <tr> + <th>'. _('Status Code') .'</th> + <th>'. _('Description') .'</th> + <th>'. _('Disallow Invoices') .'</th>'; $k=0; //row colour counter while ($myrow=DB_fetch_array($result)) { @@ -186,7 +188,9 @@ } //end of ifs and buts! if (isset($SelectedReason)) { - echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show Defined Credit Status Codes') . '</a></div>'; + echo '<div class="centre"> + <a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">' . _('Show Defined Credit Status Codes') . '</a> + </div>'; } if (!isset($_GET['delete'])) { @@ -210,8 +214,8 @@ $_POST['ReasonDescription'] = $myrow['reasondescription']; $_POST['DisallowInvoices'] = $myrow['dissallowinvoices']; - echo '<input type="hidden" name="SelectedReason" value="' . $SelectedReason . '">'; - echo '<input type="hidden" name="ReasonCode" value="' . $_POST['ReasonCode'] . '">'; + echo '<input type="hidden" name="SelectedReason" value="' . $SelectedReason . '" />'; + echo '<input type="hidden" name="ReasonCode" value="' . $_POST['ReasonCode'] . '" />'; echo '<table class="selection"> <tr> <td>'. _('Status Code') .':</td> @@ -226,7 +230,7 @@ <table class="selection"> <tr> <td>'. _('Status Code') .':</td> - <td><input ' . (in_array('ReasonCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex=1 type="text" name="ReasonCode" value="'. $_POST['ReasonCode'] .'" size=3 maxlength=2></td> + <td><input ' . (in_array('ReasonCode',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="1" type="text" name="ReasonCode" value="'. $_POST['ReasonCode'] .'" size="3" maxlength="2" /></td> </tr>'; } @@ -241,13 +245,17 @@ <tr> <td>'. _('Disallow Invoices') . '</td>'; if (isset($_POST['DisallowInvoices']) and $_POST['DisallowInvoices']==1) { - echo '<td><input tabindex=3 type="checkbox" checked name="DisallowInvoices"></td></tr>'; + echo '<td><input tabindex="3" type="checkbox" checked name="DisallowInvoices" /></td> + </tr>'; } else { - echo '<td><input tabindex=3 type="checkbox" name="DisallowInvoices"></td></tr>'; + echo '<td><input tabindex=3 type="checkbox" name="DisallowInvoices" /></td> + </tr>'; } echo '</table> <br /> - <div class="centre"><input tabindex=4 type="submit" name="submit" value="' . _('Enter Information') . '"></div> + <div class="centre"> + <input tabindex="4" type="submit" name="submit" value="' . _('Enter Information') . '" /> + </div> </form>'; } //end if record deleted no point displaying form to add record include('includes/footer.inc'); Modified: trunk/Currencies.php =================================================================== --- trunk/Currencies.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/Currencies.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -40,7 +40,9 @@ $i=1; $sql="SELECT count(currabrev) - FROM currencies WHERE currabrev='".$_POST['Abbreviation']."'"; + FROM currencies + WHERE currabrev='".$_POST['Abbreviation']."'"; + $result=DB_query($sql, $db); $myrow=DB_fetch_row($result); @@ -56,23 +58,23 @@ $Errors[$i] = 'Abbreviation'; $i++; } - if (!is_numeric($_POST['ExchangeRate'])){ + if (!is_numeric(filter_number_format($_POST['ExchangeRate']))){ $InputError = 1; prnMsg(_('The exchange rate must be numeric'),'error'); $Errors[$i] = 'ExchangeRate'; $i++; } - if (!is_numeric($_POST['DecimalPlaces'])){ + if (!is_numeric(filter_number_format($_POST['DecimalPlaces']))){ $InputError = 1; prnMsg(_('The number of decimal places to display for amounts in this currency must be numeric'),'error'); $Errors[$i] = 'DecimalPlaces'; $i++; - }elseif ($_POST['DecimalPlaces']<=0){ + }elseif (filter_number_format($_POST['DecimalPlaces'])<=0){ $InputError = 1; prnMsg(_('The number of decimal places to display for amounts in this currency must be positive or zero'),'error'); $Errors[$i] = 'DecimalPlaces'; $i++; - } elseif ($_POST['DecimalPlaces']>2){ + } elseif (filter_number_format($_POST['DecimalPlaces'])>2){ $InputError = 1; prnMsg(_('The number of decimal places to display for amounts in this currency is expected to be 2 or less'),'error'); $Errors[$i] = 'DecimalPlaces'; @@ -113,8 +115,8 @@ $sql = "UPDATE currencies SET currency='" . $_POST['CurrencyName'] . "', country='". $_POST['Country']. "', hundredsname='" . $_POST['HundredsName'] . "', - decimalplaces='" . $_POST['DecimalPlaces'] . "', - rate='" .$_POST['ExchangeRate'] . "' + decimalplaces='" . filter_number_format($_POST['DecimalPlaces']) . "', + rate='" .filter_number_format($_POST['ExchangeRate']) . "' WHERE currabrev = '" . $SelectedCurrency . "'"; $msg = _('The currency definition record has been updated'); @@ -131,8 +133,8 @@ '" . $_POST['Abbreviation'] . "', '" . $_POST['Country'] . "', '" . $_POST['HundredsName'] . "', - '" . $_POST['DecimalPlaces'] . "', - '" . $_POST['ExchangeRate'] . "')"; + '" . filter_number_format($_POST['DecimalPlaces']) . "', + '" . filter_number_format($_POST['ExchangeRate']) . "')"; $msg = _('The currency definition record has been added'); } @@ -208,7 +210,8 @@ $result = DB_query($sql, $db); echo '<table class="selection">'; - echo '<tr><td></td> + echo '<tr> + <td></td> <th>' . _('ISO4217 Code') . '</th> <th>' . _('Currency Name') . '</th> <th>' . _('Country') . '</th> @@ -216,7 +219,7 @@ <th>' . _('Decimal Places') . '</th> <th>' . _('Exchange Rate') . '</th> <th>' . _('Ex Rate - ECB') .'</th> - </tr>'; + </tr>'; $k=0; //row colour counter /*Get published currency rates from Eurpoean Central Bank */ @@ -249,9 +252,9 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> <td><a href="%s&SelectedCurrency=%s">%s</a></td> <td><a href="%s&SelectedCurrency=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this currency?') . '\');">%s</a></td> <td><a href="%s/ExchangeRateTrend.php?%s">' . _('Graph') . '</a></td> @@ -261,9 +264,9 @@ $myrow['currency'], $myrow['country'], $myrow['hundredsname'], - $myrow['decimalplaces'], - locale_number_format($myrow['rate'],5), - locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),5), + locale_number_format($myrow['decimalplaces'],0), + locale_number_format($myrow['rate'],6), + locale_number_format(GetCurrencyRate($myrow['currabrev'],$CurrencyRatesArray),6), htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['currabrev'], _('Edit'), @@ -280,14 +283,14 @@ <td>%s</td> <td class="number">%s</td> <td class="number">%s</td> - <td colspan=4>%s</td> + <td colspan="4">%s</td> </tr>', $ImageFile, $myrow['currabrev'], $myrow['currency'], $myrow['country'], $myrow['hundredsname'], - $myrow['decimalplaces'], + locale_number_format($myrow['decimalplaces'],0), 1, _('Functional Currency')); } @@ -312,11 +315,11 @@ //editing an existing payment terms $sql = "SELECT currency, - currabrev, - country, - hundredsname, - decimalplaces, - rate + currabrev, + country, + hundredsname, + decimalplaces, + rate FROM currencies WHERE currabrev='" . $SelectedCurrency . "'"; @@ -329,71 +332,76 @@ $_POST['CurrencyName'] = $myrow['currency']; $_POST['Country'] = $myrow['country']; $_POST['HundredsName'] = $myrow['hundredsname']; - $_POST['ExchangeRate'] = $myrow['rate']; - $_POST['DecimalPlaces'] = $myrow['decimalplaces']; + $_POST['ExchangeRate'] = locale_number_format($myrow['rate'],6); + $_POST['DecimalPlaces'] = locale_number_format($myrow['decimalplaces'],0); - echo '<input type="hidden" name="SelectedCurrency" value="' . $SelectedCurrency . '">'; - echo '<input type="hidden" name="Abbreviation" value="' . $_POST['Abbreviation'] . '">'; + echo '<input type="hidden" name="SelectedCurrency" value="' . $SelectedCurrency . '" />'; + echo '<input type="hidden" name="Abbreviation" value="' . $_POST['Abbreviation'] . '" />'; echo '<table class="selection"> <tr> - <td>' . _('ISO 4217 Currency Code').':</td> - <td>' . $_POST['Abbreviation'] . '</td> + <td>' . _('ISO 4217 Currency Code').':</td> + <td>' . $_POST['Abbreviation'] . '</td> </tr>'; } else { //end of if $SelectedCurrency only do the else when a new record is being entered if (!isset($_POST['Abbreviation'])) {$_POST['Abbreviation']='';} echo '<table class="selection"> <tr> - <td>' ._('Currency Abbreviation') . ':</td> - <td><input ' . (in_array('Abbreviation',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Abbreviation" value="' . $_POST['Abbreviation'] . '" size=4 maxlength=3></td></tr>'; + <td>' ._('Currency Abbreviation') . ':</td> + <td><input ' . (in_array('Abbreviation',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Abbreviation" value="' . $_POST['Abbreviation'] . '" size="4" maxlength="3" /></td> + </tr>'; } - echo '<tr><td>'._('Currency Name').':</td>'; - echo '<td>'; + echo '<tr> + <td>'._('Currency Name').':</td> + <td>'; if (!isset($_POST['CurrencyName'])) { $_POST['CurrencyName']=''; } - echo '<input ' . (in_array('CurrencyName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="CurrencyName" size=20 maxlength=20 value="' . $_POST['CurrencyName'] . '">'; - echo '</td></tr>'; - echo '<tr><td>'._('Country').':</td>'; - echo '<td>'; + echo '<input ' . (in_array('CurrencyName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="CurrencyName" size="20" maxlength="20" value="' . $_POST['CurrencyName'] . '" /></td> + </tr> + <tr> + <td>'._('Country').':</td> + <td>'; if (!isset($_POST['Country'])) { $_POST['Country']=''; } - echo '<input ' . (in_array('Country',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Country" size=30 maxlength=50 value="' . $_POST['Country'] . '">'; - echo '</td></tr>'; - - echo '<tr><td>'._('Hundredths Name').':</td>'; - echo '<td>'; + echo '<input ' . (in_array('Country',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Country" size="30" maxlength="50" value="' . $_POST['Country'] . '" /></td> + </tr> + <tr> + <td>'._('Hundredths Name').':</td> + <td>'; if (!isset($_POST['HundredsName'])) { $_POST['HundredsName']=''; } - echo '<input ' . (in_array('HundredsName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="HundredsName" size=10 maxlength=15 value="'. $_POST['HundredsName'].'">'; - echo '</td></tr>'; - - echo '<tr><td>'._('Decimal Places to Display').':</td>'; - echo '<td>'; + echo '<input ' . (in_array('HundredsName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="HundredsName" size="10" maxlength="15" value="'. $_POST['HundredsName'].'" /></td> + </tr> + <tr> + <td>'._('Decimal Places to Display').':</td> + <td>'; if (!isset($_POST['DecimalPlaces'])) { $_POST['DecimalPlaces']=''; } - echo '<input ' . (in_array('DecimalPlaces',$Errors) ? 'class="inputerror"' : 'class="number"' ) .' type="text" name="DecimalPlaces" size="2" maxlength="2" value="'. $_POST['DecimalPlaces'].'">'; - echo '</td></tr>'; - - echo '<tr><td>'._('Exchange Rate').':</td>'; - echo '<td>'; + echo '<input ' . (in_array('DecimalPlaces',$Errors) ? 'class="inputerror"' : 'class="number"' ) .' type="text" name="DecimalPlaces" size="2" maxlength="2" value="'. $_POST['DecimalPlaces'].'" /></td> + </tr> + <tr> + <td>'._('Exchange Rate').':</td> + <td>'; if (!isset($_POST['ExchangeRate'])) { $_POST['ExchangeRate']=''; } - echo '<input ' . (in_array('ExchangeRate',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class=number name="ExchangeRate" size=10 maxlength=9 value='. $_POST['ExchangeRate'].'>'; - echo '</td></tr>'; - echo '</table>'; + echo '<input ' . (in_array('ExchangeRate',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="ExchangeRate" size="10" maxlength="9" value="'. $_POST['ExchangeRate'].'"></td> + </tr> + </table>'; - echo '<br /><div class="centre"><input type="Submit" name="submit" value='._('Enter Information').'></div>'; + echo '<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/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-10-29 09:51:53 UTC (rev 4736) +++ trunk/CustLoginSetup.php 2011-10-30 05:50:51 UTC (rev 4737) @@ -134,22 +134,27 @@ $_POST['Email']=''; } -echo '<tr><td>' . _('Password') . ':</td> - <td><input type="password" name="Password" size=22 maxlength=20 value="' . $_POST['Password'] . '"></tr>'; -echo '<tr><td>' . _('Full Name') . ':</td> - <td><input type="text" name="RealName" value="' . $_POST['RealName'] . '" size=36 maxlength=35></td></tr>'; -echo '<tr><td>' . _('Telephone No') . ':</td> - <td><input type="text" name="Phone" value="' . $_POST['Phone'] . '" size=32 maxlength=30></td></tr>'; -echo '<tr><td>' . _('Email Address') .':</td> - <td><input type="text" name="Email" value="' . $_POST['Email'] .'" size=32 maxlength=55></td></tr>'; -echo '<input type="hidden" name="Access" value="1">'; +echo '<tr> + <td>' . _('Password') . ':</td> + <td><input type="password" name="Password" size="22" maxlength="20" value="' . $_POST['Password'] . '" /> + </tr> + <tr> + <td>' . _('Full Name') . ':</td> + <td><input type="text" name="RealName" value="' . $_POST['RealName'] . '" size="36" maxlength="35" /></td> + </tr> + <tr> + <td>' . _('Telephone No') . ':</td> + <td><input type="text" name="Phone" value="' . $_POST['Phone'] . '" size="32" maxlength="30" /></td> + </tr> + <tr> + <td>' . _('Email Address') .':</td> + <td><input type="text" name="Email" value="' . $_POST['Email'] .'" size="32" maxlength="55" /></td> + </tr> + <input type="hidden" name="Access" value="1" /> + <tr> + <td>' . _('Branch Code') . ':</td> + <td><select name="BranchCode">'; - -//Customer is fixed by selection of customer - -echo '<tr><td>' . _('Branch Code') . ':</td> - <td><select name="BranchCode">'; - $sql = "SELECT branchcode FROM custbranch WHERE debtorno = '" . $_SESSION['CustomerID'] . "'"; $result = DB_query($sql,$db); @@ -163,7 +168,7 @@ if (isset($_POST['BranchCode']) and $myrow['branchcode'] == $_POST['BranchCode']){ echo '<option selected value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; } else { - echo '<option Value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; + echo '<option value="' . $myrow['branchcode'] . '">' . $myrow['branchcode'] . '</option>'; } } @@ -211,15 +216,14 @@ echo '<option value="legal_landscape">' . _('Legal') . ' ' . _('landscape') .'</option>'; } -echo '</select></td></tr>'; +echo '</select></td> + </tr> + <tr> + <td>' . _('Theme') . ':</td> + <td><select name="Theme">'; -echo '<tr> - <td>' . _('Theme') . ':</td> - <td><select name="Theme">'; - $ThemeDirectory = dir('css/'); - while (false != ($ThemeName = $ThemeDirectory->read())){ if (is_dir('css/' . $ThemeName) AND $ThemeName != '.' AND $ThemeName != '..' AND $ThemeName != '.svn'){ @@ -234,13 +238,12 @@ } } -echo '</select></td></tr>'; +echo '</select></td> + </tr> + <tr> + <td>' . _('Language') . ':</td> + <td><select name="UserLanguage">'; - -echo '<tr> - <td>' . _('Language') . ':</td> - <td><select name="UserLanguage">'; - foreach ($LanguagesArray as $LanguageEntry => $LanguageName){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; @@ -250,11 +253,13 @@ echo '<option value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; } } -echo '</select></td></tr>'; - - -echo '</table><br /> - <div class="centre"><input type="submit" name="submit" value="' . _('Enter Information') . '"></div> +echo '</select></t... [truncated message content] |
From: <dai...@us...> - 2011-10-30 09:17:35
|
Revision: 4738 http://web-erp.svn.sourceforge.net/web-erp/?rev=4738&view=rev Author: daintree Date: 2011-10-30 09:17:27 +0000 (Sun, 30 Oct 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/Stocks.php trunk/doc/Change.log Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/BOMExtendedQty.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -77,7 +77,7 @@ bom.effectiveafter, bom.effectiveto, (" . filter_number_format($_POST['Quantity']) . " * bom.quantity) as extendedqpa - FROM bom + FROM bom WHERE bom.parent ='" . $_POST['Part'] . "' AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; @@ -188,11 +188,13 @@ GROUP BY purchorderdetails.itemcode) AS poqty, (SELECT SUM(woitems.qtyreqd - woitems.qtyrecd) as netwoqty - FROM woitems + FROM woitems INNER JOIN workorders + ON woitems.wo = workorders.wo WHERE woitems.stockid = tempbom.component + AND workorders.closed=0 GROUP BY woitems.stockid) AS woqty - FROM tempbom,stockmaster - WHERE tempbom.component = stockmaster.stockid + FROM tempbom INNER JOIN stockmaster + ON tempbom.component = stockmaster.stockid GROUP BY tempbom.component, stockmaster.description, stockmaster.decimalplaces, Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/CustomerReceipt.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -52,7 +52,7 @@ $_SESSION['ReceiptBatch']->BankAccountName = $myrow[0]; $_SESSION['ReceiptBatch']->AccountCurrency=$myrow[1]; unset($result); - } elseif (DB_num_rows($result)==0 and !$BankAccountEmpty){ + } elseif (DB_num_rows($result)==0 AND !$BankAccountEmpty){ prnMsg( _('The bank account number') . ' ' . $_POST['BankAccount'] . ' ' . _('is not set up as a bank account'),'error'); include ('includes/footer.inc'); exit; @@ -62,7 +62,7 @@ $_POST['DateBanked'] = Date($_SESSION['DefaultDateFormat']); } $_SESSION['ReceiptBatch']->DateBanked = $_POST['DateBanked']; - if (isset($_POST['ExRate']) and $_POST['ExRate']!=''){ + if (isset($_POST['ExRate']) AND $_POST['ExRate']!=''){ if (is_numeric(filter_number_format($_POST['ExRate']))){ $_SESSION['ReceiptBatch']->ExRate = filter_number_format($_POST['ExRate']); } else { Modified: trunk/CustomerTransInquiry.php =================================================================== --- trunk/CustomerTransInquiry.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/CustomerTransInquiry.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -6,18 +6,20 @@ $title = _('Customer Transactions Inquiry'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Transaction Inquiry') . '" alt="" />' . ' ' . _('Transaction Inquiry') . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Transaction Inquiry') . '" alt="" />' . ' ' . _('Transaction Inquiry') . ' + </p>'; echo '<div class="page_help_text">' . _('Choose which type of transaction to report on.') . '</div> <br />'; -echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding=2 class=selection><tr>'; +echo '<table class="selection"> + <tr> + <td>' . _('Type') . ':</td> + <td><select tabindex="1" name="TransType"> '; -echo '<td>' . _('Type') . ':</td> - <td><select tabindex="1" name="TransType"> '; - $sql = "SELECT typeid, typename FROM systypes @@ -35,7 +37,7 @@ echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option Value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } echo '</select></td>'; @@ -46,31 +48,38 @@ if (!isset($_POST['ToDate'])){ $_POST['ToDate'] = Date($_SESSION['DefaultDateFormat']); } -echo '<td>' . _('From') . ':</td><td><input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="TEXT" name="FromDate" maxlength="10" size="11" VALUE="' . $_POST['FromDate'] . '"></td>'; -echo '<td>' . _('To') . ':</td><td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="TEXT" name="ToDate" maxlength="10" size="11" VALUE="' . $_POST['ToDate'] . '"></td>'; +echo '<td>' . _('From') . ':</td> + <td><input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> + <td>' . _('To') . ':</td> + <td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td>'; -echo "</tr></table><br /><div class='centre'><input tabindex=4 type=submit name='ShowResults' VALUE='" . _('Show Transactions') . "'>"; +echo '</tr></table> + <br /> + <div class="centre"> + <input tabindex="4" type="submit" name="ShowResults" value="' . _('Show Transactions') . '"> + </div> + </form>'; -echo '</form></div>'; - if (isset($_POST['ShowResults']) && $_POST['TransType'] != ''){ $SQL_FromDate = FormatDateForSQL($_POST['FromDate']); $SQL_ToDate = FormatDateForSQL($_POST['ToDate']); $sql = "SELECT transno, - trandate, - debtortrans.debtorno, - branchcode, - reference, - invtext, - order_, - rate, - ovamount+ovgst+ovfreight+ovdiscount as totalamt, - currcode, - typename - FROM debtortrans - INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN systypes ON debtortrans.type = systypes.typeid - WHERE "; + trandate, + debtortrans.debtorno, + branchcode, + reference, + invtext, + order_, + debtortrans.rate, + ovamount+ovgst+ovfreight+ovdiscount as totalamt, + currcode, + typename, + decimalplaces AS currdecimalplaces + FROM debtortrans + INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev + INNER JOIN systypes ON debtortrans.type = systypes.typeid + WHERE "; $sql = $sql . "trandate >='" . $SQL_FromDate . "' AND trandate <= '" . $SQL_ToDate . "'"; if ($_POST['TransType']!='All') { @@ -82,21 +91,23 @@ $DbgMsg = _('The SQL that failed was'); $TransResult = DB_query($sql, $db,$ErrMsg,$DbgMsg); - echo '<br /><table cellpadding=2 class=selection>'; + echo '<br /> + <table class="selection">'; - $tableheader = "<tr> - <th>" . _('Type') . "</th> - <th>" . _('Number') . "</th> - <th>" . _('Date') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Branch') . "</th> - <th>" . _('Reference') . "</th> - <th>" . _('Comments') . "</th> - <th>" . _('Order') . "</th> - <th>" . _('Ex Rate') . "</th> - <th>" . _('Amount') . "</th> - <th>" . _('Currency') . '</th></tr>'; - echo $tableheader; + $TableHeader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Comments') . '</th> + <th>' . _('Order') . '</th> + <th>' . _('Ex Rate') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Currency') . '</th> + </tr>'; + echo $TableHeader; $RowCounter = 1; $k = 0; //row colour counter @@ -111,70 +122,69 @@ $k++; } - $format_base = "<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td width='200'>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td>%s</td>"; + $format_base = '<td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td width="200">%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td>%s</td>'; if ($_POST['TransType']==10){ /* invoices */ - printf("$format_base - <td><a target='_blank' href='%s/PrintCustTrans.php?%&FromTransNo=%s&InvOrCredit=Invoice'><IMG SRC='%s' title='" . _('Click to preview the invoice') . "'></a></td> - </tr>", - $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['reference'], - $myrow['invtext'], - $myrow['order_'], - $myrow['rate'], - locale_number_format($myrow['totalamt'],2), - $myrow['currcode'], - $rootpath, - SID, - $myrow['transno'], - $rootpath.'/css/'.$theme.'/images/preview.gif'); + printf($format_base . + '<td><a target="_blank" href=%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice"><img src="%s" title="' . _('Click to preview the invoice') . '"></a></td> + </tr>', + $myrow['typename'], + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + $myrow['debtorno'], + $myrow['branchcode'], + $myrow['reference'], + $myrow['invtext'], + $myrow['order_'], + locale_number_format($myrow['rate'],6), + locale_number_format($myrow['totalamt'],$myrow['currdecimalplaces']), + $myrow['currcode'], + $rootpath, + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images/preview.gif'); + } elseif ($_POST['TransType']==11){ /* credit notes */ - printf("$format_base - <td><a target='_blank' href='%s/PrintCustTrans.php?%s&FromTransNo=%s&InvOrCredit=Credit'><IMG SRC='%s' title='" . _('Click to preview the credit') . "'></a></td> - </tr>", - $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['reference'], - $myrow['invtext'], - $myrow['order_'], - $myrow['rate'], - locale_number_format($myrow['totalamt'],2), - $myrow['currcode'], - $rootpath, - SID, - $myrow['transno'], - $rootpath.'/css/'.$theme.'/images/preview.gif'); + printf($format_base . + '<td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit"><img src="%s" title="' . _('Click to preview the credit') . '"></a></td> + </tr>', + $myrow['typename'], + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + $myrow['debtorno'], + $myrow['branchcode'], + $myrow['reference'], + $myrow['invtext'], + $myrow['order_'], + locale_number_format($myrow['rate'],6), + locale_number_format($myrow['totalamt'],$myrow['currdecimalplaces']), + $myrow['currcode'], + $rootpath, + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images/preview.gif'); } else { /* otherwise */ - printf("$format_base</tr>", - $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['reference'], - $myrow['invtext'], - $myrow['order_'], - $myrow['rate'], - locale_number_format($myrow['totalamt'],2), - $myrow['currcode']); + printf($format_base . '</tr>', + $myrow['typename'], + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + $myrow['debtorno'], + $myrow['branchcode'], + $myrow['reference'], + $myrow['invtext'], + $myrow['order_'], + locale_number_format($myrow['rate'],6), + locale_number_format($myrow['totalamt'],$myrow['currdecimalplaces']), + $myrow['currcode']); } } Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/Customers.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -10,8 +10,10 @@ include('includes/SQL_CommonFunctions.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="" />' . ' ' . _('Customer Maintenance') . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . + '" alt="" />' . ' ' . _('Customer Maintenance') . ' + </p>'; if (isset($Errors)) { unset($Errors); @@ -84,37 +86,12 @@ prnMsg( _('The Line 6 of the address must be fifteen characters or less long'),'error'); $Errors[$i] = 'Address6'; $i++; - } - elseif (mb_strlen($_POST['Phone']) >25) { + } elseif (!is_numeric(filter_number_format($_POST['CreditLimit']))) { $InputError = 1; - prnMsg(_('The telephone number must be 25 characters or less long'),'error'); - $Errors[$i] = 'Telephone'; - $i++; - } - elseif (mb_strlen($_POST['Fax']) >25) { - $InputError = 1; - prnMsg(_('The fax number must be 25 characters or less long'),'error'); - $Errors[$i] = 'Fax'; - $i++; - } - elseif (mb_strlen($_POST['Email']) >55) { - $InputError = 1; - prnMsg(_('The email address must be 55 characters or less long'),'error'); - $Errors[$i] = 'Email'; - $i++; - } - elseif (mb_strlen($_POST['Email'])>0 and !IsEmailAddress($_POST['Email'])) { - $InputError = 1; - prnMsg(_('The email address is not correctly formed'),'error'); - $Errors[$i] = 'Email'; - $i++; - } - elseif (!is_numeric($_POST['CreditLimit'])) { - $InputError = 1; prnMsg( _('The credit limit must be numeric'),'error'); $Errors[$i] = 'CreditLimit'; $i++; - } elseif (!is_numeric($_POST['PymtDiscount'])) { + } elseif (!is_numeric(filter_number_format($_POST['PymtDiscount']))) { $InputError = 1; prnMsg( _('The payment discount must be numeric'),'error'); $Errors[$i] = 'PymtDiscount'; @@ -124,22 +101,22 @@ prnMsg( _('The customer since field must be a date in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); $Errors[$i] = 'ClientSince'; $i++; - } elseif (!is_numeric($_POST['Discount'])) { + } elseif (!is_numeric(filter_number_format($_POST['Discount']))) { $InputError = 1; prnMsg( _('The discount percentage must be numeric'),'error'); $Errors[$i] = 'Discount'; $i++; - } elseif ((double) $_POST['CreditLimit'] <0) { + } elseif (filter_number_format($_POST['CreditLimit']) <0) { $InputError = 1; prnMsg( _('The credit limit must be a positive number'),'error'); $Errors[$i] = 'CreditLimit'; $i++; - } elseif (((double) $_POST['PymtDiscount']> 10) OR ((double) $_POST['PymtDiscount'] <0)) { + } elseif ((filter_number_format($_POST['PymtDiscount'])> 10) OR (filter_number_format($_POST['PymtDiscount']) <0)) { $InputError = 1; prnMsg( _('The payment discount is expected to be less than 10% and greater than or equal to 0'),'error'); $Errors[$i] = 'PymtDiscount'; $i++; - } elseif (((double) $_POST['Discount']> 100) OR ((double) $_POST['Discount'] <0)) { + } elseif ((filter_number_format($_POST['Discount'])> 100) OR (filter_number_format($_POST['Discount']) <0)) { $InputError = 1; prnMsg( _('The discount is expected to be less than 100% and greater than or equal to 0'),'error'); $Errors[$i] = 'Discount'; @@ -171,10 +148,10 @@ clientsince='" . $SQL_ClientSince. "', holdreason='" . $_POST['HoldReason'] . "', paymentterms='" . $_POST['PaymentTerms'] . "', - discount='" . ($_POST['Discount'])/100 . "', + discount='" . filter_number_format($_POST['Discount'])/100 . "', discountcode='" . $_POST['DiscountCode'] . "', - pymtdiscount='" . ($_POST['PymtDiscount'])/100 . "', - creditlimit='" . $_POST['CreditLimit'] . "', + pymtdiscount='" . filter_number_format($_POST['PymtDiscount'])/100 . "', + creditlimit='" . filter_number_format($_POST['CreditLimit']) . "', salestype = '" . $_POST['SalesType'] . "', invaddrbranch='" . $_POST['AddrInvBranch'] . "', taxref='" . $_POST['TaxRef'] . "', @@ -201,10 +178,10 @@ clientsince='" . $SQL_ClientSince . "', holdreason='" . $_POST['HoldReason'] . "', paymentterms='" . $_POST['PaymentTerms'] . "', - discount='" . ($_POST['Discount'])/100 . "', + discount='" . filter_number_format($_POST['Discount'])/100 . "', discountcode='" . $_POST['DiscountCode'] . "', - pymtdiscount='" . ($_POST['PymtDiscount'])/100 . "', - creditlimit='" . $_POST['CreditLimit'] . "', + pymtdiscount='" . filter_number_format($_POST['PymtDiscount'])/100 . "', + creditlimit='" . filter_number_format($_POST['CreditLimit']) . "', salestype = '" . $_POST['SalesType'] . "', invaddrbranch='" . $_POST['AddrInvBranch'] . "', taxref='" . $_POST['TaxRef'] . "', @@ -266,10 +243,10 @@ '" . $SQL_ClientSince . "', '" . $_POST['HoldReason'] . "', '" . $_POST['PaymentTerms'] . "', - '" . ($_POST['Discount'])/100 . "', + '" . filter_number_format($_POST['Discount'])/100 . "', '" . $_POST['DiscountCode'] . "', - '" . ($_POST['PymtDiscount'])/100 . "', - '" . $_POST['CreditLimit'] . "', + '" . filter_number_format($_POST['PymtDiscount'])/100 . "', + '" . filter_number_format($_POST['CreditLimit']) . "', '" . $_POST['SalesType'] . "', '" . $_POST['AddrInvBranch'] . "', '" . $_POST['TaxRef'] . "', @@ -577,8 +554,9 @@ $myrow = DB_fetch_row($CurrResult); $_POST['CurrCode'] = $myrow[0]; } - echo '<tr><td>' . _('Customer Currency') . ':</td> - <td><select tabindex=17 name="CurrCode">'; + echo '<tr> + <td>' . _('Customer Currency') . ':</td> + <td><select tabindex="17" name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode']==$myrow['currabrev']){ echo '<option selected value='. $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; @@ -588,28 +566,34 @@ } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } - echo '<tr><td>' . _('Customer PO Line on SO') . ':</td> + echo '<tr> + <td>' . _('Customer PO Line on SO') . ':</td> <td><select tabindex="18" name="CustomerPOLine"> <option selected value=0>' . _('No') . '</option> <option value=1>' . _('Yes') . '</option> </select> </td> - </tr>'; - - echo '<tr><td>' . _('Invoice Addressing') . ':</td> + </tr> + <tr> + <td>' . _('Invoice Addressing') . ':</td> <td><select tabindex="19" name="AddrInvBranch"> <option selected value=0>' . _('Address to HO') . '</option> <option value=1>' . _('Address to Branch') . '</option> </select> </td> - </tr>'; - - echo'</table></td></tr></table>'; + </tr> + </table></td> + </tr> + </table>'; if ($DataError ==0){ - echo '<br /><div class="centre"><input tabindex=20 type="Submit" name="submit" value="' . _('Add New Customer') . '"> <input tabindex=21 type="submit" action="Reset" value="' . _('Reset') . '"></div>'; + echo '<br /> + <div class="centre"> + <input tabindex="20" type="submit" name="submit" value="' . _('Add New Customer') . '" /> <input tabindex="21" type="submit" action="Reset" value="' . _('Reset') . '" /> + </div>'; } echo '</form>'; @@ -620,34 +604,34 @@ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection cellspacing=4> - <tr><td valign=top><table class=selection>'; + echo '<table class="selection"> + <tr><td valign="top"><table class="selection">'; if (!isset($_POST['New'])) { $sql = "SELECT debtorsmaster.debtorno, - name, - address1, - address2, - address3, - address4, - address5, - address6, - currcode, - salestype, - clientsince, - holdreason, - paymentterms, - discount, - discountcode, - pymtdiscount, - creditlimit, - invaddrbranch, - taxref, - customerpoline, - typeid + name, + address1, + address2, + address3, + address4, + address5, + address6, + currcode, + salestype, + clientsince, + holdreason, + paymentterms, + discount, + discountcode, + pymtdiscount, + creditlimit, + invaddrbranch, + taxref, + customerpoline, + typeid FROM debtorsmaster - WHERE debtorsmaster.debtorno = '" . $DebtorNo . "'"; - + WHERE debtorsmaster.debtorno = '" . $DebtorNo . "'"; + $ErrMsg = _('The customer details could not be retrieved because'); $result = DB_query($sql,$db,$ErrMsg); @@ -672,10 +656,10 @@ $_POST['ClientSince'] = ConvertSQLDate($myrow['clientsince']); $_POST['HoldReason'] = $myrow['holdreason']; $_POST['PaymentTerms'] = $myrow['paymentterms']; - $_POST['Discount'] = $myrow['discount'] * 100; + $_POST['Discount'] = locale_number_format($myrow['discount'] * 100,2); $_POST['DiscountCode'] = $myrow['discountcode']; - $_POST['PymtDiscount'] = $myrow['pymtdiscount'] * 100; - $_POST['CreditLimit'] = $myrow['creditlimit']; + $_POST['PymtDiscount'] = locale_number_format($myrow['pymtdiscount'] * 100,2); + $_POST['CreditLimit'] = locale_number_format($myrow['creditlimit'],0); $_POST['InvAddrBranch'] = $myrow['invaddrbranch']; $_POST['TaxRef'] = $myrow['taxref']; $_POST['CustomerPOLine'] = $myrow['customerpoline']; @@ -690,34 +674,70 @@ /* if $AutoDebtorNo in config.php has not been set or if it has been set to a number less than one, then provide an input box for the DebtorNo to manually assigned */ if ($_SESSION['AutoDebtorNo']== 0 ) { - echo '<tr><td>' . _('Customer Code') . ':</td> - <td><input ' . (in_array('DebtorNo',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="DebtorNo" value="' . $DebtorNo . '" size=12 maxlength=10></td></tr>'; + echo '<tr> + <td>' . _('Customer Code') . ':</td> + <td><input ' . (in_array('DebtorNo',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="DebtorNo" value="' . $DebtorNo . '" size="12" maxlength="10" /></td></tr>'; } } if (isset($_GET['Modify'])) { - echo '<tr><td>' . _('Customer Name') . ':</td><td>' . $_POST['CustName'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td><td>' . $_POST['Address1'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td><td>' . $_POST['Address2'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td><td>' . $_POST['Address3'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td><td>' . $_POST['Address4'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 5') . ':</td><td>' . $_POST['Address5'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 6') . ':</td><td>' . $_POST['Address6'] . '</td></tr>'; + echo '<tr> + <td>' . _('Customer Name') . ':</td> + <td>' . $_POST['CustName'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 1 (Street)') . ':</td> + <td>' . $_POST['Address1'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 2 (Suburb/City)') . ':</td> + <td>' . $_POST['Address2'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 3 (State/Province)') . ':</td> + <td>' . $_POST['Address3'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 4 (Postal Code)') . ':</td> + <td>' . $_POST['Address4'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 5') . ':</td> + <td>' . $_POST['Address5'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 6') . ':</td> + <td>' . $_POST['Address6'] . '</td> + </tr>'; } else { - echo '<tr><td>' . _('Customer Name') . ':</td> - <td><input ' . (in_array('CustName',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="CustName" value="' . $_POST['CustName'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td> - <td><input ' . (in_array('Address1',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address1" size=42 maxlength=40 value="' . $_POST['Address1'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td> - <td><input ' . (in_array('Address2',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address2" size=42 maxlength=40 value="' . $_POST['Address2'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td> - <td><input ' . (in_array('Address3',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address3" size=42 maxlength=40 value="' . $_POST['Address3'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td> - <td><input ' . (in_array('Address4',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address4" size=42 maxlength=40 value="' . $_POST['Address4'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 5') . ':</td> - <td><input ' . (in_array('Address5',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address5" size=42 maxlength=40 value="' . $_POST['Address5'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 6') . ':</td> - <td><input ' . (in_array('Address6',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address6" size=42 maxlength=40 value="' . $_POST['Address6'] . '"></td></tr>'; + echo '<tr> + <td>' . _('Customer Name') . ':</td> + <td><input ' . (in_array('CustName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="CustName" value="' . $_POST['CustName'] . '" size="42" maxlength="40" /></td> + </tr> + <tr> + <td>' . _('Address Line 1 (Street)') . ':</td> + <td><input ' . (in_array('Address1',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address1" size="42" maxlength="40" value="' . $_POST['Address1'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 2 (Suburb/City)') . ':</td> + <td><input ' . (in_array('Address2',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address2" size="42" maxlength="40" value="' . $_POST['Address2'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 3 (State/Province)') . ':</td> + <td><input ' . (in_array('Address3',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address3" size="42" maxlength="40" value="' . $_POST['Address3'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 4 (Postal Code)') . ':</td> + <td><input ' . (in_array('Address4',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address4" size="42" maxlength="40" value="' . $_POST['Address4'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 5') . ':</td> + <td><input ' . (in_array('Address5',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address5" size="42" maxlength="40" value="' . $_POST['Address5'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 6') . ':</td> + <td><input ' . (in_array('Address6',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address6" size="42" maxlength="40" value="' . $_POST['Address6'] . '" /></td> + </tr>'; } // Select sales types for drop down list @@ -743,12 +763,14 @@ if (isset($_GET['Modify'])) { $result=DB_query("SELECT typename FROM debtortype WHERE typeid='".$_POST['typeid']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Customer Type') . ':</td> + echo '<tr> + <td>' . _('Customer Type') . ':</td> <td>'.$myrow['typename'] . '</td> </tr>'; } else { $result=DB_query("SELECT typeid, typename FROM debtortype ORDER BY typename",$db); - echo '<tr><td>' . _('Customer Type') . ':</td> + echo '<tr> + <td>' . _('Customer Type') . ':</td> <td><select name="typeid">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['typeid']==$myrow['typeid']){ @@ -765,45 +787,73 @@ <tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> <td>' . $_POST['ClientSince'] . '</td></tr>'; - echo '</table></td><td><table class=selection>'; + echo '</table></td> + <td><table class="selection">'; - echo '<tr><td>' . _('Discount Percent') . ':</td> - <td>' . $_POST['Discount'] . '</td></tr>'; - echo '<tr><td>' . _('Discount Code') . ':</td> - <td>' . $_POST['DiscountCode'] . '</td></tr>'; - echo '<tr><td>' . _('Payment Discount Percent') . ':</td> - <td>' . $_POST['PymtDiscount'] . '</td></tr>'; - echo '<tr><td>' . _('Credit Limit') . ':</td> - <td>' . locale_number_format($_POST['CreditLimit'],2) . '</td></tr>'; - echo '<tr><td>' . _('Tax Reference') . ':</td> - <td>' . $_POST['TaxRef'] . '</td></tr>'; + echo '<tr> + <td>' . _('Discount Percent') . ':</td> + <td>' . $_POST['Discount'] . '</td> + </tr> + <tr> + <td>' . _('Discount Code') . ':</td> + <td>' . $_POST['DiscountCode'] . '</td> + </tr> + <tr> + <td>' . _('Payment Discount Percent') . ':</td> + <td>' . $_POST['PymtDiscount'] . '</td> + </tr> + <tr> + <td>' . _('Credit Limit') . ':</td> + <td>' . $_POST['CreditLimit'] . '</td> + </tr> + <tr> + <td>' . _('Tax Reference') . ':</td> + <td>' . $_POST['TaxRef'] . '</td> + </tr>'; } else { - echo '</select></td></tr> - <tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input ' . (in_array('ClientSince',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" size=11 maxlength=10 value=' . $_POST['ClientSince'] . '></td></tr>'; + echo '</select></td> + </tr> + <tr> + <td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('ClientSince',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" size="11" maxlength="10" value="' . $_POST['ClientSince'] . '" /></td> + </tr> + </table></td> + <td><table class="selection">'; - echo '</table></td><td><table class="selection">'; - - echo '<tr><td>' . _('Discount Percent') . ':</td> - <td><input type="Text" name="Discount" class=number size=5 maxlength=4 value=' . $_POST['Discount'] . '></td></tr>'; - echo '<tr><td>' . _('Discount Code') . ':</td> - <td><input ' . (in_array('DiscountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="DiscountCode" size=3 maxlength=2 value="' . $_POST['DiscountCode'] . '"></td></tr>'; - echo '<tr><td>' . _('Payment Discount Percent') . ':</td> - <td><input ' . (in_array('PymtDiscount',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class=number name="PymtDiscount" size=5 maxlength=4 value=' . $_POST['PymtDiscount'] . '></td></tr>'; - echo '<tr><td>' . _('Credit Limit') . ':</td> - <td><input ' . (in_array('CreditLimit',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class=number name="CreditLimit" size=16 maxlength=14 value=' . $_POST['CreditLimit'] . '></td></tr>'; - echo '<tr><td>' . _('Tax Reference') . ':</td> - <td><input type="Text" name="TaxRef" size=22 maxlength=20 value="' . $_POST['TaxRef'] . '"></td></tr>'; + echo '<tr> + <td>' . _('Discount Percent') . ':</td> + <td><input type="text" name="Discount" class="number" size="5" maxlength="4" value="' . $_POST['Discount'] . '" /></td> + </tr> + <tr> + <td>' . _('Discount Code') . ':</td> + <td><input ' . (in_array('DiscountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="DiscountCode" size="3" maxlength="2" value="' . $_POST['DiscountCode'] . '"></td> + </tr> + <tr> + <td>' . _('Payment Discount Percent') . ':</td> + <td><input ' . (in_array('PymtDiscount',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="PymtDiscount" size="5" maxlength="4" value="' . $_POST['PymtDiscount'] . '"></td> + </tr> + <tr> + <td>' . _('Credit Limit') . ':</td> + <td><input ' . (in_array('CreditLimit',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="CreditLimit" size="16" maxlength="14" value="' . $_POST['CreditLimit'] . '" /></td> + </tr> + <tr> + <td>' . _('Tax Reference') . ':</td> + <td><input type="text" name="TaxRef" size="22" maxlength="20" value="' . $_POST['TaxRef'] . '" /></td> + </tr>'; } if (isset($_GET['Modify'])) { $result=DB_query("SELECT terms FROM paymentterms WHERE termsindicator='".$_POST['PaymentTerms']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Payment Terms') . ':</td><td>' . $myrow['terms'] . '</td></tr>'; + echo '<tr> + <td>' . _('Payment Terms') . ':</td> + <td>' . $myrow['terms'] . '</td> + </tr>'; } else { $result=DB_query("SELECT terms, termsindicator FROM paymentterms",$db); - echo '<tr><td>' . _('Payment Terms') . ':</td> - <td><select name="PaymentTerms">'; + echo '<tr> + <td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['PaymentTerms']==$myrow['termsindicator']){ echo '<option selected value="'. $myrow['termsindicator'] . '">' . $myrow['terms'] . '</option>'; @@ -812,18 +862,22 @@ } } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (isset($_GET['Modify'])) { $result=DB_query("SELECT reasondescription FROM holdreasons WHERE reasoncode='".$_POST['HoldReason']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Credit Status') . ':</td> - <td>'.$myrow['reasondescription'] . '</td></tr>'; + echo '<tr> + <td>' . _('Credit Status') . ':</td> + <td>'.$myrow['reasondescription'] . '</td> + </tr>'; } else { $result=DB_query("SELECT reasoncode, reasondescription FROM holdreasons",$db); - echo '<tr><td>' . _('Credit Status') . ':</td> - <td><select name="HoldReason">'; + echo '<tr> + <td>' . _('Credit Status') . ':</td> + <td><select name="HoldReason">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['HoldReason']==$myrow['reasoncode']){ echo '<option selected value="'. $myrow['reasoncode'] . '">' . $myrow['reasondescription'] . '</option>'; @@ -832,18 +886,21 @@ } } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (isset($_GET['Modify'])) { $result=DB_query("SELECT currency FROM currencies WHERE currabrev='".$_POST['CurrCode']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Credit Status') . ':</td> + echo '<tr> + <td>' . _('Credit Status') . ':</td> <td>' . $myrow['currency'] . '</td></tr>'; } else { $result=DB_query("SELECT currency, currabrev FROM currencies",$db); - echo '<tr><td>' . _('Customers Currency') . ':</td> - <td><select name="CurrCode">'; + echo '<tr> + <td>' . _('Customers Currency') . ':</td> + <td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode']==$myrow['currabrev']){ echo '<option selected value="'. $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; @@ -852,22 +909,26 @@ } } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } /*added lines 8/23/2007 by Morris Kelly to get po line parameter Y/N*/ if (isset($_GET['Modify'])) { if ($_POST['CustomerPOLine']==0){ - echo '<tr><td>' . _('Credit Status') . ':</td> + echo '<tr> + <td>' . _('Credit Status') . ':</td> <td>'._('No') . '</td> </tr>'; } else { - echo '<tr><td>' . _('Credit Status') . ':</td> + echo '<tr> + <td>' . _('Credit Status') . ':</td> <td>'._('Yes') . '</td> - </tr>'; + </tr>'; } } else { - echo '<tr><td>' . _('Require Customer PO Line on SO') . ':</td> - <td><select name="CustomerPOLine">'; + echo '<tr> + <td>' . _('Require Customer PO Line on SO') . ':</td> + <td><select name="CustomerPOLine">'; if ($_POST['CustomerPOLine']==0){ echo '<option selected value=0>' . _('No') . '</option>'; echo '<option value=1>' . _('Yes') . '</option>'; @@ -875,18 +936,26 @@ echo '<option value=0>' . _('No') . '</option>'; echo '<option selected value=1>' . _('Yes') . '</option>'; } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (isset($_GET['Modify'])) { if ($_POST['CustomerPOLine']==0){ - echo '<tr><td>' . _('Invoice Addressing') . ':</td><td>'._('Address to HO').'</td></tr>'; + echo '<tr> + <td>' . _('Invoice Addressing') . ':</td> + <td>'._('Address to HO').'</td> + </tr>'; } else { - echo '<tr><td>' . _('Invoice Addressing') . ':</td><td>'._('Address to Branch').'</td></tr>'; + echo '<tr> + <td>' . _('Invoice Addressing') . ':</td> + <td>'._('Address to Branch').'</td> + </tr>'; } } else { - echo '<tr><td>' . _('Invoice Addressing') . ':</td> - <td><select name="AddrInvBranch">'; + echo '<tr> + <td>' . _('Invoice Addressing') . ':</td> + <td><select name="AddrInvBranch">'; if ($_POST['InvAddrBranch']==0){ echo '<option selected value=0>' . _('Address to HO') . '</option>'; echo '<option value=1>' . _('Address to Branch') . '</option>'; @@ -896,11 +965,12 @@ } } - echo '</select></td></tr> - </table></td></tr>'; - echo '<tr><td colspan=2>'; + echo '</select></td> + </tr> + </table></td> + </tr> + <tr><td colspan="2">'; - if (isset($_GET['delete'])) { //User hit delete link on customer contacts /*Process this first before showing remaining contacts */ $resultupcc = DB_query("DELETE FROM custcontacts @@ -925,20 +995,22 @@ echo '<table class=selection>'; if (isset($_GET['Modify'])) { echo '<tr> - <th>' . _('Name') . '</th> - <th>' . _('Role') . '</th> - <th>' . _('Phone Number') . '</th> - <th>' . _('Email') . '</th> - <th>' . _('Notes') . '</th></tr>'; + <th>' . _('Name') . '</th> + <th>' . _('Role') . '</th> + <th>' . _('Phone Number') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Notes') . '</th> + </tr>'; } else { echo '<tr> - <th>' . _('Name') . '</th> - <th>' . _('Role') . '</th> - <th>' . _('Phone Number') . '</th> - <th>' . _('Email') . '</th> - <th>' . _('Notes') . '</th> - <th>' . _('Edit') . '</th> - <th colspan=2><input type="Submit" name="AddContact" value="Add Contact"></th></tr>'; + <th>' . _('Name') . '</th> + <th>' . _('Role') . '</th> + <th>' . _('Phone Number') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Edit') . '</th> + <th colspan="2"><input type="Submit" name="AddContact" value="' . _('Add Contact') . '" /></th> + </tr>'; } $k=0; //row colour counter @@ -953,51 +1025,54 @@ if (isset($_GET['Modify'])) { printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href=mailto:%s>%s</a></td> - <td>%s</td> - </tr>', - $myrow['contactname'], - $myrow['role'], - $myrow['phoneno'], - $myrow['email'], - $myrow['email'], - $myrow['notes']); + <td>%s</td> + <td>%s</td> + <td><a href=mailto:%s>%s</a></td> + <td>%s</td> + </tr>', + $myrow['contactname'], + $myrow['role'], + $myrow['phoneno'], + $myrow['email'], + $myrow['email'], + $myrow['notes']); } else { printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href=mailto:%s>%s</a></td> - <td>%s</td> - <td><a href="AddCustomerContacts.php?Id=%s&DebtorNo=%s">'. _('Edit'). '</a></td> - <td><a href="%sID=%s&DebtorNo=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this customer contact?') . '\');">'. _('Delete'). '</a></td> - </tr>', - $myrow['contactname'], - $myrow['role'], - $myrow['phoneno'], - $myrow['email'], - $myrow['email'], - $myrow['notes'], - $myrow['contid'], - $myrow['debtorno'], - htmlspecialchars($_SERVER['PHP_SELF']) . '?', - $myrow['contid'], - $myrow['debtorno']); + <td>%s</td> + <td>%s</td> + <td><a href=mailto:%s>%s</a></td> + <td>%s</td> + <td><a href="AddCustomerContacts.php?Id=%s&DebtorNo=%s">'. _('Edit'). '</a></td> + <td><a href="%sID=%s&DebtorNo=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this customer contact?') . '\');">'. _('Delete'). '</a></td> + </tr>', + $myrow['contactname'], + $myrow['role'], + $myrow['phoneno'], + $myrow['email'], + $myrow['email'], + $myrow['notes'], + $myrow['contid'], + $myrow['debtorno'], + htmlspecialchars($_SERVER['PHP_SELF']) . '?', + $myrow['contid'], + $myrow['debtorno']); } }//END WHILE LIST LOOP echo '</table>'; - - echo'</td></tr></table>'; if (isset($_POST['New']) and $_POST['New']) { - echo '<div class="centre"><input type="submit" name="submit" value="' . _('Add New Customer') . - '"> <input type=submit name="Reset" value="' . _('Reset') . '"></div></form>'; - } else if (!isset($_GET['Modify'])){ - echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Update Customer') . '">'; - echo ' <input type="Submit" name="delete" value="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; + echo '<div class="centre"> + <input type="submit" name="submit" value="' . _('Add New Customer') . '" /> + <input type=submit name="Reset" value="' . _('Reset') . '" /> + </div> + </form>'; + } elseif (!isset($_GET['Modify'])){ + echo '<br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Update Customer') . '" /> + <input type="Submit" name="delete" value="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" />'; } echo '</div>'; Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/DailyBankTransactions.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -6,14 +6,16 @@ $title = _('Bank Transactions Inquiry'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . + _('Search') . '" alt="" />' . ' ' . $title.' + </p>'; if (!isset($_POST['Show'])) { echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; + echo '<table class="selection">'; $SQL = "SELECT bankaccountname, bankaccounts.accountcode, @@ -26,7 +28,8 @@ $DbgMsg = _('The SQL used to retrieve the bank accounts was'); $AccountsResults = DB_query($SQL,$db,$ErrMsg,$DbgMsg); - echo '<tr><td>' . _('Bank Account') . ':</td> + echo '<tr> + <td>' . _('Bank Account') . ':</td> <td><select name="BankAccount">'; if (DB_num_rows($AccountsResults)==0){ @@ -49,18 +52,21 @@ } echo '</select></td></tr>'; } - echo '<tr><td>' . _('Transactions Dated From') . ':</td> - <td><input type="text" name="FromTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . - date($_SESSION['DefaultDateFormat']) . '"></td></tr> - <tr><td>' . _('Transactions Dated To') . ':</td> - <td><input type="text" name="ToTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 - onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . - date($_SESSION['DefaultDateFormat']) . '"></td> - </tr>'; - - echo '</table>'; - echo '<br /><div class="centre"><input type="submit" name="Show" value="' . _('Show transactions'). '"></div>'; - echo '</form>'; + echo '<tr> + <td>' . _('Transactions Dated From') . ':</td> + <td><input type="text" name="FromTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . + date($_SESSION['DefaultDateFormat']) . '" /></td> + </tr> + <tr> + <td>' . _('Transactions Dated To') . ':</td> + <td><input type="text" name="ToTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . date($_SESSION['DefaultDateFormat']) . '" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Show" value="' . _('Show transactions'). '" /> + </div> + </form>'; } else { $SQL = "SELECT bankaccountname, bankaccounts.currcode, @@ -78,6 +84,7 @@ banktrans.exrate, banktrans.banktranstype, banktrans.transdate, + banktrans.ref, bankaccounts.bankaccountname, systypes.typename, systypes.typeid @@ -95,20 +102,20 @@ prnMsg(_('There are no transactions for this account in the date range selected'), 'info'); } else { $BankDetailRow = DB_fetch_array($BankResult); - echo '<table class=selection> + echo '<table class="selection"> <tr> - <th colspan=7><font size=3 color=blue>' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th> + <th colspan="8"><font size="3" color="blue">' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th> + </tr> + <tr> + <th>' . ('Date') . '</th> + <th>'._('Transaction type').'</th> + <th>'._('Type').'</th> + <th>'._('Reference').'</th> + <th>'._('Amount in').' '.$BankDetailRow['currcode'].'</th> + <th>'._('Running Total').' '.$BankDetailRow['currcode'].'</th> + <th>'._('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> + <th>'._('Running Total').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> </tr>'; - echo '<tr> - <th>' . ('Date') . '</th> - <th>'._('Transaction type').'</th> - <th>'._('Type').'</th> - <th>'._('Reference').'</th> - <th>'._('Amount in').' '.$BankDetailRow['currcode'].'</th> - <th>'._('Running Total').' '.$BankDetailRow['currcode'].'</th> - <th>'._('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> - <th>'._('Running Total').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> - </tr>'; $AccountCurrTotal=0; $LocalCurrTotal =0; @@ -123,10 +130,10 @@ <td>'.$myrow['typename'].'</td> <td>'.$myrow['banktranstype'].'</td> <td>'.$myrow['ref'].'</td> - <td class=number>'.locale_number_format($myrow['amount'],$BankDetailRow['decimalplaces']).'</td> - <td class=number>'.locale_number_format($AccountCurrTotal,$BankDetailRow['decimalplaces']).'</td> - <td class=number>'.locale_number_format($myrow['amount']/$myrow['functionalexrate']/$myrow['exrate'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> - <td class=number>'.locale_number_format($LocalCurrTotal,$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class="number">'.locale_number_format($myrow['amount'],$BankDetailRow['decimalplaces']).'</td> + <td class="number">'.locale_number_format($AccountCurrTotal,$BankDetailRow['decimalplaces']).'</td> + <td class="number">'.locale_number_format($myrow['amount']/$myrow['functionalexrate']/$myrow['exrate'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class="number">'.locale_number_format($LocalCurrTotal,$_SESSION['CompanyRecord']['decimalplaces']).'</td> </tr>'; } echo '</table>'; Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/DailySalesInquiry.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -7,17 +7,21 @@ include('includes/header.inc'); include('includes/DefineCartClass.php'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Daily Sales') . '" alt="" />' . ' ' . _('Daily Sales') . '</p>'; -echo '<div class="page_help_text">' . _('Select the month to show daily sales for') . '</div><br />'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Daily Sales') . '" alt="" />' . ' ' . _('Daily Sales') . ' + </p>'; +echo '<div class="page_help_text">' . _('Select the month to show daily sales for') . '</div> + <br />'; echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding=2 class=selection><tr>'; +echo '<table class="selection"> + <tr> + <td>' . _('Month to Show') . ':</td> + <td><select tabindex="1" name="MonthToShow">'; -echo '<td>' . _('Month to Show') . ':</td><td><select tabindex=1 name="MonthToShow">'; - if (!isset($_POST['MonthToShow'])){ $_POST['MonthToShow'] = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); } @@ -29,11 +33,12 @@ echo '<option selected Value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; $EndDateSQL = $PeriodRow['lastdate_in_period']; } else { - echo '<option Value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; + echo '<option value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; } } -echo '</select></td>'; -echo '<td>' . _('Salesperson') . ':</td><td><select tabindex=2 name="Salesperson">'; +echo '</select></td> + <td>' . _('Salesperson') . ':</td> + <td><select tabindex="2" name="Salesperson">'; $SalespeopleResult = DB_query("SELECT salesmancode, salesmanname FROM salesman",$db); if (!isset($_POST['Salesperson'])){ @@ -55,9 +60,11 @@ echo '</tr> </table> <br /> - <div class="centre"><input tabindex=4 type=submit name="ShowResults" value="' . _('Show Daily Sales For The Selected Month') . '">'; -echo '</form></div>'; -echo '<br />'; + <div class="centre"> + <input tabindex="4" type="submit" name="ShowResults" value="' . _('Show Daily Sales For The Selected Month') . '" /> + </div> + </form> + <br />'; /*Now get and display the sales data returned */ if (mb_strpos($EndDateSQL,'/')) { $Date_Array = explode('/',$EndDateSQL); @@ -92,9 +99,8 @@ $ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg($db); $SalesResult = DB_query($sql, $db,$ErrMsg); -echo '<table cellpadding=2 class=selection>'; - -echo'<tr> +echo '<table class="selection"> + <tr> <th>' . _('Sunday') . '</th> <th>' . _('Monday') . '</th> <th>' . _('Tuesday') . '</th> @@ -176,7 +182,7 @@ $AverageDailySales = 0; } -echo '<th colspan=7>' . _('Total Sales for month') . ': ' . locale_number_format($CumulativeTotalSales,0) . ' ' . _('GP%') . ': ' . locale_number_format($AverageGPPercent,1) . '% ' . _('Avg Daily Sales') . ': ' . locale_number_format($AverageDailySales,0) . '</th></tr>'; +echo '<th colspan="7">' . _('Total Sales for month') . ': ' . locale_number_format($CumulativeTotalSales,0) . ' ' . _('GP%') . ': ' . locale_number_format($AverageGPPercent,1) . '% ' . _('Avg Daily Sales') . ': ' . locale_number_format($AverageDailySales,0) . '</th></tr>'; echo '</table>'; Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/DebtorsAtPeriodEnd.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -125,7 +125,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - if (!isset($_POST['FromCriteria']) || !isset($_POST['ToCriteria'])) { + if (!isset($_POST['FromCriteria']) OR !isset($_POST['ToCriteria'])) { /*if $FromCriteria is not set then show a form to allow input */ @@ -134,13 +134,13 @@ 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="1"></td> + <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="1" /></td> </tr>'; echo '<tr><td>' . _('To Customer Code') . ':</td> - <td><input tabindex=2 type="text" maxlength=6 size=7 name="ToCriteria" value="zzzzzz"></td></tr>'; + <td><input tabindex="2" type="text" maxlength="6" size="7" name="ToCriteria" value="zzzzzz" /></td></tr>'; echo '<tr><td>' . _('Balances As At') . ':</td> - <td><select tabindex=3 name="PeriodEnd">'; + <td><select tabindex="3" name="PeriodEnd">'; $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db,_('Could not retrieve period data because'),_('The SQL that failed to get the period data was')); Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/Stocks.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -778,7 +778,10 @@ $_POST['TaxCat'] = $myrow['taxcatid']; $_POST['DecimalPlaces'] = $myrow['decimalplaces']; $_POST['NextSerialNo'] = $myrow['nextserialno']; + $_POST['Pansize'] = $myrow['pansize']; + $_POST['ShrinkFactor'] = $myrow['shrinkfactor']; + echo '<tr><td>' . _('Item Code') . ':</td> <td>'.$StockID.'</td> </tr>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/doc/Change.log 2011-10-30 09:17:27 UTC (rev 4738) @@ -1,5 +1,6 @@ webERP Change Log +30/10/11 Exson: Modification to Stocks.php to avoid losing PanSize and ShrinkFactor 30/10/11 Phil: Made it so a saleman cannot be deleted if a user is setup referring only to this salesperson 29/10/11 High-Tech Bridge SA Security Research Lab <adv...@ht...> - sanitising $_SERVER['PHP_SELF'] and unquoted sql in reportwriter/FormMaker.php and reportwriter/ReportMaker.php 15/10/11 Phil: Tried to get correct characters for each language's thousands separator and decimal point in includes/LanguagesArray.php @@ -88,8 +89,8 @@ 28/6/11 Exson: MRPDemands.php links missing ? now fixed - script fixed for quoting variable name CamelCasing 27/6/11 Exson: MRP.php fixed modulus arithmetic that prevented suggesting production quantities where the quantity was less than 1 - the calculation using PanSize should round up to the nearest whole unit to manufacture 26/6/11 Phil: Fixed reference to $_POST['StockID'] in WorkOrderCosting.php when updating the new weighted average cost -26/6/11 Phil: Went back to no locale_number_formatting on PurchData.php -26/6/11 Phil: Went back to no locale_number_formatting on PO_Items.php price and quantity - Brian May still reporting issues +26/6/11 Phil: Went back to no number_formatting on PurchData.php +26/6/11 Phil: Went back to no number_formatting on PO_Items.php price and quantity - Brian May still reporting issues 25/6/11 Phil: Made PO_PDFPurchOrder.php have the description of the order item run over several lines where it exceeds the width of the space allowed for it 22/6/11 Phil: Added message to AccountGroups.php to show that child account groups cannot have changes to their account section, their profit and loss or balance sheet and sequence in TB as these properties belong only to parent account groups and are inherited by the kids 23/6/11 Phil: SelectOrderItems.php includes/DefineCartClass.php repaired credit checks @@ -143,7 +144,6 @@ 28/5/11 Phil: Reported by Daniel Brewer Fix SelectSalesOrder.php creation of PO with excluding redundant fields in purchorderdetails that were taken out. 28/5/11 Exson: UpdateCurrencyRateDaily was set to 1 when the option to enable it was clicked - should have been set to today's date in SystemParameters - fixed. Now no error reported bu ConvertSQLDate function when user enables update currencies daily. - 26/5/11 Version 4.04 Release 26/5/11 Ricard: require securitytoken 9 to allow user to see purchasing data in SelectProduct.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-30 09:17:35
|
Revision: 4738 http://web-erp.svn.sourceforge.net/web-erp/?rev=4738&view=rev Author: daintree Date: 2011-10-30 09:17:27 +0000 (Sun, 30 Oct 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/CustomerReceipt.php trunk/CustomerTransInquiry.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/DailySalesInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/Stocks.php trunk/doc/Change.log Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/BOMExtendedQty.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -77,7 +77,7 @@ bom.effectiveafter, bom.effectiveto, (" . filter_number_format($_POST['Quantity']) . " * bom.quantity) as extendedqpa - FROM bom + FROM bom WHERE bom.parent ='" . $_POST['Part'] . "' AND bom.effectiveto >= NOW() AND bom.effectiveafter <= NOW()"; @@ -188,11 +188,13 @@ GROUP BY purchorderdetails.itemcode) AS poqty, (SELECT SUM(woitems.qtyreqd - woitems.qtyrecd) as netwoqty - FROM woitems + FROM woitems INNER JOIN workorders + ON woitems.wo = workorders.wo WHERE woitems.stockid = tempbom.component + AND workorders.closed=0 GROUP BY woitems.stockid) AS woqty - FROM tempbom,stockmaster - WHERE tempbom.component = stockmaster.stockid + FROM tempbom INNER JOIN stockmaster + ON tempbom.component = stockmaster.stockid GROUP BY tempbom.component, stockmaster.description, stockmaster.decimalplaces, Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/CustomerReceipt.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -52,7 +52,7 @@ $_SESSION['ReceiptBatch']->BankAccountName = $myrow[0]; $_SESSION['ReceiptBatch']->AccountCurrency=$myrow[1]; unset($result); - } elseif (DB_num_rows($result)==0 and !$BankAccountEmpty){ + } elseif (DB_num_rows($result)==0 AND !$BankAccountEmpty){ prnMsg( _('The bank account number') . ' ' . $_POST['BankAccount'] . ' ' . _('is not set up as a bank account'),'error'); include ('includes/footer.inc'); exit; @@ -62,7 +62,7 @@ $_POST['DateBanked'] = Date($_SESSION['DefaultDateFormat']); } $_SESSION['ReceiptBatch']->DateBanked = $_POST['DateBanked']; - if (isset($_POST['ExRate']) and $_POST['ExRate']!=''){ + if (isset($_POST['ExRate']) AND $_POST['ExRate']!=''){ if (is_numeric(filter_number_format($_POST['ExRate']))){ $_SESSION['ReceiptBatch']->ExRate = filter_number_format($_POST['ExRate']); } else { Modified: trunk/CustomerTransInquiry.php =================================================================== --- trunk/CustomerTransInquiry.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/CustomerTransInquiry.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -6,18 +6,20 @@ $title = _('Customer Transactions Inquiry'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Transaction Inquiry') . '" alt="" />' . ' ' . _('Transaction Inquiry') . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Transaction Inquiry') . '" alt="" />' . ' ' . _('Transaction Inquiry') . ' + </p>'; echo '<div class="page_help_text">' . _('Choose which type of transaction to report on.') . '</div> <br />'; -echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding=2 class=selection><tr>'; +echo '<table class="selection"> + <tr> + <td>' . _('Type') . ':</td> + <td><select tabindex="1" name="TransType"> '; -echo '<td>' . _('Type') . ':</td> - <td><select tabindex="1" name="TransType"> '; - $sql = "SELECT typeid, typename FROM systypes @@ -35,7 +37,7 @@ echo '<option value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } else { - echo "<option Value='" . $myrow['typeid'] . "'>" . $myrow['typename']; + echo '<option Value="' . $myrow['typeid'] . '">' . $myrow['typename'] . '</option>'; } } echo '</select></td>'; @@ -46,31 +48,38 @@ if (!isset($_POST['ToDate'])){ $_POST['ToDate'] = Date($_SESSION['DefaultDateFormat']); } -echo '<td>' . _('From') . ':</td><td><input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="TEXT" name="FromDate" maxlength="10" size="11" VALUE="' . $_POST['FromDate'] . '"></td>'; -echo '<td>' . _('To') . ':</td><td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="TEXT" name="ToDate" maxlength="10" size="11" VALUE="' . $_POST['ToDate'] . '"></td>'; +echo '<td>' . _('From') . ':</td> + <td><input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> + <td>' . _('To') . ':</td> + <td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td>'; -echo "</tr></table><br /><div class='centre'><input tabindex=4 type=submit name='ShowResults' VALUE='" . _('Show Transactions') . "'>"; +echo '</tr></table> + <br /> + <div class="centre"> + <input tabindex="4" type="submit" name="ShowResults" value="' . _('Show Transactions') . '"> + </div> + </form>'; -echo '</form></div>'; - if (isset($_POST['ShowResults']) && $_POST['TransType'] != ''){ $SQL_FromDate = FormatDateForSQL($_POST['FromDate']); $SQL_ToDate = FormatDateForSQL($_POST['ToDate']); $sql = "SELECT transno, - trandate, - debtortrans.debtorno, - branchcode, - reference, - invtext, - order_, - rate, - ovamount+ovgst+ovfreight+ovdiscount as totalamt, - currcode, - typename - FROM debtortrans - INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN systypes ON debtortrans.type = systypes.typeid - WHERE "; + trandate, + debtortrans.debtorno, + branchcode, + reference, + invtext, + order_, + debtortrans.rate, + ovamount+ovgst+ovfreight+ovdiscount as totalamt, + currcode, + typename, + decimalplaces AS currdecimalplaces + FROM debtortrans + INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev + INNER JOIN systypes ON debtortrans.type = systypes.typeid + WHERE "; $sql = $sql . "trandate >='" . $SQL_FromDate . "' AND trandate <= '" . $SQL_ToDate . "'"; if ($_POST['TransType']!='All') { @@ -82,21 +91,23 @@ $DbgMsg = _('The SQL that failed was'); $TransResult = DB_query($sql, $db,$ErrMsg,$DbgMsg); - echo '<br /><table cellpadding=2 class=selection>'; + echo '<br /> + <table class="selection">'; - $tableheader = "<tr> - <th>" . _('Type') . "</th> - <th>" . _('Number') . "</th> - <th>" . _('Date') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Branch') . "</th> - <th>" . _('Reference') . "</th> - <th>" . _('Comments') . "</th> - <th>" . _('Order') . "</th> - <th>" . _('Ex Rate') . "</th> - <th>" . _('Amount') . "</th> - <th>" . _('Currency') . '</th></tr>'; - echo $tableheader; + $TableHeader = '<tr> + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Comments') . '</th> + <th>' . _('Order') . '</th> + <th>' . _('Ex Rate') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Currency') . '</th> + </tr>'; + echo $TableHeader; $RowCounter = 1; $k = 0; //row colour counter @@ -111,70 +122,69 @@ $k++; } - $format_base = "<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td width='200'>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td>%s</td>"; + $format_base = '<td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td width="200">%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td>%s</td>'; if ($_POST['TransType']==10){ /* invoices */ - printf("$format_base - <td><a target='_blank' href='%s/PrintCustTrans.php?%&FromTransNo=%s&InvOrCredit=Invoice'><IMG SRC='%s' title='" . _('Click to preview the invoice') . "'></a></td> - </tr>", - $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['reference'], - $myrow['invtext'], - $myrow['order_'], - $myrow['rate'], - locale_number_format($myrow['totalamt'],2), - $myrow['currcode'], - $rootpath, - SID, - $myrow['transno'], - $rootpath.'/css/'.$theme.'/images/preview.gif'); + printf($format_base . + '<td><a target="_blank" href=%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Invoice"><img src="%s" title="' . _('Click to preview the invoice') . '"></a></td> + </tr>', + $myrow['typename'], + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + $myrow['debtorno'], + $myrow['branchcode'], + $myrow['reference'], + $myrow['invtext'], + $myrow['order_'], + locale_number_format($myrow['rate'],6), + locale_number_format($myrow['totalamt'],$myrow['currdecimalplaces']), + $myrow['currcode'], + $rootpath, + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images/preview.gif'); + } elseif ($_POST['TransType']==11){ /* credit notes */ - printf("$format_base - <td><a target='_blank' href='%s/PrintCustTrans.php?%s&FromTransNo=%s&InvOrCredit=Credit'><IMG SRC='%s' title='" . _('Click to preview the credit') . "'></a></td> - </tr>", - $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['reference'], - $myrow['invtext'], - $myrow['order_'], - $myrow['rate'], - locale_number_format($myrow['totalamt'],2), - $myrow['currcode'], - $rootpath, - SID, - $myrow['transno'], - $rootpath.'/css/'.$theme.'/images/preview.gif'); + printf($format_base . + '<td><a target="_blank" href="%s/PrintCustTrans.php?FromTransNo=%s&InvOrCredit=Credit"><img src="%s" title="' . _('Click to preview the credit') . '"></a></td> + </tr>', + $myrow['typename'], + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + $myrow['debtorno'], + $myrow['branchcode'], + $myrow['reference'], + $myrow['invtext'], + $myrow['order_'], + locale_number_format($myrow['rate'],6), + locale_number_format($myrow['totalamt'],$myrow['currdecimalplaces']), + $myrow['currcode'], + $rootpath, + $myrow['transno'], + $rootpath.'/css/'.$theme.'/images/preview.gif'); } else { /* otherwise */ - printf("$format_base</tr>", - $myrow['typename'], - $myrow['transno'], - ConvertSQLDate($myrow['trandate']), - $myrow['debtorno'], - $myrow['branchcode'], - $myrow['reference'], - $myrow['invtext'], - $myrow['order_'], - $myrow['rate'], - locale_number_format($myrow['totalamt'],2), - $myrow['currcode']); + printf($format_base . '</tr>', + $myrow['typename'], + $myrow['transno'], + ConvertSQLDate($myrow['trandate']), + $myrow['debtorno'], + $myrow['branchcode'], + $myrow['reference'], + $myrow['invtext'], + $myrow['order_'], + locale_number_format($myrow['rate'],6), + locale_number_format($myrow['totalamt'],$myrow['currdecimalplaces']), + $myrow['currcode']); } } Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/Customers.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -10,8 +10,10 @@ include('includes/SQL_CommonFunctions.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . - '" alt="" />' . ' ' . _('Customer Maintenance') . '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . + '" alt="" />' . ' ' . _('Customer Maintenance') . ' + </p>'; if (isset($Errors)) { unset($Errors); @@ -84,37 +86,12 @@ prnMsg( _('The Line 6 of the address must be fifteen characters or less long'),'error'); $Errors[$i] = 'Address6'; $i++; - } - elseif (mb_strlen($_POST['Phone']) >25) { + } elseif (!is_numeric(filter_number_format($_POST['CreditLimit']))) { $InputError = 1; - prnMsg(_('The telephone number must be 25 characters or less long'),'error'); - $Errors[$i] = 'Telephone'; - $i++; - } - elseif (mb_strlen($_POST['Fax']) >25) { - $InputError = 1; - prnMsg(_('The fax number must be 25 characters or less long'),'error'); - $Errors[$i] = 'Fax'; - $i++; - } - elseif (mb_strlen($_POST['Email']) >55) { - $InputError = 1; - prnMsg(_('The email address must be 55 characters or less long'),'error'); - $Errors[$i] = 'Email'; - $i++; - } - elseif (mb_strlen($_POST['Email'])>0 and !IsEmailAddress($_POST['Email'])) { - $InputError = 1; - prnMsg(_('The email address is not correctly formed'),'error'); - $Errors[$i] = 'Email'; - $i++; - } - elseif (!is_numeric($_POST['CreditLimit'])) { - $InputError = 1; prnMsg( _('The credit limit must be numeric'),'error'); $Errors[$i] = 'CreditLimit'; $i++; - } elseif (!is_numeric($_POST['PymtDiscount'])) { + } elseif (!is_numeric(filter_number_format($_POST['PymtDiscount']))) { $InputError = 1; prnMsg( _('The payment discount must be numeric'),'error'); $Errors[$i] = 'PymtDiscount'; @@ -124,22 +101,22 @@ prnMsg( _('The customer since field must be a date in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); $Errors[$i] = 'ClientSince'; $i++; - } elseif (!is_numeric($_POST['Discount'])) { + } elseif (!is_numeric(filter_number_format($_POST['Discount']))) { $InputError = 1; prnMsg( _('The discount percentage must be numeric'),'error'); $Errors[$i] = 'Discount'; $i++; - } elseif ((double) $_POST['CreditLimit'] <0) { + } elseif (filter_number_format($_POST['CreditLimit']) <0) { $InputError = 1; prnMsg( _('The credit limit must be a positive number'),'error'); $Errors[$i] = 'CreditLimit'; $i++; - } elseif (((double) $_POST['PymtDiscount']> 10) OR ((double) $_POST['PymtDiscount'] <0)) { + } elseif ((filter_number_format($_POST['PymtDiscount'])> 10) OR (filter_number_format($_POST['PymtDiscount']) <0)) { $InputError = 1; prnMsg( _('The payment discount is expected to be less than 10% and greater than or equal to 0'),'error'); $Errors[$i] = 'PymtDiscount'; $i++; - } elseif (((double) $_POST['Discount']> 100) OR ((double) $_POST['Discount'] <0)) { + } elseif ((filter_number_format($_POST['Discount'])> 100) OR (filter_number_format($_POST['Discount']) <0)) { $InputError = 1; prnMsg( _('The discount is expected to be less than 100% and greater than or equal to 0'),'error'); $Errors[$i] = 'Discount'; @@ -171,10 +148,10 @@ clientsince='" . $SQL_ClientSince. "', holdreason='" . $_POST['HoldReason'] . "', paymentterms='" . $_POST['PaymentTerms'] . "', - discount='" . ($_POST['Discount'])/100 . "', + discount='" . filter_number_format($_POST['Discount'])/100 . "', discountcode='" . $_POST['DiscountCode'] . "', - pymtdiscount='" . ($_POST['PymtDiscount'])/100 . "', - creditlimit='" . $_POST['CreditLimit'] . "', + pymtdiscount='" . filter_number_format($_POST['PymtDiscount'])/100 . "', + creditlimit='" . filter_number_format($_POST['CreditLimit']) . "', salestype = '" . $_POST['SalesType'] . "', invaddrbranch='" . $_POST['AddrInvBranch'] . "', taxref='" . $_POST['TaxRef'] . "', @@ -201,10 +178,10 @@ clientsince='" . $SQL_ClientSince . "', holdreason='" . $_POST['HoldReason'] . "', paymentterms='" . $_POST['PaymentTerms'] . "', - discount='" . ($_POST['Discount'])/100 . "', + discount='" . filter_number_format($_POST['Discount'])/100 . "', discountcode='" . $_POST['DiscountCode'] . "', - pymtdiscount='" . ($_POST['PymtDiscount'])/100 . "', - creditlimit='" . $_POST['CreditLimit'] . "', + pymtdiscount='" . filter_number_format($_POST['PymtDiscount'])/100 . "', + creditlimit='" . filter_number_format($_POST['CreditLimit']) . "', salestype = '" . $_POST['SalesType'] . "', invaddrbranch='" . $_POST['AddrInvBranch'] . "', taxref='" . $_POST['TaxRef'] . "', @@ -266,10 +243,10 @@ '" . $SQL_ClientSince . "', '" . $_POST['HoldReason'] . "', '" . $_POST['PaymentTerms'] . "', - '" . ($_POST['Discount'])/100 . "', + '" . filter_number_format($_POST['Discount'])/100 . "', '" . $_POST['DiscountCode'] . "', - '" . ($_POST['PymtDiscount'])/100 . "', - '" . $_POST['CreditLimit'] . "', + '" . filter_number_format($_POST['PymtDiscount'])/100 . "', + '" . filter_number_format($_POST['CreditLimit']) . "', '" . $_POST['SalesType'] . "', '" . $_POST['AddrInvBranch'] . "', '" . $_POST['TaxRef'] . "', @@ -577,8 +554,9 @@ $myrow = DB_fetch_row($CurrResult); $_POST['CurrCode'] = $myrow[0]; } - echo '<tr><td>' . _('Customer Currency') . ':</td> - <td><select tabindex=17 name="CurrCode">'; + echo '<tr> + <td>' . _('Customer Currency') . ':</td> + <td><select tabindex="17" name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode']==$myrow['currabrev']){ echo '<option selected value='. $myrow['currabrev'] . '>' . $myrow['currency'] . '</option>'; @@ -588,28 +566,34 @@ } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } - echo '<tr><td>' . _('Customer PO Line on SO') . ':</td> + echo '<tr> + <td>' . _('Customer PO Line on SO') . ':</td> <td><select tabindex="18" name="CustomerPOLine"> <option selected value=0>' . _('No') . '</option> <option value=1>' . _('Yes') . '</option> </select> </td> - </tr>'; - - echo '<tr><td>' . _('Invoice Addressing') . ':</td> + </tr> + <tr> + <td>' . _('Invoice Addressing') . ':</td> <td><select tabindex="19" name="AddrInvBranch"> <option selected value=0>' . _('Address to HO') . '</option> <option value=1>' . _('Address to Branch') . '</option> </select> </td> - </tr>'; - - echo'</table></td></tr></table>'; + </tr> + </table></td> + </tr> + </table>'; if ($DataError ==0){ - echo '<br /><div class="centre"><input tabindex=20 type="Submit" name="submit" value="' . _('Add New Customer') . '"> <input tabindex=21 type="submit" action="Reset" value="' . _('Reset') . '"></div>'; + echo '<br /> + <div class="centre"> + <input tabindex="20" type="submit" name="submit" value="' . _('Add New Customer') . '" /> <input tabindex="21" type="submit" action="Reset" value="' . _('Reset') . '" /> + </div>'; } echo '</form>'; @@ -620,34 +604,34 @@ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection cellspacing=4> - <tr><td valign=top><table class=selection>'; + echo '<table class="selection"> + <tr><td valign="top"><table class="selection">'; if (!isset($_POST['New'])) { $sql = "SELECT debtorsmaster.debtorno, - name, - address1, - address2, - address3, - address4, - address5, - address6, - currcode, - salestype, - clientsince, - holdreason, - paymentterms, - discount, - discountcode, - pymtdiscount, - creditlimit, - invaddrbranch, - taxref, - customerpoline, - typeid + name, + address1, + address2, + address3, + address4, + address5, + address6, + currcode, + salestype, + clientsince, + holdreason, + paymentterms, + discount, + discountcode, + pymtdiscount, + creditlimit, + invaddrbranch, + taxref, + customerpoline, + typeid FROM debtorsmaster - WHERE debtorsmaster.debtorno = '" . $DebtorNo . "'"; - + WHERE debtorsmaster.debtorno = '" . $DebtorNo . "'"; + $ErrMsg = _('The customer details could not be retrieved because'); $result = DB_query($sql,$db,$ErrMsg); @@ -672,10 +656,10 @@ $_POST['ClientSince'] = ConvertSQLDate($myrow['clientsince']); $_POST['HoldReason'] = $myrow['holdreason']; $_POST['PaymentTerms'] = $myrow['paymentterms']; - $_POST['Discount'] = $myrow['discount'] * 100; + $_POST['Discount'] = locale_number_format($myrow['discount'] * 100,2); $_POST['DiscountCode'] = $myrow['discountcode']; - $_POST['PymtDiscount'] = $myrow['pymtdiscount'] * 100; - $_POST['CreditLimit'] = $myrow['creditlimit']; + $_POST['PymtDiscount'] = locale_number_format($myrow['pymtdiscount'] * 100,2); + $_POST['CreditLimit'] = locale_number_format($myrow['creditlimit'],0); $_POST['InvAddrBranch'] = $myrow['invaddrbranch']; $_POST['TaxRef'] = $myrow['taxref']; $_POST['CustomerPOLine'] = $myrow['customerpoline']; @@ -690,34 +674,70 @@ /* if $AutoDebtorNo in config.php has not been set or if it has been set to a number less than one, then provide an input box for the DebtorNo to manually assigned */ if ($_SESSION['AutoDebtorNo']== 0 ) { - echo '<tr><td>' . _('Customer Code') . ':</td> - <td><input ' . (in_array('DebtorNo',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="DebtorNo" value="' . $DebtorNo . '" size=12 maxlength=10></td></tr>'; + echo '<tr> + <td>' . _('Customer Code') . ':</td> + <td><input ' . (in_array('DebtorNo',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="DebtorNo" value="' . $DebtorNo . '" size="12" maxlength="10" /></td></tr>'; } } if (isset($_GET['Modify'])) { - echo '<tr><td>' . _('Customer Name') . ':</td><td>' . $_POST['CustName'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td><td>' . $_POST['Address1'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td><td>' . $_POST['Address2'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td><td>' . $_POST['Address3'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td><td>' . $_POST['Address4'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 5') . ':</td><td>' . $_POST['Address5'] . '</td></tr>'; - echo '<tr><td>' . _('Address Line 6') . ':</td><td>' . $_POST['Address6'] . '</td></tr>'; + echo '<tr> + <td>' . _('Customer Name') . ':</td> + <td>' . $_POST['CustName'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 1 (Street)') . ':</td> + <td>' . $_POST['Address1'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 2 (Suburb/City)') . ':</td> + <td>' . $_POST['Address2'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 3 (State/Province)') . ':</td> + <td>' . $_POST['Address3'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 4 (Postal Code)') . ':</td> + <td>' . $_POST['Address4'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 5') . ':</td> + <td>' . $_POST['Address5'] . '</td> + </tr> + <tr> + <td>' . _('Address Line 6') . ':</td> + <td>' . $_POST['Address6'] . '</td> + </tr>'; } else { - echo '<tr><td>' . _('Customer Name') . ':</td> - <td><input ' . (in_array('CustName',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="CustName" value="' . $_POST['CustName'] . '" size=42 maxlength=40></td></tr>'; - echo '<tr><td>' . _('Address Line 1 (Street)') . ':</td> - <td><input ' . (in_array('Address1',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address1" size=42 maxlength=40 value="' . $_POST['Address1'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 2 (Suburb/City)') . ':</td> - <td><input ' . (in_array('Address2',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address2" size=42 maxlength=40 value="' . $_POST['Address2'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 3 (State/Province)') . ':</td> - <td><input ' . (in_array('Address3',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address3" size=42 maxlength=40 value="' . $_POST['Address3'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 4 (Postal Code)') . ':</td> - <td><input ' . (in_array('Address4',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address4" size=42 maxlength=40 value="' . $_POST['Address4'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 5') . ':</td> - <td><input ' . (in_array('Address5',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address5" size=42 maxlength=40 value="' . $_POST['Address5'] . '"></td></tr>'; - echo '<tr><td>' . _('Address Line 6') . ':</td> - <td><input ' . (in_array('Address6',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Address6" size=42 maxlength=40 value="' . $_POST['Address6'] . '"></td></tr>'; + echo '<tr> + <td>' . _('Customer Name') . ':</td> + <td><input ' . (in_array('CustName',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="CustName" value="' . $_POST['CustName'] . '" size="42" maxlength="40" /></td> + </tr> + <tr> + <td>' . _('Address Line 1 (Street)') . ':</td> + <td><input ' . (in_array('Address1',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address1" size="42" maxlength="40" value="' . $_POST['Address1'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 2 (Suburb/City)') . ':</td> + <td><input ' . (in_array('Address2',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address2" size="42" maxlength="40" value="' . $_POST['Address2'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 3 (State/Province)') . ':</td> + <td><input ' . (in_array('Address3',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address3" size="42" maxlength="40" value="' . $_POST['Address3'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 4 (Postal Code)') . ':</td> + <td><input ' . (in_array('Address4',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address4" size="42" maxlength="40" value="' . $_POST['Address4'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 5') . ':</td> + <td><input ' . (in_array('Address5',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address5" size="42" maxlength="40" value="' . $_POST['Address5'] . '" /></td> + </tr> + <tr> + <td>' . _('Address Line 6') . ':</td> + <td><input ' . (in_array('Address6',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Address6" size="42" maxlength="40" value="' . $_POST['Address6'] . '" /></td> + </tr>'; } // Select sales types for drop down list @@ -743,12 +763,14 @@ if (isset($_GET['Modify'])) { $result=DB_query("SELECT typename FROM debtortype WHERE typeid='".$_POST['typeid']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Customer Type') . ':</td> + echo '<tr> + <td>' . _('Customer Type') . ':</td> <td>'.$myrow['typename'] . '</td> </tr>'; } else { $result=DB_query("SELECT typeid, typename FROM debtortype ORDER BY typename",$db); - echo '<tr><td>' . _('Customer Type') . ':</td> + echo '<tr> + <td>' . _('Customer Type') . ':</td> <td><select name="typeid">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['typeid']==$myrow['typeid']){ @@ -765,45 +787,73 @@ <tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> <td>' . $_POST['ClientSince'] . '</td></tr>'; - echo '</table></td><td><table class=selection>'; + echo '</table></td> + <td><table class="selection">'; - echo '<tr><td>' . _('Discount Percent') . ':</td> - <td>' . $_POST['Discount'] . '</td></tr>'; - echo '<tr><td>' . _('Discount Code') . ':</td> - <td>' . $_POST['DiscountCode'] . '</td></tr>'; - echo '<tr><td>' . _('Payment Discount Percent') . ':</td> - <td>' . $_POST['PymtDiscount'] . '</td></tr>'; - echo '<tr><td>' . _('Credit Limit') . ':</td> - <td>' . locale_number_format($_POST['CreditLimit'],2) . '</td></tr>'; - echo '<tr><td>' . _('Tax Reference') . ':</td> - <td>' . $_POST['TaxRef'] . '</td></tr>'; + echo '<tr> + <td>' . _('Discount Percent') . ':</td> + <td>' . $_POST['Discount'] . '</td> + </tr> + <tr> + <td>' . _('Discount Code') . ':</td> + <td>' . $_POST['DiscountCode'] . '</td> + </tr> + <tr> + <td>' . _('Payment Discount Percent') . ':</td> + <td>' . $_POST['PymtDiscount'] . '</td> + </tr> + <tr> + <td>' . _('Credit Limit') . ':</td> + <td>' . $_POST['CreditLimit'] . '</td> + </tr> + <tr> + <td>' . _('Tax Reference') . ':</td> + <td>' . $_POST['TaxRef'] . '</td> + </tr>'; } else { - echo '</select></td></tr> - <tr><td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input ' . (in_array('ClientSince',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" size=11 maxlength=10 value=' . $_POST['ClientSince'] . '></td></tr>'; + echo '</select></td> + </tr> + <tr> + <td>' . _('Customer Since') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('ClientSince',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="ClientSince" size="11" maxlength="10" value="' . $_POST['ClientSince'] . '" /></td> + </tr> + </table></td> + <td><table class="selection">'; - echo '</table></td><td><table class="selection">'; - - echo '<tr><td>' . _('Discount Percent') . ':</td> - <td><input type="Text" name="Discount" class=number size=5 maxlength=4 value=' . $_POST['Discount'] . '></td></tr>'; - echo '<tr><td>' . _('Discount Code') . ':</td> - <td><input ' . (in_array('DiscountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="DiscountCode" size=3 maxlength=2 value="' . $_POST['DiscountCode'] . '"></td></tr>'; - echo '<tr><td>' . _('Payment Discount Percent') . ':</td> - <td><input ' . (in_array('PymtDiscount',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class=number name="PymtDiscount" size=5 maxlength=4 value=' . $_POST['PymtDiscount'] . '></td></tr>'; - echo '<tr><td>' . _('Credit Limit') . ':</td> - <td><input ' . (in_array('CreditLimit',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" class=number name="CreditLimit" size=16 maxlength=14 value=' . $_POST['CreditLimit'] . '></td></tr>'; - echo '<tr><td>' . _('Tax Reference') . ':</td> - <td><input type="Text" name="TaxRef" size=22 maxlength=20 value="' . $_POST['TaxRef'] . '"></td></tr>'; + echo '<tr> + <td>' . _('Discount Percent') . ':</td> + <td><input type="text" name="Discount" class="number" size="5" maxlength="4" value="' . $_POST['Discount'] . '" /></td> + </tr> + <tr> + <td>' . _('Discount Code') . ':</td> + <td><input ' . (in_array('DiscountCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="DiscountCode" size="3" maxlength="2" value="' . $_POST['DiscountCode'] . '"></td> + </tr> + <tr> + <td>' . _('Payment Discount Percent') . ':</td> + <td><input ' . (in_array('PymtDiscount',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="PymtDiscount" size="5" maxlength="4" value="' . $_POST['PymtDiscount'] . '"></td> + </tr> + <tr> + <td>' . _('Credit Limit') . ':</td> + <td><input ' . (in_array('CreditLimit',$Errors) ? 'class="inputerror"' : '' ) .' type="text" class="number" name="CreditLimit" size="16" maxlength="14" value="' . $_POST['CreditLimit'] . '" /></td> + </tr> + <tr> + <td>' . _('Tax Reference') . ':</td> + <td><input type="text" name="TaxRef" size="22" maxlength="20" value="' . $_POST['TaxRef'] . '" /></td> + </tr>'; } if (isset($_GET['Modify'])) { $result=DB_query("SELECT terms FROM paymentterms WHERE termsindicator='".$_POST['PaymentTerms']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Payment Terms') . ':</td><td>' . $myrow['terms'] . '</td></tr>'; + echo '<tr> + <td>' . _('Payment Terms') . ':</td> + <td>' . $myrow['terms'] . '</td> + </tr>'; } else { $result=DB_query("SELECT terms, termsindicator FROM paymentterms",$db); - echo '<tr><td>' . _('Payment Terms') . ':</td> - <td><select name="PaymentTerms">'; + echo '<tr> + <td>' . _('Payment Terms') . ':</td> + <td><select name="PaymentTerms">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['PaymentTerms']==$myrow['termsindicator']){ echo '<option selected value="'. $myrow['termsindicator'] . '">' . $myrow['terms'] . '</option>'; @@ -812,18 +862,22 @@ } } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (isset($_GET['Modify'])) { $result=DB_query("SELECT reasondescription FROM holdreasons WHERE reasoncode='".$_POST['HoldReason']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Credit Status') . ':</td> - <td>'.$myrow['reasondescription'] . '</td></tr>'; + echo '<tr> + <td>' . _('Credit Status') . ':</td> + <td>'.$myrow['reasondescription'] . '</td> + </tr>'; } else { $result=DB_query("SELECT reasoncode, reasondescription FROM holdreasons",$db); - echo '<tr><td>' . _('Credit Status') . ':</td> - <td><select name="HoldReason">'; + echo '<tr> + <td>' . _('Credit Status') . ':</td> + <td><select name="HoldReason">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['HoldReason']==$myrow['reasoncode']){ echo '<option selected value="'. $myrow['reasoncode'] . '">' . $myrow['reasondescription'] . '</option>'; @@ -832,18 +886,21 @@ } } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (isset($_GET['Modify'])) { $result=DB_query("SELECT currency FROM currencies WHERE currabrev='".$_POST['CurrCode']."'",$db); $myrow=DB_fetch_array($result); - echo '<tr><td>' . _('Credit Status') . ':</td> + echo '<tr> + <td>' . _('Credit Status') . ':</td> <td>' . $myrow['currency'] . '</td></tr>'; } else { $result=DB_query("SELECT currency, currabrev FROM currencies",$db); - echo '<tr><td>' . _('Customers Currency') . ':</td> - <td><select name="CurrCode">'; + echo '<tr> + <td>' . _('Customers Currency') . ':</td> + <td><select name="CurrCode">'; while ($myrow = DB_fetch_array($result)) { if ($_POST['CurrCode']==$myrow['currabrev']){ echo '<option selected value="'. $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; @@ -852,22 +909,26 @@ } } //end while loop DB_data_seek($result,0); - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } /*added lines 8/23/2007 by Morris Kelly to get po line parameter Y/N*/ if (isset($_GET['Modify'])) { if ($_POST['CustomerPOLine']==0){ - echo '<tr><td>' . _('Credit Status') . ':</td> + echo '<tr> + <td>' . _('Credit Status') . ':</td> <td>'._('No') . '</td> </tr>'; } else { - echo '<tr><td>' . _('Credit Status') . ':</td> + echo '<tr> + <td>' . _('Credit Status') . ':</td> <td>'._('Yes') . '</td> - </tr>'; + </tr>'; } } else { - echo '<tr><td>' . _('Require Customer PO Line on SO') . ':</td> - <td><select name="CustomerPOLine">'; + echo '<tr> + <td>' . _('Require Customer PO Line on SO') . ':</td> + <td><select name="CustomerPOLine">'; if ($_POST['CustomerPOLine']==0){ echo '<option selected value=0>' . _('No') . '</option>'; echo '<option value=1>' . _('Yes') . '</option>'; @@ -875,18 +936,26 @@ echo '<option value=0>' . _('No') . '</option>'; echo '<option selected value=1>' . _('Yes') . '</option>'; } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (isset($_GET['Modify'])) { if ($_POST['CustomerPOLine']==0){ - echo '<tr><td>' . _('Invoice Addressing') . ':</td><td>'._('Address to HO').'</td></tr>'; + echo '<tr> + <td>' . _('Invoice Addressing') . ':</td> + <td>'._('Address to HO').'</td> + </tr>'; } else { - echo '<tr><td>' . _('Invoice Addressing') . ':</td><td>'._('Address to Branch').'</td></tr>'; + echo '<tr> + <td>' . _('Invoice Addressing') . ':</td> + <td>'._('Address to Branch').'</td> + </tr>'; } } else { - echo '<tr><td>' . _('Invoice Addressing') . ':</td> - <td><select name="AddrInvBranch">'; + echo '<tr> + <td>' . _('Invoice Addressing') . ':</td> + <td><select name="AddrInvBranch">'; if ($_POST['InvAddrBranch']==0){ echo '<option selected value=0>' . _('Address to HO') . '</option>'; echo '<option value=1>' . _('Address to Branch') . '</option>'; @@ -896,11 +965,12 @@ } } - echo '</select></td></tr> - </table></td></tr>'; - echo '<tr><td colspan=2>'; + echo '</select></td> + </tr> + </table></td> + </tr> + <tr><td colspan="2">'; - if (isset($_GET['delete'])) { //User hit delete link on customer contacts /*Process this first before showing remaining contacts */ $resultupcc = DB_query("DELETE FROM custcontacts @@ -925,20 +995,22 @@ echo '<table class=selection>'; if (isset($_GET['Modify'])) { echo '<tr> - <th>' . _('Name') . '</th> - <th>' . _('Role') . '</th> - <th>' . _('Phone Number') . '</th> - <th>' . _('Email') . '</th> - <th>' . _('Notes') . '</th></tr>'; + <th>' . _('Name') . '</th> + <th>' . _('Role') . '</th> + <th>' . _('Phone Number') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Notes') . '</th> + </tr>'; } else { echo '<tr> - <th>' . _('Name') . '</th> - <th>' . _('Role') . '</th> - <th>' . _('Phone Number') . '</th> - <th>' . _('Email') . '</th> - <th>' . _('Notes') . '</th> - <th>' . _('Edit') . '</th> - <th colspan=2><input type="Submit" name="AddContact" value="Add Contact"></th></tr>'; + <th>' . _('Name') . '</th> + <th>' . _('Role') . '</th> + <th>' . _('Phone Number') . '</th> + <th>' . _('Email') . '</th> + <th>' . _('Notes') . '</th> + <th>' . _('Edit') . '</th> + <th colspan="2"><input type="Submit" name="AddContact" value="' . _('Add Contact') . '" /></th> + </tr>'; } $k=0; //row colour counter @@ -953,51 +1025,54 @@ if (isset($_GET['Modify'])) { printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href=mailto:%s>%s</a></td> - <td>%s</td> - </tr>', - $myrow['contactname'], - $myrow['role'], - $myrow['phoneno'], - $myrow['email'], - $myrow['email'], - $myrow['notes']); + <td>%s</td> + <td>%s</td> + <td><a href=mailto:%s>%s</a></td> + <td>%s</td> + </tr>', + $myrow['contactname'], + $myrow['role'], + $myrow['phoneno'], + $myrow['email'], + $myrow['email'], + $myrow['notes']); } else { printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td><a href=mailto:%s>%s</a></td> - <td>%s</td> - <td><a href="AddCustomerContacts.php?Id=%s&DebtorNo=%s">'. _('Edit'). '</a></td> - <td><a href="%sID=%s&DebtorNo=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this customer contact?') . '\');">'. _('Delete'). '</a></td> - </tr>', - $myrow['contactname'], - $myrow['role'], - $myrow['phoneno'], - $myrow['email'], - $myrow['email'], - $myrow['notes'], - $myrow['contid'], - $myrow['debtorno'], - htmlspecialchars($_SERVER['PHP_SELF']) . '?', - $myrow['contid'], - $myrow['debtorno']); + <td>%s</td> + <td>%s</td> + <td><a href=mailto:%s>%s</a></td> + <td>%s</td> + <td><a href="AddCustomerContacts.php?Id=%s&DebtorNo=%s">'. _('Edit'). '</a></td> + <td><a href="%sID=%s&DebtorNo=%s&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this customer contact?') . '\');">'. _('Delete'). '</a></td> + </tr>', + $myrow['contactname'], + $myrow['role'], + $myrow['phoneno'], + $myrow['email'], + $myrow['email'], + $myrow['notes'], + $myrow['contid'], + $myrow['debtorno'], + htmlspecialchars($_SERVER['PHP_SELF']) . '?', + $myrow['contid'], + $myrow['debtorno']); } }//END WHILE LIST LOOP echo '</table>'; - - echo'</td></tr></table>'; if (isset($_POST['New']) and $_POST['New']) { - echo '<div class="centre"><input type="submit" name="submit" value="' . _('Add New Customer') . - '"> <input type=submit name="Reset" value="' . _('Reset') . '"></div></form>'; - } else if (!isset($_GET['Modify'])){ - echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Update Customer') . '">'; - echo ' <input type="Submit" name="delete" value="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');">'; + echo '<div class="centre"> + <input type="submit" name="submit" value="' . _('Add New Customer') . '" /> + <input type=submit name="Reset" value="' . _('Reset') . '" /> + </div> + </form>'; + } elseif (!isset($_GET['Modify'])){ + echo '<br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Update Customer') . '" /> + <input type="Submit" name="delete" value="' . _('Delete Customer') . '" onclick="return confirm(\'' . _('Are You Sure?') . '\');" />'; } echo '</div>'; Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/DailyBankTransactions.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -6,14 +6,16 @@ $title = _('Bank Transactions Inquiry'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . + _('Search') . '" alt="" />' . ' ' . $title.' + </p>'; if (!isset($_POST['Show'])) { echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection>'; + echo '<table class="selection">'; $SQL = "SELECT bankaccountname, bankaccounts.accountcode, @@ -26,7 +28,8 @@ $DbgMsg = _('The SQL used to retrieve the bank accounts was'); $AccountsResults = DB_query($SQL,$db,$ErrMsg,$DbgMsg); - echo '<tr><td>' . _('Bank Account') . ':</td> + echo '<tr> + <td>' . _('Bank Account') . ':</td> <td><select name="BankAccount">'; if (DB_num_rows($AccountsResults)==0){ @@ -49,18 +52,21 @@ } echo '</select></td></tr>'; } - echo '<tr><td>' . _('Transactions Dated From') . ':</td> - <td><input type="text" name="FromTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . - date($_SESSION['DefaultDateFormat']) . '"></td></tr> - <tr><td>' . _('Transactions Dated To') . ':</td> - <td><input type="text" name="ToTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength=10 size=11 - onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . - date($_SESSION['DefaultDateFormat']) . '"></td> - </tr>'; - - echo '</table>'; - echo '<br /><div class="centre"><input type="submit" name="Show" value="' . _('Show transactions'). '"></div>'; - echo '</form>'; + echo '<tr> + <td>' . _('Transactions Dated From') . ':</td> + <td><input type="text" name="FromTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . + date($_SESSION['DefaultDateFormat']) . '" /></td> + </tr> + <tr> + <td>' . _('Transactions Dated To') . ':</td> + <td><input type="text" name="ToTransDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" maxlength="10" size="11" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . date($_SESSION['DefaultDateFormat']) . '" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="Show" value="' . _('Show transactions'). '" /> + </div> + </form>'; } else { $SQL = "SELECT bankaccountname, bankaccounts.currcode, @@ -78,6 +84,7 @@ banktrans.exrate, banktrans.banktranstype, banktrans.transdate, + banktrans.ref, bankaccounts.bankaccountname, systypes.typename, systypes.typeid @@ -95,20 +102,20 @@ prnMsg(_('There are no transactions for this account in the date range selected'), 'info'); } else { $BankDetailRow = DB_fetch_array($BankResult); - echo '<table class=selection> + echo '<table class="selection"> <tr> - <th colspan=7><font size=3 color=blue>' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th> + <th colspan="8"><font size="3" color="blue">' . _('Account Transactions For').' '.$BankDetailRow['bankaccountname'].' '._('Between').' '.$_POST['FromTransDate'] . ' ' . _('and') . ' ' . $_POST['ToTransDate'] . '</font></th> + </tr> + <tr> + <th>' . ('Date') . '</th> + <th>'._('Transaction type').'</th> + <th>'._('Type').'</th> + <th>'._('Reference').'</th> + <th>'._('Amount in').' '.$BankDetailRow['currcode'].'</th> + <th>'._('Running Total').' '.$BankDetailRow['currcode'].'</th> + <th>'._('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> + <th>'._('Running Total').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> </tr>'; - echo '<tr> - <th>' . ('Date') . '</th> - <th>'._('Transaction type').'</th> - <th>'._('Type').'</th> - <th>'._('Reference').'</th> - <th>'._('Amount in').' '.$BankDetailRow['currcode'].'</th> - <th>'._('Running Total').' '.$BankDetailRow['currcode'].'</th> - <th>'._('Amount in').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> - <th>'._('Running Total').' '.$_SESSION['CompanyRecord']['currencydefault'].'</th> - </tr>'; $AccountCurrTotal=0; $LocalCurrTotal =0; @@ -123,10 +130,10 @@ <td>'.$myrow['typename'].'</td> <td>'.$myrow['banktranstype'].'</td> <td>'.$myrow['ref'].'</td> - <td class=number>'.locale_number_format($myrow['amount'],$BankDetailRow['decimalplaces']).'</td> - <td class=number>'.locale_number_format($AccountCurrTotal,$BankDetailRow['decimalplaces']).'</td> - <td class=number>'.locale_number_format($myrow['amount']/$myrow['functionalexrate']/$myrow['exrate'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> - <td class=number>'.locale_number_format($LocalCurrTotal,$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class="number">'.locale_number_format($myrow['amount'],$BankDetailRow['decimalplaces']).'</td> + <td class="number">'.locale_number_format($AccountCurrTotal,$BankDetailRow['decimalplaces']).'</td> + <td class="number">'.locale_number_format($myrow['amount']/$myrow['functionalexrate']/$myrow['exrate'],$_SESSION['CompanyRecord']['decimalplaces']).'</td> + <td class="number">'.locale_number_format($LocalCurrTotal,$_SESSION['CompanyRecord']['decimalplaces']).'</td> </tr>'; } echo '</table>'; Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/DailySalesInquiry.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -7,17 +7,21 @@ include('includes/header.inc'); include('includes/DefineCartClass.php'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Daily Sales') . '" alt="" />' . ' ' . _('Daily Sales') . '</p>'; -echo '<div class="page_help_text">' . _('Select the month to show daily sales for') . '</div><br />'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Daily Sales') . '" alt="" />' . ' ' . _('Daily Sales') . ' + </p>'; +echo '<div class="page_help_text">' . _('Select the month to show daily sales for') . '</div> + <br />'; echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding=2 class=selection><tr>'; +echo '<table class="selection"> + <tr> + <td>' . _('Month to Show') . ':</td> + <td><select tabindex="1" name="MonthToShow">'; -echo '<td>' . _('Month to Show') . ':</td><td><select tabindex=1 name="MonthToShow">'; - if (!isset($_POST['MonthToShow'])){ $_POST['MonthToShow'] = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); } @@ -29,11 +33,12 @@ echo '<option selected Value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; $EndDateSQL = $PeriodRow['lastdate_in_period']; } else { - echo '<option Value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; + echo '<option value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; } } -echo '</select></td>'; -echo '<td>' . _('Salesperson') . ':</td><td><select tabindex=2 name="Salesperson">'; +echo '</select></td> + <td>' . _('Salesperson') . ':</td> + <td><select tabindex="2" name="Salesperson">'; $SalespeopleResult = DB_query("SELECT salesmancode, salesmanname FROM salesman",$db); if (!isset($_POST['Salesperson'])){ @@ -55,9 +60,11 @@ echo '</tr> </table> <br /> - <div class="centre"><input tabindex=4 type=submit name="ShowResults" value="' . _('Show Daily Sales For The Selected Month') . '">'; -echo '</form></div>'; -echo '<br />'; + <div class="centre"> + <input tabindex="4" type="submit" name="ShowResults" value="' . _('Show Daily Sales For The Selected Month') . '" /> + </div> + </form> + <br />'; /*Now get and display the sales data returned */ if (mb_strpos($EndDateSQL,'/')) { $Date_Array = explode('/',$EndDateSQL); @@ -92,9 +99,8 @@ $ErrMsg = _('The sales data could not be retrieved because') . ' - ' . DB_error_msg($db); $SalesResult = DB_query($sql, $db,$ErrMsg); -echo '<table cellpadding=2 class=selection>'; - -echo'<tr> +echo '<table class="selection"> + <tr> <th>' . _('Sunday') . '</th> <th>' . _('Monday') . '</th> <th>' . _('Tuesday') . '</th> @@ -176,7 +182,7 @@ $AverageDailySales = 0; } -echo '<th colspan=7>' . _('Total Sales for month') . ': ' . locale_number_format($CumulativeTotalSales,0) . ' ' . _('GP%') . ': ' . locale_number_format($AverageGPPercent,1) . '% ' . _('Avg Daily Sales') . ': ' . locale_number_format($AverageDailySales,0) . '</th></tr>'; +echo '<th colspan="7">' . _('Total Sales for month') . ': ' . locale_number_format($CumulativeTotalSales,0) . ' ' . _('GP%') . ': ' . locale_number_format($AverageGPPercent,1) . '% ' . _('Avg Daily Sales') . ': ' . locale_number_format($AverageDailySales,0) . '</th></tr>'; echo '</table>'; Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/DebtorsAtPeriodEnd.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -125,7 +125,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - if (!isset($_POST['FromCriteria']) || !isset($_POST['ToCriteria'])) { + if (!isset($_POST['FromCriteria']) OR !isset($_POST['ToCriteria'])) { /*if $FromCriteria is not set then show a form to allow input */ @@ -134,13 +134,13 @@ 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="1"></td> + <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="1" /></td> </tr>'; echo '<tr><td>' . _('To Customer Code') . ':</td> - <td><input tabindex=2 type="text" maxlength=6 size=7 name="ToCriteria" value="zzzzzz"></td></tr>'; + <td><input tabindex="2" type="text" maxlength="6" size="7" name="ToCriteria" value="zzzzzz" /></td></tr>'; echo '<tr><td>' . _('Balances As At') . ':</td> - <td><select tabindex=3 name="PeriodEnd">'; + <td><select tabindex="3" name="PeriodEnd">'; $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db,_('Could not retrieve period data because'),_('The SQL that failed to get the period data was')); Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/Stocks.php 2011-10-30 09:17:27 UTC (rev 4738) @@ -778,7 +778,10 @@ $_POST['TaxCat'] = $myrow['taxcatid']; $_POST['DecimalPlaces'] = $myrow['decimalplaces']; $_POST['NextSerialNo'] = $myrow['nextserialno']; + $_POST['Pansize'] = $myrow['pansize']; + $_POST['ShrinkFactor'] = $myrow['shrinkfactor']; + echo '<tr><td>' . _('Item Code') . ':</td> <td>'.$StockID.'</td> </tr>'; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-10-30 05:50:51 UTC (rev 4737) +++ trunk/doc/Change.log 2011-10-30 09:17:27 UTC (rev 4738) @@ -1,5 +1,6 @@ webERP Change Log +30/10/11 Exson: Modification to Stocks.php to avoid losing PanSize and ShrinkFactor 30/10/11 Phil: Made it so a saleman cannot be deleted if a user is setup referring only to this salesperson 29/10/11 High-Tech Bridge SA Security Research Lab <adv...@ht...> - sanitising $_SERVER['PHP_SELF'] and unquoted sql in reportwriter/FormMaker.php and reportwriter/ReportMaker.php 15/10/11 Phil: Tried to get correct characters for each language's thousands separator and decimal point in includes/LanguagesArray.php @@ -88,8 +89,8 @@ 28/6/11 Exson: MRPDemands.php links missing ? now fixed - script fixed for quoting variable name CamelCasing 27/6/11 Exson: MRP.php fixed modulus arithmetic that prevented suggesting production quantities where the quantity was less than 1 - the calculation using PanSize should round up to the nearest whole unit to manufacture 26/6/11 Phil: Fixed reference to $_POST['StockID'] in WorkOrderCosting.php when updating the new weighted average cost -26/6/11 Phil: Went back to no locale_number_formatting on PurchData.php -26/6/11 Phil: Went back to no locale_number_formatting on PO_Items.php price and quantity - Brian May still reporting issues +26/6/11 Phil: Went back to no number_formatting on PurchData.php +26/6/11 Phil: Went back to no number_formatting on PO_Items.php price and quantity - Brian May still reporting issues 25/6/11 Phil: Made PO_PDFPurchOrder.php have the description of the order item run over several lines where it exceeds the width of the space allowed for it 22/6/11 Phil: Added message to AccountGroups.php to show that child account groups cannot have changes to their account section, their profit and loss or balance sheet and sequence in TB as these properties belong only to parent account groups and are inherited by the kids 23/6/11 Phil: SelectOrderItems.php includes/DefineCartClass.php repaired credit checks @@ -143,7 +144,6 @@ 28/5/11 Phil: Reported by Daniel Brewer Fix SelectSalesOrder.php creation of PO with excluding redundant fields in purchorderdetails that were taken out. 28/5/11 Exson: UpdateCurrencyRateDaily was set to 1 when the option to enable it was clicked - should have been set to today's date in SystemParameters - fixed. Now no error reported bu ConvertSQLDate function when user enables update currencies daily. - 26/5/11 Version 4.04 Release 26/5/11 Ricard: require securitytoken 9 to allow user to see purchasing data in SelectProduct.php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-11-04 04:56:34
|
Revision: 4739 http://web-erp.svn.sourceforge.net/web-erp/?rev=4739&view=rev Author: daintree Date: 2011-11-04 04:56:22 +0000 (Fri, 04 Nov 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/CustomerReceipt.php trunk/DailySalesInquiry.php trunk/PDFReceipt.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/DefineReceiptClass.php trunk/install/save.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/CustomerReceipt.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -16,7 +16,6 @@ unset($_SESSION['ReceiptBatch']->Items); unset($_SESSION['ReceiptBatch']); unset($_SESSION['CustomerRecord']); - } if (isset($_POST['Cancel'])) { @@ -27,7 +26,11 @@ $_POST['GLEntry']=1; } -if ((isset($_POST['BatchInput']) and $_POST['BankAccount']=='') or (isset($_POST['Process']) and $_POST['BankAccount']=='')) { +if ((isset($_POST['BatchInput']) + AND $_POST['BankAccount']=='') + OR (isset($_POST['Process']) + AND $_POST['BankAccount']=='')) { + echo '<br />'; prnMsg(_('A bank account must be selected for this receipt'), 'warn'); $BankAccountEmpty=TRUE; @@ -37,13 +40,17 @@ $BankAccountEmpty=FALSE; } -if (!isset($_GET['Delete']) AND isset($_SESSION['ReceiptBatch'])){ //always process a header update unless deleting an item +if (!isset($_GET['Delete']) AND isset($_SESSION['ReceiptBatch'])){ + //always process a header update unless deleting an item - $_SESSION['ReceiptBatch']->Account = $_POST['BankAccount']; /*Get the bank account currency and set that too */ - $SQL = "SELECT bankaccountname, currcode FROM bankaccounts WHERE accountcode='" . $_POST['BankAccount']."'"; + $SQL = "SELECT bankaccountname, + currcode + FROM bankaccounts + WHERE accountcode='" . $_POST['BankAccount']."'"; + $ErrMsg =_('The bank account name cannot be retrieved because'); $result= DB_query($SQL,$db,$ErrMsg); @@ -69,7 +76,7 @@ prnMsg(_('The exchange rate entered should be numeric'),'warn'); } } - if (isset($_POST['FunctionalExRate']) and $_POST['FunctionalExRate']!=''){ + if (isset($_POST['FunctionalExRate']) AND $_POST['FunctionalExRate']!=''){ if (is_numeric(filter_number_format($_POST['FunctionalExRate']))){ $_SESSION['ReceiptBatch']->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); //ex rate between receipt currency and account currency } else { @@ -119,14 +126,14 @@ */ /*Get suggested FunctionalExRate */ - $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->AccountCurrency . "'",$db); - $myrow = DB_fetch_row($result); - $SuggestedFunctionalExRate = $myrow[0]; - + $result = DB_query("SELECT rate, decimalplaces FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->AccountCurrency . "'",$db); + $myrow = DB_fetch_array($result); + $SuggestedFunctionalExRate = $myrow['rate']; + $_SESSION['ReceiptBatch']->CurrDecimalPlaces = $myrow['decimalplaces']; /*Get the exchange rate between the functional currency and the receipt currency*/ $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->Currency . "'",$db); - $myrow = DB_fetch_row($result); - $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the receipt currency + $myrow = DB_fetch_array($result); + $tableExRate = $myrow['rate']; //this is the rate of exchange between the functional currency and the receipt currency /*Calculate cross rate to suggest appropriate exchange rate between receipt currency and account currency */ $SuggestedExRate = $tableExRate/$SuggestedFunctionalExRate; } //end else account currency != functional currency @@ -156,17 +163,17 @@ $_POST['CustomerName']=''; } - if ($_POST['GLCode'] == '' and $_GET['Type']=='GL') { + if ($_POST['GLCode'] == '' AND $_GET['Type']=='GL') { prnMsg( _('No General Ledger code has been chosen') . ' - ' . _('so this GL analysis item could not be added'),'warn'); } else { - $_SESSION['ReceiptBatch']->add_to_batch($_POST['Amount'], - $_POST['CustomerID'], - $_POST['Discount'], - $_POST['Narrative'], - $_POST['GLCode'], - $_POST['PayeeBankDetail'], - $_POST['CustomerName'], - $_POST['tag']); + $_SESSION['ReceiptBatch']->add_to_batch(filter_number_format($_POST['Amount']), + $_POST['CustomerID'], + filter_number_format($_POST['Discount']), + $_POST['Narrative'], + $_POST['GLCode'], + $_POST['PayeeBankDetail'], + $_POST['CustomerName'], + $_POST['tag']); /*Make sure the same receipt is not double processed by a page refresh */ $Cancel = 1; @@ -228,13 +235,20 @@ $k=0; //Table row counter for row styles $CustomerReceiptCounter=1; //Count lines of customer receipts in this batch - echo '<br /><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="" />' . ' ' . _('Summary of Receipt Batch').'</p><br />'; + echo '<br /> + <p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="" />' . ' ' . _('Summary of Receipt Batch').' + </p> + <br />'; - echo '<table class=selection><tr><th>'._('Batch Number').'</th> + echo '<table class="selection"> + <tr> + <th>'._('Batch Number').'</th> <th>' . _('Date Banked') . '</th> <th>' . _('Customer Name') . '</th> <th>' . _('GL Code') . '</th> - <th>' . _('Amount of Receipt').'</th></tr>'; + <th>' . _('Amount of Receipt').'</th> + </tr>'; foreach ($_SESSION['ReceiptBatch']->Items as $ReceiptItem) { @@ -254,7 +268,7 @@ <td>'.$_SESSION['ReceiptBatch']->DateBanked.'</td> <td>'.$ReceiptItem->CustomerName.'</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> - <td class=number>'.locale_number_format($ReceiptItem->Amount/$_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate,2) .'</td>'; + <td class="number">'.locale_number_format($ReceiptItem->Amount/$_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) .'</td>'; if ($ReceiptItem->GLCode ==''){ echo '<td><a target="_blank" href="' . $rootpath . '/PDFReceipt.php?BatchNumber=' . $_SESSION['ReceiptBatch']->BatchNo. '&ReceiptNumber='.$CustomerReceiptCounter.'">'._('Print a Customer Receipt').'</a></td></tr>'; @@ -527,7 +541,8 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="">' . ' ' . '<a href="' . $rootpath . '/PDFBankingSummary.php?BatchNo=' . $_SESSION['ReceiptBatch']->BatchNo . '">' . _('Print PDF Batch Summary') . '</a></p>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/allocation.png" title="' . _('Allocate') . '" alt="">' . ' ' . '<a href="' . $rootpath . '/CustomerAllocations.php">' . _('Allocate Receipts') . '</a></p>'; - echo '<p class="page_title_text">• ' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer ' . _('Enter Receipts') . ' </p>'; + echo '<p class="page_title_text"><a href="' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a> + </p>'; unset($_SESSION['ReceiptBatch']); include('includes/footer.inc'); @@ -541,7 +556,10 @@ if ($_POST['Keywords'] AND $_POST['CustCode']) { $msg=_('Customer name keywords have been used in preference to the customer code extract entered'); } - if ($_POST['Keywords']=="" AND $_POST['CustCode']=="" AND $_POST['CustInvNo']=="") { + if ($_POST['Keywords']=='' + AND $_POST['CustCode']=='' + AND $_POST['CustInvNo']=='') { + $msg=_('At least one Customer Name keyword OR an extract of a Customer Code must be entered for the search'); } else { if (mb_strlen($_POST['Keywords'])>0) { @@ -549,24 +567,24 @@ $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name - FROM debtorsmaster - WHERE debtorsmaster.name " . LIKE . " '". $SearchString . "' - AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; + debtorsmaster.name + FROM debtorsmaster + WHERE debtorsmaster.name " . LIKE . " '". $SearchString . "' + AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } elseif (mb_strlen($_POST['CustCode'])>0){ $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name - FROM debtorsmaster - WHERE debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' - AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; + debtorsmaster.name + FROM debtorsmaster + WHERE debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' + AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } elseif (mb_strlen($_POST['CustInvNo'])>0){ $SQL = "SELECT debtortrans.debtorno, - debtorsmaster.name - FROM debtorsmaster LEFT JOIN debtortrans - ON debtorsmaster.debtorno=debtortrans.debtorno - WHERE debtortrans.transno " . LIKE . " '%" . $_POST['CustInvNo'] . "%' - AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; + debtorsmaster.name + FROM debtorsmaster LEFT JOIN debtortrans + ON debtorsmaster.debtorno=debtortrans.debtorno + WHERE debtortrans.transno " . LIKE . " '%" . $_POST['CustInvNo'] . "%' + AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } $CustomerSearchResult = DB_query($SQL,$db,'','',false,false); @@ -609,6 +627,7 @@ debtorsmaster.currcode, currencies.currency, currencies.rate, + currencies.decimalplaces AS currdecimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -629,21 +648,21 @@ ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END END) AS overdue2 - FROM debtorsmaster, - paymentterms, - holdreasons, - currencies, - debtortrans - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "' - AND debtorsmaster.debtorno = debtortrans.debtorno + FROM debtorsmaster INNER JOIN paymentterms + ON debtorsmaster.paymentterms = paymentterms.termsindicator + INNER JOIN holdreasons + ON debtorsmaster.holdreason = holdreasons.reasoncode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + INNER JOIN debtortrans + ON debtorsmaster.debtorno = debtortrans.debtorno + WHERE debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "' GROUP BY debtorsmaster.name, debtorsmaster.pymtdiscount, debtorsmaster.currcode, currencies.currency, currencies.rate, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, paymentterms.daysbeforedue, @@ -667,19 +686,19 @@ debtorsmaster.pymtdiscount, currencies.currency, currencies.rate, + currencies.decimalplaces AS currdecimalplaces, paymentterms.terms, debtorsmaster.creditlimit, debtorsmaster.currcode, holdreasons.dissallowinvoices, holdreasons.reasondescription - FROM debtorsmaster, - paymentterms, - holdreasons, - currencies - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "'"; + FROM debtorsmaster INNER JOIN paymentterms + ON debtorsmaster.paymentterms = paymentterms.termsindicator + INNER JOIN holdreasons + ON debtorsmaster.holdreason = holdreasons.reasoncode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "'"; $ErrMsg = _('The customer details could not be retrieved because'); $DbgMsg = _('The SQL that failed was'); @@ -708,11 +727,10 @@ /*show the batch header details and the entries in the batch so far */ $SQL = "SELECT bankaccountname, - bankaccounts.accountcode, - bankaccounts.currcode - FROM bankaccounts, - chartmaster - WHERE bankaccounts.accountcode=chartmaster.accountcode"; + bankaccounts.accountcode, + bankaccounts.currcode + FROM bankaccounts INNER JOIN chartmaster + ON bankaccounts.accountcode=chartmaster.accountcode"; $ErrMsg = _('The bank accounts could not be retrieved because'); @@ -725,11 +743,17 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Enter Receipt') . '" alt="">' . ' ' . _('Enter Customer Receipt') . '</p>'; echo '<div class="page_help_text">' . _('To enter a payment TO a customer (ie. to pay out a credit note), enter a negative payment amount.') . '</div>'; } -echo '<br /><table class=selection><tr><td>' . _('Bank Account') . ':</td> - <td><select tabindex=1 name="BankAccount" onChange="ReloadForm(form1.BatchInput)">'; +echo '<br /> + <table class="selection"> + <tr> + <td>' . _('Bank Account') . ':</td> + <td><select tabindex="1" name="BankAccount" onChange="ReloadForm(form1.BatchInput)">'; if (DB_num_rows($AccountsResults)==0){ - echo '</select></td></tr></table><p>'; + echo '</select></td> + </tr> + </table> + <p />'; prnMsg(_('Bank Accounts have not yet been defined') . '. ' . _('You must first') . ' ' . '<a href="' . $rootpath . '/BankAccounts.php">' . _('define the bank accounts') . '</a>' . _('and general ledger accounts to be affected'),'info'); include('includes/footer.inc'); exit; @@ -743,23 +767,27 @@ echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname']. ' - ' . $myrow['currcode'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (!Is_Date($_SESSION['ReceiptBatch']->DateBanked)){ $_SESSION['ReceiptBatch']->DateBanked = Date($_SESSION['DefaultDateFormat']); } -echo '<tr><td>' . _('Date Banked') . ':</td> - <td><input tabindex=2 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DateBanked" maxlength=10 size=10 onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['ReceiptBatch']->DateBanked . '"></td></tr>'; -echo '<tr><td>' . _('Currency') . ':</td> - <td><select tabindex=3 name="Currency" onChange="ReloadForm(form1.BatchInput)">'; +echo '<tr> + <td>' . _('Date Banked') . ':</td> + <td><input tabindex="2" type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DateBanked" maxlength="10" size="10" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['ReceiptBatch']->DateBanked . '"></td> + </tr> + <tr> + <td>' . _('Currency') . ':</td> + <td><select tabindex="3" name="Currency" onChange="ReloadForm(form1.BatchInput)">'; if (!isset($_SESSION['ReceiptBatch']->Currency)){ $_SESSION['ReceiptBatch']->Currency=$_SESSION['CompanyRecord']['currencydefault']; } -$SQL = 'SELECT currency, currabrev, rate FROM currencies'; +$SQL = "SELECT currency, currabrev, rate FROM currencies"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ echo '</select></td></tr>'; @@ -773,7 +801,8 @@ echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } @@ -793,26 +822,33 @@ if ($_SESSION['ReceiptBatch']->ExRate==1 AND isset($SuggestedExRate)){ $_SESSION['ReceiptBatch']->ExRate = $SuggestedExRate; } - echo '<tr><td>' . _('Receipt Exchange Rate') . ':</td> - <td><input tabindex=4 type="text" name="ExRate" maxlength=10 size=12 class=number value="' . $_SESSION['ReceiptBatch']->ExRate . '"></td> - <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the receipt') . '. 1 ' . $_SESSION['ReceiptBatch']->AccountCurrency . ' = ? ' . $_SESSION['ReceiptBatch']->Currency . '</i></td></tr>'; + echo '<tr> + <td>' . _('Receipt Exchange Rate') . ':</td> + <td><input tabindex="4" type="text" name="ExRate" maxlength="10" size="12" class="number" value="' . locale_number_format($_SESSION['ReceiptBatch']->ExRate,6) . '" /></td> + <td>' . locale_number_format($SuggestedExRateText,6) . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the receipt') . '. 1 ' . $_SESSION['ReceiptBatch']->AccountCurrency . ' = ? ' . $_SESSION['ReceiptBatch']->Currency . '</i></td> + </tr>'; } if ($_SESSION['ReceiptBatch']->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] - AND isset($_SESSION['ReceiptBatch']->AccountCurrency)){ + AND isset($_SESSION['ReceiptBatch']->AccountCurrency)){ if (isset($SuggestedFunctionalExRate)){ - $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,4) . '</b>'; + $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,6) . '</b>'; } else { $SuggestedFunctionalExRateText =''; } if ($_SESSION['ReceiptBatch']->FunctionalExRate==1 AND isset($SuggestedFunctionalExRate)){ $_SESSION['ReceiptBatch']->FunctionalExRate = $SuggestedFunctionalExRate; } - echo '<tr><td>' . _('Functional Exchange Rate') . ':</td><td><input tabindex=5 type="text" name="FunctionalExRate" class=number maxlength=10 size=12 value="' . $_SESSION['ReceiptBatch']->FunctionalExRate . '"></td> - <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['ReceiptBatch']->AccountCurrency . '</i></td></tr>'; + echo '<tr> + <td>' . _('Functional Exchange Rate') . ':</td> + <td><input tabindex="5" type="text" name="FunctionalExRate" class="number" maxlength="10" size="12" value="' . locale_number_format($_SESSION['ReceiptBatch']->FunctionalExRate,6) . '" /></td> + <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['ReceiptBatch']->AccountCurrency . '</i></td> + </tr>'; } -echo '<tr><td>' . _('Receipt Type') . ':</td><td><select tabindex=6 name="ReceiptType">'; +echo '<tr> + <td>' . _('Receipt Type') . ':</td> + <td><select tabindex="6" name="ReceiptType">'; include('includes/GetPaymentMethods.php'); /* The array ReceiptTypes is defined from the setup tab of the main menu under payment methods - the array is populated from the include file GetPaymentMethods.php */ @@ -824,13 +860,24 @@ echo '<option value="' .$RcptType . '">' . $RcptType .'</option>'; } } -echo '</select></td></tr>'; +echo '</select></td> + </tr>'; if (!isset($_SESSION['ReceiptBatch']->Narrative)) { $_SESSION['ReceiptBatch']->Narrative=''; } -echo '<tr><td>' . _('Narrative') . ':</td><td><input tabindex=7 type="text" name="BatchNarrative" maxlength=50 size=52 value="' . $_SESSION['ReceiptBatch']->Narrative . '"></td></tr>'; -echo '<tr><td colspan=3><div class="centre"><input tabindex=8 type=submit name="BatchInput" Value="' . _('Accept') . '"></div></td></tr>'; -echo '</table><br />'; +echo '<tr> + <td>' . _('Narrative') . ':</td> + <td><input tabindex="7" type="text" name="BatchNarrative" maxlength="50" size="52" value="' . $_SESSION['ReceiptBatch']->Narrative . '" /></td> + </tr> + <tr> + <td colspan="3"> + <div class="centre"> + <input tabindex="8" type="submit" name="BatchInput" value="' . _('Accept') . '" /> + </div> + </td> + </tr> + </table> + <br />'; if (isset($_SESSION['ReceiptBatch'])){ /* Now show the entries made so far */ @@ -840,13 +887,14 @@ $_SESSION['ReceiptBatch']->BankAccountName . ' ' . _('on') . ' ' . $_SESSION['ReceiptBatch']->DateBanked . '</p>'; } - echo '<table width="90%" class=selection><tr> + echo '<table width="90%" class="selection"> + <tr> <th>' . _('Amount') . ' ' . _('Received') . '</th> <th>' . _('Discount') . '</th> <th>' . _('Customer') . '</th> <th>' . _('GL Code') . '</th> <th>' . _('Narrative') . '</th> - </tr>'; + </tr>'; $BatchTotal = 0; @@ -857,8 +905,8 @@ $myrow=DB_fetch_array($Result); echo '<tr> - <td class=number>' . locale_number_format($ReceiptItem->Amount,2) . '</td> - <td class=number>' . locale_number_format($ReceiptItem->Discount,2) . '</td> + <td class="number">' . locale_number_format($ReceiptItem->Amount,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($ReceiptItem->Discount,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) . '</td> <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> <td>'.$ReceiptItem->Narrative . '</td> @@ -867,7 +915,10 @@ $BatchTotal= $BatchTotal + $ReceiptItem->Amount; } - echo '<tr><td class=number><b>' . locale_number_format($BatchTotal,2) . '</b></td></tr></table>'; + echo '<tr> + <td class="number"><b>' . locale_number_format($BatchTotal,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) . '</b></td> + </tr> + </table>'; } /*this next block of ifs deals with what information to display for input into the form @@ -897,43 +948,51 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . $_SESSION['CustomerRecord']['name'] . ' - (' . _('All amounts stated in') . ' ' . $_SESSION['CustomerRecord']['currency'] . ')' . _('Terms') . ': ' . $_SESSION['CustomerRecord']['terms'] . '<br/>' . _('Credit Limit') . ': ' . locale_number_format($_SESSION['CustomerRecord']['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $_SESSION['CustomerRecord']['reasondescription']; if ($_SESSION['CustomerRecord']['dissallowinvoices']!=0){ - echo '<br /><font color=red size=4><b>' . _('ACCOUNT ON HOLD') . '</font></b><br/>'; + echo '<br /> + <font color="red" size="4"><b>' . _('ACCOUNT ON HOLD') . '</font></b> + <br/>'; } - echo '<table width="90%" class=selection> + echo '<table width="90%" class="selection"> <tr> - <th width=20%>' . _('Total Balance') . '</th> - <th width=20%>' . _('Current') . '</th> - <th width=20%>' . _('Now Due') . '</th> - <th width=20%>' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> - <th width=20%>' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + <th width="20%">' . _('Total Balance') . '</th> + <th width="20%">' . _('Current') . '</th> + <th width="20%">' . _('Now Due') . '</th> + <th width="20%">' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + <th width="20%">' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> </tr>'; echo '<tr> - <td class=number>' . locale_number_format($_SESSION['CustomerRecord']['balance'],2) . '</td> - <td class=number>' . locale_number_format(($_SESSION['CustomerRecord']['balance'] - $_SESSION['CustomerRecord']['due']),2) . '</td> - <td class=number>' . locale_number_format(($_SESSION['CustomerRecord']['due']-$_SESSION['CustomerRecord']['overdue1']),2) . '</td> - <td class=number>' . locale_number_format(($_SESSION['CustomerRecord']['overdue1']-$_SESSION['CustomerRecord']['overdue2']) ,2) . '</td> - <td class=number>' . locale_number_format($_SESSION['CustomerRecord']['overdue2'],2) . '</td> + <td class="number">' . locale_number_format($_SESSION['CustomerRecord']['balance'],$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format(($_SESSION['CustomerRecord']['balance'] - $_SESSION['CustomerRecord']['due']),$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format(($_SESSION['CustomerRecord']['due']-$_SESSION['CustomerRecord']['overdue1']),$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format(($_SESSION['CustomerRecord']['overdue1']-$_SESSION['CustomerRecord']['overdue2']) ,$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format($_SESSION['CustomerRecord']['overdue2'],$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> </tr> - </table><br />'; + </table> + <br />'; echo '<table class="selection">'; $DisplayDiscountPercent = locale_number_format($_SESSION['CustomerRecord']['pymtdiscount']*100,2) . '%'; - echo '<input type="hidden" name="CustomerID" value="' . $_POST['CustomerID'] . '">'; - echo '<input type="hidden" name="CustomerName" value="' . $_SESSION['CustomerRecord']['name'] . '">'; + echo '<input type="hidden" name="CustomerID" value="' . $_POST['CustomerID'] . '" />'; + echo '<input type="hidden" name="CustomerName" value="' . $_SESSION['CustomerRecord']['name'] . '" />'; } if (isset($_POST['GLEntry']) AND isset($_SESSION['ReceiptBatch'])){ /* Set up a heading for the transaction entry for a GL Receipt */ - echo '<br /><table class=selection>'; - echo '<th colspan=2><font size=2 color=navy>' . _('General Ledger Receipt Entry') . '</font></th>'; + echo '<br /> + <table class="selection"> + <tr> + <th colspan="2"><font size="2" color="navy">' . _('General Ledger Receipt Entry') . '</font></th> + </tr>'; //Select the tag - echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; + echo '<tr> + <td>' . _('Select Tag') . ':</td> + <td><select name="tag">'; $SQL = "SELECT tagref, tagdescription @@ -949,15 +1008,20 @@ echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; // End select tag /*now set up a GLCode field to select from avaialble GL accounts */ - echo '<tr><td>' . _('GL Account') . ':</td><td><select tabindex=8 name="GLCode">'; - $SQL = 'SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode'; + echo '<tr> + <td>' . _('GL Account') . ':</td> + <td><select tabindex="8" name="GLCode">'; + + $SQL = "SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ - echo '</select>' . _('No General ledger accounts have been set up yet') . ' - ' . _('receipts cannot be entered against GL accounts until the GL accounts are set up') . '</td></tr>'; + echo '</select>' . _('No General ledger accounts have been set up yet') . ' - ' . _('receipts cannot be entered against GL accounts until the GL accounts are set up') . '</td> + </tr>'; } else { echo '<option value=""></option>'; while ($myrow=DB_fetch_array($result)){ @@ -967,9 +1031,9 @@ echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } - } /*if either a customer is selected or its a GL Entry then set out @@ -977,9 +1041,9 @@ if (((isset($_SESSION['CustomerRecord']) AND isset($_POST['CustomerID']) - AND $_POST['CustomerID']!="") + AND $_POST['CustomerID']!='') OR isset($_POST['GLEntry'])) - AND isset($_SESSION['ReceiptBatch'])){ + AND isset($_SESSION['ReceiptBatch'])){ if (!isset($_POST['Amount'])) { $_POST['Amount']=0; @@ -993,52 +1057,71 @@ if (!isset($_POST['Narrative'])) { $_POST['Narrative']=''; } - echo '<tr><td>' . _('Amount of Receipt') . ':</td> - <td><input tabindex=9 type="text" name="Amount" maxlength=12 size=13 class=number value="' . $_POST['Amount'] . '"></td> - </tr>'; + echo '<tr> + <td>' . _('Amount of Receipt') . ':</td> + <td><input tabindex="9" type="text" name="Amount" maxlength="12" size="13" class="number" value="' . $_POST['Amount'] . '" /></td> + </tr>'; if (!isset($_POST['GLEntry'])){ - echo '<tr><td>' . _('Amount of Discount') . ':</td> - <td><input tabindex=10 type="text" name="Discount" maxlength=12 size=13 class=number value="' . $_POST['Discount'] . '"> ' . _('agreed prompt payment discount is') . ' ' . $DisplayDiscountPercent . '</td></tr>'; + echo '<tr> + <td>' . _('Amount of Discount') . ':</td> + <td><input tabindex="10" type="text" name="Discount" maxlength="12" size="13" class="number" value="' . $_POST['Discount'] . '" /> ' . _('agreed prompt payment discount is') . ' ' . $DisplayDiscountPercent . '</td></tr>'; } else { - echo '<input tabindex=11 type="hidden" name="Discount" Value=0>'; + echo '<input tabindex=11 type="hidden" name="Discount" value="0" />'; } - echo '<tr><td>' . _('Payee Bank Details') . ':</td> - <td><input tabindex=12 type="text" name="PayeeBankDetail" maxlength=22 size=20 value="' . $_POST['PayeeBankDetail'] . '"></td></tr>'; + echo '<tr> + <td>' . _('Payee Bank Details') . ':</td> + <td><input tabindex="12" type="text" name="PayeeBankDetail" maxlength="22" size="20" value="' . $_POST['PayeeBankDetail'] . '" /></td> + </tr>'; // echo '<tr><td>' . _('Narrative') . ':</td> // <td><input tabindex=13 type="text" name="Narrative" maxlength=30 size=32 value="' . $_POST['Narrative'] . '"></td></tr>'; - echo '<td>' . _('Narrative') . ':</td>'; - echo '<td><textarea name="Narrative" cols=40 rows=1></textarea></td>'; - echo '</table>'; - echo '<br /><div class="centre"><input tabindex=14 type="submit" name="Process" value="' . _('Accept') . '">'; - echo '<input tabindex=14 type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; + echo '<td>' . _('Narrative') . ':</td> + <td><textarea name="Narrative" cols="40" rows="1"></textarea></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="14" type="submit" name="Process" value="' . _('Accept') . '" /> + <input tabindex="15" type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div>'; -} elseif (isset($_SESSION['ReceiptBatch']) AND !isset($_POST['GLEntry'])){ +} elseif (isset($_SESSION['ReceiptBatch']) + AND !isset($_POST['GLEntry'])){ /*Show the form to select a customer */ echo '<br />'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Select a Customer') . '</b>'; - echo '<table cellpadding=3 colspan=4 class=selection>'; - echo '<tr><td>' . _('Text in the Customer') . ' ' . '<b>' . _('name') . '</b>:</td>'; - echo '<td><input tabindex=9 type="text" name="Keywords" size=15 maxlength=25></td>'; - echo '<td><font size=3><b>' . _('OR') . '</b></font></td>'; - echo '<td>' . _('Text extract in the Customer') . ' ' . '<b>' . _('code') . '</b>:</td>'; - echo '<td><input tabindex=10 type="text" name="CustCode" size=10 maxlength=18></td>'; - echo '<td><font size=3><b>' . _('OR') . '</b></font></td>'; - echo '<td>' . _('Customer invoice number') . ':</td>'; - echo '<td><input tabindex=11 type="text" name="CustInvNo" size=8 maxlength=8></td>'; - echo '</tr></table>'; - echo '<div class="centre"><br />'; - echo '<input tabindex=11 type=submit name="Search" value="' . _('Search Now') . '">'; - echo '<br/><br/><input tabindex=12 type=submit name="GLEntry" value="' . _('Enter A GL Receipt') . '"><br /></div>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Select a Customer') . '</b> + <table class="selection"> + <tr> + <td>' . _('Text in the Customer') . ' ' . '<b>' . _('name') . '</b>:</td> + <td><input tabindex="9" type="text" name="Keywords" size="15" maxlength="25" /></td> + <td><font size="3"><b>' . _('OR') . '</b></font></td> + <td>' . _('Text extract in the Customer') . ' ' . '<b>' . _('code') . '</b>:</td> + <td><input tabindex="10" type="text" name="CustCode" size="10" maxlength="18" /></td> + <td><font size="3"><b>' . _('OR') . '</b></font></td> + <td>' . _('Customer invoice number') . ':</td> + <td><input tabindex="11" type="text" name="CustInvNo" size="8" maxlength="8" /></td> + </tr> + </table> + <div class="centre"> + <br /> + <input tabindex="11" type="submit" name="Search" value="' . _('Search Now') . '" /> + <br/> + <br/> + <input tabindex="12" type="submit" name="GLEntry" value="' . _('Enter A GL Receipt') . '" /> + <br /> + </div>'; if (isset($CustomerSearchResult)) { - echo '<table cellpadding=2 colspan=7 class=selection>'; - $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Customer Name') . '</th></tr>'; + echo '<table class="selection">'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Customer Name') . '</th> + </tr>'; echo $TableHeader; $j = 1; $k = 0; //row counter to determine background colour @@ -1052,9 +1135,9 @@ echo '<tr class="EvenTableRows">'; $k=1; } - printf('<td><font size=1> - <input tabindex='.locale_number_format(12+$j).' type=submit name="Select" value="%s"></font></td> - <td>%s</td></tr>', + printf('<td><font size=1><input tabindex="'. strval(12+$j).'" type="submit" name="Select" value="%s" /></font></td> + <td>%s</td> + </tr>', $myrow['debtorno'], $myrow['name']); @@ -1074,8 +1157,11 @@ } if (isset($_SESSION['ReceiptBatch']->Items) and count($_SESSION['ReceiptBatch']->Items) > 0){ - echo '<div class="centre"><br/><input tabindex="13" type="submit" name="CommitBatch" value="' . _('Accept and Process Batch') . '"></div>'; + echo '<div class="centre"> + <br/> + <input tabindex="13" type="submit" name="CommitBatch" value="' . _('Accept and Process Batch') . '" /> + </div>'; } echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/DailySalesInquiry.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -5,7 +5,6 @@ include('includes/session.inc'); $title = _('Daily Sales Inquiry'); include('includes/header.inc'); -include('includes/DefineCartClass.php'); echo '<p class="page_title_text"> <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Daily Sales') . '" alt="" />' . ' ' . _('Daily Sales') . ' @@ -21,16 +20,18 @@ <td>' . _('Month to Show') . ':</td> <td><select tabindex="1" name="MonthToShow">'; - if (!isset($_POST['MonthToShow'])){ $_POST['MonthToShow'] = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); + $Result = DB_query("SELECT lastdate_in_period FROM periods WHERE period='" . $_POST['MonthToShow'] . "'",$db); + $myrow = DB_fetch_array($Result); + $EndDateSQL = $myrow['lastdate_in_period']; } $PeriodsResult = DB_query("SELECT periodno, lastdate_in_period FROM periods",$db); while ($PeriodRow = DB_fetch_array($PeriodsResult)){ if ($_POST['MonthToShow']==$PeriodRow['periodno']) { - echo '<option selected Value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; + echo '<option selected value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; $EndDateSQL = $PeriodRow['lastdate_in_period']; } else { echo '<option value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; Modified: trunk/PDFReceipt.php =================================================================== --- trunk/PDFReceipt.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/PDFReceipt.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -46,23 +46,23 @@ $PageNumber++; -$sql="SELECT MIN(id) as start FROM debtortrans WHERE type=12 AND transno='". filer_locale_number_format($_GET['BatchNumber']). "'"; +$sql="SELECT MIN(id) as start FROM debtortrans WHERE type=12 AND transno='". $_GET['BatchNumber']. "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $StartReceiptNumber=$myrow['start']; -$sql="SELECT debtorno, - ovamount, - invtext - FROM debtortrans - WHERE type=12 - AND transno='".$_GET['BatchNumber']."' - AND id='". $StartReceiptNumber-1+$_GET['ReceiptNumber'] ."'"; -$result=DB_query($sql, $db); -$myrow=DB_fetch_array($result); -$DebtorNo=$myrow['debtorno']; -$Amount=$myrow['ovamount']; -$Narrative=$myrow['invtext']; +$sql="SELECT debtorno, + ovamount, + invtext + FROM debtortrans + WHERE type=12 + AND transno='" . $_GET['BatchNumber'] . "' + AND id='". ($StartReceiptNumber-1+$_GET['ReceiptNumber']) ."'"; +$result = DB_query($sql, $db); +$myrow = DB_fetch_array($result); +$DebtorNo = $myrow['debtorno']; +$Amount = $myrow['ovamount']; +$Narrative = $myrow['invtext']; $sql="SELECT currency, decimalplaces @@ -76,13 +76,13 @@ $Currency=$myrow['currency']; $DecimalPlaces=$myrow['decimalplaces']; -$sql="SELECT name, - address1, - address2, - address3, - address4, - address5, - address6 +$sql="SELECT name, + address1, + address2, + address3, + address4, + address5, + address6 FROM debtorsmaster WHERE debtorno='".$DebtorNo."'"; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/WWW_Users.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -33,8 +33,10 @@ // Make an array of the security roles $sql = "SELECT secroleid, - secrolename - FROM securityroles ORDER BY secroleid"; + secrolename + FROM securityroles + ORDER BY secroleid"; + $Sec_Result = DB_query($sql, $db); $SecurityRoles = array(); // Now load it into an a ray using Key/Value pairs @@ -72,7 +74,8 @@ } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); - } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { + } elseif ((mb_strlen($_POST['Cust'])>0) + AND (mb_strlen($_POST['BranchCode'])==0)) { $InputError = 1; prnMsg(_('If you enter a Customer Code you must also enter a Branch Code valid for this Customer'),'error'); } @@ -173,15 +176,15 @@ theme, language, pdflanguage) - VALUES ('" . DB_escape_string($_POST['UserID']) . "', - '" . DB_escape_string($_POST['RealName']) ."', - '" . DB_escape_string($_POST['Cust']) ."', - '" . DB_escape_string($_POST['BranchCode']) ."', - '" . DB_escape_string($_POST['SupplierID']) ."', + VALUES ('" . $_POST['UserID'] . "', + '" . $_POST['RealName'] ."', + '" . $_POST['Cust'] ."', + '" . $_POST['BranchCode'] ."', + '" . $_POST['SupplierID'] ."', '" . $_POST['Salesman'] . "', '" . CryptPass($_POST['Password']) ."', - '" . DB_escape_string($_POST['Phone']) . "', - '" . DB_escape_string($_POST['Email']) ."', + '" . $_POST['Phone'] . "', + '" . $_POST['Email'] ."', '" . $_POST['PageSize'] ."', '" . $_POST['Access'] . "', '" . $_POST['DefaultLocation'] ."', @@ -327,7 +330,7 @@ $SecurityRoles[($myrow['fullaccess'])], $myrow['pagesize'], $myrow['theme'], - $LanguagesArray[$myrow['language']], + $LanguagesArray[$myrow['language']]['LanguageName'], htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['userid'], htmlspecialchars($_SERVER['PHP_SELF']) . '?', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/doc/Change.log 2011-11-04 04:56:22 UTC (rev 4739) @@ -5,6 +5,7 @@ 29/10/11 High-Tech Bridge SA Security Research Lab <adv...@ht...> - sanitising $_SERVER['PHP_SELF'] and unquoted sql in reportwriter/FormMaker.php and reportwriter/ReportMaker.php 15/10/11 Phil: Tried to get correct characters for each language's thousands separator and decimal point in includes/LanguagesArray.php 15/10/11 Phil: Updated PHPplot to 5.5.0 +15/10/11 Fred Schuettler aguapop - theme 8/10/11 Ricard: PcExpenses.php PcAuthorizeExpense.php now uses GL tags 8/10/11 Phil: SelectSalesOrder.php now allows for creation of purchase orders for the components of assembly items on sales orders. 29/9/11 Ricard: added new query critera to AuditTrail.php to look for text in query strings to enable searching for updates/inserts/deletes relating to a specified customer or item code etc Modified: trunk/includes/DefineReceiptClass.php =================================================================== --- trunk/includes/DefineReceiptClass.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/includes/DefineReceiptClass.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -14,6 +14,7 @@ var $ExRate; /*Exchange rate conversion between currency received and bank account currency */ var $FunctionalExRate; /* Exchange Rate between Bank Account Currency and Functional(business reporting) currency */ var $Currency; /*Currency being banked - defaulted to company functional */ + var $CurrDecimalPlaces; var $Narrative; var $ReceiptType; /*Type of receipt ie credit card/cash/cheque etc - array of types defined in config.php*/ var $total; /*Total of the batch of receipts in the currency of the company*/ Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/install/save.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -298,7 +298,7 @@ $msg .= "\$CryptFunction = 'sha1';\n"; $msg .= "\$DefaultClock = 12;\n"; -$msg .= "\$rootpath = dirname(\htmlspecialchars($_SERVER['PHP_SELF']));\n"; +$msg .= "\$rootpath = dirname(htmlspecialchars(\$_SERVER['PHP_SELF']));\n"; $msg .= "if (isset(\$DirectoryLevelsDeep)){\n"; $msg .= " for (\$i=0;\$i<\$DirectoryLevelsDeep;\$i++){\n"; $msg .= "\$rootpath = mb_substr(\$rootpath,0, strrpos(\$rootpath,'/'));\n"; Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-11-04 04:56:22 UTC (rev 4739) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-11 19:23+1200\n" +"POT-Creation-Date: 2011-11-01 22:26+1300\n" "PO-Revision-Date: 2011-02-07 15:33+0000\n" "Last-Translator: Tim Schofield <Unknown>\n" "Language-Team: Czech <cs...@li...>\n" @@ -21,7 +21,7 @@ "X-Poedit-Language: Czech\n" "X-Poedit-SourceCharset: utf-8\n" -#: AccountGroups.php:7 index.php:1296 +#: AccountGroups.php:7 index.php:1298 msgid "Account Groups" msgstr "Účetní skupiny" @@ -41,8 +41,8 @@ "SQL příkaz použitý při získávání účetních skupin rodičovské účetní skupiny " "byl" -#: AccountGroups.php:57 AccountGroups.php:94 AccountGroups.php:178 -#: AccountGroups.php:188 +#: AccountGroups.php:57 AccountGroups.php:102 AccountGroups.php:174 +#: AccountGroups.php:184 msgid "The SQL that was used to retrieve the information was" msgstr "SQL, který byl použit k získání informace" @@ -58,16 +58,22 @@ msgid "The account group name cannot contain the character" msgstr "Název účetní skupiny nemůže obsahovat znak" -#: AccountGroups.php:71 TaxCategories.php:31 TaxProvinces.php:30 -#: UnitsOfMeasure.php:30 +#: AccountGroups.php:71 TaxCategories.php:31 msgid "or the character" msgstr "nebo znak" #: AccountGroups.php:77 +#, fuzzy +msgid "" +"The sequence that the account group is listed in the trial balance is " +"expected to be numeric" +msgstr "Množství uvedené pro převody Očekává se, že číselné" + +#: AccountGroups.php:85 msgid "The account group name must be at least one character long" msgstr "Název účetní skupiny musí být dlouhý minimálně jeden znak" -#: AccountGroups.php:84 +#: AccountGroups.php:92 msgid "" "The parent account group selected appears to result in a recursive account " "structure - select an alternative parent account group or make this group a " @@ -77,11 +83,11 @@ "účtu - vyberte alternativní mateřské účet skupiny nebo tuto skupinu na " "nejvyšší úrovni účtové skupiny" -#: AccountGroups.php:95 +#: AccountGroups.php:103 msgid "Could not check whether the group is recursive because" msgstr "Nepodařilo se zjistit, zda skupina je rekurzivní, protože" -#: AccountGroups.php:103 +#: AccountGroups.php:111 msgid "" "Since this account group is a child group, the sequence in the trial " "balance, the section in the accounts and whether or not the account group " @@ -90,47 +96,39 @@ "will have no effect." msgstr "" -#: AccountGroups.php:108 +#: AccountGroups.php:116 msgid "The section in accounts must be an integer" msgstr "Sekce v účtech musí být celé kladné číslo" -#: AccountGroups.php:114 -msgid "The sequence in the trial balance must be an integer" -msgstr "Pořadí v předvaze musí být celé číslo" - -#: AccountGroups.php:120 -msgid "The sequence in the TB must be numeric and less than" -msgstr "Pořadí v TB musí být číslo a méně než" - -#: AccountGroups.php:137 +#: AccountGroups.php:133 msgid "An error occurred in updating the account group" msgstr "Došlo k chybě při aktualizaci účtové skupiny" -#: AccountGroups.php:138 +#: AccountGroups.php:134 msgid "The SQL that was used to update the account group was" msgstr "SQL, který byl použit k aktualizaci účtu skupina byla" -#: AccountGroups.php:140 AccountSections.php:104 PaymentMethods.php:82 +#: AccountGroups.php:136 AccountSections.php:104 PaymentMethods.php:82 msgid "Record Updated" msgstr "Záznam aktualizován" -#: AccountGroups.php:158 +#: AccountGroups.php:154 msgid "An error occurred in inserting the account group" msgstr "Došlo k chybě při vkládání účtové skupiny" -#: AccountGroups.php:159 +#: AccountGroups.php:155 msgid "The SQL that was used to insert the account group was" msgstr "SQL, který byl použit pro vložení na účet skupina byla" -#: AccountGroups.php:160 AccountSections.php:116 PaymentMethods.php:103 +#: AccountGroups.php:156 AccountSections.php:116 PaymentMethods.php:103 msgid "Record inserted" msgstr "Záznam vložen" -#: AccountGroups.php:177 +#: AccountGroups.php:173 msgid "An error occurred in retrieving the group information from chartmaster" msgstr "Došlo k chybě při získávání informací od skupiny chartmaster" -#: AccountGroups.php:182 +#: AccountGroups.php:178 msgid "" "Cannot delete this account group because general ledger accounts have been " "created using this group" @@ -138,37 +136,37 @@ "Nelze smazat tento účet skupiny, protože účtů hlavní knihy byly vytvořeny " "pomocí této skupině" -#: AccountGroups.php:183 AccountGroups.php:193 AccountSections.php:137 -#: Areas.php:116 Areas.php:125 BankAccounts.php:158 CreditStatus.php:123 -#: Currencies.php:164 Currencies.php:172 Currencies.php:180 +#: AccountGroups.php:179 AccountGroups.php:189 AccountSections.php:137 +#: Areas.php:116 Areas.php:125 BankAccounts.php:158 CreditStatus.php:125 +#: Currencies.php:166 Currencies.php:174 Currencies.php:182 #: CustomerBranches.php:286 CustomerBranches.php:296 CustomerBranches.php:306 -#: CustomerBranches.php:316 Customers.php:312 Customers.php:321 -#: Customers.php:329 Customers.php:337 CustomerTypes.php:147 -#: CustomerTypes.php:157 Factors.php:134 FixedAssetCategories.php:129 -#: GLAccounts.php:80 GLAccounts.php:96 Locations.php:237 Locations.php:245 -#: Locations.php:256 Locations.php:265 Locations.php:274 Locations.php:283 -#: Locations.php:292 Locations.php:301 MRPDemandTypes.php:87 -#: PaymentMethods.php:138 PaymentTerms.php:144 PaymentTerms.php:151 -#: PcExpenses.php:152 SalesCategories.php:124 SalesCategories.php:131 -#: SalesPeople.php:149 SalesPeople.php:156 SalesTypes.php:150 -#: SalesTypes.php:160 Shippers.php:82 Shippers.php:94 StockCategories.php:179 -#: Stocks.php:604 Stocks.php:613 Stocks.php:621 Stocks.php:629 Stocks.php:637 -#: Stocks.php:645 Suppliers.php:609 Suppliers.php:618 Suppliers.php:626 -#: SupplierTypes.php:145 TaxCategories.php:131 TaxGroups.php:127 -#: TaxGroups.php:134 TaxProvinces.php:125 UnitsOfMeasure.php:138 -#: WorkCentres.php:89 WorkCentres.php:95 WWW_Access.php:83 +#: CustomerBranches.php:316 CustomerTypes.php:147 CustomerTypes.php:157 +#: Customers.php:289 Customers.php:298 Customers.php:306 Customers.php:314 +#: Factors.php:134 FixedAssetCategories.php:129 GLAccounts.php:80 +#: GLAccounts.php:96 Locations.php:237 Locations.php:245 Locations.php:256 +#: Locations.php:265 Locations.php:274 Locations.php:283 Locations.php:292 +#: Locations.php:301 MRPDemandTypes.php:87 PaymentMethods.php:138 +#: PaymentTerms.php:146 PaymentTerms.php:153 PcExpenses.php:158 +#: SalesCategories.php:124 SalesCategories.php:131 SalesPeople.php:150 +#: SalesPeople.php:157 SalesPeople.php:163 SalesTypes.php:140 +#: SalesTypes.php:150 Shippers.php:82 Shippers.php:94 StockCategories.php:181 +#: Stocks.php:615 Stocks.php:624 Stocks.php:632 Stocks.php:640 Stocks.php:648 +#: Stocks.php:656 SupplierTypes.php:145 Suppliers.php:612 Suppliers.php:621 +#: Suppliers.php:629 TaxCategories.php:131 TaxGroups.php:132 TaxGroups.php:140 +#: TaxProvinces.php:129 UnitsOfMeasure.php:135 WWW_Access.php:83 +#: WorkCentres.php:89 WorkCentres.php:95 msgid "There are" msgstr "Jsou zde" -#: AccountGroups.php:183 +#: AccountGroups.php:179 msgid "general ledger accounts that refer to this account group" msgstr "účtů hlavní knihy, které se vztahují k tomuto účtu skupině" -#: AccountGroups.php:187 +#: AccountGroups.php:183 msgid "An error occurred in retrieving the parent group information" msgstr "Došlo k chybě při načítání mateřské skupiny informací" -#: AccountGroups.php:192 +#: AccountGroups.php:188 msgid "" "Cannot delete this account group because it is a parent account group of " "other account group(s)" @@ -176,239 +174,237 @@ "Nelze smazat tento účet skupiny, protože se jedná o mateřskou účet skupinou " "dalších účtové skupiny (y)" -#: AccountGroups.php:193 +#: AccountGroups.php:189 msgid "account groups that have this group as its/there parent account group" msgstr "" "účet skupiny, které mají tuto skupinu jako jeho / je skupina rodičů účet" -#: AccountGroups.php:196 +#: AccountGroups.php:192 msgid "An error occurred in deleting the account group" msgstr "Došlo k chybě při mazání účtu skupiny" -#: AccountGroups.php:197 +#: AccountGroups.php:193 msgid "The SQL that was used to delete the account group was" msgstr "SQL, který byl použit smazat účet skupina byla" -#: AccountGroups.php:199 +#: AccountGroups.php:195 msgid "group has been deleted" msgstr "skupina byla smazána" -#: AccountGroups.php:224 +#: AccountGroups.php:220 msgid "The sql that was used to retrieve the account group information was " msgstr "Sql, který byl použit k načtení účtové skupiny informace " -#: AccountGroups.php:225 +#: AccountGroups.php:221 msgid "Could not get account groups because" msgstr "Nemohu získat účetní skupiny, protože" -#: AccountGroups.php:227 AccountSections.php:175 AddCustomerContacts.php:25 -#: AddCustomerContacts.php:28 AddCustomerNotes.php:101 -#: AddCustomerTypeNotes.php:95 AgedDebtors.php:454 AgedSuppliers.php:268 -#: Areas.php:144 AuditTrail.php:11 BankReconciliation.php:13 -#: BOMExtendedQty.php:259 BOMIndented.php:246 BOMIndentedReverse.php:236 -#: BOMInquiry.php:171 BOMListing.php:109 BOMs.php:208 BOMs.php:798 -#: COGSGLPostings.php:18 CompanyPreferences.php:153 CounterSales.php:2002 -#: CounterSales.php:2123 Credit_Invoice.php:255 CreditStatus.php:20 -#: Currencies.php:28 CustEDISetup.php:17 DailyBankTransactions.php:10 -#: DebtorsAtPeriodEnd.php:125 DiscountCategories.php:10 -#: DiscountCategories.php:131 DiscountMatrix.php:16 EDIMessageFormat.php:104 -#: FixedAssetLocations.php:9 FixedAssetRegister.php:13 -#: FixedAssetRegister.php:237 FixedAssetTransfer.php:31 FormDesigner.php:129 -#: GLBalanceSheet.php:351 GLBudgets.php:28 GLJournal.php:228 -#: InventoryPlanning.php:373 InventoryPlanningPrefSupplier.php:467 -#: Labels.php:115 Labels.php:270 MRPReport.php:515 OutstandingGRNs.php:160 -#: PcAssignCashToTab.php:56 PcAssignCashToTab.php:130 -#: PcAssignCashToTab.php:146 PcAssignCashToTab.php:183 PDFPickingList.php:28 -#: PDFPrintLabel.php:139 PDFStockLocTransfer.php:21 -#: PO_AuthorisationLevels.php:10 POReport.php:60 POReport.php:64 -#: POReport.php:68 PO_SelectOSPurchOrder.php:133 PricesBasedOnMarkUp.php:11 -#: Prices_Customer.php:39 Prices.php:30 PurchData.php:138 PurchData.php:249 -#: PurchData.php:268 RecurringSalesOrders.php:310 SalesAnalReptCols.php:51 +#: AccountGroups.php:223 AccountSections.php:175 AddCustomerContacts.php:25 +#: AddCustomerContacts.php:28 AddCustomerNotes.php:103 +#: AddCustomerTypeNotes.php:97 AgedDebtors.php:451 AgedSuppliers.php:278 +#: Areas.php:144 AuditTrail.php:11 BOMExtendedQty.php:261 BOMIndented.php:246 +#: BOMIndentedReverse.php:235 BOMInquiry.php:187 BOMListing.php:109 +#: BOMs.php:213 BOMs.php:832 BankReconciliation.php:13 COGSGLPostings.php:18 +#: CompanyPreferences.php:153 CounterSales.php:2010 CounterSales.php:2135 +#: CreditStatus.php:21 Credit_Invoice.php:255 Currencies.php:28 +#: CustEDISetup.php:17 DailyBankTransactions.php:11 DebtorsAtPeriodEnd.php:125 +#: DiscountCategories.php:10 DiscountCategories.php:131 DiscountMatrix.php:16 +#: EDIMessageFormat.php:104 FixedAssetLocations.php:9 +#: FixedAssetRegister.php:13 FixedAssetRegister.php:237 +#: FixedAssetTransfer.php:31 FormDesigner.php:129 GLBalanceSheet.php:362 +#: GLBudgets.php:29 GLJournal.php:246 InventoryPlanning.php:374 +#: InventoryPlanningPrefSupplier.php:467 Labels.php:115 Labels.php:270 +#: MRPReport.php:515 OutstandingGRNs.php:160 PDFPickingList.php:28 +#: PDFPrintLabel.php:140 PDFStockLocTransfer.php:17 POReport.php:60 +#: POReport.php:64 POReport.php:68 PO_AuthorisationLevels.php:10 +#: PO_SelectOSPurchOrder.php:135 PcAssignCashToTab.php:56 +#: PcAssignCashToTab.php:130 PcAssignCashToTab.php:146 +#: PcAssignCashToTab.php:187 Prices.php:30 PricesBasedOnMarkUp.php:8 +#: Prices_Customer.php:34 PurchData.php:137 PurchData.php:258 +#: PurchData.php:282 RecurringSalesOrders.php:309 SalesAnalReptCols.php:51 #: SalesAnalRepts.php:11 SalesCategories.php:11 SalesGLPostings.php:17 #: SalesGraph.php:34 SalesPeople.php:20 SalesTypes.php:20 SelectAsset.php:45 #: SelectCompletedOrder.php:11 SelectContract.php:78 SelectCreditItems.php:215 -#: SelectCreditItems.php:283 SelectCustomer.php:247 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:618 SelectOrderItems.php:1512 -#: SelectOrderItems.php:1636 SelectProduct.php:496 SelectSalesOrder.php:454 -#: SelectSupplier.php:9 SelectSupplier.php:192 SelectWorkOrder.php:9 -#: SelectWorkOrder.php:145 ShipmentCosting.php:11 Shipments.php:17 +#: SelectCreditItems.php:286 SelectCustomer.php:260 SelectGLAccount.php:17 +#: SelectGLAccount.php:77 SelectOrderItems.php:575 SelectOrderItems.php:1468 +#: SelectOrderItems.php:1592 SelectProduct.php:496 SelectSalesOrder.php:533 +#: SelectSupplier.php:9 SelectSupplier.php:198 SelectWorkOrder.php:9 +#: SelectWorkOrder.php:151 ShipmentCosting.php:11 Shipments.php:17 #: Shippers.php:123 Shippers.php:159 Shipt_Select.php:8 -#: StockLocMovements.php:13 StockLocStatus.php:26 Suppliers.php:302 -#: SupplierTenders.php:260 SupplierTenders.php:317 SupplierTransInquiry.php:11 -#: TaxGroups.php:15 TaxProvinces.php:10 TopItems.php:65 -#: WhereUsedInquiry.php:18 WorkCentres.php:110 WorkCentres.php:157 -#: WorkOrderCosting.php:12 WorkOrderEntry.php:10 WorkOrderIssue.php:20 -#: WorkOrderReceive.php:13 WorkOrderStatus.php:41 WWW_Access.php:11 -#: WWW_Users.php:32 Z_BottomUpCosts.php:51 +#: StockLocMovements.php:13 StockLocStatus.php:27 SupplierTenders.php:260 +#: SupplierTenders.php:317 SupplierTransInquiry.php:10 Suppliers.php:302 +#: TaxGroups.php:15 TaxProvinces.php:11 TopItems.php:77 WWW_Access.php:11 +#: WWW_Users.php:31 WhereUsedInquiry.php:18 WorkCentres.php:111 +#: WorkCentres.php:162 WorkOrderCosting.php:13 WorkOrderEntry.php:11 +#: WorkOrderIssue.php:22 WorkOrderReceive.php:15 WorkOrderStatus.php:42 +#: Z_BottomUpCosts.php:51 msgid "Search" msgstr "Vyhledávání" -#: AccountGroups.php:231 +#: AccountGroups.php:227 msgid "Group... [truncated message content] |
From: <dai...@us...> - 2011-11-04 04:56:35
|
Revision: 4739 http://web-erp.svn.sourceforge.net/web-erp/?rev=4739&view=rev Author: daintree Date: 2011-11-04 04:56:22 +0000 (Fri, 04 Nov 2011) Log Message: ----------- number_formatting Modified Paths: -------------- trunk/CustomerReceipt.php trunk/DailySalesInquiry.php trunk/PDFReceipt.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/DefineReceiptClass.php trunk/install/save.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/CustomerReceipt.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -16,7 +16,6 @@ unset($_SESSION['ReceiptBatch']->Items); unset($_SESSION['ReceiptBatch']); unset($_SESSION['CustomerRecord']); - } if (isset($_POST['Cancel'])) { @@ -27,7 +26,11 @@ $_POST['GLEntry']=1; } -if ((isset($_POST['BatchInput']) and $_POST['BankAccount']=='') or (isset($_POST['Process']) and $_POST['BankAccount']=='')) { +if ((isset($_POST['BatchInput']) + AND $_POST['BankAccount']=='') + OR (isset($_POST['Process']) + AND $_POST['BankAccount']=='')) { + echo '<br />'; prnMsg(_('A bank account must be selected for this receipt'), 'warn'); $BankAccountEmpty=TRUE; @@ -37,13 +40,17 @@ $BankAccountEmpty=FALSE; } -if (!isset($_GET['Delete']) AND isset($_SESSION['ReceiptBatch'])){ //always process a header update unless deleting an item +if (!isset($_GET['Delete']) AND isset($_SESSION['ReceiptBatch'])){ + //always process a header update unless deleting an item - $_SESSION['ReceiptBatch']->Account = $_POST['BankAccount']; /*Get the bank account currency and set that too */ - $SQL = "SELECT bankaccountname, currcode FROM bankaccounts WHERE accountcode='" . $_POST['BankAccount']."'"; + $SQL = "SELECT bankaccountname, + currcode + FROM bankaccounts + WHERE accountcode='" . $_POST['BankAccount']."'"; + $ErrMsg =_('The bank account name cannot be retrieved because'); $result= DB_query($SQL,$db,$ErrMsg); @@ -69,7 +76,7 @@ prnMsg(_('The exchange rate entered should be numeric'),'warn'); } } - if (isset($_POST['FunctionalExRate']) and $_POST['FunctionalExRate']!=''){ + if (isset($_POST['FunctionalExRate']) AND $_POST['FunctionalExRate']!=''){ if (is_numeric(filter_number_format($_POST['FunctionalExRate']))){ $_SESSION['ReceiptBatch']->FunctionalExRate=filter_number_format($_POST['FunctionalExRate']); //ex rate between receipt currency and account currency } else { @@ -119,14 +126,14 @@ */ /*Get suggested FunctionalExRate */ - $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->AccountCurrency . "'",$db); - $myrow = DB_fetch_row($result); - $SuggestedFunctionalExRate = $myrow[0]; - + $result = DB_query("SELECT rate, decimalplaces FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->AccountCurrency . "'",$db); + $myrow = DB_fetch_array($result); + $SuggestedFunctionalExRate = $myrow['rate']; + $_SESSION['ReceiptBatch']->CurrDecimalPlaces = $myrow['decimalplaces']; /*Get the exchange rate between the functional currency and the receipt currency*/ $result = DB_query("SELECT rate FROM currencies WHERE currabrev='" . $_SESSION['ReceiptBatch']->Currency . "'",$db); - $myrow = DB_fetch_row($result); - $tableExRate = $myrow[0]; //this is the rate of exchange between the functional currency and the receipt currency + $myrow = DB_fetch_array($result); + $tableExRate = $myrow['rate']; //this is the rate of exchange between the functional currency and the receipt currency /*Calculate cross rate to suggest appropriate exchange rate between receipt currency and account currency */ $SuggestedExRate = $tableExRate/$SuggestedFunctionalExRate; } //end else account currency != functional currency @@ -156,17 +163,17 @@ $_POST['CustomerName']=''; } - if ($_POST['GLCode'] == '' and $_GET['Type']=='GL') { + if ($_POST['GLCode'] == '' AND $_GET['Type']=='GL') { prnMsg( _('No General Ledger code has been chosen') . ' - ' . _('so this GL analysis item could not be added'),'warn'); } else { - $_SESSION['ReceiptBatch']->add_to_batch($_POST['Amount'], - $_POST['CustomerID'], - $_POST['Discount'], - $_POST['Narrative'], - $_POST['GLCode'], - $_POST['PayeeBankDetail'], - $_POST['CustomerName'], - $_POST['tag']); + $_SESSION['ReceiptBatch']->add_to_batch(filter_number_format($_POST['Amount']), + $_POST['CustomerID'], + filter_number_format($_POST['Discount']), + $_POST['Narrative'], + $_POST['GLCode'], + $_POST['PayeeBankDetail'], + $_POST['CustomerName'], + $_POST['tag']); /*Make sure the same receipt is not double processed by a page refresh */ $Cancel = 1; @@ -228,13 +235,20 @@ $k=0; //Table row counter for row styles $CustomerReceiptCounter=1; //Count lines of customer receipts in this batch - echo '<br /><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="" />' . ' ' . _('Summary of Receipt Batch').'</p><br />'; + echo '<br /> + <p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="" />' . ' ' . _('Summary of Receipt Batch').' + </p> + <br />'; - echo '<table class=selection><tr><th>'._('Batch Number').'</th> + echo '<table class="selection"> + <tr> + <th>'._('Batch Number').'</th> <th>' . _('Date Banked') . '</th> <th>' . _('Customer Name') . '</th> <th>' . _('GL Code') . '</th> - <th>' . _('Amount of Receipt').'</th></tr>'; + <th>' . _('Amount of Receipt').'</th> + </tr>'; foreach ($_SESSION['ReceiptBatch']->Items as $ReceiptItem) { @@ -254,7 +268,7 @@ <td>'.$_SESSION['ReceiptBatch']->DateBanked.'</td> <td>'.$ReceiptItem->CustomerName.'</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> - <td class=number>'.locale_number_format($ReceiptItem->Amount/$_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate,2) .'</td>'; + <td class="number">'.locale_number_format($ReceiptItem->Amount/$_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) .'</td>'; if ($ReceiptItem->GLCode ==''){ echo '<td><a target="_blank" href="' . $rootpath . '/PDFReceipt.php?BatchNumber=' . $_SESSION['ReceiptBatch']->BatchNo. '&ReceiptNumber='.$CustomerReceiptCounter.'">'._('Print a Customer Receipt').'</a></td></tr>'; @@ -527,7 +541,8 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="">' . ' ' . '<a href="' . $rootpath . '/PDFBankingSummary.php?BatchNo=' . $_SESSION['ReceiptBatch']->BatchNo . '">' . _('Print PDF Batch Summary') . '</a></p>'; echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/allocation.png" title="' . _('Allocate') . '" alt="">' . ' ' . '<a href="' . $rootpath . '/CustomerAllocations.php">' . _('Allocate Receipts') . '</a></p>'; - echo '<p class="page_title_text">• ' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer ' . _('Enter Receipts') . ' </p>'; + echo '<p class="page_title_text"><a href="' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a> + </p>'; unset($_SESSION['ReceiptBatch']); include('includes/footer.inc'); @@ -541,7 +556,10 @@ if ($_POST['Keywords'] AND $_POST['CustCode']) { $msg=_('Customer name keywords have been used in preference to the customer code extract entered'); } - if ($_POST['Keywords']=="" AND $_POST['CustCode']=="" AND $_POST['CustInvNo']=="") { + if ($_POST['Keywords']=='' + AND $_POST['CustCode']=='' + AND $_POST['CustInvNo']=='') { + $msg=_('At least one Customer Name keyword OR an extract of a Customer Code must be entered for the search'); } else { if (mb_strlen($_POST['Keywords'])>0) { @@ -549,24 +567,24 @@ $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name - FROM debtorsmaster - WHERE debtorsmaster.name " . LIKE . " '". $SearchString . "' - AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; + debtorsmaster.name + FROM debtorsmaster + WHERE debtorsmaster.name " . LIKE . " '". $SearchString . "' + AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } elseif (mb_strlen($_POST['CustCode'])>0){ $SQL = "SELECT debtorsmaster.debtorno, - debtorsmaster.name - FROM debtorsmaster - WHERE debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' - AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; + debtorsmaster.name + FROM debtorsmaster + WHERE debtorsmaster.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' + AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } elseif (mb_strlen($_POST['CustInvNo'])>0){ $SQL = "SELECT debtortrans.debtorno, - debtorsmaster.name - FROM debtorsmaster LEFT JOIN debtortrans - ON debtorsmaster.debtorno=debtortrans.debtorno - WHERE debtortrans.transno " . LIKE . " '%" . $_POST['CustInvNo'] . "%' - AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; + debtorsmaster.name + FROM debtorsmaster LEFT JOIN debtortrans + ON debtorsmaster.debtorno=debtortrans.debtorno + WHERE debtortrans.transno " . LIKE . " '%" . $_POST['CustInvNo'] . "%' + AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } $CustomerSearchResult = DB_query($SQL,$db,'','',false,false); @@ -609,6 +627,7 @@ debtorsmaster.currcode, currencies.currency, currencies.rate, + currencies.decimalplaces AS currdecimalplaces, paymentterms.terms, debtorsmaster.creditlimit, holdreasons.dissallowinvoices, @@ -629,21 +648,21 @@ ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1','MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END END) AS overdue2 - FROM debtorsmaster, - paymentterms, - holdreasons, - currencies, - debtortrans - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "' - AND debtorsmaster.debtorno = debtortrans.debtorno + FROM debtorsmaster INNER JOIN paymentterms + ON debtorsmaster.paymentterms = paymentterms.termsindicator + INNER JOIN holdreasons + ON debtorsmaster.holdreason = holdreasons.reasoncode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + INNER JOIN debtortrans + ON debtorsmaster.debtorno = debtortrans.debtorno + WHERE debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "' GROUP BY debtorsmaster.name, debtorsmaster.pymtdiscount, debtorsmaster.currcode, currencies.currency, currencies.rate, + currencies.decimalplaces, paymentterms.terms, debtorsmaster.creditlimit, paymentterms.daysbeforedue, @@ -667,19 +686,19 @@ debtorsmaster.pymtdiscount, currencies.currency, currencies.rate, + currencies.decimalplaces AS currdecimalplaces, paymentterms.terms, debtorsmaster.creditlimit, debtorsmaster.currcode, holdreasons.dissallowinvoices, holdreasons.reasondescription - FROM debtorsmaster, - paymentterms, - holdreasons, - currencies - WHERE debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtorsmaster.currcode = currencies.currabrev - AND debtorsmaster.holdreason = holdreasons.reasoncode - AND debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "'"; + FROM debtorsmaster INNER JOIN paymentterms + ON debtorsmaster.paymentterms = paymentterms.termsindicator + INNER JOIN holdreasons + ON debtorsmaster.holdreason = holdreasons.reasoncode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE debtorsmaster.debtorno = '" . $_POST['CustomerID'] . "'"; $ErrMsg = _('The customer details could not be retrieved because'); $DbgMsg = _('The SQL that failed was'); @@ -708,11 +727,10 @@ /*show the batch header details and the entries in the batch so far */ $SQL = "SELECT bankaccountname, - bankaccounts.accountcode, - bankaccounts.currcode - FROM bankaccounts, - chartmaster - WHERE bankaccounts.accountcode=chartmaster.accountcode"; + bankaccounts.accountcode, + bankaccounts.currcode + FROM bankaccounts INNER JOIN chartmaster + ON bankaccounts.accountcode=chartmaster.accountcode"; $ErrMsg = _('The bank accounts could not be retrieved because'); @@ -725,11 +743,17 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Enter Receipt') . '" alt="">' . ' ' . _('Enter Customer Receipt') . '</p>'; echo '<div class="page_help_text">' . _('To enter a payment TO a customer (ie. to pay out a credit note), enter a negative payment amount.') . '</div>'; } -echo '<br /><table class=selection><tr><td>' . _('Bank Account') . ':</td> - <td><select tabindex=1 name="BankAccount" onChange="ReloadForm(form1.BatchInput)">'; +echo '<br /> + <table class="selection"> + <tr> + <td>' . _('Bank Account') . ':</td> + <td><select tabindex="1" name="BankAccount" onChange="ReloadForm(form1.BatchInput)">'; if (DB_num_rows($AccountsResults)==0){ - echo '</select></td></tr></table><p>'; + echo '</select></td> + </tr> + </table> + <p />'; prnMsg(_('Bank Accounts have not yet been defined') . '. ' . _('You must first') . ' ' . '<a href="' . $rootpath . '/BankAccounts.php">' . _('define the bank accounts') . '</a>' . _('and general ledger accounts to be affected'),'info'); include('includes/footer.inc'); exit; @@ -743,23 +767,27 @@ echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['bankaccountname']. ' - ' . $myrow['currcode'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } if (!Is_Date($_SESSION['ReceiptBatch']->DateBanked)){ $_SESSION['ReceiptBatch']->DateBanked = Date($_SESSION['DefaultDateFormat']); } -echo '<tr><td>' . _('Date Banked') . ':</td> - <td><input tabindex=2 type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DateBanked" maxlength=10 size=10 onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['ReceiptBatch']->DateBanked . '"></td></tr>'; -echo '<tr><td>' . _('Currency') . ':</td> - <td><select tabindex=3 name="Currency" onChange="ReloadForm(form1.BatchInput)">'; +echo '<tr> + <td>' . _('Date Banked') . ':</td> + <td><input tabindex="2" type="text" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="DateBanked" maxlength="10" size="10" onChange="isDate(this, this.value, '."'".$_SESSION['DefaultDateFormat']."'".')" value="' . $_SESSION['ReceiptBatch']->DateBanked . '"></td> + </tr> + <tr> + <td>' . _('Currency') . ':</td> + <td><select tabindex="3" name="Currency" onChange="ReloadForm(form1.BatchInput)">'; if (!isset($_SESSION['ReceiptBatch']->Currency)){ $_SESSION['ReceiptBatch']->Currency=$_SESSION['CompanyRecord']['currencydefault']; } -$SQL = 'SELECT currency, currabrev, rate FROM currencies'; +$SQL = "SELECT currency, currabrev, rate FROM currencies"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ echo '</select></td></tr>'; @@ -773,7 +801,8 @@ echo '<option value="' . $myrow['currabrev'] . '">' . $myrow['currency'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } @@ -793,26 +822,33 @@ if ($_SESSION['ReceiptBatch']->ExRate==1 AND isset($SuggestedExRate)){ $_SESSION['ReceiptBatch']->ExRate = $SuggestedExRate; } - echo '<tr><td>' . _('Receipt Exchange Rate') . ':</td> - <td><input tabindex=4 type="text" name="ExRate" maxlength=10 size=12 class=number value="' . $_SESSION['ReceiptBatch']->ExRate . '"></td> - <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the receipt') . '. 1 ' . $_SESSION['ReceiptBatch']->AccountCurrency . ' = ? ' . $_SESSION['ReceiptBatch']->Currency . '</i></td></tr>'; + echo '<tr> + <td>' . _('Receipt Exchange Rate') . ':</td> + <td><input tabindex="4" type="text" name="ExRate" maxlength="10" size="12" class="number" value="' . locale_number_format($_SESSION['ReceiptBatch']->ExRate,6) . '" /></td> + <td>' . locale_number_format($SuggestedExRateText,6) . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the receipt') . '. 1 ' . $_SESSION['ReceiptBatch']->AccountCurrency . ' = ? ' . $_SESSION['ReceiptBatch']->Currency . '</i></td> + </tr>'; } if ($_SESSION['ReceiptBatch']->AccountCurrency!=$_SESSION['CompanyRecord']['currencydefault'] - AND isset($_SESSION['ReceiptBatch']->AccountCurrency)){ + AND isset($_SESSION['ReceiptBatch']->AccountCurrency)){ if (isset($SuggestedFunctionalExRate)){ - $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,4) . '</b>'; + $SuggestedFunctionalExRateText = '<b>' . _('Suggested rate:') . ' ' . locale_number_format($SuggestedFunctionalExRate,6) . '</b>'; } else { $SuggestedFunctionalExRateText =''; } if ($_SESSION['ReceiptBatch']->FunctionalExRate==1 AND isset($SuggestedFunctionalExRate)){ $_SESSION['ReceiptBatch']->FunctionalExRate = $SuggestedFunctionalExRate; } - echo '<tr><td>' . _('Functional Exchange Rate') . ':</td><td><input tabindex=5 type="text" name="FunctionalExRate" class=number maxlength=10 size=12 value="' . $_SESSION['ReceiptBatch']->FunctionalExRate . '"></td> - <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['ReceiptBatch']->AccountCurrency . '</i></td></tr>'; + echo '<tr> + <td>' . _('Functional Exchange Rate') . ':</td> + <td><input tabindex="5" type="text" name="FunctionalExRate" class="number" maxlength="10" size="12" value="' . locale_number_format($_SESSION['ReceiptBatch']->FunctionalExRate,6) . '" /></td> + <td>' . ' ' . $SuggestedFunctionalExRateText . ' <i>' . _('The exchange rate between the currency of the business (the functional currency) and the currency of the bank account') . '. 1 ' . $_SESSION['CompanyRecord']['currencydefault'] . ' = ? ' . $_SESSION['ReceiptBatch']->AccountCurrency . '</i></td> + </tr>'; } -echo '<tr><td>' . _('Receipt Type') . ':</td><td><select tabindex=6 name="ReceiptType">'; +echo '<tr> + <td>' . _('Receipt Type') . ':</td> + <td><select tabindex="6" name="ReceiptType">'; include('includes/GetPaymentMethods.php'); /* The array ReceiptTypes is defined from the setup tab of the main menu under payment methods - the array is populated from the include file GetPaymentMethods.php */ @@ -824,13 +860,24 @@ echo '<option value="' .$RcptType . '">' . $RcptType .'</option>'; } } -echo '</select></td></tr>'; +echo '</select></td> + </tr>'; if (!isset($_SESSION['ReceiptBatch']->Narrative)) { $_SESSION['ReceiptBatch']->Narrative=''; } -echo '<tr><td>' . _('Narrative') . ':</td><td><input tabindex=7 type="text" name="BatchNarrative" maxlength=50 size=52 value="' . $_SESSION['ReceiptBatch']->Narrative . '"></td></tr>'; -echo '<tr><td colspan=3><div class="centre"><input tabindex=8 type=submit name="BatchInput" Value="' . _('Accept') . '"></div></td></tr>'; -echo '</table><br />'; +echo '<tr> + <td>' . _('Narrative') . ':</td> + <td><input tabindex="7" type="text" name="BatchNarrative" maxlength="50" size="52" value="' . $_SESSION['ReceiptBatch']->Narrative . '" /></td> + </tr> + <tr> + <td colspan="3"> + <div class="centre"> + <input tabindex="8" type="submit" name="BatchInput" value="' . _('Accept') . '" /> + </div> + </td> + </tr> + </table> + <br />'; if (isset($_SESSION['ReceiptBatch'])){ /* Now show the entries made so far */ @@ -840,13 +887,14 @@ $_SESSION['ReceiptBatch']->BankAccountName . ' ' . _('on') . ' ' . $_SESSION['ReceiptBatch']->DateBanked . '</p>'; } - echo '<table width="90%" class=selection><tr> + echo '<table width="90%" class="selection"> + <tr> <th>' . _('Amount') . ' ' . _('Received') . '</th> <th>' . _('Discount') . '</th> <th>' . _('Customer') . '</th> <th>' . _('GL Code') . '</th> <th>' . _('Narrative') . '</th> - </tr>'; + </tr>'; $BatchTotal = 0; @@ -857,8 +905,8 @@ $myrow=DB_fetch_array($Result); echo '<tr> - <td class=number>' . locale_number_format($ReceiptItem->Amount,2) . '</td> - <td class=number>' . locale_number_format($ReceiptItem->Discount,2) . '</td> + <td class="number">' . locale_number_format($ReceiptItem->Amount,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) . '</td> + <td class="number">' . locale_number_format($ReceiptItem->Discount,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) . '</td> <td>' . stripslashes($ReceiptItem->CustomerName) . '</td> <td>'.$ReceiptItem->GLCode.' - '.$myrow['accountname'].'</td> <td>'.$ReceiptItem->Narrative . '</td> @@ -867,7 +915,10 @@ $BatchTotal= $BatchTotal + $ReceiptItem->Amount; } - echo '<tr><td class=number><b>' . locale_number_format($BatchTotal,2) . '</b></td></tr></table>'; + echo '<tr> + <td class="number"><b>' . locale_number_format($BatchTotal,$_SESSION['ReceiptBatch']->CurrDecimalPlaces) . '</b></td> + </tr> + </table>'; } /*this next block of ifs deals with what information to display for input into the form @@ -897,43 +948,51 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . $_SESSION['CustomerRecord']['name'] . ' - (' . _('All amounts stated in') . ' ' . $_SESSION['CustomerRecord']['currency'] . ')' . _('Terms') . ': ' . $_SESSION['CustomerRecord']['terms'] . '<br/>' . _('Credit Limit') . ': ' . locale_number_format($_SESSION['CustomerRecord']['creditlimit'],0) . ' ' . _('Credit Status') . ': ' . $_SESSION['CustomerRecord']['reasondescription']; if ($_SESSION['CustomerRecord']['dissallowinvoices']!=0){ - echo '<br /><font color=red size=4><b>' . _('ACCOUNT ON HOLD') . '</font></b><br/>'; + echo '<br /> + <font color="red" size="4"><b>' . _('ACCOUNT ON HOLD') . '</font></b> + <br/>'; } - echo '<table width="90%" class=selection> + echo '<table width="90%" class="selection"> <tr> - <th width=20%>' . _('Total Balance') . '</th> - <th width=20%>' . _('Current') . '</th> - <th width=20%>' . _('Now Due') . '</th> - <th width=20%>' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> - <th width=20%>' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + <th width="20%">' . _('Total Balance') . '</th> + <th width="20%">' . _('Current') . '</th> + <th width="20%">' . _('Now Due') . '</th> + <th width="20%">' . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> + <th width="20%">' . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th> </tr>'; echo '<tr> - <td class=number>' . locale_number_format($_SESSION['CustomerRecord']['balance'],2) . '</td> - <td class=number>' . locale_number_format(($_SESSION['CustomerRecord']['balance'] - $_SESSION['CustomerRecord']['due']),2) . '</td> - <td class=number>' . locale_number_format(($_SESSION['CustomerRecord']['due']-$_SESSION['CustomerRecord']['overdue1']),2) . '</td> - <td class=number>' . locale_number_format(($_SESSION['CustomerRecord']['overdue1']-$_SESSION['CustomerRecord']['overdue2']) ,2) . '</td> - <td class=number>' . locale_number_format($_SESSION['CustomerRecord']['overdue2'],2) . '</td> + <td class="number">' . locale_number_format($_SESSION['CustomerRecord']['balance'],$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format(($_SESSION['CustomerRecord']['balance'] - $_SESSION['CustomerRecord']['due']),$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format(($_SESSION['CustomerRecord']['due']-$_SESSION['CustomerRecord']['overdue1']),$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format(($_SESSION['CustomerRecord']['overdue1']-$_SESSION['CustomerRecord']['overdue2']) ,$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> + <td class="number">' . locale_number_format($_SESSION['CustomerRecord']['overdue2'],$_SESSION['CustomerRecord']['currdecimalplaces']) . '</td> </tr> - </table><br />'; + </table> + <br />'; echo '<table class="selection">'; $DisplayDiscountPercent = locale_number_format($_SESSION['CustomerRecord']['pymtdiscount']*100,2) . '%'; - echo '<input type="hidden" name="CustomerID" value="' . $_POST['CustomerID'] . '">'; - echo '<input type="hidden" name="CustomerName" value="' . $_SESSION['CustomerRecord']['name'] . '">'; + echo '<input type="hidden" name="CustomerID" value="' . $_POST['CustomerID'] . '" />'; + echo '<input type="hidden" name="CustomerName" value="' . $_SESSION['CustomerRecord']['name'] . '" />'; } if (isset($_POST['GLEntry']) AND isset($_SESSION['ReceiptBatch'])){ /* Set up a heading for the transaction entry for a GL Receipt */ - echo '<br /><table class=selection>'; - echo '<th colspan=2><font size=2 color=navy>' . _('General Ledger Receipt Entry') . '</font></th>'; + echo '<br /> + <table class="selection"> + <tr> + <th colspan="2"><font size="2" color="navy">' . _('General Ledger Receipt Entry') . '</font></th> + </tr>'; //Select the tag - echo '<tr><td>' . _('Select Tag') . ':</td><td><select name="tag">'; + echo '<tr> + <td>' . _('Select Tag') . ':</td> + <td><select name="tag">'; $SQL = "SELECT tagref, tagdescription @@ -949,15 +1008,20 @@ echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; // End select tag /*now set up a GLCode field to select from avaialble GL accounts */ - echo '<tr><td>' . _('GL Account') . ':</td><td><select tabindex=8 name="GLCode">'; - $SQL = 'SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode'; + echo '<tr> + <td>' . _('GL Account') . ':</td> + <td><select tabindex="8" name="GLCode">'; + + $SQL = "SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode"; $result=DB_query($SQL,$db); if (DB_num_rows($result)==0){ - echo '</select>' . _('No General ledger accounts have been set up yet') . ' - ' . _('receipts cannot be entered against GL accounts until the GL accounts are set up') . '</td></tr>'; + echo '</select>' . _('No General ledger accounts have been set up yet') . ' - ' . _('receipts cannot be entered against GL accounts until the GL accounts are set up') . '</td> + </tr>'; } else { echo '<option value=""></option>'; while ($myrow=DB_fetch_array($result)){ @@ -967,9 +1031,9 @@ echo '<option value=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' - ' . $myrow['accountname'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } - } /*if either a customer is selected or its a GL Entry then set out @@ -977,9 +1041,9 @@ if (((isset($_SESSION['CustomerRecord']) AND isset($_POST['CustomerID']) - AND $_POST['CustomerID']!="") + AND $_POST['CustomerID']!='') OR isset($_POST['GLEntry'])) - AND isset($_SESSION['ReceiptBatch'])){ + AND isset($_SESSION['ReceiptBatch'])){ if (!isset($_POST['Amount'])) { $_POST['Amount']=0; @@ -993,52 +1057,71 @@ if (!isset($_POST['Narrative'])) { $_POST['Narrative']=''; } - echo '<tr><td>' . _('Amount of Receipt') . ':</td> - <td><input tabindex=9 type="text" name="Amount" maxlength=12 size=13 class=number value="' . $_POST['Amount'] . '"></td> - </tr>'; + echo '<tr> + <td>' . _('Amount of Receipt') . ':</td> + <td><input tabindex="9" type="text" name="Amount" maxlength="12" size="13" class="number" value="' . $_POST['Amount'] . '" /></td> + </tr>'; if (!isset($_POST['GLEntry'])){ - echo '<tr><td>' . _('Amount of Discount') . ':</td> - <td><input tabindex=10 type="text" name="Discount" maxlength=12 size=13 class=number value="' . $_POST['Discount'] . '"> ' . _('agreed prompt payment discount is') . ' ' . $DisplayDiscountPercent . '</td></tr>'; + echo '<tr> + <td>' . _('Amount of Discount') . ':</td> + <td><input tabindex="10" type="text" name="Discount" maxlength="12" size="13" class="number" value="' . $_POST['Discount'] . '" /> ' . _('agreed prompt payment discount is') . ' ' . $DisplayDiscountPercent . '</td></tr>'; } else { - echo '<input tabindex=11 type="hidden" name="Discount" Value=0>'; + echo '<input tabindex=11 type="hidden" name="Discount" value="0" />'; } - echo '<tr><td>' . _('Payee Bank Details') . ':</td> - <td><input tabindex=12 type="text" name="PayeeBankDetail" maxlength=22 size=20 value="' . $_POST['PayeeBankDetail'] . '"></td></tr>'; + echo '<tr> + <td>' . _('Payee Bank Details') . ':</td> + <td><input tabindex="12" type="text" name="PayeeBankDetail" maxlength="22" size="20" value="' . $_POST['PayeeBankDetail'] . '" /></td> + </tr>'; // echo '<tr><td>' . _('Narrative') . ':</td> // <td><input tabindex=13 type="text" name="Narrative" maxlength=30 size=32 value="' . $_POST['Narrative'] . '"></td></tr>'; - echo '<td>' . _('Narrative') . ':</td>'; - echo '<td><textarea name="Narrative" cols=40 rows=1></textarea></td>'; - echo '</table>'; - echo '<br /><div class="centre"><input tabindex=14 type="submit" name="Process" value="' . _('Accept') . '">'; - echo '<input tabindex=14 type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; + echo '<td>' . _('Narrative') . ':</td> + <td><textarea name="Narrative" cols="40" rows="1"></textarea></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="14" type="submit" name="Process" value="' . _('Accept') . '" /> + <input tabindex="15" type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div>'; -} elseif (isset($_SESSION['ReceiptBatch']) AND !isset($_POST['GLEntry'])){ +} elseif (isset($_SESSION['ReceiptBatch']) + AND !isset($_POST['GLEntry'])){ /*Show the form to select a customer */ echo '<br />'; - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Select a Customer') . '</b>'; - echo '<table cellpadding=3 colspan=4 class=selection>'; - echo '<tr><td>' . _('Text in the Customer') . ' ' . '<b>' . _('name') . '</b>:</td>'; - echo '<td><input tabindex=9 type="text" name="Keywords" size=15 maxlength=25></td>'; - echo '<td><font size=3><b>' . _('OR') . '</b></font></td>'; - echo '<td>' . _('Text extract in the Customer') . ' ' . '<b>' . _('code') . '</b>:</td>'; - echo '<td><input tabindex=10 type="text" name="CustCode" size=10 maxlength=18></td>'; - echo '<td><font size=3><b>' . _('OR') . '</b></font></td>'; - echo '<td>' . _('Customer invoice number') . ':</td>'; - echo '<td><input tabindex=11 type="text" name="CustInvNo" size=8 maxlength=8></td>'; - echo '</tr></table>'; - echo '<div class="centre"><br />'; - echo '<input tabindex=11 type=submit name="Search" value="' . _('Search Now') . '">'; - echo '<br/><br/><input tabindex=12 type=submit name="GLEntry" value="' . _('Enter A GL Receipt') . '"><br /></div>'; + echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="">' . ' ' . _('Select a Customer') . '</b> + <table class="selection"> + <tr> + <td>' . _('Text in the Customer') . ' ' . '<b>' . _('name') . '</b>:</td> + <td><input tabindex="9" type="text" name="Keywords" size="15" maxlength="25" /></td> + <td><font size="3"><b>' . _('OR') . '</b></font></td> + <td>' . _('Text extract in the Customer') . ' ' . '<b>' . _('code') . '</b>:</td> + <td><input tabindex="10" type="text" name="CustCode" size="10" maxlength="18" /></td> + <td><font size="3"><b>' . _('OR') . '</b></font></td> + <td>' . _('Customer invoice number') . ':</td> + <td><input tabindex="11" type="text" name="CustInvNo" size="8" maxlength="8" /></td> + </tr> + </table> + <div class="centre"> + <br /> + <input tabindex="11" type="submit" name="Search" value="' . _('Search Now') . '" /> + <br/> + <br/> + <input tabindex="12" type="submit" name="GLEntry" value="' . _('Enter A GL Receipt') . '" /> + <br /> + </div>'; if (isset($CustomerSearchResult)) { - echo '<table cellpadding=2 colspan=7 class=selection>'; - $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Customer Name') . '</th></tr>'; + echo '<table class="selection">'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Customer Name') . '</th> + </tr>'; echo $TableHeader; $j = 1; $k = 0; //row counter to determine background colour @@ -1052,9 +1135,9 @@ echo '<tr class="EvenTableRows">'; $k=1; } - printf('<td><font size=1> - <input tabindex='.locale_number_format(12+$j).' type=submit name="Select" value="%s"></font></td> - <td>%s</td></tr>', + printf('<td><font size=1><input tabindex="'. strval(12+$j).'" type="submit" name="Select" value="%s" /></font></td> + <td>%s</td> + </tr>', $myrow['debtorno'], $myrow['name']); @@ -1074,8 +1157,11 @@ } if (isset($_SESSION['ReceiptBatch']->Items) and count($_SESSION['ReceiptBatch']->Items) > 0){ - echo '<div class="centre"><br/><input tabindex="13" type="submit" name="CommitBatch" value="' . _('Accept and Process Batch') . '"></div>'; + echo '<div class="centre"> + <br/> + <input tabindex="13" type="submit" name="CommitBatch" value="' . _('Accept and Process Batch') . '" /> + </div>'; } echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/DailySalesInquiry.php =================================================================== --- trunk/DailySalesInquiry.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/DailySalesInquiry.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -5,7 +5,6 @@ include('includes/session.inc'); $title = _('Daily Sales Inquiry'); include('includes/header.inc'); -include('includes/DefineCartClass.php'); echo '<p class="page_title_text"> <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Daily Sales') . '" alt="" />' . ' ' . _('Daily Sales') . ' @@ -21,16 +20,18 @@ <td>' . _('Month to Show') . ':</td> <td><select tabindex="1" name="MonthToShow">'; - if (!isset($_POST['MonthToShow'])){ $_POST['MonthToShow'] = GetPeriod(Date($_SESSION['DefaultDateFormat']),$db); + $Result = DB_query("SELECT lastdate_in_period FROM periods WHERE period='" . $_POST['MonthToShow'] . "'",$db); + $myrow = DB_fetch_array($Result); + $EndDateSQL = $myrow['lastdate_in_period']; } $PeriodsResult = DB_query("SELECT periodno, lastdate_in_period FROM periods",$db); while ($PeriodRow = DB_fetch_array($PeriodsResult)){ if ($_POST['MonthToShow']==$PeriodRow['periodno']) { - echo '<option selected Value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; + echo '<option selected value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; $EndDateSQL = $PeriodRow['lastdate_in_period']; } else { echo '<option value="' . $PeriodRow['periodno'] . '">' . MonthAndYearFromSQLDate($PeriodRow['lastdate_in_period']) . '</option>'; Modified: trunk/PDFReceipt.php =================================================================== --- trunk/PDFReceipt.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/PDFReceipt.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -46,23 +46,23 @@ $PageNumber++; -$sql="SELECT MIN(id) as start FROM debtortrans WHERE type=12 AND transno='". filer_locale_number_format($_GET['BatchNumber']). "'"; +$sql="SELECT MIN(id) as start FROM debtortrans WHERE type=12 AND transno='". $_GET['BatchNumber']. "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); $StartReceiptNumber=$myrow['start']; -$sql="SELECT debtorno, - ovamount, - invtext - FROM debtortrans - WHERE type=12 - AND transno='".$_GET['BatchNumber']."' - AND id='". $StartReceiptNumber-1+$_GET['ReceiptNumber'] ."'"; -$result=DB_query($sql, $db); -$myrow=DB_fetch_array($result); -$DebtorNo=$myrow['debtorno']; -$Amount=$myrow['ovamount']; -$Narrative=$myrow['invtext']; +$sql="SELECT debtorno, + ovamount, + invtext + FROM debtortrans + WHERE type=12 + AND transno='" . $_GET['BatchNumber'] . "' + AND id='". ($StartReceiptNumber-1+$_GET['ReceiptNumber']) ."'"; +$result = DB_query($sql, $db); +$myrow = DB_fetch_array($result); +$DebtorNo = $myrow['debtorno']; +$Amount = $myrow['ovamount']; +$Narrative = $myrow['invtext']; $sql="SELECT currency, decimalplaces @@ -76,13 +76,13 @@ $Currency=$myrow['currency']; $DecimalPlaces=$myrow['decimalplaces']; -$sql="SELECT name, - address1, - address2, - address3, - address4, - address5, - address6 +$sql="SELECT name, + address1, + address2, + address3, + address4, + address5, + address6 FROM debtorsmaster WHERE debtorno='".$DebtorNo."'"; Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/WWW_Users.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -33,8 +33,10 @@ // Make an array of the security roles $sql = "SELECT secroleid, - secrolename - FROM securityroles ORDER BY secroleid"; + secrolename + FROM securityroles + ORDER BY secroleid"; + $Sec_Result = DB_query($sql, $db); $SecurityRoles = array(); // Now load it into an a ray using Key/Value pairs @@ -72,7 +74,8 @@ } elseif (mb_strstr($_POST['Password'],$_POST['UserID'])!= False){ $InputError = 1; prnMsg(_('The password cannot contain the user id'),'error'); - } elseif ((mb_strlen($_POST['Cust'])>0) AND (mb_strlen($_POST['BranchCode'])==0)) { + } elseif ((mb_strlen($_POST['Cust'])>0) + AND (mb_strlen($_POST['BranchCode'])==0)) { $InputError = 1; prnMsg(_('If you enter a Customer Code you must also enter a Branch Code valid for this Customer'),'error'); } @@ -173,15 +176,15 @@ theme, language, pdflanguage) - VALUES ('" . DB_escape_string($_POST['UserID']) . "', - '" . DB_escape_string($_POST['RealName']) ."', - '" . DB_escape_string($_POST['Cust']) ."', - '" . DB_escape_string($_POST['BranchCode']) ."', - '" . DB_escape_string($_POST['SupplierID']) ."', + VALUES ('" . $_POST['UserID'] . "', + '" . $_POST['RealName'] ."', + '" . $_POST['Cust'] ."', + '" . $_POST['BranchCode'] ."', + '" . $_POST['SupplierID'] ."', '" . $_POST['Salesman'] . "', '" . CryptPass($_POST['Password']) ."', - '" . DB_escape_string($_POST['Phone']) . "', - '" . DB_escape_string($_POST['Email']) ."', + '" . $_POST['Phone'] . "', + '" . $_POST['Email'] ."', '" . $_POST['PageSize'] ."', '" . $_POST['Access'] . "', '" . $_POST['DefaultLocation'] ."', @@ -327,7 +330,7 @@ $SecurityRoles[($myrow['fullaccess'])], $myrow['pagesize'], $myrow['theme'], - $LanguagesArray[$myrow['language']], + $LanguagesArray[$myrow['language']]['LanguageName'], htmlspecialchars($_SERVER['PHP_SELF']) . '?', $myrow['userid'], htmlspecialchars($_SERVER['PHP_SELF']) . '?', Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/doc/Change.log 2011-11-04 04:56:22 UTC (rev 4739) @@ -5,6 +5,7 @@ 29/10/11 High-Tech Bridge SA Security Research Lab <adv...@ht...> - sanitising $_SERVER['PHP_SELF'] and unquoted sql in reportwriter/FormMaker.php and reportwriter/ReportMaker.php 15/10/11 Phil: Tried to get correct characters for each language's thousands separator and decimal point in includes/LanguagesArray.php 15/10/11 Phil: Updated PHPplot to 5.5.0 +15/10/11 Fred Schuettler aguapop - theme 8/10/11 Ricard: PcExpenses.php PcAuthorizeExpense.php now uses GL tags 8/10/11 Phil: SelectSalesOrder.php now allows for creation of purchase orders for the components of assembly items on sales orders. 29/9/11 Ricard: added new query critera to AuditTrail.php to look for text in query strings to enable searching for updates/inserts/deletes relating to a specified customer or item code etc Modified: trunk/includes/DefineReceiptClass.php =================================================================== --- trunk/includes/DefineReceiptClass.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/includes/DefineReceiptClass.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -14,6 +14,7 @@ var $ExRate; /*Exchange rate conversion between currency received and bank account currency */ var $FunctionalExRate; /* Exchange Rate between Bank Account Currency and Functional(business reporting) currency */ var $Currency; /*Currency being banked - defaulted to company functional */ + var $CurrDecimalPlaces; var $Narrative; var $ReceiptType; /*Type of receipt ie credit card/cash/cheque etc - array of types defined in config.php*/ var $total; /*Total of the batch of receipts in the currency of the company*/ Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/install/save.php 2011-11-04 04:56:22 UTC (rev 4739) @@ -298,7 +298,7 @@ $msg .= "\$CryptFunction = 'sha1';\n"; $msg .= "\$DefaultClock = 12;\n"; -$msg .= "\$rootpath = dirname(\htmlspecialchars($_SERVER['PHP_SELF']));\n"; +$msg .= "\$rootpath = dirname(htmlspecialchars(\$_SERVER['PHP_SELF']));\n"; $msg .= "if (isset(\$DirectoryLevelsDeep)){\n"; $msg .= " for (\$i=0;\$i<\$DirectoryLevelsDeep;\$i++){\n"; $msg .= "\$rootpath = mb_substr(\$rootpath,0, strrpos(\$rootpath,'/'));\n"; Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-10-30 09:17:27 UTC (rev 4738) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-11-04 04:56:22 UTC (rev 4739) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-09-11 19:23+1200\n" +"POT-Creation-Date: 2011-11-01 22:26+1300\n" "PO-Revision-Date: 2011-02-07 15:33+0000\n" "Last-Translator: Tim Schofield <Unknown>\n" "Language-Team: Czech <cs...@li...>\n" @@ -21,7 +21,7 @@ "X-Poedit-Language: Czech\n" "X-Poedit-SourceCharset: utf-8\n" -#: AccountGroups.php:7 index.php:1296 +#: AccountGroups.php:7 index.php:1298 msgid "Account Groups" msgstr "Účetní skupiny" @@ -41,8 +41,8 @@ "SQL příkaz použitý při získávání účetních skupin rodičovské účetní skupiny " "byl" -#: AccountGroups.php:57 AccountGroups.php:94 AccountGroups.php:178 -#: AccountGroups.php:188 +#: AccountGroups.php:57 AccountGroups.php:102 AccountGroups.php:174 +#: AccountGroups.php:184 msgid "The SQL that was used to retrieve the information was" msgstr "SQL, který byl použit k získání informace" @@ -58,16 +58,22 @@ msgid "The account group name cannot contain the character" msgstr "Název účetní skupiny nemůže obsahovat znak" -#: AccountGroups.php:71 TaxCategories.php:31 TaxProvinces.php:30 -#: UnitsOfMeasure.php:30 +#: AccountGroups.php:71 TaxCategories.php:31 msgid "or the character" msgstr "nebo znak" #: AccountGroups.php:77 +#, fuzzy +msgid "" +"The sequence that the account group is listed in the trial balance is " +"expected to be numeric" +msgstr "Množství uvedené pro převody Očekává se, že číselné" + +#: AccountGroups.php:85 msgid "The account group name must be at least one character long" msgstr "Název účetní skupiny musí být dlouhý minimálně jeden znak" -#: AccountGroups.php:84 +#: AccountGroups.php:92 msgid "" "The parent account group selected appears to result in a recursive account " "structure - select an alternative parent account group or make this group a " @@ -77,11 +83,11 @@ "účtu - vyberte alternativní mateřské účet skupiny nebo tuto skupinu na " "nejvyšší úrovni účtové skupiny" -#: AccountGroups.php:95 +#: AccountGroups.php:103 msgid "Could not check whether the group is recursive because" msgstr "Nepodařilo se zjistit, zda skupina je rekurzivní, protože" -#: AccountGroups.php:103 +#: AccountGroups.php:111 msgid "" "Since this account group is a child group, the sequence in the trial " "balance, the section in the accounts and whether or not the account group " @@ -90,47 +96,39 @@ "will have no effect." msgstr "" -#: AccountGroups.php:108 +#: AccountGroups.php:116 msgid "The section in accounts must be an integer" msgstr "Sekce v účtech musí být celé kladné číslo" -#: AccountGroups.php:114 -msgid "The sequence in the trial balance must be an integer" -msgstr "Pořadí v předvaze musí být celé číslo" - -#: AccountGroups.php:120 -msgid "The sequence in the TB must be numeric and less than" -msgstr "Pořadí v TB musí být číslo a méně než" - -#: AccountGroups.php:137 +#: AccountGroups.php:133 msgid "An error occurred in updating the account group" msgstr "Došlo k chybě při aktualizaci účtové skupiny" -#: AccountGroups.php:138 +#: AccountGroups.php:134 msgid "The SQL that was used to update the account group was" msgstr "SQL, který byl použit k aktualizaci účtu skupina byla" -#: AccountGroups.php:140 AccountSections.php:104 PaymentMethods.php:82 +#: AccountGroups.php:136 AccountSections.php:104 PaymentMethods.php:82 msgid "Record Updated" msgstr "Záznam aktualizován" -#: AccountGroups.php:158 +#: AccountGroups.php:154 msgid "An error occurred in inserting the account group" msgstr "Došlo k chybě při vkládání účtové skupiny" -#: AccountGroups.php:159 +#: AccountGroups.php:155 msgid "The SQL that was used to insert the account group was" msgstr "SQL, který byl použit pro vložení na účet skupina byla" -#: AccountGroups.php:160 AccountSections.php:116 PaymentMethods.php:103 +#: AccountGroups.php:156 AccountSections.php:116 PaymentMethods.php:103 msgid "Record inserted" msgstr "Záznam vložen" -#: AccountGroups.php:177 +#: AccountGroups.php:173 msgid "An error occurred in retrieving the group information from chartmaster" msgstr "Došlo k chybě při získávání informací od skupiny chartmaster" -#: AccountGroups.php:182 +#: AccountGroups.php:178 msgid "" "Cannot delete this account group because general ledger accounts have been " "created using this group" @@ -138,37 +136,37 @@ "Nelze smazat tento účet skupiny, protože účtů hlavní knihy byly vytvořeny " "pomocí této skupině" -#: AccountGroups.php:183 AccountGroups.php:193 AccountSections.php:137 -#: Areas.php:116 Areas.php:125 BankAccounts.php:158 CreditStatus.php:123 -#: Currencies.php:164 Currencies.php:172 Currencies.php:180 +#: AccountGroups.php:179 AccountGroups.php:189 AccountSections.php:137 +#: Areas.php:116 Areas.php:125 BankAccounts.php:158 CreditStatus.php:125 +#: Currencies.php:166 Currencies.php:174 Currencies.php:182 #: CustomerBranches.php:286 CustomerBranches.php:296 CustomerBranches.php:306 -#: CustomerBranches.php:316 Customers.php:312 Customers.php:321 -#: Customers.php:329 Customers.php:337 CustomerTypes.php:147 -#: CustomerTypes.php:157 Factors.php:134 FixedAssetCategories.php:129 -#: GLAccounts.php:80 GLAccounts.php:96 Locations.php:237 Locations.php:245 -#: Locations.php:256 Locations.php:265 Locations.php:274 Locations.php:283 -#: Locations.php:292 Locations.php:301 MRPDemandTypes.php:87 -#: PaymentMethods.php:138 PaymentTerms.php:144 PaymentTerms.php:151 -#: PcExpenses.php:152 SalesCategories.php:124 SalesCategories.php:131 -#: SalesPeople.php:149 SalesPeople.php:156 SalesTypes.php:150 -#: SalesTypes.php:160 Shippers.php:82 Shippers.php:94 StockCategories.php:179 -#: Stocks.php:604 Stocks.php:613 Stocks.php:621 Stocks.php:629 Stocks.php:637 -#: Stocks.php:645 Suppliers.php:609 Suppliers.php:618 Suppliers.php:626 -#: SupplierTypes.php:145 TaxCategories.php:131 TaxGroups.php:127 -#: TaxGroups.php:134 TaxProvinces.php:125 UnitsOfMeasure.php:138 -#: WorkCentres.php:89 WorkCentres.php:95 WWW_Access.php:83 +#: CustomerBranches.php:316 CustomerTypes.php:147 CustomerTypes.php:157 +#: Customers.php:289 Customers.php:298 Customers.php:306 Customers.php:314 +#: Factors.php:134 FixedAssetCategories.php:129 GLAccounts.php:80 +#: GLAccounts.php:96 Locations.php:237 Locations.php:245 Locations.php:256 +#: Locations.php:265 Locations.php:274 Locations.php:283 Locations.php:292 +#: Locations.php:301 MRPDemandTypes.php:87 PaymentMethods.php:138 +#: PaymentTerms.php:146 PaymentTerms.php:153 PcExpenses.php:158 +#: SalesCategories.php:124 SalesCategories.php:131 SalesPeople.php:150 +#: SalesPeople.php:157 SalesPeople.php:163 SalesTypes.php:140 +#: SalesTypes.php:150 Shippers.php:82 Shippers.php:94 StockCategories.php:181 +#: Stocks.php:615 Stocks.php:624 Stocks.php:632 Stocks.php:640 Stocks.php:648 +#: Stocks.php:656 SupplierTypes.php:145 Suppliers.php:612 Suppliers.php:621 +#: Suppliers.php:629 TaxCategories.php:131 TaxGroups.php:132 TaxGroups.php:140 +#: TaxProvinces.php:129 UnitsOfMeasure.php:135 WWW_Access.php:83 +#: WorkCentres.php:89 WorkCentres.php:95 msgid "There are" msgstr "Jsou zde" -#: AccountGroups.php:183 +#: AccountGroups.php:179 msgid "general ledger accounts that refer to this account group" msgstr "účtů hlavní knihy, které se vztahují k tomuto účtu skupině" -#: AccountGroups.php:187 +#: AccountGroups.php:183 msgid "An error occurred in retrieving the parent group information" msgstr "Došlo k chybě při načítání mateřské skupiny informací" -#: AccountGroups.php:192 +#: AccountGroups.php:188 msgid "" "Cannot delete this account group because it is a parent account group of " "other account group(s)" @@ -176,239 +174,237 @@ "Nelze smazat tento účet skupiny, protože se jedná o mateřskou účet skupinou " "dalších účtové skupiny (y)" -#: AccountGroups.php:193 +#: AccountGroups.php:189 msgid "account groups that have this group as its/there parent account group" msgstr "" "účet skupiny, které mají tuto skupinu jako jeho / je skupina rodičů účet" -#: AccountGroups.php:196 +#: AccountGroups.php:192 msgid "An error occurred in deleting the account group" msgstr "Došlo k chybě při mazání účtu skupiny" -#: AccountGroups.php:197 +#: AccountGroups.php:193 msgid "The SQL that was used to delete the account group was" msgstr "SQL, který byl použit smazat účet skupina byla" -#: AccountGroups.php:199 +#: AccountGroups.php:195 msgid "group has been deleted" msgstr "skupina byla smazána" -#: AccountGroups.php:224 +#: AccountGroups.php:220 msgid "The sql that was used to retrieve the account group information was " msgstr "Sql, který byl použit k načtení účtové skupiny informace " -#: AccountGroups.php:225 +#: AccountGroups.php:221 msgid "Could not get account groups because" msgstr "Nemohu získat účetní skupiny, protože" -#: AccountGroups.php:227 AccountSections.php:175 AddCustomerContacts.php:25 -#: AddCustomerContacts.php:28 AddCustomerNotes.php:101 -#: AddCustomerTypeNotes.php:95 AgedDebtors.php:454 AgedSuppliers.php:268 -#: Areas.php:144 AuditTrail.php:11 BankReconciliation.php:13 -#: BOMExtendedQty.php:259 BOMIndented.php:246 BOMIndentedReverse.php:236 -#: BOMInquiry.php:171 BOMListing.php:109 BOMs.php:208 BOMs.php:798 -#: COGSGLPostings.php:18 CompanyPreferences.php:153 CounterSales.php:2002 -#: CounterSales.php:2123 Credit_Invoice.php:255 CreditStatus.php:20 -#: Currencies.php:28 CustEDISetup.php:17 DailyBankTransactions.php:10 -#: DebtorsAtPeriodEnd.php:125 DiscountCategories.php:10 -#: DiscountCategories.php:131 DiscountMatrix.php:16 EDIMessageFormat.php:104 -#: FixedAssetLocations.php:9 FixedAssetRegister.php:13 -#: FixedAssetRegister.php:237 FixedAssetTransfer.php:31 FormDesigner.php:129 -#: GLBalanceSheet.php:351 GLBudgets.php:28 GLJournal.php:228 -#: InventoryPlanning.php:373 InventoryPlanningPrefSupplier.php:467 -#: Labels.php:115 Labels.php:270 MRPReport.php:515 OutstandingGRNs.php:160 -#: PcAssignCashToTab.php:56 PcAssignCashToTab.php:130 -#: PcAssignCashToTab.php:146 PcAssignCashToTab.php:183 PDFPickingList.php:28 -#: PDFPrintLabel.php:139 PDFStockLocTransfer.php:21 -#: PO_AuthorisationLevels.php:10 POReport.php:60 POReport.php:64 -#: POReport.php:68 PO_SelectOSPurchOrder.php:133 PricesBasedOnMarkUp.php:11 -#: Prices_Customer.php:39 Prices.php:30 PurchData.php:138 PurchData.php:249 -#: PurchData.php:268 RecurringSalesOrders.php:310 SalesAnalReptCols.php:51 +#: AccountGroups.php:223 AccountSections.php:175 AddCustomerContacts.php:25 +#: AddCustomerContacts.php:28 AddCustomerNotes.php:103 +#: AddCustomerTypeNotes.php:97 AgedDebtors.php:451 AgedSuppliers.php:278 +#: Areas.php:144 AuditTrail.php:11 BOMExtendedQty.php:261 BOMIndented.php:246 +#: BOMIndentedReverse.php:235 BOMInquiry.php:187 BOMListing.php:109 +#: BOMs.php:213 BOMs.php:832 BankReconciliation.php:13 COGSGLPostings.php:18 +#: CompanyPreferences.php:153 CounterSales.php:2010 CounterSales.php:2135 +#: CreditStatus.php:21 Credit_Invoice.php:255 Currencies.php:28 +#: CustEDISetup.php:17 DailyBankTransactions.php:11 DebtorsAtPeriodEnd.php:125 +#: DiscountCategories.php:10 DiscountCategories.php:131 DiscountMatrix.php:16 +#: EDIMessageFormat.php:104 FixedAssetLocations.php:9 +#: FixedAssetRegister.php:13 FixedAssetRegister.php:237 +#: FixedAssetTransfer.php:31 FormDesigner.php:129 GLBalanceSheet.php:362 +#: GLBudgets.php:29 GLJournal.php:246 InventoryPlanning.php:374 +#: InventoryPlanningPrefSupplier.php:467 Labels.php:115 Labels.php:270 +#: MRPReport.php:515 OutstandingGRNs.php:160 PDFPickingList.php:28 +#: PDFPrintLabel.php:140 PDFStockLocTransfer.php:17 POReport.php:60 +#: POReport.php:64 POReport.php:68 PO_AuthorisationLevels.php:10 +#: PO_SelectOSPurchOrder.php:135 PcAssignCashToTab.php:56 +#: PcAssignCashToTab.php:130 PcAssignCashToTab.php:146 +#: PcAssignCashToTab.php:187 Prices.php:30 PricesBasedOnMarkUp.php:8 +#: Prices_Customer.php:34 PurchData.php:137 PurchData.php:258 +#: PurchData.php:282 RecurringSalesOrders.php:309 SalesAnalReptCols.php:51 #: SalesAnalRepts.php:11 SalesCategories.php:11 SalesGLPostings.php:17 #: SalesGraph.php:34 SalesPeople.php:20 SalesTypes.php:20 SelectAsset.php:45 #: SelectCompletedOrder.php:11 SelectContract.php:78 SelectCreditItems.php:215 -#: SelectCreditItems.php:283 SelectCustomer.php:247 SelectGLAccount.php:19 -#: SelectGLAccount.php:79 SelectOrderItems.php:618 SelectOrderItems.php:1512 -#: SelectOrderItems.php:1636 SelectProduct.php:496 SelectSalesOrder.php:454 -#: SelectSupplier.php:9 SelectSupplier.php:192 SelectWorkOrder.php:9 -#: SelectWorkOrder.php:145 ShipmentCosting.php:11 Shipments.php:17 +#: SelectCreditItems.php:286 SelectCustomer.php:260 SelectGLAccount.php:17 +#: SelectGLAccount.php:77 SelectOrderItems.php:575 SelectOrderItems.php:1468 +#: SelectOrderItems.php:1592 SelectProduct.php:496 SelectSalesOrder.php:533 +#: SelectSupplier.php:9 SelectSupplier.php:198 SelectWorkOrder.php:9 +#: SelectWorkOrder.php:151 ShipmentCosting.php:11 Shipments.php:17 #: Shippers.php:123 Shippers.php:159 Shipt_Select.php:8 -#: StockLocMovements.php:13 StockLocStatus.php:26 Suppliers.php:302 -#: SupplierTenders.php:260 SupplierTenders.php:317 SupplierTransInquiry.php:11 -#: TaxGroups.php:15 TaxProvinces.php:10 TopItems.php:65 -#: WhereUsedInquiry.php:18 WorkCentres.php:110 WorkCentres.php:157 -#: WorkOrderCosting.php:12 WorkOrderEntry.php:10 WorkOrderIssue.php:20 -#: WorkOrderReceive.php:13 WorkOrderStatus.php:41 WWW_Access.php:11 -#: WWW_Users.php:32 Z_BottomUpCosts.php:51 +#: StockLocMovements.php:13 StockLocStatus.php:27 SupplierTenders.php:260 +#: SupplierTenders.php:317 SupplierTransInquiry.php:10 Suppliers.php:302 +#: TaxGroups.php:15 TaxProvinces.php:11 TopItems.php:77 WWW_Access.php:11 +#: WWW_Users.php:31 WhereUsedInquiry.php:18 WorkCentres.php:111 +#: WorkCentres.php:162 WorkOrderCosting.php:13 WorkOrderEntry.php:11 +#: WorkOrderIssue.php:22 WorkOrderReceive.php:15 WorkOrderStatus.php:42 +#: Z_BottomUpCosts.php:51 msgid "Search" msgstr "Vyhledávání" -#: AccountGroups.php:231 +#: AccountGroups.php:227 msgid "Group... [truncated message content] |
From: <dai...@us...> - 2011-11-06 03:12:40
|
Revision: 4740 http://web-erp.svn.sourceforge.net/web-erp/?rev=4740&view=rev Author: daintree Date: 2011-11-06 03:12:31 +0000 (Sun, 06 Nov 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerTransInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DiscountMatrix.php trunk/EDIMessageFormat.php trunk/Factors.php trunk/FixedAssetCategories.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/FixedAssetLocations.php trunk/FixedAssetRegister.php trunk/SuppLoginSetup.php trunk/Z_BottomUpCosts.php trunk/Z_ChangeBranchCode.php trunk/Z_ChangeCustomerCode.php trunk/Z_ChangeStockCategory.php trunk/Z_ChangeStockCode.php trunk/Z_CheckAllocationsFrom.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CopyBOM.php trunk/Z_CreateCompany.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/Z_DeleteSalesTransActions.php Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/CustLoginSetup.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -8,6 +8,16 @@ include('includes/SQL_CommonFunctions.inc'); include ('includes/LanguagesArray.php'); + +if (!isset($_SESSION['CustomerID'])){ + echo '<br /> + <br />'; + prnMsg(_('A customer must first be selected before logins can be defined for it') . '<br /><br /><a href="' . $rootpath . '/SelectCustomer.php">' . _('Select A Customer') . '</a>','info'); + include('includes/footer.inc'); + exit; +} + + echo '<a href="' . $rootpath . '/SelectCustomer.php">' . _('Back to Customers') . '</a><br />'; $sql="SELECT name @@ -20,7 +30,8 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName. _(' has been selected') . - '</p><br />'; + '</p> + <br />'; if (isset($_POST['submit'])) { @@ -246,11 +257,11 @@ foreach ($LanguagesArray as $LanguageEntry => $LanguageName){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; - } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; + } elseif (!isset($_POST['UserLanguage']) AND $LanguageEntry == $DefaultLanguage) { + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } else { - echo '<option value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } } echo '</select></td> Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/CustWhereAlloc.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -6,7 +6,7 @@ $title = _('Customer How Paid Inquiry'); include('includes/header.inc'); -echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"> @@ -96,7 +96,7 @@ echo '<tr> <th colspan="6"> <div class="centre"> - <font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. locale_number_format($myrow['totamt'],$CurrDecimalPlaces) . ' ' . $CurrCode . '</font></b> + <font size=3 color="blue"><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. locale_number_format($myrow['totamt'],$CurrDecimalPlaces) . ' ' . $CurrCode . '</font></b> </div> </th> </tr>'; Modified: trunk/CustomerTransInquiry.php =================================================================== --- trunk/CustomerTransInquiry.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/CustomerTransInquiry.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -51,15 +51,15 @@ echo '<td>' . _('From') . ':</td> <td><input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> <td>' . _('To') . ':</td> - <td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td>'; + <td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="4" type="submit" name="ShowResults" value="' . _('Show Transactions') . '" /> + </div> + </form>'; -echo '</tr></table> - <br /> - <div class="centre"> - <input tabindex="4" type="submit" name="ShowResults" value="' . _('Show Transactions') . '"> - </div> - </form>'; - if (isset($_POST['ShowResults']) && $_POST['TransType'] != ''){ $SQL_FromDate = FormatDateForSQL($_POST['FromDate']); $SQL_ToDate = FormatDateForSQL($_POST['ToDate']); Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/DebtorsAtPeriodEnd.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -133,13 +133,16 @@ <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Customer Code') .':</font></td> + echo '<tr> + <td>' . _('From Customer Code') .':</font></td> <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="1" /></td> - </tr>'; - echo '<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>' . _('Balances As At') . ':</td> + </tr> + <tr> + <td>' . _('To Customer Code') . ':</td> + <td><input tabindex="2" type="text" maxlength="6" size="7" name="ToCriteria" value="zzzzzz" /></td> + </tr> + <tr> + <td>' . _('Balances As At') . ':</td> <td><select tabindex="3" name="PeriodEnd">'; $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; @@ -152,9 +155,14 @@ } } - echo '</select></td></tr>'; - echo '</table> - <br /><div class="centre"><input tabindex=5 type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '</select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="5" type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> + </div> + </form>'; include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/DiscountMatrix.php =================================================================== --- trunk/DiscountMatrix.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/DiscountMatrix.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -20,26 +20,26 @@ //initialise no input errors assumed initially before we test $InputError = 0; - if (!is_numeric($_POST['QuantityBreak'])){ + if (!is_numeric(filter_number_format($_POST['QuantityBreak']))){ prnMsg( _('The quantity break must be entered as a positive number'),'error'); $InputError =1; $Errors[$i] = 'QuantityBreak'; $i++; } - if ($_POST['QuantityBreak']<=0){ + if (filter_number_format($_POST['QuantityBreak'])<=0){ prnMsg( _('The quantity of all items on an order in the discount category') . ' ' . $_POST['DiscountCategory'] . ' ' . _('at which the discount will apply is 0 or less than 0') . '. ' . _('Positive numbers are expected for this entry'),'warn'); $InputError =1; $Errors[$i] = 'QuantityBreak'; $i++; } - if (!is_numeric($_POST['DiscountRate'])){ + if (!is_numeric(filter_number_format($_POST['DiscountRate']))){ prnMsg( _('The discount rate must be entered as a positive number'),'warn'); $InputError =1; $Errors[$i] = 'DiscountRate'; $i++; } - if ($_POST['DiscountRate']<=0 OR $_POST['DiscountRate']>=70){ + if (filter_number_format($_POST['DiscountRate'])<=0 OR filter_number_format($_POST['DiscountRate'])>=70){ prnMsg( _('The discount rate applicable for this record is either less than 0% or greater than 70%') . '. ' . _('Numbers between 1 and 69 are expected'),'warn'); $InputError =1; $Errors[$i] = 'DiscountRate'; @@ -57,8 +57,8 @@ discountrate) VALUES('" . $_POST['SalesType'] . "', '" . $_POST['DiscountCategory'] . "', - '" . $_POST['QuantityBreak'] . "', - '" . ($_POST['DiscountRate']/100) . "')"; + '" . filter_number_format($_POST['QuantityBreak']) . "', + '" . (filter_number_format($_POST['DiscountRate'])/100) . "')"; $result = DB_query($sql,$db); prnMsg( _('The discount matrix record has been added'),'success'); @@ -111,8 +111,9 @@ $sql = "SELECT DISTINCT discountcategory FROM stockmaster WHERE discountcategory <>''"; $result = DB_query($sql, $db); if (DB_num_rows($result) > 0) { - echo '<tr><td>'. _('Discount Category Code') .': </td>'; - echo '<td><select name="DiscountCategory">'; + echo '<tr> + <td>'. _('Discount Category Code') .': </td> + <td><select name="DiscountCategory">'; while ($myrow = DB_fetch_array($result)){ if ($myrow['discountcategory']==$_POST['DiscCat']){ @@ -123,18 +124,24 @@ } echo '</select></td>'; } else { - echo '<input type="hidden" name="DiscountCategory" value="">'; + echo '<input type="hidden" name="DiscountCategory" value="" />'; } -echo '<tr><td>' . _('Quantity Break') . '</td> - <td><input class="number" tabindex=3 ' . (in_array('QuantityBreak',$Errors) ? 'class="inputerror"' : '') .' type="text" name="QuantityBreak" size=10 maxlength=10></td></tr>'; +echo '<tr> + <td>' . _('Quantity Break') . '</td> + <td><input class="number" tabindex=3 ' . (in_array('QuantityBreak',$Errors) ? 'class="inputerror"' : '') .' type="text" name="QuantityBreak" size="10" maxlength="10" /></td> + </tr> + <tr> + <td>' . _('Discount Rate') . ' (%):</td> + <td><input class="number" tabindex=4 ' . (in_array('DiscountRate',$Errors) ? 'class="inputerror"' : '') . 'type="text" name="DiscountRate" size="5" maxlength="5" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex=5 type="submit" name="submit" value="' . _('Enter Information') . '"> + </div> + <br />'; -echo '<tr><td>' . _('Discount Rate') . ' (%):</td> - <td><input class="number" tabindex=4 ' . (in_array('DiscountRate',$Errors) ? 'class="inputerror"' : '') . 'type="text" name="DiscountRate" size=11 maxlength=14></td></tr>'; -echo '</table><br />'; - -echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="' . _('Enter Information') . '"></div><br />'; - $sql = "SELECT sales_type, salestype, discountcategory, @@ -169,22 +176,21 @@ $DeleteURL = htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=yes&SalesType=' . $myrow['salestype'] . '&DiscountCategory=' . $myrow['discountcategory'] . '&QuantityBreak=' . $myrow['quantitybreak']; printf('<td>%s</td> - <td>%s</td> - <td class="number">%s</td> - <td class="number">%s</td> - <td><a href="%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this discount matrix record?') . '\');">' . _('Delete') . '</td> - </tr>', - $myrow['sales_type'], - $myrow['discountcategory'], - $myrow['quantitybreak'], - $myrow['discountrate']*100 , - $DeleteURL); + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this discount matrix record?') . '\');">' . _('Delete') . '</td> + </tr>', + $myrow['sales_type'], + $myrow['discountcategory'], + $myrow['quantitybreak'], + $myrow['discountrate']*100 , + $DeleteURL); } -echo '</table>'; +echo '</table> + </form>'; -echo '</form>'; - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/EDIMessageFormat.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -45,7 +45,7 @@ } $InputError = 0; -if ($InputError !=1 and isset($_POST['update'])) { +if ($InputError !=1 AND isset($_POST['update'])) { /*SelectedMessageLine 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*/ if (!isset($SelectedMessageLine)) { @@ -62,7 +62,7 @@ $msg = _('Message line updated'); unset ($SelectedMessageLine); -} elseif ($InputError !=1 and isset($_POST['submit'])) { +} elseif ($InputError !=1 AND isset($_POST['submit'])) { /*Selected group is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new message line form */ @@ -123,8 +123,8 @@ $result = DB_query($sql,$db); - echo '<table class=selection>'; - echo '<tr><th colspan=5><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode.'</font></th></tr>'; + echo '<table class="selection">'; + echo '<tr><th colspan="5"><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode.'</font></th></tr>'; $TableHeader = '<tr> <th>' . _('Section') . '</th> <th>' . _('Sequence') . '</th> @@ -161,8 +161,10 @@ } //END WHILE LIST LOOP echo '</table><p>'; if (DB_num_rows($result)==0){ - echo '<div class="centre"><input tabindex=1 type=submit name="NewEDIInvMsg" value="' . - _('Create New EDI Invoice Message From Default Template') . '"></div><br />'; + echo '<div class="centre"> + <input tabindex=1 type=submit name="NewEDIInvMsg" value="' . _('Create New EDI Invoice Message From Default Template') . '" /> + </div> + <br />'; } } //end of ifs SelectedLine is not set @@ -183,19 +185,18 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['Section'] = $myrow['section']; $_POST['SequenceNo'] = $myrow['sequenceno']; $_POST['LineText'] = $myrow['linetext']; echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?MessageType=INVOIC&PartnerCode=' . $myrow['partnercode'] . '">' . _('Review Message Lines') . '</a></div>'; - echo '<input type=hidden name="SelectedMessageLine" VALUE="' . $SelectedMessageLine . '">'; - echo '<input type=hidden name="MessageType" VALUE="' . $myrow['messagetype'] . '">'; - echo '<input type=hidden name="PartnerCode" VALUE="' . $myrow['partnercode'] . '">'; + echo '<input type="hidden" name="SelectedMessageLine" value="' . $SelectedMessageLine . '" />'; + echo '<input type="hidden" name="MessageType" value="' . $myrow['messagetype'] . '" />'; + echo '<input type="hidden" name="PartnerCode" value="' . $myrow['partnercode'] . '" />'; } else { //end of if $SelectedMessageLine only do the else when a new record is being entered - echo '<input type=hidden name="MessageType" VALUE="' . $MessageType . '">'; - echo '<input type=hidden name="PartnerCode" VALUE="' . $PartnerCode . '">'; + echo '<input type="hidden" name="MessageType" value="' . $MessageType . '" />'; + echo '<input type="hidden" name="PartnerCode" value="' . $PartnerCode . '" />'; } echo '<table class=selection>'; @@ -209,18 +210,18 @@ echo '<select tabindex=2 name="Section">'; if ($_POST['Section']=='Heading') { - echo '<option selected VALUE="Heading">' . _('Heading') . '</option>'; + echo '<option selected value="Heading">' . _('Heading') . '</option>'; } else { echo '<option value="Heading">' . _('Heading') . '</option>'; } -if (isset($_POST['Section']) and $_POST['Section']=='Detail') { - echo '<option selected VALUE="Detail">' . _('Detail') . '</option>'; +if (isset($_POST['Section']) AND $_POST['Section']=='Detail') { + echo '<option selected value="Detail">' . _('Detail') . '</option>'; } else { echo '<option value="Detail">' . _('Detail') . '</option>'; } -if (isset($_POST['Section']) and $_POST['Section']=='Summary') { - echo '<option selected VALUE="Summary">' . _('Summary') . '</option>'; +if (isset($_POST['Section']) AND $_POST['Section']=='Summary') { + echo '<option selected value="Summary">' . _('Summary') . '</option>'; } else { echo '<option value="Summary">' . _('Summary') . '</option>'; } @@ -234,17 +235,17 @@ echo '</td></tr>'; echo '<tr><td>Sequence Number:</td>'; -echo '<td><input tabindex=3 type="text" name=SequenceNo size=3 maxlength=3 value='.$_POST['SequenceNo'].'>'; +echo '<td><input tabindex=3 type="text" name=SequenceNo size=3 maxlength=3 value='.$_POST['SequenceNo'].' />'; echo '</td></tr>'; echo '<tr><td>' . _('Line Text') . ':' .'</td>'; echo '<td>'; -echo '<input tabindex=4 type="Text" name="LineText" size=50 maxlength=50 VALUE='.$_POST['LineText'] .'>'; +echo '<input tabindex=4 type="text" name="LineText" size=50 maxlength=50 value='.$_POST['LineText'] .' />'; echo '</td></tr>'; echo '</table><br />'; if (isset($_GET['SelectedMessageLine'])) { - echo '<div class="centre"><input tabindex=5 type="submit" name="update" value="'. _('Update Information'). '"></div>'; + echo '<div class="centre"><input tabindex=5 type="submit" name="update" value="'. _('Update Information'). '" /></div>'; } else { - echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="'. _('Enter Information'). '"></div>'; + echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="'. _('Enter Information'). '" /></div>'; } echo '</form>'; Modified: trunk/Factors.php =================================================================== --- trunk/Factors.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/Factors.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -33,7 +33,7 @@ if (isset($_POST['Submit']) OR isset($_POST['Update'])) { - if (mb_strlen($_POST['FactorName']) > 40 or mb_strlen($_POST['FactorName']) == 0 or $_POST['FactorName'] == '') { + if (mb_strlen($_POST['FactorName']) > 40 OR mb_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'); } @@ -49,7 +49,7 @@ } /* 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, @@ -65,7 +65,7 @@ fax, email) VALUES (null, - '" .$_POST['FactorName'] . "', + '" . $_POST['FactorName'] . "', '" . $_POST['Address1'] . "', '" . $_POST['Address2'] . "', '" . $_POST['Address3'] . "', @@ -199,45 +199,74 @@ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - 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 '</form>'; + echo '<input type="hidden" name="FactorID" value="' . $FactorID .'" /> + <table class=selection> + <input type="hidden" name="New" value="Yes" /> + <tr> + <td>' . _('Factor company Name') . ':</td> + <td><input tabindex="1" type="text" name="FactorName" size="42" maxlength="40" value="' .$_POST['FactorName'].'" /></td> + </tr> + <tr> + <td>' . _('Address Line 1') . ':</td> + <td><input tabindex=2 type="text" name="Address1" size="42" maxlength="40" value="' . $_POST['Address1'] .'" /></td> + </tr> + <tr><td>' . _('Address Line 2') . ':</td> + <td><input tabindex=3 type="text" name="Address2" size="42" maxlength="40" value="' . $_POST['Address2'] .'" /></td> + </tr> + <tr> + <td>' . _('Address Line 3') . ':</td> + <td><input tabindex=4 type="text" name="Address3" size="42" maxlength="40" value="' .$_POST['Address3'] .'" /></td> + </tr> + <tr> + <td>' . _('Address Line 4') . ':</td> + <td><input tabindex=5 type="text" name="Address4" size="42" maxlength="40" value="' . $_POST['Address4'].'" /></td> + </tr> + <tr> + <td>' . _('Address Line 5') . ':</td> + <td><input tabindex="6" type="text" name="Address5" size="42" maxlength="40" value="' . $_POST['Address5'] .'" /></td> + </tr> + <tr> + <td>' . _('Address Line 6') . ':</td> + <td><input tabindex="7" type="text" name="Address6" size="42" maxlength="40" value="' .$_POST['Address6'] . '" /></td> + </tr> + <tr> + <td>' . _('Contact Name') . ':</td> + <td><input tabindex="8" type="text" name="ContactName" size="20" maxlength="25" value="' . $_POST['ContactName'] .'" /></td> + </tr> + <tr> + <td>' . _('Telephone') . ':</td> + <td><input tabindex="9" type="text" name="Telephone" size="20" maxlength="25" value="' .$_POST['Telephone'].'" /></td> + </tr> + <tr> + <td>' . _('Fax') . ':</td> + <td><input tabindex="10" type="text" name="Fax" value=0 size="20" maxlength="25" value="' . $_POST['Fax'] .'" /></td> + </tr> + <tr> + <td>' . _('Email') . ':</td> + <td><input tabindex="11" type="text" name="Email" size="55" maxlength=55 value="' . $_POST['Email'] . '" /></td> + </tr> + </table>'; } if (isset($_POST['Create'])) { - echo '</table><p><div class="centre"><input tabindex=12 type="submit" name="Submit" value="' . _('Insert New Factor') . '"></div>'; + echo '<p> + <div class="centre"> + <input tabindex="12" type="submit" name="Submit" value="' . _('Insert New Factor') . '" /> + </div> + </form>'; } 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> + <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?') . '\');" /> + </div> + </form>'; } - /* 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*/ @@ -247,7 +276,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="New" value="No">'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <th>' . _('ID') . '</th> <th>' . _('Company Name').'</th> @@ -299,13 +328,14 @@ <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; - + } //end while loop + echo '</table> + <p> + <div class="centre"> + <br /> + <input tabindex="3" type="submit" name="Create" value="' . _('Create New Factor') . '" /> + </div> + </form>'; } include('includes/footer.inc'); Modified: trunk/FixedAssetCategories.php =================================================================== --- trunk/FixedAssetCategories.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/FixedAssetCategories.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -8,8 +8,10 @@ include('includes/header.inc'); -echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . - _('Fixed Asset Categories') . '" alt="" />' . ' ' . $title . '</p>'; +echo '<div class="centre"> + <p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Fixed Asset Categories') . '" alt="" />' . ' ' . $title . ' + </p>'; if (isset($_GET['SelectedCategory'])){ $SelectedCategory = mb_strtoupper($_GET['SelectedCategory']); @@ -41,11 +43,12 @@ } if ($_POST['CostAct'] == $_SESSION['CompanyRecord']['debtorsact'] - OR $_POST['CostAct'] == $_SESSION['CompanyRecord']['creditorsact'] - OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['debtorsact'] - OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['creditorsact'] - OR $_POST['CostAct'] == $_SESSION['CompanyRecord']['grnact'] - OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['grnact']){ + OR $_POST['CostAct'] == $_SESSION['CompanyRecord']['creditorsact'] + OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['debtorsact'] + OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['creditorsact'] + OR $_POST['CostAct'] == $_SESSION['CompanyRecord']['grnact'] + OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['grnact']){ + prnMsg(_('The accounts selected to post cost or accumulated depreciation to cannot be either of the debtors control account, creditors control account or GRN suspense accounts'),'error'); $InputError =1; } @@ -62,12 +65,12 @@ $i++; } if (in_array($_POST['CostAct'], $BankAccounts)) { - prnMsg( _('The asset cost account selected is a bank account - bank accounts are protected from having any other postings made to them. Select another balance sheet account for the asset cost'),'error'); - $InputError =1; + prnMsg(_('The asset cost account selected is a bank account - bank accounts are protected from having any other postings made to them. Select another balance sheet account for the asset cost'),'error'); + $InputError=1; } if (in_array($_POST['AccumDepnAct'], $BankAccounts)) { prnMsg( _('The accumulated depreciation account selected is a bank account - bank accounts are protected from having any other postings made to them. Select another balance sheet account for the asset accumulated depreciation'),'error'); - $InputError =1; + $InputError=1; } if (isset($SelectedCategory) AND $InputError !=1) { @@ -76,13 +79,14 @@ would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE fixedassetcategories SET - categorydescription = '" . $_POST['CategoryDescription'] . "', - costact = '" . $_POST['CostAct'] . "', - depnact = '" . $_POST['DepnAct'] . "', - disposalact = '" . $_POST['DisposalAct'] . "', - accumdepnact = '" . $_POST['AccumDepnAct'] . "' - WHERE categoryid = '".$SelectedCategory . "'"; + $sql = "UPDATE fixedassetcategories + SET categorydescription = '" . $_POST['CategoryDescription'] . "', + costact = '" . $_POST['CostAct'] . "', + depnact = '" . $_POST['DepnAct'] . "', + disposalact = '" . $_POST['DisposalAct'] . "', + accumdepnact = '" . $_POST['AccumDepnAct'] . "' + WHERE categoryid = '".$SelectedCategory . "'"; + $ErrMsg = _('Could not update the fixed asset category') . $_POST['CategoryDescription'] . _('because'); $result = DB_query($sql,$db,$ErrMsg); @@ -91,11 +95,11 @@ } elseif ($InputError !=1) { $sql = "INSERT INTO fixedassetcategories (categoryid, - categorydescription, - costact, - depnact, - disposalact, - accumdepnact) + categorydescription, + costact, + depnact, + disposalact, + accumdepnact) VALUES ('" . $_POST['CategoryID'] . "', '" . $_POST['CategoryDescription'] . "', '" . $_POST['CostAct'] . "', @@ -227,16 +231,23 @@ $_POST['DisposalAct'] = $myrow['disposalact']; $_POST['AccumDepnAct'] = $myrow['accumdepnact']; - echo '<input type=hidden name="SelectedCategory" value="' . $SelectedCategory . '">'; - echo '<input type=hidden name="CategoryID" value="' . $_POST['CategoryID'] . '">'; - echo '<table class=selection><tr><td>' . _('Category Code') . ':</td><td>' . $_POST['CategoryID'] . '</td></tr>'; + echo '<input type="hidden" name="SelectedCategory" value="' . $SelectedCategory . '" />'; + echo '<input type="hidden" name="CategoryID" value="' . $_POST['CategoryID'] . '" />'; + echo '<table class="selection"> + <tr> + <td>' . _('Category Code') . ':</td> + <td>' . $_POST['CategoryID'] . '</td> + </tr>'; } else { //end of if $SelectedCategory only do the else when a new record is being entered if (!isset($_POST['CategoryID'])) { $_POST['CategoryID'] = ''; } - echo '<table class=selection><tr><td>' . _('Category Code') . ':</td> - <td><input type="Text" name="CategoryID" size=7 maxlength=6 value="' . $_POST['CategoryID'] . '"></td></tr>'; + echo '<table class="selection"> + <tr> + <td>' . _('Category Code') . ':</td> + <td><input type="text" name="CategoryID" size="7" maxlength="6" value="' . $_POST['CategoryID'] . '" /></td> + </tr>'; } //SQL to poulate account selection boxes @@ -262,13 +273,14 @@ $_POST['CategoryDescription'] = ''; } -echo '<tr><td>' . _('Category Description') . ':</td> - <td><input type="Text" name="CategoryDescription" size=22 maxlength=20 value="' . $_POST['CategoryDescription'] . '"></td></tr>'; +echo '<tr> + <td>' . _('Category Description') . ':</td> + <td><input type="text" name="CategoryDescription" size="22" maxlength="20" value="' . $_POST['CategoryDescription'] . '" /></td> + </tr> + <tr> + <td>' . _('Fixed Asset Cost GL Code') . ':</td> + <td><select name="CostAct">'; -echo '<tr><td>' . _('Fixed Asset Cost GL Code'); - -echo ':</td><td><select name="CostAct">'; - while ($myrow = DB_fetch_array($BSAccountsResult)){ if (isset($_POST['CostAct']) and $myrow['accountcode']==$_POST['CostAct']) { @@ -277,9 +289,10 @@ echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } } //end while loop -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Profit and Loss Depreciation GL Code') . ':</td> +echo '</select></td> + </tr> + <tr> + <td>' . _('Profit and Loss Depreciation GL Code') . ':</td> <td><select name="DepnAct">'; while ($myrow = DB_fetch_array($PnLAccountsResult)) { @@ -289,10 +302,13 @@ echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } } //end while loop -echo '</select></td></tr>'; +echo '</select></td> + </tr>'; DB_data_seek($PnLAccountsResult,0); -echo '<tr><td>' . _('Profit or Loss on Disposal GL Code:') . '</td><td><select name="DisposalAct">'; +echo '<tr> + <td>' . _('Profit or Loss on Disposal GL Code:') . '</td> + <td><select name="DisposalAct">'; while ($myrow = DB_fetch_array($PnLAccountsResult)) { if (isset($_POST['DisposalAct']) and $myrow['accountcode']==$_POST['DisposalAct']) { echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; @@ -300,11 +316,13 @@ echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } } //end while loop -echo '</select></td></tr>'; +echo '</select></td> + </tr>'; - DB_data_seek($BSAccountsResult,0); -echo '<tr><td>' . _('Balance Sheet Accumulated Depreciation GL Code') . ':</td><td><select name="AccumDepnAct">'; +echo '<tr> + <td>' . _('Balance Sheet Accumulated Depreciation GL Code') . ':</td> + <td><select name="AccumDepnAct">'; while ($myrow = DB_fetch_array($BSAccountsResult)) { @@ -317,11 +335,15 @@ } //end while loop -echo '</select></td></tr></table><br />'; +echo '</select></td> + </tr> + </table> + <br />'; -echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; +echo '<div class="centre"> + <input type="Submit" name="submit" value="' . _('Enter Information') . '" /> + </div> + </form>'; -echo '</form>'; - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetDepreciation.php =================================================================== --- trunk/FixedAssetDepreciation.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/FixedAssetDepreciation.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -66,6 +66,7 @@ fixedassetcategories.depnact, fixedassetcategories.categorydescription ORDER BY assetcategoryid, assetid"; + $AssetsResult=DB_query($sql, $db); $InputError = false; //always hope for the best @@ -80,7 +81,8 @@ } echo '<p></p><table>'; -$Heading = '<tr><th>' . _('Asset ID') . '</th> +$Heading = '<tr> + <th>' . _('Asset ID') . '</th> <th>' . _('Description') . '</th> <th>' . _('Date Purchased') . '</th> <th>' . _('Cost') . '</th> @@ -97,6 +99,10 @@ $TotalCost =0; $TotalAccumDepn=0; $TotalDepn = 0; +$TotalCategoryCost = 0; +$TotalCategoryAccumDepn =0; +$TotalCategoryDepn = 0; + $RowCounter = 0; $k=0; @@ -111,7 +117,9 @@ <th class="number">' . locale_number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr>'; } - echo '<tr><th colspan=9 align="left">' . $AssetRow['categorydescription'] . '</th></tr>'; + echo '<tr> + <th colspan="9" align="left">' . $AssetRow['categorydescription'] . '</th> + </tr>'; $AssetCategoryDescription = $AssetRow['categorydescription']; $TotalCategoryCost = 0; $TotalCategoryAccumDepn =0; @@ -161,7 +169,9 @@ $TotalAccumDepn +=$AssetRow['depnbfwd']; $TotalDepn +=$NewDepreciation; - if (isset($_POST['CommitDepreciation']) AND $NewDepreciation !=0 AND $InputError==false){ + if (isset($_POST['CommitDepreciation']) + AND $NewDepreciation !=0 + AND $InputError==false){ //debit depreciation expense $SQL = "INSERT INTO gltrans (type, @@ -178,9 +188,11 @@ '" . $AssetRow['depnact'] . "', '" . $AssetRow['assetid'] . "', '" . $NewDepreciation ."')"; + $ErrMsg = _('Cannot insert a depreciation GL entry for the depreciation because'); $DbgMsg = _('The SQL that failed to insert the GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); + $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -226,22 +238,26 @@ $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); } //end if Committing the depreciation to DB } //end loop around the assets to calculate depreciation for -echo '<tr><th colspan=3 align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> - <th class="number">' . locale_number_format($TotalCategoryCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th class="number">' . locale_number_format($TotalCategoryAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th class="number">' . locale_number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th colspan=2></th> - <th class="number">' . locale_number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - </tr>'; -echo '<tr><th colspan=3 align="right">' . _('GRAND Total') . ' </th> - <th class="number">' . locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th class="number">' . locale_number_format($TotalAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th class="number">' . locale_number_format(($TotalCost-$TotalAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th colspan=2></th> - <th class="number">' . locale_number_format($TotalDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - </tr>'; +echo '<tr> + <th colspan="3" align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> + <th class="number">' . locale_number_format($TotalCategoryCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format($TotalCategoryAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th colspan="2"></th> + <th class="number">' . locale_number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + </tr> + <tr> + <th colspan="3" align="right">' . _('GRAND Total') . ' </th> + <th class="number">' . locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format($TotalAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format(($TotalCost-$TotalAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th colspan="2"></th> + <th class="number">' . locale_number_format($TotalDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + </tr>'; -echo '</table><hr><p></p>'; +echo '</table> + <hr /> + <p />'; if (isset($_POST['CommitDepreciation']) AND $InputError==false){ $result = DB_Txn_Commit($db); @@ -251,20 +267,24 @@ /*And post the journal too */ include ('includes/GLPostings.inc'); } else { - echo '<form action=' . htmlspecialchars($_SERVER['PHP_SELF']) . ' method=post name="form">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p></p>'; - echo '<table class=selection width=30%><tr></tr><tr>'; + echo '<p /> + <table class="selection" width="30%"> + <tr></tr> + <tr>'; if ($AllowUserEnteredProcessDate){ echo '<td>'._('Date to Process Depreciation'). ':</td> - <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" name="ProcessDate" maxlength=10 size=11 value="' . $_POST['ProcessDate'] . '"></td>'; + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" name="ProcessDate" maxlength="10" size="11" value="' . $_POST['ProcessDate'] . '" /></td>'; } else { echo '<td>'._('Date to Process Depreciation'). ':</td> - <td>' . $_POST['ProcessDate'] .'</td>'; + <td>' . $_POST['ProcessDate'] .'</td>'; } - echo '<td><div class="centre"><input type="submit" name="CommitDepreciation" value="'._('Commit Depreciation').'"></div>'; - echo '</tr></table><br />'; - echo '</form>'; + echo '<td><div class="centre"><input type="submit" name="CommitDepreciation" value="'._('Commit Depreciation').'" /></div></td> + </tr> + </table> + <br /> + </form>'; } include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/FixedAssetItems.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -104,13 +104,16 @@ $Errors[$i] = 'AssetLocation'; $i++; } - if (!is_numeric($_POST['DepnRate']) OR $_POST['DepnRate']>100 OR $_POST['DepnRate']<0){ + if (!is_numeric(filter_number_format($_POST['DepnRate'])) + OR filter_number_format($_POST['DepnRate'])>100 + OR filter_number_format($_POST['DepnRate'])<0){ + $InputError = 1; prnMsg(_('The depreciation rate is expected to be a number between 0 and 100'),'error'); $Errors[$i] = 'DepnRate'; $i++; } - if ($_POST['DepnRate']>0 AND $_POST['DepnRate']<1){ + if (filter_number_format($_POST['DepnRate'])>0 AND filter_number_format($_POST['DepnRate'])<1){ prnMsg(_('Numbers less than 1 are interpreted as less than 1%. The depreciation rate should be entered as a number between 0 and 100'),'warn'); } @@ -226,15 +229,15 @@ } /*end if there was accumulated depreciation for the asset */ } /* end if there is a change in asset category */ $sql = "UPDATE fixedassets - SET longdescription='" . $_POST['LongDescription'] . "', - description='" . $_POST['Description'] . "', - assetcategoryid='" . $_POST['AssetCategoryID'] . "', - assetlocation='" . $_POST['AssetLocation'] . "', - depntype='" . $_POST['DepnType'] . "', - depnrate='" . $_POST['DepnRate'] . "', - barcode='" . $_POST['BarCode'] . "', - serialno='" . $_POST['SerialNo'] . "' - WHERE assetid='" . $AssetID . "'"; + SET longdescription='" . $_POST['LongDescription'] . "', + description='" . $_POST['Description'] . "', + assetcategoryid='" . $_POST['AssetCategoryID'] . "', + assetlocation='" . $_POST['AssetLocation'] . "', + depntype='" . $_POST['DepnType'] . "', + depnrate='" . filter_number_format($_POST['DepnRate']) . "', + barcode='" . $_POST['BarCode'] . "', + serialno='" . $_POST['SerialNo'] . "' + WHERE assetid='" . $AssetID . "'"; $ErrMsg = _('The asset could not be updated because'); $DbgMsg = _('The SQL that was used to update the asset and failed was'); @@ -257,7 +260,7 @@ '" . $_POST['AssetCategoryID'] . "', '" . $_POST['AssetLocation'] . "', '" . $_POST['DepnType'] . "', - '" . $_POST['DepnRate']. "', + '" . filter_number_format($_POST['DepnRate']). "', '" . $_POST['BarCode'] . "', '" . $_POST['SerialNo'] . "' )"; $ErrMsg = _('The asset could not be added because'); @@ -382,7 +385,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -if (!isset($AssetID) or $AssetID=='') { +if (!isset($AssetID) OR $AssetID=='') { /*If the page was called without $AssetID passed to page then assume a new asset is to be entered other wise the form showing the fields with the existing entries against the asset will show for editing with a hidden AssetID field. New is set to flag that the page may have called itself and still be entering a new asset, in which case the page needs to know not to go looking up details for an existing asset*/ @@ -425,13 +428,19 @@ $_POST['AssetLocation'] = $AssetRow['assetlocation']; $_POST['DepnType'] = $AssetRow['depntype']; $_POST['BarCode'] = $AssetRow['barcode']; - $_POST['DepnRate'] = $AssetRow['depnrate']; + $_POST['DepnRate'] = locale_number_format($AssetRow['depnrate'],2); - echo '<tr><td>' . _('Asset Code') . ':</td><td>'.$AssetID.'</td></tr>'. "\n"; - echo '<input type="Hidden" name="AssetID" value="'.$AssetID.'"/>'. "\n"; + echo '<tr> + <td>' . _('Asset Code') . ':</td> + <td>' . $AssetID . '</td> + </tr>'; + echo '<input type="Hidden" name="AssetID" value="'.$AssetID.'"/>'; } else { // some changes were made to the data so don't re-set form variables to DB ie the code above - echo '<tr><td>' . _('Asset Code') . ':</td><td>' . $AssetID . '</td></tr>'; + echo '<tr> + <td>' . _('Asset Code') . ':</td> + <td>' . $AssetID . '</td> + </tr>'; echo '<input type="Hidden" name="AssetID" value="' . $AssetID . '"/>'; } @@ -440,19 +449,27 @@ } else { $Description =''; } -echo '<tr><td>' . _('Asset Description') . ' (' . _('short') . '):</td> - <td><input ' . (in_array('Description',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Description" size=52 maxlength=50 value="' . $Description . '"></td></tr>'."\n"; +echo '<tr> + <td>' . _('Asset Description') . ' (' . _('short') . '):</td> + <td><input ' . (in_array('Description',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Description" size="52" maxlength="50" value="' . $Description . '"></td> + </tr>'; + if (isset($_POST['LongDescription'])) { $LongDescription = AddCarriageReturns($_POST['LongDescription']); } else { $LongDescription =''; } -echo '<tr><td>' . _('Asset Description') . ' (' . _('long') . '):</td><td><textarea ' . (in_array('LongDescription',$Errors) ? 'class="texterror"' : '' ) .' name="LongDescription" cols=40 rows=4>' . stripslashes($LongDescription) . '</textarea></td></tr>'; +echo '<tr> + <td>' . _('Asset Description') . ' (' . _('long') . '):</td> + <td><textarea ' . (in_array('LongDescription',$Errors) ? 'class="texterror"' : '' ) .' name="LongDescription" cols="40" rows="4">' . stripslashes($LongDescription) . '</textarea></td> + </tr>'; if (!isset($New) ) { //ie not new at all! - echo '<tr><td>'. _('Image File (.jpg)') . ':</td><td><input type="file" id="ItemPicture" name="ItemPicture"></td>'; + echo '<tr> + <td>'. _('Image File (.jpg)') . ':</td> + <td><input type="file" id="ItemPicture" name="ItemPicture"></td>'; if (function_exists('imagecreatefromjpg')){ $AssetImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. @@ -478,7 +495,9 @@ // EOR Add Image upload for New Item - by Ori } //only show the add image if the asset already exists - otherwise AssetID will not be set - and the image needs the AssetID to save -echo '<tr><td>' . _('Asset Category') . ':</td><td><select name="AssetCategoryID">'; +echo '<tr> + <td>' . _('Asset Category') . ':</td> + <td><select name="AssetCategoryID">'; $sql = "SELECT categoryid, categorydescription FROM fixedassetcategories"; $ErrMsg = _('The asset categories could not be retrieved because'); @@ -499,7 +518,10 @@ } if (isset($AssetRow) AND ($AssetRow['datepurchased']!='0000-00-00' AND $AssetRow['datepurchased']!='')){ - echo '<tr><td>' . _('Date Purchased') . ':</td><td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td></tr>'; + echo '<tr> + <td>' . _('Date Purchased') . ':</td> + <td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td> + </tr>'; } $sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; @@ -507,7 +529,10 @@ $DbgMsg = _('The SQL used to retrieve asset locations and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); -echo '<tr><td>' . _('Asset Location') . ':</td><td><select name="AssetLocation">'; +echo '<tr> + <td>' . _('Asset Location') . ':</td> + <td><select name="AssetLocation">'; + while ($myrow=DB_fetch_array($result)){ if ($_POST['AssetLocation']==$myrow['locationid']){ echo '<option selected value="' . $myrow['locationid'] .'">' . $myrow['locationdescription'] . '</option>'; @@ -515,15 +540,21 @@ echo '<option value="' . $myrow['locationid'] .'">' . $myrow['locationdescription'] . '</option>'; } } -echo '</select><a target="_blank" href="'. $rootpath . '/FixedAssetLocations.php">'.' ' . _('Add Asset Location') . '</a></td></tr>'; +echo '</select> + <a target="_blank" href="'. $rootpath . '/FixedAssetLocations.php">'.' ' . _('Add Asset Location') . '</a></td> + </tr> + <tr> + <td>' . _('Bar Code') . ':</td> + <td><input ' . (in_array('BarCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BarCode" size="22" maxlength="20" value="' . $_POST['BarCode'] . '" /></td> + </tr> + <tr> + <td>' . _('Serial Number') . ':</td> + <td><input ' . (in_array('SerialNo',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="SerialNo" size="32" maxlength="30" value="' . $_POST['SerialNo'] . '" /></td> + </tr> + <tr> + <td>' . _('Depreciation Type') . ':</td> + <td><select name="DepnType">'; -echo '<tr><td>' . _('Bar Code') . ':</td><td><input ' . (in_array('BarCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BarCode" size=22 maxlength=20 value="' . $_POST['BarCode'] . '"></td></tr>'; - -echo '<tr><td>' . _('Serial Number') . ':</td><td><input ' . (in_array('SerialNo',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="SerialNo" size=32 maxlength=30 value="' . $_POST['SerialNo'] . '"></td></tr>'; - - -echo '<tr><td>' . _('Depreciation Type') . ':</td><td><select name="DepnType">'; - if (!isset($_POST['DepnType'])){ $_POST['DepnType'] = 0; //0 = Straight line - 1 = Diminishing Value } @@ -535,19 +566,35 @@ echo '<option selected value="1">' . _('Diminishing Value') . '</option>'; } -echo '</select></td></tr>'; +echo '</select></td> + </tr> + <tr> + <td>' . _('Depreciation Rate') . ':</td> + <td><input ' . (in_array('DepnRate',$Errors) ? 'class="inputerror"' : 'class="number"' ) .' type="text" name="DepnRate" size="4" maxlength="4" value="' . $_POST['DepnRate'] . '" />%</td> + </tr> + </table>'; -echo '<tr><td>' . _('Depreciation Rate') . ':</td><td><input ' . (in_array('DepnRate',$Errors) ? 'class="inputerror"' : 'class="number"' ) .' type="Text" name="DepnRate" size=4 maxlength=4 value="' . $_POST['DepnRate'] . '">%</td></tr>'; -echo '</table>'; +if (isset($AssetRow)){ + + echo '<table> + <tr> + <th colspan="2">' . _('Asset Financial Summary') . '</th> + </tr> + <tr> + <td>' . _('Accumulated Costs') . ':</td> + <td class="number">' . locale_number_format($AssetRow['cost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr> + <tr> + <td>' . _('Accumulated Depreciation') . ':</td> + <td class="number">' . locale_number_format($AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr> + <tr> + <td>' . _('Net Book Value') . ':</td> + <td class="number">' . locale_number_format($AssetRow['cost']-$AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; -/*Get the last period depreciation (depn is transtype =44) was posted for */ -echo '<table><tr><th colspan=2>' . _('Asset Financial Summary') . '</th></tr>'; - -echo '<tr><td>' . _('Accumulated Costs') . ':</td><td class="number">' . locale_number_format($AssetRow['cost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; -echo '<tr><td>' . _('Accumulated Depreciation') . ':</td><td class="number">' . locale_number_format($AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; -echo '<tr><td>' . _('Net Book Value') . ':</td><td class="number">' . locale_number_format($AssetRow['cost']-$AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; - -$result = DB_query("SELECT periods.lastdate_in_period, + /*Get the last period depreciation (depn is transtype =44) was posted for */ + $result = DB_query("SELECT periods.lastdate_in_period, max(fixedassettrans.periodno) FROM fixedassettrans INNER JOIN periods ON fixedassettrans.periodno=periods.periodno @@ -555,26 +602,35 @@ GROUP BY periods.lastdate_in_period ORDER BY periods.lastdate_in_period DESC",$db); -$LastDepnRun = DB_fetch_row($result); -if(DB_num_rows($result)==0){ - $LastRunDate = _('Not Yet Run'); -} else { - $LastRunDate = ConvertSQLDate($LastDepnRun[0]); + $LastDepnRun = DB_fetch_row($result); + if(DB_num_rows($result)==0){ + $LastRunDate = _('Not Yet Run'); + } else { + $LastRunDate = ConvertSQLDate($LastDepnRun[0]); + } + echo '<tr> + <td>' . _('Depreciation last run') . ':</td> + <td>' . $LastRunDate . '</td> + </tr> + </table>'; } -echo '<tr><td>' . _('Depreciation last run') . ':</td><td>' . $LastRunDate . '</td></tr> - </table>'; - if (isset($New)) { - echo '<div class="centre"><br /><input type="submit" name="submit" value="' . _('Insert New Fixed Asset') . '">'; - + echo '<div class="centre"> + <br /> + <input type="submit" name="submit" value="' . _('Insert New Fixed Asset') . '" />'; } else { - - echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Update') . '"></div>'; - prnMsg( _('Only click the Delete button if you are sure you wish to delete the asset. Only assets with a zero book value can be deleted'), 'warn', _('WARNING')); - echo '<br /><div class="centre"><input type="submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');"></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Update') . '" /> + </div>'; + prnMsg( _('Only click the Delete button if you are sure you wish to delete the asset. Only assets with a zero book value can be deleted'), 'warn', _('WARNING')); + echo '<br /> + <div class="centre"> + <input type="submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');" />'; } -echo '</form></div>'; +echo '</div> + </form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetLocations.php =================================================================== --- trunk/FixedAssetLocations.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/FixedAssetLocations.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -1,34 +1,35 @@ <?php -//$PageSecurity = 11; +/* $Id$ */ include('includes/session.inc'); $title = _('Fixed Asset Locations'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' + </p>'; -if (isset($_POST['submit']) and !isset($_POST['delete'])) { +if (isset($_POST['submit']) AND !isset($_POST['delete'])) { $InputError=0; - if (!isset($_POST['LocationID']) or mb_strlen($_POST['LocationID'])<1) { + if (!isset($_POST['LocationID']) OR mb_strlen($_POST['LocationID'])<1) { prnMsg(_('You must enter at least one character in the location ID'),'error'); $InputError=1; } - if (!isset($_POST['LocationDescription']) or mb_strlen($_POST['LocationDescription'])<1) { + if (!isset($_POST['LocationDescription']) OR mb_strlen($_POST['LocationDescription'])<1) { prnMsg(_('You must enter at least one character in the location description'),'error'); $InputError=1; } if ($InputError==0) { $sql="INSERT INTO fixedassetlocations - VALUES ( - '".$_POST['LocationID']."', - '".$_POST['LocationDescription']."', - '".$_POST['ParentLocationID']."')"; + VALUES ('".$_POST['LocationID']."', + '".$_POST['LocationDescription']."', + '".$_POST['ParentLocationID']."')"; $result=DB_query($sql, $db); } } if (isset($_GET['SelectedLocation'])) { - $sql="SELECT * FROM fixedassetlocations WHERE locationid='".$_GET['SelectedLocation']."'"; + $sql="SELECT * FROM fixedassetlocations + WHERE locationid='".$_GET['SelectedLocation']."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); $LocationID = $myrow['locationid']; @@ -45,14 +46,15 @@ if (isset($_POST['update']) and !isset($_POST['delete'])) { $InputError=0; if (!isset($_POST['LocationDescription']) or mb_strlen($_POST['LocationDescription'])<1) { - prnMsg(_('You must enter at least one character in the location description'),'error'); - $InputError=1; + prnMsg(_('You must enter at least one character in the location description'),'error'); + $InputError=1; } if ($InputError==0) { - $sql="UPDATE fixedassetlocations SET - locationdescription='".$_POST['LocationDescription']."', - parentlocationid='".$_POST['ParentLocationID']."' - WHERE locationid ='".$_POST['LocationID']."'"; + $sql="UPDATE fixedassetlocations + SET locationdescription='" . $_POST['LocationDescription'] . "', + parentlocationid='" . $_POST['ParentLocationID'] . "' + WHERE locationid ='" . $_POST['LocationID'] . "'"; + $result=DB_query($sql,$db); echo '<meta http-equiv="Refresh" content="0; url="'.htmlspecialchars($_SERVER['PHP_SELF']).'">'; } @@ -87,68 +89,74 @@ $result=DB_query($sql, $db); if (DB_num_rows($result) > 0) { - echo '<table class=selection><tr>'; - echo '<th>'._('Location ID').'</th> - <th>'._('Location Description').'</th> - <th>'._('Parent Location').'</th></tr>'; + echo '<table class="selection"> + <tr> + <th>'._('Location ID').'</th> + <th>'._('Location Description').'</th> + <th>'._('Parent Location').'</th> + </tr>'; } while ($myrow=DB_fetch_array($result)) { - echo '<tr><td>'.$myrow['locationid'].'</td> - <td>'.$myrow['locationdescription'].'</td>'; - $parentsql="SELECT locationdescription FROM fixedassetlocations WHERE locationid='".$myrow['parentlocationid']."'"; - $parentresult=DB_query($parentsql, $db); - $parentrow=DB_fetch_array($parentresult); - echo '<td>'.$parentrow['locationdescription'].'</td>'; - echo '<td><a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID.'SelectedLocation='.$myrow['locationid'].'">' . _('Edit') . '</td>'; + echo '<tr> + <td>' . $myrow['locationid'] . '</td> + <td>' . $myrow['locationdescription'] . '</td>'; + $ParentSql="SELECT locationdescription FROM fixedassetlocations WHERE locationid='".$myrow['parentlocationid']."'"; + $ParentResult=DB_query($ParentSql, $db); + $ParentRow=DB_fetch_array($ParentResult); + echo '<td>' . $ParentRow['locationdescription'] . '</td> + <td><a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedLocation='.$myrow['locationid'].'">' . _('Edit') . '</td>'; } -echo '</table><br />'; -echo '<form name="LocationForm" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID . '"><table class=selection>'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<tr><th style="text-align:left">'._('Location ID').'</th>'; +echo '</table> + <br />'; +echo '<form name="LocationForm" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '"> + <table class="selection"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <tr> + <th style="text-align:left">'._('Location ID').'</th>'; if (isset($_GET['SelectedLocation'])) { - echo '<input type=hidden name=LocationID value="'.$LocationID.'">'; + echo '<input type="hidden" n... [truncated message content] |
From: <dai...@us...> - 2011-11-06 03:12:40
|
Revision: 4740 http://web-erp.svn.sourceforge.net/web-erp/?rev=4740&view=rev Author: daintree Date: 2011-11-06 03:12:31 +0000 (Sun, 06 Nov 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/CustLoginSetup.php trunk/CustWhereAlloc.php trunk/CustomerTransInquiry.php trunk/DebtorsAtPeriodEnd.php trunk/DiscountMatrix.php trunk/EDIMessageFormat.php trunk/Factors.php trunk/FixedAssetCategories.php trunk/FixedAssetDepreciation.php trunk/FixedAssetItems.php trunk/FixedAssetLocations.php trunk/FixedAssetRegister.php trunk/SuppLoginSetup.php trunk/Z_BottomUpCosts.php trunk/Z_ChangeBranchCode.php trunk/Z_ChangeCustomerCode.php trunk/Z_ChangeStockCategory.php trunk/Z_ChangeStockCode.php trunk/Z_CheckAllocationsFrom.php trunk/Z_CheckAllocs.php trunk/Z_CheckDebtorsControl.php trunk/Z_CheckGLTransBalance.php trunk/Z_CopyBOM.php trunk/Z_CreateCompany.php trunk/Z_CurrencyDebtorsBalances.php trunk/Z_CurrencySuppliersBalances.php trunk/Z_DeleteSalesTransActions.php Modified: trunk/CustLoginSetup.php =================================================================== --- trunk/CustLoginSetup.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/CustLoginSetup.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -8,6 +8,16 @@ include('includes/SQL_CommonFunctions.inc'); include ('includes/LanguagesArray.php'); + +if (!isset($_SESSION['CustomerID'])){ + echo '<br /> + <br />'; + prnMsg(_('A customer must first be selected before logins can be defined for it') . '<br /><br /><a href="' . $rootpath . '/SelectCustomer.php">' . _('Select A Customer') . '</a>','info'); + include('includes/footer.inc'); + exit; +} + + echo '<a href="' . $rootpath . '/SelectCustomer.php">' . _('Back to Customers') . '</a><br />'; $sql="SELECT name @@ -20,7 +30,8 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/customer.png" title="' . _('Customer') . '" alt="" />' . ' ' . _('Customer') . ' : ' . $_SESSION['CustomerID'] . ' - ' . $CustomerName. _(' has been selected') . - '</p><br />'; + '</p> + <br />'; if (isset($_POST['submit'])) { @@ -246,11 +257,11 @@ foreach ($LanguagesArray as $LanguageEntry => $LanguageName){ if (isset($_POST['UserLanguage']) and $_POST['UserLanguage'] == $LanguageEntry){ - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; - } elseif (!isset($_POST['UserLanguage']) and $LanguageEntry == $DefaultLanguage) { - echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; + } elseif (!isset($_POST['UserLanguage']) AND $LanguageEntry == $DefaultLanguage) { + echo '<option selected value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } else { - echo '<option value="' . $LanguageEntry . '">' . $LanguageName .'</option>'; + echo '<option value="' . $LanguageEntry . '">' . $LanguageName['LanguageName'] .'</option>'; } } echo '</select></td> Modified: trunk/CustWhereAlloc.php =================================================================== --- trunk/CustWhereAlloc.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/CustWhereAlloc.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -6,7 +6,7 @@ $title = _('Customer How Paid Inquiry'); include('includes/header.inc'); -echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method=post>'; +echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"> @@ -96,7 +96,7 @@ echo '<tr> <th colspan="6"> <div class="centre"> - <font size=3 color=blue><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. locale_number_format($myrow['totamt'],$CurrDecimalPlaces) . ' ' . $CurrCode . '</font></b> + <font size=3 color="blue"><b>'._('Allocations made against invoice number') . ' ' . $_POST['TransNo'] . '<br />'._('Transaction Total').': '. locale_number_format($myrow['totamt'],$CurrDecimalPlaces) . ' ' . $CurrCode . '</font></b> </div> </th> </tr>'; Modified: trunk/CustomerTransInquiry.php =================================================================== --- trunk/CustomerTransInquiry.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/CustomerTransInquiry.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -51,15 +51,15 @@ echo '<td>' . _('From') . ':</td> <td><input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> <td>' . _('To') . ':</td> - <td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td>'; + <td><input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="text" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="4" type="submit" name="ShowResults" value="' . _('Show Transactions') . '" /> + </div> + </form>'; -echo '</tr></table> - <br /> - <div class="centre"> - <input tabindex="4" type="submit" name="ShowResults" value="' . _('Show Transactions') . '"> - </div> - </form>'; - if (isset($_POST['ShowResults']) && $_POST['TransType'] != ''){ $SQL_FromDate = FormatDateForSQL($_POST['FromDate']); $SQL_ToDate = FormatDateForSQL($_POST['ToDate']); Modified: trunk/DebtorsAtPeriodEnd.php =================================================================== --- trunk/DebtorsAtPeriodEnd.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/DebtorsAtPeriodEnd.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -133,13 +133,16 @@ <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<tr><td>' . _('From Customer Code') .':</font></td> + echo '<tr> + <td>' . _('From Customer Code') .':</font></td> <td><input tabindex="1" type="text" maxlength="6" size="7" name="FromCriteria" value="1" /></td> - </tr>'; - echo '<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>' . _('Balances As At') . ':</td> + </tr> + <tr> + <td>' . _('To Customer Code') . ':</td> + <td><input tabindex="2" type="text" maxlength="6" size="7" name="ToCriteria" value="zzzzzz" /></td> + </tr> + <tr> + <td>' . _('Balances As At') . ':</td> <td><select tabindex="3" name="PeriodEnd">'; $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; @@ -152,9 +155,14 @@ } } - echo '</select></td></tr>'; - echo '</table> - <br /><div class="centre"><input tabindex=5 type=submit name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '</select></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex="5" type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> + </div> + </form>'; include('includes/footer.inc'); } /*end of else not PrintPDF */ Modified: trunk/DiscountMatrix.php =================================================================== --- trunk/DiscountMatrix.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/DiscountMatrix.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -20,26 +20,26 @@ //initialise no input errors assumed initially before we test $InputError = 0; - if (!is_numeric($_POST['QuantityBreak'])){ + if (!is_numeric(filter_number_format($_POST['QuantityBreak']))){ prnMsg( _('The quantity break must be entered as a positive number'),'error'); $InputError =1; $Errors[$i] = 'QuantityBreak'; $i++; } - if ($_POST['QuantityBreak']<=0){ + if (filter_number_format($_POST['QuantityBreak'])<=0){ prnMsg( _('The quantity of all items on an order in the discount category') . ' ' . $_POST['DiscountCategory'] . ' ' . _('at which the discount will apply is 0 or less than 0') . '. ' . _('Positive numbers are expected for this entry'),'warn'); $InputError =1; $Errors[$i] = 'QuantityBreak'; $i++; } - if (!is_numeric($_POST['DiscountRate'])){ + if (!is_numeric(filter_number_format($_POST['DiscountRate']))){ prnMsg( _('The discount rate must be entered as a positive number'),'warn'); $InputError =1; $Errors[$i] = 'DiscountRate'; $i++; } - if ($_POST['DiscountRate']<=0 OR $_POST['DiscountRate']>=70){ + if (filter_number_format($_POST['DiscountRate'])<=0 OR filter_number_format($_POST['DiscountRate'])>=70){ prnMsg( _('The discount rate applicable for this record is either less than 0% or greater than 70%') . '. ' . _('Numbers between 1 and 69 are expected'),'warn'); $InputError =1; $Errors[$i] = 'DiscountRate'; @@ -57,8 +57,8 @@ discountrate) VALUES('" . $_POST['SalesType'] . "', '" . $_POST['DiscountCategory'] . "', - '" . $_POST['QuantityBreak'] . "', - '" . ($_POST['DiscountRate']/100) . "')"; + '" . filter_number_format($_POST['QuantityBreak']) . "', + '" . (filter_number_format($_POST['DiscountRate'])/100) . "')"; $result = DB_query($sql,$db); prnMsg( _('The discount matrix record has been added'),'success'); @@ -111,8 +111,9 @@ $sql = "SELECT DISTINCT discountcategory FROM stockmaster WHERE discountcategory <>''"; $result = DB_query($sql, $db); if (DB_num_rows($result) > 0) { - echo '<tr><td>'. _('Discount Category Code') .': </td>'; - echo '<td><select name="DiscountCategory">'; + echo '<tr> + <td>'. _('Discount Category Code') .': </td> + <td><select name="DiscountCategory">'; while ($myrow = DB_fetch_array($result)){ if ($myrow['discountcategory']==$_POST['DiscCat']){ @@ -123,18 +124,24 @@ } echo '</select></td>'; } else { - echo '<input type="hidden" name="DiscountCategory" value="">'; + echo '<input type="hidden" name="DiscountCategory" value="" />'; } -echo '<tr><td>' . _('Quantity Break') . '</td> - <td><input class="number" tabindex=3 ' . (in_array('QuantityBreak',$Errors) ? 'class="inputerror"' : '') .' type="text" name="QuantityBreak" size=10 maxlength=10></td></tr>'; +echo '<tr> + <td>' . _('Quantity Break') . '</td> + <td><input class="number" tabindex=3 ' . (in_array('QuantityBreak',$Errors) ? 'class="inputerror"' : '') .' type="text" name="QuantityBreak" size="10" maxlength="10" /></td> + </tr> + <tr> + <td>' . _('Discount Rate') . ' (%):</td> + <td><input class="number" tabindex=4 ' . (in_array('DiscountRate',$Errors) ? 'class="inputerror"' : '') . 'type="text" name="DiscountRate" size="5" maxlength="5" /></td> + </tr> + </table> + <br /> + <div class="centre"> + <input tabindex=5 type="submit" name="submit" value="' . _('Enter Information') . '"> + </div> + <br />'; -echo '<tr><td>' . _('Discount Rate') . ' (%):</td> - <td><input class="number" tabindex=4 ' . (in_array('DiscountRate',$Errors) ? 'class="inputerror"' : '') . 'type="text" name="DiscountRate" size=11 maxlength=14></td></tr>'; -echo '</table><br />'; - -echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="' . _('Enter Information') . '"></div><br />'; - $sql = "SELECT sales_type, salestype, discountcategory, @@ -169,22 +176,21 @@ $DeleteURL = htmlspecialchars($_SERVER['PHP_SELF']) . '?Delete=yes&SalesType=' . $myrow['salestype'] . '&DiscountCategory=' . $myrow['discountcategory'] . '&QuantityBreak=' . $myrow['quantitybreak']; printf('<td>%s</td> - <td>%s</td> - <td class="number">%s</td> - <td class="number">%s</td> - <td><a href="%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this discount matrix record?') . '\');">' . _('Delete') . '</td> - </tr>', - $myrow['sales_type'], - $myrow['discountcategory'], - $myrow['quantitybreak'], - $myrow['discountrate']*100 , - $DeleteURL); + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td><a href="%s" onclick="return confirm(\'' . _('Are you sure you wish to delete this discount matrix record?') . '\');">' . _('Delete') . '</td> + </tr>', + $myrow['sales_type'], + $myrow['discountcategory'], + $myrow['quantitybreak'], + $myrow['discountrate']*100 , + $DeleteURL); } -echo '</table>'; +echo '</table> + </form>'; -echo '</form>'; - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/EDIMessageFormat.php =================================================================== --- trunk/EDIMessageFormat.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/EDIMessageFormat.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -45,7 +45,7 @@ } $InputError = 0; -if ($InputError !=1 and isset($_POST['update'])) { +if ($InputError !=1 AND isset($_POST['update'])) { /*SelectedMessageLine 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*/ if (!isset($SelectedMessageLine)) { @@ -62,7 +62,7 @@ $msg = _('Message line updated'); unset ($SelectedMessageLine); -} elseif ($InputError !=1 and isset($_POST['submit'])) { +} elseif ($InputError !=1 AND isset($_POST['submit'])) { /*Selected group is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new message line form */ @@ -123,8 +123,8 @@ $result = DB_query($sql,$db); - echo '<table class=selection>'; - echo '<tr><th colspan=5><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode.'</font></th></tr>'; + echo '<table class="selection">'; + echo '<tr><th colspan="5"><font size=3>' . _('Definition of') . ' ' . $MessageType . ' ' . _('for') . ' ' . $PartnerCode.'</font></th></tr>'; $TableHeader = '<tr> <th>' . _('Section') . '</th> <th>' . _('Sequence') . '</th> @@ -161,8 +161,10 @@ } //END WHILE LIST LOOP echo '</table><p>'; if (DB_num_rows($result)==0){ - echo '<div class="centre"><input tabindex=1 type=submit name="NewEDIInvMsg" value="' . - _('Create New EDI Invoice Message From Default Template') . '"></div><br />'; + echo '<div class="centre"> + <input tabindex=1 type=submit name="NewEDIInvMsg" value="' . _('Create New EDI Invoice Message From Default Template') . '" /> + </div> + <br />'; } } //end of ifs SelectedLine is not set @@ -183,19 +185,18 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['Section'] = $myrow['section']; $_POST['SequenceNo'] = $myrow['sequenceno']; $_POST['LineText'] = $myrow['linetext']; echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?MessageType=INVOIC&PartnerCode=' . $myrow['partnercode'] . '">' . _('Review Message Lines') . '</a></div>'; - echo '<input type=hidden name="SelectedMessageLine" VALUE="' . $SelectedMessageLine . '">'; - echo '<input type=hidden name="MessageType" VALUE="' . $myrow['messagetype'] . '">'; - echo '<input type=hidden name="PartnerCode" VALUE="' . $myrow['partnercode'] . '">'; + echo '<input type="hidden" name="SelectedMessageLine" value="' . $SelectedMessageLine . '" />'; + echo '<input type="hidden" name="MessageType" value="' . $myrow['messagetype'] . '" />'; + echo '<input type="hidden" name="PartnerCode" value="' . $myrow['partnercode'] . '" />'; } else { //end of if $SelectedMessageLine only do the else when a new record is being entered - echo '<input type=hidden name="MessageType" VALUE="' . $MessageType . '">'; - echo '<input type=hidden name="PartnerCode" VALUE="' . $PartnerCode . '">'; + echo '<input type="hidden" name="MessageType" value="' . $MessageType . '" />'; + echo '<input type="hidden" name="PartnerCode" value="' . $PartnerCode . '" />'; } echo '<table class=selection>'; @@ -209,18 +210,18 @@ echo '<select tabindex=2 name="Section">'; if ($_POST['Section']=='Heading') { - echo '<option selected VALUE="Heading">' . _('Heading') . '</option>'; + echo '<option selected value="Heading">' . _('Heading') . '</option>'; } else { echo '<option value="Heading">' . _('Heading') . '</option>'; } -if (isset($_POST['Section']) and $_POST['Section']=='Detail') { - echo '<option selected VALUE="Detail">' . _('Detail') . '</option>'; +if (isset($_POST['Section']) AND $_POST['Section']=='Detail') { + echo '<option selected value="Detail">' . _('Detail') . '</option>'; } else { echo '<option value="Detail">' . _('Detail') . '</option>'; } -if (isset($_POST['Section']) and $_POST['Section']=='Summary') { - echo '<option selected VALUE="Summary">' . _('Summary') . '</option>'; +if (isset($_POST['Section']) AND $_POST['Section']=='Summary') { + echo '<option selected value="Summary">' . _('Summary') . '</option>'; } else { echo '<option value="Summary">' . _('Summary') . '</option>'; } @@ -234,17 +235,17 @@ echo '</td></tr>'; echo '<tr><td>Sequence Number:</td>'; -echo '<td><input tabindex=3 type="text" name=SequenceNo size=3 maxlength=3 value='.$_POST['SequenceNo'].'>'; +echo '<td><input tabindex=3 type="text" name=SequenceNo size=3 maxlength=3 value='.$_POST['SequenceNo'].' />'; echo '</td></tr>'; echo '<tr><td>' . _('Line Text') . ':' .'</td>'; echo '<td>'; -echo '<input tabindex=4 type="Text" name="LineText" size=50 maxlength=50 VALUE='.$_POST['LineText'] .'>'; +echo '<input tabindex=4 type="text" name="LineText" size=50 maxlength=50 value='.$_POST['LineText'] .' />'; echo '</td></tr>'; echo '</table><br />'; if (isset($_GET['SelectedMessageLine'])) { - echo '<div class="centre"><input tabindex=5 type="submit" name="update" value="'. _('Update Information'). '"></div>'; + echo '<div class="centre"><input tabindex=5 type="submit" name="update" value="'. _('Update Information'). '" /></div>'; } else { - echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="'. _('Enter Information'). '"></div>'; + echo '<div class="centre"><input tabindex=5 type="submit" name="submit" value="'. _('Enter Information'). '" /></div>'; } echo '</form>'; Modified: trunk/Factors.php =================================================================== --- trunk/Factors.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/Factors.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -33,7 +33,7 @@ if (isset($_POST['Submit']) OR isset($_POST['Update'])) { - if (mb_strlen($_POST['FactorName']) > 40 or mb_strlen($_POST['FactorName']) == 0 or $_POST['FactorName'] == '') { + if (mb_strlen($_POST['FactorName']) > 40 OR mb_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'); } @@ -49,7 +49,7 @@ } /* 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, @@ -65,7 +65,7 @@ fax, email) VALUES (null, - '" .$_POST['FactorName'] . "', + '" . $_POST['FactorName'] . "', '" . $_POST['Address1'] . "', '" . $_POST['Address2'] . "', '" . $_POST['Address3'] . "', @@ -199,45 +199,74 @@ echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - 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 '</form>'; + echo '<input type="hidden" name="FactorID" value="' . $FactorID .'" /> + <table class=selection> + <input type="hidden" name="New" value="Yes" /> + <tr> + <td>' . _('Factor company Name') . ':</td> + <td><input tabindex="1" type="text" name="FactorName" size="42" maxlength="40" value="' .$_POST['FactorName'].'" /></td> + </tr> + <tr> + <td>' . _('Address Line 1') . ':</td> + <td><input tabindex=2 type="text" name="Address1" size="42" maxlength="40" value="' . $_POST['Address1'] .'" /></td> + </tr> + <tr><td>' . _('Address Line 2') . ':</td> + <td><input tabindex=3 type="text" name="Address2" size="42" maxlength="40" value="' . $_POST['Address2'] .'" /></td> + </tr> + <tr> + <td>' . _('Address Line 3') . ':</td> + <td><input tabindex=4 type="text" name="Address3" size="42" maxlength="40" value="' .$_POST['Address3'] .'" /></td> + </tr> + <tr> + <td>' . _('Address Line 4') . ':</td> + <td><input tabindex=5 type="text" name="Address4" size="42" maxlength="40" value="' . $_POST['Address4'].'" /></td> + </tr> + <tr> + <td>' . _('Address Line 5') . ':</td> + <td><input tabindex="6" type="text" name="Address5" size="42" maxlength="40" value="' . $_POST['Address5'] .'" /></td> + </tr> + <tr> + <td>' . _('Address Line 6') . ':</td> + <td><input tabindex="7" type="text" name="Address6" size="42" maxlength="40" value="' .$_POST['Address6'] . '" /></td> + </tr> + <tr> + <td>' . _('Contact Name') . ':</td> + <td><input tabindex="8" type="text" name="ContactName" size="20" maxlength="25" value="' . $_POST['ContactName'] .'" /></td> + </tr> + <tr> + <td>' . _('Telephone') . ':</td> + <td><input tabindex="9" type="text" name="Telephone" size="20" maxlength="25" value="' .$_POST['Telephone'].'" /></td> + </tr> + <tr> + <td>' . _('Fax') . ':</td> + <td><input tabindex="10" type="text" name="Fax" value=0 size="20" maxlength="25" value="' . $_POST['Fax'] .'" /></td> + </tr> + <tr> + <td>' . _('Email') . ':</td> + <td><input tabindex="11" type="text" name="Email" size="55" maxlength=55 value="' . $_POST['Email'] . '" /></td> + </tr> + </table>'; } if (isset($_POST['Create'])) { - echo '</table><p><div class="centre"><input tabindex=12 type="submit" name="Submit" value="' . _('Insert New Factor') . '"></div>'; + echo '<p> + <div class="centre"> + <input tabindex="12" type="submit" name="Submit" value="' . _('Insert New Factor') . '" /> + </div> + </form>'; } 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> + <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?') . '\');" /> + </div> + </form>'; } - /* 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*/ @@ -247,7 +276,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="New" value="No">'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <th>' . _('ID') . '</th> <th>' . _('Company Name').'</th> @@ -299,13 +328,14 @@ <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; - + } //end while loop + echo '</table> + <p> + <div class="centre"> + <br /> + <input tabindex="3" type="submit" name="Create" value="' . _('Create New Factor') . '" /> + </div> + </form>'; } include('includes/footer.inc'); Modified: trunk/FixedAssetCategories.php =================================================================== --- trunk/FixedAssetCategories.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/FixedAssetCategories.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -8,8 +8,10 @@ include('includes/header.inc'); -echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . - _('Fixed Asset Categories') . '" alt="" />' . ' ' . $title . '</p>'; +echo '<div class="centre"> + <p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . _('Fixed Asset Categories') . '" alt="" />' . ' ' . $title . ' + </p>'; if (isset($_GET['SelectedCategory'])){ $SelectedCategory = mb_strtoupper($_GET['SelectedCategory']); @@ -41,11 +43,12 @@ } if ($_POST['CostAct'] == $_SESSION['CompanyRecord']['debtorsact'] - OR $_POST['CostAct'] == $_SESSION['CompanyRecord']['creditorsact'] - OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['debtorsact'] - OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['creditorsact'] - OR $_POST['CostAct'] == $_SESSION['CompanyRecord']['grnact'] - OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['grnact']){ + OR $_POST['CostAct'] == $_SESSION['CompanyRecord']['creditorsact'] + OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['debtorsact'] + OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['creditorsact'] + OR $_POST['CostAct'] == $_SESSION['CompanyRecord']['grnact'] + OR $_POST['AccumDepnAct'] == $_SESSION['CompanyRecord']['grnact']){ + prnMsg(_('The accounts selected to post cost or accumulated depreciation to cannot be either of the debtors control account, creditors control account or GRN suspense accounts'),'error'); $InputError =1; } @@ -62,12 +65,12 @@ $i++; } if (in_array($_POST['CostAct'], $BankAccounts)) { - prnMsg( _('The asset cost account selected is a bank account - bank accounts are protected from having any other postings made to them. Select another balance sheet account for the asset cost'),'error'); - $InputError =1; + prnMsg(_('The asset cost account selected is a bank account - bank accounts are protected from having any other postings made to them. Select another balance sheet account for the asset cost'),'error'); + $InputError=1; } if (in_array($_POST['AccumDepnAct'], $BankAccounts)) { prnMsg( _('The accumulated depreciation account selected is a bank account - bank accounts are protected from having any other postings made to them. Select another balance sheet account for the asset accumulated depreciation'),'error'); - $InputError =1; + $InputError=1; } if (isset($SelectedCategory) AND $InputError !=1) { @@ -76,13 +79,14 @@ would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE fixedassetcategories SET - categorydescription = '" . $_POST['CategoryDescription'] . "', - costact = '" . $_POST['CostAct'] . "', - depnact = '" . $_POST['DepnAct'] . "', - disposalact = '" . $_POST['DisposalAct'] . "', - accumdepnact = '" . $_POST['AccumDepnAct'] . "' - WHERE categoryid = '".$SelectedCategory . "'"; + $sql = "UPDATE fixedassetcategories + SET categorydescription = '" . $_POST['CategoryDescription'] . "', + costact = '" . $_POST['CostAct'] . "', + depnact = '" . $_POST['DepnAct'] . "', + disposalact = '" . $_POST['DisposalAct'] . "', + accumdepnact = '" . $_POST['AccumDepnAct'] . "' + WHERE categoryid = '".$SelectedCategory . "'"; + $ErrMsg = _('Could not update the fixed asset category') . $_POST['CategoryDescription'] . _('because'); $result = DB_query($sql,$db,$ErrMsg); @@ -91,11 +95,11 @@ } elseif ($InputError !=1) { $sql = "INSERT INTO fixedassetcategories (categoryid, - categorydescription, - costact, - depnact, - disposalact, - accumdepnact) + categorydescription, + costact, + depnact, + disposalact, + accumdepnact) VALUES ('" . $_POST['CategoryID'] . "', '" . $_POST['CategoryDescription'] . "', '" . $_POST['CostAct'] . "', @@ -227,16 +231,23 @@ $_POST['DisposalAct'] = $myrow['disposalact']; $_POST['AccumDepnAct'] = $myrow['accumdepnact']; - echo '<input type=hidden name="SelectedCategory" value="' . $SelectedCategory . '">'; - echo '<input type=hidden name="CategoryID" value="' . $_POST['CategoryID'] . '">'; - echo '<table class=selection><tr><td>' . _('Category Code') . ':</td><td>' . $_POST['CategoryID'] . '</td></tr>'; + echo '<input type="hidden" name="SelectedCategory" value="' . $SelectedCategory . '" />'; + echo '<input type="hidden" name="CategoryID" value="' . $_POST['CategoryID'] . '" />'; + echo '<table class="selection"> + <tr> + <td>' . _('Category Code') . ':</td> + <td>' . $_POST['CategoryID'] . '</td> + </tr>'; } else { //end of if $SelectedCategory only do the else when a new record is being entered if (!isset($_POST['CategoryID'])) { $_POST['CategoryID'] = ''; } - echo '<table class=selection><tr><td>' . _('Category Code') . ':</td> - <td><input type="Text" name="CategoryID" size=7 maxlength=6 value="' . $_POST['CategoryID'] . '"></td></tr>'; + echo '<table class="selection"> + <tr> + <td>' . _('Category Code') . ':</td> + <td><input type="text" name="CategoryID" size="7" maxlength="6" value="' . $_POST['CategoryID'] . '" /></td> + </tr>'; } //SQL to poulate account selection boxes @@ -262,13 +273,14 @@ $_POST['CategoryDescription'] = ''; } -echo '<tr><td>' . _('Category Description') . ':</td> - <td><input type="Text" name="CategoryDescription" size=22 maxlength=20 value="' . $_POST['CategoryDescription'] . '"></td></tr>'; +echo '<tr> + <td>' . _('Category Description') . ':</td> + <td><input type="text" name="CategoryDescription" size="22" maxlength="20" value="' . $_POST['CategoryDescription'] . '" /></td> + </tr> + <tr> + <td>' . _('Fixed Asset Cost GL Code') . ':</td> + <td><select name="CostAct">'; -echo '<tr><td>' . _('Fixed Asset Cost GL Code'); - -echo ':</td><td><select name="CostAct">'; - while ($myrow = DB_fetch_array($BSAccountsResult)){ if (isset($_POST['CostAct']) and $myrow['accountcode']==$_POST['CostAct']) { @@ -277,9 +289,10 @@ echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } } //end while loop -echo '</select></td></tr>'; - -echo '<tr><td>' . _('Profit and Loss Depreciation GL Code') . ':</td> +echo '</select></td> + </tr> + <tr> + <td>' . _('Profit and Loss Depreciation GL Code') . ':</td> <td><select name="DepnAct">'; while ($myrow = DB_fetch_array($PnLAccountsResult)) { @@ -289,10 +302,13 @@ echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')</option>'; } } //end while loop -echo '</select></td></tr>'; +echo '</select></td> + </tr>'; DB_data_seek($PnLAccountsResult,0); -echo '<tr><td>' . _('Profit or Loss on Disposal GL Code:') . '</td><td><select name="DisposalAct">'; +echo '<tr> + <td>' . _('Profit or Loss on Disposal GL Code:') . '</td> + <td><select name="DisposalAct">'; while ($myrow = DB_fetch_array($PnLAccountsResult)) { if (isset($_POST['DisposalAct']) and $myrow['accountcode']==$_POST['DisposalAct']) { echo '<option selected value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; @@ -300,11 +316,13 @@ echo '<option value='.$myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } } //end while loop -echo '</select></td></tr>'; +echo '</select></td> + </tr>'; - DB_data_seek($BSAccountsResult,0); -echo '<tr><td>' . _('Balance Sheet Accumulated Depreciation GL Code') . ':</td><td><select name="AccumDepnAct">'; +echo '<tr> + <td>' . _('Balance Sheet Accumulated Depreciation GL Code') . ':</td> + <td><select name="AccumDepnAct">'; while ($myrow = DB_fetch_array($BSAccountsResult)) { @@ -317,11 +335,15 @@ } //end while loop -echo '</select></td></tr></table><br />'; +echo '</select></td> + </tr> + </table> + <br />'; -echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; +echo '<div class="centre"> + <input type="Submit" name="submit" value="' . _('Enter Information') . '" /> + </div> + </form>'; -echo '</form>'; - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetDepreciation.php =================================================================== --- trunk/FixedAssetDepreciation.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/FixedAssetDepreciation.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -66,6 +66,7 @@ fixedassetcategories.depnact, fixedassetcategories.categorydescription ORDER BY assetcategoryid, assetid"; + $AssetsResult=DB_query($sql, $db); $InputError = false; //always hope for the best @@ -80,7 +81,8 @@ } echo '<p></p><table>'; -$Heading = '<tr><th>' . _('Asset ID') . '</th> +$Heading = '<tr> + <th>' . _('Asset ID') . '</th> <th>' . _('Description') . '</th> <th>' . _('Date Purchased') . '</th> <th>' . _('Cost') . '</th> @@ -97,6 +99,10 @@ $TotalCost =0; $TotalAccumDepn=0; $TotalDepn = 0; +$TotalCategoryCost = 0; +$TotalCategoryAccumDepn =0; +$TotalCategoryDepn = 0; + $RowCounter = 0; $k=0; @@ -111,7 +117,9 @@ <th class="number">' . locale_number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> </tr>'; } - echo '<tr><th colspan=9 align="left">' . $AssetRow['categorydescription'] . '</th></tr>'; + echo '<tr> + <th colspan="9" align="left">' . $AssetRow['categorydescription'] . '</th> + </tr>'; $AssetCategoryDescription = $AssetRow['categorydescription']; $TotalCategoryCost = 0; $TotalCategoryAccumDepn =0; @@ -161,7 +169,9 @@ $TotalAccumDepn +=$AssetRow['depnbfwd']; $TotalDepn +=$NewDepreciation; - if (isset($_POST['CommitDepreciation']) AND $NewDepreciation !=0 AND $InputError==false){ + if (isset($_POST['CommitDepreciation']) + AND $NewDepreciation !=0 + AND $InputError==false){ //debit depreciation expense $SQL = "INSERT INTO gltrans (type, @@ -178,9 +188,11 @@ '" . $AssetRow['depnact'] . "', '" . $AssetRow['assetid'] . "', '" . $NewDepreciation ."')"; + $ErrMsg = _('Cannot insert a depreciation GL entry for the depreciation because'); $DbgMsg = _('The SQL that failed to insert the GL Trans record was'); $result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); + $SQL = "INSERT INTO gltrans (type, typeno, trandate, @@ -226,22 +238,26 @@ $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); } //end if Committing the depreciation to DB } //end loop around the assets to calculate depreciation for -echo '<tr><th colspan=3 align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> - <th class="number">' . locale_number_format($TotalCategoryCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th class="number">' . locale_number_format($TotalCategoryAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th class="number">' . locale_number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th colspan=2></th> - <th class="number">' . locale_number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - </tr>'; -echo '<tr><th colspan=3 align="right">' . _('GRAND Total') . ' </th> - <th class="number">' . locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th class="number">' . locale_number_format($TotalAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th class="number">' . locale_number_format(($TotalCost-$TotalAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - <th colspan=2></th> - <th class="number">' . locale_number_format($TotalDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> - </tr>'; +echo '<tr> + <th colspan="3" align="right">' . _('Total for') . ' ' . $AssetCategoryDescription . ' </th> + <th class="number">' . locale_number_format($TotalCategoryCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format($TotalCategoryAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format(($TotalCategoryCost-$TotalCategoryAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th colspan="2"></th> + <th class="number">' . locale_number_format($TotalCategoryDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + </tr> + <tr> + <th colspan="3" align="right">' . _('GRAND Total') . ' </th> + <th class="number">' . locale_number_format($TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format($TotalAccumDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th class="number">' . locale_number_format(($TotalCost-$TotalAccumDepn),$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + <th colspan="2"></th> + <th class="number">' . locale_number_format($TotalDepn,$_SESSION['CompanyRecord']['decimalplaces']) . '</th> + </tr>'; -echo '</table><hr><p></p>'; +echo '</table> + <hr /> + <p />'; if (isset($_POST['CommitDepreciation']) AND $InputError==false){ $result = DB_Txn_Commit($db); @@ -251,20 +267,24 @@ /*And post the journal too */ include ('includes/GLPostings.inc'); } else { - echo '<form action=' . htmlspecialchars($_SERVER['PHP_SELF']) . ' method=post name="form">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post" name="form">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p></p>'; - echo '<table class=selection width=30%><tr></tr><tr>'; + echo '<p /> + <table class="selection" width="30%"> + <tr></tr> + <tr>'; if ($AllowUserEnteredProcessDate){ echo '<td>'._('Date to Process Depreciation'). ':</td> - <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" name="ProcessDate" maxlength=10 size=11 value="' . $_POST['ProcessDate'] . '"></td>'; + <td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat']. '" name="ProcessDate" maxlength="10" size="11" value="' . $_POST['ProcessDate'] . '" /></td>'; } else { echo '<td>'._('Date to Process Depreciation'). ':</td> - <td>' . $_POST['ProcessDate'] .'</td>'; + <td>' . $_POST['ProcessDate'] .'</td>'; } - echo '<td><div class="centre"><input type="submit" name="CommitDepreciation" value="'._('Commit Depreciation').'"></div>'; - echo '</tr></table><br />'; - echo '</form>'; + echo '<td><div class="centre"><input type="submit" name="CommitDepreciation" value="'._('Commit Depreciation').'" /></div></td> + </tr> + </table> + <br /> + </form>'; } include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetItems.php =================================================================== --- trunk/FixedAssetItems.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/FixedAssetItems.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -104,13 +104,16 @@ $Errors[$i] = 'AssetLocation'; $i++; } - if (!is_numeric($_POST['DepnRate']) OR $_POST['DepnRate']>100 OR $_POST['DepnRate']<0){ + if (!is_numeric(filter_number_format($_POST['DepnRate'])) + OR filter_number_format($_POST['DepnRate'])>100 + OR filter_number_format($_POST['DepnRate'])<0){ + $InputError = 1; prnMsg(_('The depreciation rate is expected to be a number between 0 and 100'),'error'); $Errors[$i] = 'DepnRate'; $i++; } - if ($_POST['DepnRate']>0 AND $_POST['DepnRate']<1){ + if (filter_number_format($_POST['DepnRate'])>0 AND filter_number_format($_POST['DepnRate'])<1){ prnMsg(_('Numbers less than 1 are interpreted as less than 1%. The depreciation rate should be entered as a number between 0 and 100'),'warn'); } @@ -226,15 +229,15 @@ } /*end if there was accumulated depreciation for the asset */ } /* end if there is a change in asset category */ $sql = "UPDATE fixedassets - SET longdescription='" . $_POST['LongDescription'] . "', - description='" . $_POST['Description'] . "', - assetcategoryid='" . $_POST['AssetCategoryID'] . "', - assetlocation='" . $_POST['AssetLocation'] . "', - depntype='" . $_POST['DepnType'] . "', - depnrate='" . $_POST['DepnRate'] . "', - barcode='" . $_POST['BarCode'] . "', - serialno='" . $_POST['SerialNo'] . "' - WHERE assetid='" . $AssetID . "'"; + SET longdescription='" . $_POST['LongDescription'] . "', + description='" . $_POST['Description'] . "', + assetcategoryid='" . $_POST['AssetCategoryID'] . "', + assetlocation='" . $_POST['AssetLocation'] . "', + depntype='" . $_POST['DepnType'] . "', + depnrate='" . filter_number_format($_POST['DepnRate']) . "', + barcode='" . $_POST['BarCode'] . "', + serialno='" . $_POST['SerialNo'] . "' + WHERE assetid='" . $AssetID . "'"; $ErrMsg = _('The asset could not be updated because'); $DbgMsg = _('The SQL that was used to update the asset and failed was'); @@ -257,7 +260,7 @@ '" . $_POST['AssetCategoryID'] . "', '" . $_POST['AssetLocation'] . "', '" . $_POST['DepnType'] . "', - '" . $_POST['DepnRate']. "', + '" . filter_number_format($_POST['DepnRate']). "', '" . $_POST['BarCode'] . "', '" . $_POST['SerialNo'] . "' )"; $ErrMsg = _('The asset could not be added because'); @@ -382,7 +385,7 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -if (!isset($AssetID) or $AssetID=='') { +if (!isset($AssetID) OR $AssetID=='') { /*If the page was called without $AssetID passed to page then assume a new asset is to be entered other wise the form showing the fields with the existing entries against the asset will show for editing with a hidden AssetID field. New is set to flag that the page may have called itself and still be entering a new asset, in which case the page needs to know not to go looking up details for an existing asset*/ @@ -425,13 +428,19 @@ $_POST['AssetLocation'] = $AssetRow['assetlocation']; $_POST['DepnType'] = $AssetRow['depntype']; $_POST['BarCode'] = $AssetRow['barcode']; - $_POST['DepnRate'] = $AssetRow['depnrate']; + $_POST['DepnRate'] = locale_number_format($AssetRow['depnrate'],2); - echo '<tr><td>' . _('Asset Code') . ':</td><td>'.$AssetID.'</td></tr>'. "\n"; - echo '<input type="Hidden" name="AssetID" value="'.$AssetID.'"/>'. "\n"; + echo '<tr> + <td>' . _('Asset Code') . ':</td> + <td>' . $AssetID . '</td> + </tr>'; + echo '<input type="Hidden" name="AssetID" value="'.$AssetID.'"/>'; } else { // some changes were made to the data so don't re-set form variables to DB ie the code above - echo '<tr><td>' . _('Asset Code') . ':</td><td>' . $AssetID . '</td></tr>'; + echo '<tr> + <td>' . _('Asset Code') . ':</td> + <td>' . $AssetID . '</td> + </tr>'; echo '<input type="Hidden" name="AssetID" value="' . $AssetID . '"/>'; } @@ -440,19 +449,27 @@ } else { $Description =''; } -echo '<tr><td>' . _('Asset Description') . ' (' . _('short') . '):</td> - <td><input ' . (in_array('Description',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="Description" size=52 maxlength=50 value="' . $Description . '"></td></tr>'."\n"; +echo '<tr> + <td>' . _('Asset Description') . ' (' . _('short') . '):</td> + <td><input ' . (in_array('Description',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="Description" size="52" maxlength="50" value="' . $Description . '"></td> + </tr>'; + if (isset($_POST['LongDescription'])) { $LongDescription = AddCarriageReturns($_POST['LongDescription']); } else { $LongDescription =''; } -echo '<tr><td>' . _('Asset Description') . ' (' . _('long') . '):</td><td><textarea ' . (in_array('LongDescription',$Errors) ? 'class="texterror"' : '' ) .' name="LongDescription" cols=40 rows=4>' . stripslashes($LongDescription) . '</textarea></td></tr>'; +echo '<tr> + <td>' . _('Asset Description') . ' (' . _('long') . '):</td> + <td><textarea ' . (in_array('LongDescription',$Errors) ? 'class="texterror"' : '' ) .' name="LongDescription" cols="40" rows="4">' . stripslashes($LongDescription) . '</textarea></td> + </tr>'; if (!isset($New) ) { //ie not new at all! - echo '<tr><td>'. _('Image File (.jpg)') . ':</td><td><input type="file" id="ItemPicture" name="ItemPicture"></td>'; + echo '<tr> + <td>'. _('Image File (.jpg)') . ':</td> + <td><input type="file" id="ItemPicture" name="ItemPicture"></td>'; if (function_exists('imagecreatefromjpg')){ $AssetImgLink = '<img src="GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. @@ -478,7 +495,9 @@ // EOR Add Image upload for New Item - by Ori } //only show the add image if the asset already exists - otherwise AssetID will not be set - and the image needs the AssetID to save -echo '<tr><td>' . _('Asset Category') . ':</td><td><select name="AssetCategoryID">'; +echo '<tr> + <td>' . _('Asset Category') . ':</td> + <td><select name="AssetCategoryID">'; $sql = "SELECT categoryid, categorydescription FROM fixedassetcategories"; $ErrMsg = _('The asset categories could not be retrieved because'); @@ -499,7 +518,10 @@ } if (isset($AssetRow) AND ($AssetRow['datepurchased']!='0000-00-00' AND $AssetRow['datepurchased']!='')){ - echo '<tr><td>' . _('Date Purchased') . ':</td><td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td></tr>'; + echo '<tr> + <td>' . _('Date Purchased') . ':</td> + <td>' . ConvertSQLDate($AssetRow['datepurchased']) . '</td> + </tr>'; } $sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; @@ -507,7 +529,10 @@ $DbgMsg = _('The SQL used to retrieve asset locations and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); -echo '<tr><td>' . _('Asset Location') . ':</td><td><select name="AssetLocation">'; +echo '<tr> + <td>' . _('Asset Location') . ':</td> + <td><select name="AssetLocation">'; + while ($myrow=DB_fetch_array($result)){ if ($_POST['AssetLocation']==$myrow['locationid']){ echo '<option selected value="' . $myrow['locationid'] .'">' . $myrow['locationdescription'] . '</option>'; @@ -515,15 +540,21 @@ echo '<option value="' . $myrow['locationid'] .'">' . $myrow['locationdescription'] . '</option>'; } } -echo '</select><a target="_blank" href="'. $rootpath . '/FixedAssetLocations.php">'.' ' . _('Add Asset Location') . '</a></td></tr>'; +echo '</select> + <a target="_blank" href="'. $rootpath . '/FixedAssetLocations.php">'.' ' . _('Add Asset Location') . '</a></td> + </tr> + <tr> + <td>' . _('Bar Code') . ':</td> + <td><input ' . (in_array('BarCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="BarCode" size="22" maxlength="20" value="' . $_POST['BarCode'] . '" /></td> + </tr> + <tr> + <td>' . _('Serial Number') . ':</td> + <td><input ' . (in_array('SerialNo',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="SerialNo" size="32" maxlength="30" value="' . $_POST['SerialNo'] . '" /></td> + </tr> + <tr> + <td>' . _('Depreciation Type') . ':</td> + <td><select name="DepnType">'; -echo '<tr><td>' . _('Bar Code') . ':</td><td><input ' . (in_array('BarCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="BarCode" size=22 maxlength=20 value="' . $_POST['BarCode'] . '"></td></tr>'; - -echo '<tr><td>' . _('Serial Number') . ':</td><td><input ' . (in_array('SerialNo',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="SerialNo" size=32 maxlength=30 value="' . $_POST['SerialNo'] . '"></td></tr>'; - - -echo '<tr><td>' . _('Depreciation Type') . ':</td><td><select name="DepnType">'; - if (!isset($_POST['DepnType'])){ $_POST['DepnType'] = 0; //0 = Straight line - 1 = Diminishing Value } @@ -535,19 +566,35 @@ echo '<option selected value="1">' . _('Diminishing Value') . '</option>'; } -echo '</select></td></tr>'; +echo '</select></td> + </tr> + <tr> + <td>' . _('Depreciation Rate') . ':</td> + <td><input ' . (in_array('DepnRate',$Errors) ? 'class="inputerror"' : 'class="number"' ) .' type="text" name="DepnRate" size="4" maxlength="4" value="' . $_POST['DepnRate'] . '" />%</td> + </tr> + </table>'; -echo '<tr><td>' . _('Depreciation Rate') . ':</td><td><input ' . (in_array('DepnRate',$Errors) ? 'class="inputerror"' : 'class="number"' ) .' type="Text" name="DepnRate" size=4 maxlength=4 value="' . $_POST['DepnRate'] . '">%</td></tr>'; -echo '</table>'; +if (isset($AssetRow)){ + + echo '<table> + <tr> + <th colspan="2">' . _('Asset Financial Summary') . '</th> + </tr> + <tr> + <td>' . _('Accumulated Costs') . ':</td> + <td class="number">' . locale_number_format($AssetRow['cost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr> + <tr> + <td>' . _('Accumulated Depreciation') . ':</td> + <td class="number">' . locale_number_format($AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr> + <tr> + <td>' . _('Net Book Value') . ':</td> + <td class="number">' . locale_number_format($AssetRow['cost']-$AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; -/*Get the last period depreciation (depn is transtype =44) was posted for */ -echo '<table><tr><th colspan=2>' . _('Asset Financial Summary') . '</th></tr>'; - -echo '<tr><td>' . _('Accumulated Costs') . ':</td><td class="number">' . locale_number_format($AssetRow['cost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; -echo '<tr><td>' . _('Accumulated Depreciation') . ':</td><td class="number">' . locale_number_format($AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; -echo '<tr><td>' . _('Net Book Value') . ':</td><td class="number">' . locale_number_format($AssetRow['cost']-$AssetRow['accumdepn'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; - -$result = DB_query("SELECT periods.lastdate_in_period, + /*Get the last period depreciation (depn is transtype =44) was posted for */ + $result = DB_query("SELECT periods.lastdate_in_period, max(fixedassettrans.periodno) FROM fixedassettrans INNER JOIN periods ON fixedassettrans.periodno=periods.periodno @@ -555,26 +602,35 @@ GROUP BY periods.lastdate_in_period ORDER BY periods.lastdate_in_period DESC",$db); -$LastDepnRun = DB_fetch_row($result); -if(DB_num_rows($result)==0){ - $LastRunDate = _('Not Yet Run'); -} else { - $LastRunDate = ConvertSQLDate($LastDepnRun[0]); + $LastDepnRun = DB_fetch_row($result); + if(DB_num_rows($result)==0){ + $LastRunDate = _('Not Yet Run'); + } else { + $LastRunDate = ConvertSQLDate($LastDepnRun[0]); + } + echo '<tr> + <td>' . _('Depreciation last run') . ':</td> + <td>' . $LastRunDate . '</td> + </tr> + </table>'; } -echo '<tr><td>' . _('Depreciation last run') . ':</td><td>' . $LastRunDate . '</td></tr> - </table>'; - if (isset($New)) { - echo '<div class="centre"><br /><input type="submit" name="submit" value="' . _('Insert New Fixed Asset') . '">'; - + echo '<div class="centre"> + <br /> + <input type="submit" name="submit" value="' . _('Insert New Fixed Asset') . '" />'; } else { - - echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Update') . '"></div>'; - prnMsg( _('Only click the Delete button if you are sure you wish to delete the asset. Only assets with a zero book value can be deleted'), 'warn', _('WARNING')); - echo '<br /><div class="centre"><input type="submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');"></div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Update') . '" /> + </div>'; + prnMsg( _('Only click the Delete button if you are sure you wish to delete the asset. Only assets with a zero book value can be deleted'), 'warn', _('WARNING')); + echo '<br /> + <div class="centre"> + <input type="submit" name="delete" value="' . _('Delete This Asset') . '" onclick="return confirm(\'' . _('Are You Sure? Only assets with a zero book value can be deleted.') . '\');" />'; } -echo '</form></div>'; +echo '</div> + </form>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/FixedAssetLocations.php =================================================================== --- trunk/FixedAssetLocations.php 2011-11-04 04:56:22 UTC (rev 4739) +++ trunk/FixedAssetLocations.php 2011-11-06 03:12:31 UTC (rev 4740) @@ -1,34 +1,35 @@ <?php -//$PageSecurity = 11; +/* $Id$ */ include('includes/session.inc'); $title = _('Fixed Asset Locations'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . - _('Search') . '" alt="" />' . ' ' . $title.'</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.' + </p>'; -if (isset($_POST['submit']) and !isset($_POST['delete'])) { +if (isset($_POST['submit']) AND !isset($_POST['delete'])) { $InputError=0; - if (!isset($_POST['LocationID']) or mb_strlen($_POST['LocationID'])<1) { + if (!isset($_POST['LocationID']) OR mb_strlen($_POST['LocationID'])<1) { prnMsg(_('You must enter at least one character in the location ID'),'error'); $InputError=1; } - if (!isset($_POST['LocationDescription']) or mb_strlen($_POST['LocationDescription'])<1) { + if (!isset($_POST['LocationDescription']) OR mb_strlen($_POST['LocationDescription'])<1) { prnMsg(_('You must enter at least one character in the location description'),'error'); $InputError=1; } if ($InputError==0) { $sql="INSERT INTO fixedassetlocations - VALUES ( - '".$_POST['LocationID']."', - '".$_POST['LocationDescription']."', - '".$_POST['ParentLocationID']."')"; + VALUES ('".$_POST['LocationID']."', + '".$_POST['LocationDescription']."', + '".$_POST['ParentLocationID']."')"; $result=DB_query($sql, $db); } } if (isset($_GET['SelectedLocation'])) { - $sql="SELECT * FROM fixedassetlocations WHERE locationid='".$_GET['SelectedLocation']."'"; + $sql="SELECT * FROM fixedassetlocations + WHERE locationid='".$_GET['SelectedLocation']."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); $LocationID = $myrow['locationid']; @@ -45,14 +46,15 @@ if (isset($_POST['update']) and !isset($_POST['delete'])) { $InputError=0; if (!isset($_POST['LocationDescription']) or mb_strlen($_POST['LocationDescription'])<1) { - prnMsg(_('You must enter at least one character in the location description'),'error'); - $InputError=1; + prnMsg(_('You must enter at least one character in the location description'),'error'); + $InputError=1; } if ($InputError==0) { - $sql="UPDATE fixedassetlocations SET - locationdescription='".$_POST['LocationDescription']."', - parentlocationid='".$_POST['ParentLocationID']."' - WHERE locationid ='".$_POST['LocationID']."'"; + $sql="UPDATE fixedassetlocations + SET locationdescription='" . $_POST['LocationDescription'] . "', + parentlocationid='" . $_POST['ParentLocationID'] . "' + WHERE locationid ='" . $_POST['LocationID'] . "'"; + $result=DB_query($sql,$db); echo '<meta http-equiv="Refresh" content="0; url="'.htmlspecialchars($_SERVER['PHP_SELF']).'">'; } @@ -87,68 +89,74 @@ $result=DB_query($sql, $db); if (DB_num_rows($result) > 0) { - echo '<table class=selection><tr>'; - echo '<th>'._('Location ID').'</th> - <th>'._('Location Description').'</th> - <th>'._('Parent Location').'</th></tr>'; + echo '<table class="selection"> + <tr> + <th>'._('Location ID').'</th> + <th>'._('Location Description').'</th> + <th>'._('Parent Location').'</th> + </tr>'; } while ($myrow=DB_fetch_array($result)) { - echo '<tr><td>'.$myrow['locationid'].'</td> - <td>'.$myrow['locationdescription'].'</td>'; - $parentsql="SELECT locationdescription FROM fixedassetlocations WHERE locationid='".$myrow['parentlocationid']."'"; - $parentresult=DB_query($parentsql, $db); - $parentrow=DB_fetch_array($parentresult); - echo '<td>'.$parentrow['locationdescription'].'</td>'; - echo '<td><a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID.'SelectedLocation='.$myrow['locationid'].'">' . _('Edit') . '</td>'; + echo '<tr> + <td>' . $myrow['locationid'] . '</td> + <td>' . $myrow['locationdescription'] . '</td>'; + $ParentSql="SELECT locationdescription FROM fixedassetlocations WHERE locationid='".$myrow['parentlocationid']."'"; + $ParentResult=DB_query($ParentSql, $db); + $ParentRow=DB_fetch_array($ParentResult); + echo '<td>' . $ParentRow['locationdescription'] . '</td> + <td><a href="'.htmlspecialchars($_SERVER['PHP_SELF']) . '?SelectedLocation='.$myrow['locationid'].'">' . _('Edit') . '</td>'; } -echo '</table><br />'; -echo '<form name="LocationForm" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '?' . SID . '"><table class=selection>'; -echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<tr><th style="text-align:left">'._('Location ID').'</th>'; +echo '</table> + <br />'; +echo '<form name="LocationForm" method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '"> + <table class="selection"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <tr> + <th style="text-align:left">'._('Location ID').'</th>'; if (isset($_GET['SelectedLocation'])) { - echo '<input type=hidden name=LocationID value="'.$LocationID.'">'; + echo '<input type="hidden" n... [truncated message content] |
From: <dai...@us...> - 2011-11-06 07:09:31
|
Revision: 4741 http://web-erp.svn.sourceforge.net/web-erp/?rev=4741&view=rev Author: daintree Date: 2011-11-06 07:09:21 +0000 (Sun, 06 Nov 2011) Log Message: ----------- pre 4.06RC1 Modified Paths: -------------- trunk/UpgradeDatabase.php trunk/doc/Change.log trunk/includes/ConnectDB.inc trunk/includes/LanguagesArray.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/upgrade4.05-4.06.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-11-06 03:12:31 UTC (rev 4740) +++ trunk/UpgradeDatabase.php 2011-11-06 07:09:21 UTC (rev 4741) @@ -117,6 +117,7 @@ case '4.05': case '4.05.1': case '4.05.2': + case '4.05.3': $SQLScripts[] = './sql/mysql/upgrade4.05-4.06.sql'; case '4.06': break; Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2011-11-06 03:12:31 UTC (rev 4740) +++ trunk/doc/Change.log 2011-11-06 07:09:21 UTC (rev 4741) @@ -1,5 +1,7 @@ webERP Change Log +6/11/11 Release 4.06RC1 + 30/10/11 Exson: Modification to Stocks.php to avoid losing PanSize and ShrinkFactor 30/10/11 Phil: Made it so a saleman cannot be deleted if a user is setup referring only to this salesperson 29/10/11 High-Tech Bridge SA Security Research Lab <adv...@ht...> - sanitising $_SERVER['PHP_SELF'] and unquoted sql in reportwriter/FormMaker.php and reportwriter/ReportMaker.php Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-11-06 03:12:31 UTC (rev 4740) +++ trunk/includes/ConnectDB.inc 2011-11-06 07:09:21 UTC (rev 4741) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.05.3'; //must update manually every time there is a DB change +$Version='4.06'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/includes/LanguagesArray.php =================================================================== --- trunk/includes/LanguagesArray.php 2011-11-06 03:12:31 UTC (rev 4740) +++ trunk/includes/LanguagesArray.php 2011-11-06 07:09:21 UTC (rev 4741) @@ -8,8 +8,8 @@ $LanguagesArray['en_GB.utf8']['LanguageName'] = _('English British'); $LanguagesArray['en_GB.utf8']['WindowsLocale'] = 'english-uk'; -$LanguagesArray['en_GB.utf8']['DecimalPoint'] = ','; -$LanguagesArray['en_GB.utf8']['ThousandsSeparator'] = '.'; +$LanguagesArray['en_GB.utf8']['DecimalPoint'] = '.'; +$LanguagesArray['en_GB.utf8']['ThousandsSeparator'] = ','; $LanguagesArray['cz_CZ.utf8']['LanguageName'] = _('Czech'); $LanguagesArray['cz_CZ.utf8']['WindowsLocale'] = 'czech'; Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-11-06 03:12:31 UTC (rev 4740) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-11-06 07:09:21 UTC (rev 4741) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-01 22:26+1300\n" +"POT-Creation-Date: 2011-11-06 19:49+1300\n" "PO-Revision-Date: 2011-02-07 15:33+0000\n" "Last-Translator: Tim Schofield <Unknown>\n" "Language-Team: Czech <cs...@li...>\n" @@ -142,7 +142,7 @@ #: CustomerBranches.php:286 CustomerBranches.php:296 CustomerBranches.php:306 #: CustomerBranches.php:316 CustomerTypes.php:147 CustomerTypes.php:157 #: Customers.php:289 Customers.php:298 Customers.php:306 Customers.php:314 -#: Factors.php:134 FixedAssetCategories.php:129 GLAccounts.php:80 +#: Factors.php:134 FixedAssetCategories.php:133 GLAccounts.php:80 #: GLAccounts.php:96 Locations.php:237 Locations.php:245 Locations.php:256 #: Locations.php:265 Locations.php:274 Locations.php:283 Locations.php:292 #: Locations.php:301 MRPDemandTypes.php:87 PaymentMethods.php:138 @@ -210,7 +210,7 @@ #: CustEDISetup.php:17 DailyBankTransactions.php:11 DebtorsAtPeriodEnd.php:125 #: DiscountCategories.php:10 DiscountCategories.php:131 DiscountMatrix.php:16 #: EDIMessageFormat.php:104 FixedAssetLocations.php:9 -#: FixedAssetRegister.php:13 FixedAssetRegister.php:237 +#: FixedAssetRegister.php:13 FixedAssetRegister.php:243 #: FixedAssetTransfer.php:31 FormDesigner.php:129 GLBalanceSheet.php:362 #: GLBudgets.php:29 GLJournal.php:246 InventoryPlanning.php:374 #: InventoryPlanningPrefSupplier.php:467 Labels.php:115 Labels.php:270 @@ -237,7 +237,7 @@ #: WWW_Users.php:31 WhereUsedInquiry.php:18 WorkCentres.php:111 #: WorkCentres.php:162 WorkOrderCosting.php:13 WorkOrderEntry.php:11 #: WorkOrderIssue.php:22 WorkOrderReceive.php:15 WorkOrderStatus.php:42 -#: Z_BottomUpCosts.php:51 +#: Z_BottomUpCosts.php:56 msgid "Search" msgstr "Vyhledávání" @@ -245,7 +245,7 @@ msgid "Group Name" msgstr "Název skupiny" -#: AccountGroups.php:228 EDIMessageFormat.php:129 EDIMessageFormat.php:207 +#: AccountGroups.php:228 EDIMessageFormat.php:129 EDIMessageFormat.php:208 msgid "Section" msgstr "Sekce" @@ -292,8 +292,8 @@ #: SystemParameters.php:654 SystemParameters.php:781 SystemParameters.php:916 #: SystemParameters.php:918 SystemParameters.php:928 SystemParameters.php:930 #: SystemParameters.php:984 SystemParameters.php:996 SystemParameters.php:998 -#: TaxGroups.php:307 TaxGroups.php:310 TaxGroups.php:366 WWW_Users.php:629 -#: WWW_Users.php:631 +#: TaxGroups.php:307 TaxGroups.php:310 TaxGroups.php:366 WWW_Users.php:632 +#: WWW_Users.php:634 msgid "Yes" msgstr "Ano" @@ -327,8 +327,8 @@ #: SystemParameters.php:655 SystemParameters.php:782 SystemParameters.php:915 #: SystemParameters.php:919 SystemParameters.php:927 SystemParameters.php:931 #: SystemParameters.php:985 SystemParameters.php:995 SystemParameters.php:999 -#: TaxGroups.php:308 TaxGroups.php:311 TaxGroups.php:368 WWW_Users.php:628 -#: WWW_Users.php:632 includes/PDFLowGPPageHeader.inc:44 +#: TaxGroups.php:308 TaxGroups.php:311 TaxGroups.php:368 WWW_Users.php:631 +#: WWW_Users.php:635 includes/PDFLowGPPageHeader.inc:44 #: includes/PDFTaxPageHeader.inc:35 msgid "No" msgstr "Ne" @@ -338,8 +338,8 @@ #: BOMs.php:149 BankAccounts.php:223 COGSGLPostings.php:108 #: COGSGLPostings.php:206 CreditStatus.php:174 Currencies.php:272 #: CustomerBranches.php:414 CustomerTypes.php:202 Customers.php:1011 -#: Customers.php:1045 EDIMessageFormat.php:150 Factors.php:300 -#: FixedAssetCategories.php:182 FixedAssetLocations.php:102 +#: Customers.php:1045 EDIMessageFormat.php:150 Factors.php:329 +#: FixedAssetCategories.php:186 FixedAssetLocations.php:107 #: FreightCosts.php:240 GLAccounts.php:312 GLTags.php:91 GeocodeSetup.php:173 #: Labels.php:411 Locations.php:382 MRPDemandTypes.php:120 MRPDemands.php:306 #: PO_AuthorisationLevels.php:151 PaymentMethods.php:200 PaymentTerms.php:205 @@ -353,7 +353,7 @@ #: SuppTransGLAnalysis.php:120 SupplierContacts.php:163 SupplierTypes.php:189 #: TaxAuthorities.php:174 TaxCategories.php:182 TaxGroups.php:188 #: TaxProvinces.php:180 UnitsOfMeasure.php:185 WWW_Access.php:123 -#: WWW_Users.php:315 WorkCentres.php:141 includes/InputSerialItems.php:88 +#: WWW_Users.php:318 WorkCentres.php:141 includes/InputSerialItems.php:88 #: includes/OutputSerialItems.php:20 #, php-format msgid "Edit" @@ -369,9 +369,9 @@ #: BOMs.php:151 BankAccounts.php:224 COGSGLPostings.php:109 #: COGSGLPostings.php:207 ContractBOM.php:266 ContractOtherReqts.php:119 #: CounterSales.php:812 CreditStatus.php:175 Credit_Invoice.php:381 -#: Currencies.php:275 CustomerReceipt.php:865 CustomerTypes.php:203 -#: Customers.php:1046 DiscountCategories.php:219 DiscountMatrix.php:175 -#: EDIMessageFormat.php:151 FixedAssetCategories.php:183 FreightCosts.php:241 +#: Currencies.php:275 CustomerReceipt.php:913 CustomerTypes.php:203 +#: Customers.php:1046 DiscountCategories.php:219 DiscountMatrix.php:182 +#: EDIMessageFormat.php:151 FixedAssetCategories.php:187 FreightCosts.php:241 #: GLAccounts.php:313 GLJournal.php:427 GLTags.php:92 GeocodeSetup.php:174 #: Labels.php:411 Locations.php:383 MRPDemandTypes.php:121 MRPDemands.php:307 #: PO_AuthorisationLevels.php:153 PO_Items.php:711 PaymentMethods.php:201 @@ -390,7 +390,7 @@ #: SuppTransGLAnalysis.php:121 SupplierContacts.php:164 SupplierTypes.php:191 #: TaxAuthorities.php:175 TaxCategories.php:183 TaxGroups.php:189 #: TaxProvinces.php:181 UnitsOfMeasure.php:186 WOSerialNos.php:319 -#: WWW_Access.php:124 WWW_Users.php:316 WorkCentres.php:142 +#: WWW_Access.php:124 WWW_Users.php:319 WorkCentres.php:142 #: includes/InputSerialItemsKeyed.php:59 includes/OutputSerialItems.php:99 #, php-format msgid "Delete" @@ -436,18 +436,18 @@ #: AccountGroups.php:397 AccountSections.php:264 AddCustomerContacts.php:258 #: AddCustomerNotes.php:245 AddCustomerTypeNotes.php:210 Areas.php:227 #: BOMs.php:759 BankAccounts.php:391 COGSGLPostings.php:354 -#: CreditStatus.php:257 Currencies.php:401 CustLoginSetup.php:261 -#: DiscountMatrix.php:136 EDIMessageFormat.php:247 -#: FixedAssetCategories.php:322 FixedAssetLocations.php:148 +#: CreditStatus.php:257 Currencies.php:401 CustLoginSetup.php:272 +#: DiscountMatrix.php:141 EDIMessageFormat.php:248 +#: FixedAssetCategories.php:344 FixedAssetLocations.php:156 #: FreightCosts.php:339 GLAccounts.php:262 GeocodeSetup.php:270 #: Locations.php:597 MRPDemandTypes.php:187 MRPDemands.php:419 #: OffersReceived.php:56 OffersReceived.php:143 PO_AuthorisationLevels.php:248 #: PaymentMethods.php:282 PaymentTerms.php:309 Prices_Customer.php:354 #: SalesAnalReptCols.php:552 SalesAnalRepts.php:514 SalesGLPostings.php:416 #: SalesPeople.php:368 Shippers.php:200 StockCategories.php:581 -#: SuppLoginSetup.php:285 SupplierContacts.php:281 TaxAuthorities.php:327 +#: SuppLoginSetup.php:293 SupplierContacts.php:281 TaxAuthorities.php:327 #: TaxCategories.php:237 TaxProvinces.php:235 UnitsOfMeasure.php:240 -#: WWW_Users.php:671 WorkCentres.php:279 +#: WWW_Users.php:674 WorkCentres.php:279 msgid "Enter Information" msgstr "Vložit informace" @@ -517,7 +517,7 @@ msgid "Customer Contacts" msgstr "Zákazník Kontakty" -#: AddCustomerContacts.php:20 CustEDISetup.php:9 CustLoginSetup.php:11 +#: AddCustomerContacts.php:20 CustEDISetup.php:9 CustLoginSetup.php:21 #: Z_CheckDebtorsControl.php:20 msgid "Back to Customers" msgstr "Zpět k zákazníkům" @@ -556,7 +556,7 @@ #: AddCustomerContacts.php:61 AddCustomerNotes.php:52 #: AddCustomerTypeNotes.php:49 Areas.php:73 CustomerTypes.php:69 -#: DeliveryDetails.php:774 Factors.php:105 FixedAssetItems.php:243 +#: DeliveryDetails.php:774 Factors.php:105 FixedAssetItems.php:246 #: MRPCalendar.php:176 PO_Items.php:374 PcAssignCashToTab.php:88 #: PcClaimExpensesFromTab.php:79 PcExpenses.php:95 PcTabs.php:102 #: PcTypeTabs.php:60 SalesAnalReptCols.php:129 SalesPeople.php:97 @@ -594,13 +594,13 @@ #: AddCustomerContacts.php:131 AddCustomerContacts.php:240 #: CustomerBranches.php:374 CustomerBranches.php:774 CustomerInquiry.php:253 #: Customers.php:1001 Customers.php:1009 EmailCustTrans.php:15 -#: EmailCustTrans.php:63 Factors.php:225 Factors.php:263 Locations.php:563 +#: EmailCustTrans.php:63 Factors.php:245 Factors.php:292 Locations.php:563 #: OrderDetails.php:109 PDFRemittanceAdvice.php:243 PO_PDFPurchOrder.php:369 #: PO_PDFPurchOrder.php:372 PrintCustTrans.php:714 PrintCustTrans.php:945 #: PrintCustTrans.php:994 PrintCustTransPortrait.php:753 #: PrintCustTransPortrait.php:999 PrintCustTransPortrait.php:1056 #: SelectCustomer.php:610 SupplierContacts.php:154 SupplierContacts.php:274 -#: UserSettings.php:183 WWW_Users.php:271 includes/PDFPickingListHeader.inc:25 +#: UserSettings.php:183 WWW_Users.php:274 includes/PDFPickingListHeader.inc:25 #: includes/PDFStatementPageHeader.inc:67 includes/PDFTransPageHeader.inc:82 #: includes/PDFTransPageHeaderPortrait.inc:109 #: includes/PO_PDFOrderPageHeader.inc:29 @@ -628,7 +628,7 @@ msgid "Contact Code" msgstr "Kontakt kód" -#: AddCustomerContacts.php:214 Factors.php:219 SupplierContacts.php:236 +#: AddCustomerContacts.php:214 Factors.php:233 SupplierContacts.php:236 msgid "Contact Name" msgstr "Jméno kontaktní osoby" @@ -697,9 +697,9 @@ msgstr "Datum" #: AddCustomerNotes.php:122 AddCustomerTypeNotes.php:109 PcReportTab.php:173 -#: Stocks.php:1017 UpgradeDatabase.php:171 UpgradeDatabase.php:174 -#: UpgradeDatabase.php:177 UpgradeDatabase.php:180 UpgradeDatabase.php:183 -#: UpgradeDatabase.php:186 UpgradeDatabase.php:189 UpgradeDatabase.php:192 +#: Stocks.php:1017 UpgradeDatabase.php:172 UpgradeDatabase.php:175 +#: UpgradeDatabase.php:178 UpgradeDatabase.php:181 UpgradeDatabase.php:184 +#: UpgradeDatabase.php:187 UpgradeDatabase.php:190 UpgradeDatabase.php:193 #: Z_Upgrade_3.10-3.11.php:62 Z_Upgrade_3.10-3.11.php:66 #: Z_Upgrade_3.10-3.11.php:70 Z_Upgrade_3.10-3.11.php:74 #: Z_Upgrade_3.10-3.11.php:78 Z_Upgrade_3.11-4.00.php:62 @@ -886,7 +886,7 @@ #: ConfirmDispatch_Invoice.php:152 ConfirmDispatch_Invoice.php:960 #: ConfirmDispatch_Invoice.php:974 Contracts.php:580 CounterSales.php:1353 #: CounterSales.php:1367 Credit_Invoice.php:697 Credit_Invoice.php:718 -#: CustomerReceipt.php:523 CustomerReceipt.php:657 CustomerReceipt.php:685 +#: CustomerReceipt.php:537 CustomerReceipt.php:676 CustomerReceipt.php:704 #: CustomerTransInquiry.php:91 DeliveryDetails.php:396 GLProfit_Loss.php:596 #: GLTagProfit_Loss.php:511 PDFRemittanceAdvice.php:85 Payments.php:325 #: PurchData.php:86 PurchData.php:104 PurchData.php:245 @@ -900,7 +900,7 @@ #: SupplierInquiry.php:78 SupplierInquiry.php:100 SupplierInquiry.php:136 #: SupplierInquiry.php:190 SupplierTransInquiry.php:95 WOSerialNos.php:47 #: WorkOrderCosting.php:418 WorkOrderReceive.php:273 -#: Z_ChangeBranchCode.php:105 Z_ChangeCustomerCode.php:92 +#: Z_ChangeBranchCode.php:105 Z_ChangeCustomerCode.php:91 #: Z_DeleteCreditNote.php:58 Z_DeleteInvoice.php:87 #: includes/PDFPaymentRun_PymtFooter.php:59 #: includes/PDFPaymentRun_PymtFooter.php:89 @@ -921,11 +921,11 @@ msgid "Aged Debtor Analysis" msgstr "Ve věku dlužníka analýza" -#: AgedDebtors.php:461 DebtorsAtPeriodEnd.php:136 +#: AgedDebtors.php:461 DebtorsAtPeriodEnd.php:137 msgid "From Customer Code" msgstr "Od kódu zákazníka" -#: AgedDebtors.php:465 DebtorsAtPeriodEnd.php:139 +#: AgedDebtors.php:465 DebtorsAtPeriodEnd.php:141 msgid "To Customer Code" msgstr "Do kódu zákazníka" @@ -972,7 +972,7 @@ #: AgedDebtors.php:517 AgedSuppliers.php:328 BOMExtendedQty.php:295 #: BOMIndented.php:276 BOMIndentedReverse.php:255 BOMListing.php:129 -#: DebtorsAtPeriodEnd.php:157 InventoryPlanning.php:445 +#: DebtorsAtPeriodEnd.php:163 InventoryPlanning.php:445 #: InventoryPlanningPrefSupplier.php:516 InventoryQuantities.php:209 #: InventoryValuation.php:268 MRPPlannedPurchaseOrders.php:280 #: MRPPlannedWorkOrders.php:337 MRPReschedules.php:152 MRPShortages.php:302 @@ -1103,7 +1103,7 @@ msgstr "Kód oblasti" #: Areas.php:132 CustomerTypes.php:164 Factors.php:140 -#: FixedAssetCategories.php:134 GLAccounts.php:197 Locations.php:328 +#: FixedAssetCategories.php:138 GLAccounts.php:197 Locations.php:328 #: MRPDemands.php:248 PcAssignCashToTab.php:135 PcClaimExpensesFromTab.php:126 #: PcExpenses.php:166 PcExpensesTypeTab.php:101 PcTabs.php:166 #: PcTypeTabs.php:135 SalesAnalReptCols.php:215 SalesCategories.php:135 @@ -1155,7 +1155,7 @@ #: AuditTrail.php:49 AuditTrail.php:62 ContractBOM.php:298 #: CounterSales.php:2141 CounterSales.php:2144 CustomerTransInquiry.php:31 -#: DailySalesInquiry.php:46 DailySalesInquiry.php:48 FixedAssetRegister.php:56 +#: DailySalesInquiry.php:47 DailySalesInquiry.php:49 FixedAssetRegister.php:56 #: FixedAssetRegister.php:65 InventoryQuantities.php:167 #: InventoryQuantities.php:193 InventoryQuantities.php:195 MRP.php:585 #: MRPReport.php:523 MRPReport.php:525 MRPReschedules.php:144 @@ -1209,8 +1209,8 @@ #: StockCategories.php:217 StockLocMovements.php:88 StockMovements.php:92 #: SupplierAllocations.php:453 SupplierInquiry.php:207 #: SupplierTransInquiry.php:19 SupplierTransInquiry.php:100 -#: Z_CheckAllocationsFrom.php:26 Z_CheckAllocationsFrom.php:49 -#: Z_CheckAllocs.php:57 Z_CheckGLTransBalance.php:11 +#: Z_CheckAllocationsFrom.php:32 Z_CheckAllocationsFrom.php:57 +#: Z_CheckAllocs.php:62 Z_CheckGLTransBalance.php:11 #: includes/InputSerialItemsFile.php:86 includes/InputSerialItemsFile.php:126 #: includes/PDFTaxPageHeader.inc:34 msgid "Type" @@ -1383,7 +1383,7 @@ msgstr "Vytištěno" #: BOMExtendedQty.php:321 BOMIndented.php:303 BOMIndentedReverse.php:283 -#: FixedAssetRegister.php:334 GLAccountReport.php:322 +#: FixedAssetRegister.php:351 GLAccountReport.php:322 #: InventoryPlanningPrefSupplier.php:58 InventoryQuantities.php:233 #: MRPPlannedPurchaseOrders.php:304 MRPPlannedWorkOrders.php:361 #: MRPReport.php:814 MRPReschedules.php:178 MRPShortages.php:332 @@ -1518,9 +1518,9 @@ #: BOMInquiry.php:199 BOMs.php:529 BOMs.php:855 ContractBOM.php:236 #: ContractBOM.php:346 ContractOtherReqts.php:93 CounterSales.php:2015 #: CounterSales.php:2196 CreditStatus.php:152 CreditStatus.php:241 -#: EmailConfirmation.php:192 FixedAssetCategories.php:159 -#: FixedAssetDepreciation.php:84 FixedAssetRegister.php:81 -#: FixedAssetRegister.php:355 FixedAssetTransfer.php:50 +#: EmailConfirmation.php:192 FixedAssetCategories.php:163 +#: FixedAssetDepreciation.php:86 FixedAssetRegister.php:83 +#: FixedAssetRegister.php:372 FixedAssetTransfer.php:50 #: FixedAssetTransfer.php:110 GLTags.php:59 GLTags.php:77 #: GLTransInquiry.php:47 GoodsReceived.php:99 InventoryQuantities.php:244 #: Labels.php:410 MRPDemandTypes.php:113 MRPDemands.php:91 MRPDemands.php:292 @@ -1632,7 +1632,7 @@ #: BOMInquiry.php:30 BOMs.php:839 ContractBOM.php:324 ContractBOM.php:329 #: Contracts.php:756 Contracts.php:759 CounterSales.php:2166 -#: CustomerReceipt.php:1026 CustomerReceipt.php:1029 +#: CustomerReceipt.php:1101 CustomerReceipt.php:1104 #: DiscountCategories.php:104 DiscountCategories.php:106 #: DiscountCategories.php:110 DiscountCategories.php:112 #: FixedAssetTransfer.php:61 MRPDemands.php:333 MRPDemands.php:336 @@ -1666,12 +1666,12 @@ #: StockStatus.php:59 StockTransfers.php:47 StockTransfers.php:458 #: StockUsage.php:64 SupplierTenders.php:359 WorkOrderEntry.php:606 #: WorkOrderIssue.php:667 Z_ChangeStockCategory.php:90 -#: Z_ChangeStockCode.php:303 +#: Z_ChangeStockCode.php:313 msgid "Stock Code" msgstr "Skladový kód" #: BOMInquiry.php:37 BOMs.php:844 ContractBOM.php:334 Contracts.php:764 -#: CounterSales.php:2170 CustomerReceipt.php:1034 FixedAssetTransfer.php:72 +#: CounterSales.php:2170 CustomerReceipt.php:1111 FixedAssetTransfer.php:72 #: MRPDemands.php:338 MRPReport.php:554 PO_Header.php:541 PO_Items.php:1060 #: SelectAsset.php:102 SelectCreditItems.php:229 SelectCreditItems.php:978 #: SelectCustomer.php:369 SelectGLAccount.php:96 SelectOrderItems.php:593 @@ -1709,7 +1709,7 @@ #: BOMInquiry.php:112 BOMs.php:528 BOMs.php:854 ContractBOM.php:345 #: CounterSales.php:2014 CounterSales.php:2195 CustomerBranches.php:367 -#: CustomerReceipt.php:1040 GLCodesInquiry.php:26 MRPDemands.php:90 +#: CustomerReceipt.php:1122 GLCodesInquiry.php:26 MRPDemands.php:90 #: MRPPlannedWorkOrders.php:256 MRPReport.php:746 PDFOrderStatus.php:318 #: PDFOrdersInvoiced.php:347 PDFPrintLabel.php:247 PO_Header.php:551 #: PO_Items.php:1072 PO_SelectOSPurchOrder.php:230 PO_SelectPurchOrder.php:211 @@ -2017,7 +2017,7 @@ msgid "Assembly" msgstr "Sestava" -#: BOMs.php:408 FixedAssetRegister.php:357 Stocks.php:958 Stocks.php:960 +#: BOMs.php:408 FixedAssetRegister.php:374 Stocks.php:958 Stocks.php:960 msgid "Purchased" msgstr "Koupeno" @@ -2053,7 +2053,7 @@ msgid "Level" msgstr "Úroveň" -#: BOMs.php:530 BOMs.php:660 Contracts.php:868 FixedAssetRegister.php:83 +#: BOMs.php:530 BOMs.php:660 Contracts.php:868 FixedAssetRegister.php:85 #: InventoryQuantities.php:245 Locations.php:328 MRP.php:551 MRP.php:583 #: PDFOrderStatus.php:278 PDFOrdersInvoiced.php:309 ReorderLevel.php:258 #: ReorderLevel.php:267 ReorderLevelLocation.php:169 StockCounts.php:133 @@ -2306,7 +2306,7 @@ msgid "Bank Address" msgstr "Adresa banky" -#: BankAccounts.php:196 CustomerAllocations.php:333 CustomerReceipt.php:755 +#: BankAccounts.php:196 CustomerAllocations.php:333 CustomerReceipt.php:783 #: CustomerTransInquiry.php:108 OffersReceived.php:109 PDFPrintLabel.php:97 #: PO_AuthorisationLevels.php:126 PO_AuthorisationLevels.php:209 #: PO_AuthorisationLevels.php:214 PO_AuthoriseMyOrders.php:115 @@ -2413,7 +2413,7 @@ "účtu. Zkontrolujte, zda vaše bankovní výpis a klikněte na check-box, když " "zjistíte, odpovídající transakce." -#: BankMatching.php:92 BankReconciliation.php:104 CustomerReceipt.php:728 +#: BankMatching.php:92 BankReconciliation.php:104 CustomerReceipt.php:749 #: DailyBankTransactions.php:32 PDFChequeListing.php:44 Payments.php:741 #: TaxAuthorities.php:151 TaxAuthorities.php:316 msgid "Bank Account" @@ -2545,7 +2545,7 @@ msgstr "Ref" #: BankMatching.php:264 ConfirmDispatch_Invoice.php:276 Credit_Invoice.php:279 -#: CustWhereAlloc.php:109 CustomerAllocations.php:364 CustomerReceipt.php:844 +#: CustWhereAlloc.php:109 CustomerAllocations.php:364 CustomerReceipt.php:892 #: CustomerTransInquiry.php:107 PaymentAllocations.php:67 Payments.php:1014 #: Payments.php:1018 Payments.php:1034 PcAssignCashToTab.php:222 #: PcAssignCashToTab.php:345 PcAuthorizeExpenses.php:90 @@ -2558,7 +2558,7 @@ #: SupplierAllocations.php:457 SupplierCredit.php:352 SupplierCredit.php:385 #: SupplierCredit.php:421 SupplierCredit.php:460 SupplierInvoice.php:330 #: SupplierInvoice.php:371 SupplierInvoice.php:411 SupplierInvoice.php:455 -#: SupplierTransInquiry.php:108 Z_CheckAllocs.php:61 +#: SupplierTransInquiry.php:108 Z_CheckAllocs.php:66 #: includes/PDFBankingSummaryPageHeader.inc:55 #: includes/PDFChequeListingPageHeader.inc:37 msgid "Amount" @@ -2627,25 +2627,25 @@ msgid "The bank accounts could not be retrieved by the SQL because" msgstr "Bankovní účty se nepodařilo získat na SQL, protože" -#: BankReconciliation.php:101 CustomerReceipt.php:719 +#: BankReconciliation.php:101 CustomerReceipt.php:737 #: DailyBankTransactions.php:28 Payments.php:737 SuppPaymentRun.php:317 msgid "The SQL used to retrieve the bank accounts was" msgstr "SQL slouží k získání bankovní účty byly" -#: BankReconciliation.php:111 CustomerReceipt.php:733 +#: BankReconciliation.php:111 CustomerReceipt.php:757 msgid "Bank Accounts have not yet been defined" msgstr "Bankovní účty dosud nebyly definovány" -#: BankReconciliation.php:111 CustomerReceipt.php:733 +#: BankReconciliation.php:111 CustomerReceipt.php:757 msgid "You must first" msgstr "Musíte nejprve" -#: BankReconciliation.php:111 CustomerReceipt.php:733 +#: BankReconciliation.php:111 CustomerReceipt.php:757 #: DailyBankTransactions.php:38 Payments.php:749 SuppPaymentRun.php:330 msgid "define the bank accounts" msgstr "definovat bankovních účtů" -#: BankReconciliation.php:111 CustomerReceipt.php:733 +#: BankReconciliation.php:111 CustomerReceipt.php:757 #: DailyBankTransactions.php:38 Payments.php:749 SuppPaymentRun.php:330 msgid "and general ledger accounts to be affected" msgstr "a účtů hlavní knihy mohly být postiženy" @@ -2686,7 +2686,7 @@ #: PrintCustTransPortrait.php:1038 StockMovements.php:93 #: SupplierAllocations.php:454 SupplierAllocations.php:567 #: SupplierAllocations.php:642 SupplierTransInquiry.php:101 -#: Z_CheckAllocs.php:58 Z_CheckGLTransBalance.php:12 +#: Z_CheckAllocs.php:63 Z_CheckGLTransBalance.php:12 #: includes/PDFQuotationPageHeader.inc:88 #: includes/PDFQuotationPortraitPageHeader.inc:86 #: includes/PDFStatementPageHeader.inc:168 @@ -2701,7 +2701,7 @@ #: GLAccountReport.php:337 PDFRemittanceAdvice.php:301 #: PaymentAllocations.php:64 PaymentAllocations.php:65 ShiptsList.php:37 #: StockCounts.php:99 StockCounts.php:135 StockLocMovements.php:93 -#: StockMovements.php:98 Z_CheckAllocs.php:59 +#: StockMovements.php:98 Z_CheckAllocs.php:64 #: includes/PDFBankingSummaryPageHeader.inc:40 #: includes/PDFCustTransListingPageHeader.inc:49 #: includes/PDFPeriodStockTransListingPageHeader.inc:48 @@ -2825,7 +2825,7 @@ #: COGSGLPostings.php:90 COGSGLPostings.php:189 COGSGLPostings.php:305 #: Customers.php:747 Customers.php:750 DiscountMatrix.php:96 -#: DiscountMatrix.php:153 Prices.php:223 PricesByCost.php:262 +#: DiscountMatrix.php:160 Prices.php:223 PricesByCost.php:262 #: SalesAnalRepts.php:32 SalesAnalRepts.php:34 SalesGLPostings.php:112 #: SalesGLPostings.php:224 SalesGLPostings.php:354 SelectOrderItems.php:710 #: api/api_xml-rpc.php:931 api/api_xml-rpc.php:974 @@ -2841,7 +2841,7 @@ msgid "Are you sure you wish to delete this COGS GL posting record?" msgstr "Jste si jisti, že chcete smazat tuto cenu?" -#: COGSGLPostings.php:190 CustomerReceipt.php:956 GLJournal.php:385 +#: COGSGLPostings.php:190 CustomerReceipt.php:1017 GLJournal.php:385 #: GLTransInquiry.php:44 Payments.php:1035 SupplierTransInquiry.php:170 #: TaxAuthorities.php:148 TaxAuthorities.php:149 index.php:1288 msgid "GL Account" @@ -2953,29 +2953,29 @@ msgid "Tax Authority Reference" msgstr "Daňový úřad Reference" -#: CompanyPreferences.php:238 Factors.php:207 +#: CompanyPreferences.php:238 Factors.php:210 msgid "Address Line 1" msgstr "1. řádek adresy" -#: CompanyPreferences.php:243 Factors.php:209 +#: CompanyPreferences.php:243 Factors.php:213 msgid "Address Line 2" msgstr "2. řádek adresy" -#: CompanyPreferences.php:248 Factors.php:211 +#: CompanyPreferences.php:248 Factors.php:217 msgid "Address Line 3" msgstr "3. řádek adresy" -#: CompanyPreferences.php:253 Factors.php:213 +#: CompanyPreferences.php:253 Factors.php:221 msgid "Address Line 4" msgstr "4. řádek adresy" #: CompanyPreferences.php:258 Customers.php:459 Customers.php:704 -#: Customers.php:734 Factors.php:215 +#: Customers.php:734 Factors.php:225 msgid "Address Line 5" msgstr "5. řádek adresy" #: CompanyPreferences.php:263 Customers.php:461 Customers.php:708 -#: Customers.php:738 Factors.php:217 +#: Customers.php:738 Factors.php:229 msgid "Address Line 6" msgstr "6. řádek adresy" @@ -2987,9 +2987,9 @@ msgid "Facsimile Number" msgstr "Faxové číslo" -#: CompanyPreferences.php:278 CustLoginSetup.php:150 Customers.php:449 -#: SuppLoginSetup.php:138 Suppliers.php:679 Suppliers.php:856 -#: WWW_Users.php:445 +#: CompanyPreferences.php:278 CustLoginSetup.php:161 Customers.php:449 +#: SuppLoginSetup.php:147 Suppliers.php:679 Suppliers.php:856 +#: WWW_Users.php:448 msgid "Email Address" msgstr "E-mailová adresa" @@ -3047,7 +3047,7 @@ #: CompanyPreferences.php:519 ConfirmDispatch_Invoice.php:617 #: ConfirmDispatch_Invoice.php:1645 Credit_Invoice.php:1509 -#: FixedAssetItems.php:120 FixedAssetItems.php:573 GLBudgets.php:234 +#: FixedAssetItems.php:123 FixedAssetItems.php:625 GLBudgets.php:234 #: GLTags.php:64 GoodsReceived.php:248 GoodsReceived.php:254 #: GoodsReceived.php:261 GoodsReceived.php:738 Labels.php:259 #: MRPCalendar.php:314 PO_AuthoriseMyOrders.php:138 Payments.php:886 @@ -3177,10 +3177,10 @@ msgid "Confirm Dispatch and Invoice" msgstr "Potvrdit Expedice a faktury" -#: ConfirmDispatch_Invoice.php:248 Contracts.php:772 CustLoginSetup.php:21 -#: CustLoginSetup.php:22 CustomerAllocations.php:327 CustomerBranches.php:363 +#: ConfirmDispatch_Invoice.php:248 Contracts.php:772 CustLoginSetup.php:31 +#: CustLoginSetup.php:32 CustomerAllocations.php:327 CustomerBranches.php:363 #: CustomerBranches.php:532 CustomerBranches.php:579 CustomerInquiry.php:126 -#: CustomerReceipt.php:846 CustomerReceipt.php:897 CustomerReceipt.php:1022 +#: CustomerReceipt.php:894 CustomerReceipt.php:948 CustomerReceipt.php:1096 #: CustomerTransInquiry.php:101 Customers.php:14 Customers.php:325 #: DeliveryDetails.php:804 FTP_RadioBeacon.php:51 PDFOrderStatus.php:275 #: PDFOrdersInvoiced.php:305 PricesByCost.php:153 SalesGraph.php:180 @@ -3202,14 +3202,14 @@ #: ConfirmDispatch_Invoice.php:248 CustEDISetup.php:93 Customers.php:440 #: Customers.php:643 Customers.php:678 DeliveryDetails.php:804 #: OrderDetails.php:67 SalesAnalRepts.php:27 SalesAnalRepts.php:29 -#: WWW_Users.php:272 WWW_Users.php:491 Z_ChangeBranchCode.php:199 +#: WWW_Users.php:275 WWW_Users.php:494 Z_ChangeBranchCode.php:201 #: includes/PDFStatementPageHeader.inc:112 includes/PDFTransPageHeader.inc:46 #: includes/PDFTransPageHeaderPortrait.inc:55 msgid "Customer Code" msgstr "Kód zákazníka" -#: ConfirmDispatch_Invoice.php:249 CustEDISetup.php:96 CustomerReceipt.php:235 -#: CustomerReceipt.php:1041 Customers.php:443 Customers.php:684 +#: ConfirmDispatch_Invoice.php:249 CustEDISetup.php:96 CustomerReceipt.php:248 +#: CustomerReceipt.php:1123 Customers.php:443 Customers.php:684 #: Customers.php:714 DeliveryDetails.php:805 OrderDetails.php:69 #: POReport.php:494 POReport.php:1268 SalesInquiry.php:754 #: SalesInquiry.php:764 SalesInquiry.php:788 SalesInquiry.php:932 @@ -3311,7 +3311,7 @@ msgstr "Cena" #: ConfirmDispatch_Invoice.php:272 CounterSales.php:736 Credit_Invoice.php:275 -#: CustomerReceipt.php:845 DeliveryDetails.php:828 OrderDetails.php:167 +#: CustomerReceipt.php:893 DeliveryDetails.php:828 OrderDetails.php:167 #: PrintCustTrans.php:865 PrintCustTrans.php:954 PrintCustTrans.php:1003 #: PrintCustTransPortrait.php:912 PrintCustTransPortrait.php:1010 #: PrintCustTransPortrait.php:1067 RecurringSalesOrders.php:323 @@ -3864,7 +3864,7 @@ msgstr "Nelze načíst mbflag" #: ConfirmDispatch_Invoice.php:925 CounterSales.php:1317 -#: FixedAssetItems.php:574 SalesAnalReptCols.php:328 Stocks.php:1199 +#: FixedAssetItems.php:627 SalesAnalReptCols.php:328 Stocks.php:1199 #: Suppliers.php:965 includes/MiscFunctions.php:36 msgid "WARNING" msgstr "UPOZORNĚNÍ" @@ -3893,7 +3893,7 @@ #: ConfirmDispatch_Invoice.php:959 CounterSales.php:1352 #: Credit_Invoice.php:696 EDIMessageFormat.php:43 EDISendInvoices.php:105 -#: FixedAssetCategories.php:86 FixedAssetCategories.php:105 +#: FixedAssetCategories.php:90 FixedAssetCategories.php:109 #: PricesBasedOnMarkUp.php:334 PricesBasedOnMarkUp.php:350 #: SelectCreditItems.php:1407 SpecialOrder.php:493 StockCategories.php:23 #: StockCategories.php:84 StockCategories.php:155 Z_ReApplyCostToSA.php:62 @@ -4175,7 +4175,7 @@ #: ConfirmDispatch_Invoice.php:1601 ConfirmDispatch_Invoice.php:1603 #: ContractBOM.php:293 CounterSales.php:1969 CounterSales.php:1971 -#: CustomerReceipt.php:528 DeliveryDetails.php:577 DeliveryDetails.php:581 +#: CustomerReceipt.php:542 DeliveryDetails.php:577 DeliveryDetails.php:581 #: DeliveryDetails.php:779 DeliveryDetails.php:782 GLBalanceSheet.php:18 #: GLProfit_Loss.php:22 GLTagProfit_Loss.php:22 GLTagProfit_Loss.php:519 #: GLTags.php:51 GLTransInquiry.php:36 PDFStockLocTransfer.php:28 @@ -4282,7 +4282,7 @@ msgstr "To je problém výběru část záznamy k zobrazení, protože" #: ContractBOM.php:140 PO_Items.php:989 SupplierTenders.php:471 -#: Z_ChangeStockCategory.php:63 Z_ChangeStockCode.php:92 +#: Z_ChangeStockCategory.php:63 Z_ChangeStockCode.php:104 msgid "The SQL statement that failed was" msgstr "Příkazu SQL, který byl neúspěšný" @@ -4391,13 +4391,13 @@ msgid "Create a New Stock Item" msgstr "Vytvoření nové položky skladem" -#: ContractBOM.php:348 FixedAssetItems.php:473 Stocks.php:838 +#: ContractBOM.php:348 FixedAssetItems.php:490 Stocks.php:838 #: SupplierTenders.php:492 msgid "Image" msgstr "Obrázek" -#: ContractBOM.php:368 CounterSales.php:2029 FixedAssetItems.php:468 -#: FixedAssetItems.php:472 PO_Items.php:1098 SalesCategories.php:248 +#: ContractBOM.php:368 CounterSales.php:2029 FixedAssetItems.php:485 +#: FixedAssetItems.php:489 PO_Items.php:1098 SalesCategories.php:248 #: SelectCreditItems.php:1017 SelectOrderItems.php:1489 #: SelectOrderItems.php:1667 Stocks.php:832 Stocks.php:836 #: SupplierTenders.php:518 WorkOrderEntry.php:643 WorkOrderIssue.php:709 @@ -4505,7 +4505,7 @@ #: PO_SelectOSPurchOrder.php:480 PO_SelectPurchOrder.php:431 PurchData.php:164 #: ReprintGRN.php:78 SelectProduct.php:349 SelectSupplier.php:143 #: ShipmentCosting.php:531 ShipmentCosting.php:608 Shipt_Select.php:293 -#: ShiptsList.php:11 SuppCreditGRNs.php:269 SuppLoginSetup.php:24 +#: ShiptsList.php:11 SuppCreditGRNs.php:269 SuppLoginSetup.php:33 #: SuppPriceList.php:205 SuppPriceList.php:276 SupplierAllocations.php:566 #: SupplierAllocations.php:641 SupplierCredit.php:262 SupplierInquiry.php:118 #: SupplierInvoice.php:234 SupplierTransInquiry.php:104 @@ -5018,7 +5018,7 @@ "Alespoň jednoho zákazníka Obor Název klíčového slova nebo výpis z oboru " "zákazníka kódu nebo pobočky telefonní číslo musí být zapsány na vyhledávání" -#: Contracts.php:663 CustomerReceipt.php:574 SelectCustomer.php:163 +#: Contracts.php:663 CustomerReceipt.php:592 SelectCustomer.php:163 #: SelectOrderItems.php:327 msgid "The searched customer records requested cannot be retrieved because" msgstr "Hledali záznamy zákazníků požadovaná nelze načíst, protože" @@ -5125,12 +5125,12 @@ msgid "Branch" msgstr "Větev" -#: Contracts.php:774 Factors.php:260 SelectCreditItems.php:240 +#: Contracts.php:774 Factors.php:289 SelectCreditItems.php:240 #: SelectCustomer.php:415 SelectOrderItems.php:603 SupplierContacts.php:226 msgid "Contact" msgstr "Kontakt" -#: Contracts.php:776 EmailConfirmation.php:160 Factors.php:223 +#: Contracts.php:776 EmailConfirmation.php:160 Factors.php:241 #: PDFCustomerList.php:342 PDFRemittanceAdvice.php:241 #: SelectCreditItems.php:242 SelectCustomer.php:418 SelectOrderItems.php:605 #: includes/PDFOrderPageHeader_generic.inc:32 @@ -5143,7 +5143,7 @@ msgid "Fax" msgstr "Fax" -#: Contracts.php:824 CustomerInquiry.php:126 CustomerReceipt.php:897 +#: Contracts.php:824 CustomerInquiry.php:126 CustomerReceipt.php:948 #: PDFRemittanceAdvice.php:267 PO_Header.php:600 PrintCustTrans.php:847 #: PrintCustTransPortrait.php:893 SupplierInquiry.php:118 #: includes/PDFQuotationPageHeader.inc:86 @@ -5174,7 +5174,7 @@ msgid "The stock categories could not be retrieved because" msgstr "Populace kategorie se nepodařilo získat, protože" -#: Contracts.php:850 FixedAssetItems.php:485 PricesBasedOnMarkUp.php:109 +#: Contracts.php:850 FixedAssetItems.php:504 PricesBasedOnMarkUp.php:109 #: SpecialOrder.php:690 Stocks.php:848 msgid "The SQL used to retrieve stock categories and failed was" msgstr "SQL slouží k načtení zásob kategorií a neúspěšný byl" @@ -5233,7 +5233,7 @@ msgid "Contract Status" msgstr "Stav zakázky" -#: Contracts.php:923 SuppLoginSetup.php:20 WWW_Users.php:21 index.php:20 +#: Contracts.php:923 SuppLoginSetup.php:29 WWW_Users.php:21 index.php:20 msgid "Setup" msgstr "Nastavení" @@ -5532,8 +5532,8 @@ msgid "Net" msgstr "Čistý" -#: CounterSales.php:816 CustomerReceipt.php:831 CustomerReceipt.php:848 -#: CustomerReceipt.php:1011 GLAccountInquiry.php:155 GLAccountReport.php:341 +#: CounterSales.php:816 CustomerReceipt.php:869 CustomerReceipt.php:896 +#: CustomerReceipt.php:1079 GLAccountInquiry.php:155 GLAccountReport.php:341 #: GLJournal.php:364 GLJournal.php:388 Payments.php:1036 #: SelectOrderItems.php:1402 SuppContractChgs.php:80 SuppContractChgs.php:167 #: SuppTransGLAnalysis.php:107 SuppTransGLAnalysis.php:199 @@ -5703,7 +5703,7 @@ msgstr "New Work Pořadové číslo" #: CounterSales.php:1212 DeliveryDetails.php:555 EDIMessageFormat.php:127 -#: EDIMessageFormat.php:204 Prices_Customer.php:36 +#: EDIMessageFormat.php:205 Prices_Customer.php:36 #: RecurringSalesOrdersProcess.php:88 ReverseGRN.php:336 SpecialOrder.php:116 #: SpecialOrder.php:119 msgid "for" @@ -5735,42 +5735,42 @@ msgstr "" "SQL, které se nepodařilo vložit GL transakce na vrub bankovního účtu bylo" -#: CounterSales.php:1827 CustomerReceipt.php:442 +#: CounterSales.php:1827 CustomerReceipt.php:456 msgid "Cannot insert a GL transaction for the bank account debit" msgstr "Nelze vložit transakce GL na vrub bankovního účtu" -#: CounterSales.php:1845 CustomerReceipt.php:491 +#: CounterSales.php:1845 CustomerReceipt.php:505 msgid "" "The SQL that failed to insert the GL transaction for the debtors account " "credit was" msgstr "" "SQL, které se nepodařilo vložit GL transakce pro dlužníky účet byl úvěr" -#: CounterSales.php:1846 CustomerReceipt.php:492 +#: CounterSales.php:1846 CustomerReceipt.php:506 msgid "Cannot insert a GL transaction for the debtors account credit" msgstr "Nelze vložit GL transakce pro dlužníky účet kreditní" -#: CounterSales.php:1898 CustomerReceipt.php:469 +#: CounterSales.php:1898 CustomerReceipt.php:483 msgid "The SQL that failed to insert the bank account transaction was" msgstr "SQL, které se nepodařilo vložit na bankovní účet, transakce byla" -#: CounterSales.php:1899 CustomerReceipt.php:470 +#: CounterSales.php:1899 CustomerReceipt.php:484 msgid "Cannot insert a bank transaction" msgstr "Nelze vložit bankovní transakce" -#: CounterSales.php:1927 CustomerReceipt.php:401 +#: CounterSales.php:1927 CustomerReceipt.php:415 msgid "The SQL that failed to insert the customer receipt transaction was" msgstr "SQL, které se nepodařilo vložit zákazníkovi přijetí transakce" -#: CounterSales.php:1928 CustomerReceipt.php:402 +#: CounterSales.php:1928 CustomerReceipt.php:416 msgid "Cannot insert a receipt transaction against the customer because" msgstr "Nelze vložit přijetí transakce vůči zákazníkovi, protože" -#: CounterSales.php:1937 CustomerReceipt.php:410 +#: CounterSales.php:1937 CustomerReceipt.php:424 msgid "The SQL that failed to update the date of the last payment received was" msgstr "SQL, které se nepodařilo aktualizovat datum poslední obdržela platbu," -#: CounterSales.php:1938 CustomerReceipt.php:411 +#: CounterSales.php:1938 CustomerReceipt.php:425 msgid "" "Cannot update the customer record for the date of the last payment received " "because" @@ -6394,9 +6394,9 @@ msgid "The currency code cannot contain any of the following characters" msgstr "Kód měny nemůže obsahovat žádný z těchto znaků" -#: Currencies.php:107 CustEDISetup.php:31 CustLoginSetup.php:40 -#: Customers.php:56 Stocks.php:113 SuppLoginSetup.php:42 TaxCategories.php:31 -#: WWW_Users.php:66 WorkCentres.php:35 Z_ChangeBranchCode.php:28 +#: Currencies.php:107 CustEDISetup.php:31 CustLoginSetup.php:51 +#: Customers.php:56 Stocks.php:113 SuppLoginSetup.php:51 TaxCategories.php:31 +#: WWW_Users.php:68 WorkCentres.php:35 Z_ChangeBranchCode.php:28 #: Z_ImportStocks.php:123 msgid "or a space" msgstr "nebo mezeru" @@ -6622,27 +6622,37 @@ msgid "Customer Login Configuration" msgstr "Přihlášení zákazníka konfigurace" -#: CustLoginSetup.php:22 SelectCustomer.php:210 SuppLoginSetup.php:24 +#: CustLoginSetup.php:15 +#, fuzzy +msgid "A customer must first be selected before logins can be defined for it" +msgstr "Položka musí být nejprve vybrán před tuto stránku se nazývá" + +#: CustLoginSetup.php:15 +#, fuzzy +msgid "Select A Customer" +msgstr "Vybrat zákazníka" + +#: CustLoginSetup.php:32 SelectCustomer.php:210 SuppLoginSetup.php:33 msgid " has been selected" msgstr " byla vybrána" -#: CustLoginSetup.php:37 SuppLoginSetup.php:39 WWW_Users.php:63 +#: CustLoginSetup.php:48 SuppLoginSetup.php:48 WWW_Users.php:65 msgid "The user ID entered must be at least 4 characters long" msgstr "ID uživatele, zadal musí být nejméně 4 znaky dlouhé" -#: CustLoginSetup.php:40 SuppLoginSetup.php:42 WWW_Users.php:66 +#: CustLoginSetup.php:51 SuppLoginSetup.php:51 WWW_Users.php:68 msgid "User names cannot contain any of the following characters" msgstr "Uživatelská jména nesmí obsahovat žádný z následujících znaků" -#: CustLoginSetup.php:44 SuppLoginSetup.php:46 WWW_Users.php:70 +#: CustLoginSetup.php:55 SuppLoginSetup.php:55 WWW_Users.php:72 msgid "The password entered must be at least 5 characters long" msgstr "Zadané heslo musí být minimálně 5 znaků" -#: CustLoginSetup.php:48 SuppLoginSetup.php:50 WWW_Users.php:74 +#: CustLoginSetup.php:59 SuppLoginSetup.php:59 WWW_Users.php:76 msgid "The password cannot contain the user id" msgstr "Heslo nesmí obsahovat uživatelské id" -#: CustLoginSetup.php:51 WWW_Users.php:77 +#: CustLoginSetup.php:62 WWW_Users.php:80 msgid "" "If you enter a Customer Code you must also enter a Branch Code valid for " "this Customer" @@ -6650,109 +6660,109 @@ "Zadáte-li kód zákazníka, musíte také zadat Pobočka kodex platný pro tohoto " "zákazníka" -#: CustLoginSetup.php:61 WWW_Users.php:102 +#: CustLoginSetup.php:72 WWW_Users.php:105 msgid "The check on validity of the customer code and branch failed because" msgstr "Kontrola platnosti kód zákazníka a větve se nezdařilo, protože" -#: CustLoginSetup.php:62 WWW_Users.php:103 +#: CustLoginSetup.php:73 WWW_Users.php:106 msgid "The SQL that was used to check the customer code and branch was" msgstr "SQL, který byl použit ke kontrole kód zákazníka a větev byla" -#: CustLoginSetup.php:66 WWW_Users.php:107 +#: CustLoginSetup.php:77 WWW_Users.php:110 msgid "The entered Branch Code is not valid for the entered Customer Code" msgstr "Vstoupil Pobočka Kód není platný pro zadané kód zákazníka" -#: CustLoginSetup.php:104 SuppLoginSetup.php:93 +#: CustLoginSetup.php:115 SuppLoginSetup.php:102 #, fuzzy msgid "The user could not be added because" msgstr "Aktivum nelze přidat, protože" -#: CustLoginSetup.php:105 SuppLoginSetup.php:94 +#: CustLoginSetup.php:116 SuppLoginSetup.php:103 #, fuzzy msgid "The SQL that was used to insert the new user and failed was" msgstr "SQL, který byl použit k aktualizaci uživatele a neúspěšný byl" -#: CustLoginSetup.php:107 +#: CustLoginSetup.php:118 #, fuzzy msgid "A new customer login has been created" msgstr "Nové práce, aby byla vytvořena pro" -#: CustLoginSetup.php:120 SuppLoginSetup.php:108 WWW_Users.php:268 -#: WWW_Users.php:402 +#: CustLoginSetup.php:131 SuppLoginSetup.php:117 WWW_Users.php:271 +#: WWW_Users.php:405 msgid "User Login" msgstr "Přihlášení uživatele" -#: CustLoginSetup.php:138 SMTPServer.php:59 SuppLoginSetup.php:126 -#: WWW_Users.php:433 includes/Login.php:59 +#: CustLoginSetup.php:149 SMTPServer.php:59 SuppLoginSetup.php:135 +#: WWW_Users.php:436 includes/Login.php:59 msgid "Password" msgstr "Heslo" -#: CustLoginSetup.php:142 SuppLoginSetup.php:130 WWW_Users.php:269 -#: WWW_Users.php:437 +#: CustLoginSetup.php:153 SuppLoginSetup.php:139 WWW_Users.php:272 +#: WWW_Users.php:440 msgid "Full Name" msgstr "Celé jméno" -#: CustLoginSetup.php:146 Locations.php:555 SalesPeople.php:330 -#: SuppLoginSetup.php:134 SupplierContacts.php:262 WWW_Users.php:441 +#: CustLoginSetup.php:157 Locations.php:555 SalesPeople.php:330 +#: SuppLoginSetup.php:143 SupplierContacts.php:262 WWW_Users.php:444 msgid "Telephone No" msgstr "Telefonní číslo" -#: CustLoginSetup.php:155 CustomerBranches.php:545 CustomerBranches.php:582 -#: WWW_Users.php:273 WWW_Users.php:496 +#: CustLoginSetup.php:166 CustomerBranches.php:545 CustomerBranches.php:582 +#: WWW_Users.php:276 WWW_Users.php:499 #: includes/PDFCustomerListPageHeader.inc:84 api/api_xml-rpc.php:244 msgid "Branch Code" msgstr "Kód oboru" -#: CustLoginSetup.php:175 SuppLoginSetup.php:196 WWW_Users.php:530 +#: CustLoginSetup.php:186 SuppLoginSetup.php:205 WWW_Users.php:533 msgid "Reports Page Size" msgstr "Zprávy Velikost stránky" -#: CustLoginSetup.php:179 CustLoginSetup.php:181 EmailConfirmation.php:119 +#: CustLoginSetup.php:190 CustLoginSetup.php:192 EmailConfirmation.php:119 #: PrintCustOrder.php:101 PrintCustOrder_generic.php:111 -#: SuppLoginSetup.php:200 SuppLoginSetup.php:202 WWW_Users.php:534 -#: WWW_Users.php:536 +#: SuppLoginSetup.php:209 SuppLoginSetup.php:211 WWW_Users.php:537 +#: WWW_Users.php:539 msgid "A4" msgstr "A4" -#: CustLoginSetup.php:185 CustLoginSetup.php:187 CustLoginSetup.php:191 -#: CustLoginSetup.php:193 SuppLoginSetup.php:206 SuppLoginSetup.php:208 -#: SuppLoginSetup.php:212 SuppLoginSetup.php:214 WWW_Users.php:540 -#: WWW_Users.php:542 WWW_Users.php:546 WWW_Users.php:548 +#: CustLoginSetup.php:196 CustLoginSetup.php:198 CustLoginSetup.php:202 +#: CustLoginSetup.php:204 SuppLoginSetup.php:215 SuppLoginSetup.php:217 +#: SuppLoginSetup.php:221 SuppLoginSetup.php:223 WWW_Users.php:543 +#: WWW_Users.php:545 WWW_Users.php:549 WWW_Users.php:551 msgid "A3" msgstr "A3" -#: CustLoginSetup.php:191 CustLoginSetup.php:193 CustLoginSetup.php:203 -#: CustLoginSetup.php:205 CustLoginSetup.php:214 CustLoginSetup.php:216 +#: CustLoginSetup.php:202 CustLoginSetup.php:204 CustLoginSetup.php:214 +#: CustLoginSetup.php:216 CustLoginSetup.php:225 CustLoginSetup.php:227 #: EmailConfirmation.php:119 PrintCustOrder.php:101 -#: PrintCustOrder_generic.php:111 SuppLoginSetup.php:212 -#: SuppLoginSetup.php:214 SuppLoginSetup.php:224 SuppLoginSetup.php:226 -#: SuppLoginSetup.php:235 SuppLoginSetup.php:237 WWW_Users.php:546 -#: WWW_Users.php:548 WWW_Users.php:558 WWW_Users.php:560 WWW_Users.php:569 -#: WWW_Users.php:571 +#: PrintCustOrder_generic.php:111 SuppLoginSetup.php:221 +#: SuppLoginSetup.php:223 SuppLoginSetup.php:233 SuppLoginSetup.php:235 +#: SuppLoginSetup.php:244 SuppLoginSetup.php:246 WWW_Users.php:549 +#: WWW_Users.php:551 WWW_Users.php:561 WWW_Users.php:563 WWW_Users.php:572 +#: WWW_Users.php:574 msgid "landscape" msgstr "na šířku" -#: CustLoginSetup.php:197 CustLoginSetup.php:199 CustLoginSetup.php:203 -#: CustLoginSetup.php:205 SuppLoginSetup.php:218 SuppLoginSetup.php:220 -#: SuppLoginSetup.php:224 SuppLoginSetup.php:226 WWW_Users.php:552 -#: WWW_Users.php:554 WWW_Users.php:558 WWW_Users.php:560 +#: CustLoginSetup.php:208 CustLoginSetup.php:210 CustLoginSetup.php:214 +#: CustLoginSetup.php:216 SuppLoginSetup.php:227 SuppLoginSetup.php:229 +#: SuppLoginSetup.php:233 SuppLoginSetup.php:235 WWW_Users.php:555 +#: WWW_Users.php:557 WWW_Users.php:561 WWW_Users.php:563 msgid "Letter" msgstr "Dopis" -#: CustLoginSetup.php:209 CustLoginSetup.php:211 CustLoginSetup.php:214 -#: CustLoginSetup.php:216 SuppLoginSetup.php:230 SuppLoginSetup.php:232 -#: SuppLoginSetup.php:235 SuppLoginSetup.php:237 WWW_Users.php:564 -#: WWW_Users.php:566 WWW_Users.php:569 WWW_Users.php:571 +#: CustLoginSetup.php:220 CustLoginSetup.php:222 CustLoginSetup.php:225 +#: CustLoginSetup.php:227 SuppLoginSetup.php:239 SuppLoginSetup.php:241 +#: SuppLoginSetup.php:244 SuppLoginSetup.php:246 WWW_Users.php:567 +#: WWW_Users.php:569 WWW_Users.php:572 WWW_Users.php:574 msgid "Legal" msgstr "Právní" -#: CustLoginSetup.php:222 SuppLoginSetup.php:243 UserSettings.php:146 -#: WWW_Users.php:279 WWW_Users.php:578 +#: CustLoginSetup.php:233 SuppLoginSetup.php:252 UserSettings.php:146 +#: WWW_Users.php:282 WWW_Users.php:581 msgid "Theme" msgstr "Téma" -#: CustLoginSetup.php:244 SuppLoginSetup.php:267 UserSettings.php:127 -#: WWW_Users.php:280 WWW_Users.php:603 +#: CustLoginSetup.php:255 SuppLoginSetup.php:276 UserSettings.php:127 +#: WWW_Users.php:283 WWW_Users.php:606 msgid "Language" msgstr "Jazyk" @@ -6778,7 +6788,7 @@ msgid "The transaction number to be queried must be entered first" msgstr "Číslo transakce, které budou dotazovány musí být zapsány první" -#: CustWhereAlloc.php:87 CustomerTransInquiry.php:90 Z_CheckAllocs.php:51 +#: CustWhereAlloc.php:87 CustomerTransInquiry.php:90 Z_CheckAllocs.php:56 msgid "" "The customer transactions for the selected criteria could not be retrieved " "because" @@ -6797,23 +6807,23 @@ msgstr "Celkem transakce" #: CustWhereAlloc.php:108 CustomerTransInquiry.php:106 -#: SupplierTransInquiry.php:107 Z_CheckAllocs.php:60 +#: SupplierTransInquiry.php:107 Z_CheckAllocs.php:65 msgid "Ex Rate" msgstr "Ex Hodnotit" -#: CustWhereAlloc.php:110 Z_CheckAllocs.php:62 +#: CustWhereAlloc.php:110 Z_CheckAllocs.php:67 msgid "Alloc" msgstr "Alloc" #: CustWhereAlloc.php:128 EmailCustTrans.php:12 SalesInquiry.php:1080 -#: SupplierCredit.php:1113 Z_CheckAllocs.php:80 +#: SupplierCredit.php:1113 Z_CheckAllocs.php:85 msgid "Credit Note" msgstr "Dobropis" #: CustWhereAlloc.php:130 PcAssignCashToTab.php:225 PcAssignCashToTab.php:361 #: PcAuthorizeExpenses.php:93 PcClaimExpensesFromTab.php:215 #: PcClaimExpensesFromTab.php:379 PcReportTab.php:174 PcReportTab.php:328 -#: Z_CheckAllocs.php:82 Z_SalesIntegrityCheck.php:90 +#: Z_CheckAllocs.php:87 Z_SalesIntegrityCheck.php:90 #: Z_SalesIntegrityCheck.php:105 msgid "Receipt" msgstr "Obdržení" @@ -6879,7 +6889,7 @@ msgid "Allocate Receipt" msgstr "Příjem přidělit" -#: CustomerAllocations.php:322 CustomerReceipt.php:529 +#: CustomerAllocations.php:322 CustomerReceipt.php:543 msgid "Allocate Receipts" msgstr "Příjmy přidělit" @@ -6922,7 +6932,7 @@ msgstr "Přesto se" #: CustomerAllocations.php:365 CustomerAllocations.php:491 -#: CustomerAllocations.php:532 CustomerReceipt.php:231 CustomerReceipt.php:529 +#: CustomerAllocations.php:532 CustomerReceipt.php:240 CustomerReceipt.php:543 #: SupplierAllocations.php:458 SupplierAllocations.php:594 #: SupplierAllocations.php:670 #, php-format @@ -6974,7 +6984,7 @@ msgid "Process Allocations" msgstr "Proces Přidělené" -#: CustomerAllocations.php:434 CustomerReceipt.php:1015 Labels.php:265 +#: CustomerAllocations.php:434 CustomerReceipt.php:1086 Labels.php:265 #: Payments.php:1026 PcAssignCashToTab.php:177 PcAssignCashToTab.php:373 #: PcAuthorizeExpenses.php:323 PcClaimExpensesFromTab.php:167 #: PcClaimExpensesFromTab.php:385 PcExpenses.php:344 PcExpensesTypeTab.php:140 @@ -7313,8 +7323,8 @@ msgid "Define Sales People" msgstr "Definice prodejců" -#: CustomerBranches.php:683 DailySalesInquiry.php:40 SalesPeople.php:170 -#: WWW_Users.php:275 +#: CustomerBranches.php:683 DailySalesInquiry.php:41 SalesPeople.php:170 +#: WWW_Users.php:278 msgid "Salesperson" msgstr "Prodejce" @@ -7369,7 +7379,7 @@ msgid "Phone Number" msgstr "Telefonní číslo" -#: CustomerBranches.php:763 Factors.php:262 +#: CustomerBranches.php:763 Factors.php:291 msgid "Fax Number" msgstr "Faxové číslo" @@ -7459,48 +7469,48 @@ msgid "The config value NumberOfMonthMustBeShown cannot be retrieved" msgstr "Config hodnota NumberOfMonthMustBeShown nelze načíst" -#: CustomerInquiry.php:127 CustomerReceipt.php:897 SelectOrderItems.php:711 +#: CustomerInquiry.php:127 CustomerReceipt.php:948 SelectOrderItems.php:711 #: SupplierCredit.php:264 SupplierInquiry.php:120 SupplierInvoice.php:236 msgid "Terms" msgstr "Podmínky" -#: CustomerInquiry.php:127 CustomerReceipt.php:897 Customers.php:512 +#: CustomerInquiry.php:127 CustomerReceipt.php:948 Customers.php:512 #: Customers.php:806 Customers.php:836 msgid "Credit Limit" msgstr "Úvěrový limit" -#: CustomerInquiry.php:128 CustomerReceipt.php:897 Customers.php:533 +#: CustomerInquiry.php:128 CustomerReceipt.php:948 Customers.php:533 #: Customers.php:873 Customers.php:879 Customers.php:897 Customers.php:919 #: Customers.php:924 index.php:1080 msgid "Credit Status" msgstr "Stav úvěru" -#: CustomerInquiry.php:131 CustomerReceipt.php:900 +#: CustomerInquiry.php:131 CustomerReceipt.php:952 msgid "ACCOUNT ON HOLD" msgstr "ÚČET NA HOLD" -#: CustomerInquiry.php:136 CustomerReceipt.php:905 PrintCustStatements.php:362 +#: CustomerInquiry.php:136 CustomerReceipt.php:958 PrintCustStatements.php:362 #: SupplierInquiry.php:142 msgid "Total Balance" msgstr "Celkem Zůstatek" -#: CustomerInquiry.php:137 CustomerReceipt.php:906 PrintCustStatements.php:358 +#: CustomerInquiry.php:137 CustomerReceipt.php:959 PrintCustStatements.php:358 #: SalesPeople.php:206 Shipments.php:396 Stocks.php:977 Stocks.php:979 #: SupplierInquiry.php:143 includes/PDFAgedDebtorsPageHeader.inc:50 #: includes/PDFAgedSuppliersPageHeader.inc:36 msgid "Current" msgstr "Proud" -#: CustomerInquiry.php:138 CustomerReceipt.php:907 SupplierInquiry.php:144 +#: CustomerInquiry.php:138 CustomerReceipt.php:960 SupplierInquiry.php:144 msgid "Now Due" msgstr "Nyní Díky" -#: CustomerInquiry.php:139 CustomerInquiry.php:140 CustomerReceipt.php:908 -#: CustomerReceipt.php:909 SupplierInquiry.php:145 SupplierInquiry.php:146 +#: CustomerInquiry.php:139 CustomerInquiry.php:140 CustomerReceipt.php:961 +#: CustomerReceipt.php:962 SupplierInquiry.php:145 SupplierInquiry.php:146 msgid "Days Overdue" msgstr "Dnů po splatnosti" -#: CustomerInquiry.php:140 CustomerReceipt.php:909 PrintCustStatements.php:361 +#: CustomerInquiry.php:140 CustomerReceipt.php:962 PrintCustStatements.php:361 #: SupplierInquiry.php:146 msgid "Over" msgstr "Přes" @@ -7522,7 +7532,7 @@ msgstr "Neexistují žádné transakce, k zobrazení, protože" #: CustomerInquiry.php:202 SupplierInquiry.php:211 -#: Z_CheckAllocationsFrom.php:29 Z_CheckAllocationsFrom.php:52 +#: Z_CheckAllocationsFrom.php:35 Z_CheckAllocationsFrom.php:60 #: includes/PDFStatementPageHeader.inc:172 msgid "Allocated" msgstr "Přidělených" @@ -7596,31 +7606,31 @@ msgid "Receipt Entry" msgstr "Příjem Vstup" -#: CustomerReceipt.php:32 +#: CustomerReceipt.php:35 msgid "A bank account must be selected for this receipt" msgstr "Bankovní účet, musí být vybrán pro tento příjem" -#: CustomerReceipt.php:47 Payments.php:699 +#: CustomerReceipt.php:54 Payments.php:699 msgid "The bank account name cannot be retrieved because" msgstr "Na bankovní účet, jméno nemůže získat, protože" -#: CustomerReceipt.php:56 Payments.php:709 +#: CustomerReceipt.php:63 Payments.php:709 msgid "The bank account number" msgstr "Číslo bankovního účtu" -#: CustomerReceipt.php:56 +#: CustomerReceipt.php:63 msgid "is not set up as a bank account" msgstr "není nastavena jako bankovní účet" -#: CustomerReceipt.php:69 +#: CustomerReceipt.php:76 msgid "The exchange rate entered should be numeric" msgstr "Směnného kurzu by měla být součástí číselné" -#: CustomerReceipt.php:76 +#: CustomerReceipt.php:83 msgid "The functional exchange rate entered should be numeric" msgstr "Funkční směnný kurz by měl být součástí číselné" -#: CustomerReceipt.php:92 +#: CustomerReceipt.php:99 msgid "" "Changing the currency of the receipt means that existing entries need to be " "re-done - only customers trading in the selected currency can be selected" @@ -7628,71 +7638,71 @@ "Změna měny přijetí znamená, že stávající položky je třeba re-udělat - jen " "zákazníci obchodování ve vybrané měně je možné zvolit" -#: CustomerReceipt.php:160 Payments.php:650 +#: CustomerReceipt.php:167 Payments.php:650 msgid "No General Ledger code has been chosen" msgstr "Č. General Ledger kód byl vybrán" -#: CustomerReceipt.php:160 GLJournal.php:171 Payments.php:633 Payments.php:650 +#: CustomerReceipt.php:167 GLJournal.php:171 Payments.php:633 Payments.php:650 msgid "so this GL analysis item could not be added" msgstr "takže tato analýza GL položky by neměly být přidávány" -#: CustomerReceipt.php:206 +#: CustomerReceipt.php:213 msgid "The company has not yet been set up properly" msgstr "Společnost dosud nebyl správně nastaven" -#: CustomerReceipt.php:206 +#: CustomerReceipt.php:213 msgid "this information is needed to process the batch" msgstr "tato informace je nutná ke zpracování dávky" -#: CustomerReceipt.php:206 +#: CustomerReceipt.php:213 msgid "Processing has been cancelled" msgstr "Zpracování byla zrušena" -#: CustomerReceipt.php:231 +#: CustomerReceipt.php:240 msgid "Summary of Receipt Batch" msgstr "Shrnutí Příjem dávky" -#: CustomerReceipt.php:233 +#: CustomerReceipt.php:246 msgid "Batch Number" msgstr "Číslo šarže" -#: CustomerReceipt.php:234 CustomerReceipt.php:753 +#: CustomerReceipt.php:247 CustomerReceipt.php:779 msgid "Date Banked" msgstr "Datum Uložené" -#: CustomerReceipt.php:236 CustomerReceipt.php:847 +#: CustomerReceipt.php:249 CustomerReceipt.php:895 msgid "GL Code" msgstr "GL kód" -#: CustomerReceipt.php:237 CustomerReceipt.php:996 +#: CustomerReceipt.php:250 CustomerReceipt.php:1061 msgid "Amount of Receipt" msgstr "Výše Příjem" -#: CustomerReceipt.php:260 +#: CustomerReceipt.php:274 msgid "Print a Customer Receipt" msgstr "Tisk účtenek zákazníka" -#: CustomerReceipt.php:284 +#: CustomerReceipt.php:298 msgid "Cannot insert a GL entry for the receipt because" msgstr "Nelze vložit záznam GL pro přijetí, protože" -#: CustomerReceipt.php:285 +#: CustomerReceipt.php:299 msgid "The SQL that failed to insert the receipt GL entry was" msgstr "SQL, které se nepodařilo vložit převzetí GL vstup" -#: CustomerReceipt.php:354 +#: CustomerReceipt.php:368 msgid "Act Transfer" msgstr "Zákon Transfer" -#: CustomerReceipt.php:363 +#: CustomerReceipt.php:377 msgid "The SQL that failed to insert the bank transaction was" msgstr "SQL, které se nepodařilo vložit bankovní transakce" -#: CustomerReceipt.php:364 Payments.php:553 Payments.php:579 +#: CustomerReceipt.php:378 Payments.php:553 Payments.php:579 msgid "Cannot insert a bank transaction using the SQL" msgstr "Nelze vložit bankovní transakce pomocí SQL" -#: CustomerReceipt.php:441 +#: CustomerReceipt.php:455 msgid "" "The SQL that failed to insert the GL transaction fro the bank account debit " "was" @@ -7700,38 +7710,38 @@ "SQL, které se nepodařilo vložit GL transakci spatřují na bankovní účet, " "debetní byl" -#: CustomerReceipt.php:515 +#: CustomerReceipt.php:529 msgid "" "The SQL that failed to insert the GL transaction for the payment discount " "debit was" msgstr "" "SQL, které se nepodařilo vložit GL transakci debetní platební sleva byla" -#: CustomerReceipt.php:516 +#: CustomerReceipt.php:530 msgid "Cannot in... [truncated message content] |