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 ====================================================... [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 ====================================================... [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(_(... [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(_(... [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 @@ ... [truncated message content] |
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 @@ ... [truncated message content] |
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="... [truncated message content] |
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="... [truncated message content] |
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 ===============================... [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 ===============================... [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 ... [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 ... [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 @@ ite... [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 @@ ite... [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="... [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="... [truncated message content] |
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><selec... [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><selec... [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, - cat... [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, - cat... [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_... [truncated message content] |