From: <dai...@us...> - 2011-10-05 07:26:15
|
Revision: 4712 http://web-erp.svn.sourceforge.net/web-erp/?rev=4712&view=rev Author: daintree Date: 2011-10-05 07:26:06 +0000 (Wed, 05 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/PDFBankingSummary.php trunk/PDFChequeListing.php trunk/PDFCustTransListing.php trunk/PDFCustomerList.php trunk/PDFDeliveryDifferences.php trunk/PDFGrn.php trunk/PDFLowGP.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFPickingList.php trunk/PDFPriceList.php trunk/PDFPrintLabel.php trunk/PDFQuotation.php trunk/PDFQuotationPortrait.php trunk/PDFReceipt.php trunk/PDFRemittanceAdvice.php trunk/PDFStockCheckComparison.php trunk/PDFStockLocTransfer.php trunk/PDFStockNegatives.php trunk/PDFStockTransfer.php trunk/PDFSuppTransListing.php trunk/PDFTopItems.php trunk/POReport.php trunk/PO_Header.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PageSecurity.php trunk/PaymentAllocations.php trunk/PaymentTerms.php trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcTabs.php trunk/Prices.php trunk/TopItems.php trunk/doc/INSTALL.txt trunk/doc/Manual/ManualCreatingNewSystem.html trunk/doc/Manual/ManualIntroduction.html trunk/includes/GetConfig.php Modified: trunk/PDFBankingSummary.php =================================================================== --- trunk/PDFBankingSummary.php 2011-10-05 05:19:10 UTC (rev 4711) +++ trunk/PDFBankingSummary.php 2011-10-05 07:26:06 UTC (rev 4712) @@ -32,8 +32,14 @@ while ($myrow=DB_fetch_array($result)) { echo '<option value="'.$myrow['transno'].'">'._('Batch') .' '. $myrow['transno'].' - '.ConvertSqlDate($myrow['transdate']).'</option>'; } - echo '</select></td></tr></table>'; - echo '<br /><div class="centre"><input type="submit" name="EnterBatchNo" value="' . _('Create PDF') . '"></div></form>'; + echo '</select></td> + </tr> + </table>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="EnterBatchNo" value="' . _('Create PDF') . '"> + </div> + </form>'; include ('includes/footer.inc'); exit; @@ -41,21 +47,21 @@ if (isset($_POST['BatchNo']) and $_POST['BatchNo']!='') { $SQL= "SELECT bankaccountname, - bankaccountnumber, - ref, - transdate, - banktranstype, - bankact, - banktrans.exrate, - banktrans.functionalexrate, - banktrans.currcode, - currencies.decimalplaces AS currdecimalplaces - FROM bankaccounts INNER JOIN banktrans - ON bankaccounts.accountcode=banktrans.bankact - INNER JOIN currencies - ON bankaccounts.currcode=currencies.currabrev - WHERE banktrans.transno='" . $_POST['BatchNo'] . "' - AND banktrans.type=12"; + bankaccountnumber, + ref, + transdate, + banktranstype, + bankact, + banktrans.exrate, + banktrans.functionalexrate, + banktrans.currcode, + currencies.decimalplaces AS currdecimalplaces + FROM bankaccounts INNER JOIN banktrans + ON bankaccounts.accountcode=banktrans.bankact + INNER JOIN currencies + ON bankaccounts.currcode=currencies.currabrev + WHERE banktrans.transno='" . $_POST['BatchNo'] . "' + AND banktrans.type=12"; $ErrMsg = _('An error occurred getting the header information about the receipt batch number') . ' ' . $_POST['BatchNo']; $DbgMsg = _('The SQL used to get the receipt header information that failed was'); Modified: trunk/PDFChequeListing.php =================================================================== --- trunk/PDFChequeListing.php 2011-10-05 05:19:10 UTC (rev 4711) +++ trunk/PDFChequeListing.php 2011-10-05 07:26:06 UTC (rev 4712) @@ -26,17 +26,17 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/money_add.png" title="' . $title . '" alt="" />' . ' ' . $title . '</p>'; - if ($InputError==1){ - prnMsg($msg,'error'); - } + if ($InputError==1){ + prnMsg($msg,'error'); + } echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> - <tr> + echo '<table class="selection"> + <tr> <td>' . _('Enter the date from which cheques are to be listed') . ':</td> - <td><input type="text" name="FromDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + <td><input type="text" name="FromDate" maxlength="10" size="10" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td> </tr>'; echo '<tr><td>' . _('Enter the date to which cheques are to be listed') . ':</td> <td><input type="text" name="ToDate" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> @@ -56,14 +56,18 @@ echo '</select></td></tr>'; - echo '<tr><td>' . _('Email the report off') . ':</td> - <td><select name="Email">'; - echo '<option selected value="No">' . _('No') . '</option>'; - echo '<option value="Yes">' . _('Yes') . '</option>'; - echo '</select></td> + echo '<tr> + <td>' . _('Email the report off') . ':</td> + <td><select name="Email"> + <option selected value="No">' . _('No') . '</option> + <option value="Yes">' . _('Yes') . '</option> + </select></td> </tr> </table> - <br /><div class="centre"><input type=submit name="Go" value="' . _('Create PDF') . '"></div>'; + <br /> + <div class="centre"> + <input type=submit name="Go" value="' . _('Create PDF') . '"> + </div>'; include('includes/footer.inc'); exit; Modified: trunk/PDFCustTransListing.php =================================================================== --- trunk/PDFCustTransListing.php 2011-10-05 05:19:10 UTC (rev 4711) +++ trunk/PDFCustTransListing.php 2011-10-05 07:26:06 UTC (rev 4712) @@ -17,8 +17,10 @@ $title = _('Customer Transaction Listing'); include ('includes/header.inc'); - echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' ' - . _('Customer Transaction Listing').'</p>'; + echo '<div class="centre"> + <p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . $title . '" alt="">' . ' ' . _('Customer Transaction Listing'). + '</p>'; if ($InputError==1){ prnMsg($msg,'error'); @@ -27,24 +29,25 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection"> - <tr> + <tr> <td>' . _('Enter the date for which the transactions are to be listed') . ':</td> <td><input type="text" name="Date" maxlength="10" size="10" class=date alt="' . $_SESSION['DefaultDateFormat'] . '" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> </tr>'; - echo '<tr><td>' . _('Transaction type') . '</td><td>'; + echo '<tr><td>' . _('Transaction type') . '</td> + <td><select name="TransType"> + <option value=10>' . _('Invoices') . '</option> + <option value=11>' . _('Credit Notes') . '</option> + <option value=12>' . _('Receipts') . '</option> + </select></td> + </tr>'; - echo '<select name="TransType">'; - - echo '<option value=10>' . _('Invoices') . '</option>'; - echo '<option value=11>' . _('Credit Notes') . '</option>'; - echo '<option value=12>' . _('Receipts') . '</option>'; - - echo '</select></td></tr>'; - echo '</select></td></tr> </table> - <br /><div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>'; + <br /> + <div class="centre"> + <input type="submit" name="Go" value="' . _('Create PDF') . '"> + </div>'; include('includes/footer.inc'); exit; Modified: trunk/PDFCustomerList.php =================================================================== --- trunk/PDFCustomerList.php 2011-10-05 05:19:10 UTC (rev 4711) +++ trunk/PDFCustomerList.php 2011-10-05 07:26:06 UTC (rev 4712) @@ -28,141 +28,141 @@ if (in_array('All', $_POST['Areas'])){ if (in_array('All', $_POST['SalesPeople'])){ - $SQL = 'SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.salestype, - custbranch.branchcode, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.email, - custbranch.area, - custbranch.salesman, - areas.areadescription, - salesman.salesmanname - FROM debtorsmaster INNER JOIN custbranch - ON debtorsmaster.debtorno=custbranch.debtorno - INNER JOIN areas - ON custbranch.area = areas.areacode - INNER JOIN salesman - ON custbranch.salesman=salesman.salesmancode - ORDER BY area, - salesman, - debtorsmaster.debtorno, - custbranch.branchcode'; + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.salestype, + custbranch.branchcode, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.email, + custbranch.area, + custbranch.salesman, + areas.areadescription, + salesman.salesmanname + FROM debtorsmaster INNER JOIN custbranch + ON debtorsmaster.debtorno=custbranch.debtorno + INNER JOIN areas + ON custbranch.area = areas.areacode + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + ORDER BY area, + salesman, + debtorsmaster.debtorno, + custbranch.branchcode"; } else { /* there are a range of salesfolk selected need to build the where clause */ - $SQL = 'SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.salestype, - custbranch.branchcode, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.email, - custbranch.area, - custbranch.salesman, - areas.areadescription, - salesman.salesmanname - FROM debtorsmaster INNER JOIN custbranch - ON debtorsmaster.debtorno=custbranch.debtorno - INNER JOIN areas - ON custbranch.area = areas.areacode - INNER JOIN salesman - ON custbranch.salesman=salesman.salesmancode - WHERE ('; + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.salestype, + custbranch.branchcode, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.email, + custbranch.area, + custbranch.salesman, + areas.areadescription, + salesman.salesmanname + FROM debtorsmaster INNER JOIN custbranch + ON debtorsmaster.debtorno=custbranch.debtorno + INNER JOIN areas + ON custbranch.area = areas.areacode + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + WHERE ("; $i=0; foreach ($_POST['SalesPeople'] as $Salesperson){ if ($i>0){ - $SQL .= ' OR '; + $SQL .= " OR "; } $i++; $SQL .= "custbranch.salesman='" . $Salesperson ."'"; } - $SQL .=') ORDER BY area, + $SQL .=") ORDER BY area, salesman, debtorsmaster.debtorno, - custbranch.branchcode'; + custbranch.branchcode"; } /*end if SalesPeople =='All' */ } else { /* not all sales areas has been selected so need to build the where clause */ if (in_array('All', $_POST['SalesPeople'])){ - $SQL = 'SELECT debtorsmaster.debtorno, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.salestype, - custbranch.branchcode, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.email, - custbranch.area, - custbranch.salesman, - areas.areadescription, - salesman.salesmanname - FROM debtorsmaster INNER JOIN custbranch - ON debtorsmaster.debtorno=custbranch.debtorno - INNER JOIN areas - ON custbranch.area = areas.areacode - INNER JOIN salesman - ON custbranch.salesman=salesman.salesmancode - WHERE ('; - + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.salestype, + custbranch.branchcode, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.email, + custbranch.area, + custbranch.salesman, + areas.areadescription, + salesman.salesmanname + FROM debtorsmaster INNER JOIN custbranch + ON debtorsmaster.debtorno=custbranch.debtorno + INNER JOIN areas + ON custbranch.area = areas.areacode + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + WHERE ("; + $i=0; foreach ($_POST['Areas'] as $Area){ if ($i>0){ - $SQL .= ' OR '; + $SQL .= " OR "; } $i++; $SQL .= "custbranch.area='" . $Area ."'"; } - $SQL .= ') ORDER BY custbranch.area, + $SQL .= ") ORDER BY custbranch.area, custbranch.salesman, debtorsmaster.debtorno, - custbranch.branchcode'; + custbranch.branchcode"; } else { /* there are a range of salesfolk selected need to build the where clause */ - $SQL = 'SELECT debtorsmaster.debtorno, + $SQL = "SELECT debtorsmaster.debtorno, debtorsmaster.name, debtorsmaster.address1, debtorsmaster.address2, @@ -193,32 +193,32 @@ ON custbranch.area = areas.areacode INNER JOIN salesman ON custbranch.salesman=salesman.salesmancode - WHERE ('; + WHERE ("; $i=0; foreach ($_POST['Areas'] as $Area){ if ($i>0){ - $SQL .= ' OR '; + $SQL .= " OR "; } $i++; $SQL .= "custbranch.area='" . $Area ."'"; } - $SQL .= ') AND ('; + $SQL .= ") AND ("; $i=0; foreach ($_POST['SalesPeople'] as $Salesperson){ if ($i>0){ - $SQL .= ' OR '; + $SQL .= " OR "; } $i++; $SQL .= "custbranch.salesman='" . $Salesperson ."'"; } - $SQL .=') ORDER BY custbranch.area, + $SQL .=") ORDER BY custbranch.area, custbranch.salesman, debtorsmaster.debtorno, - custbranch.branchcode'; + custbranch.branchcode"; } /*end if Salesfolk =='All' */ } /* end if not all sales areas was selected */ @@ -261,11 +261,11 @@ since the date entered */ $SQL = "SELECT SUM((ovamount+ovfreight+ovdiscount)/rate) AS turnover - FROM debtortrans - WHERE debtorno='" . $Customers['debtorno'] . "' - AND branchcode='" . $Customers['branchcode'] . "' - AND (type=10 or type=11) - AND trandate >='" . FormatDateForSQL($_POST['ActivitySince']). "'"; + FROM debtortrans + WHERE debtorno='" . $Customers['debtorno'] . "' + AND branchcode='" . $Customers['branchcode'] . "' + AND (type=10 or type=11) + AND trandate >='" . FormatDateForSQL($_POST['ActivitySince']). "'"; $ActivityResult = DB_query($SQL, $db, _('Could not retrieve the activity of the branch because'), _('The failed SQL was')); $ActivityRow = DB_fetch_row($ActivityResult); @@ -382,10 +382,10 @@ } echo '</select></td></tr>'; - echo '<tr><td>' . _('For Sales folk'). ':</td><td><select name=SalesPeople[] multiple>'; + echo '<tr><td>' . _('For Sales folk'). ':</td> + <td><select name=SalesPeople[] multiple> + <option selected value="All">'. _('All sales folk') . '</option>'; - echo '<option selected value="All">'. _('All sales folk'); - $sql = "SELECT salesmancode, salesmanname FROM salesman"; $SalesFolkResult = DB_query($sql,$db); @@ -394,20 +394,28 @@ } echo '</select></td></tr>'; - echo '<tr><td>' . _('Level Of Activity'). ':</td><td><select name="Activity">'; + echo '<tr><td>' . _('Level Of Activity'). ':</td> + <td><select name="Activity"> + <option selected value="All">'. _('All customers') . '</option> + <option value="GreaterThan">'. _('Sales Greater Than') . '</option> + <option value="LessThan">'. _('Sales Less Than') . '</option> + </select></td> + <td>'; - echo '<option selected value="All">'. _('All customers') . '</option>'; - echo '<option value="GreaterThan">'. _('Sales Greater Than') . '</option>'; - echo '<option value="LessThan">'. _('Sales Less Than') . '</option>'; - echo '</select></td><td>'; + echo '<input type="text" class="number" name="ActivityAmount" size="8" maxlength="8" value=0></td> + </tr>'; - echo '<input type="text" class=number name="ActivityAmount" size=8 maxlength=8 value=0></td></tr>'; - $DefaultActivitySince = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-6,0,Date('y'))); - echo '<tr><td>' . _('Activity Since'). ':</td> - <td><input type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ActivitySince" size=10 maxlength=10 value="' . $DefaultActivitySince . '"></td></tr>'; + echo '<tr> + <td>' . _('Activity Since'). ':</td> + <td><input type="text" class=date alt="'.$_SESSION['DefaultDateFormat'].'" name="ActivitySince" size="10" maxlength="10" value="' . $DefaultActivitySince . '"></td> + </tr>'; - echo '</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'); Modified: trunk/PDFDeliveryDifferences.php =================================================================== --- trunk/PDFDeliveryDifferences.php 2011-10-05 05:19:10 UTC (rev 4711) +++ trunk/PDFDeliveryDifferences.php 2011-10-05 07:26:06 UTC (rev 4712) @@ -26,30 +26,39 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class=selection> + echo '<table class="selection"> <tr> <td>' . _('Enter the date from which variances between orders and deliveries are to be listed') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat']. '" name="FromDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,0,Date('y'))) . '"></td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat']. '" name="FromDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,0,Date('y'))) . '" /></td> </tr>'; - echo '<tr> - <td>' . _('Enter the date to which variances between orders and deliveries are to be listed') . ':</td><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat']. '" name="ToDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat']) . '"></td> + echo '<tr> + <td>' . _('Enter the date to which variances between orders and deliveries are to be listed') . ':</td><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat']. '" name="ToDate" maxlength="10" size="10" value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td> </tr>'; - echo '<tr><td>' . _('Inventory Category') . '</td><td>'; + echo '<tr> + <td>' . _('Inventory Category') . '</td> + <td>'; - $sql = "SELECT categorydescription, categoryid FROM stockcategory WHERE stocktype<>'D' AND stocktype<>'L'"; - $result = DB_query($sql,$db); + $sql = "SELECT categorydescription, + categoryid + FROM stockcategory + WHERE stocktype<>'D' + AND stocktype<>'L'"; + + $result = DB_query($sql,$db); - echo '<select name="CategoryID">'; - echo '<option selected value="All">' . _('Over All Categories') . '</option>'; + echo '<select name="CategoryID"> + <option selected value="All">' . _('Over All Categories') . '</option>'; while ($myrow=DB_fetch_array($result)){ echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categorydescription'] . '</option>'; } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; - echo '<tr><td>' . _('Inventory Location') . ':</td> + echo '<tr> + <td>' . _('Inventory Location') . ':</td> <td><select name="Location"> <option selected value="All">' . _('All Locations') . '</option>'; @@ -59,16 +68,18 @@ } echo '</select></td></tr>'; - echo '<tr><td>' . _('Email the report off') . ':</td> + echo '<tr> + <td>' . _('Email the report off') . ':</td> <td><select name="Email"> <option selected value="No">' . _('No') . '</option> <option value="Yes">' . _('Yes') . '</option> - </select> - </td> + </select></td> </tr> </table> <br /> - <div class="centre"><input type="submit" name="Go" value="' . _('Create PDF') . '"></div>'; + <div class="centre"> + <input type="submit" name="Go" value="' . _('Create PDF') . '"> + </div>'; if ($InputError==1){ prnMsg($msg,'error'); @@ -84,6 +95,7 @@ orderdeliverydifferenceslog.orderno, orderdeliverydifferenceslog.stockid, stockmaster.description, + stockmaster.decimalplaces, quantitydiff, trandate, orderdeliverydifferenceslog.debtorno, @@ -100,6 +112,7 @@ orderdeliverydifferenceslog.orderno, orderdeliverydifferenceslog.stockid, stockmaster.description, + stockmaster.decimalplaces, quantitydiff, trandate, orderdeliverydifferenceslog.debtorno, @@ -117,6 +130,7 @@ orderdeliverydifferenceslog.orderno, orderdeliverydifferenceslog.stockid, stockmaster.description, + stockmaster.decimalplaces, quantitydiff, trandate, orderdeliverydifferenceslog.debtorno, @@ -138,6 +152,7 @@ orderdeliverydifferenceslog.orderno, orderdeliverydifferenceslog.stockid, stockmaster.description, + stockmaster.decimalplaces, quantitydiff, trandate, orderdeliverydifferenceslog.debtorno, @@ -162,7 +177,7 @@ include('includes/header.inc'); prnMsg( _('An error occurred getting the variances between deliveries and orders'),'error'); if ($debug==1){ - prnMsg( _('The SQL used to get the variances between deliveries and orders that failed was') . "<br />$SQL",'error'); + prnMsg( _('The SQL used to get the variances between deliveries and orders that failed was') . '<br />' . $SQL,'error'); } include ('includes/footer.inc'); exit; @@ -195,7 +210,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin+40,$YPos,40,$FontSize,$myrow['orderno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+80,$YPos,200,$FontSize,$myrow['stockid'] . ' - ' . $myrow['description'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+280,$YPos,50,$FontSize,locale_number_format($myrow['quantitydiff']), 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+280,$YPos,50,$FontSize,locale_number_format($myrow['quantitydiff'],$myrow['decimalplaces']), 'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+335,$YPos,50,$FontSize,$myrow['debtorno'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+385,$YPos,50,$FontSize,$myrow['branch'], 'left'); $LeftOvers = $pdf->addTextWrap($Left_Margin+435,$YPos,50,$FontSize,ConvertSQLDate($myrow['trandate']), 'left'); Modified: trunk/PDFGrn.php =================================================================== --- trunk/PDFGrn.php 2011-10-05 05:19:10 UTC (rev 4711) +++ trunk/PDFGrn.php 2011-10-05 07:26:06 UTC (rev 4712) @@ -54,7 +54,7 @@ ON grns.podetailitem=purchorderdetails.podetailitem LEFT JOIN stockmaster ON grns.itemcode=stockmaster.stockid - WHERE grnbatch='".filter_number_format($GRNNo)."'"; + WHERE grnbatch='". $GRNNo ."'"; $GRNResult=DB_query($sql, $db); $NoOfGRNs = DB_num_rows($GRNResult); @@ -69,7 +69,7 @@ suppliers.address6 FROM grns INNER JOIN suppliers ON grns.supplierid=suppliers.supplierid - WHERE grnbatch='".filter_number_format($GRNNo)."'"; + WHERE grnbatch='". $GRNNo ."'"; $SuppResult = DB_query($sql,$db,_('Could not get the supplier of the selected GRN')); $SuppRow = DB_fetch_array($SuppResult); } @@ -88,7 +88,7 @@ $DecimalPlaces=2; } if (is_numeric($myrow['conversionfactor']) AND $myrow['conversionfactor'] !=0){ - $SuppliersQuantity=locale_number_format(filter_number_format($myrow['qtyrecd']/$myrow['conversionfactor']),$DecimalPlaces); + $SuppliersQuantity=locale_number_format($myrow['qtyrecd']/$myrow['conversionfactor'],$DecimalPlaces); } else { $SuppliersQuantity=locale_number_format($myrow['qtyrecd'],$DecimalPlaces); } Modified: trunk/PDFLowGP.php =================================================================== --- trunk/PDFLowGP.php 2011-10-05 05:19:10 UTC (rev 4711) +++ trunk/PDFLowGP.php 2011-10-05 07:26:06 UTC (rev 4712) @@ -47,7 +47,7 @@ ON stockmoves.debtorno=debtorsmaster.debtorno WHERE stockmoves.trandate >= '" . FormatDateForSQL($_POST['FromDate']) . "' AND stockmoves.trandate <= '" . FormatDateForSQL($_POST['ToDate']) . "' - AND ((stockmoves.price*(1-stockmoves.discountpercent)) - (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost))/(stockmoves.price*(1-stockmoves.discountpercent)) <=" . filter_number_format(filter_number_format($_POST['GPMin'])/100) . " + AND ((stockmoves.price*(1-stockmoves.discountpercent)) - (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost))/(stockmoves.price*(1-stockmoves.discountpercent)) <=" . $_POST['GPMin']/100 . " ORDER BY stockmaster.stockid"; $LowGPSalesResult = DB_query($SQL,$db,'','',false,false); @@ -129,21 +129,21 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<tr><td>' . _('Sales Made From') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size=10 maxlength="10" value="' . $_POST['FromDate'] . '"></td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" size=10 maxlength="10" value="' . $_POST['FromDate'] . '" /></td> </tr>'; echo '<tr><td>' . _('Sales Made To') . ' (' . _('in the format') . ' ' . $_SESSION['DefaultDateFormat'] . '):</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>'; echo '<tr><td>' . _('Show sales with GP') . '%' . _('below') . ':</td> - <td><input type="text" class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '"></td> + <td><input type="text" class="number" name="GPMin" maxlength="3" size="3" value="' . $_POST['GPMin'] . '" /></td> </tr>'; echo '</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/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2011-10-05 05:19:10 UTC (rev 4711) +++ trunk/PDFOrderStatus.php 2011-10-05 07:26:06 UTC (rev 4712) @@ -34,7 +34,7 @@ echo '<table class="selection"> <tr> <td>' . _('Enter the date from which orders are to be listed') . ':</td> - <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . '"></td> + <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))) . '" /></td> </tr>'; echo '<tr><td>' . _('Enter the date to which orders are to ... [truncated message content] |
From: <dai...@us...> - 2011-10-06 07:52:45
|
Revision: 4713 http://web-erp.svn.sourceforge.net/web-erp/?rev=4713&view=rev Author: daintree Date: 2011-10-06 07:52:38 +0000 (Thu, 06 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/PricesByCost.php trunk/PrintCheque.php trunk/PrintCustOrder.php trunk/PrintCustOrder_generic.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PricesByCost.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -163,7 +163,7 @@ echo '<form action="' .$_SERVER['PHP_SELF'] .'" method="POST" name="update">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo'<input type="hidden" value=' . $_POST['StockCat'] . ' name="StockCat"> - <input type="hidden" value=' . filter_number_format($_POST['Margin']) . ' name="Margin"> + <input type="hidden" value=' . $_POST['Margin'] . ' name="Margin"> <input type="hidden" value=' . $_POST['CurrCode'] . ' name="CurrCode"> <input type="hidden" value=' . $_POST['Comparator'] . ' name="Comparator"> <input type="hidden" value=' . $_POST['SalesType'] . ' name="SalesType">'; @@ -213,7 +213,7 @@ <td class="number">' . locale_number_format($Cost, $_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($CurrentGP, 1) . '%</td> <td class="number">' . locale_number_format($ProposedPrice, $myrow['decimalplaces']) . '</td> - <td><input type="text" class="number" name="Price_' . $PriceCounter . '" maxlength=14 size=10 value="' . locale_number_format($myrow['price'],$myrow['decimalplaces']) . '"></td> + <td><input type="text" class="number" name="Price_' . $PriceCounter . '" maxlength="14" size="10" value="' . locale_number_format($myrow['price'],$myrow['decimalplaces']) . '"></td> </tr> '; $PriceCounter++; } //end of looping @@ -227,7 +227,10 @@ } } else { /*The option to submit was not hit so display form */ echo '<div class="page_help_text">' . _('Use this report to display price list with the cost.') . '</div><br />'; - echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class=selection>'; + echo '<br /> + <br /> + <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $SQL = "SELECT categoryid, categorydescription @@ -243,9 +246,9 @@ } echo '</select></td></tr>'; echo '<tr><td>' . _('Price') . ' - <select name="Comparator">'; - echo '<option value="1">' . _('Less than or equal to') . '</option>'; - echo '<option value="2">' . _('Greater than or equal to') . '</option>'; + <select name="Comparator"> + <option value="1">' . _('Less than or equal to') . '</option> + <option value="2">' . _('Greater than or equal to') . '</option>'; if ($_SESSION['WeightedAverageCosting']==1) { echo '</select>'.' '. _('Average Cost') . ' x </td>'; } else { Modified: trunk/PrintCheque.php =================================================================== --- trunk/PrintCheque.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PrintCheque.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -13,7 +13,10 @@ $PageNumber=1; $line_height=12; -$result = db_query("SELECT hundredsname, decimalplaces FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); +$result = db_query("SELECT hundredsname, + decimalplaces + FROM currencies + WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); If (DB_num_rows($result) == 0){ include ('includes/header.inc'); Modified: trunk/PrintCustOrder.php =================================================================== --- trunk/PrintCustOrder.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PrintCustOrder.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -7,15 +7,28 @@ include('includes/SQL_CommonFunctions.inc'); //Get Out if we have no order number to work with -If (!isset($_GET['TransNo']) || $_GET['TransNo']==""){ +If (!isset($_GET['TransNo']) OR $_GET['TransNo']==''){ $title = _('Select Order To Print'); include('includes/header.inc'); - echo '<div class=centre><br /><br /><br />'; + echo '<div class="centre"> + <br /> + <br /> + <br />'; prnMsg( _('Select an Order Number to Print before calling this page') , 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br /><br /><br />'; + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; include('includes/footer.inc'); exit; } @@ -52,7 +65,7 @@ ON salesorders.shipvia=shippers.shipper_id INNER JOIN locations ON salesorders.fromstkloc=locations.loccode - WHERE salesorders.orderno='" . filter_number_format($_GET['TransNo']). "'"; + WHERE salesorders.orderno='" . $_GET['TransNo'] . "'"; $result=DB_query($sql,$db, $ErrMsg); @@ -122,7 +135,7 @@ stockmaster.decimalplaces FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid - WHERE salesorderdetails.orderno='" . filter_number_format($_GET['TransNo']) . "'"; + WHERE salesorderdetails.orderno='" . $_GET['TransNo'] . "'"; $result=DB_query($sql, $db, $ErrMsg); if (DB_num_rows($result)>0){ @@ -195,9 +208,9 @@ $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_Order_' . $_GET['TransNo'] . '_' . Date('Y-m-d') .'.pdf'); $pdf-> __destruct(); - $sql = "UPDATE salesorders SET printedpackingslip=1, - datepackingslipprinted='" . Date('Y-m-d') . "' - WHERE salesorders.orderno='" .filter_number_format($_GET['TransNo']) . "'"; + $sql = "UPDATE salesorders SET printedpackingslip=1, + datepackingslipprinted='" . Date('Y-m-d') . "' + WHERE salesorders.orderno='" . $_GET['TransNo'] . "'"; $result = DB_query($sql,$db); } else { $title = _('Print Packing Slip Error'); Modified: trunk/PrintCustOrder_generic.php =================================================================== --- trunk/PrintCustOrder_generic.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PrintCustOrder_generic.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -65,7 +65,7 @@ WHERE salesorders.debtorno=debtorsmaster.debtorno AND salesorders.shipvia=shippers.shipper_id AND salesorders.fromstkloc=locations.loccode - AND salesorders.orderno='" . filter_number_format($_GET['TransNo']) . "'"; + AND salesorders.orderno='" . $_GET['TransNo'] . "'"; $result=DB_query($sql,$db, $ErrMsg); @@ -166,7 +166,7 @@ stockmaster.decimalplaces FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid - WHERE salesorderdetails.orderno='" . filter_number_format($_GET['TransNo']) . "'"; + WHERE salesorderdetails.orderno='" . $_GET['TransNo'] . "'"; $result=DB_query($sql,$db, $ErrMsg); if (DB_num_rows($result)>0){ @@ -248,7 +248,7 @@ $pdf->__destruct(); $sql = "UPDATE salesorders SET printedpackingslip=1, datepackingslipprinted='" . Date('Y-m-d') . "' - WHERE salesorders.orderno='" . filter_number_format($_GET['TransNo']) . "'"; + WHERE salesorders.orderno='" . $_GET['TransNo'] . "'"; $result = DB_query($sql,$db); } Modified: trunk/PrintCustStatements.php =================================================================== --- trunk/PrintCustStatements.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PrintCustStatements.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -79,7 +79,7 @@ if (DB_Num_Rows($StatementResults) == 0){ $title = _('Print Statements') . ' - ' . _('No Customers Found'); - require('includes/header.inc'); + require('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Customer Account Statements') . '</p>'; prnMsg( _('There were no Customers matching your selection of '). $_POST['FromCust']. ' - '. $_POST['ToCust'].'.' , 'error'); Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PrintCustTrans.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -7,7 +7,7 @@ if (isset($_GET['FromTransNo'])) { $FromTransNo = trim($_GET['FromTransNo']); } elseif (isset($_POST['FromTransNo'])) { - $FromTransNo = trim($_POST['FromTransNo']); + $FromTransNo = filter_number_format($_POST['FromTransNo']); } else { $FromTransNo = ''; } @@ -25,8 +25,8 @@ } if (!isset($_POST['ToTransNo']) - or trim($_POST['ToTransNo'])=='' - or $_POST['ToTransNo'] < $FromTransNo) { + OR trim($_POST['ToTransNo'])=='' + OR filter_number_format($_POST['ToTransNo']) < $FromTransNo) { $_POST['ToTransNo'] = $FromTransNo; } @@ -72,7 +72,7 @@ $FirstPage = true; $line_height=16; - while ($FromTransNo <= $_POST['ToTransNo']){ + while ($FromTransNo <= filter_number_format($_POST['ToTransNo'])){ /* retrieve the invoice details from the database to print notice that salesorder record must be present to print the invoice purging of sales orders will @@ -127,22 +127,22 @@ debtortrans.debtorno, debtortrans.branchcode, currencies.decimalplaces - FROM debtortrans INNER JOIN debtorsmaster - ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN custbranch - ON debtortrans.debtorno=custbranch.debtorno + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode - INNER JOIN salesorders + INNER JOIN salesorders ON debtortrans.order_ = salesorders.orderno - INNER JOIN shippers - ON debtortrans.shipvia=shippers.shipper_id - INNER JOIN salesman - ON custbranch.salesman=salesman.salesmancode - INNER JOIN locations - ON salesorders.fromstkloc=locations.loccode - INNER JOIN paymentterms + INNER JOIN shippers + ON debtortrans.shipvia=shippers.shipper_id + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.type=10 AND debtortrans.transno='" . $FromTransNo . "'"; @@ -186,16 +186,16 @@ debtortrans.branchcode, paymentterms.terms, currencies.decimalplaces - FROM debtortrans INNER JOIN debtorsmaster - ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN custbranch - ON debtortrans.debtorno=custbranch.debtorno + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode - INNER JOIN salesman - ON custbranch.salesman=salesman.salesmancode - INNER JOIN paymentterms + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.type=11 AND debtortrans.transno='" . $FromTransNo . "'"; @@ -460,10 +460,10 @@ if (isset($_GET['FromTransNo'])) { $FromTransNo = trim($_GET['FromTransNo']); } elseif (isset($_POST['FromTransNo'])) { - $FromTransNo = trim($_POST['FromTransNo']); + $FromTransNo = filter_number_format($_POST['FromTransNo']); } - - + + if (isset($_GET['Email'])){ //email the invoice to address supplied include('includes/header.inc'); @@ -471,7 +471,7 @@ $FileName = $_SESSION['reports_dir'] . '/' . $_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $_GET['FromTransNo'] . '.pdf'; $pdf->Output($FileName,'F'); $mail = new htmlMimeMail(); - + $Attachment = $mail->getFile($FileName); $mail->setText(_('Please find attached') . ' ' . $InvOrCredit . ' ' . $_GET['FromTransNo'] ); $mail->SetSubject($InvOrCredit . ' ' . $_GET['FromTransNo']); @@ -489,7 +489,7 @@ } else { //its not an email just print the invoice to PDF $pdf->OutputD($_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $FromTransNo . '.pdf'); - + } $pdf->__destruct(); @@ -503,7 +503,7 @@ /* if FromTransNo is not set then show a form to allow input of either a single invoice number or a range of invoices to be printed. Also get the last invoice number created to show the user where the current range is up to */ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - + echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="">' . ' ' . _('Print Invoices or Credit Notes (Landscape Mode)') . '</div>'; echo '<table class="table1"> <tr><td>' . _('Print Invoices or Credit Notes') . '</td><td><select name=InvOrCredit>'; @@ -532,12 +532,12 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td> - <td><input Type=text class=number max=6 size=7 name=FromTransNo></td></tr>'; + <td><input type="text" class="number" maxlength="6" size="7" name="FromTransNo" /></td></tr>'; echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> - <td><input Type=text class=number max=6 size=7 name="ToTransNo"></td></tr> + <td><input type="text" class="number" maxlength="6" size="7" name="ToTransNo" /></td></tr> </table>'; - echo '<div class="centre"><input type="submit" name="Print" value="' . _('Print') . '"><p>'; - echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '<div class="centre"><input type="submit" name="Print" value="' . _('Print') . '" /><p>'; + echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /></div>'; $sql = "SELECT typeno FROM systypes WHERE typeid=10"; @@ -551,11 +551,13 @@ $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br />' . _('A sequential range can be printed using the same method as for invoices above') . '. ' . _('A single credit note can be printed by only entering a start transaction number') . '</DIV'; + echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b> + <br />' . _('A sequential range can be printed using the same method as for invoices above') . '. ' . _('A single credit note can be printed by only entering a start transaction number') . + '</div>'; } else { - while ($FromTransNo <= $_POST['ToTransNo']) { + while ($FromTransNo <= filter_number_format($_POST['ToTransNo'])) { /*retrieve the invoice details from the database to print notice that salesorder record must be present to print the invoice purging of sales orders will @@ -600,22 +602,22 @@ salesman.salesmanname, debtortrans.debtorno, currencies.decimalplaces - FROM debtortrans INNER JOIN debtorsmaster - ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN custbranch - ON debtortrans.debtorno=custbranch.debtorno + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode - INNER JOIN salesorders + INNER JOIN salesorders ON debtortrans.order_ = salesorders.orderno - INNER JOIN shippers - ON debtortrans.shipvia=shippers.shipper_id - INNER JOIN salesman - ON custbranch.salesman=salesman.salesmancode - INNER JOIN locations - ON salesorders.fromstkloc=locations.loccode - INNER JOIN paymentterms + INNER JOIN shippers + ON debtortrans.shipvia=shippers.shipper_id + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.type=10 AND debtortrans.transno='" . $FromTransNo . "'"; @@ -646,16 +648,16 @@ salesman.salesmanname, debtortrans.debtorno, currencies.decimalplaces - FROM debtortrans INNER JOIN debtorsmaster - ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN custbranch - ON debtortrans.debtorno=custbranch.debtorno + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode - INNER JOIN salesman - ON custbranch.salesman=salesman.salesmancode - INNER JOIN paymentterms + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.type=11 AND debtortrans.transno='" . $FromTransNo . "'"; @@ -674,8 +676,11 @@ $myrow = DB_fetch_array($result); /* Then there's an invoice (or credit note) to print. So print out the invoice header and GST Number from the company record */ - if (count($_SESSION['AllowedPageSecurityTokens'])==1 AND in_array(1, $_SESSION['AllowedPageSecurityTokens']) AND $myrow['debtorno'] != $_SESSION['CustomerID']){ - echo '<p><font color=RED size=4>' . _('This transaction is addressed to another customer and cannot be displayed for privacy reasons') . '. ' . _('Please select only transactions relevant to your company'); + if (count($_SESSION['AllowedPageSecurityTokens'])==1 + AND in_array(1, $_SESSION['AllowedPageSecurityTokens']) + AND $myrow['debtorno'] != $_SESSION['CustomerID']){ + + echo '<p><font color="red" size="4">' . _('This transaction is addressed to another customer and cannot be displayed for privacy reasons') . '. ' . _('Please select only transactions relevant to your company'); exit; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-06 07:52:45
|
Revision: 4713 http://web-erp.svn.sourceforge.net/web-erp/?rev=4713&view=rev Author: daintree Date: 2011-10-06 07:52:38 +0000 (Thu, 06 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/PricesByCost.php trunk/PrintCheque.php trunk/PrintCustOrder.php trunk/PrintCustOrder_generic.php trunk/PrintCustStatements.php trunk/PrintCustTrans.php Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PricesByCost.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -163,7 +163,7 @@ echo '<form action="' .$_SERVER['PHP_SELF'] .'" method="POST" name="update">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo'<input type="hidden" value=' . $_POST['StockCat'] . ' name="StockCat"> - <input type="hidden" value=' . filter_number_format($_POST['Margin']) . ' name="Margin"> + <input type="hidden" value=' . $_POST['Margin'] . ' name="Margin"> <input type="hidden" value=' . $_POST['CurrCode'] . ' name="CurrCode"> <input type="hidden" value=' . $_POST['Comparator'] . ' name="Comparator"> <input type="hidden" value=' . $_POST['SalesType'] . ' name="SalesType">'; @@ -213,7 +213,7 @@ <td class="number">' . locale_number_format($Cost, $_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($CurrentGP, 1) . '%</td> <td class="number">' . locale_number_format($ProposedPrice, $myrow['decimalplaces']) . '</td> - <td><input type="text" class="number" name="Price_' . $PriceCounter . '" maxlength=14 size=10 value="' . locale_number_format($myrow['price'],$myrow['decimalplaces']) . '"></td> + <td><input type="text" class="number" name="Price_' . $PriceCounter . '" maxlength="14" size="10" value="' . locale_number_format($myrow['price'],$myrow['decimalplaces']) . '"></td> </tr> '; $PriceCounter++; } //end of looping @@ -227,7 +227,10 @@ } } else { /*The option to submit was not hit so display form */ echo '<div class="page_help_text">' . _('Use this report to display price list with the cost.') . '</div><br />'; - echo '<br /><br /><form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class=selection>'; + echo '<br /> + <br /> + <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $SQL = "SELECT categoryid, categorydescription @@ -243,9 +246,9 @@ } echo '</select></td></tr>'; echo '<tr><td>' . _('Price') . ' - <select name="Comparator">'; - echo '<option value="1">' . _('Less than or equal to') . '</option>'; - echo '<option value="2">' . _('Greater than or equal to') . '</option>'; + <select name="Comparator"> + <option value="1">' . _('Less than or equal to') . '</option> + <option value="2">' . _('Greater than or equal to') . '</option>'; if ($_SESSION['WeightedAverageCosting']==1) { echo '</select>'.' '. _('Average Cost') . ' x </td>'; } else { Modified: trunk/PrintCheque.php =================================================================== --- trunk/PrintCheque.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PrintCheque.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -13,7 +13,10 @@ $PageNumber=1; $line_height=12; -$result = db_query("SELECT hundredsname, decimalplaces FROM currencies WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); +$result = db_query("SELECT hundredsname, + decimalplaces + FROM currencies + WHERE currabrev='" . $_SESSION['PaymentDetail']->Currency . "'",$db); If (DB_num_rows($result) == 0){ include ('includes/header.inc'); Modified: trunk/PrintCustOrder.php =================================================================== --- trunk/PrintCustOrder.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PrintCustOrder.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -7,15 +7,28 @@ include('includes/SQL_CommonFunctions.inc'); //Get Out if we have no order number to work with -If (!isset($_GET['TransNo']) || $_GET['TransNo']==""){ +If (!isset($_GET['TransNo']) OR $_GET['TransNo']==''){ $title = _('Select Order To Print'); include('includes/header.inc'); - echo '<div class=centre><br /><br /><br />'; + echo '<div class="centre"> + <br /> + <br /> + <br />'; prnMsg( _('Select an Order Number to Print before calling this page') , 'error'); - echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br /><br /><br />'; + echo '<br /> + <br /> + <br /> + <table class="table_index"> + <tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; include('includes/footer.inc'); exit; } @@ -52,7 +65,7 @@ ON salesorders.shipvia=shippers.shipper_id INNER JOIN locations ON salesorders.fromstkloc=locations.loccode - WHERE salesorders.orderno='" . filter_number_format($_GET['TransNo']). "'"; + WHERE salesorders.orderno='" . $_GET['TransNo'] . "'"; $result=DB_query($sql,$db, $ErrMsg); @@ -122,7 +135,7 @@ stockmaster.decimalplaces FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid - WHERE salesorderdetails.orderno='" . filter_number_format($_GET['TransNo']) . "'"; + WHERE salesorderdetails.orderno='" . $_GET['TransNo'] . "'"; $result=DB_query($sql, $db, $ErrMsg); if (DB_num_rows($result)>0){ @@ -195,9 +208,9 @@ $pdf->OutputD($_SESSION['DatabaseName'] . '_Customer_Order_' . $_GET['TransNo'] . '_' . Date('Y-m-d') .'.pdf'); $pdf-> __destruct(); - $sql = "UPDATE salesorders SET printedpackingslip=1, - datepackingslipprinted='" . Date('Y-m-d') . "' - WHERE salesorders.orderno='" .filter_number_format($_GET['TransNo']) . "'"; + $sql = "UPDATE salesorders SET printedpackingslip=1, + datepackingslipprinted='" . Date('Y-m-d') . "' + WHERE salesorders.orderno='" . $_GET['TransNo'] . "'"; $result = DB_query($sql,$db); } else { $title = _('Print Packing Slip Error'); Modified: trunk/PrintCustOrder_generic.php =================================================================== --- trunk/PrintCustOrder_generic.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PrintCustOrder_generic.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -65,7 +65,7 @@ WHERE salesorders.debtorno=debtorsmaster.debtorno AND salesorders.shipvia=shippers.shipper_id AND salesorders.fromstkloc=locations.loccode - AND salesorders.orderno='" . filter_number_format($_GET['TransNo']) . "'"; + AND salesorders.orderno='" . $_GET['TransNo'] . "'"; $result=DB_query($sql,$db, $ErrMsg); @@ -166,7 +166,7 @@ stockmaster.decimalplaces FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid - WHERE salesorderdetails.orderno='" . filter_number_format($_GET['TransNo']) . "'"; + WHERE salesorderdetails.orderno='" . $_GET['TransNo'] . "'"; $result=DB_query($sql,$db, $ErrMsg); if (DB_num_rows($result)>0){ @@ -248,7 +248,7 @@ $pdf->__destruct(); $sql = "UPDATE salesorders SET printedpackingslip=1, datepackingslipprinted='" . Date('Y-m-d') . "' - WHERE salesorders.orderno='" . filter_number_format($_GET['TransNo']) . "'"; + WHERE salesorders.orderno='" . $_GET['TransNo'] . "'"; $result = DB_query($sql,$db); } Modified: trunk/PrintCustStatements.php =================================================================== --- trunk/PrintCustStatements.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PrintCustStatements.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -79,7 +79,7 @@ if (DB_Num_Rows($StatementResults) == 0){ $title = _('Print Statements') . ' - ' . _('No Customers Found'); - require('includes/header.inc'); + require('includes/header.inc'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Customer Account Statements') . '</p>'; prnMsg( _('There were no Customers matching your selection of '). $_POST['FromCust']. ' - '. $_POST['ToCust'].'.' , 'error'); Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-10-05 07:26:06 UTC (rev 4712) +++ trunk/PrintCustTrans.php 2011-10-06 07:52:38 UTC (rev 4713) @@ -7,7 +7,7 @@ if (isset($_GET['FromTransNo'])) { $FromTransNo = trim($_GET['FromTransNo']); } elseif (isset($_POST['FromTransNo'])) { - $FromTransNo = trim($_POST['FromTransNo']); + $FromTransNo = filter_number_format($_POST['FromTransNo']); } else { $FromTransNo = ''; } @@ -25,8 +25,8 @@ } if (!isset($_POST['ToTransNo']) - or trim($_POST['ToTransNo'])=='' - or $_POST['ToTransNo'] < $FromTransNo) { + OR trim($_POST['ToTransNo'])=='' + OR filter_number_format($_POST['ToTransNo']) < $FromTransNo) { $_POST['ToTransNo'] = $FromTransNo; } @@ -72,7 +72,7 @@ $FirstPage = true; $line_height=16; - while ($FromTransNo <= $_POST['ToTransNo']){ + while ($FromTransNo <= filter_number_format($_POST['ToTransNo'])){ /* retrieve the invoice details from the database to print notice that salesorder record must be present to print the invoice purging of sales orders will @@ -127,22 +127,22 @@ debtortrans.debtorno, debtortrans.branchcode, currencies.decimalplaces - FROM debtortrans INNER JOIN debtorsmaster - ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN custbranch - ON debtortrans.debtorno=custbranch.debtorno + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode - INNER JOIN salesorders + INNER JOIN salesorders ON debtortrans.order_ = salesorders.orderno - INNER JOIN shippers - ON debtortrans.shipvia=shippers.shipper_id - INNER JOIN salesman - ON custbranch.salesman=salesman.salesmancode - INNER JOIN locations - ON salesorders.fromstkloc=locations.loccode - INNER JOIN paymentterms + INNER JOIN shippers + ON debtortrans.shipvia=shippers.shipper_id + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.type=10 AND debtortrans.transno='" . $FromTransNo . "'"; @@ -186,16 +186,16 @@ debtortrans.branchcode, paymentterms.terms, currencies.decimalplaces - FROM debtortrans INNER JOIN debtorsmaster - ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN custbranch - ON debtortrans.debtorno=custbranch.debtorno + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode - INNER JOIN salesman - ON custbranch.salesman=salesman.salesmancode - INNER JOIN paymentterms + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.type=11 AND debtortrans.transno='" . $FromTransNo . "'"; @@ -460,10 +460,10 @@ if (isset($_GET['FromTransNo'])) { $FromTransNo = trim($_GET['FromTransNo']); } elseif (isset($_POST['FromTransNo'])) { - $FromTransNo = trim($_POST['FromTransNo']); + $FromTransNo = filter_number_format($_POST['FromTransNo']); } - - + + if (isset($_GET['Email'])){ //email the invoice to address supplied include('includes/header.inc'); @@ -471,7 +471,7 @@ $FileName = $_SESSION['reports_dir'] . '/' . $_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $_GET['FromTransNo'] . '.pdf'; $pdf->Output($FileName,'F'); $mail = new htmlMimeMail(); - + $Attachment = $mail->getFile($FileName); $mail->setText(_('Please find attached') . ' ' . $InvOrCredit . ' ' . $_GET['FromTransNo'] ); $mail->SetSubject($InvOrCredit . ' ' . $_GET['FromTransNo']); @@ -489,7 +489,7 @@ } else { //its not an email just print the invoice to PDF $pdf->OutputD($_SESSION['DatabaseName'] . '_' . $InvOrCredit . '_' . $FromTransNo . '.pdf'); - + } $pdf->__destruct(); @@ -503,7 +503,7 @@ /* if FromTransNo is not set then show a form to allow input of either a single invoice number or a range of invoices to be printed. Also get the last invoice number created to show the user where the current range is up to */ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - + echo '<div class="centre"><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="">' . ' ' . _('Print Invoices or Credit Notes (Landscape Mode)') . '</div>'; echo '<table class="table1"> <tr><td>' . _('Print Invoices or Credit Notes') . '</td><td><select name=InvOrCredit>'; @@ -532,12 +532,12 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td> - <td><input Type=text class=number max=6 size=7 name=FromTransNo></td></tr>'; + <td><input type="text" class="number" maxlength="6" size="7" name="FromTransNo" /></td></tr>'; echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> - <td><input Type=text class=number max=6 size=7 name="ToTransNo"></td></tr> + <td><input type="text" class="number" maxlength="6" size="7" name="ToTransNo" /></td></tr> </table>'; - echo '<div class="centre"><input type="submit" name="Print" value="' . _('Print') . '"><p>'; - echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '<div class="centre"><input type="submit" name="Print" value="' . _('Print') . '" /><p>'; + echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /></div>'; $sql = "SELECT typeno FROM systypes WHERE typeid=10"; @@ -551,11 +551,13 @@ $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); - echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b><br />' . _('A sequential range can be printed using the same method as for invoices above') . '. ' . _('A single credit note can be printed by only entering a start transaction number') . '</DIV'; + echo '<br /><b>' . _('The last credit note created was number') . ' ' . $myrow[0] . '</b> + <br />' . _('A sequential range can be printed using the same method as for invoices above') . '. ' . _('A single credit note can be printed by only entering a start transaction number') . + '</div>'; } else { - while ($FromTransNo <= $_POST['ToTransNo']) { + while ($FromTransNo <= filter_number_format($_POST['ToTransNo'])) { /*retrieve the invoice details from the database to print notice that salesorder record must be present to print the invoice purging of sales orders will @@ -600,22 +602,22 @@ salesman.salesmanname, debtortrans.debtorno, currencies.decimalplaces - FROM debtortrans INNER JOIN debtorsmaster - ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN custbranch - ON debtortrans.debtorno=custbranch.debtorno + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode - INNER JOIN salesorders + INNER JOIN salesorders ON debtortrans.order_ = salesorders.orderno - INNER JOIN shippers - ON debtortrans.shipvia=shippers.shipper_id - INNER JOIN salesman - ON custbranch.salesman=salesman.salesmancode - INNER JOIN locations - ON salesorders.fromstkloc=locations.loccode - INNER JOIN paymentterms + INNER JOIN shippers + ON debtortrans.shipvia=shippers.shipper_id + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.type=10 AND debtortrans.transno='" . $FromTransNo . "'"; @@ -646,16 +648,16 @@ salesman.salesmanname, debtortrans.debtorno, currencies.decimalplaces - FROM debtortrans INNER JOIN debtorsmaster - ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN custbranch - ON debtortrans.debtorno=custbranch.debtorno + FROM debtortrans INNER JOIN debtorsmaster + ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN custbranch + ON debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode - INNER JOIN salesman - ON custbranch.salesman=salesman.salesmancode - INNER JOIN paymentterms + INNER JOIN salesman + ON custbranch.salesman=salesman.salesmancode + INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator - INNER JOIN currencies + INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.type=11 AND debtortrans.transno='" . $FromTransNo . "'"; @@ -674,8 +676,11 @@ $myrow = DB_fetch_array($result); /* Then there's an invoice (or credit note) to print. So print out the invoice header and GST Number from the company record */ - if (count($_SESSION['AllowedPageSecurityTokens'])==1 AND in_array(1, $_SESSION['AllowedPageSecurityTokens']) AND $myrow['debtorno'] != $_SESSION['CustomerID']){ - echo '<p><font color=RED size=4>' . _('This transaction is addressed to another customer and cannot be displayed for privacy reasons') . '. ' . _('Please select only transactions relevant to your company'); + if (count($_SESSION['AllowedPageSecurityTokens'])==1 + AND in_array(1, $_SESSION['AllowedPageSecurityTokens']) + AND $myrow['debtorno'] != $_SESSION['CustomerID']){ + + echo '<p><font color="red" size="4">' . _('This transaction is addressed to another customer and cannot be displayed for privacy reasons') . '. ' . _('Please select only transactions relevant to your company'); exit; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-06 09:16:53
|
Revision: 4714 http://web-erp.svn.sourceforge.net/web-erp/?rev=4714&view=rev Author: daintree Date: 2011-10-06 09:16:44 +0000 (Thu, 06 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/Prices.php trunk/Prices_Customer.php trunk/PrintCustOrder.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PurchData.php trunk/SecurityTokens.php trunk/SelectSalesOrder.php trunk/includes/MiscFunctions.php Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2011-10-06 07:52:38 UTC (rev 4713) +++ trunk/Prices.php 2011-10-06 09:16:44 UTC (rev 4714) @@ -193,7 +193,7 @@ prices.currabrev, prices.startdate, prices.enddate, - currencies.decimalplaces + currencies.decimalplaces AS currdecimalplaces FROM prices INNER JOIN salestypes ON prices.typeabbrev = salestypes.typeabbrev @@ -211,7 +211,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <table class=selection> <tr> - <th colspan=7> + <th colspan="7"> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />' . _('Pricing for part') . ': <input type="text" name="Item" size="22" value="' . $Item . '" maxlength="20"> @@ -245,7 +245,7 @@ if (in_array(5,$_SESSION['AllowedPageSecurityTokens'])) { echo '<td>' . $myrow['currency'] . '</td> <td>' . $myrow['sales_type'] . '</td> - <td class="number">' . locale_number_format($myrow['price'],$myrow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> <td>' . ConvertSQLDate($myrow['startdate']) . '</td> <td>' . $EndDateDisplay . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?Item=' . $myrow['stockid'] . '&TypeAbbrev=' .$myrow['typeabbrev'] . '&CurrAbrev=' . $myrow['currabrev'] . '&Price=' . $myrow['price'] . '&StartDate=' . $myrow['startdate'] . '&EndDate=' . $myrow['enddate'] . '&Edit=1">' . _('Edit') . '</td> @@ -254,7 +254,7 @@ } else { echo '<td>' . $myrow['currency'] . '</td> <td>' . $myrow['sales_type'] . '</td> - <td class="number">' . locale_number_format($myrow['price'],$myrow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> <td>' . ConvertSQLDate($myrow['startdate']) . '</td> <td>' . $EndDateDisplay . '</td></tr>'; } @@ -269,10 +269,10 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['Edit'])){ - echo '<input type=hidden name="OldTypeAbbrev" value="' . $_GET['TypeAbbrev'] .'">'; - echo '<input type=hidden name="OldCurrAbrev" value="' . $_GET['CurrAbrev'] . '">'; - echo '<input type=hidden name="OldStartDate" value="' . $_GET['StartDate'] . '">'; - echo '<input type=hidden name="OldEndDate" value="' . $_GET['EndDate'] . '">'; + echo '<input type="hidden" name="OldTypeAbbrev" value="' . $_GET['TypeAbbrev'] .'">'; + echo '<input type="hidden" name="OldCurrAbrev" value="' . $_GET['CurrAbrev'] . '">'; + echo '<input type="hidden" name="OldStartDate" value="' . $_GET['StartDate'] . '">'; + echo '<input type="hidden" name="OldEndDate" value="' . $_GET['EndDate'] . '">'; $_POST['CurrAbrev'] = $_GET['CurrAbrev']; $_POST['TypeAbbrev'] = $_GET['TypeAbbrev']; /*the price sent with the get is sql format price so no need to filter */ @@ -291,7 +291,7 @@ $result = DB_query($SQL,$db); echo '<br /><table class="selection">'; - echo '<tr><th colspan=5><font color=BLUE size=3><b>' . $Item . ' - ' . $PartDescription . '</b></font></th></tr>'; + echo '<tr><th colspan="5"><font color="blue" size="3"><b>' . $Item . ' - ' . $PartDescription . '</b></font></th></tr>'; echo '<tr><td>' . _('Currency') . ':</td> <td><select name="CurrAbrev">'; while ($myrow = DB_fetch_array($result)) { Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-10-06 07:52:38 UTC (rev 4713) +++ trunk/Prices_Customer.php 2011-10-06 09:16:44 UTC (rev 4714) @@ -5,12 +5,13 @@ $result = DB_query("SELECT debtorsmaster.name, debtorsmaster.currcode, - debtorsmaster.salestype + debtorsmaster.salestype, + currencies.decimalplaces AS currdecimalplaces FROM debtorsmaster WHERE debtorsmaster.debtorno='" . $_SESSION['CustomerID'] . "'",$db); -$myrow = DB_fetch_row($result); +$myrow = DB_fetch_array($result); -$title = _('Special Prices for') . ' '. $myrow[0]; +$title = _('Special Prices for') . ' '. $myrow['name']; include('includes/header.inc'); @@ -20,7 +21,7 @@ $Item = $_POST['Item']; } -if (!isset($Item) OR !isset($_SESSION['CustomerID']) OR $_SESSION['CustomerID']==""){ +if (!isset($Item) OR !isset($_SESSION['CustomerID']) OR $_SESSION['CustomerID']==''){ prnMsg( _('A customer must be selected from the customer selection screen') . ', ' . _('then an item must be selected before this page is called') . '. ' @@ -30,18 +31,13 @@ exit; } -$result = DB_query("SELECT debtorsmaster.name, - debtorsmaster.currcode, - debtorsmaster.salestype - FROM debtorsmaster - WHERE debtorsmaster.debtorno='" . $_SESSION['CustomerID'] . "'",$db); -$myrow = DB_fetch_row($result); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . _('Special Customer Prices').'</p><br />'; -echo '<font color=BLUE><b>' . $myrow[0] . ' ' . _('in') . ' ' . $myrow[1] . '<br />' . ' ' . _('for') . ' '; +echo '<font color=BLUE><b>' . $myrow['name'] . ' ' . _('in') . ' ' . $myrow['currcode'] . '<br />' . ' ' . _('for') . ' '; -$CurrCode = $myrow[1]; -$SalesType = $myrow[2]; +$CurrCode = $myrow['currcode']; +$SalesType = $myrow['salestype']; +$CurrDecimalPlaces = $myrow['currdecimalplaces']; $result = DB_query("SELECT stockmaster.description, stockmaster.mbflag @@ -216,16 +212,16 @@ $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } printf('<tr class="EvenTableRows"> - <td class=number>%0.2f</td> - <td class=date>%s</td> - <td class=date>%s</td></tr>', - $myrow['price'], + <td class="number">%s</td> + <td class="date">%s</td> + <td class="date">%s</td></tr>', + locale_number_format($myrow['price'],$CurrDecimalPlaces), ConvertSQLDate($myrow['startdate']), $EndDateDisplay); } } -echo '</table></td><td valign=top>'; +echo '</table></td><td valign="top">'; //now get the prices for the customer selected @@ -234,7 +230,8 @@ custbranch.brname, prices.startdate, prices.enddate - FROM prices LEFT JOIN custbranch ON prices.branchcode= custbranch.branchcode + FROM prices LEFT JOIN custbranch + ON prices.branchcode= custbranch.branchcode WHERE prices.typeabbrev = '".$SalesType."' AND prices.stockid='".$Item."' AND prices.debtorno='" . $_SESSION['CustomerID'] . "' @@ -242,13 +239,13 @@ AND (custbranch.debtorno='" . $_SESSION['CustomerID'] . "' OR custbranch.debtorno IS NULL) ORDER BY prices.branchcode, - prices.startdate"; + prices.startdate"; $ErrMsg = _('Could not retrieve the special prices set up because'); $DbgMsg = _('The SQL used to retrieve these records was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); -echo '<table class=selection>'; +echo '<table class="selection">'; if (DB_num_rows($result) == 0) { echo '<tr><td>' . _('There are no special prices set up for this part') . '</td></tr>'; @@ -270,10 +267,10 @@ $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } echo '<tr bgcolor="#CCCCCC"> - <td class=number>'.locale_number_format($myrow['price'],2).'</td> - <td>'.$Branch.'</td> + <td class="number">'.locale_number_format($myrow['price'],$CurrDecimalPlaces).'</td> + <td>' . $Branch.'</td> <td>'.$myrow['units'].'</td> - <td class=number>'.$myrow['conversionfactor'].'</td> + <td class="number">'.$myrow['conversionfactor'].'</td> <td>'.ConvertSQLDate($myrow['startdate']).'</td> <td>'.$EndDateDisplay.'</td> <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Price='.$myrow['price'].'&Branch='.$myrow['branchcode']. @@ -288,13 +285,13 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<input type=hidden name="Item" value="' . $Item . '">'; +echo '<input type="hidden" name="Item" value="' . $Item . '" />'; if (isset($_GET['Edit']) and $_GET['Edit']==1){ - echo '<input type=hidden name="Editing" value="Yes">'; - echo '<input type=hidden name="OldStartDate" value="' . $_GET['StartDate'] .'">'; - echo '<input type=hidden name="OldEndDate" value="' . $_GET['EndDate'] . '">'; - $_POST['Price']=filter_number_format($_GET['Price']); + echo '<input type="hidden" name="Editing" value="Yes" />'; + echo '<input type="hidden" name="OldStartDate" value="' . $_GET['StartDate'] .'" />'; + echo '<input type="hidden" name="OldEndDate" value="' . $_GET['EndDate'] . '" />'; + $_POST['Price']=$_GET['Price']; $_POST['Branch']=$_GET['Branch']; $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); if (Is_Date($_GET['EndDate'])){ @@ -322,11 +319,14 @@ branchcode, brname FROM custbranch - WHERE debtorno='".$_SESSION['CustomerID'] ."'"; + WHERE debtorno='" . $_SESSION['CustomerID'] . "'"; $result = DB_query($sql, $db); -echo '<table class=selection>'; -echo '<tr><td>' . _('Branch') . ':</td>'; -echo '<td><select name="Branch">'; + +echo '<table class="selection"> + <tr> + <td>' . _('Branch') . ':</td> + <td><select name="Branch">'; + while ($myrow=DB_fetch_array($result)) { if ($myrow['branchcode']==$_POST['branch']) { echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; @@ -335,22 +335,28 @@ } } echo '</select></td></tr>'; -echo '<tr><td>' . _('Start Date') . ':</td> - <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value="' . $_POST['StartDate'] . '"></td></tr>'; -echo '<tr><td>' . _('End Date') . ':</td> - <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value="' . $_POST['EndDate'] . '"></td></tr>'; +echo '<tr> + <td>' . _('Start Date') . ':</td> + <td><input type="text" name="StartDate" class="date" alt='.$_SESSION['DefaultDateFormat']. ' size="11" maxlength="10" value="' . $_POST['StartDate'] . '"></td> + </tr>'; +echo '<tr> + <td>' . _('End Date') . ':</td> + <td><input type="text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. ' size="11" maxlength="10" value="' . $_POST['EndDate'] . '" /></td></tr>'; echo '<tr><td>' . _('Price') . ':</td> - <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> - </tr></table>'; + <td><input type="text" class="number" name="Price" size="11" maxlength="10" value="' . locale_number_format($_POST['Price'],2) . '"></td> + </tr> + </table>'; -echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; - -echo '</form>'; +echo '<br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> + </div> + </form>'; + include('includes/footer.inc'); +exit; function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $CustomerID, $db) { Modified: trunk/PrintCustOrder.php =================================================================== --- trunk/PrintCustOrder.php 2011-10-06 07:52:38 UTC (rev 4713) +++ trunk/PrintCustOrder.php 2011-10-06 09:16:44 UTC (rev 4714) @@ -20,15 +20,15 @@ <br /> <table class="table_index"> <tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td> - </tr> - </table> - </div> - <br /> - <br /> - <br />'; + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; include('includes/footer.inc'); exit; } Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-10-06 07:52:38 UTC (rev 4713) +++ trunk/PrintCustTrans.php 2011-10-06 09:16:44 UTC (rev 4714) @@ -692,11 +692,13 @@ <td bgcolor="#BBBBBB"><b>'; if ($InvOrCredit=='Invoice') { - echo '<font size=4>' . _('TAX INVOICE') . ' '; + echo '<font size="4">' . _('TAX INVOICE') . ' '; } else { - echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; + echo '<font color="red" size="4">' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td> + </tr> + </table>'; /* Now print out the logo and company name and address */ echo '<table class="table1"> @@ -711,13 +713,16 @@ echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td WIDTH=50% class=number>'; + echo '</td><td width="50%" class="number">'; /* Now the customer charged to details in a sub table within a cell of the main table*/ echo '<table class="table1"> - <tr><td align=left bgcolor="#BBBBBB"><b>' . _('Charge To') . ':</b></td> - </tr><tr><td bgcolor="#EEEEEE">'; + <tr> + <td align=left bgcolor="#BBBBBB"><b>' . _('Charge To') . ':</b></td> + </tr> + <tr> + <td bgcolor="#EEEEEE">'; echo $myrow['name'] . '<br />' . $myrow['address1'] . '<br />' . $myrow['address2'] . @@ -725,10 +730,14 @@ '<br />' . $myrow['address4'] . '<br />' . $myrow['address5'] . '<br />' . $myrow['address6']; - echo '</td></tr></table>'; + echo '</td> + </tr> + </table>'; /*end of the small table showing charge to account details */ echo _('Page') . ': ' . $PageNumber; - echo '</td></tr></table>'; + echo '</td> + </tr> + </table>'; /*end of the main table showing the company name and charge to details */ if ($InvOrCredit=='Invoice') { @@ -755,7 +764,8 @@ '<br />' . $myrow['deladd5'] . '<br />' . $myrow['deladd6'] . '</td> </tr> - </table><hr>'; + </table> + <hr>'; echo '<table class="table1"> <tr> @@ -880,22 +890,22 @@ $DisplayDiscount = locale_number_format($myrow2['discountpercent']*100,2) . '%'; } - printf ('<td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - </tr>', - $myrow2['stockid'], - $myrow2['description'], - $DisplayQty, - $myrow2['units'], - $DisplayPrice, - $DisplayDiscount, - $DisplayNet); - + printf ('<td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + </tr>', + $myrow2['stockid'], + $myrow2['description'], + $DisplayQty, + $myrow2['units'], + $DisplayPrice, + $DisplayDiscount, + $DisplayNet); + if (mb_strlen($myrow2['narrative'])>1){ echo $RowStarter . '<td></td><td colspan=6>' . $myrow2['narrative'] . '</td></tr>'; $LineCounter++; @@ -981,7 +991,7 @@ echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td class=number>' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; + echo '</td><td class="number">' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; echo '<table class="table1"> <tr> <th>' . _('Item Code') . '</th> @@ -1023,18 +1033,22 @@ /*Print out the invoice text entered */ echo '<table class=table1><tr> - <td class=number>' . _('Sub Total') . '</td> - <td class=number bgcolor="#EEEEEE" width=15%>' . $DisplaySubTot . '</td></tr>'; - echo '<tr><td class=number>' . _('Freight') . '</td> - <td class=number bgcolor="#EEEEEE">' . $DisplayFreight . '</td></tr>'; - echo '<tr><td class=number>' . _('Tax') . '</td> - <td class=number bgcolor="#EEEEEE">' . $DisplayTax . '</td></tr>'; + <td class="number">' . _('Sub Total') . '</td> + <td class="number" bgcolor="#EEEEEE" width=15%>' . $DisplaySubTot . '</td></tr>'; + echo '<tr><td class="number">' . _('Freight') . '</td> + <td class="number" bgcolor="#EEEEEE">' . $DisplayFreight . '</td></tr>'; + echo '<tr><td class="number">' . _('Tax') . '</td> + <td class="number" bgcolor="#EEEEEE">' . $DisplayTax . '</td></tr>'; if ($InvOrCredit=='Invoice'){ - echo '<tr><td class=number><b>' . _('TOTAL INVOICE') . '</b></td> - <td class=number bgcolor="#EEEEEE"><U><b>' . $DisplayTotal . '</b></U></td></tr>'; + echo '<tr> + <td class="number"><b>' . _('TOTAL INVOICE') . '</b></td> + <td class="number" bgcolor="#EEEEEE"><U><b>' . $DisplayTotal . '</b></U></td> + </tr>'; } else { - echo '<tr><td class=number><font color=RED><b>' . _('TOTAL CREDIT') . '</b></font></td> - <td class=number bgcolor="#EEEEEE"><font color="red"><U><b>' . $DisplayTotal . '</b></U></font></td></tr>'; + echo '<tr> + <td class="number"><font color=RED><b>' . _('TOTAL CREDIT') .'</b></font></td> + <td class="number" bgcolor="#EEEEEE"><font color="red"><U><b>' . $DisplayTotal . '</b></U></font></td> + </tr>'; } echo '</table>'; } /* end of check to see that there was an invoice record to print */ Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-10-06 07:52:38 UTC (rev 4713) +++ trunk/PrintCustTransPortrait.php 2011-10-06 09:16:44 UTC (rev 4714) @@ -334,8 +334,8 @@ $GetControlMovts = DB_query("SELECT moveqty, serialno - FROM stockserialmoves - WHERE stockmoveno='" . $myrow2['stkmoveno'] . "'",$db); + FROM stockserialmoves + WHERE stockmoveno='" . $myrow2['stkmoveno'] . "'",$db); if ($myrow2['serialised']==1){ while ($ControlledMovtRow = DB_fetch_array($GetControlMovts)){ @@ -358,7 +358,6 @@ PrintLinesToBottom (); include ('includes/PDFTransPageHeaderPortrait.inc'); } //end if need a new page headed up - } } } @@ -487,7 +486,6 @@ $FromTransNo++; } /* end loop to print invoices */ - if (isset($_GET['Email'])){ //email the invoice to address supplied include('includes/header.inc'); @@ -523,14 +521,18 @@ if (!isset($FromTransNo) OR $FromTransNo=='') { - /*if FromTransNo is not set then show a form to allow input of either a single invoice number or a range of invoices to be printed. Also get the last invoice number created to show the user where the current range is up to */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"><table class="selection">'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Invoices or Credit Notes (Portrait Mode)') . '</p>'; - echo '<tr><td>' . _('Print Invoices or Credit Notes') . '</td> - <td><select name="InvOrCredit">'; + + echo '<table class="selection"> + <tr> + <td>' . _('Print Invoices or Credit Notes') . '</td> + <td><select name="InvOrCredit">'; + if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)){ echo '<option selected value="Invoice">' . _('Invoices') . '</option>'; @@ -539,9 +541,13 @@ echo '<option selected value="Credit">' . _('Credit Notes') . '</option>'; echo '<option value="Invoice">' . _('Invoices') . '</option>'; } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; - echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name="PrintEDI">'; + echo '<tr> + <td>' . _('Print EDI Transactions') . '</td> + <td><select name="PrintEDI">'; + if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)){ echo '<option selected value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; @@ -554,14 +560,23 @@ } - echo '</select></td></tr>'; - echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td> - <td><input class="number" type="text" max="6" size="7" name="FromTransNo"></td></tr>'; - echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> - <td><input class="number" type="text" max="6" size="7" name="ToTransNo"></td></tr> + echo '</select></td> + </tr>'; + echo '<tr> + <td>' . _('Start invoice/credit note number to print') . '</td> + <td><input class="number" type="text" max="6" size="7" name="FromTransNo"></td> + </tr>'; + echo '<tr> + <td>' . _('End invoice/credit note number to print') . '</td> + <td><input class="number" type="text" max="6" size="7" name="ToTransNo"></td> + </tr> </table>'; - echo '<div class="centre"><br /><input type="submit" name="Print" value="' . _('Print Preview') . '"><p>'; - echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '<div class="centre"> + <br /> + <input type="submit" name="Print" value="' . _('Print Preview') . '" /> + <br /> + <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> + </div>'; $sql = "SELECT typeno FROM systypes WHERE typeid=10"; @@ -700,7 +715,7 @@ $myrow = DB_fetch_array($result); /* Then there's an invoice (or credit note) to print. So print out the invoice header and GST Number from the company record */ if (count($_SESSION['AllowedPageSecurityTokens'])==1 AND in_array(1, $_SESSION['AllowedPageSecurityTokens']) AND $myrow['debtorno'] != $_SESSION['CustomerID']){ - echo '<p><font color=RED size=4>' . _('This transaction is addressed to another customer and cannot be displayed for privacy reasons') . '. ' . _('Please select only transactions relevant to your company'); + echo '<p><font color="red" size="4">' . _('This transaction is addressed to another customer and cannot be displayed for privacy reasons') . '. ' . _('Please select only transactions relevant to your company'); exit; } @@ -708,17 +723,25 @@ $PageNumber = 1; echo '<table class="table1"> - <tr><td valign=top width=10%><img src="' . $_SESSION['LogoFile'] . '"></td><td bgcolor="#bbb"><b>'; + <tr> + <td valign=top width=10%><img src="' . $_SESSION['LogoFile'] . '"></td> + <td bgcolor="#bbb"><b>'; if ($InvOrCredit=='Invoice') { - echo '<font size=4>' . _('TAX INVOICE') . ' '; + echo '<font size="4">' . _('TAX INVOICE') . ' '; } else { - echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; + echo '<font color="red" size="4">' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font> + <br /><font size="1">' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td> + </tr> + </table>'; /*Now print out the logo and company name and address */ - echo '<table class"table1"><tr><td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo '<table class"table1"> + <tr> + <td><font size="4" color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font> + <br />'; echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; @@ -729,11 +752,17 @@ echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td width=50% class+"number">'; + echo '</td> + <td width="50%" class="number">'; /*Now the customer charged to details in a sub table within a cell of the main table*/ - echo '<table class="table1"><tr><td align="left" bgcolor="#bbb"><b>' . _('Charge To') . ':</b></td></tr><tr><td bgcolor="#eee">'; + echo '<table class="table1"> + <tr> + <td align="left" bgcolor="#bbb"><b>' . _('Charge To') . ':</b></td> + </tr> + <tr> + <td bgcolor="#eee">'; echo $myrow['name'] . '<br />' . $myrow['address1'] . '<br />' . $myrow['address2'] . @@ -742,10 +771,14 @@ '<br />' . $myrow['address5'] . '<br />' . $myrow['address6']; - echo '</td></tr></table>'; + echo '</td> + </tr> + </table>'; /*end of the small table showing charge to account details */ echo _('Page') . ': ' . $PageNumber; - echo '</td></tr></table>'; + echo '</td> + </tr> + </table>'; /*end of the main table showing the company name and charge to details */ if ($InvOrCredit=='Invoice') { @@ -814,11 +847,12 @@ } else { /* then its a credit note */ - echo '<table WIDTH=50%><tr> - <td align=left bgcolor="#BBBBBB"><b>' . _('Branch') . ':</b></td> + echo '<table width="50%"> + <tr> + <td align=left bgcolor="#BBBBBB"><b>' . _('Branch') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' .$myrow['brname'] . + <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . @@ -827,14 +861,17 @@ '<br />' . $myrow['braddress6'] . '</td> </tr></table>'; - echo '<hr><table class="table1"><tr> - <td align=left bgcolor="#bbbbbb"><b>' . _('Date') . '</b></td> - <td align=left bgcolor="#BBBBBB"><b>' . _('Sales Person') . '</font></b></td> - </tr>'; + echo '<hr> + <table class="table1"> + <tr> + <td align="left" bgcolor="#bbbbbb"><b>' . _('Date') . '</b></td> + <td align=left bgcolor="#BBBBBB"><b>' . _('Sales Person') . '</font></b></td> + </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> - <td bgcolor="#EEEEEE">' . $myrow['salesmanname'] . '</td> - </tr></table>'; + <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> + <td bgcolor="#EEEEEE">' . $myrow['salesmanname'] . '</td> + </tr> + </table>'; $sql ="SELECT stockmoves.stockid, @@ -903,11 +940,11 @@ printf ('<td>%s</td> <td>%s</td> - <td class+"number">%s</td> - <td class+"number">%s</td> - <td class+"number">%s</td> - <td class+"number">%s</td> - <td class+"number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> </tr>', $myrow2['stockid'], $myrow2['description'], @@ -918,7 +955,10 @@ $DisplayNet); if (mb_strlen($myrow2['narrative'])>1){ - echo $RowStarter . '<td></td><td colspan=6>' . $myrow2['narrative'] . '</td></tr>'; + echo $RowStarter . + '<td></td> + <td colspan=6>' . $myrow2['narrative'] . '</td> + </tr>'; $LineCounter++; } @@ -929,17 +969,25 @@ /* head up a new invoice/credit note page */ $PageNumber++; - echo '</table><table class="table1"><tr><td VALIGN=TOP><img src="' . $_SESSION['LogoFile'] . '"></td><td bgcolor="#bbb"><b>'; + echo '</table> + <table class="table1"> + <tr> + <td valign="top"><img src="' . $_SESSION['LogoFile'] . '"></td> + <td bgcolor="#bbb"><b>'; + if ($InvOrCredit=='Invoice') { - echo '<font size=4>' . _('TAX INVOICE') . ' '; + echo '<font size="4">' . _('TAX INVOICE') . ' '; } else { - echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; + echo '<font color="red" size="4">' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br... [truncated message content] |
From: <dai...@us...> - 2011-10-06 09:16:53
|
Revision: 4714 http://web-erp.svn.sourceforge.net/web-erp/?rev=4714&view=rev Author: daintree Date: 2011-10-06 09:16:44 +0000 (Thu, 06 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/Prices.php trunk/Prices_Customer.php trunk/PrintCustOrder.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/PurchData.php trunk/SecurityTokens.php trunk/SelectSalesOrder.php trunk/includes/MiscFunctions.php Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2011-10-06 07:52:38 UTC (rev 4713) +++ trunk/Prices.php 2011-10-06 09:16:44 UTC (rev 4714) @@ -193,7 +193,7 @@ prices.currabrev, prices.startdate, prices.enddate, - currencies.decimalplaces + currencies.decimalplaces AS currdecimalplaces FROM prices INNER JOIN salestypes ON prices.typeabbrev = salestypes.typeabbrev @@ -211,7 +211,7 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '"> <table class=selection> <tr> - <th colspan=7> + <th colspan="7"> <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />' . _('Pricing for part') . ': <input type="text" name="Item" size="22" value="' . $Item . '" maxlength="20"> @@ -245,7 +245,7 @@ if (in_array(5,$_SESSION['AllowedPageSecurityTokens'])) { echo '<td>' . $myrow['currency'] . '</td> <td>' . $myrow['sales_type'] . '</td> - <td class="number">' . locale_number_format($myrow['price'],$myrow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> <td>' . ConvertSQLDate($myrow['startdate']) . '</td> <td>' . $EndDateDisplay . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?Item=' . $myrow['stockid'] . '&TypeAbbrev=' .$myrow['typeabbrev'] . '&CurrAbrev=' . $myrow['currabrev'] . '&Price=' . $myrow['price'] . '&StartDate=' . $myrow['startdate'] . '&EndDate=' . $myrow['enddate'] . '&Edit=1">' . _('Edit') . '</td> @@ -254,7 +254,7 @@ } else { echo '<td>' . $myrow['currency'] . '</td> <td>' . $myrow['sales_type'] . '</td> - <td class="number">' . locale_number_format($myrow['price'],$myrow['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($myrow['price'],$myrow['currdecimalplaces']) . '</td> <td>' . ConvertSQLDate($myrow['startdate']) . '</td> <td>' . $EndDateDisplay . '</td></tr>'; } @@ -269,10 +269,10 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (isset($_GET['Edit'])){ - echo '<input type=hidden name="OldTypeAbbrev" value="' . $_GET['TypeAbbrev'] .'">'; - echo '<input type=hidden name="OldCurrAbrev" value="' . $_GET['CurrAbrev'] . '">'; - echo '<input type=hidden name="OldStartDate" value="' . $_GET['StartDate'] . '">'; - echo '<input type=hidden name="OldEndDate" value="' . $_GET['EndDate'] . '">'; + echo '<input type="hidden" name="OldTypeAbbrev" value="' . $_GET['TypeAbbrev'] .'">'; + echo '<input type="hidden" name="OldCurrAbrev" value="' . $_GET['CurrAbrev'] . '">'; + echo '<input type="hidden" name="OldStartDate" value="' . $_GET['StartDate'] . '">'; + echo '<input type="hidden" name="OldEndDate" value="' . $_GET['EndDate'] . '">'; $_POST['CurrAbrev'] = $_GET['CurrAbrev']; $_POST['TypeAbbrev'] = $_GET['TypeAbbrev']; /*the price sent with the get is sql format price so no need to filter */ @@ -291,7 +291,7 @@ $result = DB_query($SQL,$db); echo '<br /><table class="selection">'; - echo '<tr><th colspan=5><font color=BLUE size=3><b>' . $Item . ' - ' . $PartDescription . '</b></font></th></tr>'; + echo '<tr><th colspan="5"><font color="blue" size="3"><b>' . $Item . ' - ' . $PartDescription . '</b></font></th></tr>'; echo '<tr><td>' . _('Currency') . ':</td> <td><select name="CurrAbrev">'; while ($myrow = DB_fetch_array($result)) { Modified: trunk/Prices_Customer.php =================================================================== --- trunk/Prices_Customer.php 2011-10-06 07:52:38 UTC (rev 4713) +++ trunk/Prices_Customer.php 2011-10-06 09:16:44 UTC (rev 4714) @@ -5,12 +5,13 @@ $result = DB_query("SELECT debtorsmaster.name, debtorsmaster.currcode, - debtorsmaster.salestype + debtorsmaster.salestype, + currencies.decimalplaces AS currdecimalplaces FROM debtorsmaster WHERE debtorsmaster.debtorno='" . $_SESSION['CustomerID'] . "'",$db); -$myrow = DB_fetch_row($result); +$myrow = DB_fetch_array($result); -$title = _('Special Prices for') . ' '. $myrow[0]; +$title = _('Special Prices for') . ' '. $myrow['name']; include('includes/header.inc'); @@ -20,7 +21,7 @@ $Item = $_POST['Item']; } -if (!isset($Item) OR !isset($_SESSION['CustomerID']) OR $_SESSION['CustomerID']==""){ +if (!isset($Item) OR !isset($_SESSION['CustomerID']) OR $_SESSION['CustomerID']==''){ prnMsg( _('A customer must be selected from the customer selection screen') . ', ' . _('then an item must be selected before this page is called') . '. ' @@ -30,18 +31,13 @@ exit; } -$result = DB_query("SELECT debtorsmaster.name, - debtorsmaster.currcode, - debtorsmaster.salestype - FROM debtorsmaster - WHERE debtorsmaster.debtorno='" . $_SESSION['CustomerID'] . "'",$db); -$myrow = DB_fetch_row($result); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . _('Special Customer Prices').'</p><br />'; -echo '<font color=BLUE><b>' . $myrow[0] . ' ' . _('in') . ' ' . $myrow[1] . '<br />' . ' ' . _('for') . ' '; +echo '<font color=BLUE><b>' . $myrow['name'] . ' ' . _('in') . ' ' . $myrow['currcode'] . '<br />' . ' ' . _('for') . ' '; -$CurrCode = $myrow[1]; -$SalesType = $myrow[2]; +$CurrCode = $myrow['currcode']; +$SalesType = $myrow['salestype']; +$CurrDecimalPlaces = $myrow['currdecimalplaces']; $result = DB_query("SELECT stockmaster.description, stockmaster.mbflag @@ -216,16 +212,16 @@ $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } printf('<tr class="EvenTableRows"> - <td class=number>%0.2f</td> - <td class=date>%s</td> - <td class=date>%s</td></tr>', - $myrow['price'], + <td class="number">%s</td> + <td class="date">%s</td> + <td class="date">%s</td></tr>', + locale_number_format($myrow['price'],$CurrDecimalPlaces), ConvertSQLDate($myrow['startdate']), $EndDateDisplay); } } -echo '</table></td><td valign=top>'; +echo '</table></td><td valign="top">'; //now get the prices for the customer selected @@ -234,7 +230,8 @@ custbranch.brname, prices.startdate, prices.enddate - FROM prices LEFT JOIN custbranch ON prices.branchcode= custbranch.branchcode + FROM prices LEFT JOIN custbranch + ON prices.branchcode= custbranch.branchcode WHERE prices.typeabbrev = '".$SalesType."' AND prices.stockid='".$Item."' AND prices.debtorno='" . $_SESSION['CustomerID'] . "' @@ -242,13 +239,13 @@ AND (custbranch.debtorno='" . $_SESSION['CustomerID'] . "' OR custbranch.debtorno IS NULL) ORDER BY prices.branchcode, - prices.startdate"; + prices.startdate"; $ErrMsg = _('Could not retrieve the special prices set up because'); $DbgMsg = _('The SQL used to retrieve these records was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); -echo '<table class=selection>'; +echo '<table class="selection">'; if (DB_num_rows($result) == 0) { echo '<tr><td>' . _('There are no special prices set up for this part') . '</td></tr>'; @@ -270,10 +267,10 @@ $EndDateDisplay = ConvertSQLDate($myrow['enddate']); } echo '<tr bgcolor="#CCCCCC"> - <td class=number>'.locale_number_format($myrow['price'],2).'</td> - <td>'.$Branch.'</td> + <td class="number">'.locale_number_format($myrow['price'],$CurrDecimalPlaces).'</td> + <td>' . $Branch.'</td> <td>'.$myrow['units'].'</td> - <td class=number>'.$myrow['conversionfactor'].'</td> + <td class="number">'.$myrow['conversionfactor'].'</td> <td>'.ConvertSQLDate($myrow['startdate']).'</td> <td>'.$EndDateDisplay.'</td> <td><a href="'.$_SERVER['PHP_SELF'].'?Item='.$Item.'&Price='.$myrow['price'].'&Branch='.$myrow['branchcode']. @@ -288,13 +285,13 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<input type=hidden name="Item" value="' . $Item . '">'; +echo '<input type="hidden" name="Item" value="' . $Item . '" />'; if (isset($_GET['Edit']) and $_GET['Edit']==1){ - echo '<input type=hidden name="Editing" value="Yes">'; - echo '<input type=hidden name="OldStartDate" value="' . $_GET['StartDate'] .'">'; - echo '<input type=hidden name="OldEndDate" value="' . $_GET['EndDate'] . '">'; - $_POST['Price']=filter_number_format($_GET['Price']); + echo '<input type="hidden" name="Editing" value="Yes" />'; + echo '<input type="hidden" name="OldStartDate" value="' . $_GET['StartDate'] .'" />'; + echo '<input type="hidden" name="OldEndDate" value="' . $_GET['EndDate'] . '" />'; + $_POST['Price']=$_GET['Price']; $_POST['Branch']=$_GET['Branch']; $_POST['StartDate'] = ConvertSQLDate($_GET['StartDate']); if (Is_Date($_GET['EndDate'])){ @@ -322,11 +319,14 @@ branchcode, brname FROM custbranch - WHERE debtorno='".$_SESSION['CustomerID'] ."'"; + WHERE debtorno='" . $_SESSION['CustomerID'] . "'"; $result = DB_query($sql, $db); -echo '<table class=selection>'; -echo '<tr><td>' . _('Branch') . ':</td>'; -echo '<td><select name="Branch">'; + +echo '<table class="selection"> + <tr> + <td>' . _('Branch') . ':</td> + <td><select name="Branch">'; + while ($myrow=DB_fetch_array($result)) { if ($myrow['branchcode']==$_POST['branch']) { echo '<option selected value='.$myrow['branchcode'].'>'.$myrow['brname'].'</option>'; @@ -335,22 +335,28 @@ } } echo '</select></td></tr>'; -echo '<tr><td>' . _('Start Date') . ':</td> - <td><input type="Text" name="StartDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value="' . $_POST['StartDate'] . '"></td></tr>'; -echo '<tr><td>' . _('End Date') . ':</td> - <td><input type="Text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. - ' size=11 maxlength=10 value="' . $_POST['EndDate'] . '"></td></tr>'; +echo '<tr> + <td>' . _('Start Date') . ':</td> + <td><input type="text" name="StartDate" class="date" alt='.$_SESSION['DefaultDateFormat']. ' size="11" maxlength="10" value="' . $_POST['StartDate'] . '"></td> + </tr>'; +echo '<tr> + <td>' . _('End Date') . ':</td> + <td><input type="text" name="EndDate" class=date alt='.$_SESSION['DefaultDateFormat']. ' size="11" maxlength="10" value="' . $_POST['EndDate'] . '" /></td></tr>'; echo '<tr><td>' . _('Price') . ':</td> - <td><input type="Text" class=number name="Price" size=11 maxlength=10 value=' . $_POST['Price'] . '></td> - </tr></table>'; + <td><input type="text" class="number" name="Price" size="11" maxlength="10" value="' . locale_number_format($_POST['Price'],2) . '"></td> + </tr> + </table>'; -echo '<br /><div class="centre"><input type="Submit" name="submit" value="' . _('Enter Information') . '"></div>'; - -echo '</form>'; +echo '<br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> + </div> + </form>'; + include('includes/footer.inc'); +exit; function ReSequenceEffectiveDates ($Item, $PriceList, $CurrAbbrev, $CustomerID, $db) { Modified: trunk/PrintCustOrder.php =================================================================== --- trunk/PrintCustOrder.php 2011-10-06 07:52:38 UTC (rev 4713) +++ trunk/PrintCustOrder.php 2011-10-06 09:16:44 UTC (rev 4714) @@ -20,15 +20,15 @@ <br /> <table class="table_index"> <tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td> - </tr> - </table> - </div> - <br /> - <br /> - <br />'; + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </td> + </tr> + </table> + </div> + <br /> + <br /> + <br />'; include('includes/footer.inc'); exit; } Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-10-06 07:52:38 UTC (rev 4713) +++ trunk/PrintCustTrans.php 2011-10-06 09:16:44 UTC (rev 4714) @@ -692,11 +692,13 @@ <td bgcolor="#BBBBBB"><b>'; if ($InvOrCredit=='Invoice') { - echo '<font size=4>' . _('TAX INVOICE') . ' '; + echo '<font size="4">' . _('TAX INVOICE') . ' '; } else { - echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; + echo '<font color="red" size="4">' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td> + </tr> + </table>'; /* Now print out the logo and company name and address */ echo '<table class="table1"> @@ -711,13 +713,16 @@ echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td WIDTH=50% class=number>'; + echo '</td><td width="50%" class="number">'; /* Now the customer charged to details in a sub table within a cell of the main table*/ echo '<table class="table1"> - <tr><td align=left bgcolor="#BBBBBB"><b>' . _('Charge To') . ':</b></td> - </tr><tr><td bgcolor="#EEEEEE">'; + <tr> + <td align=left bgcolor="#BBBBBB"><b>' . _('Charge To') . ':</b></td> + </tr> + <tr> + <td bgcolor="#EEEEEE">'; echo $myrow['name'] . '<br />' . $myrow['address1'] . '<br />' . $myrow['address2'] . @@ -725,10 +730,14 @@ '<br />' . $myrow['address4'] . '<br />' . $myrow['address5'] . '<br />' . $myrow['address6']; - echo '</td></tr></table>'; + echo '</td> + </tr> + </table>'; /*end of the small table showing charge to account details */ echo _('Page') . ': ' . $PageNumber; - echo '</td></tr></table>'; + echo '</td> + </tr> + </table>'; /*end of the main table showing the company name and charge to details */ if ($InvOrCredit=='Invoice') { @@ -755,7 +764,8 @@ '<br />' . $myrow['deladd5'] . '<br />' . $myrow['deladd6'] . '</td> </tr> - </table><hr>'; + </table> + <hr>'; echo '<table class="table1"> <tr> @@ -880,22 +890,22 @@ $DisplayDiscount = locale_number_format($myrow2['discountpercent']*100,2) . '%'; } - printf ('<td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - </tr>', - $myrow2['stockid'], - $myrow2['description'], - $DisplayQty, - $myrow2['units'], - $DisplayPrice, - $DisplayDiscount, - $DisplayNet); - + printf ('<td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + </tr>', + $myrow2['stockid'], + $myrow2['description'], + $DisplayQty, + $myrow2['units'], + $DisplayPrice, + $DisplayDiscount, + $DisplayNet); + if (mb_strlen($myrow2['narrative'])>1){ echo $RowStarter . '<td></td><td colspan=6>' . $myrow2['narrative'] . '</td></tr>'; $LineCounter++; @@ -981,7 +991,7 @@ echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br />'; echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td class=number>' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; + echo '</td><td class="number">' . _('Page') . ': ' . $PageNumber . '</td></tr></table>'; echo '<table class="table1"> <tr> <th>' . _('Item Code') . '</th> @@ -1023,18 +1033,22 @@ /*Print out the invoice text entered */ echo '<table class=table1><tr> - <td class=number>' . _('Sub Total') . '</td> - <td class=number bgcolor="#EEEEEE" width=15%>' . $DisplaySubTot . '</td></tr>'; - echo '<tr><td class=number>' . _('Freight') . '</td> - <td class=number bgcolor="#EEEEEE">' . $DisplayFreight . '</td></tr>'; - echo '<tr><td class=number>' . _('Tax') . '</td> - <td class=number bgcolor="#EEEEEE">' . $DisplayTax . '</td></tr>'; + <td class="number">' . _('Sub Total') . '</td> + <td class="number" bgcolor="#EEEEEE" width=15%>' . $DisplaySubTot . '</td></tr>'; + echo '<tr><td class="number">' . _('Freight') . '</td> + <td class="number" bgcolor="#EEEEEE">' . $DisplayFreight . '</td></tr>'; + echo '<tr><td class="number">' . _('Tax') . '</td> + <td class="number" bgcolor="#EEEEEE">' . $DisplayTax . '</td></tr>'; if ($InvOrCredit=='Invoice'){ - echo '<tr><td class=number><b>' . _('TOTAL INVOICE') . '</b></td> - <td class=number bgcolor="#EEEEEE"><U><b>' . $DisplayTotal . '</b></U></td></tr>'; + echo '<tr> + <td class="number"><b>' . _('TOTAL INVOICE') . '</b></td> + <td class="number" bgcolor="#EEEEEE"><U><b>' . $DisplayTotal . '</b></U></td> + </tr>'; } else { - echo '<tr><td class=number><font color=RED><b>' . _('TOTAL CREDIT') . '</b></font></td> - <td class=number bgcolor="#EEEEEE"><font color="red"><U><b>' . $DisplayTotal . '</b></U></font></td></tr>'; + echo '<tr> + <td class="number"><font color=RED><b>' . _('TOTAL CREDIT') .'</b></font></td> + <td class="number" bgcolor="#EEEEEE"><font color="red"><U><b>' . $DisplayTotal . '</b></U></font></td> + </tr>'; } echo '</table>'; } /* end of check to see that there was an invoice record to print */ Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2011-10-06 07:52:38 UTC (rev 4713) +++ trunk/PrintCustTransPortrait.php 2011-10-06 09:16:44 UTC (rev 4714) @@ -334,8 +334,8 @@ $GetControlMovts = DB_query("SELECT moveqty, serialno - FROM stockserialmoves - WHERE stockmoveno='" . $myrow2['stkmoveno'] . "'",$db); + FROM stockserialmoves + WHERE stockmoveno='" . $myrow2['stkmoveno'] . "'",$db); if ($myrow2['serialised']==1){ while ($ControlledMovtRow = DB_fetch_array($GetControlMovts)){ @@ -358,7 +358,6 @@ PrintLinesToBottom (); include ('includes/PDFTransPageHeaderPortrait.inc'); } //end if need a new page headed up - } } } @@ -487,7 +486,6 @@ $FromTransNo++; } /* end loop to print invoices */ - if (isset($_GET['Email'])){ //email the invoice to address supplied include('includes/header.inc'); @@ -523,14 +521,18 @@ if (!isset($FromTransNo) OR $FromTransNo=='') { - /*if FromTransNo is not set then show a form to allow input of either a single invoice number or a range of invoices to be printed. Also get the last invoice number created to show the user where the current range is up to */ - echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="POST"><table class="selection">'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="" />' . ' ' . _('Print Invoices or Credit Notes (Portrait Mode)') . '</p>'; - echo '<tr><td>' . _('Print Invoices or Credit Notes') . '</td> - <td><select name="InvOrCredit">'; + + echo '<table class="selection"> + <tr> + <td>' . _('Print Invoices or Credit Notes') . '</td> + <td><select name="InvOrCredit">'; + if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)){ echo '<option selected value="Invoice">' . _('Invoices') . '</option>'; @@ -539,9 +541,13 @@ echo '<option selected value="Credit">' . _('Credit Notes') . '</option>'; echo '<option value="Invoice">' . _('Invoices') . '</option>'; } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; - echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name="PrintEDI">'; + echo '<tr> + <td>' . _('Print EDI Transactions') . '</td> + <td><select name="PrintEDI">'; + if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)){ echo '<option selected value="No">' . _('Do not Print PDF EDI Transactions') . '</option>'; @@ -554,14 +560,23 @@ } - echo '</select></td></tr>'; - echo '<tr><td>' . _('Start invoice/credit note number to print') . '</td> - <td><input class="number" type="text" max="6" size="7" name="FromTransNo"></td></tr>'; - echo '<tr><td>' . _('End invoice/credit note number to print') . '</td> - <td><input class="number" type="text" max="6" size="7" name="ToTransNo"></td></tr> + echo '</select></td> + </tr>'; + echo '<tr> + <td>' . _('Start invoice/credit note number to print') . '</td> + <td><input class="number" type="text" max="6" size="7" name="FromTransNo"></td> + </tr>'; + echo '<tr> + <td>' . _('End invoice/credit note number to print') . '</td> + <td><input class="number" type="text" max="6" size="7" name="ToTransNo"></td> + </tr> </table>'; - echo '<div class="centre"><br /><input type="submit" name="Print" value="' . _('Print Preview') . '"><p>'; - echo '<input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"></div>'; + echo '<div class="centre"> + <br /> + <input type="submit" name="Print" value="' . _('Print Preview') . '" /> + <br /> + <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> + </div>'; $sql = "SELECT typeno FROM systypes WHERE typeid=10"; @@ -700,7 +715,7 @@ $myrow = DB_fetch_array($result); /* Then there's an invoice (or credit note) to print. So print out the invoice header and GST Number from the company record */ if (count($_SESSION['AllowedPageSecurityTokens'])==1 AND in_array(1, $_SESSION['AllowedPageSecurityTokens']) AND $myrow['debtorno'] != $_SESSION['CustomerID']){ - echo '<p><font color=RED size=4>' . _('This transaction is addressed to another customer and cannot be displayed for privacy reasons') . '. ' . _('Please select only transactions relevant to your company'); + echo '<p><font color="red" size="4">' . _('This transaction is addressed to another customer and cannot be displayed for privacy reasons') . '. ' . _('Please select only transactions relevant to your company'); exit; } @@ -708,17 +723,25 @@ $PageNumber = 1; echo '<table class="table1"> - <tr><td valign=top width=10%><img src="' . $_SESSION['LogoFile'] . '"></td><td bgcolor="#bbb"><b>'; + <tr> + <td valign=top width=10%><img src="' . $_SESSION['LogoFile'] . '"></td> + <td bgcolor="#bbb"><b>'; if ($InvOrCredit=='Invoice') { - echo '<font size=4>' . _('TAX INVOICE') . ' '; + echo '<font size="4">' . _('TAX INVOICE') . ' '; } else { - echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; + echo '<font color="red" size="4">' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font> + <br /><font size="1">' . _('Tax Authority Ref') . '. ' . $_SESSION['CompanyRecord']['gstno'] . '</td> + </tr> + </table>'; /*Now print out the logo and company name and address */ - echo '<table class"table1"><tr><td><font size=4 color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br />'; + echo '<table class"table1"> + <tr> + <td><font size="4" color="#333"><b>' . $_SESSION['CompanyRecord']['coyname'] . '</b></font> + <br />'; echo $_SESSION['CompanyRecord']['regoffice1'] . '<br />'; echo $_SESSION['CompanyRecord']['regoffice2'] . '<br />'; echo $_SESSION['CompanyRecord']['regoffice3'] . '<br />'; @@ -729,11 +752,17 @@ echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br />'; echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br />'; - echo '</td><td width=50% class+"number">'; + echo '</td> + <td width="50%" class="number">'; /*Now the customer charged to details in a sub table within a cell of the main table*/ - echo '<table class="table1"><tr><td align="left" bgcolor="#bbb"><b>' . _('Charge To') . ':</b></td></tr><tr><td bgcolor="#eee">'; + echo '<table class="table1"> + <tr> + <td align="left" bgcolor="#bbb"><b>' . _('Charge To') . ':</b></td> + </tr> + <tr> + <td bgcolor="#eee">'; echo $myrow['name'] . '<br />' . $myrow['address1'] . '<br />' . $myrow['address2'] . @@ -742,10 +771,14 @@ '<br />' . $myrow['address5'] . '<br />' . $myrow['address6']; - echo '</td></tr></table>'; + echo '</td> + </tr> + </table>'; /*end of the small table showing charge to account details */ echo _('Page') . ': ' . $PageNumber; - echo '</td></tr></table>'; + echo '</td> + </tr> + </table>'; /*end of the main table showing the company name and charge to details */ if ($InvOrCredit=='Invoice') { @@ -814,11 +847,12 @@ } else { /* then its a credit note */ - echo '<table WIDTH=50%><tr> - <td align=left bgcolor="#BBBBBB"><b>' . _('Branch') . ':</b></td> + echo '<table width="50%"> + <tr> + <td align=left bgcolor="#BBBBBB"><b>' . _('Branch') . ':</b></td> </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' .$myrow['brname'] . + <td bgcolor="#EEEEEE">' . $myrow['brname'] . '<br />' . $myrow['braddress1'] . '<br />' . $myrow['braddress2'] . '<br />' . $myrow['braddress3'] . @@ -827,14 +861,17 @@ '<br />' . $myrow['braddress6'] . '</td> </tr></table>'; - echo '<hr><table class="table1"><tr> - <td align=left bgcolor="#bbbbbb"><b>' . _('Date') . '</b></td> - <td align=left bgcolor="#BBBBBB"><b>' . _('Sales Person') . '</font></b></td> - </tr>'; + echo '<hr> + <table class="table1"> + <tr> + <td align="left" bgcolor="#bbbbbb"><b>' . _('Date') . '</b></td> + <td align=left bgcolor="#BBBBBB"><b>' . _('Sales Person') . '</font></b></td> + </tr>'; echo '<tr> - <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> - <td bgcolor="#EEEEEE">' . $myrow['salesmanname'] . '</td> - </tr></table>'; + <td bgcolor="#EEEEEE">' . ConvertSQLDate($myrow['trandate']) . '</td> + <td bgcolor="#EEEEEE">' . $myrow['salesmanname'] . '</td> + </tr> + </table>'; $sql ="SELECT stockmoves.stockid, @@ -903,11 +940,11 @@ printf ('<td>%s</td> <td>%s</td> - <td class+"number">%s</td> - <td class+"number">%s</td> - <td class+"number">%s</td> - <td class+"number">%s</td> - <td class+"number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> </tr>', $myrow2['stockid'], $myrow2['description'], @@ -918,7 +955,10 @@ $DisplayNet); if (mb_strlen($myrow2['narrative'])>1){ - echo $RowStarter . '<td></td><td colspan=6>' . $myrow2['narrative'] . '</td></tr>'; + echo $RowStarter . + '<td></td> + <td colspan=6>' . $myrow2['narrative'] . '</td> + </tr>'; $LineCounter++; } @@ -929,17 +969,25 @@ /* head up a new invoice/credit note page */ $PageNumber++; - echo '</table><table class="table1"><tr><td VALIGN=TOP><img src="' . $_SESSION['LogoFile'] . '"></td><td bgcolor="#bbb"><b>'; + echo '</table> + <table class="table1"> + <tr> + <td valign="top"><img src="' . $_SESSION['LogoFile'] . '"></td> + <td bgcolor="#bbb"><b>'; + if ($InvOrCredit=='Invoice') { - echo '<font size=4>' . _('TAX INVOICE') . ' '; + echo '<font size="4">' . _('TAX INVOICE') . ' '; } else { - echo '<font color=RED size=4>' . _('TAX CREDIT NOTE') . ' '; + echo '<font color="red" size="4">' . _('TAX CREDIT NOTE') . ' '; } - echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br /><font size=1>' . _('GST Number') . ' - ' . $_SESSION['CompanyRecord']['gstno'] . '</td></tr></table>'; + echo '</b>' . _('Number') . ' ' . $FromTransNo . '</font><br... [truncated message content] |
From: <dai...@us...> - 2011-10-08 09:45:06
|
Revision: 4715 http://web-erp.svn.sourceforge.net/web-erp/?rev=4715&view=rev Author: daintree Date: 2011-10-08 09:44:56 +0000 (Sat, 08 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/PcAuthorizeExpenses.php trunk/PcExpenses.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SalesAnalReptCols.php trunk/SalesAnalRepts.php trunk/SalesAnalysis_UserDefined.php trunk/SelectSalesOrder.php trunk/doc/Change.log trunk/includes/ConnectDB.inc trunk/includes/ConstructSQLForUserDefinedSalesReport.inc trunk/includes/PDFSalesAnalysis.inc trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/PcAuthorizeExpenses.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -57,7 +57,7 @@ echo '<br /><table class=selection>'; echo '<tr><th colspan=7>' . _('Detail Of Movement For Last ') .': '; echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" />' . _('Days'); - echo '<input type=submit name="Go" value="' . _('Go') . '"></tr></th>'; + echo '<input type="submit" name="Go" value="' . _('Go') . '"></tr></th>'; echo '</form>'; $sql = "SELECT pcashdetails.counterindex, @@ -101,7 +101,9 @@ while ($myrow=DB_fetch_array($result)) { $CurrDecimalPlaces = $myrow['decimalplaces']; //update database if update pressed - if ((isset($_POST['Submit']) AND $_POST['Submit']=='Update') AND isset($_POST[$myrow['counterindex']])){ + if ((isset($_POST['Submit']) + AND $_POST['Submit']=='Update') + AND isset($_POST[$myrow['counterindex']])){ $PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db); @@ -119,12 +121,14 @@ $type = 1; $Amount = -$Amount; $AccountFrom = $myrow['glaccountpcash']; - $SQLAccExp = "SELECT glaccount + $SQLAccExp = "SELECT glaccount, + tag FROM pcexpenses WHERE codeexpense = '".$myrow['codeexpense']."'"; $ResultAccExp = DB_query($SQLAccExp,$db); $myrowAccExp = DB_fetch_array($ResultAccExp); $AccountTo = $myrowAccExp['glaccount']; + $TagTo = $myrowAccExp['tag']; } //get typeno @@ -158,7 +162,7 @@ '".-$Amount."', 0, '', - 0)"; + '" . $TagTo ."')"; $ResultFrom = DB_Query($sqlFrom, $db, '', '', true); @@ -185,7 +189,7 @@ '".$Amount."', 0, '', - 0)"; + '" . $TagTo ."')"; $ResultTo = DB_Query($sqlTo, $db, '', '', true); @@ -253,13 +257,13 @@ if(($Authoriser!='00/00/0000')){ echo'<td>'.ConvertSQLDate($myrow['authorized']).'</td>'; }else{ - echo '<td align=right><input type="checkbox" name="'.$myrow['counterindex'].'">'; + echo '<td align=right><input type="checkbox" name="'.$myrow['counterindex'].'" /></td>'; } } - echo '<input type="hidden" name="SelectedIndex" value="' . $myrow['counterindex']. '">'; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; - echo '<input type="hidden" name="Days" value="' .$Days. '">'; + echo '<input type="hidden" name="SelectedIndex" value="' . $myrow['counterindex']. '" />'; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; + echo '<input type="hidden" name="Days" value="' .$Days. '" />'; echo'</tr>'; Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/PcExpenses.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -20,6 +20,7 @@ unset($_POST['CodeExpense']); unset($_POST['Description']); unset($_POST['GLAccount']); + unset($_POST['Tag']); } @@ -85,10 +86,11 @@ if (isset($SelectedExpense) AND $InputError !=1) { - $sql = "UPDATE pcexpenses - SET description = '" . DB_escape_string($_POST['Description']) . "', - glaccount = '" . $_POST['GLAccount'] . "' - WHERE codeexpense = '" . $SelectedExpense . "'"; + $sql = "UPDATE pcexpenses + SET description = '" . DB_escape_string($_POST['Description']) . "', + glaccount = '" . $_POST['GLAccount'] . "', + tag = '" . $_POST['Tag'] . "' + WHERE codeexpense = '" . $SelectedExpense . "'"; $msg = _('The Expenses type') . ' ' . $SelectedExpense . ' ' . _('has been updated'); } elseif ( $InputError !=1 ) { @@ -111,11 +113,14 @@ $sql = "INSERT INTO pcexpenses (codeexpense, - description,glaccount) + description, + glaccount, + tag) VALUES ('" . $_POST['CodeExpense'] . "', '" . DB_escape_string($_POST['Description']) . "', - '" . $_POST['GLAccount'] . "')"; - + '" . $_POST['GLAccount'] . "', + '" . $_POST['Tag'] . "')"; + $msg = _('Expense ') . ' ' . $_POST['CodeExpense'] . ' ' . _('has been created'); $checkSql = "SELECT count(codeexpense) FROM pcexpenses"; @@ -134,6 +139,7 @@ unset($_POST['CodeExpense']); unset($_POST['Description']); unset($_POST['GLAccount']); + unset($_POST['Tag']); } } elseif ( isset($_GET['delete']) ) { @@ -181,6 +187,7 @@ <th>' . _('Description') . '</th> <th>' . _('Account Code') . '</th> <th>' . _('Account Description') . '</th> + <th>' . _('Tag') . '</th> </tr>'; $k=0; //row colour counter @@ -200,20 +207,29 @@ $ResultDes = DB_query($sqldesc,$db); $Description=DB_fetch_array($ResultDes); + + $SqlDescTag="SELECT tagdescription + FROM tags + WHERE tagref='". $myrow[3] . "'"; + $ResultDesTag = DB_query($SqlDescTag,$db); + $DescriptionTag=DB_fetch_array($ResultDesTag); + printf('<td>%s</td> - <td>%s</td> - <td class="number">%s</td> - <td>%s</td> - <td><a href="%sSelectedExpense=%s">' . _('Edit') . '</td> - <td><a href="%sSelectedExpense=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this expense code and all the details it may have set up?') . '\');">' . _('Delete') . '</td> - </tr>', - $myrow[0], - $myrow[1], - $myrow[2], - $Description[0], - $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?', $myrow[0]); + <td>%s</td> + <td class="number">%s</td> + <td>%s</td> + <td>%s</td> + <td><a href="%sSelectedExpense=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedExpense=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this expense code and all the details it may have set up?') . '\');">' . _('Delete') . '</td> + </tr>', + $myrow[0], + $myrow[1], + $myrow[2], + $Description['accountname'], + $DescriptionTag['tagdesciption'], + $_SERVER['PHP_SELF'] . '?', $myrow[0], + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -228,14 +244,15 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p><table class=selection>'; //Main table + echo '<p><table class="selection">'; //Main table // The user wish to EDIT an existing type if ( isset($SelectedExpense) AND $SelectedExpense!='' ){ $sql = "SELECT codeexpense, description, - glaccount + glaccount, + tag FROM pcexpenses WHERE codeexpense='" . $SelectedExpense . "'"; @@ -245,6 +262,7 @@ $_POST['CodeExpense'] = $myrow['codeexpense']; $_POST['Description'] = $myrow['description']; $_POST['GLAccount'] = $myrow['glaccount']; + $_POST['Tag'] = $myrow['tag']; echo '<input type=hidden name="SelectedExpense" value="' . $SelectedExpense . '">'; echo '<input type=hidden name="CodeExpense" VALUE="' . $_POST['CodeExpense']. '">'; @@ -274,7 +292,9 @@ <td><input type="text" ' . (in_array('Description',$Errors) ? 'class="inputerror"' : '' ) . ' name="Description" size=50 maxlength=49 value="' . $_POST['Description'] . '"></td> </tr>'; - echo '<tr><td>' . _('Account Code') . ':</td><td><select name="GLAccount">'; + echo '<tr> + <td>' . _('Account Code') . ':</td> + <td><select name="GLAccount">'; DB_free_result($result); $SQL = "SELECT accountcode, @@ -294,11 +314,34 @@ } //end while loop echo '</select></td></tr>'; + + //Select the tag + DB_free_result($result); + echo '<tr> + <td>' . _('Tag') . ':</td> + <td><select name="Tag">'; + $SQL = "SELECT tagref, + tagdescription + FROM tags + ORDER BY tagref"; + + $result=DB_query($SQL,$db); + echo '<option value="0">0 - ' . _('None') . '</option>'; + while ($myrow=DB_fetch_array($result)){ + if (isset($_POST['Tag']) and $_POST['Tag']==$myrow['tagref']){ + echo '<option selected value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'].'</option>'; + } else { + echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; + } + } + echo '</select></td>'; + // End select tag + echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '"> - <input type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; echo '</form>'; Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/RecurringSalesOrders.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -160,11 +160,11 @@ if (isset($_POST['DeleteRecurringOrder'])){ - $sql = "DELETE FROM recurrsalesorderdetails WHERE recurrorderno='" . filter_number_format($_POST['ExistingRecurrOrderNo']) . "'"; + $sql = "DELETE FROM recurrsalesorderdetails WHERE recurrorderno='" . $_POST['ExistingRecurrOrderNo'] . "'"; $ErrMsg = _('Could not delete recurring sales order lines for the recurring order template') . ' ' . $_POST['ExistingRecurrOrderNo']; $result = DB_query($sql,$db,$ErrMsg); - $sql = "DELETE FROM recurringsalesorders WHERE recurrorderno='" . filter_number_format($_POST['ExistingRecurrOrderNo']) . "'"; + $sql = "DELETE FROM recurringsalesorders WHERE recurrorderno='" . $_POST['ExistingRecurrOrderNo'] . "'"; $ErrMsg = _('Could not delete the recurring sales order template number') . ' ' . $_POST['ExistingRecurrOrderNo']; $result = DB_query($sql,$db,$ErrMsg); @@ -287,7 +287,7 @@ stopdate = '" . FormatDateforSQL($_POST['StopDate']) . "', frequency = '" . $_POST['Frequency'] . "', autoinvoice = '" . $_POST['AutoInvoice'] . "' - WHERE recurrorderno = '" . filter_number_format($_POST['ExistingRecurrOrderNo']) . "'"; + WHERE recurrorderno = '" . $_POST['ExistingRecurrOrderNo'] . "'"; $ErrMsg = _('The recurring order cannot be updated because'); $UpdateQryResult = DB_query($HeaderSQL,$db,$ErrMsg); @@ -420,7 +420,7 @@ echo '<tr> <td>'. _('Last Recurrence') . ':</td> <td>' . $_POST['StartDate'] . '</td></tr>'; - echo '<input type=hidden name="StartDate" value="' . $_POST['StartDate'] . '">'; + echo '<input type="hidden" name="StartDate" value="' . $_POST['StartDate'] . '">'; } if (!isset($_POST['StopDate'])){ @@ -486,7 +486,7 @@ } echo '</select></td></tr>'; } else { - echo '<input type=hidden name="AutoInvoice" value=0>'; + echo '<input type="hidden" name="AutoInvoice" value=0>'; } echo '</table>'; @@ -496,8 +496,8 @@ echo '<input type="hidden" name="NewRecurringOrder" value="Yes" />'; echo '<input type="submit" name="Process" value="' . _('Create Recurring Order') . '" />'; } else { - echo '<input type=hidden name="NewRecurringOrder" value="No">'; - echo '<input type=hidden name="ExistingRecurrOrderNo" value="' . $_POST['ExistingRecurrOrderNo'] . '" />'; + echo '<input type="hidden" name="NewRecurringOrder" value="No">'; + echo '<input type="hidden" name="ExistingRecurrOrderNo" value="' . $_POST['ExistingRecurrOrderNo'] . '" />'; echo '<input type="submit" name="Process" value="' . _('Update Recurring Order Details') . '" />'; echo '<hr>'; Modified: trunk/ReorderLevel.php =================================================================== --- trunk/ReorderLevel.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/ReorderLevel.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -170,7 +170,10 @@ locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); - echo '<table class=selection><tr><td>' . _('From Stock Location') . ':</td><td><select name="StockLocation"> '; + echo '<table class="selection"> + <tr> + <td>' . _('From Stock Location') . ':</td> + <td><select name="StockLocation"> '; if (!isset($_POST['StockLocation'])){ $_POST['StockLocation']='All'; } @@ -200,7 +203,9 @@ exit; } - echo '<tr><td>' . _('In Stock Category') . ':</td><td><select name="StockCat">'; + echo '<tr> + <td>' . _('In Stock Category') . ':</td> + <td><select name="StockCat">'; if (!isset($_POST['StockCat'])){ $_POST['StockCat']='All'; } @@ -217,7 +222,11 @@ } } echo '</select></td></tr>'; - echo '</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'); Modified: trunk/ReorderLevelLocation.php =================================================================== --- trunk/ReorderLevelLocation.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/ReorderLevelLocation.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -60,19 +60,20 @@ $Location=DB_fetch_array($ResultLocation); echo'<p class="page_title_text" align="center"><strong>' . _('Location : ') . '' . $Location['locationname'] . ' </strong></p>'; - echo'<p class="page_title_text" align="center"><strong>' . _('Number Of Days Sales : ') . '' . $_POST['NumberOfDays'] . '' . _(' Days ') . ' </strong></p>'; + echo'<p class="page_title_text" align="center"><strong>' . _('Number Of Days Sales : ') . '' . locale_number_format($_POST['NumberOfDays'],0) . '' . _(' Days ') . ' </strong></p>'; echo '<table>'; - echo '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Total Invoiced').'<br />'._('At All Locations') . '</th> - <th>' . _('Total Invoiced').'<br />'._('At Location') . '</th> - <th>' . _('On Hand') .'<br />'._('At All Locations') . '</th> - <th>' . _('On Hand') .'<br />' ._('At Location') . '</th> - <th>' . _('Reorder Level') . '</th> - <tr>'; + echo '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Total Invoiced').'<br />'._('At All Locations') . '</th> + <th>' . _('Total Invoiced').'<br />'._('At Location') . '</th> + <th>' . _('On Hand') .'<br />'._('At All Locations') . '</th> + <th>' . _('On Hand') .'<br />' ._('At Location') . '</th> + <th>' . _('Reorder Level') . '</th> + <tr>'; $k=0; //row colour counter - echo'<form action="ReorderLevelLocation.php" method="POST" name="update">'; + echo'<form action="ReorderLevelLocation.php" method="post" name="update">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $i=1; while ($myrow=DB_fetch_array($result)) { @@ -88,9 +89,9 @@ //variable for update data echo'<input type="hidden" value=' . $_POST['order'] . ' name='. _('order').' /> - <input type="hidden" value="' . $_POST['StockLocation'] . '" name="StockLocation" /> - <input type="hidden" value="' . $_POST['StockCat'] . '" name="StockCat" /> - <input type="hidden" value="' . $_POST['NumberOfDays'] . '" name="NumberOfDays" />'; + <input type="hidden" value="' . $_POST['StockLocation'] . '" name="StockLocation" /> + <input type="hidden" value="' . $_POST['StockCat'] . '" name="StockCat" /> + <input type="hidden" value="' . locale_number_format($_POST['NumberOfDays'],0) . '" name="NumberOfDays" />'; //get qtyinvoice all $sqlinv="SELECT sum(salesorderdetails.qtyinvoiced)as qtyinvoice @@ -138,13 +139,13 @@ <td class="number">'.$QtyInvoice.'</td> <td class="number">'.$ohRow['0'].'</td> <td class="number">'.$ohinRow['0'].'</td> - <td><input type="text" class="number" name="ReorderLevel' . $i .'" maxlength="3" size="4" value="'. $myrow['reorderlevel'] .'" /> + <td><input type="text" class="number" name="ReorderLevel' . $i .'" maxlength="3" size="4" value="'. locale_number_format($myrow['reorderlevel'],0) .'" /> <input type="hidden" name="StockID' . $i . '" value="' . $myrow['stockid'] . '" /></td> </tr> '; $i++; } //end of looping echo'<tr> - <td style="text-align:center" colspan=7><input type="submit" name="submit" value=' . _('Update') . ' /></td> + <td style="text-align:center" colspan="7"><input type="submit" name="submit" value=' . _('Update') . ' /></td> </tr> </form>'; @@ -191,14 +192,21 @@ echo'<tr> <td>' . _('Number Of Days Sales') . ':</td> <td><input type="text" class="number" name="NumberOfDays" maxlength="3" size="4" value="0" /></td>'; - echo '<tr><td>' . _('Order By') . ':</td> - <td><select name="order">'; - echo '<option value="1">'. _('Total Invoiced') . '</option>'; - echo '<option value="2">'. _('Item Code') . '</option>'; + echo '<tr> + <td>' . _('Order By') . ':</td> + <td><select name="order"> + <option value="1">'. _('Total Invoiced') . '</option> + <option value="2">'. _('Item Code') . '</option> + </select></td> + </tr>'; + echo '</table> + <br /> + <p> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Submit') . '"> + </div> + </p>'; - echo '</select></td></tr>'; - echo '</table><br /><p><div class="centre"><input type="submit" name="submit" value="' . _('Submit') . '"></div></p>'; - } /*end of else not submit */ include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/ReprintGRN.php =================================================================== --- trunk/ReprintGRN.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/ReprintGRN.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -13,15 +13,20 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class="selection">'; -echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Select a purchase order') . '</th></tr>'; -echo '<tr><td>' . _('Enter a Purchase Order Number') . '</td>'; -echo '<td>' . '<input type="text" name="PONumber" class="number" size="7" value="'.$_POST['PONumber'].'" /></td></tr>'; -echo '<tr><td colspan=2 style="text-align: center"><input type="submit" name="Show" value="Show GRNs" /></td></tr>'; +echo '<table class="selection"> + <tr> + <th colspan="2"><font size="2" color="navy">' . _('Select a purchase order') . '</th> + </tr> + <tr> + <td>' . _('Enter a Purchase Order Number') . '</td> + <td>' . '<input type="text" name="PONumber" class="number" size="7" value="'.$_POST['PONumber'].'" /></td> + </tr> + <tr> + <td colspan="2" style="text-align: center"><input type="submit" name="Show" value="' . _('Show GRNs') . '" /></td> + </tr> + </table> + </form>'; -echo '</table>'; -echo '</form>'; - if (isset($_POST['Show'])) { if ($_POST['PONumber']=='') { echo '<br />'; @@ -64,15 +69,21 @@ exit; } $k=0; - echo '<br /><table class="selection">'; - echo '<tr><th colspan="8"><font size="2" color="navy">' . _('GRNs for Purchase Order No') .' ' . $_POST['PONumber'] . '</th></tr>'; - echo '<tr><th>' . _('Supplier') . '</th>'; - echo '<th>' . _('PO Order line') . '</th>'; - echo '<th>' . _('GRN Number') . '</th>'; - echo '<th>' . _('Item Code') . '</th>'; - echo '<th>' . _('Item Description') . '</th>'; - echo '<th>' . _('Delivery Date') . '</th>'; - echo '<th>' . _('Quantity Received') . '</th></tr>'; + echo '<br /> + <table class="selection"> + <tr> + <th colspan="8"><font size="2" color="navy">' . _('GRNs for Purchase Order No') .' ' . $_POST['PONumber'] . '</th> + </tr> + <tr> + <th>' . _('Supplier') . '</th> + <th>' . _('PO Order line') . '</th> + <th>' . _('GRN Number') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Delivery Date') . '</th> + <th>' . _('Quantity Received') . '</th> + </tr>'; + while ($myrow=DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -81,15 +92,15 @@ echo '<tr class="OddTableRows">'; $k=1; } - echo '<td>' . $myrow['suppname'] . '</td>'; - echo '<td class="number">' . $myrow['podetailitem'] . '</td>'; - echo '<td class="number">' . $myrow['grnbatch'] . '</td>'; - echo '<td>' . $myrow['itemcode'] . '</td>'; - echo '<td>' . $myrow['itemdescription'] . '</td>'; - echo '<td>' . $myrow['deliverydate'] . '</td>'; - echo '<td class="number">' . locale_number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td>'; - echo '<td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint') . '</a></td>'; - echo '</tr>'; + echo '<td>' . $myrow['suppname'] . '</td> + <td class="number">' . $myrow['podetailitem'] . '</td> + <td class="number">' . $myrow['grnbatch'] . '</td> + <td>' . $myrow['itemcode'] . '</td> + <td>' . $myrow['itemdescription'] . '</td> + <td>' . $myrow['deliverydate'] . '</td> + <td class="number">' . locale_number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td> + <td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint') . '</a></td> + </tr>'; } echo '</table>'; } Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/ReverseGRN.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -12,8 +12,11 @@ if ((isset($_SESSION['SupplierID']) AND $_SESSION['SupplierID']!='') OR (!isset($_POST['SupplierID']) OR $_POST['SupplierID'])==''){ + $_POST['SupplierID']=$_SESSION['SupplierID']; + } + if (!isset($_POST['SupplierID']) OR $_POST['SupplierID']==""){ echo '<br />' . _('This page is expected to be called after a supplier has been selected'); echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SelectSupplier.php">'; @@ -25,8 +28,7 @@ $_POST['SuppName'] = $SuppRow[0]; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Sales') . - '" alt="" />' . ' ' . _('Reverse Goods Received from') . ' ' . $_POST['SuppName'] . '</p> '; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Sales') . '" alt="" />' . ' ' . _('Reverse Goods Received from') . ' ' . $_POST['SuppName'] . '</p> '; if (isset($_GET['GRNNo']) AND isset($_POST['SupplierID'])){ /* SQL to process the postings for the GRN reversal.. */ @@ -48,7 +50,7 @@ ON grns.podetailitem=purchorderdetails.podetailitem INNER JOIN purchorders ON purchorderdetails.orderno = purchorders.orderno - WHERE AND grnno='" . filter_number_format($_GET['GRNNo']) . "'"; + WHERE AND grnno='" . $_GET['GRNNo'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not get the details of the GRN selected for reversal because') . ' '; $DbgMsg = _('The following SQL to retrieve the GRN details was used') . ':'; @@ -59,7 +61,8 @@ $QtyToReverse = $GRN['qtyrecd'] - $GRN['quantityinv']; if ($QtyToReverse ==0){ - echo '<br /><br />' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); + echo '<br /> + <br />' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); include ('includes/footer.inc'); exit; } @@ -118,7 +121,7 @@ /*Now the SQL to do the update to the PurchOrderDetails */ $SQL = "UPDATE purchorderdetails - SET quantityrecd = quantityrecd - '" . filter_number_format($QtyToReverse) . "', + SET quantityrecd = quantityrecd - '" . $QtyToReverse . "', completed=0 WHERE purchorderdetails.podetailitem = '" . $GRN['podetailitem'] . "'"; @@ -144,9 +147,9 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN record could not be deleted because'); $DbgMsg = _('The following SQL to delete the GRN record was used'); - $result = DB_query("DELETE FROM grns WHERE grnno='" . filter_number_format($_GET['GRNNo']) . "'",$db,$ErrMsg,$DbgMsg,true); + $result = DB_query("DELETE FROM grns WHERE grnno='" . $_GET['GRNNo'] . "'",$db,$ErrMsg,$DbgMsg,true); } else { - $SQL = "UPDATE grns SET qtyrecd = qtyrecd - " . filter_number_format($QtyToReverse) . " + $SQL = "UPDATE grns SET qtyrecd = qtyrecd - " . $QtyToReverse . " WHERE grns.grnno='" . $_GET['GRNNo'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN record could not be updated') . '. ' . _('This reversal of goods received has not been processed because'); @@ -163,18 +166,18 @@ inputdate, cost) VALUES ('" . $GRN['assetid'] . "', - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - '" . filter_number_format((-$GRN['stdcostunit'] * $QtyToReverse)) . "')"; + '25', + '" . $_GET['GRNNo'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + '" . (-$GRN['stdcostunit'] * $QtyToReverse) . "')"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); /*now reverse the cost put to fixedassets */ - $SQL = "UPDATE fixedassets SET cost = cost - " . filter_number_format($GRN['stdcostunit'] * $QtyToReverse) . " + $SQL = "UPDATE fixedassets SET cost = cost - " . $GRN['stdcostunit'] * $QtyToReverse . " WHERE assetid = '" . $GRN['assetid'] . "'"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost addition could not be reversed:'); $DbgMsg = _('The following SQL was used to attempt the reduce the cost of the asset was:'); @@ -237,9 +240,9 @@ '" . $GRN['deliverydate'] . "', '" . $PeriodNo . "', '" . _('Reversal') . ' - ' . $_POST['SupplierID'] . ' - ' . $GRN['orderno'] . "', - '" . filter_number_format(-$QtyToReverse) . "', + '" . -$QtyToReverse . "', '" . $GRN['stdcostunit'] . "', - '" . filter_number_format($QtyOnHandPrior - $QtyToReverse) . "' + '" . $QtyOnHandPrior - $QtyToReverse . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); @@ -260,6 +263,7 @@ '" . $GRN['itemcode'] . "', '" . $SerialStockMoves['serialno'] . "', '" . -$SerialStockMoves['moveqty'] . "')"; + $result = DB_query($SQL,$db,_('Could not insert the reversing stock movements for the batch/serial numbers'),_('The SQL used but failed was') . ':',true); $SQL = "UPDATE stockserialitems @@ -274,9 +278,14 @@ /* If GLLink_Stock then insert GLTrans to debit the GL Code and credit GRN Suspense account at standard cost*/ - if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $GRN['glcode'] !=0 AND $GRN['stdcostunit']!=0){ /*GLCode is set to 0 when the GLLink is not activated - this covers a situation where the GLLink is now active but it wasn't when this PO was entered */ - /*first the credit using the GLCode in the PO detail record entry*/ + if ($_SESSION['CompanyRecord']['gllink_stock']==1 + AND $GRN['glcode'] !=0 + AND $GRN['stdcostunit']!=0){ + + /*GLCode is set to 0 when the GLLink is not activated + this covers a situation where the GLLink is now active but it wasn't when this PO was entered + + First the credit using the GLCode in the PO detail record entry*/ $SQL = "INSERT INTO gltrans (type, typeno, @@ -292,7 +301,7 @@ '" . $PeriodNo . "', '" . $GRN['glcode'] . "', '" . _('GRN Reversal for PO') .": " . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . locale_number_format($GRN['stdcostunit'],$_SESSION['CompanyRecord']['decimalplaces']) . "', - '" . filter_number_format(-($GRN['stdcostunit'] * $QtyToReverse)) . "')"; + '" . -($GRN['stdcostunit'] * $QtyToReverse) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The purchase GL posting could not be inserted for the reversal of the received item because'); $DbgMsg = _('The following SQL to insert the purchase GLTrans record was used'); @@ -313,7 +322,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['grnact'] . "', '" . _('GRN Reversal PO') . ': ' . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . locale_number_format($GRN['stdcostunit'],$_SESSION['CompanyRecord']['decimalplaces']) . "', - '" . filter_number_format($GRN['stdcostunit'] * $QtyToReverse) . "' + '" . $GRN['stdcostunit'] * $QtyToRever... [truncated message content] |
From: <dai...@us...> - 2011-10-08 09:45:07
|
Revision: 4715 http://web-erp.svn.sourceforge.net/web-erp/?rev=4715&view=rev Author: daintree Date: 2011-10-08 09:44:56 +0000 (Sat, 08 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/PcAuthorizeExpenses.php trunk/PcExpenses.php trunk/RecurringSalesOrders.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SalesAnalReptCols.php trunk/SalesAnalRepts.php trunk/SalesAnalysis_UserDefined.php trunk/SelectSalesOrder.php trunk/doc/Change.log trunk/includes/ConnectDB.inc trunk/includes/ConstructSQLForUserDefinedSalesReport.inc trunk/includes/PDFSalesAnalysis.inc trunk/sql/mysql/upgrade4.05-4.06.sql Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/PcAuthorizeExpenses.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -57,7 +57,7 @@ echo '<br /><table class=selection>'; echo '<tr><th colspan=7>' . _('Detail Of Movement For Last ') .': '; echo '<input type="text" class="number" name="Days" value="' . $Days . '" maxlength="3" size="4" />' . _('Days'); - echo '<input type=submit name="Go" value="' . _('Go') . '"></tr></th>'; + echo '<input type="submit" name="Go" value="' . _('Go') . '"></tr></th>'; echo '</form>'; $sql = "SELECT pcashdetails.counterindex, @@ -101,7 +101,9 @@ while ($myrow=DB_fetch_array($result)) { $CurrDecimalPlaces = $myrow['decimalplaces']; //update database if update pressed - if ((isset($_POST['Submit']) AND $_POST['Submit']=='Update') AND isset($_POST[$myrow['counterindex']])){ + if ((isset($_POST['Submit']) + AND $_POST['Submit']=='Update') + AND isset($_POST[$myrow['counterindex']])){ $PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db); @@ -119,12 +121,14 @@ $type = 1; $Amount = -$Amount; $AccountFrom = $myrow['glaccountpcash']; - $SQLAccExp = "SELECT glaccount + $SQLAccExp = "SELECT glaccount, + tag FROM pcexpenses WHERE codeexpense = '".$myrow['codeexpense']."'"; $ResultAccExp = DB_query($SQLAccExp,$db); $myrowAccExp = DB_fetch_array($ResultAccExp); $AccountTo = $myrowAccExp['glaccount']; + $TagTo = $myrowAccExp['tag']; } //get typeno @@ -158,7 +162,7 @@ '".-$Amount."', 0, '', - 0)"; + '" . $TagTo ."')"; $ResultFrom = DB_Query($sqlFrom, $db, '', '', true); @@ -185,7 +189,7 @@ '".$Amount."', 0, '', - 0)"; + '" . $TagTo ."')"; $ResultTo = DB_Query($sqlTo, $db, '', '', true); @@ -253,13 +257,13 @@ if(($Authoriser!='00/00/0000')){ echo'<td>'.ConvertSQLDate($myrow['authorized']).'</td>'; }else{ - echo '<td align=right><input type="checkbox" name="'.$myrow['counterindex'].'">'; + echo '<td align=right><input type="checkbox" name="'.$myrow['counterindex'].'" /></td>'; } } - echo '<input type="hidden" name="SelectedIndex" value="' . $myrow['counterindex']. '">'; - echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '">'; - echo '<input type="hidden" name="Days" value="' .$Days. '">'; + echo '<input type="hidden" name="SelectedIndex" value="' . $myrow['counterindex']. '" />'; + echo '<input type="hidden" name="SelectedTabs" value="' . $SelectedTabs . '" />'; + echo '<input type="hidden" name="Days" value="' .$Days. '" />'; echo'</tr>'; Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/PcExpenses.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -20,6 +20,7 @@ unset($_POST['CodeExpense']); unset($_POST['Description']); unset($_POST['GLAccount']); + unset($_POST['Tag']); } @@ -85,10 +86,11 @@ if (isset($SelectedExpense) AND $InputError !=1) { - $sql = "UPDATE pcexpenses - SET description = '" . DB_escape_string($_POST['Description']) . "', - glaccount = '" . $_POST['GLAccount'] . "' - WHERE codeexpense = '" . $SelectedExpense . "'"; + $sql = "UPDATE pcexpenses + SET description = '" . DB_escape_string($_POST['Description']) . "', + glaccount = '" . $_POST['GLAccount'] . "', + tag = '" . $_POST['Tag'] . "' + WHERE codeexpense = '" . $SelectedExpense . "'"; $msg = _('The Expenses type') . ' ' . $SelectedExpense . ' ' . _('has been updated'); } elseif ( $InputError !=1 ) { @@ -111,11 +113,14 @@ $sql = "INSERT INTO pcexpenses (codeexpense, - description,glaccount) + description, + glaccount, + tag) VALUES ('" . $_POST['CodeExpense'] . "', '" . DB_escape_string($_POST['Description']) . "', - '" . $_POST['GLAccount'] . "')"; - + '" . $_POST['GLAccount'] . "', + '" . $_POST['Tag'] . "')"; + $msg = _('Expense ') . ' ' . $_POST['CodeExpense'] . ' ' . _('has been created'); $checkSql = "SELECT count(codeexpense) FROM pcexpenses"; @@ -134,6 +139,7 @@ unset($_POST['CodeExpense']); unset($_POST['Description']); unset($_POST['GLAccount']); + unset($_POST['Tag']); } } elseif ( isset($_GET['delete']) ) { @@ -181,6 +187,7 @@ <th>' . _('Description') . '</th> <th>' . _('Account Code') . '</th> <th>' . _('Account Description') . '</th> + <th>' . _('Tag') . '</th> </tr>'; $k=0; //row colour counter @@ -200,20 +207,29 @@ $ResultDes = DB_query($sqldesc,$db); $Description=DB_fetch_array($ResultDes); + + $SqlDescTag="SELECT tagdescription + FROM tags + WHERE tagref='". $myrow[3] . "'"; + $ResultDesTag = DB_query($SqlDescTag,$db); + $DescriptionTag=DB_fetch_array($ResultDesTag); + printf('<td>%s</td> - <td>%s</td> - <td class="number">%s</td> - <td>%s</td> - <td><a href="%sSelectedExpense=%s">' . _('Edit') . '</td> - <td><a href="%sSelectedExpense=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this expense code and all the details it may have set up?') . '\');">' . _('Delete') . '</td> - </tr>', - $myrow[0], - $myrow[1], - $myrow[2], - $Description[0], - $_SERVER['PHP_SELF'] . '?', $myrow[0], - $_SERVER['PHP_SELF'] . '?', $myrow[0]); + <td>%s</td> + <td class="number">%s</td> + <td>%s</td> + <td>%s</td> + <td><a href="%sSelectedExpense=%s">' . _('Edit') . '</td> + <td><a href="%sSelectedExpense=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this expense code and all the details it may have set up?') . '\');">' . _('Delete') . '</td> + </tr>', + $myrow[0], + $myrow[1], + $myrow[2], + $Description['accountname'], + $DescriptionTag['tagdesciption'], + $_SERVER['PHP_SELF'] . '?', $myrow[0], + $_SERVER['PHP_SELF'] . '?', $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -228,14 +244,15 @@ echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<p><table class=selection>'; //Main table + echo '<p><table class="selection">'; //Main table // The user wish to EDIT an existing type if ( isset($SelectedExpense) AND $SelectedExpense!='' ){ $sql = "SELECT codeexpense, description, - glaccount + glaccount, + tag FROM pcexpenses WHERE codeexpense='" . $SelectedExpense . "'"; @@ -245,6 +262,7 @@ $_POST['CodeExpense'] = $myrow['codeexpense']; $_POST['Description'] = $myrow['description']; $_POST['GLAccount'] = $myrow['glaccount']; + $_POST['Tag'] = $myrow['tag']; echo '<input type=hidden name="SelectedExpense" value="' . $SelectedExpense . '">'; echo '<input type=hidden name="CodeExpense" VALUE="' . $_POST['CodeExpense']. '">'; @@ -274,7 +292,9 @@ <td><input type="text" ' . (in_array('Description',$Errors) ? 'class="inputerror"' : '' ) . ' name="Description" size=50 maxlength=49 value="' . $_POST['Description'] . '"></td> </tr>'; - echo '<tr><td>' . _('Account Code') . ':</td><td><select name="GLAccount">'; + echo '<tr> + <td>' . _('Account Code') . ':</td> + <td><select name="GLAccount">'; DB_free_result($result); $SQL = "SELECT accountcode, @@ -294,11 +314,34 @@ } //end while loop echo '</select></td></tr>'; + + //Select the tag + DB_free_result($result); + echo '<tr> + <td>' . _('Tag') . ':</td> + <td><select name="Tag">'; + $SQL = "SELECT tagref, + tagdescription + FROM tags + ORDER BY tagref"; + + $result=DB_query($SQL,$db); + echo '<option value="0">0 - ' . _('None') . '</option>'; + while ($myrow=DB_fetch_array($result)){ + if (isset($_POST['Tag']) and $_POST['Tag']==$myrow['tagref']){ + echo '<option selected value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'].'</option>'; + } else { + echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; + } + } + echo '</select></td>'; + // End select tag + echo '</td></tr></table>'; // close main table - echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '"> - <input type="submit" name="Cancel" value="' . _('Cancel') . '"></div>'; + echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; echo '</form>'; Modified: trunk/RecurringSalesOrders.php =================================================================== --- trunk/RecurringSalesOrders.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/RecurringSalesOrders.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -160,11 +160,11 @@ if (isset($_POST['DeleteRecurringOrder'])){ - $sql = "DELETE FROM recurrsalesorderdetails WHERE recurrorderno='" . filter_number_format($_POST['ExistingRecurrOrderNo']) . "'"; + $sql = "DELETE FROM recurrsalesorderdetails WHERE recurrorderno='" . $_POST['ExistingRecurrOrderNo'] . "'"; $ErrMsg = _('Could not delete recurring sales order lines for the recurring order template') . ' ' . $_POST['ExistingRecurrOrderNo']; $result = DB_query($sql,$db,$ErrMsg); - $sql = "DELETE FROM recurringsalesorders WHERE recurrorderno='" . filter_number_format($_POST['ExistingRecurrOrderNo']) . "'"; + $sql = "DELETE FROM recurringsalesorders WHERE recurrorderno='" . $_POST['ExistingRecurrOrderNo'] . "'"; $ErrMsg = _('Could not delete the recurring sales order template number') . ' ' . $_POST['ExistingRecurrOrderNo']; $result = DB_query($sql,$db,$ErrMsg); @@ -287,7 +287,7 @@ stopdate = '" . FormatDateforSQL($_POST['StopDate']) . "', frequency = '" . $_POST['Frequency'] . "', autoinvoice = '" . $_POST['AutoInvoice'] . "' - WHERE recurrorderno = '" . filter_number_format($_POST['ExistingRecurrOrderNo']) . "'"; + WHERE recurrorderno = '" . $_POST['ExistingRecurrOrderNo'] . "'"; $ErrMsg = _('The recurring order cannot be updated because'); $UpdateQryResult = DB_query($HeaderSQL,$db,$ErrMsg); @@ -420,7 +420,7 @@ echo '<tr> <td>'. _('Last Recurrence') . ':</td> <td>' . $_POST['StartDate'] . '</td></tr>'; - echo '<input type=hidden name="StartDate" value="' . $_POST['StartDate'] . '">'; + echo '<input type="hidden" name="StartDate" value="' . $_POST['StartDate'] . '">'; } if (!isset($_POST['StopDate'])){ @@ -486,7 +486,7 @@ } echo '</select></td></tr>'; } else { - echo '<input type=hidden name="AutoInvoice" value=0>'; + echo '<input type="hidden" name="AutoInvoice" value=0>'; } echo '</table>'; @@ -496,8 +496,8 @@ echo '<input type="hidden" name="NewRecurringOrder" value="Yes" />'; echo '<input type="submit" name="Process" value="' . _('Create Recurring Order') . '" />'; } else { - echo '<input type=hidden name="NewRecurringOrder" value="No">'; - echo '<input type=hidden name="ExistingRecurrOrderNo" value="' . $_POST['ExistingRecurrOrderNo'] . '" />'; + echo '<input type="hidden" name="NewRecurringOrder" value="No">'; + echo '<input type="hidden" name="ExistingRecurrOrderNo" value="' . $_POST['ExistingRecurrOrderNo'] . '" />'; echo '<input type="submit" name="Process" value="' . _('Update Recurring Order Details') . '" />'; echo '<hr>'; Modified: trunk/ReorderLevel.php =================================================================== --- trunk/ReorderLevel.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/ReorderLevel.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -170,7 +170,10 @@ locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); - echo '<table class=selection><tr><td>' . _('From Stock Location') . ':</td><td><select name="StockLocation"> '; + echo '<table class="selection"> + <tr> + <td>' . _('From Stock Location') . ':</td> + <td><select name="StockLocation"> '; if (!isset($_POST['StockLocation'])){ $_POST['StockLocation']='All'; } @@ -200,7 +203,9 @@ exit; } - echo '<tr><td>' . _('In Stock Category') . ':</td><td><select name="StockCat">'; + echo '<tr> + <td>' . _('In Stock Category') . ':</td> + <td><select name="StockCat">'; if (!isset($_POST['StockCat'])){ $_POST['StockCat']='All'; } @@ -217,7 +222,11 @@ } } echo '</select></td></tr>'; - echo '</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'); Modified: trunk/ReorderLevelLocation.php =================================================================== --- trunk/ReorderLevelLocation.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/ReorderLevelLocation.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -60,19 +60,20 @@ $Location=DB_fetch_array($ResultLocation); echo'<p class="page_title_text" align="center"><strong>' . _('Location : ') . '' . $Location['locationname'] . ' </strong></p>'; - echo'<p class="page_title_text" align="center"><strong>' . _('Number Of Days Sales : ') . '' . $_POST['NumberOfDays'] . '' . _(' Days ') . ' </strong></p>'; + echo'<p class="page_title_text" align="center"><strong>' . _('Number Of Days Sales : ') . '' . locale_number_format($_POST['NumberOfDays'],0) . '' . _(' Days ') . ' </strong></p>'; echo '<table>'; - echo '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Total Invoiced').'<br />'._('At All Locations') . '</th> - <th>' . _('Total Invoiced').'<br />'._('At Location') . '</th> - <th>' . _('On Hand') .'<br />'._('At All Locations') . '</th> - <th>' . _('On Hand') .'<br />' ._('At Location') . '</th> - <th>' . _('Reorder Level') . '</th> - <tr>'; + echo '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Total Invoiced').'<br />'._('At All Locations') . '</th> + <th>' . _('Total Invoiced').'<br />'._('At Location') . '</th> + <th>' . _('On Hand') .'<br />'._('At All Locations') . '</th> + <th>' . _('On Hand') .'<br />' ._('At Location') . '</th> + <th>' . _('Reorder Level') . '</th> + <tr>'; $k=0; //row colour counter - echo'<form action="ReorderLevelLocation.php" method="POST" name="update">'; + echo'<form action="ReorderLevelLocation.php" method="post" name="update">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $i=1; while ($myrow=DB_fetch_array($result)) { @@ -88,9 +89,9 @@ //variable for update data echo'<input type="hidden" value=' . $_POST['order'] . ' name='. _('order').' /> - <input type="hidden" value="' . $_POST['StockLocation'] . '" name="StockLocation" /> - <input type="hidden" value="' . $_POST['StockCat'] . '" name="StockCat" /> - <input type="hidden" value="' . $_POST['NumberOfDays'] . '" name="NumberOfDays" />'; + <input type="hidden" value="' . $_POST['StockLocation'] . '" name="StockLocation" /> + <input type="hidden" value="' . $_POST['StockCat'] . '" name="StockCat" /> + <input type="hidden" value="' . locale_number_format($_POST['NumberOfDays'],0) . '" name="NumberOfDays" />'; //get qtyinvoice all $sqlinv="SELECT sum(salesorderdetails.qtyinvoiced)as qtyinvoice @@ -138,13 +139,13 @@ <td class="number">'.$QtyInvoice.'</td> <td class="number">'.$ohRow['0'].'</td> <td class="number">'.$ohinRow['0'].'</td> - <td><input type="text" class="number" name="ReorderLevel' . $i .'" maxlength="3" size="4" value="'. $myrow['reorderlevel'] .'" /> + <td><input type="text" class="number" name="ReorderLevel' . $i .'" maxlength="3" size="4" value="'. locale_number_format($myrow['reorderlevel'],0) .'" /> <input type="hidden" name="StockID' . $i . '" value="' . $myrow['stockid'] . '" /></td> </tr> '; $i++; } //end of looping echo'<tr> - <td style="text-align:center" colspan=7><input type="submit" name="submit" value=' . _('Update') . ' /></td> + <td style="text-align:center" colspan="7"><input type="submit" name="submit" value=' . _('Update') . ' /></td> </tr> </form>'; @@ -191,14 +192,21 @@ echo'<tr> <td>' . _('Number Of Days Sales') . ':</td> <td><input type="text" class="number" name="NumberOfDays" maxlength="3" size="4" value="0" /></td>'; - echo '<tr><td>' . _('Order By') . ':</td> - <td><select name="order">'; - echo '<option value="1">'. _('Total Invoiced') . '</option>'; - echo '<option value="2">'. _('Item Code') . '</option>'; + echo '<tr> + <td>' . _('Order By') . ':</td> + <td><select name="order"> + <option value="1">'. _('Total Invoiced') . '</option> + <option value="2">'. _('Item Code') . '</option> + </select></td> + </tr>'; + echo '</table> + <br /> + <p> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Submit') . '"> + </div> + </p>'; - echo '</select></td></tr>'; - echo '</table><br /><p><div class="centre"><input type="submit" name="submit" value="' . _('Submit') . '"></div></p>'; - } /*end of else not submit */ include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/ReprintGRN.php =================================================================== --- trunk/ReprintGRN.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/ReprintGRN.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -13,15 +13,20 @@ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table class="selection">'; -echo '<tr><th colspan="2"><font size="2" color="navy">' . _('Select a purchase order') . '</th></tr>'; -echo '<tr><td>' . _('Enter a Purchase Order Number') . '</td>'; -echo '<td>' . '<input type="text" name="PONumber" class="number" size="7" value="'.$_POST['PONumber'].'" /></td></tr>'; -echo '<tr><td colspan=2 style="text-align: center"><input type="submit" name="Show" value="Show GRNs" /></td></tr>'; +echo '<table class="selection"> + <tr> + <th colspan="2"><font size="2" color="navy">' . _('Select a purchase order') . '</th> + </tr> + <tr> + <td>' . _('Enter a Purchase Order Number') . '</td> + <td>' . '<input type="text" name="PONumber" class="number" size="7" value="'.$_POST['PONumber'].'" /></td> + </tr> + <tr> + <td colspan="2" style="text-align: center"><input type="submit" name="Show" value="' . _('Show GRNs') . '" /></td> + </tr> + </table> + </form>'; -echo '</table>'; -echo '</form>'; - if (isset($_POST['Show'])) { if ($_POST['PONumber']=='') { echo '<br />'; @@ -64,15 +69,21 @@ exit; } $k=0; - echo '<br /><table class="selection">'; - echo '<tr><th colspan="8"><font size="2" color="navy">' . _('GRNs for Purchase Order No') .' ' . $_POST['PONumber'] . '</th></tr>'; - echo '<tr><th>' . _('Supplier') . '</th>'; - echo '<th>' . _('PO Order line') . '</th>'; - echo '<th>' . _('GRN Number') . '</th>'; - echo '<th>' . _('Item Code') . '</th>'; - echo '<th>' . _('Item Description') . '</th>'; - echo '<th>' . _('Delivery Date') . '</th>'; - echo '<th>' . _('Quantity Received') . '</th></tr>'; + echo '<br /> + <table class="selection"> + <tr> + <th colspan="8"><font size="2" color="navy">' . _('GRNs for Purchase Order No') .' ' . $_POST['PONumber'] . '</th> + </tr> + <tr> + <th>' . _('Supplier') . '</th> + <th>' . _('PO Order line') . '</th> + <th>' . _('GRN Number') . '</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Item Description') . '</th> + <th>' . _('Delivery Date') . '</th> + <th>' . _('Quantity Received') . '</th> + </tr>'; + while ($myrow=DB_fetch_array($result)) { if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -81,15 +92,15 @@ echo '<tr class="OddTableRows">'; $k=1; } - echo '<td>' . $myrow['suppname'] . '</td>'; - echo '<td class="number">' . $myrow['podetailitem'] . '</td>'; - echo '<td class="number">' . $myrow['grnbatch'] . '</td>'; - echo '<td>' . $myrow['itemcode'] . '</td>'; - echo '<td>' . $myrow['itemdescription'] . '</td>'; - echo '<td>' . $myrow['deliverydate'] . '</td>'; - echo '<td class="number">' . locale_number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td>'; - echo '<td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint') . '</a></td>'; - echo '</tr>'; + echo '<td>' . $myrow['suppname'] . '</td> + <td class="number">' . $myrow['podetailitem'] . '</td> + <td class="number">' . $myrow['grnbatch'] . '</td> + <td>' . $myrow['itemcode'] . '</td> + <td>' . $myrow['itemdescription'] . '</td> + <td>' . $myrow['deliverydate'] . '</td> + <td class="number">' . locale_number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td> + <td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint') . '</a></td> + </tr>'; } echo '</table>'; } Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2011-10-06 09:16:44 UTC (rev 4714) +++ trunk/ReverseGRN.php 2011-10-08 09:44:56 UTC (rev 4715) @@ -12,8 +12,11 @@ if ((isset($_SESSION['SupplierID']) AND $_SESSION['SupplierID']!='') OR (!isset($_POST['SupplierID']) OR $_POST['SupplierID'])==''){ + $_POST['SupplierID']=$_SESSION['SupplierID']; + } + if (!isset($_POST['SupplierID']) OR $_POST['SupplierID']==""){ echo '<br />' . _('This page is expected to be called after a supplier has been selected'); echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SelectSupplier.php">'; @@ -25,8 +28,7 @@ $_POST['SuppName'] = $SuppRow[0]; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Sales') . - '" alt="" />' . ' ' . _('Reverse Goods Received from') . ' ' . $_POST['SuppName'] . '</p> '; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Sales') . '" alt="" />' . ' ' . _('Reverse Goods Received from') . ' ' . $_POST['SuppName'] . '</p> '; if (isset($_GET['GRNNo']) AND isset($_POST['SupplierID'])){ /* SQL to process the postings for the GRN reversal.. */ @@ -48,7 +50,7 @@ ON grns.podetailitem=purchorderdetails.podetailitem INNER JOIN purchorders ON purchorderdetails.orderno = purchorders.orderno - WHERE AND grnno='" . filter_number_format($_GET['GRNNo']) . "'"; + WHERE AND grnno='" . $_GET['GRNNo'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not get the details of the GRN selected for reversal because') . ' '; $DbgMsg = _('The following SQL to retrieve the GRN details was used') . ':'; @@ -59,7 +61,8 @@ $QtyToReverse = $GRN['qtyrecd'] - $GRN['quantityinv']; if ($QtyToReverse ==0){ - echo '<br /><br />' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); + echo '<br /> + <br />' . _('The GRN') . ' ' . $_GET['GRNNo'] . ' ' . _('has already been reversed or fully invoiced by the supplier - it cannot be reversed - stock quantities must be corrected by stock adjustments - the stock is paid for'); include ('includes/footer.inc'); exit; } @@ -118,7 +121,7 @@ /*Now the SQL to do the update to the PurchOrderDetails */ $SQL = "UPDATE purchorderdetails - SET quantityrecd = quantityrecd - '" . filter_number_format($QtyToReverse) . "', + SET quantityrecd = quantityrecd - '" . $QtyToReverse . "', completed=0 WHERE purchorderdetails.podetailitem = '" . $GRN['podetailitem'] . "'"; @@ -144,9 +147,9 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN record could not be deleted because'); $DbgMsg = _('The following SQL to delete the GRN record was used'); - $result = DB_query("DELETE FROM grns WHERE grnno='" . filter_number_format($_GET['GRNNo']) . "'",$db,$ErrMsg,$DbgMsg,true); + $result = DB_query("DELETE FROM grns WHERE grnno='" . $_GET['GRNNo'] . "'",$db,$ErrMsg,$DbgMsg,true); } else { - $SQL = "UPDATE grns SET qtyrecd = qtyrecd - " . filter_number_format($QtyToReverse) . " + $SQL = "UPDATE grns SET qtyrecd = qtyrecd - " . $QtyToReverse . " WHERE grns.grnno='" . $_GET['GRNNo'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GRN record could not be updated') . '. ' . _('This reversal of goods received has not been processed because'); @@ -163,18 +166,18 @@ inputdate, cost) VALUES ('" . $GRN['assetid'] . "', - 25, - '" . $_GET['GRNNo'] . "', - '" . $GRN['deliverydate'] . "', - '" . $PeriodNo . "', - '" . Date('Y-m-d') . "', - '" . filter_number_format((-$GRN['stdcostunit'] * $QtyToReverse)) . "')"; + '25', + '" . $_GET['GRNNo'] . "', + '" . $GRN['deliverydate'] . "', + '" . $PeriodNo . "', + '" . Date('Y-m-d') . "', + '" . (-$GRN['stdcostunit'] * $QtyToReverse) . "')"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset transaction could not be inserted because'); $DbgMsg = _('The following SQL to insert the fixed asset transaction record was used'); $Result = DB_query($SQL,$db,$ErrMsg, $DbgMsg, true); /*now reverse the cost put to fixedassets */ - $SQL = "UPDATE fixedassets SET cost = cost - " . filter_number_format($GRN['stdcostunit'] * $QtyToReverse) . " + $SQL = "UPDATE fixedassets SET cost = cost - " . $GRN['stdcostunit'] * $QtyToReverse . " WHERE assetid = '" . $GRN['assetid'] . "'"; $ErrMsg = _('CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset cost addition could not be reversed:'); $DbgMsg = _('The following SQL was used to attempt the reduce the cost of the asset was:'); @@ -237,9 +240,9 @@ '" . $GRN['deliverydate'] . "', '" . $PeriodNo . "', '" . _('Reversal') . ' - ' . $_POST['SupplierID'] . ' - ' . $GRN['orderno'] . "', - '" . filter_number_format(-$QtyToReverse) . "', + '" . -$QtyToReverse . "', '" . $GRN['stdcostunit'] . "', - '" . filter_number_format($QtyOnHandPrior - $QtyToReverse) . "' + '" . $QtyOnHandPrior - $QtyToReverse . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Stock movement records could not be inserted because'); @@ -260,6 +263,7 @@ '" . $GRN['itemcode'] . "', '" . $SerialStockMoves['serialno'] . "', '" . -$SerialStockMoves['moveqty'] . "')"; + $result = DB_query($SQL,$db,_('Could not insert the reversing stock movements for the batch/serial numbers'),_('The SQL used but failed was') . ':',true); $SQL = "UPDATE stockserialitems @@ -274,9 +278,14 @@ /* If GLLink_Stock then insert GLTrans to debit the GL Code and credit GRN Suspense account at standard cost*/ - if ($_SESSION['CompanyRecord']['gllink_stock']==1 AND $GRN['glcode'] !=0 AND $GRN['stdcostunit']!=0){ /*GLCode is set to 0 when the GLLink is not activated - this covers a situation where the GLLink is now active but it wasn't when this PO was entered */ - /*first the credit using the GLCode in the PO detail record entry*/ + if ($_SESSION['CompanyRecord']['gllink_stock']==1 + AND $GRN['glcode'] !=0 + AND $GRN['stdcostunit']!=0){ + + /*GLCode is set to 0 when the GLLink is not activated + this covers a situation where the GLLink is now active but it wasn't when this PO was entered + + First the credit using the GLCode in the PO detail record entry*/ $SQL = "INSERT INTO gltrans (type, typeno, @@ -292,7 +301,7 @@ '" . $PeriodNo . "', '" . $GRN['glcode'] . "', '" . _('GRN Reversal for PO') .": " . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . locale_number_format($GRN['stdcostunit'],$_SESSION['CompanyRecord']['decimalplaces']) . "', - '" . filter_number_format(-($GRN['stdcostunit'] * $QtyToReverse)) . "')"; + '" . -($GRN['stdcostunit'] * $QtyToReverse) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The purchase GL posting could not be inserted for the reversal of the received item because'); $DbgMsg = _('The following SQL to insert the purchase GLTrans record was used'); @@ -313,7 +322,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['grnact'] . "', '" . _('GRN Reversal PO') . ': ' . $GRN['orderno'] . " " . $_POST['SupplierID'] . " - " . $GRN['itemcode'] . "-" . $GRN['itemdescription'] . " x " . $QtyToReverse . " @ " . locale_number_format($GRN['stdcostunit'],$_SESSION['CompanyRecord']['decimalplaces']) . "', - '" . filter_number_format($GRN['stdcostunit'] * $QtyToReverse) . "' + '" . $GRN['stdcostunit'] * $QtyToRever... [truncated message content] |
From: <dai...@us...> - 2011-10-09 00:16:22
|
Revision: 4716 http://web-erp.svn.sourceforge.net/web-erp/?rev=4716&view=rev Author: daintree Date: 2011-10-09 00:16:14 +0000 (Sun, 09 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/PrintCustTrans.php trunk/SalesByTypePeriodInquiry.php trunk/SalesGraph.php trunk/SalesPeople.php trunk/SalesTopItemsInquiry.php trunk/SelectCompletedOrder.php trunk/SelectContract.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/includes/MiscFunctions.php Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/PrintCustTrans.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -832,6 +832,7 @@ stockmoves.qty as quantity, stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) AS fxnet, (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmoves.narrative, stockmaster.units, stockmaster.decimalplaces FROM stockmoves, Modified: trunk/SalesByTypePeriodInquiry.php =================================================================== --- trunk/SalesByTypePeriodInquiry.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesByTypePeriodInquiry.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -19,7 +19,7 @@ $_POST['DateRange']='ThisMonth'; } -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form name="Form1" action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding=2 class="selection"> @@ -34,7 +34,7 @@ if ($_POST['DateRange']=='Custom'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)"/></td> </tr> <tr> <td>' . _('This Week') . ':</td> @@ -42,7 +42,7 @@ if ($_POST['DateRange']=='ThisWeek'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('This Month') . ':</td> @@ -50,7 +50,7 @@ if ($_POST['DateRange']=='ThisMonth'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('This Quarter') . ':</td> @@ -58,9 +58,13 @@ if ($_POST['DateRange']=='ThisQuarter'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr>'; if ($_POST['DateRange']=='Custom'){ + if (!isset($_POST['ToDate'])){ + $_POST['FromDate'] = Date($_SESSION['DefaultDateFormat'],mktime(1,1,1,Date('m')-12,Date('d')+1,Date('Y'))); + $_POST['ToDate'] = Date($_SESSION['DefaultDateFormat']); + } echo '<tr> <td>' . _('Date From') . ':</td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> @@ -82,7 +86,7 @@ if ($_POST['DisplayData']=='Daily'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('Weekly') . ':</td> @@ -90,7 +94,7 @@ if ($_POST['DisplayData']=='Weekly'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('Monthly') . ':</td> @@ -98,24 +102,27 @@ if ($_POST['DisplayData']=='Monthly'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('Quarterly') . ':</td> <td><input type="radio" name="DisplayData" value="Quarterly" '; -if ($_POST['DisplayData']=='Monthly'){ +if ($_POST['DisplayData']=='Quarterly'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr>'; echo '</table> </td></tr> </table>'; -echo '<br /><div class="centre"><input tabindex=4 type=submit name="ShowSales" value="' . _('Show Sales') . '">'; -echo '</form></div>'; -echo '<br />'; +echo '<br /> + <div class="centre"> + <input tabindex="4" type="submit" name="ShowSales" value="' . _('Show Sales') . '" /> + </div> + </form> + <br />'; if ($_POST['DateRange']=='Custom' AND !isset($_POST['FromDate']) AND !isset($_POST['ToDate'])){ //Don't run the report until custom dates entered Modified: trunk/SalesGraph.php =================================================================== --- trunk/SalesGraph.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesGraph.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -176,20 +176,20 @@ $_POST['ValueTo']=''; } echo '<tr><td>' . _('Graph On:') . '</td><td> - <input type="RADIO" name="GraphOn" value="All" CHECKED>' . _('All') . '<br /> - <input type="RADIO" name="GraphOn" value="Customer">' . _('Customer') . '<br /> - <input type="RADIO" name="GraphOn" value="StockID">' . _('Item Code') . '</td></tr>'; + <input type="radio"" name="GraphOn" value="All" CHECKED>' . _('All') . '<br /> + <input type="radio"" name="GraphOn" value="Customer">' . _('Customer') . '<br /> + <input type="radio"" name="GraphOn" value="StockID">' . _('Item Code') . '</td></tr>'; echo '<tr><td>' . _('From:') . ' <input type=TEXT name="ValueFrom" value=' . $_POST['ValueFrom'] . '></td> <td>' . _('To:') . ' <input type=TEXT name="ValueTo" value=' . $_POST['ValueTo'] . '></td></tr>'; echo '<tr><td>' . _('Graph Value:') . '</td><td> - <input type="RADIO" name="GraphValue" value="Net" CHECKED>' . _('Net Sales Value') . '<br /> - <input type="RADIO" name="GraphValue" value="GP">' . _('Gross Profit') . '<br /> - <input type="RADIO" name="GraphValue" value="Quantity">' . _('Quantity') . '</td></tr>'; + <input type="radio"" name="GraphValue" value="Net" CHECKED>' . _('Net Sales Value') . '<br /> + <input type="radio"" name="GraphValue" value="GP">' . _('Gross Profit') . '<br /> + <input type="radio"" name="GraphValue" value="Quantity">' . _('Quantity') . '</td></tr>'; echo '</table>'; - echo '<br /><div class="centre"><input type="submit" Name="ShowGraph" Value="' . _('Show Sales Graph') .'"></div>'; + echo '<br /><div class="centre"><input type="submit" Name="ShowGraph" Value="' . _('Show Sales Graph') .'" /></div>'; include('includes/footer.inc'); } else { Modified: trunk/SalesPeople.php =================================================================== --- trunk/SalesPeople.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesPeople.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -57,9 +57,6 @@ OR !is_numeric(filter_number_format($_POST['CommissionRate2']))) { $InputError = 1; prnMsg(_('The commission rates must be a floating point number'),'error'); - echo '<br/>Commission Rate 1 = ' . filter_number_format($_POST['CommissionRate1']); - echo '<br/>Commission Rate 2 = ' . filter_number_format($_POST['CommissionRate2']); - echo '<br/>The locale decimal point is ' . $LocaleInfo['decimal_point']; } elseif (!is_numeric(filter_number_format($_POST['Breakpoint']))) { $InputError = 1; prnMsg(_('The breakpoint should be a floating point number'),'error'); @@ -88,10 +85,10 @@ /*SelectedSalesPerson 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*/ - $sql = "UPDATE salesman SET salesmanname='" . $_POST['SalesmanName'] . "', + $sql = "UPDATE salesman SET salesmanname='" . DB_escape_string($_POST['SalesmanName']) . "', commissionrate1='" . filter_number_format($_POST['CommissionRate1']) . "', - smantel='" . $_POST['SManTel'] . "', - smanfax='" . $_POST['SManFax'] . "', + smantel='" . DB_escape_string($_POST['SManTel']) . "', + smanfax='" . DB_escape_string($_POST['SManFax']) . "', breakpoint='" . filter_number_format($_POST['Breakpoint']) . "', commissionrate2='" . filter_number_format($_POST['CommissionRate2']) . "', current='" . $_POST['Current'] . "' @@ -110,7 +107,7 @@ smantel, smanfax, current) - VALUES ('" . $_POST['SalesmanCode'] . "', + VALUES ('" . DB_escape_string($_POST['SalesmanCode']) . "', '" . DB_escape_string($_POST['SalesmanName']) . "', '" . filter_number_format($_POST['CommissionRate1']) . "', '" . filter_number_format($_POST['CommissionRate2']) . "', @@ -275,9 +272,9 @@ $_POST['SalesmanName'] = $myrow['salesmanname']; $_POST['SManTel'] = $myrow['smantel']; $_POST['SManFax'] = $myrow['smanfax']; - $_POST['CommissionRate1'] = $myrow['commissionrate1']; - $_POST['Breakpoint'] = $myrow['breakpoint']; - $_POST['CommissionRate2'] = $myrow['commissionrate2']; + $_POST['CommissionRate1'] = locale_number_format($myrow['commissionrate1'],'Variable'); + $_POST['Breakpoint'] = locale_number_format($myrow['breakpoint'],'Variable'); + $_POST['CommissionRate2'] = locale_number_format($myrow['commissionrate2'],'Variable'); $_POST['Current'] = $myrow['current']; @@ -347,24 +344,24 @@ <td>' . _('Current?') . ':</td> <td><select name="Current">'; if ($_POST['Current']==1){ - echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option selected value="1">' . _('Yes') . '</option>'; } else { - echo '<option value=1>' . _('Yes') . '</option>'; + echo '<option value="1">' . _('Yes') . '</option>'; } if ($_POST['Current']==0){ - echo '<option selected value=0>' . _('No') . '</option>'; + echo '<option selected value="0">' . _('No') . '</option>'; } else { - echo '<option value=0>' . _('No') . '</option>'; + echo '<option value="0">' . _('No') . '</option>'; } echo '</select></td> - </tr>'; + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> + </div> + </form>'; - echo '</table>'; - - echo '<br /><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/SalesTopItemsInquiry.php =================================================================== --- trunk/SalesTopItemsInquiry.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesTopItemsInquiry.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -3,11 +3,11 @@ /* $Id: SalesTopItemsInquiry.php 4261 2010-12-22 15:56:50Z $*/ include('includes/session.inc'); -$title = _('Sales Category Report'); +$title = _('Top Sales Inquiry'); include('includes/header.inc'); include('includes/DefineCartClass.php'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Report') . '" alt="" />' . ' ' . _('Sales Category Report') . '</p>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Inquiry') . '" alt="" />' . ' ' . _('Top Sales Items Inquiry') . '</p>'; echo '<div class="page_help_text">' . _('Select the parameters for the report') . '</div><br />'; if (!isset($_POST['DateRange'])){ @@ -244,7 +244,7 @@ <td class="number">' . locale_number_format($SalesRow['salesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($SalesRow['netsalesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . $SalesRow['salesquantity'] . '</td> + <td class="number">' . locale_number_format($SalesRow['salesquantity'],'Variable') . '</td> </tr>'; $i++; @@ -266,7 +266,7 @@ <td class="number">' . locale_number_format($CumulativeTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($CumulativeTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($CumulativeTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . $CumulativeTotalQuantity . '</td> + <td class="number">' . locale_number_format($CumulativeTotalQuantity,'Variable') . '</td> </tr>'; echo '</table>'; Modified: trunk/SelectCompletedOrder.php =================================================================== --- trunk/SelectCompletedOrder.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SelectCompletedOrder.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -519,7 +519,7 @@ $_POST['OrderNumber']=''; } echo '<td>' . _('Order Number') . ':</td> - <td><input type="text" name="OrderNumber" maxlength =8 size=9 value ="' . $_POST['OrderNumber'] . '"></td> + <td><input type="text" name="OrderNumber" maxlength="8" size="9" value ="' . $_POST['OrderNumber'] . '" /></td> <td>' . _('for all orders placed after') . ': </td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="OrdersAfterDate" maxlength="10" size="11" value="' . $_POST['OrdersAfterDate'] . '" /></td> <td><input type="submit" name="SearchOrders" value="' . _('Search Orders') . '" /></td> @@ -542,7 +542,7 @@ echo '<div class="page_help_text"><font size=1>' . _('To search for sales orders for a specific part use the part selection facilities below') . ' </font></div>'; echo '<br /> <table class="selection">'; - echo '<tr><td><font size=1>' . _('Select a stock category') . ':</font>'; + echo '<tr><td><font size="1">' . _('Select a stock category') . ':</font>'; echo '<select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { @@ -553,19 +553,23 @@ } } - echo '</select>'; - echo '<td><font size=1>' . _('Enter text extracts in the description') . ':</font></td>'; - echo '<td><input type="text" name="Keywords" size="20" maxlength="25"></td></tr>'; - echo '<tr><td></td>'; - echo '<td><font size=3><b> ' ._('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . ':</font></td>'; - echo '<td><input type="text" name="StockCode" size="15" maxlength="18"></td>'; - echo '</tr>'; - echo '<tr><td colspan=4><div class="centre"><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '" />'; + echo '</select> + <td><font size="1">' . _('Enter text extracts in the description') . ':</font></td> + <td><input type="text" name="Keywords" size="20" maxlength="25" /></td> + </tr> + <tr> + <td></td> + <td><font size=3><b> ' ._('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . ':</font></td> + <td><input type="text" name="StockCode" size="15" maxlength="18" /></td> + </tr> + <tr><td colspan=4><div class="centre"><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '" />'; if (count($_SESSION['AllowedPageSecurityTokens'])>1){ echo '<input type="submit" name="ResetPart" value="' . _('Show All') . '" /></div>'; } - echo '</td></tr></table>'; + echo '</td> + </tr> + </table>'; } @@ -574,12 +578,14 @@ echo '<br /> <table cellpadding="2" colspan="7" class="selection">'; - $TableHeadings = '<tr><th>' . _('Code') . '</th> + $TableHeadings = '<tr> + <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('On Hand') . '</th> <th>' . _('Purchase Orders') . '</th> <th>' . _('Sales Orders') . '</th> - <th>' . _('Units') . '</th></tr>'; + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeadings; @@ -597,17 +603,17 @@ } printf('<td><font size=1><input type="submit" name="SelectedStockItem" value="%s" /></font></td> - <td><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td><font size=1>%s</font></td></tr>', - $myrow['stockid'], - $myrow['description'], - locale_number_format($myrow['qoh'],$myrow['decimalplaces']), - locale_number_format($myrow['qoo'],$myrow['decimalplaces']), - locale_number_format($myrow['qdem'],$myrow['decimalplaces']), - $myrow['units']); + <td><font size=1>%s</font></td> + <td class="number"><font size=1>%s</font></td> + <td class="number"><font size=1>%s</font></td> + <td class="number"><font size=1>%s</font></td> + <td><font size=1>%s</font></td></tr>', + $myrow['stockid'], + $myrow['description'], + locale_number_format($myrow['qoh'],$myrow['decimalplaces']), + locale_number_format($myrow['qoo'],$myrow['decimalplaces']), + locale_number_format($myrow['qdem'],$myrow['decimalplaces']), + $myrow['units']); //end of page full new headings if } @@ -631,7 +637,8 @@ <th>' . _('Order Date') . '</th> <th>' . _('Req Del Date') . '</th> <th>' . _('Delivery To') . '</th> - <th>' . _('Order Total') . '</th></tr>'; + <th>' . _('Order Total') . '</th> + </tr>'; echo $tableheader; @@ -654,23 +661,23 @@ $FormatedOrderValue = locale_number_format($myrow['ordervalue'],$myrow['currdecimalplaces']); printf('<td><a href="%s">%s</a></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class="number">%s</td> - </tr>', - $ViewPage, - $myrow['orderno'], - $myrow['name'], - $myrow['brname'], - $myrow['customerref'], - $FormatedOrderDate, - $FormatedDelDate, - $myrow['deliverto'], - $FormatedOrderValue); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + </tr>', + $ViewPage, + $myrow['orderno'], + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedOrderDate, + $FormatedDelDate, + $myrow['deliverto'], + $FormatedOrderValue); //end of page full new headings if } Modified: trunk/SelectContract.php =================================================================== --- trunk/SelectContract.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SelectContract.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -27,7 +27,7 @@ } else { if (isset($_POST['SelectedCustomer'])) { echo _('For customer') . ': ' . $_POST['SelectedCustomer'] . ' ' . _('and') . ' '; - echo '<input type="hidden" name="SelectedCustomer" value="' . $_POST['SelectedCustomer'] . '">'; + echo '<input type="hidden" name="SelectedCustomer" value="' . $_POST['SelectedCustomer'] . '" />'; } } @@ -145,14 +145,14 @@ echo '<table cellpadding="2" colspan="7" width="98%" class="selection">'; $TableHeader = '<tr> - <th>' . _('Modify') . '</th> - <th>' . _('Order') . '</th> - <th>' . _('Issue To WO') . '</th> - <th>' . _('Costing') . '</th> - <th>' . _('Contract Ref') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Required Date') . '</th> + <th>' . _('Modify') . '</th> + <th>' . _('Order') . '</th> + <th>' . _('Issue To WO') . '</th> + <th>' . _('Costing') . '</th> + <th>' . _('Contract Ref') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Required Date') . '</th> </tr>'; echo $TableHeader; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SelectCreditItems.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -541,7 +541,7 @@ $Narrative = $_POST['Narrative_' . $LineItem->LineNumber]; if (isset($_POST['Price_' . $LineItem->LineNumber])){ - if (isset($_POST['Gross']) AND $_POST['Gross']==True){ + if (isset($_POST['Gross']) AND $_POST['Gross']==true){ $TaxTotalPercent =0; foreach ($LineItem->Taxes AS $Tax) { if ($Tax->TaxOnTax ==1){ @@ -550,7 +550,7 @@ $TaxTotalPercent += $Tax->TaxRate; } } - $Price = round($_POST['Price_' . $LineItem->LineNumber]/($TaxTotalPercent + 1),$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces); + $Price = round(filter_number_format($_POST['Price_' . $LineItem->LineNumber])/($TaxTotalPercent + 1),$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces); } else { $Price = filter_number_format($_POST['Price_' . $LineItem->LineNumber]); } @@ -708,16 +708,16 @@ <td>' . $LineItem->ItemDescription . '</td>'; if ($LineItem->Controlled==0){ - echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength="6" size="6" value=' . locale_number_format($LineItem->Quantity,$LineItem->DecimalPlaces) . '></td>'; + echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength="6" size="6" value=' . locale_number_format(round($LineItem->Quantity,$LineItem->DecimalPlaces),$LineItem->DecimalPlaces) . '></td>'; } else { echo '<td class="number"><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LineItem->LineNumber . '">' . locale_number_format($LineItem->Quantity,$LineItem->DecimalPlaces) . '</a> - <input type=hidden name="Quantity_' . $LineItem->LineNumber . '" value=' . round($LineItem->Quantity,$LineItem->DecimalPlaces) . '></td>'; + <input type=hidden name="Quantity_' . $LineItem->LineNumber . '" value=' . locale_number_format(round($LineItem->Quantity,$LineItem->DecimalPlaces),$LineItem->DecimalPlaces) . '></td>'; } echo '<td>' . $LineItem->Units . '</td> <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 value=' . locale_number_format($LineItem->Price,$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '></td> <td><input type="CheckBox" name="Gross" value=False></td> - <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 value=' . ($LineItem->DiscountPercent * 100) . '>%</td> + <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 value=' . locale_number_format(($LineItem->DiscountPercent * 100),'Variable') . '>%</td> <td class="number">' . $DisplayLineTotal . '</td>'; @@ -741,7 +741,7 @@ if ($i>0){ echo '<br />'; } - echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . locale_number_format($Tax->TaxRate*100,$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '">'; + echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size="4" value="' . locale_number_format($Tax->TaxRate*100,'Variable') . '">'; $i++; if ($Tax->TaxOnTax ==1){ $TaxTotals[$Tax->TaxAuthID] += ($Tax->TaxRate * ($LineTotal + $TaxLineTotal)); @@ -765,7 +765,7 @@ </tr>'; echo $RowStarter; - echo '<td colspan=11><textarea name="Narrative_' . $LineItem->LineNumber . '" cols=100% rows=1>' . $LineItem->Narrative . '</textarea><br /></td></tr>'; + echo '<td colspan=11><textarea name="Narrative_' . $LineItem->LineNumber . '" cols="100%" rows="1">' . $LineItem->Narrative . '</textarea><br /></td></tr>'; $_SESSION['CreditItems'.$identifier]->total += $LineTotal; @@ -780,7 +780,6 @@ echo '<tr> <td colspan="5"></td>'; - echo '<td colspan="2" class="number">'. _('Credit Freight').'</td> <td><input type="text" class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . locale_number_format($_SESSION['CreditItems'.$identifier]->FreightCost,$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '" /></td>'; @@ -805,7 +804,7 @@ echo '<br />'; } - echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength="4" size="4" value="' . locale_number_format(($FreightTaxLine->TaxRate * 100),$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '" />'; + echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength="4" size="4" value="' . locale_number_format(($FreightTaxLine->TaxRate * 100),'Variable') . '" />'; if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems'.$identifier]->FreightCost + $FreightTaxTotal)); @@ -933,7 +932,7 @@ /* Now show the stock item selection search stuff below */ - if (isset($_POST['PartSearch']) AND $_POST['PartSearch']!="" AND !isset($_POST['ProcessCredit'])){ + if (isset($_POST['PartSearch']) AND $_POST['PartSearch']!='' AND !isset($_POST['ProcessCredit'])){ echo '<input type="hidden" name="PartSearch" value="' . _('Yes Please') . '" />'; @@ -950,7 +949,7 @@ <tr> <td>' . _('Select a stock category') . ': <select name="StockCat">'; - echo '<option selected value="All">' . _('All'); + echo '<option selected value="All">' . _('All') . '</option>'; while ($myrow1 = DB_fetch_array($result1)) { if (isset($_POST['StockCat']) and $_POST['StockCat']==$myrow1['categoryid']){ echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; @@ -970,7 +969,7 @@ echo '<td><input type="text" name="Keywords" size="20" maxlength="25" value="' . $_POST['Keywords'] . '" /></td></tr>'; echo '<tr><td></td>'; echo '<td><font size="3"><b>' ._('OR') . '</b></font> ' . _('Enter extract of the Stock Code') . ': </td>'; - echo '<td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '"></td>'; + echo '<td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '" /></td>'; echo '</tr>'; echo '</table> <br /> @@ -1121,7 +1120,7 @@ '" . -$TaxTotal . "', '" . -$_SESSION['CreditItems'.$identifier]->FreightCost . "', '" . $_SESSION['CurrencyRate'] . "', - '" . $_POST['CreditText'] . "' + '" . DB_escape_string($_POST['CreditText']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The customer credit note transaction could not be added to the database because'); @@ -1139,7 +1138,7 @@ taxamount) VALUES ('" . $CreditTransID . "', '" . $TaxAuthID . "', - '" . -($TaxAmount)/$_SESSION['CurrencyRate'] . "')"; + '" . -$TaxAmount/$_SESSION['CurrencyRate'] . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); @@ -1316,10 +1315,10 @@ /*1st off check if StockSerialItems already exists */ $SQL = "SELECT COUNT(*) - FROM stockserialitems - WHERE stockid='" . $CreditLine->StockID . "' - AND loccode='" . $_SESSION['CreditItems'.$identifier]->Location . "' - AND serialno='" . $Item->BundleRef . "'"; + FROM stockserialitems + WHERE stockid='" . $CreditLine->StockID . "' + AND loccode='" . $_SESSION['CreditItems'.$identifier]->Location . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The existence of the serial stock item record could not be determined because'); $DbgMsg = _('The following SQL to find out if the serial stock item record existed already was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1362,8 +1361,7 @@ '" . $StkMoveNo . "', '" . $CreditLine->StockID . "', '" . $Item->BundleRef . "', - '" . $Item->BundleQty . "' - )"; + '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1381,7 +1379,7 @@ if ($CreditLine->MBflag=='B' OR $CreditLine->MBflag=='M') { $SQL = "UPDATE locstock - SET locstock.quantity = locstock.quantity + " . filter_number_format($CreditLine->Quantity) . " + SET locstock.quantity = locstock.quantity + " . $CreditLine->Quantity . " WHERE locstock.stockid = '" . $CreditLine->StockID . "' AND locstock.loccode = '" . $_SESSION['CreditItems'.$identifier]->Location . "'"; @@ -1400,11 +1398,11 @@ $SQL = "SELECT bom.component, bom.quantity, stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standard - FROM bom INNER JOIN stockmaster - ON bom.component=stockmaster.stockid - WHERE bom.parent='" . $CreditLine->StockID . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + FROM bom INNER JOIN stockmaster + ON bom.component=stockmaster.stockid + WHERE bom.parent='" . $CreditLine->StockID . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve assembly components from the database for') . ' ' . $CreditLine->StockID . ' ' . _('because'); $DbgMsg = _('The SQL that failed was'); @@ -1453,10 +1451,10 @@ '" . $_SESSION['CreditItems'.$identifier]->Branch . "', '" . $PeriodNo . "', '" . _('Assembly') .': ' . $CreditLine->StockID . "', - '" . filter_number_format($AssParts['quantity'] * $CreditLine->Quantity) . "', + '" . $AssParts['quantity'] * $CreditLine->Quantity . "', '" . $AssParts['standard'] . "', 0, - '" . filter_number_format($QtyOnHandPrior + ($AssParts['quantity'] * $CreditLine->Quantity)) . "' + '" . $QtyOnHandPrior + ($AssParts['quantity'] * $CreditLine->Quantity) . "' )"; $Er... [truncated message content] |
From: <dai...@us...> - 2011-10-09 00:16:22
|
Revision: 4716 http://web-erp.svn.sourceforge.net/web-erp/?rev=4716&view=rev Author: daintree Date: 2011-10-09 00:16:14 +0000 (Sun, 09 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/PrintCustTrans.php trunk/SalesByTypePeriodInquiry.php trunk/SalesGraph.php trunk/SalesPeople.php trunk/SalesTopItemsInquiry.php trunk/SelectCompletedOrder.php trunk/SelectContract.php trunk/SelectCreditItems.php trunk/SelectCustomer.php trunk/includes/MiscFunctions.php Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/PrintCustTrans.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -832,6 +832,7 @@ stockmoves.qty as quantity, stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * " . $ExchRate . " * stockmoves.qty) AS fxnet, (stockmoves.price * " . $ExchRate . ") AS fxprice, + stockmoves.narrative, stockmaster.units, stockmaster.decimalplaces FROM stockmoves, Modified: trunk/SalesByTypePeriodInquiry.php =================================================================== --- trunk/SalesByTypePeriodInquiry.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesByTypePeriodInquiry.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -19,7 +19,7 @@ $_POST['DateRange']='ThisMonth'; } -echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; +echo '<form name="Form1" action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table cellpadding=2 class="selection"> @@ -34,7 +34,7 @@ if ($_POST['DateRange']=='Custom'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)"/></td> </tr> <tr> <td>' . _('This Week') . ':</td> @@ -42,7 +42,7 @@ if ($_POST['DateRange']=='ThisWeek'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('This Month') . ':</td> @@ -50,7 +50,7 @@ if ($_POST['DateRange']=='ThisMonth'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('This Quarter') . ':</td> @@ -58,9 +58,13 @@ if ($_POST['DateRange']=='ThisQuarter'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr>'; if ($_POST['DateRange']=='Custom'){ + if (!isset($_POST['ToDate'])){ + $_POST['FromDate'] = Date($_SESSION['DefaultDateFormat'],mktime(1,1,1,Date('m')-12,Date('d')+1,Date('Y'))); + $_POST['ToDate'] = Date($_SESSION['DefaultDateFormat']); + } echo '<tr> <td>' . _('Date From') . ':</td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength="10" size="11" value="' . $_POST['FromDate'] . '" /></td> @@ -82,7 +86,7 @@ if ($_POST['DisplayData']=='Daily'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('Weekly') . ':</td> @@ -90,7 +94,7 @@ if ($_POST['DisplayData']=='Weekly'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('Monthly') . ':</td> @@ -98,24 +102,27 @@ if ($_POST['DisplayData']=='Monthly'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr> <tr> <td>' . _('Quarterly') . ':</td> <td><input type="radio" name="DisplayData" value="Quarterly" '; -if ($_POST['DisplayData']=='Monthly'){ +if ($_POST['DisplayData']=='Quarterly'){ echo 'checked'; } -echo '></td> +echo ' onChange="ReloadForm(Form1.ShowSales)" /></td> </tr>'; echo '</table> </td></tr> </table>'; -echo '<br /><div class="centre"><input tabindex=4 type=submit name="ShowSales" value="' . _('Show Sales') . '">'; -echo '</form></div>'; -echo '<br />'; +echo '<br /> + <div class="centre"> + <input tabindex="4" type="submit" name="ShowSales" value="' . _('Show Sales') . '" /> + </div> + </form> + <br />'; if ($_POST['DateRange']=='Custom' AND !isset($_POST['FromDate']) AND !isset($_POST['ToDate'])){ //Don't run the report until custom dates entered Modified: trunk/SalesGraph.php =================================================================== --- trunk/SalesGraph.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesGraph.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -176,20 +176,20 @@ $_POST['ValueTo']=''; } echo '<tr><td>' . _('Graph On:') . '</td><td> - <input type="RADIO" name="GraphOn" value="All" CHECKED>' . _('All') . '<br /> - <input type="RADIO" name="GraphOn" value="Customer">' . _('Customer') . '<br /> - <input type="RADIO" name="GraphOn" value="StockID">' . _('Item Code') . '</td></tr>'; + <input type="radio"" name="GraphOn" value="All" CHECKED>' . _('All') . '<br /> + <input type="radio"" name="GraphOn" value="Customer">' . _('Customer') . '<br /> + <input type="radio"" name="GraphOn" value="StockID">' . _('Item Code') . '</td></tr>'; echo '<tr><td>' . _('From:') . ' <input type=TEXT name="ValueFrom" value=' . $_POST['ValueFrom'] . '></td> <td>' . _('To:') . ' <input type=TEXT name="ValueTo" value=' . $_POST['ValueTo'] . '></td></tr>'; echo '<tr><td>' . _('Graph Value:') . '</td><td> - <input type="RADIO" name="GraphValue" value="Net" CHECKED>' . _('Net Sales Value') . '<br /> - <input type="RADIO" name="GraphValue" value="GP">' . _('Gross Profit') . '<br /> - <input type="RADIO" name="GraphValue" value="Quantity">' . _('Quantity') . '</td></tr>'; + <input type="radio"" name="GraphValue" value="Net" CHECKED>' . _('Net Sales Value') . '<br /> + <input type="radio"" name="GraphValue" value="GP">' . _('Gross Profit') . '<br /> + <input type="radio"" name="GraphValue" value="Quantity">' . _('Quantity') . '</td></tr>'; echo '</table>'; - echo '<br /><div class="centre"><input type="submit" Name="ShowGraph" Value="' . _('Show Sales Graph') .'"></div>'; + echo '<br /><div class="centre"><input type="submit" Name="ShowGraph" Value="' . _('Show Sales Graph') .'" /></div>'; include('includes/footer.inc'); } else { Modified: trunk/SalesPeople.php =================================================================== --- trunk/SalesPeople.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesPeople.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -57,9 +57,6 @@ OR !is_numeric(filter_number_format($_POST['CommissionRate2']))) { $InputError = 1; prnMsg(_('The commission rates must be a floating point number'),'error'); - echo '<br/>Commission Rate 1 = ' . filter_number_format($_POST['CommissionRate1']); - echo '<br/>Commission Rate 2 = ' . filter_number_format($_POST['CommissionRate2']); - echo '<br/>The locale decimal point is ' . $LocaleInfo['decimal_point']; } elseif (!is_numeric(filter_number_format($_POST['Breakpoint']))) { $InputError = 1; prnMsg(_('The breakpoint should be a floating point number'),'error'); @@ -88,10 +85,10 @@ /*SelectedSalesPerson 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*/ - $sql = "UPDATE salesman SET salesmanname='" . $_POST['SalesmanName'] . "', + $sql = "UPDATE salesman SET salesmanname='" . DB_escape_string($_POST['SalesmanName']) . "', commissionrate1='" . filter_number_format($_POST['CommissionRate1']) . "', - smantel='" . $_POST['SManTel'] . "', - smanfax='" . $_POST['SManFax'] . "', + smantel='" . DB_escape_string($_POST['SManTel']) . "', + smanfax='" . DB_escape_string($_POST['SManFax']) . "', breakpoint='" . filter_number_format($_POST['Breakpoint']) . "', commissionrate2='" . filter_number_format($_POST['CommissionRate2']) . "', current='" . $_POST['Current'] . "' @@ -110,7 +107,7 @@ smantel, smanfax, current) - VALUES ('" . $_POST['SalesmanCode'] . "', + VALUES ('" . DB_escape_string($_POST['SalesmanCode']) . "', '" . DB_escape_string($_POST['SalesmanName']) . "', '" . filter_number_format($_POST['CommissionRate1']) . "', '" . filter_number_format($_POST['CommissionRate2']) . "', @@ -275,9 +272,9 @@ $_POST['SalesmanName'] = $myrow['salesmanname']; $_POST['SManTel'] = $myrow['smantel']; $_POST['SManFax'] = $myrow['smanfax']; - $_POST['CommissionRate1'] = $myrow['commissionrate1']; - $_POST['Breakpoint'] = $myrow['breakpoint']; - $_POST['CommissionRate2'] = $myrow['commissionrate2']; + $_POST['CommissionRate1'] = locale_number_format($myrow['commissionrate1'],'Variable'); + $_POST['Breakpoint'] = locale_number_format($myrow['breakpoint'],'Variable'); + $_POST['CommissionRate2'] = locale_number_format($myrow['commissionrate2'],'Variable'); $_POST['Current'] = $myrow['current']; @@ -347,24 +344,24 @@ <td>' . _('Current?') . ':</td> <td><select name="Current">'; if ($_POST['Current']==1){ - echo '<option selected value=1>' . _('Yes') . '</option>'; + echo '<option selected value="1">' . _('Yes') . '</option>'; } else { - echo '<option value=1>' . _('Yes') . '</option>'; + echo '<option value="1">' . _('Yes') . '</option>'; } if ($_POST['Current']==0){ - echo '<option selected value=0>' . _('No') . '</option>'; + echo '<option selected value="0">' . _('No') . '</option>'; } else { - echo '<option value=0>' . _('No') . '</option>'; + echo '<option value="0">' . _('No') . '</option>'; } echo '</select></td> - </tr>'; + </tr> + </table> + <br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> + </div> + </form>'; - echo '</table>'; - - echo '<br /><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/SalesTopItemsInquiry.php =================================================================== --- trunk/SalesTopItemsInquiry.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SalesTopItemsInquiry.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -3,11 +3,11 @@ /* $Id: SalesTopItemsInquiry.php 4261 2010-12-22 15:56:50Z $*/ include('includes/session.inc'); -$title = _('Sales Category Report'); +$title = _('Top Sales Inquiry'); include('includes/header.inc'); include('includes/DefineCartClass.php'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Report') . '" alt="" />' . ' ' . _('Sales Category Report') . '</p>'; +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Sales Inquiry') . '" alt="" />' . ' ' . _('Top Sales Items Inquiry') . '</p>'; echo '<div class="page_help_text">' . _('Select the parameters for the report') . '</div><br />'; if (!isset($_POST['DateRange'])){ @@ -244,7 +244,7 @@ <td class="number">' . locale_number_format($SalesRow['salesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($SalesRow['returnvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($SalesRow['netsalesvalue'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . $SalesRow['salesquantity'] . '</td> + <td class="number">' . locale_number_format($SalesRow['salesquantity'],'Variable') . '</td> </tr>'; $i++; @@ -266,7 +266,7 @@ <td class="number">' . locale_number_format($CumulativeTotalSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($CumulativeTotalRefunds,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($CumulativeTotalNetSales,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . $CumulativeTotalQuantity . '</td> + <td class="number">' . locale_number_format($CumulativeTotalQuantity,'Variable') . '</td> </tr>'; echo '</table>'; Modified: trunk/SelectCompletedOrder.php =================================================================== --- trunk/SelectCompletedOrder.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SelectCompletedOrder.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -519,7 +519,7 @@ $_POST['OrderNumber']=''; } echo '<td>' . _('Order Number') . ':</td> - <td><input type="text" name="OrderNumber" maxlength =8 size=9 value ="' . $_POST['OrderNumber'] . '"></td> + <td><input type="text" name="OrderNumber" maxlength="8" size="9" value ="' . $_POST['OrderNumber'] . '" /></td> <td>' . _('for all orders placed after') . ': </td> <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] .'" name="OrdersAfterDate" maxlength="10" size="11" value="' . $_POST['OrdersAfterDate'] . '" /></td> <td><input type="submit" name="SearchOrders" value="' . _('Search Orders') . '" /></td> @@ -542,7 +542,7 @@ echo '<div class="page_help_text"><font size=1>' . _('To search for sales orders for a specific part use the part selection facilities below') . ' </font></div>'; echo '<br /> <table class="selection">'; - echo '<tr><td><font size=1>' . _('Select a stock category') . ':</font>'; + echo '<tr><td><font size="1">' . _('Select a stock category') . ':</font>'; echo '<select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { @@ -553,19 +553,23 @@ } } - echo '</select>'; - echo '<td><font size=1>' . _('Enter text extracts in the description') . ':</font></td>'; - echo '<td><input type="text" name="Keywords" size="20" maxlength="25"></td></tr>'; - echo '<tr><td></td>'; - echo '<td><font size=3><b> ' ._('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . ':</font></td>'; - echo '<td><input type="text" name="StockCode" size="15" maxlength="18"></td>'; - echo '</tr>'; - echo '<tr><td colspan=4><div class="centre"><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '" />'; + echo '</select> + <td><font size="1">' . _('Enter text extracts in the description') . ':</font></td> + <td><input type="text" name="Keywords" size="20" maxlength="25" /></td> + </tr> + <tr> + <td></td> + <td><font size=3><b> ' ._('OR') . ' </b></font><font size=1>' . _('Enter extract of the Stock Code') . ':</font></td> + <td><input type="text" name="StockCode" size="15" maxlength="18" /></td> + </tr> + <tr><td colspan=4><div class="centre"><input type="submit" name="SearchParts" value="' . _('Search Parts Now') . '" />'; if (count($_SESSION['AllowedPageSecurityTokens'])>1){ echo '<input type="submit" name="ResetPart" value="' . _('Show All') . '" /></div>'; } - echo '</td></tr></table>'; + echo '</td> + </tr> + </table>'; } @@ -574,12 +578,14 @@ echo '<br /> <table cellpadding="2" colspan="7" class="selection">'; - $TableHeadings = '<tr><th>' . _('Code') . '</th> + $TableHeadings = '<tr> + <th>' . _('Code') . '</th> <th>' . _('Description') . '</th> <th>' . _('On Hand') . '</th> <th>' . _('Purchase Orders') . '</th> <th>' . _('Sales Orders') . '</th> - <th>' . _('Units') . '</th></tr>'; + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeadings; @@ -597,17 +603,17 @@ } printf('<td><font size=1><input type="submit" name="SelectedStockItem" value="%s" /></font></td> - <td><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td class="number"><font size=1>%s</font></td> - <td><font size=1>%s</font></td></tr>', - $myrow['stockid'], - $myrow['description'], - locale_number_format($myrow['qoh'],$myrow['decimalplaces']), - locale_number_format($myrow['qoo'],$myrow['decimalplaces']), - locale_number_format($myrow['qdem'],$myrow['decimalplaces']), - $myrow['units']); + <td><font size=1>%s</font></td> + <td class="number"><font size=1>%s</font></td> + <td class="number"><font size=1>%s</font></td> + <td class="number"><font size=1>%s</font></td> + <td><font size=1>%s</font></td></tr>', + $myrow['stockid'], + $myrow['description'], + locale_number_format($myrow['qoh'],$myrow['decimalplaces']), + locale_number_format($myrow['qoo'],$myrow['decimalplaces']), + locale_number_format($myrow['qdem'],$myrow['decimalplaces']), + $myrow['units']); //end of page full new headings if } @@ -631,7 +637,8 @@ <th>' . _('Order Date') . '</th> <th>' . _('Req Del Date') . '</th> <th>' . _('Delivery To') . '</th> - <th>' . _('Order Total') . '</th></tr>'; + <th>' . _('Order Total') . '</th> + </tr>'; echo $tableheader; @@ -654,23 +661,23 @@ $FormatedOrderValue = locale_number_format($myrow['ordervalue'],$myrow['currdecimalplaces']); printf('<td><a href="%s">%s</a></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class="number">%s</td> - </tr>', - $ViewPage, - $myrow['orderno'], - $myrow['name'], - $myrow['brname'], - $myrow['customerref'], - $FormatedOrderDate, - $FormatedDelDate, - $myrow['deliverto'], - $FormatedOrderValue); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + </tr>', + $ViewPage, + $myrow['orderno'], + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedOrderDate, + $FormatedDelDate, + $myrow['deliverto'], + $FormatedOrderValue); //end of page full new headings if } Modified: trunk/SelectContract.php =================================================================== --- trunk/SelectContract.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SelectContract.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -27,7 +27,7 @@ } else { if (isset($_POST['SelectedCustomer'])) { echo _('For customer') . ': ' . $_POST['SelectedCustomer'] . ' ' . _('and') . ' '; - echo '<input type="hidden" name="SelectedCustomer" value="' . $_POST['SelectedCustomer'] . '">'; + echo '<input type="hidden" name="SelectedCustomer" value="' . $_POST['SelectedCustomer'] . '" />'; } } @@ -145,14 +145,14 @@ echo '<table cellpadding="2" colspan="7" width="98%" class="selection">'; $TableHeader = '<tr> - <th>' . _('Modify') . '</th> - <th>' . _('Order') . '</th> - <th>' . _('Issue To WO') . '</th> - <th>' . _('Costing') . '</th> - <th>' . _('Contract Ref') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Required Date') . '</th> + <th>' . _('Modify') . '</th> + <th>' . _('Order') . '</th> + <th>' . _('Issue To WO') . '</th> + <th>' . _('Costing') . '</th> + <th>' . _('Contract Ref') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Required Date') . '</th> </tr>'; echo $TableHeader; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-10-08 09:44:56 UTC (rev 4715) +++ trunk/SelectCreditItems.php 2011-10-09 00:16:14 UTC (rev 4716) @@ -541,7 +541,7 @@ $Narrative = $_POST['Narrative_' . $LineItem->LineNumber]; if (isset($_POST['Price_' . $LineItem->LineNumber])){ - if (isset($_POST['Gross']) AND $_POST['Gross']==True){ + if (isset($_POST['Gross']) AND $_POST['Gross']==true){ $TaxTotalPercent =0; foreach ($LineItem->Taxes AS $Tax) { if ($Tax->TaxOnTax ==1){ @@ -550,7 +550,7 @@ $TaxTotalPercent += $Tax->TaxRate; } } - $Price = round($_POST['Price_' . $LineItem->LineNumber]/($TaxTotalPercent + 1),$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces); + $Price = round(filter_number_format($_POST['Price_' . $LineItem->LineNumber])/($TaxTotalPercent + 1),$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces); } else { $Price = filter_number_format($_POST['Price_' . $LineItem->LineNumber]); } @@ -708,16 +708,16 @@ <td>' . $LineItem->ItemDescription . '</td>'; if ($LineItem->Controlled==0){ - echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength="6" size="6" value=' . locale_number_format($LineItem->Quantity,$LineItem->DecimalPlaces) . '></td>'; + echo '<td><input type="text" class="number" name="Quantity_' . $LineItem->LineNumber . '" maxlength="6" size="6" value=' . locale_number_format(round($LineItem->Quantity,$LineItem->DecimalPlaces),$LineItem->DecimalPlaces) . '></td>'; } else { echo '<td class="number"><a href="' . $rootpath . '/CreditItemsControlled.php?LineNo=' . $LineItem->LineNumber . '">' . locale_number_format($LineItem->Quantity,$LineItem->DecimalPlaces) . '</a> - <input type=hidden name="Quantity_' . $LineItem->LineNumber . '" value=' . round($LineItem->Quantity,$LineItem->DecimalPlaces) . '></td>'; + <input type=hidden name="Quantity_' . $LineItem->LineNumber . '" value=' . locale_number_format(round($LineItem->Quantity,$LineItem->DecimalPlaces),$LineItem->DecimalPlaces) . '></td>'; } echo '<td>' . $LineItem->Units . '</td> <td><input type="text" class="number" name="Price_' . $LineItem->LineNumber . '" size=10 maxlength=12 value=' . locale_number_format($LineItem->Price,$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '></td> <td><input type="CheckBox" name="Gross" value=False></td> - <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 value=' . ($LineItem->DiscountPercent * 100) . '>%</td> + <td><input type="text" class="number" name="Discount_' . $LineItem->LineNumber . '" size=3 maxlength=3 value=' . locale_number_format(($LineItem->DiscountPercent * 100),'Variable') . '>%</td> <td class="number">' . $DisplayLineTotal . '</td>'; @@ -741,7 +741,7 @@ if ($i>0){ echo '<br />'; } - echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size=4 value="' . locale_number_format($Tax->TaxRate*100,$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '">'; + echo '<input type="text" class="number" name="' . $LineItem->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" maxlength=4 size="4" value="' . locale_number_format($Tax->TaxRate*100,'Variable') . '">'; $i++; if ($Tax->TaxOnTax ==1){ $TaxTotals[$Tax->TaxAuthID] += ($Tax->TaxRate * ($LineTotal + $TaxLineTotal)); @@ -765,7 +765,7 @@ </tr>'; echo $RowStarter; - echo '<td colspan=11><textarea name="Narrative_' . $LineItem->LineNumber . '" cols=100% rows=1>' . $LineItem->Narrative . '</textarea><br /></td></tr>'; + echo '<td colspan=11><textarea name="Narrative_' . $LineItem->LineNumber . '" cols="100%" rows="1">' . $LineItem->Narrative . '</textarea><br /></td></tr>'; $_SESSION['CreditItems'.$identifier]->total += $LineTotal; @@ -780,7 +780,6 @@ echo '<tr> <td colspan="5"></td>'; - echo '<td colspan="2" class="number">'. _('Credit Freight').'</td> <td><input type="text" class="number" size=6 maxlength=6 name="ChargeFreightCost" value="' . locale_number_format($_SESSION['CreditItems'.$identifier]->FreightCost,$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '" /></td>'; @@ -805,7 +804,7 @@ echo '<br />'; } - echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength="4" size="4" value="' . locale_number_format(($FreightTaxLine->TaxRate * 100),$_SESSION['CreditItems'.$identifier]->CurrDecimalPlaces) . '" />'; + echo '<input type="text" class="number" name=FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . ' maxlength="4" size="4" value="' . locale_number_format(($FreightTaxLine->TaxRate * 100),'Variable') . '" />'; if ($FreightTaxLine->TaxOnTax ==1){ $TaxTotals[$FreightTaxLine->TaxAuthID] += ($FreightTaxLine->TaxRate * ($_SESSION['CreditItems'.$identifier]->FreightCost + $FreightTaxTotal)); @@ -933,7 +932,7 @@ /* Now show the stock item selection search stuff below */ - if (isset($_POST['PartSearch']) AND $_POST['PartSearch']!="" AND !isset($_POST['ProcessCredit'])){ + if (isset($_POST['PartSearch']) AND $_POST['PartSearch']!='' AND !isset($_POST['ProcessCredit'])){ echo '<input type="hidden" name="PartSearch" value="' . _('Yes Please') . '" />'; @@ -950,7 +949,7 @@ <tr> <td>' . _('Select a stock category') . ': <select name="StockCat">'; - echo '<option selected value="All">' . _('All'); + echo '<option selected value="All">' . _('All') . '</option>'; while ($myrow1 = DB_fetch_array($result1)) { if (isset($_POST['StockCat']) and $_POST['StockCat']==$myrow1['categoryid']){ echo '<option selected value=' . $myrow1['categoryid'] . '>' . $myrow1['categorydescription'] . '</option>'; @@ -970,7 +969,7 @@ echo '<td><input type="text" name="Keywords" size="20" maxlength="25" value="' . $_POST['Keywords'] . '" /></td></tr>'; echo '<tr><td></td>'; echo '<td><font size="3"><b>' ._('OR') . '</b></font> ' . _('Enter extract of the Stock Code') . ': </td>'; - echo '<td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '"></td>'; + echo '<td><input type="text" name="StockCode" size="15" maxlength="18" value="' . $_POST['StockCode'] . '" /></td>'; echo '</tr>'; echo '</table> <br /> @@ -1121,7 +1120,7 @@ '" . -$TaxTotal . "', '" . -$_SESSION['CreditItems'.$identifier]->FreightCost . "', '" . $_SESSION['CurrencyRate'] . "', - '" . $_POST['CreditText'] . "' + '" . DB_escape_string($_POST['CreditText']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The customer credit note transaction could not be added to the database because'); @@ -1139,7 +1138,7 @@ taxamount) VALUES ('" . $CreditTransID . "', '" . $TaxAuthID . "', - '" . -($TaxAmount)/$_SESSION['CurrencyRate'] . "')"; + '" . -$TaxAmount/$_SESSION['CurrencyRate'] . "')"; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); @@ -1316,10 +1315,10 @@ /*1st off check if StockSerialItems already exists */ $SQL = "SELECT COUNT(*) - FROM stockserialitems - WHERE stockid='" . $CreditLine->StockID . "' - AND loccode='" . $_SESSION['CreditItems'.$identifier]->Location . "' - AND serialno='" . $Item->BundleRef . "'"; + FROM stockserialitems + WHERE stockid='" . $CreditLine->StockID . "' + AND loccode='" . $_SESSION['CreditItems'.$identifier]->Location . "' + AND serialno='" . $Item->BundleRef . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The existence of the serial stock item record could not be determined because'); $DbgMsg = _('The following SQL to find out if the serial stock item record existed already was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1362,8 +1361,7 @@ '" . $StkMoveNo . "', '" . $CreditLine->StockID . "', '" . $Item->BundleRef . "', - '" . $Item->BundleQty . "' - )"; + '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -1381,7 +1379,7 @@ if ($CreditLine->MBflag=='B' OR $CreditLine->MBflag=='M') { $SQL = "UPDATE locstock - SET locstock.quantity = locstock.quantity + " . filter_number_format($CreditLine->Quantity) . " + SET locstock.quantity = locstock.quantity + " . $CreditLine->Quantity . " WHERE locstock.stockid = '" . $CreditLine->StockID . "' AND locstock.loccode = '" . $_SESSION['CreditItems'.$identifier]->Location . "'"; @@ -1400,11 +1398,11 @@ $SQL = "SELECT bom.component, bom.quantity, stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standard - FROM bom INNER JOIN stockmaster - ON bom.component=stockmaster.stockid - WHERE bom.parent='" . $CreditLine->StockID . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + FROM bom INNER JOIN stockmaster + ON bom.component=stockmaster.stockid + WHERE bom.parent='" . $CreditLine->StockID . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve assembly components from the database for') . ' ' . $CreditLine->StockID . ' ' . _('because'); $DbgMsg = _('The SQL that failed was'); @@ -1453,10 +1451,10 @@ '" . $_SESSION['CreditItems'.$identifier]->Branch . "', '" . $PeriodNo . "', '" . _('Assembly') .': ' . $CreditLine->StockID . "', - '" . filter_number_format($AssParts['quantity'] * $CreditLine->Quantity) . "', + '" . $AssParts['quantity'] * $CreditLine->Quantity . "', '" . $AssParts['standard'] . "', 0, - '" . filter_number_format($QtyOnHandPrior + ($AssParts['quantity'] * $CreditLine->Quantity)) . "' + '" . $QtyOnHandPrior + ($AssParts['quantity'] * $CreditLine->Quantity) . "' )"; $Er... [truncated message content] |
From: <dai...@us...> - 2011-10-11 09:10:23
|
Revision: 4718 http://web-erp.svn.sourceforge.net/web-erp/?rev=4718&view=rev Author: daintree Date: 2011-10-11 09:10:13 +0000 (Tue, 11 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/Areas.php trunk/GLBalanceSheet.php trunk/SelectSalesOrder.php trunk/Shipments.php trunk/Shippers.php trunk/Shipt_Select.php Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2011-10-10 15:43:31 UTC (rev 4717) +++ trunk/Areas.php 2011-10-11 09:10:13 UTC (rev 4718) @@ -195,9 +195,13 @@ $_POST['AreaCode'] = $myrow['areacode']; $_POST['AreaDescription'] = $myrow['areadescription']; - echo '<input type=hidden name=SelectedArea value="' . $SelectedArea . '">'; - echo '<input type=hidden name=AreaCode value="' .$_POST['AreaCode'] . '">'; - echo '<table class=selection><tr><td>' . _('Area Code') . ':</td><td>' . $_POST['AreaCode'] . '</td></tr>'; + echo '<input type=hidden name="SelectedArea" value="' . $SelectedArea . '" />'; + echo '<input type=hidden name="AreaCode" value="' .$_POST['AreaCode'] . '" />'; + echo '<table class="selection"> + <tr> + <td>' . _('Area Code') . ':</td> + <td>' . $_POST['AreaCode'] . '</td> + </tr>'; } else { if (!isset($_POST['AreaCode'])) { @@ -209,16 +213,23 @@ echo '<table class="selection"> <tr> <td>' . _('Area Code') . ':</td> - <td><input tabindex="1" ' . (in_array('AreaCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="AreaCode" value="' . $_POST['AreaCode'] . '" size=3 maxlength=3></td> + <td><input tabindex="1" ' . (in_array('AreaCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="AreaCode" value="' . $_POST['AreaCode'] . '" size="3" maxlength=3></td> </tr>'; } echo '<tr><td>' . _('Area Name') . ':</td> - <td><input tabindex="2" ' . (in_array('AreaDescription',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="AreaDescription" value="' . $_POST['AreaDescription'] .'" size=26 maxlength=25></td> + <td><input tabindex="2" ' . (in_array('AreaDescription',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="AreaDescription" value="' . $_POST['AreaDescription'] .'" size="26" maxlength="25" /></td> </tr>'; - echo '<tr><td colspan=2><div class="centre"><input tabindex="3" type="submit" name="submit" value=' . _('Enter Information') .'></div></td></tr>'; - echo '</table></form>'; + echo '<tr> + <td colspan="2"> + <div class="centre"> + <input tabindex="3" 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/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2011-10-10 15:43:31 UTC (rev 4717) +++ trunk/GLBalanceSheet.php 2011-10-11 09:10:13 UTC (rev 4718) @@ -1,12 +1,9 @@ <?php -/* $Revision: 1.21 $ */ - /* $Id$*/ /*Through deviousness and cunning, this system allows shows the balance sheets as at the end of any period selected - so first off need to show the input of criteria screen while the user is selecting the period end of the balance date meanwhile the system is posting any unposted transactions */ -//$PageSecurity = 8; include ('includes/session.inc'); $title = _('Balance Sheet'); @@ -24,9 +21,12 @@ . _('The balance sheet has three parts: assets, liabilities and ownership equity. The main categories of assets are listed first and are followed by the liabilities. The difference between the assets and the liabilities is known as equity or the net assets or the net worth or capital of the company and according to the accounting equation, net worth must equal assets minus liabilities.') . '<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 '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection"><tr><td>'._('Select the balance date').':</td><td><select Name="BalancePeriodEnd">'; + echo '<table class="selection"> + <tr> + <td>'._('Select the balance date').':</td> + <td><select Name="BalancePeriodEnd">'; $periodno=GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='".$periodno . "'"; @@ -34,28 +34,38 @@ $myrow=DB_fetch_array($result, $db); $lastdate_in_period=$myrow[0]; - $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; + $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db); while ($myrow=DB_fetch_array($Periods,$db)){ if( $myrow['periodno']== $periodno){ - echo '<option selected value=' . $myrow['periodno'] . '>' . ConvertSQLDate($lastdate_in_period); + echo '<option selected value=' . $myrow['periodno'] . '>' . ConvertSQLDate($lastdate_in_period) . '</option>'; } else { - echo '<option value=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']); + echo '<option value=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; - echo '<tr><td>'._('Detail Or Summary').':</td><td><select Name="Detail">'; - echo '<option selected VALUE="Summary">'._('Summary') . '</option>'; - echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; - echo '</select></td></tr>'; + echo '<tr> + <td>'._('Detail Or Summary').':</td> + <td><select Name="Detail"> + <option value="Summary">'._('Summary') . '</option> + <option selected value="Detailed">'._('All Accounts') . '</option> + </select></td> + </tr>'; echo '</table>'; - echo '<br /><div class="centre"><input type=submit Name="ShowBalanceSheet" Value="'._('Show on Screen (HTML)').'"></div>'; - echo '<br /><div class="centre"><input type=submit Name="PrintPDF" Value="'._('Produce PDF Report').'"></div></form>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="ShowBalanceSheet" value="'._('Show on Screen (HTML)').'" /> + </div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="PrintPDF" value="'._('Produce PDF Report').'"> + </div> + </form>'; /*Now do the posting while the user is thinking about the period to select */ include ('includes/GLPostings.inc'); @@ -90,7 +100,8 @@ $title = _('Balance Sheet') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The accumulated profits brought forward could not be calculated by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /> + <a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ echo '<br />'. $SQL; } @@ -128,7 +139,7 @@ $title = _('Balance Sheet') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ echo '<br />'. $SQL; } @@ -254,26 +265,26 @@ $FontSize = 8; $pdf->setFont('','B'); while ($Level>0) { - $YPos -= $line_height; - $LeftOvers = $pdf->addTextWrap($Left_Margin+(10 * ($Level+1)),$YPos,200,$FontSize,_('Total') . ' ' . $ParentGroups[$Level]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,100,$FontSize,locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); - $ParentGroups[$Level]=''; - $GroupTotal[$Level]=0; - $LYGroupTotal[$Level]=0; - $Level--; - } - $YPos -= $line_height; - $LeftOvers = $pdf->addTextWrap($Left_Margin+(10 * ($Level+1)),$YPos,200,$FontSize,_('Total') . ' ' . $ParentGroups[$Level]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,100,$FontSize,locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); - $ParentGroups[$Level]=''; - $GroupTotal[$Level]=0; - $LYGroupTotal[$Level]=0; - $YPos -= $line_height; + $YPos -= $line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin+(10 * ($Level+1)),$YPos,200,$FontSize,_('Total') . ' ' . $ParentGroups[$Level]); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,100,$FontSize,locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $ParentGroups[$Level]=''; + $GroupTotal[$Level]=0; + $LYGroupTotal[$Level]=0; + $Level--; + } + $YPos -= $line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin+(10 * ($Level+1)),$YPos,200,$FontSize,_('Total') . ' ' . $ParentGroups[$Level]); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,100,$FontSize,locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $ParentGroups[$Level]=''; + $GroupTotal[$Level]=0; + $LYGroupTotal[$Level]=0; + $YPos -= $line_height; - if ($SectionBalanceLY+$SectionBalance !=0){ - $FontSize =8; + if ($SectionBalanceLY+$SectionBalance !=0){ + $FontSize =8; $pdf->setFont('','B'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,locale_number_format($SectionBalance,$_SESSION['CompanyRecord']['decimalplaces']),'right'); @@ -295,15 +306,15 @@ include('includes/footer.inc'); exit; } else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_GL_Balance_Sheet_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_GL_Balance_Sheet_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); } exit; } else { include('includes/header.inc'); - echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type=hidden name="BalancePeriodEnd" VALUE="' . $_POST['BalancePeriodEnd'] . '">'; + echo '<input type=hidden name="BalancePeriodEnd" value="' . $_POST['BalancePeriodEnd'] . '" />'; $RetainedEarningsAct = $_SESSION['CompanyRecord']['retainedearnings']; @@ -350,22 +361,29 @@ $AccountsResult = DB_query($SQL,$db,_('No general ledger accounts were returned by the SQL because')); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/preview.gif" title="' . _('Search') . '" alt="" /> ' . _('HTML View') . '</p>'; - echo '<div class=invoice><table class="selection"><tr><th colspan=6><div class="centre"><font size=4 color=blue><b>' . - _('Balance Sheet as at') . ' ' . $BalanceDate .'</b></font></div></th></tr>'; + echo '<div class="invoice"> + <table class="selection"> + <tr> + <th colspan=6> + <div class="centre"><font size="4" color="blue"><b>' . + _('Balance Sheet as at') . ' ' . $BalanceDate .'</b></font> + </div> + </th> + </tr>'; if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> - <th>'._('Account').'</td> - <th>'._('Account Name').'</td> - <th colspan=2>$BalanceDate</th> - <th colspan=2>'._('Last Year').'</th> - </tr>'; + <th>'._('Account').'</td> + <th>'._('Account Name').'</td> + <th colspan="2">' . $BalanceDate . '</th> + <th colspan="2">'._('Last Year').'</th> + </tr>'; } else { /*summary */ $TableHeader = '<tr> - <th colspan=2></th> - <th colspan=2>$BalanceDate</th> - <th colspan=2>'._('Last Year').'</th> - </tr>'; + <th colspan="2"></th> + <th colspan="2">' . $BalanceDate . '</th> + <th colspan="2">' ._('Last Year') . '</th> + </tr>'; } @@ -401,22 +419,22 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0){ if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> + <td colspan="2"></td> <td><hr></td> - <td></td> - <td><hr></td> - <td></td> + <td></td> + <td><hr></td> + <td></td> </tr>'; } - printf('<td colspan=2><I>%s</I></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ParentGroups[$Level], - locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) - ); + printf('<td colspan="2"><I>%s</I></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + </tr>', + $ParentGroups[$Level], + locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) + ); $GroupTotal[$Level] = 0; $LYGroupTotal[$Level] = 0; $ParentGroups[$Level]=''; @@ -425,23 +443,23 @@ } if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> + <td colspan="2"></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> </tr>'; } - printf('<td colspan=2>%s</td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ParentGroups[$Level], - locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) - ); + printf('<td colspan="2">%s</td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + </tr>', + $ParentGroups[$Level], + locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) ); + $GroupTotal[$Level] = 0; $LYGroupTotal[$Level] = 0; $ParentGroups[$Level]=''; @@ -453,27 +471,27 @@ if ($Section!=''){ if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - </tr>'; + <td colspan="2"></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> + </tr>'; } else { echo '<tr> - <td colspan=3></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; + <td colspan="3"></td> + <td><hr></td> + <td></td> + <td><hr></td> + </tr>'; } printf('<tr> - <td colspan=3><font size=4>%s</font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', + <td colspan="3"><font size="4">%s</font></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + </tr>', $Sections[$Section], locale_number_format($SectionBalance,$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($SectionBalanceLY,$_SESSION['CompanyRecord']['decimalplaces'])); @@ -486,9 +504,9 @@ if ($_POST['Detail']=='Detailed'){ printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> - </tr>', - $Sections[$myrow['sectioninaccounts']]); + <td colspan="6"><font size="4" color="blue"><b>%s</b></font></td> + </tr>', + $Sections[$myrow['sectioninaccounts']]); } } @@ -501,9 +519,9 @@ if ($_POST['Detail']=='Detailed'){ $ActGrp = $myrow['groupname']; printf('<tr> - <td colspan=6><font size=2 color=BLUE><b>%s</b></font></td> - </tr>', - $myrow['groupname']); + <td colspan="6"><font size="2" color="blue"><b>%s</b></font></td> + </tr>', + $myrow['groupname']); echo $TableHeader; } $GroupTotal[$Level]=0; @@ -535,63 +553,57 @@ $ActEnquiryURL = '<a href="' . $rootpath . '/GLAccountInquiry.php?Period=' . $_POST['BalancePeriodEnd'] . '&Account=' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . '</a>'; - $PrintString = '<td>%s</td> + 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> - </tr>'; - - printf($PrintString, - $ActEnquiryURL, - $myrow['accountname'], - locale_number_format($AccountBalance,$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($LYAccountBalance,$_SESSION['CompanyRecord']['decimalplaces']) - ); + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + locale_number_format($AccountBalance,$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($LYAccountBalance,$_SESSION['CompanyRecord']['decimalplaces'])); $j++; - } - } //end of loop - while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0){ if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> + <td colspan="2"></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> </tr>'; } - printf('<td colspan=2><I>%s</I></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ParentGroups[$Level], - locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) - ); + printf('<td colspan="2"><I>%s</I></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + </tr>', + $ParentGroups[$Level], + locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) + ); $Level--; } if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> + <td colspan="2"></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> </tr>'; } - printf('<td colspan=2>%s</td> - <td class=number>%s</td> + printf('<td colspan="2">%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ParentGroups[$Level], locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), @@ -600,7 +612,7 @@ if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> + <td colspan="2"></td> <td><hr></td> <td></td> <td><hr></td> @@ -617,50 +629,50 @@ printf('<tr> <td colspan=3><font size=4>%s</font></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> - </tr>', - $Sections[$Section], - locale_number_format($SectionBalance,$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($SectionBalanceLY,$_SESSION['CompanyRecord']['decimalplaces'])); + <td class="number">%s</td> + </tr>', + $Sections[$Section], + locale_number_format($SectionBalance,$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($SectionBalanceLY,$_SESSION['CompanyRecord']['decimalplaces'])); $Section = $myrow['sectioninaccounts']; if (isset($myrow['sectioninaccounts']) and $_POST['Detail']=='Detailed'){ printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> - </tr>', - $Sections[$myrow['sectioninaccounts']]); + <td colspan="6"><font size="4" color="blue"><b>%s</b></font></td> + </tr>', + $Sections[$myrow['sectioninaccounts']]); } echo '<tr> - <td colspan=3></td> + <td colspan="3"></td> <td><hr></td> - <td></td> - <td><hr></td> + <td></td> + <td><hr></td> </tr>'; printf('<tr> - <td colspan=3>'._('Check Total').'</font></td> - <td class=number>%s</td> + <td colspan="3">'._('Check Total').'</font></td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', locale_number_format($CheckTotal,$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($LYCheckTotal,$_SESSION['CompanyRecord']['decimalplaces'])); echo '<tr> - <td colspan=3></td> - <td><hr></td> + <td colspan="3"></td> + <td><hr></td> <td></td> <td><hr></td> </tr>'; echo '</table>'; - echo '<br /><div class="centre"><input type=submit Name="SelectADifferentPeriod" Value="'._('Select A Different Balance Date').'"></div>'; + echo '<br /><div class="centre"><input type="submit" name="SelectADifferentPeriod" value="'._('Select A Different Balance Date').'" /></div>'; } echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-10-10 15:43:31 UTC (rev 4717) +++ trunk/SelectSalesOrder.php 2011-10-11 09:10:13 UTC (rev 4718) @@ -65,7 +65,7 @@ $ItemArray = array(); while ($myrow = DB_fetch_array($ItemResult)){ - $ItemArray[] = $myrow; + $ItemArray[$myrow['stockid']] = $myrow; } /* Now figure out if there are any components of Assembly items that need to be ordered too */ @@ -116,9 +116,27 @@ /* add any assembly item components from salesorders to the ItemArray */ while ($myrow = DB_fetch_array($ItemResult)){ - $ItemArray[] = $myrow; + if (isset($ItemArray[$myrow['stockid']])){ + /* if the item is already in the ItemArray then just add the quantity to the existing item */ + $ItemArray[$myrow['stockid']]['orderqty'] += $myrow['orderqty']; + } else { /*it is not already in the ItemArray so add it */ + $ItemArray[$myrow['stockid']] = $myrow; + } } + + /* We need the items to order to be in supplier order so that only a single order is created for a supplier - so need to sort the multi-dimensional array to ensure it is listed by supplier sequence. To use array_multisort we need to get arrays of supplier with the same keys as the main array of rows + */ + foreach ($ItemArray as $key => $row) { + //to make the Supplier array with the keys of the $ItemArray + $SupplierArray[$key] = $row['supplierno']; + } + + /* Use array_multisort to Sort the ItemArray with supplierno ascending + Add $ItemArray as the last parameter, to sort by the common key + */ + array_multisort($SupplierArray, SORT_ASC, $ItemArray); + if (count($ItemArray)==0){ prnMsg(_('There might be no supplier purchasing data set up for any items on the selected sales order(s). No purchase orders have been created'),'warn'); } else { Modified: trunk/Shipments.php =================================================================== --- trunk/Shipments.php 2011-10-10 15:43:31 UTC (rev 4717) +++ trunk/Shipments.php 2011-10-11 09:10:13 UTC (rev 4718) @@ -251,6 +251,7 @@ purchorderdetails.quantityrecd, purchorderdetails.deliverydate, stockmaster.units, + stockmaster.decimalplaces, purchorderdetails.qtyinvoiced FROM purchorderdetails INNER JOIN stockmaster ON purchorderdetails.itemcode=stockmaster.stockid @@ -268,17 +269,17 @@ } $_SESSION['Shipment']->add_to_shipment($_GET['Add'], - $myrow['orderno'], - $myrow['itemcode'], - $myrow['itemdescription'], - $myrow['qtyinvoiced'], - $myrow['unitprice'], - $myrow['units'], - $myrow['deliverydate'], - $myrow['quantityord'], - $myrow['quantityrecd'], - $StandardCost, - $db); + $myrow['orderno'], + $myrow['itemcode'], + $myrow['itemdescription'], + $myrow['qtyinvoiced'], + $myrow['unitprice'], + $myrow['units'], + $myrow['deliverydate'], + $myrow['quantityord'], + $myrow['quantityrecd'], + $StandardCost, + $db); } if (isset($_GET['Delete']) AND $_SESSION['Shipment']->Closed==0){ //shipment is open and user hit delete on a line @@ -312,7 +313,7 @@ echo '<tr><td>'. _('Expected Arrival Date (ETA)'). ': </td>'; if (isset($_SESSION['Shipment']->ETA)) { - echo '<td><input type="text class="date" alt='.$_SESSION['DefaultDateFormat'].' name="ETA" maxlength=10 size=10 value="' . $ETA . '" /></td>'; + echo '<td><input type="text class="date" alt='.$_SESSION['DefaultDateFormat'].' name="ETA" maxlength="10" size="10" value="' . $ETA . '" /></td>'; } else { echo '<td><input type="text class="date" alt='.$_SESSION['DefaultDateFormat'].' name="ETA" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td>'; } @@ -382,7 +383,7 @@ /* Always display all shipment lines */ echo '<br /><table cellpadding=2 colspan=7 class="selection">'; - echo '<tr><th colspan=9><font color=navy size=3>'. _('Order Lines On This Shipment'). '</font></th></tr>'; + echo '<tr><th colspan="9"><font color="navy" size="3">'. _('Order Lines On This Shipment'). '</font></th></tr>'; $TableHeader = '<tr> <th>'. _('Order'). '</th> @@ -419,19 +420,22 @@ echo '<td>'.$LnItm->OrderNo.'</td> - <td>'. $LnItm->StockID .' - '. $LnItm->ItemDescription. '</td><td class=number>' . locale_number_format($LnItm->QuantityOrd,2) . '</td> + <td>'. $LnItm->StockID .' - '. $LnItm->ItemDescription. '</td><td class="number">' . locale_number_format($LnItm->QuantityOrd,2) . '</td> <td>'. $LnItm->UOM .'</td> - <td class=number>' . locale_number_format($LnItm->QuantityRecd,2) . '</td> - <td class=number>' . locale_number_format($LnItm->QtyInvoiced,2) . '</td> - <td class=number>' . locale_number_format($LnItm->UnitPrice,2) . '</td> - <td class=number>' . locale_number_format($LnItm->StdCostUnit,2) . '</td> + <td class="number">' . locale_number_format($LnItm->QuantityRecd,2) . '</td> + <td class="number">' . locale_number_format($LnItm->QtyInvoiced,2) . '</td> + <td class="number">' . locale_number_format($LnItm->UnitPrice,2) . '</td> + <td class="number">' . locale_number_format($LnItm->StdCostUnit,2) . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $LnItm->PODetailItem . '">'. _('Delete'). '</a></td> </tr>'; }//for each line on the shipment echo '</table>'; }//there are lines on the shipment -echo '<br /><div class="centre"><input type=submit name="Update" value="'. _('Update Shipment Details') . '" /></div><p>'; +echo '<br /> + <div class="centre"> + <input type="submit" name="Update" value="'. _('Update Shipment Details') . '" /> + </div>'; if (!isset($_POST['StockLocation'])) { $_POST['StockLocation'] =$_SESSION['Shipment']->StockLocation; @@ -445,7 +449,8 @@ purchorderdetails.quantityord, purchorderdetails.quantityrecd, purchorderdetails.deliverydate, - stockmaster.units + stockmaster.units, + stockmaster.decimalplaces FROM purchorderdetails INNER JOIN purchorders ON purchorderdetails.orderno=purchorders.orderno INNER JOIN stockmaster @@ -496,10 +501,10 @@ echo '<td>' . $myrow['orderno'] . '</td> <td>' . $myrow['itemcode'] . ' - ' . $myrow['itemdescription'] . '</td> - <td class=number>' . locale_number_format($myrow['quantityord'],2) . '</td> + <td class="number">' . locale_number_format($myrow['quantityord'],$myrow['decimalplaces']) . '</td> <td>' . $myrow['units'] . '</td> - <td class=number>' . locale_number_format($myrow['quantityrecd'],2) . '</td> - <td class=number>' . ConvertSQLDate($myrow['deliverydate']) . '</td> + <td class="number">' . locale_number_format($myrow['quantityrecd'],,$myrow['decimalplaces']) . '</td> + <td class="number">' . ConvertSQLDate($myrow['deliverydate']) . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?' . 'Add=' . $myrow['podetailitem'] . '">'. _('Add').'</a></td> </tr>'; Modified: trunk/Shippers.php =================================================================== --- trunk/Shippers.php 2011-10-10 15:43:31 UTC (rev 4717) +++ trunk/Shippers.php 2011-10-11 09:10:13 UTC (rev 4718) @@ -32,12 +32,12 @@ if (mb_strlen($_POST['ShipperName']) >40) { $InputError = 1; - prnMsg( _("The shipper's name must be forty characters or less long"), 'error'); + prnMsg( _('The shipper\'s name must be forty characters or less long'), 'error'); $Errors[$i] = 'ShipperName'; $i++; } elseif( trim($_POST['ShipperName']) == '' ) { $InputError = 1; - prnMsg( _("The shipper's name may not be empty"), 'error'); + prnMsg( _('The shipper\'s name may not be empty'), 'error'); $Errors[$i] = 'ShipperName'; $i++; } @@ -48,13 +48,13 @@ would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE shippers SET shippername='" . $_POST['ShipperName'] . "' WHERE shipper_id = '".$SelectedShipper."'"; + $sql = "UPDATE shippers SET shippername='" . DB_escape_string($_POST['ShipperN... [truncated message content] |
From: <dai...@us...> - 2011-10-11 09:10:25
|
Revision: 4718 http://web-erp.svn.sourceforge.net/web-erp/?rev=4718&view=rev Author: daintree Date: 2011-10-11 09:10:13 +0000 (Tue, 11 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/Areas.php trunk/GLBalanceSheet.php trunk/SelectSalesOrder.php trunk/Shipments.php trunk/Shippers.php trunk/Shipt_Select.php Modified: trunk/Areas.php =================================================================== --- trunk/Areas.php 2011-10-10 15:43:31 UTC (rev 4717) +++ trunk/Areas.php 2011-10-11 09:10:13 UTC (rev 4718) @@ -195,9 +195,13 @@ $_POST['AreaCode'] = $myrow['areacode']; $_POST['AreaDescription'] = $myrow['areadescription']; - echo '<input type=hidden name=SelectedArea value="' . $SelectedArea . '">'; - echo '<input type=hidden name=AreaCode value="' .$_POST['AreaCode'] . '">'; - echo '<table class=selection><tr><td>' . _('Area Code') . ':</td><td>' . $_POST['AreaCode'] . '</td></tr>'; + echo '<input type=hidden name="SelectedArea" value="' . $SelectedArea . '" />'; + echo '<input type=hidden name="AreaCode" value="' .$_POST['AreaCode'] . '" />'; + echo '<table class="selection"> + <tr> + <td>' . _('Area Code') . ':</td> + <td>' . $_POST['AreaCode'] . '</td> + </tr>'; } else { if (!isset($_POST['AreaCode'])) { @@ -209,16 +213,23 @@ echo '<table class="selection"> <tr> <td>' . _('Area Code') . ':</td> - <td><input tabindex="1" ' . (in_array('AreaCode',$Errors) ? 'class="inputerror"' : '' ) .' type="Text" name="AreaCode" value="' . $_POST['AreaCode'] . '" size=3 maxlength=3></td> + <td><input tabindex="1" ' . (in_array('AreaCode',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="AreaCode" value="' . $_POST['AreaCode'] . '" size="3" maxlength=3></td> </tr>'; } echo '<tr><td>' . _('Area Name') . ':</td> - <td><input tabindex="2" ' . (in_array('AreaDescription',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="AreaDescription" value="' . $_POST['AreaDescription'] .'" size=26 maxlength=25></td> + <td><input tabindex="2" ' . (in_array('AreaDescription',$Errors) ? 'class="inputerror"' : '' ) .' type="text" name="AreaDescription" value="' . $_POST['AreaDescription'] .'" size="26" maxlength="25" /></td> </tr>'; - echo '<tr><td colspan=2><div class="centre"><input tabindex="3" type="submit" name="submit" value=' . _('Enter Information') .'></div></td></tr>'; - echo '</table></form>'; + echo '<tr> + <td colspan="2"> + <div class="centre"> + <input tabindex="3" 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/GLBalanceSheet.php =================================================================== --- trunk/GLBalanceSheet.php 2011-10-10 15:43:31 UTC (rev 4717) +++ trunk/GLBalanceSheet.php 2011-10-11 09:10:13 UTC (rev 4718) @@ -1,12 +1,9 @@ <?php -/* $Revision: 1.21 $ */ - /* $Id$*/ /*Through deviousness and cunning, this system allows shows the balance sheets as at the end of any period selected - so first off need to show the input of criteria screen while the user is selecting the period end of the balance date meanwhile the system is posting any unposted transactions */ -//$PageSecurity = 8; include ('includes/session.inc'); $title = _('Balance Sheet'); @@ -24,9 +21,12 @@ . _('The balance sheet has three parts: assets, liabilities and ownership equity. The main categories of assets are listed first and are followed by the liabilities. The difference between the assets and the liabilities is known as equity or the net assets or the net worth or capital of the company and according to the accounting equation, net worth must equal assets minus liabilities.') . '<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 '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection"><tr><td>'._('Select the balance date').':</td><td><select Name="BalancePeriodEnd">'; + echo '<table class="selection"> + <tr> + <td>'._('Select the balance date').':</td> + <td><select Name="BalancePeriodEnd">'; $periodno=GetPeriod(Date($_SESSION['DefaultDateFormat']), $db); $sql = "SELECT lastdate_in_period FROM periods WHERE periodno='".$periodno . "'"; @@ -34,28 +34,38 @@ $myrow=DB_fetch_array($result, $db); $lastdate_in_period=$myrow[0]; - $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; + $sql = "SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC"; $Periods = DB_query($sql,$db); while ($myrow=DB_fetch_array($Periods,$db)){ if( $myrow['periodno']== $periodno){ - echo '<option selected value=' . $myrow['periodno'] . '>' . ConvertSQLDate($lastdate_in_period); + echo '<option selected value=' . $myrow['periodno'] . '>' . ConvertSQLDate($lastdate_in_period) . '</option>'; } else { - echo '<option value=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']); + echo '<option value=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } } echo '</select></td></tr>'; - echo '<tr><td>'._('Detail Or Summary').':</td><td><select Name="Detail">'; - echo '<option selected VALUE="Summary">'._('Summary') . '</option>'; - echo '<option selected VALUE="Detailed">'._('All Accounts') . '</option>'; - echo '</select></td></tr>'; + echo '<tr> + <td>'._('Detail Or Summary').':</td> + <td><select Name="Detail"> + <option value="Summary">'._('Summary') . '</option> + <option selected value="Detailed">'._('All Accounts') . '</option> + </select></td> + </tr>'; echo '</table>'; - echo '<br /><div class="centre"><input type=submit Name="ShowBalanceSheet" Value="'._('Show on Screen (HTML)').'"></div>'; - echo '<br /><div class="centre"><input type=submit Name="PrintPDF" Value="'._('Produce PDF Report').'"></div></form>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="ShowBalanceSheet" value="'._('Show on Screen (HTML)').'" /> + </div>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="PrintPDF" value="'._('Produce PDF Report').'"> + </div> + </form>'; /*Now do the posting while the user is thinking about the period to select */ include ('includes/GLPostings.inc'); @@ -90,7 +100,8 @@ $title = _('Balance Sheet') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('The accumulated profits brought forward could not be calculated by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /> + <a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ echo '<br />'. $SQL; } @@ -128,7 +139,7 @@ $title = _('Balance Sheet') . ' - ' . _('Problem Report') . '....'; include('includes/header.inc'); prnMsg( _('No general ledger accounts were returned by the SQL because') . ' - ' . DB_error_msg($db) ); - echo '<br /><a href="' .$rootpath .'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + echo '<br /><a href="' .$rootpath .'/index.php">'. _('Back to the menu'). '</a>'; if ($debug==1){ echo '<br />'. $SQL; } @@ -254,26 +265,26 @@ $FontSize = 8; $pdf->setFont('','B'); while ($Level>0) { - $YPos -= $line_height; - $LeftOvers = $pdf->addTextWrap($Left_Margin+(10 * ($Level+1)),$YPos,200,$FontSize,_('Total') . ' ' . $ParentGroups[$Level]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,100,$FontSize,locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); - $ParentGroups[$Level]=''; - $GroupTotal[$Level]=0; - $LYGroupTotal[$Level]=0; - $Level--; - } - $YPos -= $line_height; - $LeftOvers = $pdf->addTextWrap($Left_Margin+(10 * ($Level+1)),$YPos,200,$FontSize,_('Total') . ' ' . $ParentGroups[$Level]); - $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,100,$FontSize,locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); - $ParentGroups[$Level]=''; - $GroupTotal[$Level]=0; - $LYGroupTotal[$Level]=0; - $YPos -= $line_height; + $YPos -= $line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin+(10 * ($Level+1)),$YPos,200,$FontSize,_('Total') . ' ' . $ParentGroups[$Level]); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,100,$FontSize,locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $ParentGroups[$Level]=''; + $GroupTotal[$Level]=0; + $LYGroupTotal[$Level]=0; + $Level--; + } + $YPos -= $line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin+(10 * ($Level+1)),$YPos,200,$FontSize,_('Total') . ' ' . $ParentGroups[$Level]); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,100,$FontSize,locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $ParentGroups[$Level]=''; + $GroupTotal[$Level]=0; + $LYGroupTotal[$Level]=0; + $YPos -= $line_height; - if ($SectionBalanceLY+$SectionBalance !=0){ - $FontSize =8; + if ($SectionBalanceLY+$SectionBalance !=0){ + $FontSize =8; $pdf->setFont('','B'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize,$Sections[$Section]); $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,locale_number_format($SectionBalance,$_SESSION['CompanyRecord']['decimalplaces']),'right'); @@ -295,15 +306,15 @@ include('includes/footer.inc'); exit; } else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_GL_Balance_Sheet_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN + $pdf->OutputD($_SESSION['DatabaseName'] . '_GL_Balance_Sheet_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); } exit; } else { include('includes/header.inc'); - echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '">'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type=hidden name="BalancePeriodEnd" VALUE="' . $_POST['BalancePeriodEnd'] . '">'; + echo '<input type=hidden name="BalancePeriodEnd" value="' . $_POST['BalancePeriodEnd'] . '" />'; $RetainedEarningsAct = $_SESSION['CompanyRecord']['retainedearnings']; @@ -350,22 +361,29 @@ $AccountsResult = DB_query($SQL,$db,_('No general ledger accounts were returned by the SQL because')); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/preview.gif" title="' . _('Search') . '" alt="" /> ' . _('HTML View') . '</p>'; - echo '<div class=invoice><table class="selection"><tr><th colspan=6><div class="centre"><font size=4 color=blue><b>' . - _('Balance Sheet as at') . ' ' . $BalanceDate .'</b></font></div></th></tr>'; + echo '<div class="invoice"> + <table class="selection"> + <tr> + <th colspan=6> + <div class="centre"><font size="4" color="blue"><b>' . + _('Balance Sheet as at') . ' ' . $BalanceDate .'</b></font> + </div> + </th> + </tr>'; if ($_POST['Detail']=='Detailed'){ $TableHeader = '<tr> - <th>'._('Account').'</td> - <th>'._('Account Name').'</td> - <th colspan=2>$BalanceDate</th> - <th colspan=2>'._('Last Year').'</th> - </tr>'; + <th>'._('Account').'</td> + <th>'._('Account Name').'</td> + <th colspan="2">' . $BalanceDate . '</th> + <th colspan="2">'._('Last Year').'</th> + </tr>'; } else { /*summary */ $TableHeader = '<tr> - <th colspan=2></th> - <th colspan=2>$BalanceDate</th> - <th colspan=2>'._('Last Year').'</th> - </tr>'; + <th colspan="2"></th> + <th colspan="2">' . $BalanceDate . '</th> + <th colspan="2">' ._('Last Year') . '</th> + </tr>'; } @@ -401,22 +419,22 @@ while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0){ if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> + <td colspan="2"></td> <td><hr></td> - <td></td> - <td><hr></td> - <td></td> + <td></td> + <td><hr></td> + <td></td> </tr>'; } - printf('<td colspan=2><I>%s</I></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ParentGroups[$Level], - locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) - ); + printf('<td colspan="2"><I>%s</I></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + </tr>', + $ParentGroups[$Level], + locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) + ); $GroupTotal[$Level] = 0; $LYGroupTotal[$Level] = 0; $ParentGroups[$Level]=''; @@ -425,23 +443,23 @@ } if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> + <td colspan="2"></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> </tr>'; } - printf('<td colspan=2>%s</td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ParentGroups[$Level], - locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) - ); + printf('<td colspan="2">%s</td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + </tr>', + $ParentGroups[$Level], + locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) ); + $GroupTotal[$Level] = 0; $LYGroupTotal[$Level] = 0; $ParentGroups[$Level]=''; @@ -453,27 +471,27 @@ if ($Section!=''){ if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> - </tr>'; + <td colspan="2"></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> + </tr>'; } else { echo '<tr> - <td colspan=3></td> - <td><hr></td> - <td></td> - <td><hr></td> - </tr>'; + <td colspan="3"></td> + <td><hr></td> + <td></td> + <td><hr></td> + </tr>'; } printf('<tr> - <td colspan=3><font size=4>%s</font></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', + <td colspan="3"><font size="4">%s</font></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + </tr>', $Sections[$Section], locale_number_format($SectionBalance,$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($SectionBalanceLY,$_SESSION['CompanyRecord']['decimalplaces'])); @@ -486,9 +504,9 @@ if ($_POST['Detail']=='Detailed'){ printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> - </tr>', - $Sections[$myrow['sectioninaccounts']]); + <td colspan="6"><font size="4" color="blue"><b>%s</b></font></td> + </tr>', + $Sections[$myrow['sectioninaccounts']]); } } @@ -501,9 +519,9 @@ if ($_POST['Detail']=='Detailed'){ $ActGrp = $myrow['groupname']; printf('<tr> - <td colspan=6><font size=2 color=BLUE><b>%s</b></font></td> - </tr>', - $myrow['groupname']); + <td colspan="6"><font size="2" color="blue"><b>%s</b></font></td> + </tr>', + $myrow['groupname']); echo $TableHeader; } $GroupTotal[$Level]=0; @@ -535,63 +553,57 @@ $ActEnquiryURL = '<a href="' . $rootpath . '/GLAccountInquiry.php?Period=' . $_POST['BalancePeriodEnd'] . '&Account=' . $myrow['accountcode'] . '">' . $myrow['accountcode'] . '</a>'; - $PrintString = '<td>%s</td> + 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> - </tr>'; - - printf($PrintString, - $ActEnquiryURL, - $myrow['accountname'], - locale_number_format($AccountBalance,$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($LYAccountBalance,$_SESSION['CompanyRecord']['decimalplaces']) - ); + </tr>', + $ActEnquiryURL, + $myrow['accountname'], + locale_number_format($AccountBalance,$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($LYAccountBalance,$_SESSION['CompanyRecord']['decimalplaces'])); $j++; - } - } //end of loop - while ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0){ if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> + <td colspan="2"></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> </tr>'; } - printf('<td colspan=2><I>%s</I></td> - <td class=number>%s</td> - <td></td> - <td class=number>%s</td> - </tr>', - $ParentGroups[$Level], - locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) - ); + printf('<td colspan="2"><I>%s</I></td> + <td class="number">%s</td> + <td></td> + <td class="number">%s</td> + </tr>', + $ParentGroups[$Level], + locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($LYGroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']) + ); $Level--; } if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> - <td><hr></td> - <td></td> - <td><hr></td> - <td></td> + <td colspan="2"></td> + <td><hr></td> + <td></td> + <td><hr></td> + <td></td> </tr>'; } - printf('<td colspan=2>%s</td> - <td class=number>%s</td> + printf('<td colspan="2">%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', $ParentGroups[$Level], locale_number_format($GroupTotal[$Level],$_SESSION['CompanyRecord']['decimalplaces']), @@ -600,7 +612,7 @@ if ($_POST['Detail']=='Detailed'){ echo '<tr> - <td colspan=2></td> + <td colspan="2"></td> <td><hr></td> <td></td> <td><hr></td> @@ -617,50 +629,50 @@ printf('<tr> <td colspan=3><font size=4>%s</font></td> - <td class=number>%s</td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> - </tr>', - $Sections[$Section], - locale_number_format($SectionBalance,$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($SectionBalanceLY,$_SESSION['CompanyRecord']['decimalplaces'])); + <td class="number">%s</td> + </tr>', + $Sections[$Section], + locale_number_format($SectionBalance,$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($SectionBalanceLY,$_SESSION['CompanyRecord']['decimalplaces'])); $Section = $myrow['sectioninaccounts']; if (isset($myrow['sectioninaccounts']) and $_POST['Detail']=='Detailed'){ printf('<tr> - <td colspan=6><font size=4 color=BLUE><b>%s</b></font></td> - </tr>', - $Sections[$myrow['sectioninaccounts']]); + <td colspan="6"><font size="4" color="blue"><b>%s</b></font></td> + </tr>', + $Sections[$myrow['sectioninaccounts']]); } echo '<tr> - <td colspan=3></td> + <td colspan="3"></td> <td><hr></td> - <td></td> - <td><hr></td> + <td></td> + <td><hr></td> </tr>'; printf('<tr> - <td colspan=3>'._('Check Total').'</font></td> - <td class=number>%s</td> + <td colspan="3">'._('Check Total').'</font></td> + <td class="number">%s</td> <td></td> - <td class=number>%s</td> + <td class="number">%s</td> </tr>', locale_number_format($CheckTotal,$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($LYCheckTotal,$_SESSION['CompanyRecord']['decimalplaces'])); echo '<tr> - <td colspan=3></td> - <td><hr></td> + <td colspan="3"></td> + <td><hr></td> <td></td> <td><hr></td> </tr>'; echo '</table>'; - echo '<br /><div class="centre"><input type=submit Name="SelectADifferentPeriod" Value="'._('Select A Different Balance Date').'"></div>'; + echo '<br /><div class="centre"><input type="submit" name="SelectADifferentPeriod" value="'._('Select A Different Balance Date').'" /></div>'; } echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-10-10 15:43:31 UTC (rev 4717) +++ trunk/SelectSalesOrder.php 2011-10-11 09:10:13 UTC (rev 4718) @@ -65,7 +65,7 @@ $ItemArray = array(); while ($myrow = DB_fetch_array($ItemResult)){ - $ItemArray[] = $myrow; + $ItemArray[$myrow['stockid']] = $myrow; } /* Now figure out if there are any components of Assembly items that need to be ordered too */ @@ -116,9 +116,27 @@ /* add any assembly item components from salesorders to the ItemArray */ while ($myrow = DB_fetch_array($ItemResult)){ - $ItemArray[] = $myrow; + if (isset($ItemArray[$myrow['stockid']])){ + /* if the item is already in the ItemArray then just add the quantity to the existing item */ + $ItemArray[$myrow['stockid']]['orderqty'] += $myrow['orderqty']; + } else { /*it is not already in the ItemArray so add it */ + $ItemArray[$myrow['stockid']] = $myrow; + } } + + /* We need the items to order to be in supplier order so that only a single order is created for a supplier - so need to sort the multi-dimensional array to ensure it is listed by supplier sequence. To use array_multisort we need to get arrays of supplier with the same keys as the main array of rows + */ + foreach ($ItemArray as $key => $row) { + //to make the Supplier array with the keys of the $ItemArray + $SupplierArray[$key] = $row['supplierno']; + } + + /* Use array_multisort to Sort the ItemArray with supplierno ascending + Add $ItemArray as the last parameter, to sort by the common key + */ + array_multisort($SupplierArray, SORT_ASC, $ItemArray); + if (count($ItemArray)==0){ prnMsg(_('There might be no supplier purchasing data set up for any items on the selected sales order(s). No purchase orders have been created'),'warn'); } else { Modified: trunk/Shipments.php =================================================================== --- trunk/Shipments.php 2011-10-10 15:43:31 UTC (rev 4717) +++ trunk/Shipments.php 2011-10-11 09:10:13 UTC (rev 4718) @@ -251,6 +251,7 @@ purchorderdetails.quantityrecd, purchorderdetails.deliverydate, stockmaster.units, + stockmaster.decimalplaces, purchorderdetails.qtyinvoiced FROM purchorderdetails INNER JOIN stockmaster ON purchorderdetails.itemcode=stockmaster.stockid @@ -268,17 +269,17 @@ } $_SESSION['Shipment']->add_to_shipment($_GET['Add'], - $myrow['orderno'], - $myrow['itemcode'], - $myrow['itemdescription'], - $myrow['qtyinvoiced'], - $myrow['unitprice'], - $myrow['units'], - $myrow['deliverydate'], - $myrow['quantityord'], - $myrow['quantityrecd'], - $StandardCost, - $db); + $myrow['orderno'], + $myrow['itemcode'], + $myrow['itemdescription'], + $myrow['qtyinvoiced'], + $myrow['unitprice'], + $myrow['units'], + $myrow['deliverydate'], + $myrow['quantityord'], + $myrow['quantityrecd'], + $StandardCost, + $db); } if (isset($_GET['Delete']) AND $_SESSION['Shipment']->Closed==0){ //shipment is open and user hit delete on a line @@ -312,7 +313,7 @@ echo '<tr><td>'. _('Expected Arrival Date (ETA)'). ': </td>'; if (isset($_SESSION['Shipment']->ETA)) { - echo '<td><input type="text class="date" alt='.$_SESSION['DefaultDateFormat'].' name="ETA" maxlength=10 size=10 value="' . $ETA . '" /></td>'; + echo '<td><input type="text class="date" alt='.$_SESSION['DefaultDateFormat'].' name="ETA" maxlength="10" size="10" value="' . $ETA . '" /></td>'; } else { echo '<td><input type="text class="date" alt='.$_SESSION['DefaultDateFormat'].' name="ETA" maxlength=10 size=10 value="' . Date($_SESSION['DefaultDateFormat']) . '" /></td>'; } @@ -382,7 +383,7 @@ /* Always display all shipment lines */ echo '<br /><table cellpadding=2 colspan=7 class="selection">'; - echo '<tr><th colspan=9><font color=navy size=3>'. _('Order Lines On This Shipment'). '</font></th></tr>'; + echo '<tr><th colspan="9"><font color="navy" size="3">'. _('Order Lines On This Shipment'). '</font></th></tr>'; $TableHeader = '<tr> <th>'. _('Order'). '</th> @@ -419,19 +420,22 @@ echo '<td>'.$LnItm->OrderNo.'</td> - <td>'. $LnItm->StockID .' - '. $LnItm->ItemDescription. '</td><td class=number>' . locale_number_format($LnItm->QuantityOrd,2) . '</td> + <td>'. $LnItm->StockID .' - '. $LnItm->ItemDescription. '</td><td class="number">' . locale_number_format($LnItm->QuantityOrd,2) . '</td> <td>'. $LnItm->UOM .'</td> - <td class=number>' . locale_number_format($LnItm->QuantityRecd,2) . '</td> - <td class=number>' . locale_number_format($LnItm->QtyInvoiced,2) . '</td> - <td class=number>' . locale_number_format($LnItm->UnitPrice,2) . '</td> - <td class=number>' . locale_number_format($LnItm->StdCostUnit,2) . '</td> + <td class="number">' . locale_number_format($LnItm->QuantityRecd,2) . '</td> + <td class="number">' . locale_number_format($LnItm->QtyInvoiced,2) . '</td> + <td class="number">' . locale_number_format($LnItm->UnitPrice,2) . '</td> + <td class="number">' . locale_number_format($LnItm->StdCostUnit,2) . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $LnItm->PODetailItem . '">'. _('Delete'). '</a></td> </tr>'; }//for each line on the shipment echo '</table>'; }//there are lines on the shipment -echo '<br /><div class="centre"><input type=submit name="Update" value="'. _('Update Shipment Details') . '" /></div><p>'; +echo '<br /> + <div class="centre"> + <input type="submit" name="Update" value="'. _('Update Shipment Details') . '" /> + </div>'; if (!isset($_POST['StockLocation'])) { $_POST['StockLocation'] =$_SESSION['Shipment']->StockLocation; @@ -445,7 +449,8 @@ purchorderdetails.quantityord, purchorderdetails.quantityrecd, purchorderdetails.deliverydate, - stockmaster.units + stockmaster.units, + stockmaster.decimalplaces FROM purchorderdetails INNER JOIN purchorders ON purchorderdetails.orderno=purchorders.orderno INNER JOIN stockmaster @@ -496,10 +501,10 @@ echo '<td>' . $myrow['orderno'] . '</td> <td>' . $myrow['itemcode'] . ' - ' . $myrow['itemdescription'] . '</td> - <td class=number>' . locale_number_format($myrow['quantityord'],2) . '</td> + <td class="number">' . locale_number_format($myrow['quantityord'],$myrow['decimalplaces']) . '</td> <td>' . $myrow['units'] . '</td> - <td class=number>' . locale_number_format($myrow['quantityrecd'],2) . '</td> - <td class=number>' . ConvertSQLDate($myrow['deliverydate']) . '</td> + <td class="number">' . locale_number_format($myrow['quantityrecd'],,$myrow['decimalplaces']) . '</td> + <td class="number">' . ConvertSQLDate($myrow['deliverydate']) . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?' . 'Add=' . $myrow['podetailitem'] . '">'. _('Add').'</a></td> </tr>'; Modified: trunk/Shippers.php =================================================================== --- trunk/Shippers.php 2011-10-10 15:43:31 UTC (rev 4717) +++ trunk/Shippers.php 2011-10-11 09:10:13 UTC (rev 4718) @@ -32,12 +32,12 @@ if (mb_strlen($_POST['ShipperName']) >40) { $InputError = 1; - prnMsg( _("The shipper's name must be forty characters or less long"), 'error'); + prnMsg( _('The shipper\'s name must be forty characters or less long'), 'error'); $Errors[$i] = 'ShipperName'; $i++; } elseif( trim($_POST['ShipperName']) == '' ) { $InputError = 1; - prnMsg( _("The shipper's name may not be empty"), 'error'); + prnMsg( _('The shipper\'s name may not be empty'), 'error'); $Errors[$i] = 'ShipperName'; $i++; } @@ -48,13 +48,13 @@ would not run in this case cos submit is false of course see the delete code below*/ - $sql = "UPDATE shippers SET shippername='" . $_POST['ShipperName'] . "' WHERE shipper_id = '".$SelectedShipper."'"; + $sql = "UPDATE shippers SET shippername='" . DB_escape_string($_POST['ShipperN... [truncated message content] |
From: <dai...@us...> - 2011-10-14 06:08:17
|
Revision: 4719 http://web-erp.svn.sourceforge.net/web-erp/?rev=4719&view=rev Author: daintree Date: 2011-10-14 06:08:10 +0000 (Fri, 14 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/FixedAssetRegister.php trunk/SelectGLAccount.php trunk/StockCostUpdate.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/reportwriter/WriteForm.inc Modified: trunk/FixedAssetRegister.php =================================================================== --- trunk/FixedAssetRegister.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/FixedAssetRegister.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -4,7 +4,7 @@ $title = _('Fixed Asset Register'); $csv_output = ''; // Reports being generated in HTML, PDF and CSV/EXCEL format -if (isset($_POST['submit']) or isset($_POST['pdf']) or isset($_POST['csv'])) { +if (isset($_POST['submit']) OR isset($_POST['pdf']) OR isset($_POST['csv'])) { if (isset($_POST['pdf'])) { $PaperSize = 'A4_Landscape'; include ('includes/PDFStarter.php'); @@ -213,11 +213,11 @@ header('Location: ' .$_SESSION['reports_dir'] . '/FixedAssetRegister_' . Date('Y-m-d') .'.csv'); } else { - echo '<input type=hidden name="FromDate" value="' . $_POST['FromDate'] . '">'; - echo '<input type=hidden name="ToDate" value=' . $_POST['ToDate'] . '>'; - echo '<input type=hidden name="AssetCategory" value=' . $_POST['AssetCategory'] . '>'; - echo '<input type=hidden name="AssetID" value=' . $_POST['AssetID'] . '>'; - echo '<input type=hidden name="AssetLocation" value=' . $_POST['AssetLocation'] . '>'; + echo '<input type="hidden" name="FromDate" value="' . $_POST['FromDate'] . '" />'; + echo '<input type="hidden" name="ToDate" value=' . $_POST['ToDate'] . '>'; + echo '<input type="hidden" name="AssetCategory" value="' . $_POST['AssetCategory'] . '" />'; + echo '<input type="hidden" name="AssetID" value="' . $_POST['AssetID'] . '" />'; + echo '<input type="hidden" name="AssetLocation" value="' . $_POST['AssetLocation'] . '" />'; //Total Values echo '<tr><th style="vertical-align:top" colspan="5">' . _('TOTAL') . '</th>'; echo '<th style="text-align:right">' . locale_number_format($TotalCostBfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; @@ -229,8 +229,8 @@ echo '<th style="text-align:right">' . locale_number_format($TotalNBV, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; echo '<th style="text-align:right">' . locale_number_format($TotalDisposals, $_SESSION['CompanyRecord']['decimalplaces']) . '</th></tr>'; echo '</table>'; - echo '<br /><div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; - echo '<input type="Submit" name="csv" value="' . _('Print as CSV') . '"></div></form>'; + echo '<br /><div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '" /> '; + echo '<input type="submit" name="csv" value="' . _('Print as CSV') . '" /></div></form>'; } } else { include ('includes/header.inc'); @@ -283,16 +283,16 @@ $_POST['ToDate'] = date($_SESSION['DefaultDateFormat']); } - echo '<tr><th>' . _(' From Date') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=11 value="' . $_POST['FromDate'] . '"></td>'; + echo '<tr><th>' . _(' From Date') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=11 value="' . $_POST['FromDate'] . '" /></td>'; echo '</tr>'; - echo '<tr><th>' . _('To Date ') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '"></td> + echo '<tr><th>' . _('To Date ') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td> </tr> </table> <br />'; - + echo '<div class="centre"><input type="submit" name="submit" value="' . _('Show Assets') . '"> '; - echo '<input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; - echo '<input type="Submit" name = "csv" value= "' . _('Print as CSV') . '"></div>'; + echo '<input type="submit" name="pdf" value="' . _('Print as a pdf') . '" /> '; + echo '<input type="Submit" name = "csv" value= "' . _('Print as CSV') . '" /></div>'; echo '</form>'; } include ('includes/footer.inc'); Modified: trunk/SelectGLAccount.php =================================================================== --- trunk/SelectGLAccount.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/SelectGLAccount.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -111,11 +111,11 @@ while ($myrow=DB_fetch_array($result)) { - printf("<tr><td><font size=1><input type=submit name='Select' VALUE='%s'</font></td> + printf('<tr><td><font size=1><input type="submit" name="Select" value="%s" /></font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> - </tr>", + </tr>', $myrow['accountcode'], $myrow['accountname'], $myrow['group_'], Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/StockCostUpdate.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -55,7 +55,7 @@ DB_free_result($OldResult); $OldCost = $_POST['OldMaterialCost'] + $_POST['OldLabourCost'] + $_POST['OldOverheadCost']; - $NewCost =$_POST['MaterialCost'] + $_POST['LabourCost'] + $_POST['OverheadCost']; + $NewCost = filter_number_format($_POST['MaterialCost']) + filter_number_format($_POST['LabourCost']) + filter_number_format($_POST['OverheadCost']); $result = DB_query("SELECT * FROM stockmaster WHERE stockid='" . $StockID . "'",$db); $myrow = DB_fetch_row($result); @@ -66,9 +66,9 @@ $Result = DB_Txn_Begin($db); ItemCostUpdateGL($db, $StockID, $NewCost, $OldCost, $_POST['QOH']); - $SQL = "UPDATE stockmaster SET materialcost='" . $_POST['MaterialCost'] . "', - labourcost='" . $_POST['LabourCost'] . "', - overheadcost='" . $_POST['OverheadCost'] . "', + $SQL = "UPDATE stockmaster SET materialcost='" . filter_number_format($_POST['MaterialCost']) . "', + labourcost='" . filter_number_format($_POST['LabourCost']) . "', + overheadcost='" . filter_number_format($_POST['OverheadCost']) . "', lastcost='" . $OldCost . "', lastcostupdate ='" . Date('Y-m-d')."' WHERE stockid='" . $StockID . "'"; @@ -116,15 +116,15 @@ $myrow = DB_fetch_array($result); -echo '<form action="' . $_SERVER['PHP_SELF'] . '?'. SID .'" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding=2 class=selection>'; -echo '<tr><th colspan=2>' . _('Item Code') . ':<input type="text" name="StockID" value="' . $StockID . '" 1 maxlength=20>'; -echo '<input type="submit" name="Show" value="' . _('Show Cost Details') . '"></th></tr>'; -echo '<tr><th colspan=2><font color=navy size=2>' . $StockID . ' - ' . $myrow['description'] . '</font></th></tr>'; -echo '<tr><th colspan=2><font color=navy size=2>'. _('Total Quantity On Hand') . ': ' . $myrow['totalqoh'] . ' ' . $myrow['units'] .'</font></th></tr>'; -echo '<tr><th colspan=2><font color=navy size=2>'. _('Last Cost update on') . ': ' . ConvertSQLDate($myrow['lastcostupdate']) .'</font></th></tr>'; +echo '<table cellpadding="2" class="selection">'; +echo '<tr><th colspan="2">' . _('Item Code') . ':<input type="text" name="StockID" value="' . $StockID . '" maxlength="20" />'; +echo '<input type="submit" name="Show" value="' . _('Show Cost Details') . '" /></th></tr>'; +echo '<tr><th colspan="2"><font color="navy" size="2">' . $StockID . ' - ' . $myrow['description'] . '</font></th></tr>'; +echo '<tr><th colspan="2"><font color="navy" size="2">'. _('Total Quantity On Hand') . ': ' . $myrow['totalqoh'] . ' ' . $myrow['units'] .'</font></th></tr>'; +echo '<tr><th colspan="2"><font color="navy" size="2">'. _('Last Cost update on') . ': ' . ConvertSQLDate($myrow['lastcostupdate']) .'</font></th></tr>'; if (($myrow['mbflag']=='D' AND $myrow['stocktype'] != 'L') OR $myrow['mbflag']=='A' @@ -142,10 +142,10 @@ exit; } -echo '<input type=hidden name="OldMaterialCost" value="' . $myrow['materialcost'] .'">'; -echo '<input type=hidden name="OldLabourCost" value="' . $myrow['labourcost'] .'">'; -echo '<input type=hidden name="OldOverheadCost" value="' . $myrow['overheadcost'] .'">'; -echo '<input type=hidden name="QOH" value="' . $myrow['totalqoh'] .'">'; +echo '<input type="hidden" name="OldMaterialCost" value="' . $myrow['materialcost'] .'" />'; +echo '<input type="hidden" name="OldLabourCost" value="' . $myrow['labourcost'] .'" />'; +echo '<input type="hidden" name="OldOverheadCost" value="' . $myrow['overheadcost'] .'" />'; +echo '<input type="hidden" name="QOH" value="' . $myrow['totalqoh'] .'" />'; echo '<tr><td>' . _('Last Cost') .':</td> <td class="number">' . locale_number_format($myrow['lastcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; @@ -163,22 +163,27 @@ </tr>'; echo '<tr> <td>' . _('Standard Labour Cost Per Unit') . ':</td> - <td class="number"><input type="text" class="number" name="LabourCost" value=' . $myrow['labourcost'] . '></td> + <td class="number"><input type="text" class="number" name="LabourCost" value="' . locale_number_format($myrow['labourcost'],4) . '" /></td> </tr>'; echo '<tr> <td>' . _('Standard Overhead Cost Per Unit') . ':</td> - <td class="number"><input type="text" class="number" name="OverheadCost" value=' . $myrow['overheadcost'] . '></td> + <td class="number"><input type="text" class="number" name="OverheadCost" value="' . locale_number_format($myrow['overheadcost'],4) . '" /></td> </tr>'; } elseif ($myrow['mbflag']=='B' OR $myrow['mbflag']=='D') { echo '<tr> <td>' . _('Standard Cost') .':</td> - <td class="number"><input type="text" class="number" name="MaterialCost" value=' . $myrow['materialcost'] . '></td> + <td class="number"><input type="text" class="number" name="MaterialCost" value="' . locale_number_format($myrow['materialcost'],4) . '" /></td> </tr>'; } else { echo '<input type="hidden" name="LabourCost" value=0>'; echo '<input type="hidden" name="OverheadCost" value=0>'; } - echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" value="' . _('Update') . '"><br /><br />'; + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="UpdateData" value="' . _('Update') . '" /> + <br /> + <br />'; } if ($myrow['mbflag']!='D'){ echo '<div class="centre"><a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '>' . _('Show Stock Status') . '</a>'; @@ -187,6 +192,7 @@ echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>'; echo '<br /><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a></div>'; } -echo '</form></div>'; +echo '</form> + </div>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/StockDispatch.php =================================================================== --- trunk/StockDispatch.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/StockDispatch.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -10,7 +10,7 @@ If (isset($_POST['PrintPDF'])) { include('includes/PDFStarter.php'); - if (!is_numeric($_POST['Percent'])) { + if (!is_numeric(filter_number_format($_POST['Percent']))) { $_POST['Percent'] = 0; } @@ -63,7 +63,7 @@ stockmaster.serialised, stockmaster.controlled, ROUND((locstock.reorderlevel - locstock.quantity) * - (1 + (" . $_POST['Percent'] . "/100))) + (1 + (" . filter_number_format($_POST['Percent']) . "/100))) as neededqty, (fromlocstock.quantity - fromlocstock.reorderlevel) as available, fromlocstock.reorderlevel as fromreorderlevel, @@ -89,9 +89,10 @@ $title = _('Stock Dispatch - Problem Report'); include('includes/header.inc'); prnMsg( _('The Stock Dispatch report could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br /><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /> + <a href="' .$rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br />$sql"; + echo '<br />' . $sql; } include('includes/footer.inc'); exit; @@ -101,7 +102,8 @@ include('includes/header.inc'); echo '<br />'; prnMsg( _('The stock dispatch did not have any items to list'),'warn'); - echo "<br /><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /> + <a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } @@ -226,7 +228,9 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); $DefaultLocation = $myrow['defaultlocation']; - echo '<br/><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '<br/> + <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT loccode, locationname @@ -235,8 +239,14 @@ if (!isset($_POST['FromLocation'])) { $_POST['FromLocation']=$DefaultLocation; } - echo '<table class=selection><tr><td>' . _('Dispatch Percent') . ':</td><td><input type ="text" name="Percent" class="number" size="8" value=0>'; - echo '<tr><td>' . _('From Stock Location') . ':</td><td><select name="FromLocation"> '; + echo '<table class="selection"> + <tr> + <td>' . _('Dispatch Percent') . ':</td> + <td><input type ="text" name="Percent" class="number" size="8" value="0" /> + </tr>'; + echo '<tr> + <td>' . _('From Stock Location') . ':</td> + <td><select name="FromLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if ($myrow['loccode'] == $_POST['FromLocation']){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; @@ -244,22 +254,26 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; DB_data_seek($resultStkLocs,0); if (!isset($_POST['ToLocation'])) { $_POST['ToLocation']=$DefaultLocation; } - echo '<tr><td>' . _('To Stock Location') . ':</td><td><select name="ToLocation"> '; + echo '<tr> + <td>' . _('To Stock Location') . ':</td> + <td><select name="ToLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if ($myrow['loccode'] == $_POST['ToLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; - $SQL='SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription'; + $SQL="SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); if (DB_num_rows($result1)==0){ echo '</table></td></tr> @@ -274,7 +288,9 @@ // Define StockCat with 'name="StockCat[ ]" multiple' so can select more than one // Also have to change way define $WhereCategory for WHERE clause - echo '<tr><td>' . _('In Stock Category') . ':</td><td><select name="StockCat">'; + echo '<tr> + <td>' . _('In Stock Category') . ':</td> + <td><select name="StockCat">'; if (!isset($_POST['StockCat'])){ $_POST['StockCat']='All'; } @@ -305,14 +321,17 @@ echo '<option value="simple">' . _('Simple') . '</option>'; echo '</select></td><td> </td></tr>'; - echo '</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 */ - function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, $Page_Width,$Right_Margin,$Trf_ID,$FromLocation,$ToLocation,$template) { Modified: trunk/StockLocMovements.php =================================================================== --- trunk/StockLocMovements.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/StockLocMovements.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -7,29 +7,30 @@ include('includes/header.inc'); -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 class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; -echo '<table class=selection><tr><td>'; -echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; +echo '<table class="selection"> + <tr> + <td> ' . _('From Stock Location') . ':<select name="StockLocation"> '; $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } @@ -41,53 +42,59 @@ if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,Date('d'),Date('y'))); } -echo ' ' . _('Show Movements before') . ': <input type="text" name="BeforeDate" size=12 maxlength=12 Value="' . $_POST['BeforeDate'] . '">'; -echo ' ' . _('But after') . ': <input type=TEXT name="AfterDate" size=12 maxlength=12 Value="' . $_POST['AfterDate'] . '">'; -echo '</td></tr></table><br />'; -echo '<div class=centre><input type=submit name="ShowMoves" VALUE="' . _('Show Stock Movements') . '"></div><br />'; +echo ' ' . _('Show Movements before') . ': <input type="text" name="BeforeDate" size="12" maxlength="12" value="' . $_POST['BeforeDate'] . '" />'; +echo ' ' . _('But after') . ': <input type="text" name="AfterDate" size="12" maxlength="12" value="' . $_POST['AfterDate'] . '" />'; +echo '</td> + </tr> + </table> + <br />'; +echo '<div class="centre"> + <input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '" /> + </div> + <br />'; $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); $SQLAfterDate = FormatDateForSQL($_POST['AfterDate']); $sql = "SELECT stockmoves.stockid, - systypes.typename, - stockmoves.type, - stockmoves.transno, - stockmoves.trandate, - stockmoves.debtorno, - stockmoves.branchcode, - stockmoves.qty, - stockmoves.reference, - stockmoves.price, - stockmoves.discountpercent, - stockmoves.newqoh, - stockmaster.decimalplaces - FROM stockmoves - INNER JOIN systypes ON stockmoves.type=systypes.typeid - INNER JOIN stockmaster ON stockmoves.stockid=stockmaster.stockid - WHERE stockmoves.loccode='" . $_POST['StockLocation'] . "' - AND stockmoves.trandate >= '". $SQLAfterDate . "' - AND stockmoves.trandate <= '" . $SQLBeforeDate . "' - AND hidemovt=0 - ORDER BY stkmoveno DESC"; + systypes.typename, + stockmoves.type, + stockmoves.transno, + stockmoves.trandate, + stockmoves.debtorno, + stockmoves.branchcode, + stockmoves.qty, + stockmoves.reference, + stockmoves.price, + stockmoves.discountpercent, + stockmoves.newqoh, + stockmaster.decimalplaces + FROM stockmoves + INNER JOIN systypes ON stockmoves.type=systypes.typeid + INNER JOIN stockmaster ON stockmoves.stockid=stockmaster.stockid + WHERE stockmoves.loccode='" . $_POST['StockLocation'] . "' + AND stockmoves.trandate >= '". $SQLAfterDate . "' + AND stockmoves.trandate <= '" . $SQLBeforeDate . "' + AND hidemovt=0 + ORDER BY stkmoveno DESC"; $ErrMsg = _('The stock movements for the selected criteria could not be retrieved because'); $MovtsResult = DB_query($sql, $db,$ErrMsg); echo '<table cellpadding=5 cellspacing="4 "class="selection">'; $tableheader = '<tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Type') . '</th> - <th>' . _('Trans No') . '</th> - <th>' . _('Date') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Reference') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Quantity on Hand') . '</th> - </tr>'; + <th>' . _('Item Code') . '</th> + <th>' . _('Type') . '</th> + <th>' . _('Trans No') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Quantity on Hand') . '</th> + </tr>'; echo $tableheader; $j = 1; @@ -111,11 +118,11 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> </tr>', mb_strtoupper($myrow['stockid']), mb_strtoupper($myrow['stockid']), Modified: trunk/StockLocStatus.php =================================================================== --- trunk/StockLocStatus.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/StockLocStatus.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -19,14 +19,16 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT loccode, - locationname - FROM locations"; + locationname + FROM locations"; $resultStkLocs = DB_query($sql,$db); -echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title.'</p>'; +echo '<p class="page_title_text"> + <img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . + '" alt="" />' . ' ' . $title.' + </p>'; -echo '<table class=selection> +echo '<table class="selection"> <tr><td>' . _('From Stock Location') . ':</td> <td><select name="StockLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ @@ -45,9 +47,9 @@ } echo '</select></td></tr>'; -$SQL="SELECT categoryid, - categorydescription - FROM stockcategory +$SQL="SELECT categoryid, + categorydescription + FROM stockcategory ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); if (DB_num_rows($result1)==0){ @@ -84,22 +86,27 @@ $_POST['BelowReorderQuantity']='All'; } if ($_POST['BelowReorderQuantity']=='All'){ - echo '<option selected value="All">' . _('All') . '</option>'; - echo '<option value="Below">' . _('Only Items Below Re-order Quantity') . '</option>'; - echo '<option value="NotZero">' . _('Only items where stock is available') . '</option>'; + echo '<option selected value="All">' . _('All') . '</option> + <option value="Below">' . _('Only Items Below Re-order Quantity') . '</option> + <option value="NotZero">' . _('Only items where stock is available') . '</option>'; } else if ($_POST['BelowReorderQuantity']=='Below') { - echo '<option value="All">' . _('All') . '</option>'; - echo '<option selected value="Below">' . _('Only Items Below Re-order Quantity') . '</option>'; - echo '<option value="NotZero">' . _('Only items where stock is available') . '</option>'; + echo '<option value="All">' . _('All') . '</option> + <option selected value="Below">' . _('Only Items Below Re-order Quantity') . '</option> + <option value="NotZero">' . _('Only items where stock is available') . '</option>'; } else { - echo '<option value="All">' . _('All') . '</option>'; - echo '<option value="Below">' . _('Only Items Below Re-order Quantity') . '</option>'; - echo '<option selected value="NotZero">' . _('Only items where stock is available') . '</option>'; + echo '<option value="All">' . _('All') . '</option> + <option value="Below">' . _('Only Items Below Re-order Quantity') . '</option> + <option selected value="NotZero">' . _('Only items where stock is available') . '</option>'; } -echo '</td></tr></table>'; +echo '</td> + </tr> + </table>'; -echo '<br /><div class="centre"><input type=submit name="ShowStatus" value="' . _('Show Stock Status') . '"></div>'; +echo '<br /> + <div class="centre"> + <input type="submit" name="ShowStatus" value="' . _('Show Stock Status') . '" /> + </div>'; if (isset($_POST['ShowStatus'])){ @@ -142,21 +149,21 @@ ORDER BY locstock.stockid"; } - $ErrMsg = _('The stock held at each location cannot be retrieved because'); $DbgMsg = _('The SQL that failed was'); $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); - echo '<br /><table cellpadding=5 cellspacing=4 class="selection">'; + echo '<br /> + <table cellpadding="5" cellspacing="4" class="selection">'; $tableheader = '<tr> - <th>' . _('StockID') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Quantity On Hand') . '</th> - <th>' . _('Re-Order Level') . '</th> - <th>' . _('Demand') . '</th> - <th>' . _('Available') . '</th> - <th>' . _('On Order') . '</th> + <th>' . _('StockID') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th>' . _('Re-Order Level') . '</th> + <th>' . _('Demand') . '</th> + <th>' . _('Available') . '</th> + <th>' . _('On Order') . '</th> </tr>'; echo $tableheader; $j = 1; @@ -167,12 +174,11 @@ $StockID = $myrow['stockid']; $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem - FROM salesorderdetails, - salesorders - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.fromstkloc='" . $myrow['loccode'] . "' - AND salesorderdetails.completed=0 - AND salesorderdetails.stkcode='" . $StockID . "'"; + FROM salesorderdetails INNER JOIN salesorders + ON salesorders.orderno = salesorderdetails.orderno + WHERE salesorders.fromstkloc='" . $myrow['loccode'] . "' + AND salesorderdetails.completed=0 + AND salesorderdetails.stkcode='" . $StockID . "'"; $ErrMsg = _('The demand for this product from') . ' ' . $myrow['loccode'] . ' ' . _('cannot be retrieved because'); $DemandResult = DB_query($sql,$db,$ErrMsg); @@ -185,17 +191,16 @@ } //Also need to add in the demand as a component of an assembly items if this items has any assembly parents. - $sql = "SELECT Sum((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem - FROM salesorderdetails, - salesorders, - bom, - stockmaster - WHERE salesorderdetails.stkcode=bom.parent - AND salesorders.orderno = salesorderdetails.orderno - AND salesorders.fromstkloc='" . $myrow['loccode'] . "' + $sql = "SELECT SUM((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem + FROM salesorderdetails INNER JOIN salesorders + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN bom + ON salesorderdetails.stkcode=bom.parent + INNER JOIN stockmaster + ON stockmaster.stockid=bom.parent + WHERE salesorders.fromstkloc='" . $myrow['loccode'] . "' AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 AND bom.component='" . $StockID . "' - AND stockmaster.stockid=bom.parent AND stockmaster.mbflag='A'"; $ErrMsg = _('The demand for this product from') . ' ' . $myrow['loccode'] . ' ' . _('cannot be retrieved because'); @@ ... [truncated message content] |
From: <dai...@us...> - 2011-10-14 06:08:17
|
Revision: 4719 http://web-erp.svn.sourceforge.net/web-erp/?rev=4719&view=rev Author: daintree Date: 2011-10-14 06:08:10 +0000 (Fri, 14 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/FixedAssetRegister.php trunk/SelectGLAccount.php trunk/StockCostUpdate.php trunk/StockDispatch.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/reportwriter/WriteForm.inc Modified: trunk/FixedAssetRegister.php =================================================================== --- trunk/FixedAssetRegister.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/FixedAssetRegister.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -4,7 +4,7 @@ $title = _('Fixed Asset Register'); $csv_output = ''; // Reports being generated in HTML, PDF and CSV/EXCEL format -if (isset($_POST['submit']) or isset($_POST['pdf']) or isset($_POST['csv'])) { +if (isset($_POST['submit']) OR isset($_POST['pdf']) OR isset($_POST['csv'])) { if (isset($_POST['pdf'])) { $PaperSize = 'A4_Landscape'; include ('includes/PDFStarter.php'); @@ -213,11 +213,11 @@ header('Location: ' .$_SESSION['reports_dir'] . '/FixedAssetRegister_' . Date('Y-m-d') .'.csv'); } else { - echo '<input type=hidden name="FromDate" value="' . $_POST['FromDate'] . '">'; - echo '<input type=hidden name="ToDate" value=' . $_POST['ToDate'] . '>'; - echo '<input type=hidden name="AssetCategory" value=' . $_POST['AssetCategory'] . '>'; - echo '<input type=hidden name="AssetID" value=' . $_POST['AssetID'] . '>'; - echo '<input type=hidden name="AssetLocation" value=' . $_POST['AssetLocation'] . '>'; + echo '<input type="hidden" name="FromDate" value="' . $_POST['FromDate'] . '" />'; + echo '<input type="hidden" name="ToDate" value=' . $_POST['ToDate'] . '>'; + echo '<input type="hidden" name="AssetCategory" value="' . $_POST['AssetCategory'] . '" />'; + echo '<input type="hidden" name="AssetID" value="' . $_POST['AssetID'] . '" />'; + echo '<input type="hidden" name="AssetLocation" value="' . $_POST['AssetLocation'] . '" />'; //Total Values echo '<tr><th style="vertical-align:top" colspan="5">' . _('TOTAL') . '</th>'; echo '<th style="text-align:right">' . locale_number_format($TotalCostBfwd, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; @@ -229,8 +229,8 @@ echo '<th style="text-align:right">' . locale_number_format($TotalNBV, $_SESSION['CompanyRecord']['decimalplaces']) . '</th>'; echo '<th style="text-align:right">' . locale_number_format($TotalDisposals, $_SESSION['CompanyRecord']['decimalplaces']) . '</th></tr>'; echo '</table>'; - echo '<br /><div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; - echo '<input type="Submit" name="csv" value="' . _('Print as CSV') . '"></div></form>'; + echo '<br /><div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '" /> '; + echo '<input type="submit" name="csv" value="' . _('Print as CSV') . '" /></div></form>'; } } else { include ('includes/header.inc'); @@ -283,16 +283,16 @@ $_POST['ToDate'] = date($_SESSION['DefaultDateFormat']); } - echo '<tr><th>' . _(' From Date') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=11 value="' . $_POST['FromDate'] . '"></td>'; + echo '<tr><th>' . _(' From Date') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="FromDate" maxlength=10 size=11 value="' . $_POST['FromDate'] . '" /></td>'; echo '</tr>'; - echo '<tr><th>' . _('To Date ') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '"></td> + echo '<tr><th>' . _('To Date ') . '</th><td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="ToDate" maxlength="10" size="11" value="' . $_POST['ToDate'] . '" /></td> </tr> </table> <br />'; - + echo '<div class="centre"><input type="submit" name="submit" value="' . _('Show Assets') . '"> '; - echo '<input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"> '; - echo '<input type="Submit" name = "csv" value= "' . _('Print as CSV') . '"></div>'; + echo '<input type="submit" name="pdf" value="' . _('Print as a pdf') . '" /> '; + echo '<input type="Submit" name = "csv" value= "' . _('Print as CSV') . '" /></div>'; echo '</form>'; } include ('includes/footer.inc'); Modified: trunk/SelectGLAccount.php =================================================================== --- trunk/SelectGLAccount.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/SelectGLAccount.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -111,11 +111,11 @@ while ($myrow=DB_fetch_array($result)) { - printf("<tr><td><font size=1><input type=submit name='Select' VALUE='%s'</font></td> + printf('<tr><td><font size=1><input type="submit" name="Select" value="%s" /></font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> <td><font size=1>%s</font></td> - </tr>", + </tr>', $myrow['accountcode'], $myrow['accountname'], $myrow['group_'], Modified: trunk/StockCostUpdate.php =================================================================== --- trunk/StockCostUpdate.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/StockCostUpdate.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -55,7 +55,7 @@ DB_free_result($OldResult); $OldCost = $_POST['OldMaterialCost'] + $_POST['OldLabourCost'] + $_POST['OldOverheadCost']; - $NewCost =$_POST['MaterialCost'] + $_POST['LabourCost'] + $_POST['OverheadCost']; + $NewCost = filter_number_format($_POST['MaterialCost']) + filter_number_format($_POST['LabourCost']) + filter_number_format($_POST['OverheadCost']); $result = DB_query("SELECT * FROM stockmaster WHERE stockid='" . $StockID . "'",$db); $myrow = DB_fetch_row($result); @@ -66,9 +66,9 @@ $Result = DB_Txn_Begin($db); ItemCostUpdateGL($db, $StockID, $NewCost, $OldCost, $_POST['QOH']); - $SQL = "UPDATE stockmaster SET materialcost='" . $_POST['MaterialCost'] . "', - labourcost='" . $_POST['LabourCost'] . "', - overheadcost='" . $_POST['OverheadCost'] . "', + $SQL = "UPDATE stockmaster SET materialcost='" . filter_number_format($_POST['MaterialCost']) . "', + labourcost='" . filter_number_format($_POST['LabourCost']) . "', + overheadcost='" . filter_number_format($_POST['OverheadCost']) . "', lastcost='" . $OldCost . "', lastcostupdate ='" . Date('Y-m-d')."' WHERE stockid='" . $StockID . "'"; @@ -116,15 +116,15 @@ $myrow = DB_fetch_array($result); -echo '<form action="' . $_SERVER['PHP_SELF'] . '?'. SID .'" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<table cellpadding=2 class=selection>'; -echo '<tr><th colspan=2>' . _('Item Code') . ':<input type="text" name="StockID" value="' . $StockID . '" 1 maxlength=20>'; -echo '<input type="submit" name="Show" value="' . _('Show Cost Details') . '"></th></tr>'; -echo '<tr><th colspan=2><font color=navy size=2>' . $StockID . ' - ' . $myrow['description'] . '</font></th></tr>'; -echo '<tr><th colspan=2><font color=navy size=2>'. _('Total Quantity On Hand') . ': ' . $myrow['totalqoh'] . ' ' . $myrow['units'] .'</font></th></tr>'; -echo '<tr><th colspan=2><font color=navy size=2>'. _('Last Cost update on') . ': ' . ConvertSQLDate($myrow['lastcostupdate']) .'</font></th></tr>'; +echo '<table cellpadding="2" class="selection">'; +echo '<tr><th colspan="2">' . _('Item Code') . ':<input type="text" name="StockID" value="' . $StockID . '" maxlength="20" />'; +echo '<input type="submit" name="Show" value="' . _('Show Cost Details') . '" /></th></tr>'; +echo '<tr><th colspan="2"><font color="navy" size="2">' . $StockID . ' - ' . $myrow['description'] . '</font></th></tr>'; +echo '<tr><th colspan="2"><font color="navy" size="2">'. _('Total Quantity On Hand') . ': ' . $myrow['totalqoh'] . ' ' . $myrow['units'] .'</font></th></tr>'; +echo '<tr><th colspan="2"><font color="navy" size="2">'. _('Last Cost update on') . ': ' . ConvertSQLDate($myrow['lastcostupdate']) .'</font></th></tr>'; if (($myrow['mbflag']=='D' AND $myrow['stocktype'] != 'L') OR $myrow['mbflag']=='A' @@ -142,10 +142,10 @@ exit; } -echo '<input type=hidden name="OldMaterialCost" value="' . $myrow['materialcost'] .'">'; -echo '<input type=hidden name="OldLabourCost" value="' . $myrow['labourcost'] .'">'; -echo '<input type=hidden name="OldOverheadCost" value="' . $myrow['overheadcost'] .'">'; -echo '<input type=hidden name="QOH" value="' . $myrow['totalqoh'] .'">'; +echo '<input type="hidden" name="OldMaterialCost" value="' . $myrow['materialcost'] .'" />'; +echo '<input type="hidden" name="OldLabourCost" value="' . $myrow['labourcost'] .'" />'; +echo '<input type="hidden" name="OldOverheadCost" value="' . $myrow['overheadcost'] .'" />'; +echo '<input type="hidden" name="QOH" value="' . $myrow['totalqoh'] .'" />'; echo '<tr><td>' . _('Last Cost') .':</td> <td class="number">' . locale_number_format($myrow['lastcost'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; @@ -163,22 +163,27 @@ </tr>'; echo '<tr> <td>' . _('Standard Labour Cost Per Unit') . ':</td> - <td class="number"><input type="text" class="number" name="LabourCost" value=' . $myrow['labourcost'] . '></td> + <td class="number"><input type="text" class="number" name="LabourCost" value="' . locale_number_format($myrow['labourcost'],4) . '" /></td> </tr>'; echo '<tr> <td>' . _('Standard Overhead Cost Per Unit') . ':</td> - <td class="number"><input type="text" class="number" name="OverheadCost" value=' . $myrow['overheadcost'] . '></td> + <td class="number"><input type="text" class="number" name="OverheadCost" value="' . locale_number_format($myrow['overheadcost'],4) . '" /></td> </tr>'; } elseif ($myrow['mbflag']=='B' OR $myrow['mbflag']=='D') { echo '<tr> <td>' . _('Standard Cost') .':</td> - <td class="number"><input type="text" class="number" name="MaterialCost" value=' . $myrow['materialcost'] . '></td> + <td class="number"><input type="text" class="number" name="MaterialCost" value="' . locale_number_format($myrow['materialcost'],4) . '" /></td> </tr>'; } else { echo '<input type="hidden" name="LabourCost" value=0>'; echo '<input type="hidden" name="OverheadCost" value=0>'; } - echo '</table><br /><div class="centre"><input type="submit" name="UpdateData" value="' . _('Update') . '"><br /><br />'; + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="UpdateData" value="' . _('Update') . '" /> + <br /> + <br />'; } if ($myrow['mbflag']!='D'){ echo '<div class="centre"><a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '>' . _('Show Stock Status') . '</a>'; @@ -187,6 +192,7 @@ echo '<br /><a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a>'; echo '<br /><a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a></div>'; } -echo '</form></div>'; +echo '</form> + </div>'; include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/StockDispatch.php =================================================================== --- trunk/StockDispatch.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/StockDispatch.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -10,7 +10,7 @@ If (isset($_POST['PrintPDF'])) { include('includes/PDFStarter.php'); - if (!is_numeric($_POST['Percent'])) { + if (!is_numeric(filter_number_format($_POST['Percent']))) { $_POST['Percent'] = 0; } @@ -63,7 +63,7 @@ stockmaster.serialised, stockmaster.controlled, ROUND((locstock.reorderlevel - locstock.quantity) * - (1 + (" . $_POST['Percent'] . "/100))) + (1 + (" . filter_number_format($_POST['Percent']) . "/100))) as neededqty, (fromlocstock.quantity - fromlocstock.reorderlevel) as available, fromlocstock.reorderlevel as fromreorderlevel, @@ -89,9 +89,10 @@ $title = _('Stock Dispatch - Problem Report'); include('includes/header.inc'); prnMsg( _('The Stock Dispatch report could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); - echo "<br /><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /> + <a href="' .$rootpath . '/index.php">' . _('Back to the menu') . '</a>'; if ($debug==1){ - echo "<br />$sql"; + echo '<br />' . $sql; } include('includes/footer.inc'); exit; @@ -101,7 +102,8 @@ include('includes/header.inc'); echo '<br />'; prnMsg( _('The stock dispatch did not have any items to list'),'warn'); - echo "<br /><a href='" .$rootpath .'/index.php?' . SID . "'>" . _('Back to the menu') . '</a>'; + echo '<br /> + <a href="' .$rootpath .'/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } @@ -226,7 +228,9 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); $DefaultLocation = $myrow['defaultlocation']; - echo '<br/><form action=' . $_SERVER['PHP_SELF'] . " method='post'><table class=selection>"; + echo '<br/> + <form action="' . $_SERVER['PHP_SELF'] . '" method="post"> + <table class="selection">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT loccode, locationname @@ -235,8 +239,14 @@ if (!isset($_POST['FromLocation'])) { $_POST['FromLocation']=$DefaultLocation; } - echo '<table class=selection><tr><td>' . _('Dispatch Percent') . ':</td><td><input type ="text" name="Percent" class="number" size="8" value=0>'; - echo '<tr><td>' . _('From Stock Location') . ':</td><td><select name="FromLocation"> '; + echo '<table class="selection"> + <tr> + <td>' . _('Dispatch Percent') . ':</td> + <td><input type ="text" name="Percent" class="number" size="8" value="0" /> + </tr>'; + echo '<tr> + <td>' . _('From Stock Location') . ':</td> + <td><select name="FromLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if ($myrow['loccode'] == $_POST['FromLocation']){ echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; @@ -244,22 +254,26 @@ echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; DB_data_seek($resultStkLocs,0); if (!isset($_POST['ToLocation'])) { $_POST['ToLocation']=$DefaultLocation; } - echo '<tr><td>' . _('To Stock Location') . ':</td><td><select name="ToLocation"> '; + echo '<tr> + <td>' . _('To Stock Location') . ':</td> + <td><select name="ToLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ if ($myrow['loccode'] == $_POST['ToLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; - $SQL='SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription'; + $SQL="SELECT categoryid, categorydescription FROM stockcategory ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); if (DB_num_rows($result1)==0){ echo '</table></td></tr> @@ -274,7 +288,9 @@ // Define StockCat with 'name="StockCat[ ]" multiple' so can select more than one // Also have to change way define $WhereCategory for WHERE clause - echo '<tr><td>' . _('In Stock Category') . ':</td><td><select name="StockCat">'; + echo '<tr> + <td>' . _('In Stock Category') . ':</td> + <td><select name="StockCat">'; if (!isset($_POST['StockCat'])){ $_POST['StockCat']='All'; } @@ -305,14 +321,17 @@ echo '<option value="simple">' . _('Simple') . '</option>'; echo '</select></td><td> </td></tr>'; - echo '</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 */ - function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, $Page_Width,$Right_Margin,$Trf_ID,$FromLocation,$ToLocation,$template) { Modified: trunk/StockLocMovements.php =================================================================== --- trunk/StockLocMovements.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/StockLocMovements.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -7,29 +7,30 @@ include('includes/header.inc'); -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 class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p>'; -echo '<table class=selection><tr><td>'; -echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; +echo '<table class="selection"> + <tr> + <td> ' . _('From Stock Location') . ':<select name="StockLocation"> '; $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation']) AND $_POST['StockLocation']!='All'){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; $_POST['StockLocation']=$myrow['loccode']; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } @@ -41,53 +42,59 @@ if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-1,Date('d'),Date('y'))); } -echo ' ' . _('Show Movements before') . ': <input type="text" name="BeforeDate" size=12 maxlength=12 Value="' . $_POST['BeforeDate'] . '">'; -echo ' ' . _('But after') . ': <input type=TEXT name="AfterDate" size=12 maxlength=12 Value="' . $_POST['AfterDate'] . '">'; -echo '</td></tr></table><br />'; -echo '<div class=centre><input type=submit name="ShowMoves" VALUE="' . _('Show Stock Movements') . '"></div><br />'; +echo ' ' . _('Show Movements before') . ': <input type="text" name="BeforeDate" size="12" maxlength="12" value="' . $_POST['BeforeDate'] . '" />'; +echo ' ' . _('But after') . ': <input type="text" name="AfterDate" size="12" maxlength="12" value="' . $_POST['AfterDate'] . '" />'; +echo '</td> + </tr> + </table> + <br />'; +echo '<div class="centre"> + <input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '" /> + </div> + <br />'; $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); $SQLAfterDate = FormatDateForSQL($_POST['AfterDate']); $sql = "SELECT stockmoves.stockid, - systypes.typename, - stockmoves.type, - stockmoves.transno, - stockmoves.trandate, - stockmoves.debtorno, - stockmoves.branchcode, - stockmoves.qty, - stockmoves.reference, - stockmoves.price, - stockmoves.discountpercent, - stockmoves.newqoh, - stockmaster.decimalplaces - FROM stockmoves - INNER JOIN systypes ON stockmoves.type=systypes.typeid - INNER JOIN stockmaster ON stockmoves.stockid=stockmaster.stockid - WHERE stockmoves.loccode='" . $_POST['StockLocation'] . "' - AND stockmoves.trandate >= '". $SQLAfterDate . "' - AND stockmoves.trandate <= '" . $SQLBeforeDate . "' - AND hidemovt=0 - ORDER BY stkmoveno DESC"; + systypes.typename, + stockmoves.type, + stockmoves.transno, + stockmoves.trandate, + stockmoves.debtorno, + stockmoves.branchcode, + stockmoves.qty, + stockmoves.reference, + stockmoves.price, + stockmoves.discountpercent, + stockmoves.newqoh, + stockmaster.decimalplaces + FROM stockmoves + INNER JOIN systypes ON stockmoves.type=systypes.typeid + INNER JOIN stockmaster ON stockmoves.stockid=stockmaster.stockid + WHERE stockmoves.loccode='" . $_POST['StockLocation'] . "' + AND stockmoves.trandate >= '". $SQLAfterDate . "' + AND stockmoves.trandate <= '" . $SQLBeforeDate . "' + AND hidemovt=0 + ORDER BY stkmoveno DESC"; $ErrMsg = _('The stock movements for the selected criteria could not be retrieved because'); $MovtsResult = DB_query($sql, $db,$ErrMsg); echo '<table cellpadding=5 cellspacing="4 "class="selection">'; $tableheader = '<tr> - <th>' . _('Item Code') . '</th> - <th>' . _('Type') . '</th> - <th>' . _('Trans No') . '</th> - <th>' . _('Date') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Reference') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('Quantity on Hand') . '</th> - </tr>'; + <th>' . _('Item Code') . '</th> + <th>' . _('Type') . '</th> + <th>' . _('Trans No') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('Quantity on Hand') . '</th> + </tr>'; echo $tableheader; $j = 1; @@ -111,11 +118,11 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number">%s</td> </tr>', mb_strtoupper($myrow['stockid']), mb_strtoupper($myrow['stockid']), Modified: trunk/StockLocStatus.php =================================================================== --- trunk/StockLocStatus.php 2011-10-11 09:10:13 UTC (rev 4718) +++ trunk/StockLocStatus.php 2011-10-14 06:08:10 UTC (rev 4719) @@ -19,14 +19,16 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $sql = "SELECT loccode, - locationname - FROM locations"; + locationname + FROM locations"; $resultStkLocs = DB_query($sql,$db); -echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . - '" alt="" />' . ' ' . $title.'</p>'; +echo '<p class="page_title_text"> + <img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . + '" alt="" />' . ' ' . $title.' + </p>'; -echo '<table class=selection> +echo '<table class="selection"> <tr><td>' . _('From Stock Location') . ':</td> <td><select name="StockLocation"> '; while ($myrow=DB_fetch_array($resultStkLocs)){ @@ -45,9 +47,9 @@ } echo '</select></td></tr>'; -$SQL="SELECT categoryid, - categorydescription - FROM stockcategory +$SQL="SELECT categoryid, + categorydescription + FROM stockcategory ORDER BY categorydescription"; $result1 = DB_query($SQL,$db); if (DB_num_rows($result1)==0){ @@ -84,22 +86,27 @@ $_POST['BelowReorderQuantity']='All'; } if ($_POST['BelowReorderQuantity']=='All'){ - echo '<option selected value="All">' . _('All') . '</option>'; - echo '<option value="Below">' . _('Only Items Below Re-order Quantity') . '</option>'; - echo '<option value="NotZero">' . _('Only items where stock is available') . '</option>'; + echo '<option selected value="All">' . _('All') . '</option> + <option value="Below">' . _('Only Items Below Re-order Quantity') . '</option> + <option value="NotZero">' . _('Only items where stock is available') . '</option>'; } else if ($_POST['BelowReorderQuantity']=='Below') { - echo '<option value="All">' . _('All') . '</option>'; - echo '<option selected value="Below">' . _('Only Items Below Re-order Quantity') . '</option>'; - echo '<option value="NotZero">' . _('Only items where stock is available') . '</option>'; + echo '<option value="All">' . _('All') . '</option> + <option selected value="Below">' . _('Only Items Below Re-order Quantity') . '</option> + <option value="NotZero">' . _('Only items where stock is available') . '</option>'; } else { - echo '<option value="All">' . _('All') . '</option>'; - echo '<option value="Below">' . _('Only Items Below Re-order Quantity') . '</option>'; - echo '<option selected value="NotZero">' . _('Only items where stock is available') . '</option>'; + echo '<option value="All">' . _('All') . '</option> + <option value="Below">' . _('Only Items Below Re-order Quantity') . '</option> + <option selected value="NotZero">' . _('Only items where stock is available') . '</option>'; } -echo '</td></tr></table>'; +echo '</td> + </tr> + </table>'; -echo '<br /><div class="centre"><input type=submit name="ShowStatus" value="' . _('Show Stock Status') . '"></div>'; +echo '<br /> + <div class="centre"> + <input type="submit" name="ShowStatus" value="' . _('Show Stock Status') . '" /> + </div>'; if (isset($_POST['ShowStatus'])){ @@ -142,21 +149,21 @@ ORDER BY locstock.stockid"; } - $ErrMsg = _('The stock held at each location cannot be retrieved because'); $DbgMsg = _('The SQL that failed was'); $LocStockResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); - echo '<br /><table cellpadding=5 cellspacing=4 class="selection">'; + echo '<br /> + <table cellpadding="5" cellspacing="4" class="selection">'; $tableheader = '<tr> - <th>' . _('StockID') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Quantity On Hand') . '</th> - <th>' . _('Re-Order Level') . '</th> - <th>' . _('Demand') . '</th> - <th>' . _('Available') . '</th> - <th>' . _('On Order') . '</th> + <th>' . _('StockID') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity On Hand') . '</th> + <th>' . _('Re-Order Level') . '</th> + <th>' . _('Demand') . '</th> + <th>' . _('Available') . '</th> + <th>' . _('On Order') . '</th> </tr>'; echo $tableheader; $j = 1; @@ -167,12 +174,11 @@ $StockID = $myrow['stockid']; $sql = "SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem - FROM salesorderdetails, - salesorders - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.fromstkloc='" . $myrow['loccode'] . "' - AND salesorderdetails.completed=0 - AND salesorderdetails.stkcode='" . $StockID . "'"; + FROM salesorderdetails INNER JOIN salesorders + ON salesorders.orderno = salesorderdetails.orderno + WHERE salesorders.fromstkloc='" . $myrow['loccode'] . "' + AND salesorderdetails.completed=0 + AND salesorderdetails.stkcode='" . $StockID . "'"; $ErrMsg = _('The demand for this product from') . ' ' . $myrow['loccode'] . ' ' . _('cannot be retrieved because'); $DemandResult = DB_query($sql,$db,$ErrMsg); @@ -185,17 +191,16 @@ } //Also need to add in the demand as a component of an assembly items if this items has any assembly parents. - $sql = "SELECT Sum((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem - FROM salesorderdetails, - salesorders, - bom, - stockmaster - WHERE salesorderdetails.stkcode=bom.parent - AND salesorders.orderno = salesorderdetails.orderno - AND salesorders.fromstkloc='" . $myrow['loccode'] . "' + $sql = "SELECT SUM((salesorderdetails.quantity-salesorderdetails.qtyinvoiced)*bom.quantity) AS dem + FROM salesorderdetails INNER JOIN salesorders + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN bom + ON salesorderdetails.stkcode=bom.parent + INNER JOIN stockmaster + ON stockmaster.stockid=bom.parent + WHERE salesorders.fromstkloc='" . $myrow['loccode'] . "' AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 AND bom.component='" . $StockID . "' - AND stockmaster.stockid=bom.parent AND stockmaster.mbflag='A'"; $ErrMsg = _('The demand for this product from') . ' ' . $myrow['loccode'] . ' ' . _('cannot be retrieved because'); @@ ... [truncated message content] |
From: <dai...@us...> - 2011-10-14 06:11:21
|
Revision: 4720 http://web-erp.svn.sourceforge.net/web-erp/?rev=4720&view=rev Author: daintree Date: 2011-10-14 06:11:13 +0000 (Fri, 14 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/SelectRecurringSalesOrder.php trunk/SelectSupplier.php trunk/ShipmentCosting.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCategories.php trunk/StockCheck.php trunk/includes/DefineSpecialOrderClass.php Modified: trunk/SelectRecurringSalesOrder.php =================================================================== --- trunk/SelectRecurringSalesOrder.php 2011-10-14 06:08:10 UTC (rev 4719) +++ trunk/SelectRecurringSalesOrder.php 2011-10-14 06:11:13 UTC (rev 4720) @@ -10,8 +10,10 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . _('Inventory Items') . '" alt="" />' . ' ' . $title . '</p>'; -echo '<table class="selection"><tr><td>'; -echo _('Select recurring order templates for delivery from:') . ' </td><td>' . '<select name="StockLocation">'; +echo '<table class="selection"> + <tr> + <td>' . _('Select recurring order templates for delivery from:') . ' </td> + <td>' . '<select name="StockLocation">'; $sql = "SELECT loccode, locationname FROM locations"; @@ -31,9 +33,11 @@ } } -echo '</select></td></tr></table>'; +echo '</select></td> + </tr> + </table>'; -echo '<br /><div class=centre><input type="submit" name="SearchRecurringOrders" value="' . _('Search Recurring Orders') . '"></div>'; +echo '<br /><div class=centre><input type="submit" name="SearchRecurringOrders" value="' . _('Search Recurring Orders') . '" /></div>'; if (isset($_POST['SearchRecurringOrders'])){ @@ -78,15 +82,15 @@ <table cellpadding="2" colspan="7" width="90%" class="selection">'; $tableheader = '<tr> - <th>' . _('Modify') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Branch') . '</th> - <th>' . _('Cust Order') . ' #</th> - <th>' . _('Last Recurrence') . '</th> - <th>' . _('End Date') . '</th> - <th>' . _('Times p.a.') . '</th> - <th>' . _('Order Total') . '</th> - </tr>'; + <th>' . _('Modify') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Cust Order') . ' #</th> + <th>' . _('Last Recurrence') . '</th> + <th>' . _('End Date') . '</th> + <th>' . _('Times p.a.') . '</th> + <th>' . _('Order Total') . '</th> + </tr>'; echo $tableheader; @@ -109,23 +113,23 @@ $FormatedOrderValue = locale_number_format($myrow['ordervalue'],$myrow['currdecimalplaces']); printf('<td><a href="%s">%s</a></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - </tr>', - $ModifyPage, - $myrow['recurrorderno'], - $myrow['name'], - $myrow['brname'], - $myrow['customerref'], - $FormatedLastRecurrence, - $FormatedStopDate, - $myrow['frequency'], - $FormatedOrderValue); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + </tr>', + $ModifyPage, + $myrow['recurrorderno'], + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedLastRecurrence, + $FormatedStopDate, + $myrow['frequency'], + $FormatedOrderValue); $j++; If ($j == 12){ Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2011-10-14 06:08:10 UTC (rev 4719) +++ trunk/SelectSupplier.php 2011-10-14 06:11:13 UTC (rev 4720) @@ -145,11 +145,11 @@ echo '<br /> <table width=90% colspan=2 cellpadding=4> <tr> - <th width=33%>' . _('Supplier Inquiries') . '</th> - <th width=33%>' . _('Supplier Transactions') . '</th> - <th width=33%>' . _('Supplier Maintenance') . '</th> + <th width="33%">' . _('Supplier Inquiries') . '</th> + <th width="33%">' . _('Supplier Transactions') . '</th> + <th width="33%">' . _('Supplier Maintenance') . '</th> </tr>'; - echo '<tr><td valign=top class="select">'; /* Inquiry Options */ + echo '<tr><td valign="top" class="select">'; /* Inquiry Options */ echo '<a href="' . $rootpath . '/SupplierInquiry.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Supplier Account Inquiry') . '</a> <br /> <br />'; @@ -180,14 +180,14 @@ echo '<br />'; echo '<table width=90% colspan=2 cellpadding=4> <tr> - <th width=33%>' . _('Supplier Inquiries') . '</th> - <th width=33%>' . _('Supplier Transactions') . '</th> - <th width=33%>' . _('Supplier Maintenance') . '</th> + <th width="33%">' . _('Supplier Inquiries') . '</th> + <th width="33%">' . _('Supplier Transactions') . '</th> + <th width="33%">' . _('Supplier Maintenance') . '</th> </tr>'; echo '<tr> - <td valign=top class="select"></td> - <td valign=top class="select"></td> - <td valign=top class="select">'; /* Supplier Maintenance */ + <td valign="top" class="select"></td> + <td valign="top" class="select"></td> + <td valign="top" class="select">'; /* Supplier Maintenance */ echo '<a href="' . $rootpath . '/Suppliers.php">' . _('Add a New Supplier') . '</a><br />'; echo '</td> </tr> Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-10-14 06:08:10 UTC (rev 4719) +++ trunk/ShipmentCosting.php 2011-10-14 06:11:13 UTC (rev 4720) @@ -11,7 +11,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; -if (isset($_GET['NewShipment']) and $_GET['NewShipment']=='Yes'){ +if (isset($_GET['NewShipment']) AND $_GET['NewShipment']=='Yes'){ unset($_SESSION['Shipment']->LineItems); unset($_SESSION['Shipment']); } @@ -47,7 +47,7 @@ $HeaderData = DB_fetch_array($GetShiptHdrResult); echo '<br />'; echo '<table class="selection">'; -echo '<tr><th colspan=4><font size=3 color=navy>'._('Shipment Details').'</font></th></tr>'; +echo '<tr><th colspan="4"><font size="3" color="navy">'._('Shipment Details').'</font></th></tr>'; echo '<tr> <td><b>'. _('Shipment') .': </td> <td><b>' . $_GET['SelectedShipment'] . '</b></td> @@ -260,8 +260,7 @@ /*So we need to write off some of the variance to variances and only the balance of the quantity in stock to go to stock value */ - $WriteOffToVariances = ($myrow['totqtyinvoiced'] - $TotalQuantityOnHand) - * ($ItemShipmentCost - $StdCostUnit); + $WriteOffToVariances = ($myrow['totqtyinvoiced'] - $TotalQuantityOnHand) * ($ItemShipmentCost - $StdCostUnit); } @@ -286,7 +285,7 @@ '" . $PeriodNo . "', '" . $StockGLCodes['purchpricevaract'] . "', '" . $myrow['itemcode'] . ' ' . _('shipment cost') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['deicmalplaces']) . _('shipment quantity > stock held - variance write off') . "', - " . filter_number_format($WriteOffToVariances) . ")"; + " . $WriteOffToVariances . ")"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL entry for the shipment variance posting for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); $result = DB_query($sql,$db, $ErrMsg,'',TRUE); @@ -306,7 +305,7 @@ '" . $PeriodNo . "', '" . $StockGLCodes['stockact'] . "', '" . $myrow['itemcode'] . ' ' . _('shipment avg cost adjt') . "', - '" . filter_number_format($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit)- $WriteOffToVariances) . "')"; + '" . ($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit)- $WriteOffToVariances) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL entry for the shipment average cost adjustment for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); $result = DB_query($sql,$db, $ErrMsg,'',TRUE); @@ -329,14 +328,23 @@ $CostIncrement = ($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit) - $WriteOffToVariances) / $TotalQuantityOnHand; - $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=materialcost+" . filter_number_format($CostIncrement) . " - WHERE stockid='" . $myrow['itemcode'] . "'"; + $sql = "UPDATE stockmaster + SET lastcost=materialcost+overheadcost+labourcost, + materialcost=materialcost+" . $CostIncrement . ", + lastcostupdate='" . Date('Y-m-d') . "' + WHERE stockid='" . $myrow['itemcode'] . "'"; + $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg,'',TRUE); + } else { - $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost='" . filter_number_format($ItemShipmentCost) . "' WHERE stockid='" . $myrow['itemcode'] . "'"; + $sql = "UPDATE stockmaster + SET lastcost=materialcost+overheadcost+labourcost, + materialcost='" . $ItemShipmentCost . "', + lastcostupdate='" . Date('Y-m-d') . "' + WHERE stockid='" . $myrow['itemcode'] . "'"; + $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg,'',TRUE); + } /* End of Weighted Average Costing Code */ @@ -356,7 +364,9 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $StockGLCodes['purchpricevaract'] . "', - '" . $myrow['itemcode'] . ' ' . _('shipment cost') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' x ' . _('Qty recd') .' ' . $myrow['totqtyrecd'] . "', " . filter_number_format(-$Variance * $myrow['totqtyrecd']) . ")"; + '" . $myrow['itemcode'] . ' ' . _('shipment cost') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' x ' . _('Qty recd') .' ' . $myrow['totqtyrecd'] . "', + " . -$Variance * $myrow['totqtyrecd'] . ")"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The Positive GL entry for the shipment variance posting for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); $result = DB_query($sql,$db, $ErrMsg,'',TRUE); } @@ -378,7 +388,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['grnact'] . "', '" . $myrow['itemcode'] . ' ' ._('shipment cost') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' x ' . _('Qty invoiced') . ' ' . $myrow['totqtyinvoiced'] . "', - " . filter_number_format($Variance * $myrow['totqtyinvoiced']) . ")"; + " . ($Variance * $myrow['totqtyinvoiced']) . ")"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit GL entry for the shipment variance posting for') . ' ' . $myrow['itemcode'] . ' ' . _('could not be inserted because'); @@ -388,7 +398,9 @@ if ( $_POST['UpdateCost'] == 'Yes' ){ /*Only ever a standard costing option Weighted average costing implies cost updates taking place automatically */ - $QOHResult = DB_query("SELECT SUM(quantity) FROM locstock WHERE stockid ='" . $myrow['itemcode'] . "'",$db); + $QOHResult = DB_query("SELECT SUM(quantity) + FROM locstock + WHERE stockid ='" . $myrow['itemcode'] . "'",$db); $QOHRow = DB_fetch_row($QOHResult); $QOH=$QOHRow[0]; @@ -411,7 +423,7 @@ '" . $PeriodNo . "', '" . $StockGLCodes['adjglact'] . "', '" . _('Shipment of') . ' ' . $myrow['itemcode'] . " " . _('cost was') . ' ' . $StdCostUnit . ' ' . _('changed to') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' x ' . _('QOH of') . ' ' . $QOH . "', - " . filter_number_format(-$ValueOfChange) . ")"; + " . -$ValueOfChange . ")"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL credit for the shipment stock cost adjustment posting could not be inserted because'). ' ' . DB_error_msg($db); @@ -430,7 +442,8 @@ '" . $PeriodNo . "', '" . $StockGLCodes['stockact'] . "', '" . _('Shipment of') . ' ' . $myrow['itemcode'] . ' ' . _('cost was') . ' ' . $StdCostUnit . ' ' . _('changed to') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' x ' . _('QOH of') . ' ' . $QOH . "', - " . filter_number_format($ValueOfChange) . ")"; + " . $ValueOfChange . ")"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL debit for stock cost adjustment posting could not be inserted because') .' '. DB_error_msg($db); $Result = DB_query($SQL,$db, $ErrMsg,'',TRUE); @@ -438,10 +451,11 @@ } /*end of GL entries for a standard cost update */ /* Only the material cost is important for imported items */ - $sql = "UPDATE stockmaster SET materialcost=" . filter_number_format($ItemShipmentCost) . ", + $sql = "UPDATE stockmaster SET materialcost=" . $ItemShipmentCost . ", labourcost=0, overheadcost=0, - lastcost='" . filter_number_format($StdCostUnit) . "' + lastcost='" . $StdCostUnit . "', + lastcostupdate='" . Date('Y-m-d') . "' WHERE stockid='" . $myrow['itemcode'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment cost details for the stock item could not be updated because'). ': ' . DB_error_msg($db); @@ -455,8 +469,8 @@ /* Item / Qty Inv/ FX price/ Local Val/ Portion of chgs/ Shipt Cost/ Std Cost/ Variance/ Var % */ echo '<td>' . $myrow['itemcode'] . ' - ' . $myrow['itemdescription'] . '</td> - <td class="number">' . locale_number_format($myrow['totqtyinvoiced'],2) . '</td> - <td class="number">' . locale_number_format($myrow['totqtyrecd'],2) . '</td> + <td class="number">' . locale_number_format($myrow['totqtyinvoiced'],'Variable') . '</td> + <td class="number">' . locale_number_format($myrow['totqtyrecd'],'Variable') . '</td> <td class="number">' . locale_number_format($ItemCharges,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($PortionOfCharges,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> @@ -465,20 +479,24 @@ <td class="number">' . $VariancePercentage . '%</td></tr>'; } } -echo '<tr><td colspan=3 class="number"><font color=BLUE><b>'. _('Total Shipment Charges'). '</b></font></td> - <td class="number">' . locale_number_format($TotalInvoiceValueOfShipment,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($TotalCostsToApportion,$_SESSION['CompanyRecord']['decimalplaces']) .'</td></tr>'; +echo '<tr> + <td colspan=3 class="number"><font color=BLUE><b>'. _('Total Shipment Charges'). '</b></font></td> + <td class="number">' . locale_number_format($TotalInvoiceValueOfShipment,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($TotalCostsToApportion,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + </tr>'; -echo '<tr><td colspan=6 class="number">' . _('Total Value of all variances on this shipment') . '</td> - <td class="number">' . locale_number_format($TotalShiptVariance,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; +echo '<tr> + <td colspan="6" class="number">' . _('Total Value of all variances on this shipment') . '</td> + <td class="number">' . locale_number_format($TotalShiptVariance,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; echo '</table>'; echo '<br /> - <table colspan=2 width=95%> + <table colspan="2" width="95%"> <tr> - <td valign=top>'; // put this shipment charges side by side in a table (major table 2 cols) + <td valign="top">'; // put this shipment charges side by side in a table (major table 2 cols) $sql = "SELECT suppliers.suppname, supptrans.suppreference, @@ -505,7 +523,9 @@ $ChargesResult = DB_query($sql,$db); echo '<table cellpadding="2" colspan="6" class="selection">'; -echo '<tr><th colspan=6><font color="navy" size="3">' . _('Shipment Charges Against Products'). '</font></th></tr>'; +echo '<tr> + <th colspan="6"><font color="navy" size="3">' . _('Shipment Charges Against Products'). '</font></th> + </tr>'; $TableHeader = '<tr> <th>'. _('Supplier'). '</th> @@ -540,13 +560,16 @@ <td>' . $myrow['suppreference'] . '</td> <td>' . ConvertSQLDate($myrow['trandate']) . '</td> <td>' . $myrow['stockid'] . '</td> - <td class="number">' . locale_number_format($myrow['value'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + <td class="number">' . locale_number_format($myrow['value'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; $TotalItemShipmentChgs += $myrow['value']; } -echo '<tr><td colspan=5 class="number"><font color=BLUE><b>'. _('Total Charges Against Shipment Items'). ':</b></font></td> - <td class="number">' . locale_number_format($TotalItemShipmentChgs,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; +echo '<tr> + <td colspan="5" class="number"><font color="blue"><b>'. _('Total Charges Against Shipment Items'). ':</b></font></td> + <td class="number">' . locale_number_format($TotalItemShipmentChgs,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; echo '</table>'; @@ -577,7 +600,9 @@ $ChargesResult = DB_query($sql,$db); echo '<table cellpadding="2" colspan="5" class="selection">'; -echo '<tr><th colspan="6"><font color="navy" size="3">'._('General Shipment Charges').'</font></th></tr>'; +echo '<tr> + <th colspan="6"><font color="navy" size="3">'._('General Shipment Charges').'</font></th> + </tr>'; $TableHeader = '<tr> <th>'. _('Supplier'). '</th> @@ -621,13 +646,15 @@ echo '</table>'; -echo '</td></tr></table>'; //major table close +echo '</td> + </tr> + </table>'; //major table close if ( isset($_GET['Close'])) { /* Only an opportunity to confirm user wishes to close */ // if the page was called with Close=Yes then show options to confirm OK to c echo '<div class="centre"> - <form method="POST" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; + <form method="post" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ($_SESSION['WeightedAverageCosting']==0){ @@ -637,8 +664,11 @@ <option value="No">'. _('No') . '</option> </select>'; } - echo '<br /><br /><input type=submit name="Close" value="'. _('Confirm OK to Close'). '" />'; - echo '</form></div>'; + echo '<br /> + <br /> + <input type=submit name="Close" value="'. _('Confirm OK to Close'). '" /> + </form> + </div>'; } if ( isset($_POST['Close']) ){ /* OK do the shipment close journals */ Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2011-10-14 06:08:10 UTC (rev 4719) +++ trunk/SpecialOrder.php 2011-10-14 06:11:13 UTC (rev 4720) @@ -28,7 +28,10 @@ } if (!isset($_SESSION['CustomerID']) OR $_SESSION['CustomerID']==""){ - echo '<br /><br />' . _('To set up a special') . ', ' . _('the customer must first be selected from the Select Customer page') . '<br /><a href="' . $rootpath . '/SelectCustomer.php">' . _('Select the customer now') . '</a>'; + echo '<br /> + <br />' . _('To set up a special') . ', ' . _('the customer must first be selected from the Select Customer page') . ' + <br /> + <a href="' . $rootpath . '/SelectCustomer.php">' . _('Select the customer now') . '</a>'; include('includes/footer.inc'); exit; } @@ -109,11 +112,13 @@ } echo '<div class="centre">'; if (!isset($_SESSION['SPL']->BranchCode)){ - echo '<br /><font size="4" color="blue">' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ')'; + echo '<br /> + <font size="4" color="blue">' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ')'; } else { - echo '<br /><font size="4" color="blue">' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ') - ' . _('delivered to') . ' ' . $_SESSION['SPL']->BranchName . ' ' . _('branch'); + echo '<br /> + <font size="4" color="blue">' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ') - ' . _('delivered to') . ' ' . $_SESSION['SPL']->BranchName . ' ' . _('branch'); } -echo '</div></font>'; +echo '</font></div>'; /*if the branch details and delivery details have not been entered then select them from the list */ if (!isset($_SESSION['SPL']->BranchCode)){ @@ -129,12 +134,15 @@ echo '<br /> <br />' . _('Select the customer branch to deliver the special to from the list below'); - echo '</div><br /><table class="selection">'; + echo '</div> + <br /> + <table class="selection">'; - $tableheader = '<tr><th>' ._('Code') . '</th> + $TableHeader = '<tr> + <th>' ._('Code') . '</th> <th>' . _('Branch Name') . '</th> </tr>'; - echo $tableheader; + echo $TableHeader; $j = 1; $k = 0; //row counter to determine background colour @@ -240,13 +248,22 @@ } } -if (isset($_POST['StkLocation'])) {$_SESSION['SPL']->StkLocation = $_POST['StkLocation'];} -if (isset($_POST['Initiator'])) {$_SESSION['SPL']->Initiator = $_POST['Initiator'];} -if (isset($_POST['QuotationRef'])) {$_SESSION['SPL']->QuotationRef = $_POST['QuotationRef'];} -if (isset($_POST['Comments'])) {$_SESSION['SPL']->Comments = $_POST['Comments'];} -if (isset($_POST['CustRef'])) {$_SESSION['SPL']->CustRef = $_POST['CustRef'];} +if (isset($_POST['StkLocation'])) { + $_SESSION['SPL']->StkLocation = $_POST['StkLocation']; +} +if (isset($_POST['Initiator'])) { + $_SESSION['SPL']->Initiator = $_POST['Initiator']; +} +if (isset($_POST['QuotationRef'])) { + $_SESSION['SPL']->QuotationRef = $_POST['QuotationRef']; +} +if (isset($_POST['Comments'])) { + $_SESSION['SPL']->Comments = $_POST['Comments']; +} +if (isset($_POST['CustRef'])) { + $_SESSION['SPL']->CustRef = $_POST['CustRef']; +} - if (isset($_POST['Commit'])){ /*User wishes to commit the order to the database */ /*First do some validation @@ -267,7 +284,6 @@ prnMsg( _('The person entering this order must be specified in the initiator field') . ' - ' . _('a blank initiator is not allowed'),'error'); } - if ($InputError!=1){ if (IsEmailAddress($_SESSION['UserEmail'])){ @@ -287,7 +303,7 @@ $AuthRow=DB_fetch_array($AuthResult); if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $_SESSION['SPL']->Order_Value()) { //user has authority to authrorise as well as create the order - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . '<br />'.$_SESSION['SPL']->StatusComments.'<br />'; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . '<br />'; $_SESSION['SPL']->AllowPrintPO=1; $_SESSION['SPL']->Status = 'Authorised'; } else { // no authority to authorise this order @@ -297,11 +313,7 @@ $AuthMessage = _('You can only authorise up to').' '.$_SESSION['SPL']->SuppCurrCode.' '.$AuthRow['authlevel'] .'.<br />'; } - prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. - $_SESSION['SPL']->SuppCurrCode . ' '. $_SESSION['SPL']->Order_Value() .'. '. - $AuthMessage . - _('If you think this is a mistake please contact the systems administrator') . '<br />'. - _('The order will be created with a status of pending and will require authorisation'), 'warn'); + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. $_SESSION['SPL']->SuppCurrCode . ' '. $_SESSION['SPL']->Order_Value() .'. '. $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. _('The order will be created with a status of pending and will require authorisation'), 'warn'); $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails; $_SESSION['SPL']->Status = 'Pending'; @@ -373,7 +385,6 @@ $_SESSION['SPL']->PurchOrderNo = GetNextTransNo(18, $db); - /*Insert the purchase order detail records */ foreach ($_SESSION['SPL']->LineItems as $SPLLine) { @@ -448,8 +459,8 @@ '" . $OrderDate . "', '" . DB_escape_string($SPLLine->ItemDescription) . "', '" . $GLCode . "', - '" . filter_number_format($SPLLine->Cost) . "', - '" . filter_number_format($SPLLine->Quantity) . "')"; + '" . $SPLLine->Cost . "', + '" . $SPLLine->Quantity . "')"; $ErrMsg = _('One of the purchase order detail records could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the purchase order detail record and failed was'); @@ -538,14 +549,13 @@ $LineItemsSQL = $StartOf_LineItemsSQL . ", '" . DB_escape_string($StockItem->PartCode) . "', - '". filter_number_format($StockItem->Price) . "', - '" . filter_number_format($StockItem->Quantity) . "', + '". $StockItem->Price . "', + '" . $StockItem->Quantity . "', '" . $StockItem->LineNo . "')"; $Ins_LineItemResult = DB_query($LineItemsSQL,$db,$ErrMsg); } /* inserted line items into sales order details */ - unset ($_SESSION['SPL']); prnMsg(_('Purchase Order') . ' ' . $_SESSION['SPL']->PurchOrderNo . ' ' . _('on') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('has been created') .'<br/>' . _('Sales Order Number') . ' ' . $OrderNo . ' ' . _('has been entered') . '. <br/>' . _('Orders created on a cash sales account may need the delivery details for the order to be modified') . '<br />' . _('A freight charge may also be applicable'),'success'); if (count($_SESSION['AllowedPageSecurityTokens'])>1){ @@ -557,10 +567,9 @@ } $Result = DB_Txn_Commit($db); - - unset($_SESSION['SPL']); /*Clear the PO data to allow a newy to be input*/ - echo '<br /><br /><a href="' . $rootpath . '/SpecialOrder.php">' . _('Enter A New Special Order') . '</a>'; - exit; + unset ($_SESSION['SPL']); + echo '<br /><br /><a href="' . $rootpath . '/SpecialOrder.php">' . _('Enter A New Special Order') . '</a>'; + exit; } /*end if there were no input errors trapped */ } /* end of the code to do transfer the SPL object to the database - user hit the place Order*/ @@ -586,8 +595,11 @@ echo '<td>' . _('Initiated By') . ': <input type="text" name="Initiator" size="11" maxlength="10" value="' . $_SESSION['SPL']->Initiator . '" /></td> <td>' . _('Special Ref') . ': <input type="text" name="QuotationRef" size="16" maxlength="15" value="' . $_SESSION['SPL']->QuotationRef . '" /></td> - <td>' . _('Customer Ref') . ': <input type="text" name="CustRef" size="11" maxlength="10" value="' . $_SESSION['SPL']->CustRef . '" /></td></tr> - <tr><td valign="top" colspan="2">' . _('Comments') . ': <textarea name="Comments" cols="70" rows="2">' . $_SESSION['SPL']->Comments . '</textarea></td></tr> + <td>' . _('Customer Ref') . ': <input type="text" name="CustRef" size="11" maxlength="10" value="' . $_SESSION['SPL']->CustRef . '" /></td> + </tr> + <tr> + <td valign="top" colspan="2">' . _('Comments') . ': <textarea name="Comments" cols="70" rows="2">' . $_SESSION['SPL']->Comments . '</textarea></td> + </tr> </table> <hr>'; /* Rule off the header */ @@ -622,7 +634,7 @@ $DisplayLineCostTotalCurr = locale_number_format($LineCostTotal/$_SESSION['SPL']->SuppCurrExRate,$_SESSION['CompanyRecord']['decimalplaces']); $DisplayCost = locale_number_format($SPLLine->Cost,$_SESSION['SPL']->SuppCurrDecimalPlaces); $DisplayPrice = locale_number_format($SPLLine->Price,$_SESSION['SPL']->CustCurrDecimalPlaces); - $DisplayQuantity = locale_number_format($SPLLine->Quantity,2); + $DisplayQuantity = locale_number_format($SPLLine->Quantity,'Variable'); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -647,7 +659,7 @@ $DisplayTotal = locale_number_format($_SESSION['SPL']->total,$_SESSION['SPL']->CustCurrDecimalPlaces); echo '<tr> - <td colspan=8 class="number">' . _('TOTAL Excl Tax') . '</td> + <td colspan="8" class="number">' . _('TOTAL Excl Tax') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> </tr> </table>'; @@ -663,11 +675,14 @@ if (!isset($_POST['ItemDescription'])) { $_POST['ItemDescription']=''; } -echo '<tr><td>' . _('Ordered item Description') . ':</td> - <td><input type="text" name="ItemDescription" size="40" maxlength="40" value="' . $_POST['ItemDescription'] . '" /></td></tr>'; +echo '<tr> + <td>' . _('Ordered item Description') . ':</td> + <td><input type="text" name="ItemDescription" size="40" maxlength="40" value="' . $_POST['ItemDescription'] . '" /></td> + </tr>'; -echo '<tr><td>' . _('Category'... [truncated message content] |
From: <dai...@us...> - 2011-10-14 06:11:21
|
Revision: 4720 http://web-erp.svn.sourceforge.net/web-erp/?rev=4720&view=rev Author: daintree Date: 2011-10-14 06:11:13 +0000 (Fri, 14 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/SelectRecurringSalesOrder.php trunk/SelectSupplier.php trunk/ShipmentCosting.php trunk/SpecialOrder.php trunk/StockAdjustments.php trunk/StockCategories.php trunk/StockCheck.php trunk/includes/DefineSpecialOrderClass.php Modified: trunk/SelectRecurringSalesOrder.php =================================================================== --- trunk/SelectRecurringSalesOrder.php 2011-10-14 06:08:10 UTC (rev 4719) +++ trunk/SelectRecurringSalesOrder.php 2011-10-14 06:11:13 UTC (rev 4720) @@ -10,8 +10,10 @@ echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/customer.png" title="' . _('Inventory Items') . '" alt="" />' . ' ' . $title . '</p>'; -echo '<table class="selection"><tr><td>'; -echo _('Select recurring order templates for delivery from:') . ' </td><td>' . '<select name="StockLocation">'; +echo '<table class="selection"> + <tr> + <td>' . _('Select recurring order templates for delivery from:') . ' </td> + <td>' . '<select name="StockLocation">'; $sql = "SELECT loccode, locationname FROM locations"; @@ -31,9 +33,11 @@ } } -echo '</select></td></tr></table>'; +echo '</select></td> + </tr> + </table>'; -echo '<br /><div class=centre><input type="submit" name="SearchRecurringOrders" value="' . _('Search Recurring Orders') . '"></div>'; +echo '<br /><div class=centre><input type="submit" name="SearchRecurringOrders" value="' . _('Search Recurring Orders') . '" /></div>'; if (isset($_POST['SearchRecurringOrders'])){ @@ -78,15 +82,15 @@ <table cellpadding="2" colspan="7" width="90%" class="selection">'; $tableheader = '<tr> - <th>' . _('Modify') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Branch') . '</th> - <th>' . _('Cust Order') . ' #</th> - <th>' . _('Last Recurrence') . '</th> - <th>' . _('End Date') . '</th> - <th>' . _('Times p.a.') . '</th> - <th>' . _('Order Total') . '</th> - </tr>'; + <th>' . _('Modify') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Cust Order') . ' #</th> + <th>' . _('Last Recurrence') . '</th> + <th>' . _('End Date') . '</th> + <th>' . _('Times p.a.') . '</th> + <th>' . _('Order Total') . '</th> + </tr>'; echo $tableheader; @@ -109,23 +113,23 @@ $FormatedOrderValue = locale_number_format($myrow['ordervalue'],$myrow['currdecimalplaces']); printf('<td><a href="%s">%s</a></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - </tr>', - $ModifyPage, - $myrow['recurrorderno'], - $myrow['name'], - $myrow['brname'], - $myrow['customerref'], - $FormatedLastRecurrence, - $FormatedStopDate, - $myrow['frequency'], - $FormatedOrderValue); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + </tr>', + $ModifyPage, + $myrow['recurrorderno'], + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedLastRecurrence, + $FormatedStopDate, + $myrow['frequency'], + $FormatedOrderValue); $j++; If ($j == 12){ Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2011-10-14 06:08:10 UTC (rev 4719) +++ trunk/SelectSupplier.php 2011-10-14 06:11:13 UTC (rev 4720) @@ -145,11 +145,11 @@ echo '<br /> <table width=90% colspan=2 cellpadding=4> <tr> - <th width=33%>' . _('Supplier Inquiries') . '</th> - <th width=33%>' . _('Supplier Transactions') . '</th> - <th width=33%>' . _('Supplier Maintenance') . '</th> + <th width="33%">' . _('Supplier Inquiries') . '</th> + <th width="33%">' . _('Supplier Transactions') . '</th> + <th width="33%">' . _('Supplier Maintenance') . '</th> </tr>'; - echo '<tr><td valign=top class="select">'; /* Inquiry Options */ + echo '<tr><td valign="top" class="select">'; /* Inquiry Options */ echo '<a href="' . $rootpath . '/SupplierInquiry.php?SupplierID=' . $_SESSION['SupplierID'] . '">' . _('Supplier Account Inquiry') . '</a> <br /> <br />'; @@ -180,14 +180,14 @@ echo '<br />'; echo '<table width=90% colspan=2 cellpadding=4> <tr> - <th width=33%>' . _('Supplier Inquiries') . '</th> - <th width=33%>' . _('Supplier Transactions') . '</th> - <th width=33%>' . _('Supplier Maintenance') . '</th> + <th width="33%">' . _('Supplier Inquiries') . '</th> + <th width="33%">' . _('Supplier Transactions') . '</th> + <th width="33%">' . _('Supplier Maintenance') . '</th> </tr>'; echo '<tr> - <td valign=top class="select"></td> - <td valign=top class="select"></td> - <td valign=top class="select">'; /* Supplier Maintenance */ + <td valign="top" class="select"></td> + <td valign="top" class="select"></td> + <td valign="top" class="select">'; /* Supplier Maintenance */ echo '<a href="' . $rootpath . '/Suppliers.php">' . _('Add a New Supplier') . '</a><br />'; echo '</td> </tr> Modified: trunk/ShipmentCosting.php =================================================================== --- trunk/ShipmentCosting.php 2011-10-14 06:08:10 UTC (rev 4719) +++ trunk/ShipmentCosting.php 2011-10-14 06:11:13 UTC (rev 4720) @@ -11,7 +11,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . '</p>'; -if (isset($_GET['NewShipment']) and $_GET['NewShipment']=='Yes'){ +if (isset($_GET['NewShipment']) AND $_GET['NewShipment']=='Yes'){ unset($_SESSION['Shipment']->LineItems); unset($_SESSION['Shipment']); } @@ -47,7 +47,7 @@ $HeaderData = DB_fetch_array($GetShiptHdrResult); echo '<br />'; echo '<table class="selection">'; -echo '<tr><th colspan=4><font size=3 color=navy>'._('Shipment Details').'</font></th></tr>'; +echo '<tr><th colspan="4"><font size="3" color="navy">'._('Shipment Details').'</font></th></tr>'; echo '<tr> <td><b>'. _('Shipment') .': </td> <td><b>' . $_GET['SelectedShipment'] . '</b></td> @@ -260,8 +260,7 @@ /*So we need to write off some of the variance to variances and only the balance of the quantity in stock to go to stock value */ - $WriteOffToVariances = ($myrow['totqtyinvoiced'] - $TotalQuantityOnHand) - * ($ItemShipmentCost - $StdCostUnit); + $WriteOffToVariances = ($myrow['totqtyinvoiced'] - $TotalQuantityOnHand) * ($ItemShipmentCost - $StdCostUnit); } @@ -286,7 +285,7 @@ '" . $PeriodNo . "', '" . $StockGLCodes['purchpricevaract'] . "', '" . $myrow['itemcode'] . ' ' . _('shipment cost') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['deicmalplaces']) . _('shipment quantity > stock held - variance write off') . "', - " . filter_number_format($WriteOffToVariances) . ")"; + " . $WriteOffToVariances . ")"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL entry for the shipment variance posting for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); $result = DB_query($sql,$db, $ErrMsg,'',TRUE); @@ -306,7 +305,7 @@ '" . $PeriodNo . "', '" . $StockGLCodes['stockact'] . "', '" . $myrow['itemcode'] . ' ' . _('shipment avg cost adjt') . "', - '" . filter_number_format($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit)- $WriteOffToVariances) . "')"; + '" . ($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit)- $WriteOffToVariances) . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL entry for the shipment average cost adjustment for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); $result = DB_query($sql,$db, $ErrMsg,'',TRUE); @@ -329,14 +328,23 @@ $CostIncrement = ($myrow['totqtyinvoiced'] *($ItemShipmentCost - $StdCostUnit) - $WriteOffToVariances) / $TotalQuantityOnHand; - $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost=materialcost+" . filter_number_format($CostIncrement) . " - WHERE stockid='" . $myrow['itemcode'] . "'"; + $sql = "UPDATE stockmaster + SET lastcost=materialcost+overheadcost+labourcost, + materialcost=materialcost+" . $CostIncrement . ", + lastcostupdate='" . Date('Y-m-d') . "' + WHERE stockid='" . $myrow['itemcode'] . "'"; + $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg,'',TRUE); + } else { - $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, - materialcost='" . filter_number_format($ItemShipmentCost) . "' WHERE stockid='" . $myrow['itemcode'] . "'"; + $sql = "UPDATE stockmaster + SET lastcost=materialcost+overheadcost+labourcost, + materialcost='" . $ItemShipmentCost . "', + lastcostupdate='" . Date('Y-m-d') . "' + WHERE stockid='" . $myrow['itemcode'] . "'"; + $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg,'',TRUE); + } /* End of Weighted Average Costing Code */ @@ -356,7 +364,9 @@ '" . Date('Y-m-d') . "', '" . $PeriodNo . "', '" . $StockGLCodes['purchpricevaract'] . "', - '" . $myrow['itemcode'] . ' ' . _('shipment cost') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' x ' . _('Qty recd') .' ' . $myrow['totqtyrecd'] . "', " . filter_number_format(-$Variance * $myrow['totqtyrecd']) . ")"; + '" . $myrow['itemcode'] . ' ' . _('shipment cost') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' x ' . _('Qty recd') .' ' . $myrow['totqtyrecd'] . "', + " . -$Variance * $myrow['totqtyrecd'] . ")"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The Positive GL entry for the shipment variance posting for'). ' ' . $myrow['itemcode'] . ' '. _('could not be inserted into the database because'); $result = DB_query($sql,$db, $ErrMsg,'',TRUE); } @@ -378,7 +388,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['grnact'] . "', '" . $myrow['itemcode'] . ' ' ._('shipment cost') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' x ' . _('Qty invoiced') . ' ' . $myrow['totqtyinvoiced'] . "', - " . filter_number_format($Variance * $myrow['totqtyinvoiced']) . ")"; + " . ($Variance * $myrow['totqtyinvoiced']) . ")"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The credit GL entry for the shipment variance posting for') . ' ' . $myrow['itemcode'] . ' ' . _('could not be inserted because'); @@ -388,7 +398,9 @@ if ( $_POST['UpdateCost'] == 'Yes' ){ /*Only ever a standard costing option Weighted average costing implies cost updates taking place automatically */ - $QOHResult = DB_query("SELECT SUM(quantity) FROM locstock WHERE stockid ='" . $myrow['itemcode'] . "'",$db); + $QOHResult = DB_query("SELECT SUM(quantity) + FROM locstock + WHERE stockid ='" . $myrow['itemcode'] . "'",$db); $QOHRow = DB_fetch_row($QOHResult); $QOH=$QOHRow[0]; @@ -411,7 +423,7 @@ '" . $PeriodNo . "', '" . $StockGLCodes['adjglact'] . "', '" . _('Shipment of') . ' ' . $myrow['itemcode'] . " " . _('cost was') . ' ' . $StdCostUnit . ' ' . _('changed to') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' x ' . _('QOH of') . ' ' . $QOH . "', - " . filter_number_format(-$ValueOfChange) . ")"; + " . -$ValueOfChange . ")"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL credit for the shipment stock cost adjustment posting could not be inserted because'). ' ' . DB_error_msg($db); @@ -430,7 +442,8 @@ '" . $PeriodNo . "', '" . $StockGLCodes['stockact'] . "', '" . _('Shipment of') . ' ' . $myrow['itemcode'] . ' ' . _('cost was') . ' ' . $StdCostUnit . ' ' . _('changed to') . ' ' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . ' x ' . _('QOH of') . ' ' . $QOH . "', - " . filter_number_format($ValueOfChange) . ")"; + " . $ValueOfChange . ")"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The GL debit for stock cost adjustment posting could not be inserted because') .' '. DB_error_msg($db); $Result = DB_query($SQL,$db, $ErrMsg,'',TRUE); @@ -438,10 +451,11 @@ } /*end of GL entries for a standard cost update */ /* Only the material cost is important for imported items */ - $sql = "UPDATE stockmaster SET materialcost=" . filter_number_format($ItemShipmentCost) . ", + $sql = "UPDATE stockmaster SET materialcost=" . $ItemShipmentCost . ", labourcost=0, overheadcost=0, - lastcost='" . filter_number_format($StdCostUnit) . "' + lastcost='" . $StdCostUnit . "', + lastcostupdate='" . Date('Y-m-d') . "' WHERE stockid='" . $myrow['itemcode'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment cost details for the stock item could not be updated because'). ': ' . DB_error_msg($db); @@ -455,8 +469,8 @@ /* Item / Qty Inv/ FX price/ Local Val/ Portion of chgs/ Shipt Cost/ Std Cost/ Variance/ Var % */ echo '<td>' . $myrow['itemcode'] . ' - ' . $myrow['itemdescription'] . '</td> - <td class="number">' . locale_number_format($myrow['totqtyinvoiced'],2) . '</td> - <td class="number">' . locale_number_format($myrow['totqtyrecd'],2) . '</td> + <td class="number">' . locale_number_format($myrow['totqtyinvoiced'],'Variable') . '</td> + <td class="number">' . locale_number_format($myrow['totqtyrecd'],'Variable') . '</td> <td class="number">' . locale_number_format($ItemCharges,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($PortionOfCharges,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> <td class="number">' . locale_number_format($ItemShipmentCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> @@ -465,20 +479,24 @@ <td class="number">' . $VariancePercentage . '%</td></tr>'; } } -echo '<tr><td colspan=3 class="number"><font color=BLUE><b>'. _('Total Shipment Charges'). '</b></font></td> - <td class="number">' . locale_number_format($TotalInvoiceValueOfShipment,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> - <td class="number">' . locale_number_format($TotalCostsToApportion,$_SESSION['CompanyRecord']['decimalplaces']) .'</td></tr>'; +echo '<tr> + <td colspan=3 class="number"><font color=BLUE><b>'. _('Total Shipment Charges'). '</b></font></td> + <td class="number">' . locale_number_format($TotalInvoiceValueOfShipment,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + <td class="number">' . locale_number_format($TotalCostsToApportion,$_SESSION['CompanyRecord']['decimalplaces']) .'</td> + </tr>'; -echo '<tr><td colspan=6 class="number">' . _('Total Value of all variances on this shipment') . '</td> - <td class="number">' . locale_number_format($TotalShiptVariance,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; +echo '<tr> + <td colspan="6" class="number">' . _('Total Value of all variances on this shipment') . '</td> + <td class="number">' . locale_number_format($TotalShiptVariance,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; echo '</table>'; echo '<br /> - <table colspan=2 width=95%> + <table colspan="2" width="95%"> <tr> - <td valign=top>'; // put this shipment charges side by side in a table (major table 2 cols) + <td valign="top">'; // put this shipment charges side by side in a table (major table 2 cols) $sql = "SELECT suppliers.suppname, supptrans.suppreference, @@ -505,7 +523,9 @@ $ChargesResult = DB_query($sql,$db); echo '<table cellpadding="2" colspan="6" class="selection">'; -echo '<tr><th colspan=6><font color="navy" size="3">' . _('Shipment Charges Against Products'). '</font></th></tr>'; +echo '<tr> + <th colspan="6"><font color="navy" size="3">' . _('Shipment Charges Against Products'). '</font></th> + </tr>'; $TableHeader = '<tr> <th>'. _('Supplier'). '</th> @@ -540,13 +560,16 @@ <td>' . $myrow['suppreference'] . '</td> <td>' . ConvertSQLDate($myrow['trandate']) . '</td> <td>' . $myrow['stockid'] . '</td> - <td class="number">' . locale_number_format($myrow['value'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; + <td class="number">' . locale_number_format($myrow['value'],$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; $TotalItemShipmentChgs += $myrow['value']; } -echo '<tr><td colspan=5 class="number"><font color=BLUE><b>'. _('Total Charges Against Shipment Items'). ':</b></font></td> - <td class="number">' . locale_number_format($TotalItemShipmentChgs,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>'; +echo '<tr> + <td colspan="5" class="number"><font color="blue"><b>'. _('Total Charges Against Shipment Items'). ':</b></font></td> + <td class="number">' . locale_number_format($TotalItemShipmentChgs,$_SESSION['CompanyRecord']['decimalplaces']) . '</td> + </tr>'; echo '</table>'; @@ -577,7 +600,9 @@ $ChargesResult = DB_query($sql,$db); echo '<table cellpadding="2" colspan="5" class="selection">'; -echo '<tr><th colspan="6"><font color="navy" size="3">'._('General Shipment Charges').'</font></th></tr>'; +echo '<tr> + <th colspan="6"><font color="navy" size="3">'._('General Shipment Charges').'</font></th> + </tr>'; $TableHeader = '<tr> <th>'. _('Supplier'). '</th> @@ -621,13 +646,15 @@ echo '</table>'; -echo '</td></tr></table>'; //major table close +echo '</td> + </tr> + </table>'; //major table close if ( isset($_GET['Close'])) { /* Only an opportunity to confirm user wishes to close */ // if the page was called with Close=Yes then show options to confirm OK to c echo '<div class="centre"> - <form method="POST" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; + <form method="post" action="' . $_SERVER['PHP_SELF'] .'?SelectedShipment=' . $_GET['SelectedShipment'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if ($_SESSION['WeightedAverageCosting']==0){ @@ -637,8 +664,11 @@ <option value="No">'. _('No') . '</option> </select>'; } - echo '<br /><br /><input type=submit name="Close" value="'. _('Confirm OK to Close'). '" />'; - echo '</form></div>'; + echo '<br /> + <br /> + <input type=submit name="Close" value="'. _('Confirm OK to Close'). '" /> + </form> + </div>'; } if ( isset($_POST['Close']) ){ /* OK do the shipment close journals */ Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2011-10-14 06:08:10 UTC (rev 4719) +++ trunk/SpecialOrder.php 2011-10-14 06:11:13 UTC (rev 4720) @@ -28,7 +28,10 @@ } if (!isset($_SESSION['CustomerID']) OR $_SESSION['CustomerID']==""){ - echo '<br /><br />' . _('To set up a special') . ', ' . _('the customer must first be selected from the Select Customer page') . '<br /><a href="' . $rootpath . '/SelectCustomer.php">' . _('Select the customer now') . '</a>'; + echo '<br /> + <br />' . _('To set up a special') . ', ' . _('the customer must first be selected from the Select Customer page') . ' + <br /> + <a href="' . $rootpath . '/SelectCustomer.php">' . _('Select the customer now') . '</a>'; include('includes/footer.inc'); exit; } @@ -109,11 +112,13 @@ } echo '<div class="centre">'; if (!isset($_SESSION['SPL']->BranchCode)){ - echo '<br /><font size="4" color="blue">' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ')'; + echo '<br /> + <font size="4" color="blue">' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ')'; } else { - echo '<br /><font size="4" color="blue">' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ') - ' . _('delivered to') . ' ' . $_SESSION['SPL']->BranchName . ' ' . _('branch'); + echo '<br /> + <font size="4" color="blue">' . _('Purchase from') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('in') . ' ' . $_SESSION['SPL']->SuppCurrCode . ' ' . _('for') . ' ' . $_SESSION['SPL']->CustomerName . ' (' . $_SESSION['SPL']->CustCurrCode . ') - ' . _('delivered to') . ' ' . $_SESSION['SPL']->BranchName . ' ' . _('branch'); } -echo '</div></font>'; +echo '</font></div>'; /*if the branch details and delivery details have not been entered then select them from the list */ if (!isset($_SESSION['SPL']->BranchCode)){ @@ -129,12 +134,15 @@ echo '<br /> <br />' . _('Select the customer branch to deliver the special to from the list below'); - echo '</div><br /><table class="selection">'; + echo '</div> + <br /> + <table class="selection">'; - $tableheader = '<tr><th>' ._('Code') . '</th> + $TableHeader = '<tr> + <th>' ._('Code') . '</th> <th>' . _('Branch Name') . '</th> </tr>'; - echo $tableheader; + echo $TableHeader; $j = 1; $k = 0; //row counter to determine background colour @@ -240,13 +248,22 @@ } } -if (isset($_POST['StkLocation'])) {$_SESSION['SPL']->StkLocation = $_POST['StkLocation'];} -if (isset($_POST['Initiator'])) {$_SESSION['SPL']->Initiator = $_POST['Initiator'];} -if (isset($_POST['QuotationRef'])) {$_SESSION['SPL']->QuotationRef = $_POST['QuotationRef'];} -if (isset($_POST['Comments'])) {$_SESSION['SPL']->Comments = $_POST['Comments'];} -if (isset($_POST['CustRef'])) {$_SESSION['SPL']->CustRef = $_POST['CustRef'];} +if (isset($_POST['StkLocation'])) { + $_SESSION['SPL']->StkLocation = $_POST['StkLocation']; +} +if (isset($_POST['Initiator'])) { + $_SESSION['SPL']->Initiator = $_POST['Initiator']; +} +if (isset($_POST['QuotationRef'])) { + $_SESSION['SPL']->QuotationRef = $_POST['QuotationRef']; +} +if (isset($_POST['Comments'])) { + $_SESSION['SPL']->Comments = $_POST['Comments']; +} +if (isset($_POST['CustRef'])) { + $_SESSION['SPL']->CustRef = $_POST['CustRef']; +} - if (isset($_POST['Commit'])){ /*User wishes to commit the order to the database */ /*First do some validation @@ -267,7 +284,6 @@ prnMsg( _('The person entering this order must be specified in the initiator field') . ' - ' . _('a blank initiator is not allowed'),'error'); } - if ($InputError!=1){ if (IsEmailAddress($_SESSION['UserEmail'])){ @@ -287,7 +303,7 @@ $AuthRow=DB_fetch_array($AuthResult); if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $_SESSION['SPL']->Order_Value()) { //user has authority to authrorise as well as create the order - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . '<br />'.$_SESSION['SPL']->StatusComments.'<br />'; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . '<br />'; $_SESSION['SPL']->AllowPrintPO=1; $_SESSION['SPL']->Status = 'Authorised'; } else { // no authority to authorise this order @@ -297,11 +313,7 @@ $AuthMessage = _('You can only authorise up to').' '.$_SESSION['SPL']->SuppCurrCode.' '.$AuthRow['authlevel'] .'.<br />'; } - prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. - $_SESSION['SPL']->SuppCurrCode . ' '. $_SESSION['SPL']->Order_Value() .'. '. - $AuthMessage . - _('If you think this is a mistake please contact the systems administrator') . '<br />'. - _('The order will be created with a status of pending and will require authorisation'), 'warn'); + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. $_SESSION['SPL']->SuppCurrCode . ' '. $_SESSION['SPL']->Order_Value() .'. '. $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. _('The order will be created with a status of pending and will require authorisation'), 'warn'); $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails; $_SESSION['SPL']->Status = 'Pending'; @@ -373,7 +385,6 @@ $_SESSION['SPL']->PurchOrderNo = GetNextTransNo(18, $db); - /*Insert the purchase order detail records */ foreach ($_SESSION['SPL']->LineItems as $SPLLine) { @@ -448,8 +459,8 @@ '" . $OrderDate . "', '" . DB_escape_string($SPLLine->ItemDescription) . "', '" . $GLCode . "', - '" . filter_number_format($SPLLine->Cost) . "', - '" . filter_number_format($SPLLine->Quantity) . "')"; + '" . $SPLLine->Cost . "', + '" . $SPLLine->Quantity . "')"; $ErrMsg = _('One of the purchase order detail records could not be inserted into the database because'); $DbgMsg = _('The SQL statement used to insert the purchase order detail record and failed was'); @@ -538,14 +549,13 @@ $LineItemsSQL = $StartOf_LineItemsSQL . ", '" . DB_escape_string($StockItem->PartCode) . "', - '". filter_number_format($StockItem->Price) . "', - '" . filter_number_format($StockItem->Quantity) . "', + '". $StockItem->Price . "', + '" . $StockItem->Quantity . "', '" . $StockItem->LineNo . "')"; $Ins_LineItemResult = DB_query($LineItemsSQL,$db,$ErrMsg); } /* inserted line items into sales order details */ - unset ($_SESSION['SPL']); prnMsg(_('Purchase Order') . ' ' . $_SESSION['SPL']->PurchOrderNo . ' ' . _('on') . ' ' . $_SESSION['SPL']->SupplierName . ' ' . _('has been created') .'<br/>' . _('Sales Order Number') . ' ' . $OrderNo . ' ' . _('has been entered') . '. <br/>' . _('Orders created on a cash sales account may need the delivery details for the order to be modified') . '<br />' . _('A freight charge may also be applicable'),'success'); if (count($_SESSION['AllowedPageSecurityTokens'])>1){ @@ -557,10 +567,9 @@ } $Result = DB_Txn_Commit($db); - - unset($_SESSION['SPL']); /*Clear the PO data to allow a newy to be input*/ - echo '<br /><br /><a href="' . $rootpath . '/SpecialOrder.php">' . _('Enter A New Special Order') . '</a>'; - exit; + unset ($_SESSION['SPL']); + echo '<br /><br /><a href="' . $rootpath . '/SpecialOrder.php">' . _('Enter A New Special Order') . '</a>'; + exit; } /*end if there were no input errors trapped */ } /* end of the code to do transfer the SPL object to the database - user hit the place Order*/ @@ -586,8 +595,11 @@ echo '<td>' . _('Initiated By') . ': <input type="text" name="Initiator" size="11" maxlength="10" value="' . $_SESSION['SPL']->Initiator . '" /></td> <td>' . _('Special Ref') . ': <input type="text" name="QuotationRef" size="16" maxlength="15" value="' . $_SESSION['SPL']->QuotationRef . '" /></td> - <td>' . _('Customer Ref') . ': <input type="text" name="CustRef" size="11" maxlength="10" value="' . $_SESSION['SPL']->CustRef . '" /></td></tr> - <tr><td valign="top" colspan="2">' . _('Comments') . ': <textarea name="Comments" cols="70" rows="2">' . $_SESSION['SPL']->Comments . '</textarea></td></tr> + <td>' . _('Customer Ref') . ': <input type="text" name="CustRef" size="11" maxlength="10" value="' . $_SESSION['SPL']->CustRef . '" /></td> + </tr> + <tr> + <td valign="top" colspan="2">' . _('Comments') . ': <textarea name="Comments" cols="70" rows="2">' . $_SESSION['SPL']->Comments . '</textarea></td> + </tr> </table> <hr>'; /* Rule off the header */ @@ -622,7 +634,7 @@ $DisplayLineCostTotalCurr = locale_number_format($LineCostTotal/$_SESSION['SPL']->SuppCurrExRate,$_SESSION['CompanyRecord']['decimalplaces']); $DisplayCost = locale_number_format($SPLLine->Cost,$_SESSION['SPL']->SuppCurrDecimalPlaces); $DisplayPrice = locale_number_format($SPLLine->Price,$_SESSION['SPL']->CustCurrDecimalPlaces); - $DisplayQuantity = locale_number_format($SPLLine->Quantity,2); + $DisplayQuantity = locale_number_format($SPLLine->Quantity,'Variable'); if ($k==1){ echo '<tr class="EvenTableRows">'; @@ -647,7 +659,7 @@ $DisplayTotal = locale_number_format($_SESSION['SPL']->total,$_SESSION['SPL']->CustCurrDecimalPlaces); echo '<tr> - <td colspan=8 class="number">' . _('TOTAL Excl Tax') . '</td> + <td colspan="8" class="number">' . _('TOTAL Excl Tax') . '</td> <td class="number"><b>' . $DisplayTotal . '</b></td> </tr> </table>'; @@ -663,11 +675,14 @@ if (!isset($_POST['ItemDescription'])) { $_POST['ItemDescription']=''; } -echo '<tr><td>' . _('Ordered item Description') . ':</td> - <td><input type="text" name="ItemDescription" size="40" maxlength="40" value="' . $_POST['ItemDescription'] . '" /></td></tr>'; +echo '<tr> + <td>' . _('Ordered item Description') . ':</td> + <td><input type="text" name="ItemDescription" size="40" maxlength="40" value="' . $_POST['ItemDescription'] . '" /></td> + </tr>'; -echo '<tr><td>' . _('Category'... [truncated message content] |
From: <dai...@us...> - 2011-10-16 00:17:36
|
Revision: 4721 http://web-erp.svn.sourceforge.net/web-erp/?rev=4721&view=rev Author: daintree Date: 2011-10-16 00:17:27 +0000 (Sun, 16 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItemResearch.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockTransferControlled.php trunk/StockTransfers.php trunk/StockUsage.php trunk/StockUsageGraph.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/SupplierCredit.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/LanguagesArray.php trunk/includes/OutputSerialItems.php trunk/includes/phplot/ChangeLog trunk/includes/phplot/NEWS.txt trunk/includes/phplot/README.txt trunk/includes/phplot/contrib/color_range.example.php trunk/includes/phplot/contrib/color_range.php trunk/includes/phplot/contrib/color_range.test1.php trunk/includes/phplot/contrib/color_range.test2.php trunk/includes/phplot/contrib/prune_labels.example.php trunk/includes/phplot/contrib/prune_labels.php trunk/includes/phplot/contrib/prune_labels.test.php trunk/includes/phplot/phplot.php trunk/includes/phplot/rgb.inc.php trunk/index.php Modified: trunk/StockLocTransfer.php =================================================================== --- trunk/StockLocTransfer.php 2011-10-14 06:11:13 UTC (rev 4720) +++ trunk/StockLocTransfer.php 2011-10-16 00:17:27 UTC (rev 4721) @@ -25,7 +25,7 @@ } $ErrorMessage=''; for ($i=$_POST['LinesCounter']-10;$i<$_POST['LinesCounter'];$i++){ - if (isset($_POST['StockID' . $i]) and $_POST['StockID' . $i]!=''){ + if (isset($_POST['StockID' . $i]) AND $_POST['StockID' . $i]!=''){ $_POST['StockID' . $i]=trim(mb_strtoupper($_POST['StockID' . $i])); $result = DB_query("SELECT COUNT(stockid) FROM stockmaster WHERE stockid='" . $_POST['StockID' . $i] . "'",$db); $myrow = DB_fetch_row($result); @@ -35,12 +35,12 @@ $_POST['LinesCounter'] -= 10; } DB_free_result( $result ); - if (!is_numeric($_POST['StockQTY' . $i])){ + if (!is_numeric(filter_number_format($_POST['StockQTY' . $i]))){ $InputError = True; $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br />'; $_POST['LinesCounter'] -= 10; } - if ($_POST['StockQTY' . $i] <= 0){ + if (filter_number_format($_POST['StockQTY' . $i]) <= 0){ $InputError = True; $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br />'; $_POST['LinesCounter'] -= 10; @@ -53,7 +53,7 @@ $db); $myrow = DB_fetch_row($result); - if ($myrow[0] < $_POST['StockQTY' . $i]){ + if ($myrow[0] < filter_number_format($_POST['StockQTY' . $i])){ $InputError = True; $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('does not have enough stock available for transfer.') . '.<br />'; $_POST['LinesCounter'] -= 10; @@ -94,7 +94,7 @@ recloc) VALUES ('" . $_POST['Trf_ID'] . "', '" . $_POST['StockID' . $i] . "', - '" . round($_POST['StockQTY' . $i], $DecimalRow['decimalplaces']) . "', + '" . round(filter_number_format($_POST['StockQTY' . $i]), $DecimalRow['decimalplaces']) . "', '" . Date('Y-m-d') . "', '" . $_POST['FromStockLocation'] ."', '" . $_POST['ToStockLocation'] . "')"; @@ -136,8 +136,9 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; - echo '<tr><th colspan=4><input type=hidden name="Trf_ID" value="' . $Trf_ID . '"><font size=3 color=blue>'. - _('Inventory Location Transfer Shipment Reference').' # '. $Trf_ID. '</font></th></tr>'; + echo '<tr> + <th colspan="4"><input type="hidden" name="Trf_ID" value="' . $Trf_ID . '" /><font size="3" color="blue">'. _('Inventory Location Transfer Shipment Reference').' # '. $Trf_ID. '</font></th> + </tr>'; $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); @@ -197,8 +198,8 @@ $k++; echo '<tr> - <td><input type="text" name="StockID' . $i .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '"></td> - <td><input type="text" name="StockQTY' . $i .'" size="10" maxlength="10" class="number" value="' . $_POST['StockQTY' . $i] . '"></td> + <td><input type="text" name="StockID' . $i .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '" /></td> + <td><input type="text" name="StockQTY' . $i .'" size="10" maxlength="10" class="number" value="' . locale_number_format($_POST['StockQTY' . $i],'Variable') . '" /></td> </tr>'; } }else { @@ -215,20 +216,24 @@ $_POST['StockQTY' . $i]=0; } echo '<tr> - <td><input type="text" name="StockID' . $i .'" size=21 maxlength=20 value="' . $_POST['StockID' . $i] . '"></td> - <td><input type="text" name="StockQTY' . $i .'" size=10 maxlength=10 class="number" value="' . $_POST['StockQTY' . $i] . '"></td> + <td><input type="text" name="StockID' . $i .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '" /></td> + <td><input type="text" name="StockQTY' . $i .'" size="10" maxlength="10" class="number" value="' . locale_number_format($_POST['StockQTY' . $i]) . '" /></td> </tr>'; $i++; } - echo '</table><br /><div class="centre"> - <input type="hidden" name="LinesCounter" value='. $i .'> - <input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"> - <input type="submit" name="Submit" value="'. _('Create Transfer Shipment'). '"><br />'; + echo '</table> + <br /> + <div class="centre"> + <input type="hidden" name="LinesCounter" value="'. $i .'" /> + <input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '" /> + <input type="submit" name="Submit" value="'. _('Create Transfer Shipment'). '" /> + <br />'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockID0);</script>'; - echo '</form></div>'; + echo '</form> + </div>'; include('includes/footer.inc'); } ?> \ No newline at end of file Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2011-10-14 06:11:13 UTC (rev 4720) +++ trunk/StockLocTransferReceive.php 2011-10-16 00:17:27 UTC (rev 4721) @@ -29,7 +29,7 @@ foreach ($_SESSION['Transfer']->TransferItem AS $TrfLine) { if (is_numeric(filter_number_format($_POST['Qty' . $i]))){ /*Update the quantity received from the inputs */ - $_SESSION['Transfer']->TransferItem[$i]->Quantity= filter_number_format($_POST['Qty' . $i]); + $_SESSION['Transfer']->TransferItem[$i]->Quantity= round(filter_number_format($_POST['Qty' . $i]),$_SESSION['Transfer']->TransferItem[$i]->DecimalPlaces); } else { prnMsg(_('The quantity entered for'). ' ' . $TrfLine->StockID . ' '. _('is not numeric') . '. ' . _('All quantities must be numeric'),'error'); $InputError = True; @@ -47,7 +47,7 @@ } else { $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=0; } - $TotalQuantity += filter_number_format($TrfLine->Quantity); + $TotalQuantity += $TrfLine->Quantity; $i++; } /*end loop to validate and update the SESSION['Transfer'] data */ if ($TotalQuantity < 0){ @@ -95,8 +95,8 @@ '" . $SQLTransferDate . "', '" . $PeriodNo . "', '" . _('To') . ' ' . $_SESSION['Transfer']->StockLocationToName . "', - '" . filter_number_format(round(-$TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', - '" . filter_number_format(round($QtyOnHandPrior - $TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' + '" . round(-$TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', + '" . round($QtyOnHandPrior - $TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because'); @@ -127,7 +127,7 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems SET - quantity= quantity - " . filter_number_format($Item->BundleQty) . " + quantity= quantity - " . $Item->BundleQty . " WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' @@ -145,7 +145,7 @@ VALUES ('" . $TrfLine->StockID . "', '" . $_SESSION['Transfer']->StockLocationFrom . "', '" . DB_escape_string($Item->BundleRef) . "', - '" . -filter_number_format($Item->BundleQty) . "')"; + '" . -$Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item for the stock being transferred out of the existing location could not be inserted because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -164,7 +164,7 @@ '" . $StkMoveNo . "', '" . $TrfLine->StockID . "', '" . DB_escape_string($Item->BundleRef) . "', - '" . -filter_number_format($Item->BundleQty) . "' + '" . -$Item->BundleQty . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); @@ -207,8 +207,8 @@ '" . $SQLTransferDate . "', '" . $PeriodNo . "', '" . _('From') . ' ' . $_SESSION['Transfer']->StockLocationFromName ."', - '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', - '" . filter_number_format(round($QtyOnHandPrior + $TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' + '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', + '" . round($QtyOnHandPrior + $TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record for the incoming stock cannot be added because'); @@ -241,7 +241,7 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems SET - quantity= quantity + '" . filter_number_format($Item->BundleQty) . "' + quantity= quantity + '" . $Item->BundleQty . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' @@ -259,7 +259,7 @@ VALUES ('" . $TrfLine->StockID . "', '" . $_SESSION['Transfer']->StockLocationTo . "', '" . DB_escape_string($Item->BundleRef) . "', - '" . filter_number_format($Item->BundleQty) . "')"; + '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record for the stock coming in could not be added because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -277,7 +277,7 @@ VALUES (" . $StkMoveNo . ", '" . $TrfLine->StockID . "', '" . DB_escape_string($Item->BundleRef) . "', - '" . filter_number_format($Item->BundleQty) . "')"; + '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -286,7 +286,7 @@ } /*end if the transfer item is a controlled item */ $SQL = "UPDATE locstock - SET quantity = quantity - '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' + SET quantity = quantity - '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "'"; @@ -295,7 +295,7 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); $SQL = "UPDATE locstock - SET quantity = quantity + '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' + SET quantity = quantity + '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "'"; @@ -306,13 +306,13 @@ prnMsg(_('A stock transfer for item code'). ' - ' . $TrfLine->StockID . ' ' . $TrfLine->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . ' ' . _('for a quantity of'). ' '. $TrfLine->Quantity,'success'); if ($TrfLine->CancelBalance==1){ - $sql = "UPDATE loctransfers SET recqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', - shipqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', + $sql = "UPDATE loctransfers SET recqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', + shipqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', recdate = '".date('Y-m-d H:i:s'). "' WHERE reference = '". $_SESSION['Transfer']->TrfID . "' AND stockid = '". $TrfLine->StockID."'"; } else { - $sql = "UPDATE loctransfers SET recqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', + $sql = "UPDATE loctransfers SET recqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', recdate = '".date('Y-m-d H:i:s'). "' WHERE reference = '". $_SESSION['Transfer']->TrfID . "' AND stockid = '". $TrfLine->StockID."'"; @@ -419,17 +419,19 @@ echo '<br /> <table class="selection">'; - echo '<tr><th colspan="7"><font size=3 color=blue>' . _('Location Transfer Reference'). ' #' . $_SESSION['Transfer']->TrfID . ' '. _('from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . '</font></th></tr>'; + echo '<tr> + <th colspan="7"><font size="3" color="blue">' . _('Location Transfer Reference'). ' #' . $_SESSION['Transfer']->TrfID . ' '. _('from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . '</font></th> + </tr>'; $tableheader = '<tr> - <th>'. _('Item Code') . '</th> - <th>'. _('Item Description'). '</th> - <th>'. _('Quantity Dispatched'). '</th> - <th>'. _('Quantity Received'). '</th> - <th>'. _('Quantity To Receive'). '</th> - <th>'. _('Units'). '</th> - <th>'. _('Cancel Balance') . '</th> - </tr>'; + <th>'. _('Item Code') . '</th> + <th>'. _('Item Description'). '</th> + <th>'. _('Quantity Dispatched'). '</th> + <th>'. _('Quantity Received'). '</th> + <th>'. _('Quantity To Receive'). '</th> + <th>'. _('Units'). '</th> + <th>'. _('Cancel Balance') . '</th> + </tr>'; echo $tableheader; $k=0; @@ -445,30 +447,33 @@ echo '<td>' . $TrfLine->StockID . '</td> <td>' . $TrfLine->ItemDescription . '</td>'; - echo '<td class=number>' . locale_number_format($TrfLine->ShipQty, $TrfLine->DecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_number_format($TrfLine->ShipQty, $TrfLine->DecimalPlaces) . '</td>'; if (isset($_POST['Qty' . $i]) AND is_numeric(filter_number_format($_POST['Qty' . $i]))){ - $_SESSION['Transfer']->TransferItem[$i]->Quantity= filter_number_format($_POST['Qty' . $i]); - $Qty = filter_number_format($_POST['Qty' . $i]); + + $_SESSION['Transfer']->TransferItem[$i]->Quantity= round(filter_number_format($_POST['Qty' . $i]),$TrfLine->DecimalPlaces); + + $Qty = round(filter_number_format($_POST['Qty' . $i]),$TrfLine->DecimalPlaces); + } else if ($TrfLine->Controlled==1) { if (sizeOf($TrfLine->SerialItems)==0) { $Qty = 0; } else { - $Qty = filter_number_format($TrfLine->Quantity); + $Qty = $TrfLine->Quantity; } } else { - $Qty = filter_number_format($TrfLine->Quantity); + $Qty = $TrfLine->Quantity; } - echo '<td class=number>' . locale_number_format($TrfLine->PrevRecvQty, $TrfLine->DecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_number_format($TrfLine->PrevRecvQty, $TrfLine->DecimalPlaces) . '</td>'; if ($TrfLine->Controlled==1){ - echo '<td class=number><input type=hidden name="Qty' . $i . '" value="' . $Qty . '"><a href="' . $rootpath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . $Qty . '</a></td>'; + echo '<td class="number"><input type="hidden" name="Qty' . $i . '" value="' . locale_number_format($Qty,$TrfLine->DecimalPlaces) . '" /><a href="' . $rootpath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . $Qty . '</a></td>'; } else { - echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength=10 class="number" size=auto value="' . $Qty . '"></td>'; + echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength="10" class="number" size="auto" value="' . locale_number_format($Qty,$TrfLine->DecimalPlaces) . '" /></td>'; } echo '<td>' . $TrfLine->PartUnit . '</td>'; - echo '<td><input type="checkbox" name="CancelBalance' . $i . '" value=1></td>'; + echo '<td><input type="checkbox" name="CancelBalance' . $i . '" value=1 /></td>'; if ($TrfLine->Controlled==1){ @@ -484,9 +489,13 @@ $i++; /* the array of TransferItem s is indexed numerically and i matches the index no */ } /*end of foreach TransferItem */ - echo '</table><br /> - <div class="centre"><input type="submit" name="ProcessTransfer" value="'. _('Process Inventory Transfer'). '"><br /> - </form></div>'; + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="ProcessTransfer" value="'. _('Process Inventory Transfer'). '"> + <br /> + </div> + </form>'; echo '<a href="'.$_SERVER['PHP_SELF']. '?NewTransfer=true">'. _('Select A Different Transfer').'</a>'; } else { /*Not $_SESSION['Transfer'] set */ @@ -498,20 +507,26 @@ $LocResult = DB_query("SELECT locationname, loccode FROM locations",$db); - echo '<table class=selection>'; - echo '<tr><td>'. _('Select Location Receiving Into'). ':</td><td>'; + echo '<table class="selection">'; + echo '<tr> + <td>'. _('Select Location Receiving Into'). ':</td> + <td>'; echo '<select name="RecLocation" onChange="ReloadForm(form1.RefreshTransferList)">'; if (!isset($_POST['RecLocation'])){ $_POST['RecLocation'] = $_SESSION['UserStockLocation']; } while ($myrow=DB_fetch_array($LocResult)){ if ($myrow['loccode'] == $_POST['RecLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } - echo '</select><input type=submit name="RefreshTransferList" value="' . _('Refresh Transfer List') . '"></td></tr></table><p>'; + echo '</select> + <input type="submit" name="RefreshTransferList" value="' . _('Refresh Transfer List') . '"></td> + </tr> + </table> + <p />'; $sql = "SELECT DISTINCT reference, locations.locationname as trffromloc, @@ -527,7 +542,7 @@ $LocResult = DB_query($LocSql,$db); $LocRow = DB_fetch_array($LocResult); echo '<table class="selection">'; - echo '<tr><th colspan="4"><font size="3" color=blue>'._('Pending Transfers Into').' '.$LocRow['locationname'].'</font></th></tr>'; + echo '<tr><th colspan="4"><font size="3" color="blue">'._('Pending Transfers Into').' '.$LocRow['locationname'].'</font></th></tr>'; echo '<tr> <th>'. _('Transfer Ref'). '</th> <th>'. _('Transfer From'). '</th> @@ -543,9 +558,10 @@ $k++; } echo '<td class="number">' . $myrow['reference'] . '</td> - <td>' . $myrow['trffromloc'] . '</td> - <td>' . ConvertSQLDate($myrow['shipdate']) . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?Trf_ID=' . $myrow['reference'] . '">'. _('Receive'). '</a></td></tr>'; + <td>' . $myrow['trffromloc'] . '</td> + <td>' . ConvertSQLDate($myrow['shipdate']) . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Trf_ID=' . $myrow['reference'] . '">'. _('Receive'). '</a></td> + </tr>'; } echo '</table>'; } else if (!isset($_POST['ProcessTransfer'])) { Modified: trunk/StockMovements.php =================================================================== --- trunk/StockMovements.php 2011-10-14 06:11:13 UTC (rev 4720) +++ trunk/StockMovements.php 2011-10-16 00:17:27 UTC (rev 4721) @@ -27,8 +27,9 @@ if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-3,Date('d'),Date('y'))); } -echo '<br /><table cellpadding=2 class=selection>'; -echo '<tr><th colspan=10>' . _('Stock Code') . ':<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength=20>'; +echo '<br /> + <table class="selection">'; +echo '<tr><th colspan="10">' . _('Stock Code') . ':<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength="20" />'; echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; @@ -50,36 +51,37 @@ } } -echo '</select></th></tr>'; -echo '<tr><th colspan=10>' . _('Show Movements before') . ': <input type="text" name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['BeforeDate'] . '">'; -echo ' ' . _('But after') . ': <input type="text" name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['AfterDate'] . '">'; -echo ' <input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '"></th></tr>'; +echo '</select></th> + </tr>'; +echo '<tr> + <th colspan="10">' . _('Show Movements before') . ': <input type="text" name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" value="' . $_POST['BeforeDate'] . '" /> ' . _('But after') . ': <input type="text" name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" value="' . $_POST['AfterDate'] . '" /><input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '" /></th> + </tr>'; $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); $SQLAfterDate = FormatDateForSQL($_POST['AfterDate']); $sql = "SELECT stockmoves.stockid, - systypes.typename, - stockmoves.type, - stockmoves.transno, - stockmoves.trandate, - stockmoves.debtorno, - stockmoves.branchcode, - stockmoves.qty, - stockmoves.reference, - stockmoves.price, - stockmoves.discountpercent, - stockmoves.newqoh, - stockmaster.decimalplaces - FROM stockmoves - INNER JOIN systypes ON stockmoves.type=systypes.typeid - INNER JOIN stockmaster ON stockmoves.stockid=stockmaster.stockid - WHERE stockmoves.loccode='" . $_POST['StockLocation'] . "' - AND stockmoves.trandate >= '". $SQLAfterDate . "' - AND stockmoves.stockid = '" . $StockID . "' - AND stockmoves.trandate <= '" . $SQLBeforeDate . "' - AND hidemovt=0 - ORDER BY stkmoveno DESC"; + systypes.typename, + stockmoves.type, + stockmoves.transno, + stockmoves.trandate, + stockmoves.debtorno, + stockmoves.branchcode, + stockmoves.qty, + stockmoves.reference, + stockmoves.price, + stockmoves.discountpercent, + stockmoves.newqoh, + stockmaster.decimalplaces + FROM stockmoves + INNER JOIN systypes ON stockmoves.type=systypes.typeid + INNER JOIN stockmaster ON stockmoves.stockid=stockmaster.stockid + WHERE stockmoves.loccode='" . $_POST['StockLocation'] . "' + AND stockmoves.trandate >= '". $SQLAfterDate . "' + AND stockmoves.stockid = '" . $StockID . "' + AND stockmoves.trandate <= '" . $SQLBeforeDate . "' + AND hidemovt=0 + ORDER BY stkmoveno DESC"; $ErrMsg = _('The stock movements for the selected criteria could not be retrieved because') . ' - '; $DbgMsg = _('The SQL that failed was') . ' '; @@ -87,17 +89,17 @@ $MovtsResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); $tableheader = '<tr> - <th>' . _('Type') . '</th> - <th>' . _('Number') . '</th> - <th>' . _('Date') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Branch') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Reference') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('New Qty') . '</th> - </tr>'; + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('New Qty') . '</th> + </tr>'; echo $tableheader; @@ -123,11 +125,11 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s%%</td> + <td class="number">%s</td> </tr>', $rootpath, $myrow['transno'], @@ -136,10 +138,9 @@ $DisplayTranDate, $myrow['debtorno'], $myrow['branchcode'], - locale_number_format($myrow['qty'], - $myrow['decimalplaces']), + locale_number_format($myrow['qty'],$myrow['decimalplaces']), $myrow['reference'], - locale_number_format($myrow['price'],2), + locale_number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($myrow['discountpercent']*100,2), locale_number_format($myrow['newqoh'],$myrow['decimalplaces'])); @@ -150,11 +151,11 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s%%</td> + <td class="number">%s</td> </tr>', $rootpath, $myrow['transno'], @@ -171,26 +172,26 @@ } else { printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> - </tr>', - $myrow['typename'], - $myrow['transno'], - $DisplayTranDate, - $myrow['debtorno'], - $myrow['branchcode'], - locale_number_format($myrow['qty'],$myrow['decimalplaces']), - $myrow['reference'], - locale_number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($myrow['discountpercent']*100,2), - locale_number_format($myrow['newqoh'],$myrow['decimalplaces'])); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s%%</td> + <td class="number">%s</td> + </tr>', + $myrow['typename'], + $myrow['transno'], + $DisplayTranDate, + $myrow['debtorno'], + $myrow['branchcode'], + locale_number_format($myrow['qty'],$myrow['decimalplaces']), + $myrow['reference'], + locale_number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($myrow['discountpercent']*100,2), + locale_number_format($myrow['newqoh'],$myrow['decimalplaces'])); } //end of page full new headings if } Modified: trunk/StockQuantityByDate.php =================================================================== --- trunk/StockQuantityByDate.php 2011-10-14 06:11:13 UTC (rev 4720) +++ trunk/StockQuantityByDate.php 2011-10-16 00:17:27 UTC (rev 4721) @@ -6,19 +6,22 @@ $title = _('Stock On Hand By Date'); include('includes/header.inc'); -echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . -'" alt="" /><b>' . $title. '</b></p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . +'" alt="" /><b>' . $title. '</b> + </p>'; -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'] . '" />'; $sql = "SELECT categoryid, categorydescription FROM stockcategory"; $resultStkLocs = DB_query($sql, $db); -echo '<table class=selection><tr>'; -echo '<td>' . _('For Stock Category') . ':</td> - <td><select name="StockCategory"> '; -echo '<option value="All">' . _('All') . '</option>'; +echo '<table class="selection"> + <tr> + <td>' . _('For Stock Category') . ':</td> + <td><select name="StockCategory"> + <option value="All">' . _('All') . '</option>'; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockCategory']) AND $_POST['StockCategory']!='All'){ @@ -60,9 +63,15 @@ } echo '<td>' . _('On-Hand On Date') . ':</td> - <td><input type="t... [truncated message content] |
From: <dai...@us...> - 2011-10-16 00:17:36
|
Revision: 4721 http://web-erp.svn.sourceforge.net/web-erp/?rev=4721&view=rev Author: daintree Date: 2011-10-16 00:17:27 +0000 (Sun, 16 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockQuantityByDate.php trunk/StockReorderLevel.php trunk/StockSerialItemResearch.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockTransferControlled.php trunk/StockTransfers.php trunk/StockUsage.php trunk/StockUsageGraph.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/SupplierCredit.php trunk/WWW_Users.php trunk/doc/Change.log trunk/includes/LanguagesArray.php trunk/includes/OutputSerialItems.php trunk/includes/phplot/ChangeLog trunk/includes/phplot/NEWS.txt trunk/includes/phplot/README.txt trunk/includes/phplot/contrib/color_range.example.php trunk/includes/phplot/contrib/color_range.php trunk/includes/phplot/contrib/color_range.test1.php trunk/includes/phplot/contrib/color_range.test2.php trunk/includes/phplot/contrib/prune_labels.example.php trunk/includes/phplot/contrib/prune_labels.php trunk/includes/phplot/contrib/prune_labels.test.php trunk/includes/phplot/phplot.php trunk/includes/phplot/rgb.inc.php trunk/index.php Modified: trunk/StockLocTransfer.php =================================================================== --- trunk/StockLocTransfer.php 2011-10-14 06:11:13 UTC (rev 4720) +++ trunk/StockLocTransfer.php 2011-10-16 00:17:27 UTC (rev 4721) @@ -25,7 +25,7 @@ } $ErrorMessage=''; for ($i=$_POST['LinesCounter']-10;$i<$_POST['LinesCounter'];$i++){ - if (isset($_POST['StockID' . $i]) and $_POST['StockID' . $i]!=''){ + if (isset($_POST['StockID' . $i]) AND $_POST['StockID' . $i]!=''){ $_POST['StockID' . $i]=trim(mb_strtoupper($_POST['StockID' . $i])); $result = DB_query("SELECT COUNT(stockid) FROM stockmaster WHERE stockid='" . $_POST['StockID' . $i] . "'",$db); $myrow = DB_fetch_row($result); @@ -35,12 +35,12 @@ $_POST['LinesCounter'] -= 10; } DB_free_result( $result ); - if (!is_numeric($_POST['StockQTY' . $i])){ + if (!is_numeric(filter_number_format($_POST['StockQTY' . $i]))){ $InputError = True; $ErrorMessage .= _('The quantity entered of'). ' ' . $_POST['StockQTY' . $i] . ' '. _('for part code'). ' ' . $_POST['StockID' . $i] . ' '. _('is not numeric') . '. ' . _('The quantity entered for transfers is expected to be numeric').'<br />'; $_POST['LinesCounter'] -= 10; } - if ($_POST['StockQTY' . $i] <= 0){ + if (filter_number_format($_POST['StockQTY' . $i]) <= 0){ $InputError = True; $ErrorMessage .= _('The quantity entered for').' '. $_POST['StockID' . $i] . ' ' . _('is less than or equal to 0') . '. ' . _('Please correct this or remove the item').'<br />'; $_POST['LinesCounter'] -= 10; @@ -53,7 +53,7 @@ $db); $myrow = DB_fetch_row($result); - if ($myrow[0] < $_POST['StockQTY' . $i]){ + if ($myrow[0] < filter_number_format($_POST['StockQTY' . $i])){ $InputError = True; $ErrorMessage .= _('The part code entered of'). ' ' . $_POST['StockID' . $i] . ' '. _('does not have enough stock available for transfer.') . '.<br />'; $_POST['LinesCounter'] -= 10; @@ -94,7 +94,7 @@ recloc) VALUES ('" . $_POST['Trf_ID'] . "', '" . $_POST['StockID' . $i] . "', - '" . round($_POST['StockQTY' . $i], $DecimalRow['decimalplaces']) . "', + '" . round(filter_number_format($_POST['StockQTY' . $i]), $DecimalRow['decimalplaces']) . "', '" . Date('Y-m-d') . "', '" . $_POST['FromStockLocation'] ."', '" . $_POST['ToStockLocation'] . "')"; @@ -136,8 +136,9 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; - echo '<tr><th colspan=4><input type=hidden name="Trf_ID" value="' . $Trf_ID . '"><font size=3 color=blue>'. - _('Inventory Location Transfer Shipment Reference').' # '. $Trf_ID. '</font></th></tr>'; + echo '<tr> + <th colspan="4"><input type="hidden" name="Trf_ID" value="' . $Trf_ID . '" /><font size="3" color="blue">'. _('Inventory Location Transfer Shipment Reference').' # '. $Trf_ID. '</font></th> + </tr>'; $sql = "SELECT loccode, locationname FROM locations"; $resultStkLocs = DB_query($sql,$db); @@ -197,8 +198,8 @@ $k++; echo '<tr> - <td><input type="text" name="StockID' . $i .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '"></td> - <td><input type="text" name="StockQTY' . $i .'" size="10" maxlength="10" class="number" value="' . $_POST['StockQTY' . $i] . '"></td> + <td><input type="text" name="StockID' . $i .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '" /></td> + <td><input type="text" name="StockQTY' . $i .'" size="10" maxlength="10" class="number" value="' . locale_number_format($_POST['StockQTY' . $i],'Variable') . '" /></td> </tr>'; } }else { @@ -215,20 +216,24 @@ $_POST['StockQTY' . $i]=0; } echo '<tr> - <td><input type="text" name="StockID' . $i .'" size=21 maxlength=20 value="' . $_POST['StockID' . $i] . '"></td> - <td><input type="text" name="StockQTY' . $i .'" size=10 maxlength=10 class="number" value="' . $_POST['StockQTY' . $i] . '"></td> + <td><input type="text" name="StockID' . $i .'" size="21" maxlength="20" value="' . $_POST['StockID' . $i] . '" /></td> + <td><input type="text" name="StockQTY' . $i .'" size="10" maxlength="10" class="number" value="' . locale_number_format($_POST['StockQTY' . $i]) . '" /></td> </tr>'; $i++; } - echo '</table><br /><div class="centre"> - <input type="hidden" name="LinesCounter" value='. $i .'> - <input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '"> - <input type="submit" name="Submit" value="'. _('Create Transfer Shipment'). '"><br />'; + echo '</table> + <br /> + <div class="centre"> + <input type="hidden" name="LinesCounter" value="'. $i .'" /> + <input type=submit name="EnterMoreItems" value="'. _('Add More Items'). '" /> + <input type="submit" name="Submit" value="'. _('Create Transfer Shipment'). '" /> + <br />'; echo '<script type="text/javascript">defaultControl(document.forms[0].StockID0);</script>'; - echo '</form></div>'; + echo '</form> + </div>'; include('includes/footer.inc'); } ?> \ No newline at end of file Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2011-10-14 06:11:13 UTC (rev 4720) +++ trunk/StockLocTransferReceive.php 2011-10-16 00:17:27 UTC (rev 4721) @@ -29,7 +29,7 @@ foreach ($_SESSION['Transfer']->TransferItem AS $TrfLine) { if (is_numeric(filter_number_format($_POST['Qty' . $i]))){ /*Update the quantity received from the inputs */ - $_SESSION['Transfer']->TransferItem[$i]->Quantity= filter_number_format($_POST['Qty' . $i]); + $_SESSION['Transfer']->TransferItem[$i]->Quantity= round(filter_number_format($_POST['Qty' . $i]),$_SESSION['Transfer']->TransferItem[$i]->DecimalPlaces); } else { prnMsg(_('The quantity entered for'). ' ' . $TrfLine->StockID . ' '. _('is not numeric') . '. ' . _('All quantities must be numeric'),'error'); $InputError = True; @@ -47,7 +47,7 @@ } else { $_SESSION['Transfer']->TransferItem[$i]->CancelBalance=0; } - $TotalQuantity += filter_number_format($TrfLine->Quantity); + $TotalQuantity += $TrfLine->Quantity; $i++; } /*end loop to validate and update the SESSION['Transfer'] data */ if ($TotalQuantity < 0){ @@ -95,8 +95,8 @@ '" . $SQLTransferDate . "', '" . $PeriodNo . "', '" . _('To') . ' ' . $_SESSION['Transfer']->StockLocationToName . "', - '" . filter_number_format(round(-$TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', - '" . filter_number_format(round($QtyOnHandPrior - $TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' + '" . round(-$TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', + '" . round($QtyOnHandPrior - $TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because'); @@ -127,7 +127,7 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems SET - quantity= quantity - " . filter_number_format($Item->BundleQty) . " + quantity= quantity - " . $Item->BundleQty . " WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "' @@ -145,7 +145,7 @@ VALUES ('" . $TrfLine->StockID . "', '" . $_SESSION['Transfer']->StockLocationFrom . "', '" . DB_escape_string($Item->BundleRef) . "', - '" . -filter_number_format($Item->BundleQty) . "')"; + '" . -$Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item for the stock being transferred out of the existing location could not be inserted because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -164,7 +164,7 @@ '" . $StkMoveNo . "', '" . $TrfLine->StockID . "', '" . DB_escape_string($Item->BundleRef) . "', - '" . -filter_number_format($Item->BundleQty) . "' + '" . -$Item->BundleQty . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); @@ -207,8 +207,8 @@ '" . $SQLTransferDate . "', '" . $PeriodNo . "', '" . _('From') . ' ' . $_SESSION['Transfer']->StockLocationFromName ."', - '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', - '" . filter_number_format(round($QtyOnHandPrior + $TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' + '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', + '" . round($QtyOnHandPrior + $TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record for the incoming stock cannot be added because'); @@ -241,7 +241,7 @@ if ($SerialItemExistsRow[0]==1){ $SQL = "UPDATE stockserialitems SET - quantity= quantity + '" . filter_number_format($Item->BundleQty) . "' + quantity= quantity + '" . $Item->BundleQty . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "' @@ -259,7 +259,7 @@ VALUES ('" . $TrfLine->StockID . "', '" . $_SESSION['Transfer']->StockLocationTo . "', '" . DB_escape_string($Item->BundleRef) . "', - '" . filter_number_format($Item->BundleQty) . "')"; + '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record for the stock coming in could not be added because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -277,7 +277,7 @@ VALUES (" . $StkMoveNo . ", '" . $TrfLine->StockID . "', '" . DB_escape_string($Item->BundleRef) . "', - '" . filter_number_format($Item->BundleQty) . "')"; + '" . $Item->BundleQty . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -286,7 +286,7 @@ } /*end if the transfer item is a controlled item */ $SQL = "UPDATE locstock - SET quantity = quantity - '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' + SET quantity = quantity - '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationFrom . "'"; @@ -295,7 +295,7 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); $SQL = "UPDATE locstock - SET quantity = quantity + '" . filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "' + SET quantity = quantity + '" . round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "' WHERE stockid='" . $TrfLine->StockID . "' AND loccode='" . $_SESSION['Transfer']->StockLocationTo . "'"; @@ -306,13 +306,13 @@ prnMsg(_('A stock transfer for item code'). ' - ' . $TrfLine->StockID . ' ' . $TrfLine->ItemDescription . ' '. _('has been created from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . ' ' . _('for a quantity of'). ' '. $TrfLine->Quantity,'success'); if ($TrfLine->CancelBalance==1){ - $sql = "UPDATE loctransfers SET recqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', - shipqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', + $sql = "UPDATE loctransfers SET recqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', + shipqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', recdate = '".date('Y-m-d H:i:s'). "' WHERE reference = '". $_SESSION['Transfer']->TrfID . "' AND stockid = '". $TrfLine->StockID."'"; } else { - $sql = "UPDATE loctransfers SET recqty = recqty + '". filter_number_format(round($TrfLine->Quantity, $TrfLine->DecimalPlaces)) . "', + $sql = "UPDATE loctransfers SET recqty = recqty + '". round($TrfLine->Quantity, $TrfLine->DecimalPlaces) . "', recdate = '".date('Y-m-d H:i:s'). "' WHERE reference = '". $_SESSION['Transfer']->TrfID . "' AND stockid = '". $TrfLine->StockID."'"; @@ -419,17 +419,19 @@ echo '<br /> <table class="selection">'; - echo '<tr><th colspan="7"><font size=3 color=blue>' . _('Location Transfer Reference'). ' #' . $_SESSION['Transfer']->TrfID . ' '. _('from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . '</font></th></tr>'; + echo '<tr> + <th colspan="7"><font size="3" color="blue">' . _('Location Transfer Reference'). ' #' . $_SESSION['Transfer']->TrfID . ' '. _('from').' ' . $_SESSION['Transfer']->StockLocationFromName . ' '. _('to'). ' ' . $_SESSION['Transfer']->StockLocationToName . '</font></th> + </tr>'; $tableheader = '<tr> - <th>'. _('Item Code') . '</th> - <th>'. _('Item Description'). '</th> - <th>'. _('Quantity Dispatched'). '</th> - <th>'. _('Quantity Received'). '</th> - <th>'. _('Quantity To Receive'). '</th> - <th>'. _('Units'). '</th> - <th>'. _('Cancel Balance') . '</th> - </tr>'; + <th>'. _('Item Code') . '</th> + <th>'. _('Item Description'). '</th> + <th>'. _('Quantity Dispatched'). '</th> + <th>'. _('Quantity Received'). '</th> + <th>'. _('Quantity To Receive'). '</th> + <th>'. _('Units'). '</th> + <th>'. _('Cancel Balance') . '</th> + </tr>'; echo $tableheader; $k=0; @@ -445,30 +447,33 @@ echo '<td>' . $TrfLine->StockID . '</td> <td>' . $TrfLine->ItemDescription . '</td>'; - echo '<td class=number>' . locale_number_format($TrfLine->ShipQty, $TrfLine->DecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_number_format($TrfLine->ShipQty, $TrfLine->DecimalPlaces) . '</td>'; if (isset($_POST['Qty' . $i]) AND is_numeric(filter_number_format($_POST['Qty' . $i]))){ - $_SESSION['Transfer']->TransferItem[$i]->Quantity= filter_number_format($_POST['Qty' . $i]); - $Qty = filter_number_format($_POST['Qty' . $i]); + + $_SESSION['Transfer']->TransferItem[$i]->Quantity= round(filter_number_format($_POST['Qty' . $i]),$TrfLine->DecimalPlaces); + + $Qty = round(filter_number_format($_POST['Qty' . $i]),$TrfLine->DecimalPlaces); + } else if ($TrfLine->Controlled==1) { if (sizeOf($TrfLine->SerialItems)==0) { $Qty = 0; } else { - $Qty = filter_number_format($TrfLine->Quantity); + $Qty = $TrfLine->Quantity; } } else { - $Qty = filter_number_format($TrfLine->Quantity); + $Qty = $TrfLine->Quantity; } - echo '<td class=number>' . locale_number_format($TrfLine->PrevRecvQty, $TrfLine->DecimalPlaces) . '</td>'; + echo '<td class="number">' . locale_number_format($TrfLine->PrevRecvQty, $TrfLine->DecimalPlaces) . '</td>'; if ($TrfLine->Controlled==1){ - echo '<td class=number><input type=hidden name="Qty' . $i . '" value="' . $Qty . '"><a href="' . $rootpath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . $Qty . '</a></td>'; + echo '<td class="number"><input type="hidden" name="Qty' . $i . '" value="' . locale_number_format($Qty,$TrfLine->DecimalPlaces) . '" /><a href="' . $rootpath .'/StockTransferControlled.php?TransferItem=' . $i . '">' . $Qty . '</a></td>'; } else { - echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength=10 class="number" size=auto value="' . $Qty . '"></td>'; + echo '<td><input type="text" class="number" name="Qty' . $i . '" maxlength="10" class="number" size="auto" value="' . locale_number_format($Qty,$TrfLine->DecimalPlaces) . '" /></td>'; } echo '<td>' . $TrfLine->PartUnit . '</td>'; - echo '<td><input type="checkbox" name="CancelBalance' . $i . '" value=1></td>'; + echo '<td><input type="checkbox" name="CancelBalance' . $i . '" value=1 /></td>'; if ($TrfLine->Controlled==1){ @@ -484,9 +489,13 @@ $i++; /* the array of TransferItem s is indexed numerically and i matches the index no */ } /*end of foreach TransferItem */ - echo '</table><br /> - <div class="centre"><input type="submit" name="ProcessTransfer" value="'. _('Process Inventory Transfer'). '"><br /> - </form></div>'; + echo '</table> + <br /> + <div class="centre"> + <input type="submit" name="ProcessTransfer" value="'. _('Process Inventory Transfer'). '"> + <br /> + </div> + </form>'; echo '<a href="'.$_SERVER['PHP_SELF']. '?NewTransfer=true">'. _('Select A Different Transfer').'</a>'; } else { /*Not $_SESSION['Transfer'] set */ @@ -498,20 +507,26 @@ $LocResult = DB_query("SELECT locationname, loccode FROM locations",$db); - echo '<table class=selection>'; - echo '<tr><td>'. _('Select Location Receiving Into'). ':</td><td>'; + echo '<table class="selection">'; + echo '<tr> + <td>'. _('Select Location Receiving Into'). ':</td> + <td>'; echo '<select name="RecLocation" onChange="ReloadForm(form1.RefreshTransferList)">'; if (!isset($_POST['RecLocation'])){ $_POST['RecLocation'] = $_SESSION['UserStockLocation']; } while ($myrow=DB_fetch_array($LocResult)){ if ($myrow['loccode'] == $_POST['RecLocation']){ - echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option selected value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; + echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } } - echo '</select><input type=submit name="RefreshTransferList" value="' . _('Refresh Transfer List') . '"></td></tr></table><p>'; + echo '</select> + <input type="submit" name="RefreshTransferList" value="' . _('Refresh Transfer List') . '"></td> + </tr> + </table> + <p />'; $sql = "SELECT DISTINCT reference, locations.locationname as trffromloc, @@ -527,7 +542,7 @@ $LocResult = DB_query($LocSql,$db); $LocRow = DB_fetch_array($LocResult); echo '<table class="selection">'; - echo '<tr><th colspan="4"><font size="3" color=blue>'._('Pending Transfers Into').' '.$LocRow['locationname'].'</font></th></tr>'; + echo '<tr><th colspan="4"><font size="3" color="blue">'._('Pending Transfers Into').' '.$LocRow['locationname'].'</font></th></tr>'; echo '<tr> <th>'. _('Transfer Ref'). '</th> <th>'. _('Transfer From'). '</th> @@ -543,9 +558,10 @@ $k++; } echo '<td class="number">' . $myrow['reference'] . '</td> - <td>' . $myrow['trffromloc'] . '</td> - <td>' . ConvertSQLDate($myrow['shipdate']) . '</td> - <td><a href="' . $_SERVER['PHP_SELF'] . '?Trf_ID=' . $myrow['reference'] . '">'. _('Receive'). '</a></td></tr>'; + <td>' . $myrow['trffromloc'] . '</td> + <td>' . ConvertSQLDate($myrow['shipdate']) . '</td> + <td><a href="' . $_SERVER['PHP_SELF'] . '?Trf_ID=' . $myrow['reference'] . '">'. _('Receive'). '</a></td> + </tr>'; } echo '</table>'; } else if (!isset($_POST['ProcessTransfer'])) { Modified: trunk/StockMovements.php =================================================================== --- trunk/StockMovements.php 2011-10-14 06:11:13 UTC (rev 4720) +++ trunk/StockMovements.php 2011-10-16 00:17:27 UTC (rev 4721) @@ -27,8 +27,9 @@ if (!isset($_POST['AfterDate']) OR !Is_Date($_POST['AfterDate'])){ $_POST['AfterDate'] = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')-3,Date('d'),Date('y'))); } -echo '<br /><table cellpadding=2 class=selection>'; -echo '<tr><th colspan=10>' . _('Stock Code') . ':<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength=20>'; +echo '<br /> + <table class="selection">'; +echo '<tr><th colspan="10">' . _('Stock Code') . ':<input type="text" name="StockID" size=21 value="' . $StockID . '" maxlength="20" />'; echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; @@ -50,36 +51,37 @@ } } -echo '</select></th></tr>'; -echo '<tr><th colspan=10>' . _('Show Movements before') . ': <input type="text" name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['BeforeDate'] . '">'; -echo ' ' . _('But after') . ': <input type="text" name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" VALUE="' . $_POST['AfterDate'] . '">'; -echo ' <input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '"></th></tr>'; +echo '</select></th> + </tr>'; +echo '<tr> + <th colspan="10">' . _('Show Movements before') . ': <input type="text" name="BeforeDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" value="' . $_POST['BeforeDate'] . '" /> ' . _('But after') . ': <input type="text" name="AfterDate" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="12" maxlength="12" value="' . $_POST['AfterDate'] . '" /><input type="submit" name="ShowMoves" value="' . _('Show Stock Movements') . '" /></th> + </tr>'; $SQLBeforeDate = FormatDateForSQL($_POST['BeforeDate']); $SQLAfterDate = FormatDateForSQL($_POST['AfterDate']); $sql = "SELECT stockmoves.stockid, - systypes.typename, - stockmoves.type, - stockmoves.transno, - stockmoves.trandate, - stockmoves.debtorno, - stockmoves.branchcode, - stockmoves.qty, - stockmoves.reference, - stockmoves.price, - stockmoves.discountpercent, - stockmoves.newqoh, - stockmaster.decimalplaces - FROM stockmoves - INNER JOIN systypes ON stockmoves.type=systypes.typeid - INNER JOIN stockmaster ON stockmoves.stockid=stockmaster.stockid - WHERE stockmoves.loccode='" . $_POST['StockLocation'] . "' - AND stockmoves.trandate >= '". $SQLAfterDate . "' - AND stockmoves.stockid = '" . $StockID . "' - AND stockmoves.trandate <= '" . $SQLBeforeDate . "' - AND hidemovt=0 - ORDER BY stkmoveno DESC"; + systypes.typename, + stockmoves.type, + stockmoves.transno, + stockmoves.trandate, + stockmoves.debtorno, + stockmoves.branchcode, + stockmoves.qty, + stockmoves.reference, + stockmoves.price, + stockmoves.discountpercent, + stockmoves.newqoh, + stockmaster.decimalplaces + FROM stockmoves + INNER JOIN systypes ON stockmoves.type=systypes.typeid + INNER JOIN stockmaster ON stockmoves.stockid=stockmaster.stockid + WHERE stockmoves.loccode='" . $_POST['StockLocation'] . "' + AND stockmoves.trandate >= '". $SQLAfterDate . "' + AND stockmoves.stockid = '" . $StockID . "' + AND stockmoves.trandate <= '" . $SQLBeforeDate . "' + AND hidemovt=0 + ORDER BY stkmoveno DESC"; $ErrMsg = _('The stock movements for the selected criteria could not be retrieved because') . ' - '; $DbgMsg = _('The SQL that failed was') . ' '; @@ -87,17 +89,17 @@ $MovtsResult = DB_query($sql, $db, $ErrMsg, $DbgMsg); $tableheader = '<tr> - <th>' . _('Type') . '</th> - <th>' . _('Number') . '</th> - <th>' . _('Date') . '</th> - <th>' . _('Customer') . '</th> - <th>' . _('Branch') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Reference') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('New Qty') . '</th> - </tr>'; + <th>' . _('Type') . '</th> + <th>' . _('Number') . '</th> + <th>' . _('Date') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('New Qty') . '</th> + </tr>'; echo $tableheader; @@ -123,11 +125,11 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s%%</td> + <td class="number">%s</td> </tr>', $rootpath, $myrow['transno'], @@ -136,10 +138,9 @@ $DisplayTranDate, $myrow['debtorno'], $myrow['branchcode'], - locale_number_format($myrow['qty'], - $myrow['decimalplaces']), + locale_number_format($myrow['qty'],$myrow['decimalplaces']), $myrow['reference'], - locale_number_format($myrow['price'],2), + locale_number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), locale_number_format($myrow['discountpercent']*100,2), locale_number_format($myrow['newqoh'],$myrow['decimalplaces'])); @@ -150,11 +151,11 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td class=number>%s</td> + <td class="number">%s</td> <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> + <td class="number">%s</td> + <td class="number">%s%%</td> + <td class="number">%s</td> </tr>', $rootpath, $myrow['transno'], @@ -171,26 +172,26 @@ } else { printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s%%</td> - <td class=number>%s</td> - </tr>', - $myrow['typename'], - $myrow['transno'], - $DisplayTranDate, - $myrow['debtorno'], - $myrow['branchcode'], - locale_number_format($myrow['qty'],$myrow['decimalplaces']), - $myrow['reference'], - locale_number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), - locale_number_format($myrow['discountpercent']*100,2), - locale_number_format($myrow['newqoh'],$myrow['decimalplaces'])); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s%%</td> + <td class="number">%s</td> + </tr>', + $myrow['typename'], + $myrow['transno'], + $DisplayTranDate, + $myrow['debtorno'], + $myrow['branchcode'], + locale_number_format($myrow['qty'],$myrow['decimalplaces']), + $myrow['reference'], + locale_number_format($myrow['price'],$_SESSION['CompanyRecord']['decimalplaces']), + locale_number_format($myrow['discountpercent']*100,2), + locale_number_format($myrow['newqoh'],$myrow['decimalplaces'])); } //end of page full new headings if } Modified: trunk/StockQuantityByDate.php =================================================================== --- trunk/StockQuantityByDate.php 2011-10-14 06:11:13 UTC (rev 4720) +++ trunk/StockQuantityByDate.php 2011-10-16 00:17:27 UTC (rev 4721) @@ -6,19 +6,22 @@ $title = _('Stock On Hand By Date'); include('includes/header.inc'); -echo '<p Class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . -'" alt="" /><b>' . $title. '</b></p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Inventory') . +'" alt="" /><b>' . $title. '</b> + </p>'; -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'] . '" />'; $sql = "SELECT categoryid, categorydescription FROM stockcategory"; $resultStkLocs = DB_query($sql, $db); -echo '<table class=selection><tr>'; -echo '<td>' . _('For Stock Category') . ':</td> - <td><select name="StockCategory"> '; -echo '<option value="All">' . _('All') . '</option>'; +echo '<table class="selection"> + <tr> + <td>' . _('For Stock Category') . ':</td> + <td><select name="StockCategory"> + <option value="All">' . _('All') . '</option>'; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockCategory']) AND $_POST['StockCategory']!='All'){ @@ -60,9 +63,15 @@ } echo '<td>' . _('On-Hand On Date') . ':</td> - <td><input type="t... [truncated message content] |
From: <dai...@us...> - 2011-10-17 09:14:13
|
Revision: 4723 http://web-erp.svn.sourceforge.net/web-erp/?rev=4723&view=rev Author: daintree Date: 2011-10-17 09:14:05 +0000 (Mon, 17 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/Suppliers.php trunk/Tax.php trunk/TaxAuthorities.php trunk/TaxAuthorityRates.php trunk/TaxCategories.php trunk/TaxGroups.php trunk/TaxProvinces.php trunk/TopItems.php Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2011-10-16 07:24:19 UTC (rev 4722) +++ trunk/Suppliers.php 2011-10-17 09:14:05 UTC (rev 4723) @@ -954,13 +954,22 @@ echo '</select></td></tr></table>'; if (isset($_POST['New'])) { - echo '<p><div class="centre"><input type="Submit" name="submit" value="' . _('Add These New Supplier Details') . '"></form>'; + echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Add These New Supplier Details') . '" /></form>'; } else { - echo '<br /><p><div class="centre"><input type="Submit" name="submit" value="' . _('Update Supplier') . '"></div><br />'; + echo '<br /> + <div class="centre"> + <input type="Submit" name="submit" value="' . _('Update Supplier') . '" /> + </div> + <br />'; // echo '<p><font color=red><b>' . _('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed') . '<br /></font></b>'; prnMsg(_('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed'), 'Warn'); - echo '<br /><div class=centre><input type="submit" name="delete" value="' . _('Delete Supplier') . '" onclick=\"return confirm(\'' . _('Are you sure you wish to delete this supplier?') . '\');\"></form>'; - echo '<br /><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $SupplierID . '">' . _('Review Contact Details') . '</a></div>'; + echo '<br /> + <div class=centre> + <input type="submit" name="delete" value="' . _('Delete Supplier') . '" onclick=\"return confirm(\'' . _('Are you sure you wish to delete this supplier?') . '\');\"> + </form>'; + echo '<br /> + <a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $SupplierID . '">' . _('Review Contact Details') . '</a> + </div>'; } echo '</div>'; } // end of main ifs Modified: trunk/Tax.php =================================================================== --- trunk/Tax.php 2011-10-16 07:24:19 UTC (rev 4722) +++ trunk/Tax.php 2011-10-17 09:14:05 UTC (rev 4723) @@ -34,25 +34,25 @@ /*Now get the invoices for the tax report */ $SQL = "SELECT debtortrans.transno, - debtortrans.type, - systypes.typename, - debtortrans.trandate, - debtortrans.debtorno, - debtorsmaster.name, - debtortrans.branchcode, - debtortrans.order_, - (debtortrans.ovamount+debtortrans.ovfreight)/debtortrans.rate AS netamount, - debtortrans.ovfreight/debtortrans.rate AS freightamount, - debtortranstaxes.taxamount/debtortrans.rate AS tax - FROM debtortrans - INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN systypes ON debtortrans.type=systypes.typeid - INNER JOIN debtortranstaxes ON debtortrans.id = debtortranstaxes.debtortransid - WHERE debtortrans.prd >= '" . ($_POST['ToPeriod'] - $_POST['NoOfPeriods'] + 1) . "' - AND debtortrans.prd <= '" . $_POST['ToPeriod'] . "' - AND (debtortrans.type=10 OR debtortrans.type=11) - AND debtortranstaxes.taxauthid = '" . $_POST['TaxAuthority'] . "' - ORDER BY debtortrans.id"; + debtortrans.type, + systypes.typename, + debtortrans.trandate, + debtortrans.debtorno, + debtorsmaster.name, + debtortrans.branchcode, + debtortrans.order_, + (debtortrans.ovamount+debtortrans.ovfreight)/debtortrans.rate AS netamount, + debtortrans.ovfreight/debtortrans.rate AS freightamount, + debtortranstaxes.taxamount/debtortrans.rate AS tax + FROM debtortrans + INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN systypes ON debtortrans.type=systypes.typeid + INNER JOIN debtortranstaxes ON debtortrans.id = debtortranstaxes.debtortransid + WHERE debtortrans.prd >= '" . ($_POST['ToPeriod'] - $_POST['NoOfPeriods'] + 1) . "' + AND debtortrans.prd <= '" . $_POST['ToPeriod'] . "' + AND (debtortrans.type=10 OR debtortrans.type=11) + AND debtortranstaxes.taxauthid = '" . $_POST['TaxAuthority'] . "' + ORDER BY debtortrans.id"; $DebtorTransResult = DB_query($SQL,$db,'','',false,false); //don't trap errors in DB_query @@ -91,8 +91,8 @@ $LeftOvers = $pdf->addTextWrap(140,$YPos,60,$FontSize,ConvertSQLDate($DebtorTransRow['trandate']),'left'); $LeftOvers = $pdf->addTextWrap(200,$YPos,150,$FontSize, $DebtorTransRow['name'],'left'); $LeftOvers = $pdf->addTextWrap(350,$YPos,60,$FontSize, $DebtorTransRow['branchcode'],'left'); - $LeftOvers = $pdf->addTextWrap(410,$YPos,60,$FontSize, locale_number_format($DebtorTransRow['netamount'],2),'right'); - $LeftOvers = $pdf->addTextWrap(470,$YPos,60,$FontSize, locale_number_format($DebtorTransRow['tax'],2),'right'); + $LeftOvers = $pdf->addTextWrap(410,$YPos,60,$FontSize, locale_number_format($DebtorTransRow['netamount'],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,60,$FontSize, locale_number_format($DebtorTransRow['tax'],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -=$line_height; if ($YPos < $Bottom_Margin + $line_height){ @@ -118,8 +118,8 @@ if ($_POST['DetailOrSummary']=='Detail'){ /*Print out the outputs totals */ - $LeftOvers = $pdf->addTextWrap(410,$YPos,60,8, locale_number_format($Outputs,2),'right'); - $LeftOvers = $pdf->addTextWrap(470,$YPos,60,8, locale_number_format($OutputTax,2),'right'); + $LeftOvers = $pdf->addTextWrap(410,$YPos,60,8, locale_number_format($Outputs,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,60,8, locale_number_format($OutputTax,$_SESSION['CompanyRecord']['decimalplaces']),'right'); /*Rule off under output totals */ $pdf->line(410, $YPos-5,530, $YPos-5); @@ -190,8 +190,8 @@ $LeftOvers = $pdf->addTextWrap(140,$YPos,60,$FontSize,ConvertSQLDate($SuppTransRow['trandate']),'left'); $LeftOvers = $pdf->addTextWrap(200,$YPos,150,$FontSize, $SuppTransRow['suppname'],'left'); - $LeftOvers = $pdf->addTextWrap(410,$YPos,60,$FontSize, locale_number_format($SuppTransRow['netamount'],2),'right'); - $LeftOvers = $pdf->addTextWrap(470,$YPos,60,$FontSize, locale_number_format($SuppTransRow['taxamt'],2),'right'); + $LeftOvers = $pdf->addTextWrap(410,$YPos,60,$FontSize, locale_number_format($SuppTransRow['netamount'],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,60,$FontSize, locale_number_format($SuppTransRow['taxamt'],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -=$line_height; if ($YPos < $Bottom_Margin + $line_height){ @@ -217,8 +217,8 @@ if ($_POST['DetailOrSummary']=='Detail'){ /*Print out the input totals */ - $LeftOvers = $pdf->addTextWrap(410,$YPos,60,8, locale_number_format($Inputs,2),'right'); - $LeftOvers = $pdf->addTextWrap(470,$YPos,60,8, locale_number_format($InputTax,2),'right'); + $LeftOvers = $pdf->addTextWrap(410,$YPos,60,8, locale_number_format($Inputs,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,60,8, locale_number_format($InputTax,$_SESSION['CompanyRecord']['decimalplaces']),'right'); /*Rule off under input totals */ $pdf->line(410, $YPos-5,530, $YPos-5); @@ -253,17 +253,17 @@ $YPos -= (2*$line_height); $LeftOvers = $pdf->addTextWrap(40,$YPos,180,$FontSize,_('Total Sales and Income (incl Tax)'),'left'); - $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($Outputs+$OutputTax,2),'right'); + $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($Outputs+$OutputTax,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= $line_height; $LeftOvers = $pdf->addTextWrap(40,$YPos,180,$FontSize,_('Tax On Liable Sales'),'left'); - $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($OutputTax,2),'right'); + $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($OutputTax,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= $line_height; $LeftOvers = $pdf->addTextWrap(40,$YPos,200,$FontSize,_('Tax On Purchases'),'left'); - $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($InputTax,2),'right'); + $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($InputTax,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2*$line_height); $LeftOvers = $pdf->addTextWrap(40,$YPos,500,$FontSize,_('Adjustments for Tax paid to Customs, FBT, entertainments etc must also be entered'),'left'); @@ -289,7 +289,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') . '" 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'] . '" />'; @@ -301,19 +301,21 @@ echo '<option Value=' . $myrow['taxid'] . '>' . $myrow['description'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Return Covering') . ':</font></td> + echo '<tr> + <td>' . _('Return Covering') . ':</font></td> <td><select name="NoOfPeriods"> <option value=1>' . _('One Month') . '</option>' . '<option selected value=2>' ._('Two Months') . '</option>' . '<option value=3>' . _('Quarter') . '</option>' . '<option value=6>' . _('Six Months') . '</option>' . - '</select></td></tr>'; + '</select></td> + </tr>'; - echo '<tr><td>' . _('Return To') . ':</td> + echo '<tr> + <td>' . _('Return To') . ':</td> <td><select name="ToPeriod">'; - $DefaultPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),0,Date('Y'))),$db); $sql = "SELECT periodno, @@ -325,23 +327,28 @@ while ($myrow = DB_fetch_array($Periods,$db)){ if ($myrow['periodno']==$DefaultPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value="' . $myrow['periodno'] . '">' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value="' . $myrow['periodno'] . '">' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; - echo '<tr><td>' . _('Detail Or Summary Only') . ':</font></td> + echo '<tr> + <td>' . _('Detail Or Summary Only') . ':</font></td> <td><select name="DetailOrSummary"> - <option Value="Detail">' . _('Detail and Summary') . '</option> - <option selected value="Summary">' . _('Summary Only') . '</option> - </select></td></tr>'; + <option value="Detail">' . _('Detail and Summary') . '</option> + <option selected value="Summary">' . _('Summary Only') . '</option> + </select></td> + </tr>'; echo '</table> - <br /><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"> + <br /> + <div class="centre"> + <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> </div> </form>'; Modified: trunk/TaxAuthorities.php =================================================================== --- trunk/TaxAuthorities.php 2011-10-16 07:24:19 UTC (rev 4722) +++ trunk/TaxAuthorities.php 2011-10-17 09:14:05 UTC (rev 4723) @@ -6,8 +6,10 @@ $title = _('Tax Authorities'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') - . '" alt="" />' . $title. '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') + . '" alt="" />' . $title. ' + </p>'; if (isset($_POST['SelectedTaxAuthID'])){ $SelectedTaxAuthID =$_POST['SelectedTaxAuthID']; @@ -32,14 +34,14 @@ delete code below*/ $sql = "UPDATE taxauthorities - SET taxglcode ='" . $_POST['TaxGLCode'] . "', - purchtaxglaccount ='" . $_POST['PurchTaxGLCode'] . "', - description = '" . $_POST['Description'] . "', - bank = '". $_POST['Bank']."', - bankacctype = '". $_POST['BankAccType']."', - bankacc = '". $_POST['BankAcc']."', - bankswift = '". $_POST['BankSwift']."' - WHERE taxid = '" . $SelectedTaxAuthID . "'"; + SET taxglcode ='" . $_POST['TaxGLCode'] . "', + purchtaxglaccount ='" . $_POST['PurchTaxGLCode'] . "', + description = '" . DB_escape_string($_POST['Description']) . "', + bank = '" . $_POST['Bank'] . "', + bankacctype = '". $_POST['BankAccType'] . "', + bankacc = '". DB_escape_string($_POST['BankAcc']) . "', + bankswift = '". DB_escape_string($_POST['BankSwift']) . "' + WHERE taxid = '" . $SelectedTaxAuthID . "'"; $ErrMsg = _('The update of this tax authority failed because'); $result = DB_query($sql,$db,$ErrMsg); @@ -61,11 +63,11 @@ VALUES ( '" . $_POST['TaxGLCode'] . "', '" . $_POST['PurchTaxGLCode'] . "', - '" .$_POST['Description'] . "', - '" .$_POST['Bank'] . "', - '" .$_POST['BankAccType'] . "', - '" .$_POST['BankAcc'] . "', - '" .$_POST['BankSwift'] . "' + '" . DB_escape_string($_POST['Description']) . "', + '" . $_POST['Bank'] . "', + '" . $_POST['BankAccType'] . "', + '" . DB_escape_string($_POST['BankAcc']) . "', + '" . DB_escape_string($_POST['BankSwift']) . "' )"; $Errmsg = _('The addition of this tax authority failed because'); @@ -126,30 +128,30 @@ /* It could still be the second time the page has been run and a record has been selected for modification - SelectedTaxAuthID will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters then none of the above are true and the list of tax authorities will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ $sql = "SELECT taxid, - description, - taxglcode, - purchtaxglaccount, - bank, - bankacc, - bankacctype, - bankswift - FROM taxauthorities"; + description, + taxglcode, + purchtaxglaccount, + bank, + bankacc, + bankacctype, + bankswift + FROM taxauthorities"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The defined tax authorities could not be retrieved because'); $DbgMsg = _('The following SQL to retrieve the tax authorities was used'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class=selection>'; - echo '<tr> - <th>' . _('ID') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Input Tax') . '<br />' . _('GL Account') . '</th> - <th>' . _('Output Tax') . '<br />' . _('GL Account') . '</th> - <th>' . _('Bank') . '</th> - <th>' . _('Bank Account') . '</th> - <th>' . _('Bank Act Type') . '</th> - <th>' . _('Bank Swift') . '</th> - </tr></font>'; + echo '<table class="selection"> + <tr> + <th>' . _('ID') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Input Tax') . '<br />' . _('GL Account') . '</th> + <th>' . _('Output Tax') . '<br />' . _('GL Account') . '</th> + <th>' . _('Bank') . '</th> + <th>' . _('Bank Account') . '</th> + <th>' . _('Bank Act Type') . '</th> + <th>' . _('Bank Swift') . '</th> + </tr>'; $k=0; while ($myrow = DB_fetch_row($result)) { @@ -161,7 +163,7 @@ $k++; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -169,24 +171,24 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s&SelectedTaxAuthID=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s&SelectedTaxAuthID=%s&delete=yes\">" . _('Delete') . "</a></td> - <td><td><a href=\"%s&TaxAuthority=%s\">" . _('Edit Rates') . "</a></td> - </tr>", - $myrow[0], - $myrow[1], - $myrow[3], - $myrow[2], - $myrow[4], - $myrow[5], - $myrow[6], - $myrow[7], - $_SERVER['PHP_SELF'] . '?', - $myrow[0], - $_SERVER['PHP_SELF'] . '?', - $myrow[0], - $rootpath . '/TaxAuthorityRates.php?', - $myrow[0]); + <td><a href="%sSelectedTaxAuthID=%s">' . _('Edit') . '</a></td> + <td><a href="%sSelectedTaxAuthID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this tax authority?') . '\');">' . _('Delete') . '</a></td> + <td><td><a href="%sTaxAuthority=%s">' . _('Edit Rates') . '</a></td> + </tr>', + $myrow[0], + $myrow[1], + $myrow[3], + $myrow[2], + $myrow[4], + $myrow[5], + $myrow[6], + $myrow[7], + $_SERVER['PHP_SELF'] . '?', + $myrow[0], + $_SERVER['PHP_SELF'] . '?', + $myrow[0], + $rootpath . '/TaxAuthorityRates.php?', + $myrow[0]); } //END WHILE LIST LOOP @@ -199,7 +201,9 @@ if (isset($SelectedTaxAuthID)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review all defined tax authority records') . '</a></div>'; + echo '<div class="centre"> + <a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review all defined tax authority records') . '</a> + </div>'; } @@ -210,14 +214,14 @@ //editing an existing tax authority $sql = "SELECT taxglcode, - purchtaxglaccount, - description, - bank, - bankacc, - bankacctype, - bankswift - FROM taxauthorities - WHERE taxid='" . $SelectedTaxAuthID . "'"; + purchtaxglaccount, + description, + bank, + bankacc, + bankacctype, + bankswift + FROM taxauthorities + WHERE taxid='" . $SelectedTaxAuthID . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -231,56 +235,57 @@ $_POST['BankSwift'] = $myrow['bankswift']; - echo "<input type=hidden name='SelectedTaxAuthID' VALUE=" . $SelectedTaxAuthID . '>'; + echo '<input type="hidden" name="SelectedTaxAuthID" value="' . $SelectedTaxAuthID . '" />'; } //end of if $SelectedTaxAuthID only do the else when a new record is being entered $SQL = "SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=0 - ORDER BY accountcode"; + accountname + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=0 + ORDER BY accountcode"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { $_POST['Description']=''; } -echo '<table class=selection> -<tr><td>' . _('Tax Type Description') . ":</td> -<td><input type=Text name='Description' size=21 maxlength=20 value='" . $_POST['Description'] . "'></td></tr>"; +echo '<table class="selection"> + <tr> + <td>' . _('Tax Type Description') . ':</td> + <td><input type="text" name="Description" size="21" maxlength="20" value="' . $_POST['Description'] . '"></td> + </tr> + <tr> + <td>' . _('Input tax GL Account') . ':</td> + <td><select name="PurchTaxGLCode">'; - -echo '<tr><td>' . _('Input tax GL Account') . ':</td> - <td><select name="PurchTaxGLCode">'; - while ($myrow = DB_fetch_array($result)) { if (isset($_POST['PurchTaxGLCode']) and $myrow['accountcode']==$_POST['PurchTaxGLCode']) { - echo '<option selected VALUE='; + echo '<option selected value='; } else { - echo '<option VALUE='; + echo '<option value='; } echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop -echo '</select></td></tr>'; +echo '</select></td> + </tr>'; DB_data_seek($result,0); -echo '<tr><td>' . _('Output tax GL Account') . ':</td> - <td><select name="TaxGLCode">'; +echo '<tr> + <td>' . _('Output tax GL Account') . ':</td> + <td><select name="TaxGLCode">'; - while ($myrow = DB_fetch_array($result)) { if (isset($_POST['TaxGLCode']) and $myrow['accountcode']==$_POST['TaxGLCode']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + echo $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop @@ -297,20 +302,32 @@ $_POST['BankSwift']=''; } -echo '</select></td></tr>'; -echo '<tr><td>' . _('Bank Name') . ':</td>'; -echo '<td><input type=Text name="Bank" size=41 maxlength=40 value="' . $_POST['Bank'] . '"></td></tr>'; -echo '<tr><td>' . _('Bank Account Type') . ':</td>'; -echo '<td><input type=Text name="BankAccType" size=15 maxlength=20 value="' . $_POST['BankAccType'] . '"></td></tr>'; -echo '<tr><td>' . _('Bank Account') . ':</td>'; -echo '<td><input type=Text name="BankAcc" size=21 maxlength=20 value="' . $_POST['BankAcc'] . '"></td></tr>'; -echo '<tr><td>' . _('Bank Swift No') . ':</td>'; -echo '<td><input type=Text name="BankSwift" size=15 maxlength=14 value="' . $_POST['BankSwift'] . '"></td></tr>'; +echo '</select></td> + </tr> + <tr> + <td>' . _('Bank Name') . ':</td> + <td><input type="text" name="Bank" size="41" maxlength="40" value="' . $_POST['Bank'] . '" /></td> + </tr> + <tr> + <td>' . _('Bank Account Type') . ':</td> + <td><input type="text" name="BankAccType" size="15" maxlength="20" value="' . $_POST['BankAccType'] . '" /></td> + </tr> + <tr> + <td>' . _('Bank Account') . ':</td> + <td><input type="text" name="BankAcc" size="21" maxlength="20" value="' . $_POST['BankAcc'] . '" /></td> + </tr> + <tr> + <td>' . _('Bank Swift No') . ':</td> + <td><input type="text" name="BankSwift" size="15" maxlength="14" value="' . $_POST['BankSwift'] . '" /></td> + </tr> + </table>'; -echo '</table>'; +echo '<br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> + </div> + </form>'; -echo '<br /><div class="centre"><input type=submit name=submit value=' . _('Enter Information') . '></div></form>'; - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/TaxAuthorityRates.php =================================================================== --- trunk/TaxAuthorityRates.php 2011-10-16 07:24:19 UTC (rev 4722) +++ trunk/TaxAuthorityRates.php 2011-10-17 09:14:05 UTC (rev 4723) @@ -12,8 +12,10 @@ $title = _('Tax Rates'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') - . '" alt="" />' . $title. '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') + . '" alt="" />' . $title. ' + </p>'; if (!isset($TaxAuthority)){ @@ -34,7 +36,7 @@ while ($myrow=DB_fetch_array($TaxRatesResult)){ - $sql = "UPDATE taxauthrates SET taxrate=" . ($_POST[$myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid']]/100) . " + $sql = "UPDATE taxauthrates SET taxrate=" . (filter_number_format($_POST[$myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid']])/100) . " WHERE taxcatid = '" . $myrow['taxcatid'] . "' AND dispatchtaxprovince = '" . $myrow['dispatchtaxprovince'] . "' AND taxauthority = '" . $TaxAuthority . "'"; @@ -49,35 +51,39 @@ /*Display updated rates */ -$TaxAuthDetail = DB_query("SELECT description FROM taxauthorities WHERE taxid='" . $TaxAuthority . "'",$db); +$TaxAuthDetail = DB_query("SELECT description + FROM taxauthorities WHERE taxid='" . $TaxAuthority . "'",$db); $myrow = DB_fetch_row($TaxAuthDetail); echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<input type=hidden name="TaxAuthority" value="' . $TaxAuthority . '">'; +echo '<input type=hidden name="TaxAuthority" value="' . $TaxAuthority . '" />'; $TaxRatesResult = DB_query("SELECT taxauthrates.taxcatid, taxcategories.taxcatname, taxauthrates.taxrate, taxauthrates.dispatchtaxprovince, taxprovinces.taxprovincename - FROM taxauthrates INNER JOIN taxauthorities - ON taxauthrates.taxauthority=taxauthorities.taxid - INNER JOIN taxprovinces - ON taxauthrates.dispatchtaxprovince= taxprovinces.taxprovinceid - INNER JOIN taxcategories - ON taxauthrates.taxcatid=taxcategories.taxcatid - WHERE taxauthrates.taxauthority='" . $TaxAuthority . "' - ORDER BY taxauthrates.dispatchtaxprovince, - taxauthrates.taxcatid", - $db); + FROM taxauthrates INNER JOIN taxauthorities + ON taxauthrates.taxauthority=taxauthorities.taxid + INNER JOIN taxprovinces + ON taxauthrates.dispatchtaxprovince= taxprovinces.taxprovinceid + INNER JOIN taxcategories + ON taxauthrates.taxcatid=taxcategories.taxcatid + WHERE taxauthrates.taxauthority='" . $TaxAuthority . "' + ORDER BY taxauthrates.dispatchtaxprovince, + taxauthrates.taxcatid", + $db); if (DB_num_rows($TaxRatesResult)>0){ - echo '<table cellpadding=2 class="selection">'; - echo '<tr><th colspan=3><font size=3 color=navy>' . _('Update') . ' ' . $myrow[0] . ' ' . _('Rates') . '</font></th></tr>'; - $TableHeader = '<tr><th>' . _('Deliveries From') . '<br />' . _('Tax Province') . '</th> + echo '<table class="selection">'; + echo '<tr> + <th colspan="3"><font size="3" color="navy">' . _('Update') . ' ' . $myrow[0] . ' ' . _('Rates') . '</font></th> + </tr>'; + $TableHeader = '<tr> + <th>' . _('Deliveries From') . '<br />' . _('Tax Province') . '</th> <th>' . _('Tax Category') . '</th> <th>' . _('Tax Rate') . ' %</th> </tr>'; @@ -89,7 +95,7 @@ while ($myrow = DB_fetch_array($TaxRatesResult)){ if ($OldProvince!=$myrow['dispatchtaxprovince'] AND $OldProvince!=''){ - echo '<tr bgcolor="#555555"><font size=1> </font><td colspan=3></td></tr>'; + echo '<tr bgcolor="#555555"><td colspan="3"></td></tr>'; } if ($k==1){ @@ -101,13 +107,13 @@ } printf('<td>%s</td> - <td>%s</td> - <td><input type="text" class="number" name=%s maxlength=5 size=5 value=%s></td> - </tr>', - $myrow['taxprovincename'], - $myrow['taxcatname'], - $myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid'], - $myrow['taxrate']*100 ); + <td>%s</td> + <td><input type="text" class="number" name=%s maxlength="5" size="5" value="%s" /></td> + </tr>', + $myrow['taxprovincename'], + $myrow['taxcatname'], + $myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid'], + locale_number_format($myrow['taxrate']*100,2)); $OldProvince = $myrow['dispatchtaxprovince']; @@ -116,7 +122,7 @@ echo '</table>'; echo '<br /> <div class="centre"> - <input type=submit name="UpdateRates" VALUE="' . _('Update Rates') . '">'; + <input type="submit" name="UpdateRates" value="' . _('Update Rates') . '" />'; } //end if tax taxcatid/rates to show else { prnMsg(_('There are no tax rates to show - perhaps the dispatch tax province records have not yet been created?'),'warn'); @@ -124,11 +130,16 @@ echo '</form>'; -echo '<br /><br /><a href="' . $rootpath . '/TaxAuthorities.php">' . _('Tax Authorities') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxGroups.php">' . _('Tax Groupings') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxCategories.php">' . _('Tax Categories') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxProvinces.php">' . _('Dispatch Tax Provinces') . '</a>'; -echo '</div>'; +echo '<br /> + <br /> + <a href="' . $rootpath . '/TaxAuthorities.php">' . _('Tax Authorities') . '</a> + <br /> + <a href="' . $rootpath . '/TaxGroups.php">' . _('Tax Groupings') . '</a> + <br /> + <a href="' . $rootpath . '/TaxCategories.php">' . _('Tax Categories') . '</a> + <br /> + <a href="' . $rootpath . '/TaxProvinces.php">' . _('Dispatch Tax Provinces') . '</a> + </div>'; include( 'includes/footer.inc' ); ?> \ No newline at end of file Modified: trunk/TaxCategories.php =================================================================== --- trunk/TaxCategories.php 2011-10-16 07:24:19 UTC (rev 4722) +++ trunk/TaxCategories.php 2011-10-17 09:14:05 UTC (rev 4723) @@ -26,9 +26,9 @@ //first off validate inputs sensible - if (mb_strpos($_POST['TaxCategoryName'],'&')>0 OR mb_strpos($_POST['TaxCategoryName'],"'")>0) { + if (ContainsIllegalCharacters($_POST['TaxCategoryName'])) { $InputError = 1; - prnMsg( _('The tax category name cannot contain the character') . " '&' " . _('or the character') ." '",'error'); + prnMsg( _('The tax category name cannot contain the character') . " '&' " . _('or the character') ." ' " . _('or a space') ,'error'); } if (trim($_POST['TaxCategoryName']) == '') { $InputError = 1; @@ -162,10 +162,10 @@ $ErrMsg = _('Could not get tax categories because'); $result = DB_query($sql,$db,$ErrMsg); - echo '<table class=selection> - <tr> - <th>' . _('Tax Categories') . '</th> - </tr>'; + echo '<table class="selection"> + <tr> + <th>' . _('Tax Categories') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -178,18 +178,20 @@ $k++; } - echo '<td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedTaxCategory=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedTaxCatego... [truncated message content] |
From: <dai...@us...> - 2011-10-17 09:14:13
|
Revision: 4723 http://web-erp.svn.sourceforge.net/web-erp/?rev=4723&view=rev Author: daintree Date: 2011-10-17 09:14:05 +0000 (Mon, 17 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/Suppliers.php trunk/Tax.php trunk/TaxAuthorities.php trunk/TaxAuthorityRates.php trunk/TaxCategories.php trunk/TaxGroups.php trunk/TaxProvinces.php trunk/TopItems.php Modified: trunk/Suppliers.php =================================================================== --- trunk/Suppliers.php 2011-10-16 07:24:19 UTC (rev 4722) +++ trunk/Suppliers.php 2011-10-17 09:14:05 UTC (rev 4723) @@ -954,13 +954,22 @@ echo '</select></td></tr></table>'; if (isset($_POST['New'])) { - echo '<p><div class="centre"><input type="Submit" name="submit" value="' . _('Add These New Supplier Details') . '"></form>'; + echo '<p><div class="centre"><input type="submit" name="submit" value="' . _('Add These New Supplier Details') . '" /></form>'; } else { - echo '<br /><p><div class="centre"><input type="Submit" name="submit" value="' . _('Update Supplier') . '"></div><br />'; + echo '<br /> + <div class="centre"> + <input type="Submit" name="submit" value="' . _('Update Supplier') . '" /> + </div> + <br />'; // echo '<p><font color=red><b>' . _('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed') . '<br /></font></b>'; prnMsg(_('WARNING') . ': ' . _('There is no second warning if you hit the delete button below') . '. ' . _('However checks will be made to ensure there are no outstanding purchase orders or existing accounts payable transactions before the deletion is processed'), 'Warn'); - echo '<br /><div class=centre><input type="submit" name="delete" value="' . _('Delete Supplier') . '" onclick=\"return confirm(\'' . _('Are you sure you wish to delete this supplier?') . '\');\"></form>'; - echo '<br /><a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $SupplierID . '">' . _('Review Contact Details') . '</a></div>'; + echo '<br /> + <div class=centre> + <input type="submit" name="delete" value="' . _('Delete Supplier') . '" onclick=\"return confirm(\'' . _('Are you sure you wish to delete this supplier?') . '\');\"> + </form>'; + echo '<br /> + <a href="' . $rootpath . '/SupplierContacts.php?SupplierID=' . $SupplierID . '">' . _('Review Contact Details') . '</a> + </div>'; } echo '</div>'; } // end of main ifs Modified: trunk/Tax.php =================================================================== --- trunk/Tax.php 2011-10-16 07:24:19 UTC (rev 4722) +++ trunk/Tax.php 2011-10-17 09:14:05 UTC (rev 4723) @@ -34,25 +34,25 @@ /*Now get the invoices for the tax report */ $SQL = "SELECT debtortrans.transno, - debtortrans.type, - systypes.typename, - debtortrans.trandate, - debtortrans.debtorno, - debtorsmaster.name, - debtortrans.branchcode, - debtortrans.order_, - (debtortrans.ovamount+debtortrans.ovfreight)/debtortrans.rate AS netamount, - debtortrans.ovfreight/debtortrans.rate AS freightamount, - debtortranstaxes.taxamount/debtortrans.rate AS tax - FROM debtortrans - INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno - INNER JOIN systypes ON debtortrans.type=systypes.typeid - INNER JOIN debtortranstaxes ON debtortrans.id = debtortranstaxes.debtortransid - WHERE debtortrans.prd >= '" . ($_POST['ToPeriod'] - $_POST['NoOfPeriods'] + 1) . "' - AND debtortrans.prd <= '" . $_POST['ToPeriod'] . "' - AND (debtortrans.type=10 OR debtortrans.type=11) - AND debtortranstaxes.taxauthid = '" . $_POST['TaxAuthority'] . "' - ORDER BY debtortrans.id"; + debtortrans.type, + systypes.typename, + debtortrans.trandate, + debtortrans.debtorno, + debtorsmaster.name, + debtortrans.branchcode, + debtortrans.order_, + (debtortrans.ovamount+debtortrans.ovfreight)/debtortrans.rate AS netamount, + debtortrans.ovfreight/debtortrans.rate AS freightamount, + debtortranstaxes.taxamount/debtortrans.rate AS tax + FROM debtortrans + INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno + INNER JOIN systypes ON debtortrans.type=systypes.typeid + INNER JOIN debtortranstaxes ON debtortrans.id = debtortranstaxes.debtortransid + WHERE debtortrans.prd >= '" . ($_POST['ToPeriod'] - $_POST['NoOfPeriods'] + 1) . "' + AND debtortrans.prd <= '" . $_POST['ToPeriod'] . "' + AND (debtortrans.type=10 OR debtortrans.type=11) + AND debtortranstaxes.taxauthid = '" . $_POST['TaxAuthority'] . "' + ORDER BY debtortrans.id"; $DebtorTransResult = DB_query($SQL,$db,'','',false,false); //don't trap errors in DB_query @@ -91,8 +91,8 @@ $LeftOvers = $pdf->addTextWrap(140,$YPos,60,$FontSize,ConvertSQLDate($DebtorTransRow['trandate']),'left'); $LeftOvers = $pdf->addTextWrap(200,$YPos,150,$FontSize, $DebtorTransRow['name'],'left'); $LeftOvers = $pdf->addTextWrap(350,$YPos,60,$FontSize, $DebtorTransRow['branchcode'],'left'); - $LeftOvers = $pdf->addTextWrap(410,$YPos,60,$FontSize, locale_number_format($DebtorTransRow['netamount'],2),'right'); - $LeftOvers = $pdf->addTextWrap(470,$YPos,60,$FontSize, locale_number_format($DebtorTransRow['tax'],2),'right'); + $LeftOvers = $pdf->addTextWrap(410,$YPos,60,$FontSize, locale_number_format($DebtorTransRow['netamount'],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,60,$FontSize, locale_number_format($DebtorTransRow['tax'],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -=$line_height; if ($YPos < $Bottom_Margin + $line_height){ @@ -118,8 +118,8 @@ if ($_POST['DetailOrSummary']=='Detail'){ /*Print out the outputs totals */ - $LeftOvers = $pdf->addTextWrap(410,$YPos,60,8, locale_number_format($Outputs,2),'right'); - $LeftOvers = $pdf->addTextWrap(470,$YPos,60,8, locale_number_format($OutputTax,2),'right'); + $LeftOvers = $pdf->addTextWrap(410,$YPos,60,8, locale_number_format($Outputs,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,60,8, locale_number_format($OutputTax,$_SESSION['CompanyRecord']['decimalplaces']),'right'); /*Rule off under output totals */ $pdf->line(410, $YPos-5,530, $YPos-5); @@ -190,8 +190,8 @@ $LeftOvers = $pdf->addTextWrap(140,$YPos,60,$FontSize,ConvertSQLDate($SuppTransRow['trandate']),'left'); $LeftOvers = $pdf->addTextWrap(200,$YPos,150,$FontSize, $SuppTransRow['suppname'],'left'); - $LeftOvers = $pdf->addTextWrap(410,$YPos,60,$FontSize, locale_number_format($SuppTransRow['netamount'],2),'right'); - $LeftOvers = $pdf->addTextWrap(470,$YPos,60,$FontSize, locale_number_format($SuppTransRow['taxamt'],2),'right'); + $LeftOvers = $pdf->addTextWrap(410,$YPos,60,$FontSize, locale_number_format($SuppTransRow['netamount'],$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,60,$FontSize, locale_number_format($SuppTransRow['taxamt'],$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -=$line_height; if ($YPos < $Bottom_Margin + $line_height){ @@ -217,8 +217,8 @@ if ($_POST['DetailOrSummary']=='Detail'){ /*Print out the input totals */ - $LeftOvers = $pdf->addTextWrap(410,$YPos,60,8, locale_number_format($Inputs,2),'right'); - $LeftOvers = $pdf->addTextWrap(470,$YPos,60,8, locale_number_format($InputTax,2),'right'); + $LeftOvers = $pdf->addTextWrap(410,$YPos,60,8, locale_number_format($Inputs,$_SESSION['CompanyRecord']['decimalplaces']),'right'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,60,8, locale_number_format($InputTax,$_SESSION['CompanyRecord']['decimalplaces']),'right'); /*Rule off under input totals */ $pdf->line(410, $YPos-5,530, $YPos-5); @@ -253,17 +253,17 @@ $YPos -= (2*$line_height); $LeftOvers = $pdf->addTextWrap(40,$YPos,180,$FontSize,_('Total Sales and Income (incl Tax)'),'left'); - $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($Outputs+$OutputTax,2),'right'); + $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($Outputs+$OutputTax,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= $line_height; $LeftOvers = $pdf->addTextWrap(40,$YPos,180,$FontSize,_('Tax On Liable Sales'),'left'); - $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($OutputTax,2),'right'); + $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($OutputTax,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= $line_height; $LeftOvers = $pdf->addTextWrap(40,$YPos,200,$FontSize,_('Tax On Purchases'),'left'); - $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($InputTax,2),'right'); + $LeftOvers = $pdf->addTextWrap(220,$YPos,100,$FontSize,locale_number_format($InputTax,$_SESSION['CompanyRecord']['decimalplaces']),'right'); $YPos -= (2*$line_height); $LeftOvers = $pdf->addTextWrap(40,$YPos,500,$FontSize,_('Adjustments for Tax paid to Customs, FBT, entertainments etc must also be entered'),'left'); @@ -289,7 +289,7 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') . '" 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'] . '" />'; @@ -301,19 +301,21 @@ echo '<option Value=' . $myrow['taxid'] . '>' . $myrow['description'] . '</option>'; } echo '</select></td></tr>'; - echo '<tr><td>' . _('Return Covering') . ':</font></td> + echo '<tr> + <td>' . _('Return Covering') . ':</font></td> <td><select name="NoOfPeriods"> <option value=1>' . _('One Month') . '</option>' . '<option selected value=2>' ._('Two Months') . '</option>' . '<option value=3>' . _('Quarter') . '</option>' . '<option value=6>' . _('Six Months') . '</option>' . - '</select></td></tr>'; + '</select></td> + </tr>'; - echo '<tr><td>' . _('Return To') . ':</td> + echo '<tr> + <td>' . _('Return To') . ':</td> <td><select name="ToPeriod">'; - $DefaultPeriod = GetPeriod(Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),0,Date('Y'))),$db); $sql = "SELECT periodno, @@ -325,23 +327,28 @@ while ($myrow = DB_fetch_array($Periods,$db)){ if ($myrow['periodno']==$DefaultPeriod){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option selected value="' . $myrow['periodno'] . '">' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; + echo '<option value="' . $myrow['periodno'] . '">' . ConvertSQLDate($myrow['lastdate_in_period']) . '</option>'; } } - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; - echo '<tr><td>' . _('Detail Or Summary Only') . ':</font></td> + echo '<tr> + <td>' . _('Detail Or Summary Only') . ':</font></td> <td><select name="DetailOrSummary"> - <option Value="Detail">' . _('Detail and Summary') . '</option> - <option selected value="Summary">' . _('Summary Only') . '</option> - </select></td></tr>'; + <option value="Detail">' . _('Detail and Summary') . '</option> + <option selected value="Summary">' . _('Summary Only') . '</option> + </select></td> + </tr>'; echo '</table> - <br /><div class="centre"><input type="submit" name="PrintPDF" value="' . _('Print PDF') . '"> + <br /> + <div class="centre"> + <input type="submit" name="PrintPDF" value="' . _('Print PDF') . '" /> </div> </form>'; Modified: trunk/TaxAuthorities.php =================================================================== --- trunk/TaxAuthorities.php 2011-10-16 07:24:19 UTC (rev 4722) +++ trunk/TaxAuthorities.php 2011-10-17 09:14:05 UTC (rev 4723) @@ -6,8 +6,10 @@ $title = _('Tax Authorities'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') - . '" alt="" />' . $title. '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') + . '" alt="" />' . $title. ' + </p>'; if (isset($_POST['SelectedTaxAuthID'])){ $SelectedTaxAuthID =$_POST['SelectedTaxAuthID']; @@ -32,14 +34,14 @@ delete code below*/ $sql = "UPDATE taxauthorities - SET taxglcode ='" . $_POST['TaxGLCode'] . "', - purchtaxglaccount ='" . $_POST['PurchTaxGLCode'] . "', - description = '" . $_POST['Description'] . "', - bank = '". $_POST['Bank']."', - bankacctype = '". $_POST['BankAccType']."', - bankacc = '". $_POST['BankAcc']."', - bankswift = '". $_POST['BankSwift']."' - WHERE taxid = '" . $SelectedTaxAuthID . "'"; + SET taxglcode ='" . $_POST['TaxGLCode'] . "', + purchtaxglaccount ='" . $_POST['PurchTaxGLCode'] . "', + description = '" . DB_escape_string($_POST['Description']) . "', + bank = '" . $_POST['Bank'] . "', + bankacctype = '". $_POST['BankAccType'] . "', + bankacc = '". DB_escape_string($_POST['BankAcc']) . "', + bankswift = '". DB_escape_string($_POST['BankSwift']) . "' + WHERE taxid = '" . $SelectedTaxAuthID . "'"; $ErrMsg = _('The update of this tax authority failed because'); $result = DB_query($sql,$db,$ErrMsg); @@ -61,11 +63,11 @@ VALUES ( '" . $_POST['TaxGLCode'] . "', '" . $_POST['PurchTaxGLCode'] . "', - '" .$_POST['Description'] . "', - '" .$_POST['Bank'] . "', - '" .$_POST['BankAccType'] . "', - '" .$_POST['BankAcc'] . "', - '" .$_POST['BankSwift'] . "' + '" . DB_escape_string($_POST['Description']) . "', + '" . $_POST['Bank'] . "', + '" . $_POST['BankAccType'] . "', + '" . DB_escape_string($_POST['BankAcc']) . "', + '" . DB_escape_string($_POST['BankSwift']) . "' )"; $Errmsg = _('The addition of this tax authority failed because'); @@ -126,30 +128,30 @@ /* It could still be the second time the page has been run and a record has been selected for modification - SelectedTaxAuthID will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters then none of the above are true and the list of tax authorities will be displayed with links to delete or edit each. These will call the same page again and allow update/input or deletion of the records*/ $sql = "SELECT taxid, - description, - taxglcode, - purchtaxglaccount, - bank, - bankacc, - bankacctype, - bankswift - FROM taxauthorities"; + description, + taxglcode, + purchtaxglaccount, + bank, + bankacc, + bankacctype, + bankswift + FROM taxauthorities"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The defined tax authorities could not be retrieved because'); $DbgMsg = _('The following SQL to retrieve the tax authorities was used'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table class=selection>'; - echo '<tr> - <th>' . _('ID') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Input Tax') . '<br />' . _('GL Account') . '</th> - <th>' . _('Output Tax') . '<br />' . _('GL Account') . '</th> - <th>' . _('Bank') . '</th> - <th>' . _('Bank Account') . '</th> - <th>' . _('Bank Act Type') . '</th> - <th>' . _('Bank Swift') . '</th> - </tr></font>'; + echo '<table class="selection"> + <tr> + <th>' . _('ID') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Input Tax') . '<br />' . _('GL Account') . '</th> + <th>' . _('Output Tax') . '<br />' . _('GL Account') . '</th> + <th>' . _('Bank') . '</th> + <th>' . _('Bank Account') . '</th> + <th>' . _('Bank Act Type') . '</th> + <th>' . _('Bank Swift') . '</th> + </tr>'; $k=0; while ($myrow = DB_fetch_row($result)) { @@ -161,7 +163,7 @@ $k++; } - printf("<td>%s</td> + printf('<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> @@ -169,24 +171,24 @@ <td>%s</td> <td>%s</td> <td>%s</td> - <td><a href=\"%s&SelectedTaxAuthID=%s\">" . _('Edit') . "</a></td> - <td><a href=\"%s&SelectedTaxAuthID=%s&delete=yes\">" . _('Delete') . "</a></td> - <td><td><a href=\"%s&TaxAuthority=%s\">" . _('Edit Rates') . "</a></td> - </tr>", - $myrow[0], - $myrow[1], - $myrow[3], - $myrow[2], - $myrow[4], - $myrow[5], - $myrow[6], - $myrow[7], - $_SERVER['PHP_SELF'] . '?', - $myrow[0], - $_SERVER['PHP_SELF'] . '?', - $myrow[0], - $rootpath . '/TaxAuthorityRates.php?', - $myrow[0]); + <td><a href="%sSelectedTaxAuthID=%s">' . _('Edit') . '</a></td> + <td><a href="%sSelectedTaxAuthID=%s&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this tax authority?') . '\');">' . _('Delete') . '</a></td> + <td><td><a href="%sTaxAuthority=%s">' . _('Edit Rates') . '</a></td> + </tr>', + $myrow[0], + $myrow[1], + $myrow[3], + $myrow[2], + $myrow[4], + $myrow[5], + $myrow[6], + $myrow[7], + $_SERVER['PHP_SELF'] . '?', + $myrow[0], + $_SERVER['PHP_SELF'] . '?', + $myrow[0], + $rootpath . '/TaxAuthorityRates.php?', + $myrow[0]); } //END WHILE LIST LOOP @@ -199,7 +201,9 @@ if (isset($SelectedTaxAuthID)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review all defined tax authority records') . '</a></div>'; + echo '<div class="centre"> + <a href="' . $_SERVER['PHP_SELF'] .'">' . _('Review all defined tax authority records') . '</a> + </div>'; } @@ -210,14 +214,14 @@ //editing an existing tax authority $sql = "SELECT taxglcode, - purchtaxglaccount, - description, - bank, - bankacc, - bankacctype, - bankswift - FROM taxauthorities - WHERE taxid='" . $SelectedTaxAuthID . "'"; + purchtaxglaccount, + description, + bank, + bankacc, + bankacctype, + bankswift + FROM taxauthorities + WHERE taxid='" . $SelectedTaxAuthID . "'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -231,56 +235,57 @@ $_POST['BankSwift'] = $myrow['bankswift']; - echo "<input type=hidden name='SelectedTaxAuthID' VALUE=" . $SelectedTaxAuthID . '>'; + echo '<input type="hidden" name="SelectedTaxAuthID" value="' . $SelectedTaxAuthID . '" />'; } //end of if $SelectedTaxAuthID only do the else when a new record is being entered $SQL = "SELECT accountcode, - accountname - FROM chartmaster, - accountgroups - WHERE chartmaster.group_=accountgroups.groupname - AND accountgroups.pandl=0 - ORDER BY accountcode"; + accountname + FROM chartmaster INNER JOIN accountgroups + ON chartmaster.group_=accountgroups.groupname + WHERE accountgroups.pandl=0 + ORDER BY accountcode"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { $_POST['Description']=''; } -echo '<table class=selection> -<tr><td>' . _('Tax Type Description') . ":</td> -<td><input type=Text name='Description' size=21 maxlength=20 value='" . $_POST['Description'] . "'></td></tr>"; +echo '<table class="selection"> + <tr> + <td>' . _('Tax Type Description') . ':</td> + <td><input type="text" name="Description" size="21" maxlength="20" value="' . $_POST['Description'] . '"></td> + </tr> + <tr> + <td>' . _('Input tax GL Account') . ':</td> + <td><select name="PurchTaxGLCode">'; - -echo '<tr><td>' . _('Input tax GL Account') . ':</td> - <td><select name="PurchTaxGLCode">'; - while ($myrow = DB_fetch_array($result)) { if (isset($_POST['PurchTaxGLCode']) and $myrow['accountcode']==$_POST['PurchTaxGLCode']) { - echo '<option selected VALUE='; + echo '<option selected value='; } else { - echo '<option VALUE='; + echo '<option value='; } echo $myrow['accountcode'] . '>' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop -echo '</select></td></tr>'; +echo '</select></td> + </tr>'; DB_data_seek($result,0); -echo '<tr><td>' . _('Output tax GL Account') . ':</td> - <td><select name="TaxGLCode">'; +echo '<tr> + <td>' . _('Output tax GL Account') . ':</td> + <td><select name="TaxGLCode">'; - while ($myrow = DB_fetch_array($result)) { if (isset($_POST['TaxGLCode']) and $myrow['accountcode']==$_POST['TaxGLCode']) { - echo "<option selected VALUE='"; + echo '<option selected value="'; } else { - echo "<option VALUE='"; + echo '<option value="'; } - echo $myrow['accountcode'] . "'>" . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; + echo $myrow['accountcode'] . '">' . $myrow['accountname'] . ' ('.$myrow['accountcode'].')' . '</option>'; } //end while loop @@ -297,20 +302,32 @@ $_POST['BankSwift']=''; } -echo '</select></td></tr>'; -echo '<tr><td>' . _('Bank Name') . ':</td>'; -echo '<td><input type=Text name="Bank" size=41 maxlength=40 value="' . $_POST['Bank'] . '"></td></tr>'; -echo '<tr><td>' . _('Bank Account Type') . ':</td>'; -echo '<td><input type=Text name="BankAccType" size=15 maxlength=20 value="' . $_POST['BankAccType'] . '"></td></tr>'; -echo '<tr><td>' . _('Bank Account') . ':</td>'; -echo '<td><input type=Text name="BankAcc" size=21 maxlength=20 value="' . $_POST['BankAcc'] . '"></td></tr>'; -echo '<tr><td>' . _('Bank Swift No') . ':</td>'; -echo '<td><input type=Text name="BankSwift" size=15 maxlength=14 value="' . $_POST['BankSwift'] . '"></td></tr>'; +echo '</select></td> + </tr> + <tr> + <td>' . _('Bank Name') . ':</td> + <td><input type="text" name="Bank" size="41" maxlength="40" value="' . $_POST['Bank'] . '" /></td> + </tr> + <tr> + <td>' . _('Bank Account Type') . ':</td> + <td><input type="text" name="BankAccType" size="15" maxlength="20" value="' . $_POST['BankAccType'] . '" /></td> + </tr> + <tr> + <td>' . _('Bank Account') . ':</td> + <td><input type="text" name="BankAcc" size="21" maxlength="20" value="' . $_POST['BankAcc'] . '" /></td> + </tr> + <tr> + <td>' . _('Bank Swift No') . ':</td> + <td><input type="text" name="BankSwift" size="15" maxlength="14" value="' . $_POST['BankSwift'] . '" /></td> + </tr> + </table>'; -echo '</table>'; +echo '<br /> + <div class="centre"> + <input type="submit" name="submit" value="' . _('Enter Information') . '" /> + </div> + </form>'; -echo '<br /><div class="centre"><input type=submit name=submit value=' . _('Enter Information') . '></div></form>'; - include('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/TaxAuthorityRates.php =================================================================== --- trunk/TaxAuthorityRates.php 2011-10-16 07:24:19 UTC (rev 4722) +++ trunk/TaxAuthorityRates.php 2011-10-17 09:14:05 UTC (rev 4723) @@ -12,8 +12,10 @@ $title = _('Tax Rates'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') - . '" alt="" />' . $title. '</p>'; +echo '<p class="page_title_text"> + <img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Supplier Types') + . '" alt="" />' . $title. ' + </p>'; if (!isset($TaxAuthority)){ @@ -34,7 +36,7 @@ while ($myrow=DB_fetch_array($TaxRatesResult)){ - $sql = "UPDATE taxauthrates SET taxrate=" . ($_POST[$myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid']]/100) . " + $sql = "UPDATE taxauthrates SET taxrate=" . (filter_number_format($_POST[$myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid']])/100) . " WHERE taxcatid = '" . $myrow['taxcatid'] . "' AND dispatchtaxprovince = '" . $myrow['dispatchtaxprovince'] . "' AND taxauthority = '" . $TaxAuthority . "'"; @@ -49,35 +51,39 @@ /*Display updated rates */ -$TaxAuthDetail = DB_query("SELECT description FROM taxauthorities WHERE taxid='" . $TaxAuthority . "'",$db); +$TaxAuthDetail = DB_query("SELECT description + FROM taxauthorities WHERE taxid='" . $TaxAuthority . "'",$db); $myrow = DB_fetch_row($TaxAuthDetail); echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -echo '<input type=hidden name="TaxAuthority" value="' . $TaxAuthority . '">'; +echo '<input type=hidden name="TaxAuthority" value="' . $TaxAuthority . '" />'; $TaxRatesResult = DB_query("SELECT taxauthrates.taxcatid, taxcategories.taxcatname, taxauthrates.taxrate, taxauthrates.dispatchtaxprovince, taxprovinces.taxprovincename - FROM taxauthrates INNER JOIN taxauthorities - ON taxauthrates.taxauthority=taxauthorities.taxid - INNER JOIN taxprovinces - ON taxauthrates.dispatchtaxprovince= taxprovinces.taxprovinceid - INNER JOIN taxcategories - ON taxauthrates.taxcatid=taxcategories.taxcatid - WHERE taxauthrates.taxauthority='" . $TaxAuthority . "' - ORDER BY taxauthrates.dispatchtaxprovince, - taxauthrates.taxcatid", - $db); + FROM taxauthrates INNER JOIN taxauthorities + ON taxauthrates.taxauthority=taxauthorities.taxid + INNER JOIN taxprovinces + ON taxauthrates.dispatchtaxprovince= taxprovinces.taxprovinceid + INNER JOIN taxcategories + ON taxauthrates.taxcatid=taxcategories.taxcatid + WHERE taxauthrates.taxauthority='" . $TaxAuthority . "' + ORDER BY taxauthrates.dispatchtaxprovince, + taxauthrates.taxcatid", + $db); if (DB_num_rows($TaxRatesResult)>0){ - echo '<table cellpadding=2 class="selection">'; - echo '<tr><th colspan=3><font size=3 color=navy>' . _('Update') . ' ' . $myrow[0] . ' ' . _('Rates') . '</font></th></tr>'; - $TableHeader = '<tr><th>' . _('Deliveries From') . '<br />' . _('Tax Province') . '</th> + echo '<table class="selection">'; + echo '<tr> + <th colspan="3"><font size="3" color="navy">' . _('Update') . ' ' . $myrow[0] . ' ' . _('Rates') . '</font></th> + </tr>'; + $TableHeader = '<tr> + <th>' . _('Deliveries From') . '<br />' . _('Tax Province') . '</th> <th>' . _('Tax Category') . '</th> <th>' . _('Tax Rate') . ' %</th> </tr>'; @@ -89,7 +95,7 @@ while ($myrow = DB_fetch_array($TaxRatesResult)){ if ($OldProvince!=$myrow['dispatchtaxprovince'] AND $OldProvince!=''){ - echo '<tr bgcolor="#555555"><font size=1> </font><td colspan=3></td></tr>'; + echo '<tr bgcolor="#555555"><td colspan="3"></td></tr>'; } if ($k==1){ @@ -101,13 +107,13 @@ } printf('<td>%s</td> - <td>%s</td> - <td><input type="text" class="number" name=%s maxlength=5 size=5 value=%s></td> - </tr>', - $myrow['taxprovincename'], - $myrow['taxcatname'], - $myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid'], - $myrow['taxrate']*100 ); + <td>%s</td> + <td><input type="text" class="number" name=%s maxlength="5" size="5" value="%s" /></td> + </tr>', + $myrow['taxprovincename'], + $myrow['taxcatname'], + $myrow['dispatchtaxprovince'] . '_' . $myrow['taxcatid'], + locale_number_format($myrow['taxrate']*100,2)); $OldProvince = $myrow['dispatchtaxprovince']; @@ -116,7 +122,7 @@ echo '</table>'; echo '<br /> <div class="centre"> - <input type=submit name="UpdateRates" VALUE="' . _('Update Rates') . '">'; + <input type="submit" name="UpdateRates" value="' . _('Update Rates') . '" />'; } //end if tax taxcatid/rates to show else { prnMsg(_('There are no tax rates to show - perhaps the dispatch tax province records have not yet been created?'),'warn'); @@ -124,11 +130,16 @@ echo '</form>'; -echo '<br /><br /><a href="' . $rootpath . '/TaxAuthorities.php">' . _('Tax Authorities') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxGroups.php">' . _('Tax Groupings') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxCategories.php">' . _('Tax Categories') . '</a>'; -echo '<br /><a href="' . $rootpath . '/TaxProvinces.php">' . _('Dispatch Tax Provinces') . '</a>'; -echo '</div>'; +echo '<br /> + <br /> + <a href="' . $rootpath . '/TaxAuthorities.php">' . _('Tax Authorities') . '</a> + <br /> + <a href="' . $rootpath . '/TaxGroups.php">' . _('Tax Groupings') . '</a> + <br /> + <a href="' . $rootpath . '/TaxCategories.php">' . _('Tax Categories') . '</a> + <br /> + <a href="' . $rootpath . '/TaxProvinces.php">' . _('Dispatch Tax Provinces') . '</a> + </div>'; include( 'includes/footer.inc' ); ?> \ No newline at end of file Modified: trunk/TaxCategories.php =================================================================== --- trunk/TaxCategories.php 2011-10-16 07:24:19 UTC (rev 4722) +++ trunk/TaxCategories.php 2011-10-17 09:14:05 UTC (rev 4723) @@ -26,9 +26,9 @@ //first off validate inputs sensible - if (mb_strpos($_POST['TaxCategoryName'],'&')>0 OR mb_strpos($_POST['TaxCategoryName'],"'")>0) { + if (ContainsIllegalCharacters($_POST['TaxCategoryName'])) { $InputError = 1; - prnMsg( _('The tax category name cannot contain the character') . " '&' " . _('or the character') ." '",'error'); + prnMsg( _('The tax category name cannot contain the character') . " '&' " . _('or the character') ." ' " . _('or a space') ,'error'); } if (trim($_POST['TaxCategoryName']) == '') { $InputError = 1; @@ -162,10 +162,10 @@ $ErrMsg = _('Could not get tax categories because'); $result = DB_query($sql,$db,$ErrMsg); - echo '<table class=selection> - <tr> - <th>' . _('Tax Categories') . '</th> - </tr>'; + echo '<table class="selection"> + <tr> + <th>' . _('Tax Categories') . '</th> + </tr>'; $k=0; //row colour counter while ($myrow = DB_fetch_row($result)) { @@ -178,18 +178,20 @@ $k++; } - echo '<td>' . $myrow[1] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedTaxCategory=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedTaxCatego... [truncated message content] |
From: <dai...@us...> - 2011-10-17 09:29:40
|
Revision: 4724 http://web-erp.svn.sourceforge.net/web-erp/?rev=4724&view=rev Author: daintree Date: 2011-10-17 09:29:33 +0000 (Mon, 17 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/TopItems.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-10-17 09:14:05 UTC (rev 4723) +++ trunk/TopItems.php 2011-10-17 09:29:33 UTC (rev 4724) @@ -10,7 +10,9 @@ //check if input already if (!(isset($_POST['Search']))) { - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="" />' . ' ' . _('Top Sales Order Search') . '</p>'; + echo '<p class="page_title_text"> + <img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="" />' . ' ' . _('Top Sales Order Search') . ' + </p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '?name="SelectCustomer" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; Modified: trunk/UnitsOfMeasure.php =================================================================== --- trunk/UnitsOfMeasure.php 2011-10-17 09:14:05 UTC (rev 4723) +++ trunk/UnitsOfMeasure.php 2011-10-17 09:29:33 UTC (rev 4724) @@ -25,9 +25,9 @@ //first off validate inputs sensible - if (mb_strpos($_POST['MeasureName'],'&')>0 OR mb_strpos($_POST['MeasureName'],"'")>0) { + if (ContainsIllegalCharacters($_POST['MeasureName'])) { $InputError = 1; - prnMsg( _('The unit of measure cannot contain the character') . " '&' " . _('or the character') ." '",'error'); + prnMsg( _('The unit of measure cannot contain any of the illegal characters') ,'error'); } if (trim($_POST['MeasureName']) == '') { $InputError = 1; @@ -81,11 +81,8 @@ $InputError = 1; prnMsg( _('The unit of measure can not be created because another with the same name already exists.'),'error'); } else { - $sql = "INSERT INTO unitsofmeasure ( - unitname ) - VALUES ( - '" . $_POST['MeasureName'] ."' - )"; + $sql = "INSERT INTO unitsofmeasure (unitname ) + VALUES ('" . $_POST['MeasureName'] ."')"; } $msg = _('New unit of measure added'); } @@ -186,7 +183,7 @@ echo '<td>' . $myrow[1] . '</td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedMeasureID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedMeasureID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedMeasureID=' . $myrow[0] . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this unit of measure?') . '\');">' . _('Delete') .'</a></td>'; echo '</tr>'; } //END WHILE LIST LOOP @@ -195,10 +192,12 @@ if (isset($SelectedMeasureID)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Units of Measure') . '</a></div>'; + echo '<div class="centre"> + <a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Units of Measure') . '</a> + </div>'; } -echo '<p>'; +echo '<p />'; if (! isset($_GET['delete'])) { @@ -223,7 +222,7 @@ $_POST['MeasureID'] = $myrow['unitid']; $_POST['MeasureName'] = $myrow['unitname']; - echo '<input type="hidden" name="SelectedMeasureID" value="' . $_POST['MeasureID'] . '">'; + echo '<input type="hidden" name="SelectedMeasureID" value="' . $_POST['MeasureID'] . '" />'; echo '<table class="selection">'; } @@ -233,11 +232,13 @@ } echo '<tr> <td>' . _('Unit of Measure') . ':' . '</td> - <td><input type="text" name="MeasureName" size="30" maxlength="30" value="' . $_POST['MeasureName'] . '"></td> + <td><input type="text" name="MeasureName" size="30" maxlength="30" value="' . $_POST['MeasureName'] . '" /></td> </tr>'; echo '</table>'; - echo '<div class="centre"><input type="submit" name="Submit" value=' . _('Enter Information') . '></div>'; + echo '<div class="centre"> + <input type="submit" name="Submit" value=' . _('Enter Information') . '> + </div>'; echo '</form>'; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-10-17 09:14:05 UTC (rev 4723) +++ trunk/UpgradeDatabase.php 2011-10-17 09:29:33 UTC (rev 4724) @@ -14,22 +14,26 @@ if (!isset($_SESSION['VersionNumber'])){ prnMsg(_('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is not actually recorded at this version'),'info'); - echo '<table><tr><td>' . _('Select the version you are upgrading from:') . '</td> - <td><select name="OldVersion" >'; - echo '<option selected value="Manual">' . _('Apply database changes manually') . '</option>'; - echo '<option value="3.00">' . _('Version 3.00') . '</option>'; - echo '<option value="3.01">' . _('Version 3.01') . '</option>'; - echo '<option value="3.02">' . _('Version 3.02') . '</option>'; - echo '<option value="3.03">' . _('Version 3.03') . '</option>'; - echo '<option value="3.04">' . _('Version 3.04') . '</option>'; - echo '<option value="3.05">' . _('Version 3.05') . '</option>'; - echo '<option value="3.06">' . _('Version 3.06') . '</option>'; - echo '<option value="3.07">' . _('Version 3.07') . '</option>'; - echo '<option value="3.08">' . _('Version 3.08') . '</option>'; - echo '<option value="3.09">' . _('Version 3.09') . '</option>'; - echo '<option value="3.10">' . _('Version 3.10') . '</option>'; - echo '<option value="3.11.x">' . _('Version 3.11 or 4.01 - 4.02') . '</option>'; - echo '</select></td></tr></table>'; + echo '<table class="selection"> + <tr> + <td>' . _('Select the version you are upgrading from:') . '</td> + <td><select name="OldVersion" > + <option selected value="Manual">' . _('Apply database changes manually') . '</option> + <option value="3.00">' . _('Version 3.00') . '</option> + <option value="3.01">' . _('Version 3.01') . '</option> + <option value="3.02">' . _('Version 3.02') . '</option> + <option value="3.03">' . _('Version 3.03') . '</option> + <option value="3.04">' . _('Version 3.04') . '</option> + <option value="3.05">' . _('Version 3.05') . '</option> + <option value="3.06">' . _('Version 3.06') . '</option> + <option value="3.07">' . _('Version 3.07') . '</option> + <option value="3.08">' . _('Version 3.08') . '</option> + <option value="3.09">' . _('Version 3.09') . '</option> + <option value="3.10">' . _('Version 3.10') . '</option> + <option value="3.11.x">' . _('Version 3.11 or 4.01 - 4.02') . '</option> + </select></td> + </tr> + </table>'; } else { if ($_SESSION['VersionNumber']=='4.00RC1'){ $_SESSION['VersionNumber']='3.12'; @@ -130,8 +134,11 @@ $ScriptFileEntries = sizeof($SQLEntries); $sql =''; $InAFunction = false; - echo '<br /><table> - <tr><th colspan=2>' . _('Applying') . ' ' . $SQLScriptFile . '</th></tr>'; + echo '<br /> + <table> + <tr> + <th colspan="2">' . _('Applying') . ' ' . $SQLScriptFile . '</th> + </tr>'; for ($i=0; $i<=$ScriptFileEntries; $i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-17 09:29:43
|
Revision: 4724 http://web-erp.svn.sourceforge.net/web-erp/?rev=4724&view=rev Author: daintree Date: 2011-10-17 09:29:33 +0000 (Mon, 17 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/TopItems.php trunk/UnitsOfMeasure.php trunk/UpgradeDatabase.php Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2011-10-17 09:14:05 UTC (rev 4723) +++ trunk/TopItems.php 2011-10-17 09:29:33 UTC (rev 4724) @@ -10,7 +10,9 @@ //check if input already if (!(isset($_POST['Search']))) { - echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="" />' . ' ' . _('Top Sales Order Search') . '</p>'; + echo '<p class="page_title_text"> + <img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="" />' . ' ' . _('Top Sales Order Search') . ' + </p>'; echo '<form action="' . $_SERVER['PHP_SELF'] . '?name="SelectCustomer" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; Modified: trunk/UnitsOfMeasure.php =================================================================== --- trunk/UnitsOfMeasure.php 2011-10-17 09:14:05 UTC (rev 4723) +++ trunk/UnitsOfMeasure.php 2011-10-17 09:29:33 UTC (rev 4724) @@ -25,9 +25,9 @@ //first off validate inputs sensible - if (mb_strpos($_POST['MeasureName'],'&')>0 OR mb_strpos($_POST['MeasureName'],"'")>0) { + if (ContainsIllegalCharacters($_POST['MeasureName'])) { $InputError = 1; - prnMsg( _('The unit of measure cannot contain the character') . " '&' " . _('or the character') ." '",'error'); + prnMsg( _('The unit of measure cannot contain any of the illegal characters') ,'error'); } if (trim($_POST['MeasureName']) == '') { $InputError = 1; @@ -81,11 +81,8 @@ $InputError = 1; prnMsg( _('The unit of measure can not be created because another with the same name already exists.'),'error'); } else { - $sql = "INSERT INTO unitsofmeasure ( - unitname ) - VALUES ( - '" . $_POST['MeasureName'] ."' - )"; + $sql = "INSERT INTO unitsofmeasure (unitname ) + VALUES ('" . $_POST['MeasureName'] ."')"; } $msg = _('New unit of measure added'); } @@ -186,7 +183,7 @@ echo '<td>' . $myrow[1] . '</td>'; echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedMeasureID=' . $myrow[0] . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedMeasureID=' . $myrow[0] . '&delete=1">' . _('Delete') .'</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?SelectedMeasureID=' . $myrow[0] . '&delete=1" onclick="return confirm(\'' . _('Are you sure you wish to delete this unit of measure?') . '\');">' . _('Delete') .'</a></td>'; echo '</tr>'; } //END WHILE LIST LOOP @@ -195,10 +192,12 @@ if (isset($SelectedMeasureID)) { - echo '<div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Units of Measure') . '</a></div>'; + echo '<div class="centre"> + <a href="' . $_SERVER['PHP_SELF'] . '">' . _('Review Units of Measure') . '</a> + </div>'; } -echo '<p>'; +echo '<p />'; if (! isset($_GET['delete'])) { @@ -223,7 +222,7 @@ $_POST['MeasureID'] = $myrow['unitid']; $_POST['MeasureName'] = $myrow['unitname']; - echo '<input type="hidden" name="SelectedMeasureID" value="' . $_POST['MeasureID'] . '">'; + echo '<input type="hidden" name="SelectedMeasureID" value="' . $_POST['MeasureID'] . '" />'; echo '<table class="selection">'; } @@ -233,11 +232,13 @@ } echo '<tr> <td>' . _('Unit of Measure') . ':' . '</td> - <td><input type="text" name="MeasureName" size="30" maxlength="30" value="' . $_POST['MeasureName'] . '"></td> + <td><input type="text" name="MeasureName" size="30" maxlength="30" value="' . $_POST['MeasureName'] . '" /></td> </tr>'; echo '</table>'; - echo '<div class="centre"><input type="submit" name="Submit" value=' . _('Enter Information') . '></div>'; + echo '<div class="centre"> + <input type="submit" name="Submit" value=' . _('Enter Information') . '> + </div>'; echo '</form>'; Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-10-17 09:14:05 UTC (rev 4723) +++ trunk/UpgradeDatabase.php 2011-10-17 09:29:33 UTC (rev 4724) @@ -14,22 +14,26 @@ if (!isset($_SESSION['VersionNumber'])){ prnMsg(_('The webERP code is version') . ' ' . $Version . ' ' . _('and the database version is not actually recorded at this version'),'info'); - echo '<table><tr><td>' . _('Select the version you are upgrading from:') . '</td> - <td><select name="OldVersion" >'; - echo '<option selected value="Manual">' . _('Apply database changes manually') . '</option>'; - echo '<option value="3.00">' . _('Version 3.00') . '</option>'; - echo '<option value="3.01">' . _('Version 3.01') . '</option>'; - echo '<option value="3.02">' . _('Version 3.02') . '</option>'; - echo '<option value="3.03">' . _('Version 3.03') . '</option>'; - echo '<option value="3.04">' . _('Version 3.04') . '</option>'; - echo '<option value="3.05">' . _('Version 3.05') . '</option>'; - echo '<option value="3.06">' . _('Version 3.06') . '</option>'; - echo '<option value="3.07">' . _('Version 3.07') . '</option>'; - echo '<option value="3.08">' . _('Version 3.08') . '</option>'; - echo '<option value="3.09">' . _('Version 3.09') . '</option>'; - echo '<option value="3.10">' . _('Version 3.10') . '</option>'; - echo '<option value="3.11.x">' . _('Version 3.11 or 4.01 - 4.02') . '</option>'; - echo '</select></td></tr></table>'; + echo '<table class="selection"> + <tr> + <td>' . _('Select the version you are upgrading from:') . '</td> + <td><select name="OldVersion" > + <option selected value="Manual">' . _('Apply database changes manually') . '</option> + <option value="3.00">' . _('Version 3.00') . '</option> + <option value="3.01">' . _('Version 3.01') . '</option> + <option value="3.02">' . _('Version 3.02') . '</option> + <option value="3.03">' . _('Version 3.03') . '</option> + <option value="3.04">' . _('Version 3.04') . '</option> + <option value="3.05">' . _('Version 3.05') . '</option> + <option value="3.06">' . _('Version 3.06') . '</option> + <option value="3.07">' . _('Version 3.07') . '</option> + <option value="3.08">' . _('Version 3.08') . '</option> + <option value="3.09">' . _('Version 3.09') . '</option> + <option value="3.10">' . _('Version 3.10') . '</option> + <option value="3.11.x">' . _('Version 3.11 or 4.01 - 4.02') . '</option> + </select></td> + </tr> + </table>'; } else { if ($_SESSION['VersionNumber']=='4.00RC1'){ $_SESSION['VersionNumber']='3.12'; @@ -130,8 +134,11 @@ $ScriptFileEntries = sizeof($SQLEntries); $sql =''; $InAFunction = false; - echo '<br /><table> - <tr><th colspan=2>' . _('Applying') . ' ' . $SQLScriptFile . '</th></tr>'; + echo '<br /> + <table> + <tr> + <th colspan="2">' . _('Applying') . ' ' . $SQLScriptFile . '</th> + </tr>'; for ($i=0; $i<=$ScriptFileEntries; $i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fox...@us...> - 2011-10-19 01:32:55
|
Revision: 4727 http://web-erp.svn.sourceforge.net/web-erp/?rev=4727&view=rev Author: foxdeluxe Date: 2011-10-19 01:32:48 +0000 (Wed, 19 Oct 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/BOMs.php trunk/ContractOtherReqts.php trunk/CustomerAllocations.php trunk/CustomerReceipt.php Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-10-18 05:51:03 UTC (rev 4726) +++ trunk/BOMExtendedQty.php 2011-10-19 01:32:48 UTC (rev 4727) @@ -15,7 +15,7 @@ $PageNumber=1; $line_height=12; - if (!$_POST['Quantity'] OR !is_numeric($_POST['Quantity'])) { + if (!$_POST['Quantity'] OR !is_numeric(filter_number_format($_POST['Quantity']))) { $_POST['Quantity'] = 1; } @@ -48,7 +48,7 @@ // This finds the top level $sql = "INSERT INTO passbom (part, extendedqpa, sortpart) SELECT bom.component AS part, - (" . $_POST['Quantity'] . " * bom.quantity) as extendedqpa, + (" . filter_number_format($_POST['Quantity']) . " * bom.quantity) as extendedqpa, CONCAT(bom.parent,bom.component) AS sortpart FROM bom WHERE bom.parent ='" . $_POST['Part'] . "' @@ -76,7 +76,7 @@ bom.loccode, bom.effectiveafter, bom.effectiveto, - (" . $_POST['Quantity'] . " * bom.quantity) as extendedqpa + (" . filter_number_format($_POST['Quantity']) . " * bom.quantity) as extendedqpa FROM bom WHERE bom.parent ='" . $_POST['Part'] . "' AND bom.effectiveto >= NOW() @@ -331,4 +331,4 @@ $YPos =$YPos - (2*$line_height); $PageNumber++; } // End of PrintHeader function -?> \ No newline at end of file +?> Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-10-18 05:51:03 UTC (rev 4726) +++ trunk/BOMs.php 2011-10-19 01:32:48 UTC (rev 4727) @@ -226,13 +226,13 @@ $Errors[$i] = 'EffectiveTo'; $i++; } - if (!is_numeric($_POST['Quantity'])) { + if (!is_numeric(filter_number_format($_POST['Quantity']))) { $InputError = 1; prnMsg(_('The quantity entered must be numeric'),'error'); $Errors[$i] = 'Quantity'; $i++; } - if ($_POST['Quantity']==0) { + if (filter_number_format($_POST['Quantity']==0)) { $InputError = 1; prnMsg(_('The quantity entered cannot be zero'),'error'); $Errors[$i] = 'Quantity'; @@ -270,7 +270,7 @@ loccode='" . $_POST['LocCode'] . "', effectiveafter='" . $EffectiveAfterSQL . "', effectiveto='" . $EffectiveToSQL . "', - quantity= '" . $_POST['Quantity'] . "', + quantity= '" . filter_number_format($_POST['Quantity']) . "', autoissue='" . $_POST['AutoIssue'] . "' WHERE bom.parent='" . $SelectedParent . "' AND bom.component='" . $SelectedComponent . "'"; @@ -317,7 +317,7 @@ '" . $_POST['Component'] . "', '" . $_POST['WorkCentreAdded'] . "', '" . $_POST['LocCode'] . "', - " . $_POST['Quantity'] . ", + " . filter_number_format($_POST['Quantity']) . ", '" . $EffectiveAfterSQL . "', '" . $EffectiveToSQL . "', " . $_POST['AutoIssue'] . ")"; @@ -867,4 +867,4 @@ } //end StockID already selected include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-10-18 05:51:03 UTC (rev 4726) +++ trunk/ContractOtherReqts.php 2011-10-19 01:32:48 UTC (rev 4727) @@ -28,8 +28,8 @@ //this is the same as deleting the line - so delete it $_SESSION['Contract'.$identifier]->Remove_ContractRequirement($ContractComponentID); } else { - $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->Quantity=$_POST['Qty'.$ContractComponentID]; - $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->CostPerUnit=$_POST['CostPerUnit'.$ContractComponentID]; + $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->Quantity=filter_number_format($_POST['Qty'.$ContractComponentID]); + $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->CostPerUnit=filter_number_format($_POST['CostPerUnit'.$ContractComponentID]); $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->Requirement=$_POST['Requirement'.$ContractComponentID]; } } // end loop around the items on the contract requirements array @@ -55,18 +55,18 @@ } if (isset($_POST['EnterNewRequirement'])){ $InputError = false; - if (!is_numeric($_POST['Quantity'])){ + if (!is_numeric(filter_number_format($_POST['Quantity']))){ prnMsg(_('The quantity of the new requirement is expected to be numeric'),'error'); $InputError = true; } - if (!is_numeric($_POST['CostPerUnit'])){ + if (!is_numeric(filter_number_format($_POST['CostPerUnit']))){ prnMsg(_('The cost per unit of the new requirement is expected to be numeric'),'error'); $InputError = true; } if (!$InputError){ $_SESSION['Contract'.$identifier]->Add_To_ContractRequirements ($_POST['RequirementDescription'], - $_POST['Quantity'], - $_POST['CostPerUnit']); + filter_number_format($_POST['Quantity']), + filter_number_format($_POST['CostPerUnit'])); unset($_POST['RequirementDescription']); unset($_POST['Quantity']); unset($_POST['CostPerUnit']); @@ -146,4 +146,4 @@ echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-10-18 05:51:03 UTC (rev 4726) +++ trunk/CustomerAllocations.php 2011-10-19 01:32:48 UTC (rev 4727) @@ -40,29 +40,29 @@ // loop through amounts allocated using AllocnItm->ID for each record if (isset($_POST['Amt' . $AllocCounter])) { // allocatable charge amounts - if (!is_numeric($_POST['Amt' . $AllocCounter])) { + if (!is_numeric(filter_number_format($_POST['Amt' . $AllocCounter]))) { $_POST['Amt' . $AllocCounter] = 0; } - if ($_POST['Amt' . $AllocCounter] < 0) { + if (filter_number_format($_POST['Amt' . $AllocCounter] < 0)) { prnMsg(_('Amount entered was negative') . '. ' . _('Only positive amounts are allowed') . '.','warn'); $_POST['Amt' . $AllocCounter] = 0; } if (isset($_POST['All' . $AllocCounter]) and $_POST['All' . $AllocCounter] == True) { $_POST['Amt' . $AllocCounter] = $_POST['YetToAlloc' . $AllocCounter]; } - if ($_POST['Amt' . $AllocCounter] > $_POST['YetToAlloc' . $AllocCounter]) { + if (filter_number_format($_POST['Amt' . $AllocCounter]) > filter_number_format($_POST['YetToAlloc' . $AllocCounter])) { $_POST['Amt' . $AllocCounter]=$_POST['YetToAlloc' . $AllocCounter]; // Amount entered must be smaller than unallocated amount } - $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->AllocAmt = $_POST['Amt' . $AllocCounter]; + $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->AllocAmt = filter_number_format($_POST['Amt' . $AllocCounter]); // recalcuate the new difference on exchange (a +positive amount is a gain -ve a loss) $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->DiffOnExch = - ($_POST['Amt' . $AllocCounter] / $_SESSION['Alloc']->TransExRate) - - ($_POST['Amt' . $AllocCounter] / $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->ExRate); + (filter_number_format($_POST['Amt' . $AllocCounter]) / $_SESSION['Alloc']->TransExRate) - + (filter_number_format($_POST['Amt' . $AllocCounter]) / $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->ExRate); $TotalDiffOnExch = $TotalDiffOnExch + $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->DiffOnExch; - $TotalAllocated = $TotalAllocated + $_POST['Amt' . $AllocCounter]; + $TotalAllocated = $TotalAllocated + filter_number_format($_POST['Amt' . $AllocCounter]); } } @@ -576,4 +576,4 @@ echo '</td></tr></table>'; // end Page Border include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-10-18 05:51:03 UTC (rev 4726) +++ trunk/CustomerReceipt.php 2011-10-19 01:32:48 UTC (rev 4727) @@ -63,15 +63,15 @@ } $_SESSION['ReceiptBatch']->DateBanked = $_POST['DateBanked']; if (isset($_POST['ExRate']) and $_POST['ExRate']!=''){ - if (is_numeric($_POST['ExRate'])){ - $_SESSION['ReceiptBatch']->ExRate = $_POST['ExRate']; + if (is_numeric(filter_number_format($_POST['ExRate']))){ + $_SESSION['ReceiptBatch']->ExRate = filter_number_format($_POST['ExRate']); } else { prnMsg(_('The exchange rate entered should be numeric'),'warn'); } } if (isset($_POST['FunctionalExRate']) and $_POST['FunctionalExRate']!=''){ - if (is_numeric($_POST['FunctionalExRate'])){ - $_SESSION['ReceiptBatch']->FunctionalExRate=$_POST['FunctionalExRate']; //ex rate between receipt currency and account currency + 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 { prnMsg(_('The functional exchange rate entered should be numeric'),'warn'); } @@ -1078,4 +1078,4 @@ } echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fox...@us...> - 2011-10-19 01:32:55
|
Revision: 4727 http://web-erp.svn.sourceforge.net/web-erp/?rev=4727&view=rev Author: foxdeluxe Date: 2011-10-19 01:32:48 +0000 (Wed, 19 Oct 2011) Log Message: ----------- number formatting Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/BOMs.php trunk/ContractOtherReqts.php trunk/CustomerAllocations.php trunk/CustomerReceipt.php Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-10-18 05:51:03 UTC (rev 4726) +++ trunk/BOMExtendedQty.php 2011-10-19 01:32:48 UTC (rev 4727) @@ -15,7 +15,7 @@ $PageNumber=1; $line_height=12; - if (!$_POST['Quantity'] OR !is_numeric($_POST['Quantity'])) { + if (!$_POST['Quantity'] OR !is_numeric(filter_number_format($_POST['Quantity']))) { $_POST['Quantity'] = 1; } @@ -48,7 +48,7 @@ // This finds the top level $sql = "INSERT INTO passbom (part, extendedqpa, sortpart) SELECT bom.component AS part, - (" . $_POST['Quantity'] . " * bom.quantity) as extendedqpa, + (" . filter_number_format($_POST['Quantity']) . " * bom.quantity) as extendedqpa, CONCAT(bom.parent,bom.component) AS sortpart FROM bom WHERE bom.parent ='" . $_POST['Part'] . "' @@ -76,7 +76,7 @@ bom.loccode, bom.effectiveafter, bom.effectiveto, - (" . $_POST['Quantity'] . " * bom.quantity) as extendedqpa + (" . filter_number_format($_POST['Quantity']) . " * bom.quantity) as extendedqpa FROM bom WHERE bom.parent ='" . $_POST['Part'] . "' AND bom.effectiveto >= NOW() @@ -331,4 +331,4 @@ $YPos =$YPos - (2*$line_height); $PageNumber++; } // End of PrintHeader function -?> \ No newline at end of file +?> Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-10-18 05:51:03 UTC (rev 4726) +++ trunk/BOMs.php 2011-10-19 01:32:48 UTC (rev 4727) @@ -226,13 +226,13 @@ $Errors[$i] = 'EffectiveTo'; $i++; } - if (!is_numeric($_POST['Quantity'])) { + if (!is_numeric(filter_number_format($_POST['Quantity']))) { $InputError = 1; prnMsg(_('The quantity entered must be numeric'),'error'); $Errors[$i] = 'Quantity'; $i++; } - if ($_POST['Quantity']==0) { + if (filter_number_format($_POST['Quantity']==0)) { $InputError = 1; prnMsg(_('The quantity entered cannot be zero'),'error'); $Errors[$i] = 'Quantity'; @@ -270,7 +270,7 @@ loccode='" . $_POST['LocCode'] . "', effectiveafter='" . $EffectiveAfterSQL . "', effectiveto='" . $EffectiveToSQL . "', - quantity= '" . $_POST['Quantity'] . "', + quantity= '" . filter_number_format($_POST['Quantity']) . "', autoissue='" . $_POST['AutoIssue'] . "' WHERE bom.parent='" . $SelectedParent . "' AND bom.component='" . $SelectedComponent . "'"; @@ -317,7 +317,7 @@ '" . $_POST['Component'] . "', '" . $_POST['WorkCentreAdded'] . "', '" . $_POST['LocCode'] . "', - " . $_POST['Quantity'] . ", + " . filter_number_format($_POST['Quantity']) . ", '" . $EffectiveAfterSQL . "', '" . $EffectiveToSQL . "', " . $_POST['AutoIssue'] . ")"; @@ -867,4 +867,4 @@ } //end StockID already selected include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/ContractOtherReqts.php =================================================================== --- trunk/ContractOtherReqts.php 2011-10-18 05:51:03 UTC (rev 4726) +++ trunk/ContractOtherReqts.php 2011-10-19 01:32:48 UTC (rev 4727) @@ -28,8 +28,8 @@ //this is the same as deleting the line - so delete it $_SESSION['Contract'.$identifier]->Remove_ContractRequirement($ContractComponentID); } else { - $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->Quantity=$_POST['Qty'.$ContractComponentID]; - $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->CostPerUnit=$_POST['CostPerUnit'.$ContractComponentID]; + $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->Quantity=filter_number_format($_POST['Qty'.$ContractComponentID]); + $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->CostPerUnit=filter_number_format($_POST['CostPerUnit'.$ContractComponentID]); $_SESSION['Contract'.$identifier]->ContractReqts[$ContractComponentID]->Requirement=$_POST['Requirement'.$ContractComponentID]; } } // end loop around the items on the contract requirements array @@ -55,18 +55,18 @@ } if (isset($_POST['EnterNewRequirement'])){ $InputError = false; - if (!is_numeric($_POST['Quantity'])){ + if (!is_numeric(filter_number_format($_POST['Quantity']))){ prnMsg(_('The quantity of the new requirement is expected to be numeric'),'error'); $InputError = true; } - if (!is_numeric($_POST['CostPerUnit'])){ + if (!is_numeric(filter_number_format($_POST['CostPerUnit']))){ prnMsg(_('The cost per unit of the new requirement is expected to be numeric'),'error'); $InputError = true; } if (!$InputError){ $_SESSION['Contract'.$identifier]->Add_To_ContractRequirements ($_POST['RequirementDescription'], - $_POST['Quantity'], - $_POST['CostPerUnit']); + filter_number_format($_POST['Quantity']), + filter_number_format($_POST['CostPerUnit'])); unset($_POST['RequirementDescription']); unset($_POST['Quantity']); unset($_POST['CostPerUnit']); @@ -146,4 +146,4 @@ echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/CustomerAllocations.php =================================================================== --- trunk/CustomerAllocations.php 2011-10-18 05:51:03 UTC (rev 4726) +++ trunk/CustomerAllocations.php 2011-10-19 01:32:48 UTC (rev 4727) @@ -40,29 +40,29 @@ // loop through amounts allocated using AllocnItm->ID for each record if (isset($_POST['Amt' . $AllocCounter])) { // allocatable charge amounts - if (!is_numeric($_POST['Amt' . $AllocCounter])) { + if (!is_numeric(filter_number_format($_POST['Amt' . $AllocCounter]))) { $_POST['Amt' . $AllocCounter] = 0; } - if ($_POST['Amt' . $AllocCounter] < 0) { + if (filter_number_format($_POST['Amt' . $AllocCounter] < 0)) { prnMsg(_('Amount entered was negative') . '. ' . _('Only positive amounts are allowed') . '.','warn'); $_POST['Amt' . $AllocCounter] = 0; } if (isset($_POST['All' . $AllocCounter]) and $_POST['All' . $AllocCounter] == True) { $_POST['Amt' . $AllocCounter] = $_POST['YetToAlloc' . $AllocCounter]; } - if ($_POST['Amt' . $AllocCounter] > $_POST['YetToAlloc' . $AllocCounter]) { + if (filter_number_format($_POST['Amt' . $AllocCounter]) > filter_number_format($_POST['YetToAlloc' . $AllocCounter])) { $_POST['Amt' . $AllocCounter]=$_POST['YetToAlloc' . $AllocCounter]; // Amount entered must be smaller than unallocated amount } - $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->AllocAmt = $_POST['Amt' . $AllocCounter]; + $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->AllocAmt = filter_number_format($_POST['Amt' . $AllocCounter]); // recalcuate the new difference on exchange (a +positive amount is a gain -ve a loss) $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->DiffOnExch = - ($_POST['Amt' . $AllocCounter] / $_SESSION['Alloc']->TransExRate) - - ($_POST['Amt' . $AllocCounter] / $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->ExRate); + (filter_number_format($_POST['Amt' . $AllocCounter]) / $_SESSION['Alloc']->TransExRate) - + (filter_number_format($_POST['Amt' . $AllocCounter]) / $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->ExRate); $TotalDiffOnExch = $TotalDiffOnExch + $_SESSION['Alloc']->Allocs[$_POST['AllocID' . $AllocCounter]]->DiffOnExch; - $TotalAllocated = $TotalAllocated + $_POST['Amt' . $AllocCounter]; + $TotalAllocated = $TotalAllocated + filter_number_format($_POST['Amt' . $AllocCounter]); } } @@ -576,4 +576,4 @@ echo '</td></tr></table>'; // end Page Border include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2011-10-18 05:51:03 UTC (rev 4726) +++ trunk/CustomerReceipt.php 2011-10-19 01:32:48 UTC (rev 4727) @@ -63,15 +63,15 @@ } $_SESSION['ReceiptBatch']->DateBanked = $_POST['DateBanked']; if (isset($_POST['ExRate']) and $_POST['ExRate']!=''){ - if (is_numeric($_POST['ExRate'])){ - $_SESSION['ReceiptBatch']->ExRate = $_POST['ExRate']; + if (is_numeric(filter_number_format($_POST['ExRate']))){ + $_SESSION['ReceiptBatch']->ExRate = filter_number_format($_POST['ExRate']); } else { prnMsg(_('The exchange rate entered should be numeric'),'warn'); } } if (isset($_POST['FunctionalExRate']) and $_POST['FunctionalExRate']!=''){ - if (is_numeric($_POST['FunctionalExRate'])){ - $_SESSION['ReceiptBatch']->FunctionalExRate=$_POST['FunctionalExRate']; //ex rate between receipt currency and account currency + 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 { prnMsg(_('The functional exchange rate entered should be numeric'),'warn'); } @@ -1078,4 +1078,4 @@ } echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-19 09:40:51
|
Revision: 4728 http://web-erp.svn.sourceforge.net/web-erp/?rev=4728&view=rev Author: daintree Date: 2011-10-19 09:40:44 +0000 (Wed, 19 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/BOMs.php Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-10-19 01:32:48 UTC (rev 4727) +++ trunk/BOMExtendedQty.php 2011-10-19 09:40:44 UTC (rev 4728) @@ -258,28 +258,37 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '<br /><br /><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">'; + 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>' . _('Part') . ':</td> + echo '<tr> + <td>' . _('Part') . ':</td> <td><input type ="text" name="Part" size="20">'; - echo '<tr><td>' . _('Quantity') . ':</td> - <td><input type="text" class="number" name="Quantity" size="4"></td></tr>'; + echo '<tr> + <td>' . _('Quantity') . ':</td> + <td><input type="text" class="number" name="Quantity" size="4" /></td></tr>'; - echo '<tr><td>' . _('Selection Option') . ':</td> + echo '<tr> + <td>' . _('Selection Option') . ':</td> <td><select name="Select"> <option selected value="All">' . _('Show All Parts') . '</option> <option value="Shortages">' . _('Only Show Shortages') . '</option> - </select></td></tr>'; - echo '<tr><td>' . _('Print Option') . ':</td> + </select></td> + </tr>'; + echo '<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>'; + </select></td> + </tr>'; echo '</table> <br /> <br /> <div class="centre"> - <br /><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"> + <br /><input type=submit name="PrintPDF" value="' . _('Print PDF') . '" /> </div>'; include('includes/footer.inc'); Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-10-19 01:32:48 UTC (rev 4727) +++ trunk/BOMs.php 2011-10-19 09:40:44 UTC (rev 4728) @@ -72,30 +72,30 @@ global $ParentMBflag; // Modified by POPAD&T $sql = "SELECT bom.component, - stockmaster.description, - locations.locationname, - workcentres.description, - bom.quantity, - bom.effectiveafter, - bom.effectiveto, - stockmaster.mbflag, - bom.autoissue, - 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"; + stockmaster.description, + locations.locationname, + workcentres.description, + bom.quantity, + bom.effectiveafter, + bom.effectiveto, + stockmaster.mbflag, + bom.autoissue, + 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"; $ErrMsg = _('Could not retrieve the BOM components because'); $DbgMsg = _('The SQL used to retrieve the components was'); @@ -132,38 +132,38 @@ $QuantityOnHand = locale_number_format($myrow[10],$myrow[11]); } printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td><a href="%s&Select=%s&SelectedComponent=%s">' . _('Edit') . '</a></td> - <td>'.$DrillText.'</a></td> - <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s" 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], - $myrow[4], - ConvertSQLDate($myrow[5]), - ConvertSQLDate($myrow[6]), - $AutoIssue, - $QuantityOnHand, - $_SERVER['PHP_SELF'] . '?', - $Parent, - $myrow[0], - $DrillLink, - $DrillID, - $_SERVER['PHP_SELF'] . '?', - $Parent, - $myrow[0], - $UltimateParent); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td><a href="%s&Select=%s&SelectedComponent=%s">' . _('Edit') . '</a></td> + <td>'.$DrillText.'</a></td> + <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s" 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]), + $AutoIssue, + $QuantityOnHand, + $_SERVER['PHP_SELF'] . '?', + $Parent, + $myrow[0], + $DrillLink, + $DrillID, + $_SERVER['PHP_SELF'] . '?', + $Parent, + $myrow[0], + $UltimateParent); } //END WHILE LIST LOOP } //end of function DisplayBOMItems @@ -232,7 +232,7 @@ $Errors[$i] = 'Quantity'; $i++; } - if (filter_number_format($_POST['Quantity']==0)) { + if (filter_number_format($_POST['Quantity'])==0) { $InputError = 1; prnMsg(_('The quantity entered cannot be zero'),'error'); $Errors[$i] = 'Quantity'; @@ -293,10 +293,10 @@ /*Now check to see that the component is not already on the BOM */ $sql = "SELECT component FROM bom - WHERE parent='".$SelectedParent."' - AND component='" . $_POST['Component'] . "' - AND workcentreadded='" . $_POST['WorkCentreAdded'] . "' - AND loccode='" . $_POST['LocCode'] . "'" ; + WHERE parent='".$SelectedParent."' + AND component='" . $_POST['Component'] . "' + AND workcentreadded='" . $_POST['WorkCentreAdded'] . "' + AND loccode='" . $_POST['LocCode'] . "'" ; $ErrMsg = _('An error occurred in checking the component is not already on the BOM'); $DbgMsg = _('The SQL that was used to check the component was not already on the BOM and that failed in the process was'); @@ -306,13 +306,13 @@ if (DB_num_rows($result)==0) { $sql = "INSERT INTO bom (parent, - component, - workcentreadded, - loccode, - quantity, - effectiveafter, - effectiveto, - autoissue) + component, + workcentreadded, + loccode, + quantity, + effectiveafter, + effectiveto, + autoissue) VALUES ('".$SelectedParent."', '" . $_POST['Component'] . "', '" . $_POST['WorkCentreAdded'] . "', @@ -330,7 +330,6 @@ UpdateCost($db, $_POST['Component']); $msg = _('A new component part') . ' ' . $_POST['Component'] . ' ' . _('has been added to the bill of material for part') . ' - ' . $SelectedParent . '.'; - } else { /*The component must already be on the BOM */ @@ -350,13 +349,17 @@ //the link to delete a selected record was clicked instead of the Submit button - $sql="DELETE FROM bom WHERE parent='".$SelectedParent."' AND component='".$SelectedComponent."'"; + $sql="DELETE FROM bom + WHERE parent='".$SelectedParent."' + AND component='".$SelectedComponent."'"; $ErrMsg = _('Could not delete this BOM components because'); $DbgMsg = _('The SQL used to delete the BOM was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - $ComponentSQL = "SELECT component from bom where parent='" . $SelectedParent ."'"; + $ComponentSQL = "SELECT component + FROM bom + WHERE parent='" . $SelectedParent ."'"; $ComponentResult = DB_query($ComponentSQL,$db); $ComponentArray = DB_fetch_row($ComponentResult); UpdateCost($db, $ComponentArray[0]); @@ -505,7 +508,9 @@ echo '</table> <br /> <table class="selection">'; - echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . $SelectedParent .' - ' . $myrow[0] . ' ('. $MBdesc. ') </font></b></th></tr>'; + echo '<tr> + <th colspan="13"><div class="centre"><font color="blue" size="3"><b>' . $SelectedParent .' - ' . $myrow[0] . ' ('. $MBdesc. ') </font></b></th> + </tr>'; $BOMTree = array(); //BOMTree is a 2 dimensional array with three elements for each item in the array - Level, Parent, Component @@ -514,20 +519,22 @@ display_children($SelectedParent, 1, $BOMTree); $TableHeader = '<tr> - <th>' . _('Level') . '</th> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Location') . '</th> - <th>' . _('Work Centre') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Effective After') . '</th> - <th>' . _('Effective To') . '</th> - <th>' . _('Auto Issue') . '</th> - <th>' . _('Qty On Hand') . '</th> + <th>' . _('Level') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Work Centre') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Effective After') . '</th> + <th>' . _('Effective To') . '</th> + <th>' . _('Auto Issue') . '</th> + <th>' . _('Qty On Hand') . '</th> </tr>'; echo $TableHeader; if(count($BOMTree) == 0) { - echo '<tr class="OddTableRows"><td colspan="8">'._('No materials found.').'</td></tr>'; + echo '<tr class="OddTableRows"> + <td colspan="8">'._('No materials found.').'</td> + </tr>'; } else { $UltimateParent = $SelectedParent; $k = 0; @@ -547,7 +554,8 @@ DisplayBOMItems($UltimateParent, $Parent, $Component, $Level, $db); } } - echo '</table><br />'; + echo '</table> + <br />'; if (! isset($_GET['delete'])) { @@ -558,14 +566,14 @@ //editing a selected component from the link to the line item $sql = "SELECT loccode, - effectiveafter, - effectiveto, - workcentreadded, - quantity, - autoissue - FROM bom - WHERE parent='".$SelectedParent."' - AND component='".$SelectedComponent."'"; + effectiveafter, + effectiveto, + workcentreadded, + quantity, + autoissue + FROM bom + WHERE parent='".$SelectedParent."' + AND component='".$SelectedComponent."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -574,7 +582,7 @@ $_POST['EffectiveAfter'] = ConvertSQLDate($myrow['effectiveafter']); $_POST['EffectiveTo'] = ConvertSQLDate($myrow['effectiveto']); $_POST['WorkCentreAdded'] = $myrow['workcentreadded']; - $_POST['Quantity'] = $myrow['quantity']; + $_POST['Quantity'] = locale_number_format($myrow['quantity'],'Variable'); $_POST['AutoIssue'] = $myrow['autoissue']; prnMsg(_('Edit the details of the selected component in the fields below') . '. <br />' . _('Click on the Enter Information button to update the component details'),'info'); @@ -582,8 +590,11 @@ <input type="hidden" name="SelectedParent" value="' . $SelectedParent . '" />'; echo '<input type="hidden" name="SelectedComponent" value="' . $SelectedComponent . '" />'; echo '<table class="selection">'; - echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>'. ('Edit Component Details') .'</font></b></th></tr>'; - echo '<tr><td>' . _('Component') . ':</td> + echo '<tr> + <th colspan="13"><div class="centre"><font color="blue" size="3"><b>'. ('Edit Component Details') .'</font></b></th> + </tr>'; + echo '<tr> + <td>' . _('Component') . ':</td> <td><b>' . $SelectedComponent . '</b></td> </tr>'; @@ -593,8 +604,12 @@ /* echo "Enter the details of a new component in the fields below. <br />Click on 'Enter Information' to add the new component, once all fields are completed."; */ echo '<table class="selection">'; - echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . ('New Component Details') .'</font></b></th></tr>'; - echo '<tr><td>' . _('Component code') . ':</td><td>'; + echo '<tr> + <th colspan="13"><div class="centre"><font color="blue" size="3"><b>' . ('New Component Details') .'</font></b></th> + </tr>'; + echo '<tr> + <td>' . _('Component code') . ':</td> + <td>'; echo '<select ' . (in_array('ComponentCode',$Errors) ? 'class="selecterror"' : '' ) .' tabindex="1" name="Component">'; if ($ParentMBflag=='A'){ /*Its an assembly */ @@ -632,10 +647,12 @@ echo '<option value="' .$myrow['stockid'].'">' . str_pad($myrow['stockid'],21, '_', STR_PAD_RIGHT) . $myrow['description'] . '</option>'; } //end while loop - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } - echo '<tr><td>' . _('Location') . ': </td> + echo '<tr> + <td>' . _('Location') . ': </td> <td><select tabindex="2" name="LocCode">'; DB_free_result($result); @@ -656,8 +673,9 @@ echo '</select></td> </tr> - <tr><td>' . _('Work Centre Added') . ': </td> - <td><select tabindex="3" name="WorkCentreAdded">'; + <tr> + <td>' . _('Work Centre Added') . ': </td> + <td><select tabindex="3" name="WorkCentreAdded">'; $sql = "SELECT code, description FROM workcentres"; $result = DB_query($sql,$db); @@ -682,7 +700,8 @@ echo '</select></td> </tr> - <tr><td>' . _('Quantity') . ': </td> + <tr> + <td>' . _('Quantity') . ': </td> <td><input ' . (in_array('Quantity',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="4" type="text" class="number" name="Quantity" class="number" size="10" maxlength="8" value="'; if (isset($_POST['Quantity'])){ echo $_POST['Quantity']; @@ -690,7 +709,8 @@ echo 1; } - echo '"></td></tr>'; + echo '" /></td> + </tr>'; if (!isset($_POST['EffectiveTo']) OR $_POST['EffectiveTo']=='') { $_POST['EffectiveTo'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d'),(Date('y')+20))); @@ -699,10 +719,14 @@ $_POST['EffectiveAfter'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))); } - echo '<tr><td>' . _('Effective After') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input ' . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="5" type="text" name="EffectiveAfter" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" size="11" maxlength="10" value="' . $_POST['EffectiveAfter'] .'"></td></tr> - <tr><td>' . _('Effective To') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input ' . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="6" type="text" name="EffectiveTo" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" size="11" maxlength="10" value="' . $_POST['EffectiveTo'] .'"></td></tr>'; + echo '<tr> + <td>' . _('Effective After') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="5" type="text" name="EffectiveAfter" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" size="11" maxlength="10" value="' . $_POST['EffectiveAfter'] .'" /></td> + </tr> + <tr> + <td>' . _('Effective To') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="6" type="text" name="EffectiveTo" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" size="11" maxlength="10" value="' . $_POST['EffectiveTo'] .'" /></td> + </tr>'; if ($ParentMBflag=='M' OR $ParentMBflag=='G'){ echo '<tr><td>' . _('Auto Issue this Component to Work Orders') . ':</td> @@ -723,11 +747,14 @@ echo '</select></td></tr>'; } else { - echo '<input type=hidden name="AutoIssue" value="0">'; + echo '<input type="hidden" name="AutoIssue" value="0" />'; } echo '</table> - <br /><div class="centre"><input tabindex="8" type="submit" name="Submit" value="' . _('Enter Information') . '"></form></div>'; + <br /><div class="centre"><input tabindex="8" type="submit" name="Submit" value="' . _('Enter Information') . '" /> + + </form> + </div>'; } //end if record deleted no point displaying form to add record @@ -752,16 +779,17 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units, + stockmaster.decimalplaces, stockmaster.mbflag, SUM(locstock.quantity) as totalonhand - FROM stockmaster, - locstock - WHERE stockmaster.stockid = locstock.stockid - AND stockmaster.description " . LIKE . " '".$SearchString."' + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid = locstock.stockid + WHERE stockmaster.description " . LIKE . " '".$SearchString."' AND (stockmaster.mbflag='M' OR stockmaster.mbflag='K' OR stockmaster.mbflag='A' OR stockmaster.mbflag='G') GROUP BY stockmaster.stockid, stockmaster.description, stockmaster.units, + stockmaster.decimalplaces, stockmaster.mbflag ORDER BY stockmaster.stockid"; @@ -770,11 +798,11 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.decimalplaces, sum(locstock.quantity) as totalonhand - FROM stockmaster, - locstock - WHERE stockmaster.stockid = locstock.stockid - AND stockmaster.stockid " . LIKE . "'%" . $_POST['StockCode'] . "%' + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid = locstock.stockid + WHERE stockmaster.stockid " . LIKE . "'%" . $_POST['StockCode'] . "%' AND (stockmaster.mbflag='M' OR stockmaster.mbflag='K' OR stockmaster.mbflag='G' @@ -782,7 +810,8 @@ GROUP BY stockmaster.stockid, stockmaster.description, stockmaster.units, - stockmaster.mbflag + stockmaster.mbflag, + stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } @@ -797,74 +826,79 @@ 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">' . - '<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> + '<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"> <tr><td><font size=1>' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td> - <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25"></td> - <td><font size=3><b>' . _('OR') . '</b></font></td> - <td><font size=1>' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td> - <td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="18"></td> + <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25" /></td> + <td><font size="3"><b>' . _('OR') . '</b></font></td> + <td><font size="1">' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td> + <td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="18" /></td> </tr> </table> - <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '"></div>'; + <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '" /></div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -if (isset($_POST['Search']) AND isset($result) AND !isset($SelectedParent)) { - - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; - $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('On Hand') . '</th> - <th>' . _('Units') . '</th> - </tr>'; - - echo $TableHeader; - - $j = 1; - $k=0; //row colour counter - while ($myrow=DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">';; - $k=0; - } else { - echo '<tr class="OddTableRows">';; - $k++; + if (isset($_POST['Search']) + AND isset($result) + AND !isset($SelectedParent)) { + + echo '<br /> + <table cellpadding="2" colspan="7" class="selection">'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; + + echo $TableHeader; + + $j = 1; + $k=0; //row colour counter + while ($myrow=DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">';; + $k=0; + } else { + echo '<tr class="OddTableRows">';; + $k++; + } + if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K' OR $myrow['mbflag']=='G'){ + $StockOnHand = _('N/A'); + } else { + $StockOnHand = locale_number_format($myrow['totalonhand'],$myrow['decimalplaces']); + } + $tab = $j+3; + printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s" /></td> + <td>%s</td> + <td class="number">%s</td> + <td>%s</td> + </tr>', + $myrow['stockid'], + $myrow['description'], + $StockOnHand, + $myrow['units']); + + $j++; + //end of page full new headings if } - if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K' OR $myrow['mbflag']=='G'){ - $StockOnHand = _('N/A'); - } else { - $StockOnHand = locale_number_format($myrow['totalonhand'],2); - } - $tab = $j+3; - printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td></tr>', - $myrow['stockid'], - $myrow['description'], - $StockOnHand, - $myrow['units']); - - $j++; -//end of page full new headings if + //end of while loop + + echo '</table>'; + } -//end of while loop + //end if results to show + + if (!isset($SelectedParent) or $SelectedParent=='') { + echo '<script>defaultControl(document.forms[0].StockCode);</script>'; + } else { + echo '<script>defaultControl(document.form.JournalProcessDate);</script>'; + } + + echo '</form>'; - echo '</table>'; - -} -//end if results to show - -if (!isset($SelectedParent) or $SelectedParent=='') { - echo '<script>defaultControl(document.forms[0].StockCode);</script>'; -} else { - echo '<script>defaultControl(document.form.JournalProcessDate);</script>'; -} - -echo '</form>'; - } //end StockID already selected include('includes/footer.inc'); -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-10-19 09:40:55
|
Revision: 4728 http://web-erp.svn.sourceforge.net/web-erp/?rev=4728&view=rev Author: daintree Date: 2011-10-19 09:40:44 +0000 (Wed, 19 Oct 2011) Log Message: ----------- number_formats Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/BOMs.php Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2011-10-19 01:32:48 UTC (rev 4727) +++ trunk/BOMExtendedQty.php 2011-10-19 09:40:44 UTC (rev 4728) @@ -258,28 +258,37 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title.'</p><br />'; - echo '<br /><br /><form action=' . $_SERVER['PHP_SELF'] . ' method="post"><table class="selection">'; + 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>' . _('Part') . ':</td> + echo '<tr> + <td>' . _('Part') . ':</td> <td><input type ="text" name="Part" size="20">'; - echo '<tr><td>' . _('Quantity') . ':</td> - <td><input type="text" class="number" name="Quantity" size="4"></td></tr>'; + echo '<tr> + <td>' . _('Quantity') . ':</td> + <td><input type="text" class="number" name="Quantity" size="4" /></td></tr>'; - echo '<tr><td>' . _('Selection Option') . ':</td> + echo '<tr> + <td>' . _('Selection Option') . ':</td> <td><select name="Select"> <option selected value="All">' . _('Show All Parts') . '</option> <option value="Shortages">' . _('Only Show Shortages') . '</option> - </select></td></tr>'; - echo '<tr><td>' . _('Print Option') . ':</td> + </select></td> + </tr>'; + echo '<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>'; + </select></td> + </tr>'; echo '</table> <br /> <br /> <div class="centre"> - <br /><input type=submit name="PrintPDF" value="' . _('Print PDF') . '"> + <br /><input type=submit name="PrintPDF" value="' . _('Print PDF') . '" /> </div>'; include('includes/footer.inc'); Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2011-10-19 01:32:48 UTC (rev 4727) +++ trunk/BOMs.php 2011-10-19 09:40:44 UTC (rev 4728) @@ -72,30 +72,30 @@ global $ParentMBflag; // Modified by POPAD&T $sql = "SELECT bom.component, - stockmaster.description, - locations.locationname, - workcentres.description, - bom.quantity, - bom.effectiveafter, - bom.effectiveto, - stockmaster.mbflag, - bom.autoissue, - 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"; + stockmaster.description, + locations.locationname, + workcentres.description, + bom.quantity, + bom.effectiveafter, + bom.effectiveto, + stockmaster.mbflag, + bom.autoissue, + 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"; $ErrMsg = _('Could not retrieve the BOM components because'); $DbgMsg = _('The SQL used to retrieve the components was'); @@ -132,38 +132,38 @@ $QuantityOnHand = locale_number_format($myrow[10],$myrow[11]); } printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td><a href="%s&Select=%s&SelectedComponent=%s">' . _('Edit') . '</a></td> - <td>'.$DrillText.'</a></td> - <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s" 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], - $myrow[4], - ConvertSQLDate($myrow[5]), - ConvertSQLDate($myrow[6]), - $AutoIssue, - $QuantityOnHand, - $_SERVER['PHP_SELF'] . '?', - $Parent, - $myrow[0], - $DrillLink, - $DrillID, - $_SERVER['PHP_SELF'] . '?', - $Parent, - $myrow[0], - $UltimateParent); + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td><a href="%s&Select=%s&SelectedComponent=%s">' . _('Edit') . '</a></td> + <td>'.$DrillText.'</a></td> + <td><a href="%s&Select=%s&SelectedComponent=%s&delete=1&ReSelect=%s" 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]), + $AutoIssue, + $QuantityOnHand, + $_SERVER['PHP_SELF'] . '?', + $Parent, + $myrow[0], + $DrillLink, + $DrillID, + $_SERVER['PHP_SELF'] . '?', + $Parent, + $myrow[0], + $UltimateParent); } //END WHILE LIST LOOP } //end of function DisplayBOMItems @@ -232,7 +232,7 @@ $Errors[$i] = 'Quantity'; $i++; } - if (filter_number_format($_POST['Quantity']==0)) { + if (filter_number_format($_POST['Quantity'])==0) { $InputError = 1; prnMsg(_('The quantity entered cannot be zero'),'error'); $Errors[$i] = 'Quantity'; @@ -293,10 +293,10 @@ /*Now check to see that the component is not already on the BOM */ $sql = "SELECT component FROM bom - WHERE parent='".$SelectedParent."' - AND component='" . $_POST['Component'] . "' - AND workcentreadded='" . $_POST['WorkCentreAdded'] . "' - AND loccode='" . $_POST['LocCode'] . "'" ; + WHERE parent='".$SelectedParent."' + AND component='" . $_POST['Component'] . "' + AND workcentreadded='" . $_POST['WorkCentreAdded'] . "' + AND loccode='" . $_POST['LocCode'] . "'" ; $ErrMsg = _('An error occurred in checking the component is not already on the BOM'); $DbgMsg = _('The SQL that was used to check the component was not already on the BOM and that failed in the process was'); @@ -306,13 +306,13 @@ if (DB_num_rows($result)==0) { $sql = "INSERT INTO bom (parent, - component, - workcentreadded, - loccode, - quantity, - effectiveafter, - effectiveto, - autoissue) + component, + workcentreadded, + loccode, + quantity, + effectiveafter, + effectiveto, + autoissue) VALUES ('".$SelectedParent."', '" . $_POST['Component'] . "', '" . $_POST['WorkCentreAdded'] . "', @@ -330,7 +330,6 @@ UpdateCost($db, $_POST['Component']); $msg = _('A new component part') . ' ' . $_POST['Component'] . ' ' . _('has been added to the bill of material for part') . ' - ' . $SelectedParent . '.'; - } else { /*The component must already be on the BOM */ @@ -350,13 +349,17 @@ //the link to delete a selected record was clicked instead of the Submit button - $sql="DELETE FROM bom WHERE parent='".$SelectedParent."' AND component='".$SelectedComponent."'"; + $sql="DELETE FROM bom + WHERE parent='".$SelectedParent."' + AND component='".$SelectedComponent."'"; $ErrMsg = _('Could not delete this BOM components because'); $DbgMsg = _('The SQL used to delete the BOM was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); - $ComponentSQL = "SELECT component from bom where parent='" . $SelectedParent ."'"; + $ComponentSQL = "SELECT component + FROM bom + WHERE parent='" . $SelectedParent ."'"; $ComponentResult = DB_query($ComponentSQL,$db); $ComponentArray = DB_fetch_row($ComponentResult); UpdateCost($db, $ComponentArray[0]); @@ -505,7 +508,9 @@ echo '</table> <br /> <table class="selection">'; - echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . $SelectedParent .' - ' . $myrow[0] . ' ('. $MBdesc. ') </font></b></th></tr>'; + echo '<tr> + <th colspan="13"><div class="centre"><font color="blue" size="3"><b>' . $SelectedParent .' - ' . $myrow[0] . ' ('. $MBdesc. ') </font></b></th> + </tr>'; $BOMTree = array(); //BOMTree is a 2 dimensional array with three elements for each item in the array - Level, Parent, Component @@ -514,20 +519,22 @@ display_children($SelectedParent, 1, $BOMTree); $TableHeader = '<tr> - <th>' . _('Level') . '</th> - <th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Location') . '</th> - <th>' . _('Work Centre') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('Effective After') . '</th> - <th>' . _('Effective To') . '</th> - <th>' . _('Auto Issue') . '</th> - <th>' . _('Qty On Hand') . '</th> + <th>' . _('Level') . '</th> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Location') . '</th> + <th>' . _('Work Centre') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('Effective After') . '</th> + <th>' . _('Effective To') . '</th> + <th>' . _('Auto Issue') . '</th> + <th>' . _('Qty On Hand') . '</th> </tr>'; echo $TableHeader; if(count($BOMTree) == 0) { - echo '<tr class="OddTableRows"><td colspan="8">'._('No materials found.').'</td></tr>'; + echo '<tr class="OddTableRows"> + <td colspan="8">'._('No materials found.').'</td> + </tr>'; } else { $UltimateParent = $SelectedParent; $k = 0; @@ -547,7 +554,8 @@ DisplayBOMItems($UltimateParent, $Parent, $Component, $Level, $db); } } - echo '</table><br />'; + echo '</table> + <br />'; if (! isset($_GET['delete'])) { @@ -558,14 +566,14 @@ //editing a selected component from the link to the line item $sql = "SELECT loccode, - effectiveafter, - effectiveto, - workcentreadded, - quantity, - autoissue - FROM bom - WHERE parent='".$SelectedParent."' - AND component='".$SelectedComponent."'"; + effectiveafter, + effectiveto, + workcentreadded, + quantity, + autoissue + FROM bom + WHERE parent='".$SelectedParent."' + AND component='".$SelectedComponent."'"; $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); @@ -574,7 +582,7 @@ $_POST['EffectiveAfter'] = ConvertSQLDate($myrow['effectiveafter']); $_POST['EffectiveTo'] = ConvertSQLDate($myrow['effectiveto']); $_POST['WorkCentreAdded'] = $myrow['workcentreadded']; - $_POST['Quantity'] = $myrow['quantity']; + $_POST['Quantity'] = locale_number_format($myrow['quantity'],'Variable'); $_POST['AutoIssue'] = $myrow['autoissue']; prnMsg(_('Edit the details of the selected component in the fields below') . '. <br />' . _('Click on the Enter Information button to update the component details'),'info'); @@ -582,8 +590,11 @@ <input type="hidden" name="SelectedParent" value="' . $SelectedParent . '" />'; echo '<input type="hidden" name="SelectedComponent" value="' . $SelectedComponent . '" />'; echo '<table class="selection">'; - echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>'. ('Edit Component Details') .'</font></b></th></tr>'; - echo '<tr><td>' . _('Component') . ':</td> + echo '<tr> + <th colspan="13"><div class="centre"><font color="blue" size="3"><b>'. ('Edit Component Details') .'</font></b></th> + </tr>'; + echo '<tr> + <td>' . _('Component') . ':</td> <td><b>' . $SelectedComponent . '</b></td> </tr>'; @@ -593,8 +604,12 @@ /* echo "Enter the details of a new component in the fields below. <br />Click on 'Enter Information' to add the new component, once all fields are completed."; */ echo '<table class="selection">'; - echo '<tr><th colspan=13><div class="centre"><font color=blue size=3><b>' . ('New Component Details') .'</font></b></th></tr>'; - echo '<tr><td>' . _('Component code') . ':</td><td>'; + echo '<tr> + <th colspan="13"><div class="centre"><font color="blue" size="3"><b>' . ('New Component Details') .'</font></b></th> + </tr>'; + echo '<tr> + <td>' . _('Component code') . ':</td> + <td>'; echo '<select ' . (in_array('ComponentCode',$Errors) ? 'class="selecterror"' : '' ) .' tabindex="1" name="Component">'; if ($ParentMBflag=='A'){ /*Its an assembly */ @@ -632,10 +647,12 @@ echo '<option value="' .$myrow['stockid'].'">' . str_pad($myrow['stockid'],21, '_', STR_PAD_RIGHT) . $myrow['description'] . '</option>'; } //end while loop - echo '</select></td></tr>'; + echo '</select></td> + </tr>'; } - echo '<tr><td>' . _('Location') . ': </td> + echo '<tr> + <td>' . _('Location') . ': </td> <td><select tabindex="2" name="LocCode">'; DB_free_result($result); @@ -656,8 +673,9 @@ echo '</select></td> </tr> - <tr><td>' . _('Work Centre Added') . ': </td> - <td><select tabindex="3" name="WorkCentreAdded">'; + <tr> + <td>' . _('Work Centre Added') . ': </td> + <td><select tabindex="3" name="WorkCentreAdded">'; $sql = "SELECT code, description FROM workcentres"; $result = DB_query($sql,$db); @@ -682,7 +700,8 @@ echo '</select></td> </tr> - <tr><td>' . _('Quantity') . ': </td> + <tr> + <td>' . _('Quantity') . ': </td> <td><input ' . (in_array('Quantity',$Errors) ? 'class="inputerror"' : '' ) .' tabindex="4" type="text" class="number" name="Quantity" class="number" size="10" maxlength="8" value="'; if (isset($_POST['Quantity'])){ echo $_POST['Quantity']; @@ -690,7 +709,8 @@ echo 1; } - echo '"></td></tr>'; + echo '" /></td> + </tr>'; if (!isset($_POST['EffectiveTo']) OR $_POST['EffectiveTo']=='') { $_POST['EffectiveTo'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d'),(Date('y')+20))); @@ -699,10 +719,14 @@ $_POST['EffectiveAfter'] = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))); } - echo '<tr><td>' . _('Effective After') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input ' . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="5" type="text" name="EffectiveAfter" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" size="11" maxlength="10" value="' . $_POST['EffectiveAfter'] .'"></td></tr> - <tr><td>' . _('Effective To') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> - <td><input ' . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="6" type="text" name="EffectiveTo" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" size="11" maxlength="10" value="' . $_POST['EffectiveTo'] .'"></td></tr>'; + echo '<tr> + <td>' . _('Effective After') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('EffectiveAfter',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="5" type="text" name="EffectiveAfter" class="date" alt="' .$_SESSION['DefaultDateFormat'] .'" size="11" maxlength="10" value="' . $_POST['EffectiveAfter'] .'" /></td> + </tr> + <tr> + <td>' . _('Effective To') . ' (' . $_SESSION['DefaultDateFormat'] . '):</td> + <td><input ' . (in_array('EffectiveTo',$Errors) ? 'class="inputerror"' : '' ) . ' tabindex="6" type="text" name="EffectiveTo" class="date" alt="' .$_SESSION['DefaultDateFormat'] . '" size="11" maxlength="10" value="' . $_POST['EffectiveTo'] .'" /></td> + </tr>'; if ($ParentMBflag=='M' OR $ParentMBflag=='G'){ echo '<tr><td>' . _('Auto Issue this Component to Work Orders') . ':</td> @@ -723,11 +747,14 @@ echo '</select></td></tr>'; } else { - echo '<input type=hidden name="AutoIssue" value="0">'; + echo '<input type="hidden" name="AutoIssue" value="0" />'; } echo '</table> - <br /><div class="centre"><input tabindex="8" type="submit" name="Submit" value="' . _('Enter Information') . '"></form></div>'; + <br /><div class="centre"><input tabindex="8" type="submit" name="Submit" value="' . _('Enter Information') . '" /> + + </form> + </div>'; } //end if record deleted no point displaying form to add record @@ -752,16 +779,17 @@ $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units, + stockmaster.decimalplaces, stockmaster.mbflag, SUM(locstock.quantity) as totalonhand - FROM stockmaster, - locstock - WHERE stockmaster.stockid = locstock.stockid - AND stockmaster.description " . LIKE . " '".$SearchString."' + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid = locstock.stockid + WHERE stockmaster.description " . LIKE . " '".$SearchString."' AND (stockmaster.mbflag='M' OR stockmaster.mbflag='K' OR stockmaster.mbflag='A' OR stockmaster.mbflag='G') GROUP BY stockmaster.stockid, stockmaster.description, stockmaster.units, + stockmaster.decimalplaces, stockmaster.mbflag ORDER BY stockmaster.stockid"; @@ -770,11 +798,11 @@ stockmaster.description, stockmaster.units, stockmaster.mbflag, + stockmaster.decimalplaces, sum(locstock.quantity) as totalonhand - FROM stockmaster, - locstock - WHERE stockmaster.stockid = locstock.stockid - AND stockmaster.stockid " . LIKE . "'%" . $_POST['StockCode'] . "%' + FROM stockmaster INNER JOIN locstock + ON stockmaster.stockid = locstock.stockid + WHERE stockmaster.stockid " . LIKE . "'%" . $_POST['StockCode'] . "%' AND (stockmaster.mbflag='M' OR stockmaster.mbflag='K' OR stockmaster.mbflag='G' @@ -782,7 +810,8 @@ GROUP BY stockmaster.stockid, stockmaster.description, stockmaster.units, - stockmaster.mbflag + stockmaster.mbflag, + stockmaster.decimalplaces ORDER BY stockmaster.stockid"; } @@ -797,74 +826,79 @@ 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">' . - '<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> + '<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"> <tr><td><font size=1>' . _('Enter text extracts in the') . ' <b>' . _('description') . '</b>:</font></td> - <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25"></td> - <td><font size=3><b>' . _('OR') . '</b></font></td> - <td><font size=1>' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td> - <td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="18"></td> + <td><input tabindex="1" type="text" name="Keywords" size="20" maxlength="25" /></td> + <td><font size="3"><b>' . _('OR') . '</b></font></td> + <td><font size="1">' . _('Enter extract of the') . ' <b>' . _('Stock Code') . '</b>:</font></td> + <td><input tabindex="2" type="text" name="StockCode" size="15" maxlength="18" /></td> </tr> </table> - <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '"></div>'; + <br /><div class="centre"><input tabindex="3" type="submit" name="Search" value="' . _('Search Now') . '" /></div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -if (isset($_POST['Search']) AND isset($result) AND !isset($SelectedParent)) { - - echo '<br /><table cellpadding="2" colspan="7" class="selection">'; - $TableHeader = '<tr><th>' . _('Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('On Hand') . '</th> - <th>' . _('Units') . '</th> - </tr>'; - - echo $TableHeader; - - $j = 1; - $k=0; //row colour counter - while ($myrow=DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">';; - $k=0; - } else { - echo '<tr class="OddTableRows">';; - $k++; + if (isset($_POST['Search']) + AND isset($result) + AND !isset($SelectedParent)) { + + echo '<br /> + <table cellpadding="2" colspan="7" class="selection">'; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; + + echo $TableHeader; + + $j = 1; + $k=0; //row colour counter + while ($myrow=DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">';; + $k=0; + } else { + echo '<tr class="OddTableRows">';; + $k++; + } + if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K' OR $myrow['mbflag']=='G'){ + $StockOnHand = _('N/A'); + } else { + $StockOnHand = locale_number_format($myrow['totalonhand'],$myrow['decimalplaces']); + } + $tab = $j+3; + printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s" /></td> + <td>%s</td> + <td class="number">%s</td> + <td>%s</td> + </tr>', + $myrow['stockid'], + $myrow['description'], + $StockOnHand, + $myrow['units']); + + $j++; + //end of page full new headings if } - if ($myrow['mbflag']=='A' OR $myrow['mbflag']=='K' OR $myrow['mbflag']=='G'){ - $StockOnHand = _('N/A'); - } else { - $StockOnHand = locale_number_format($myrow['totalonhand'],2); - } - $tab = $j+3; - printf('<td><input tabindex="' . $tab . '" type="submit" name="Select" value="%s"</td> - <td>%s</td> - <td class=number>%s</td> - <td>%s</td></tr>', - $myrow['stockid'], - $myrow['description'], - $StockOnHand, - $myrow['units']); - - $j++; -//end of page full new headings if + //end of while loop + + echo '</table>'; + } -//end of while loop + //end if results to show + + if (!isset($SelectedParent) or $SelectedParent=='') { + echo '<script>defaultControl(document.forms[0].StockCode);</script>'; + } else { + echo '<script>defaultControl(document.form.JournalProcessDate);</script>'; + } + + echo '</form>'; - echo '</table>'; - -} -//end if results to show - -if (!isset($SelectedParent) or $SelectedParent=='') { - echo '<script>defaultControl(document.forms[0].StockCode);</script>'; -} else { - echo '<script>defaultControl(document.form.JournalProcessDate);</script>'; -} - -echo '</form>'; - } //end StockID already selected include('includes/footer.inc'); -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |