From: <tim...@us...> - 2010-01-29 15:58:12
|
Revision: 3333 http://web-erp.svn.sourceforge.net/web-erp/?rev=3333&view=rev Author: tim_schofield Date: 2010-01-29 15:58:05 +0000 (Fri, 29 Jan 2010) Log Message: ----------- Pak Ricard: PricesByCost.php - New script to view or update prices by cost Modified Paths: -------------- trunk/doc/Change.log.html trunk/index.php Added Paths: ----------- trunk/PricesByCost.php Added: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php (rev 0) +++ trunk/PricesByCost.php 2010-01-29 15:58:05 UTC (rev 3333) @@ -0,0 +1,179 @@ +<?php +/* $Id$ */ +// PricesByCost.php - +$PageSecurity = 2; +include ('includes/session.inc'); +$title = _('Update of Prices By Cost'); +include ('includes/header.inc'); +echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/inventory.png" title="' . _('Inventory') . '" alt="">' . ' ' . _('Update Price By Cost') . ''; +if (isset($_POST['submit']) or isset($_POST['update'])) { + if ($_POST['Margin'] == "") { + header('Location: PricesByCost.php'); + } + if ($_POST['Comparator'] == 1) { + $Comparator = "<="; + } else { + $Comparator = ">="; + } /*end of else Comparator */ + if ($_POST['StockCat'] == "all") { + $Category = "stockmaster.stockid = prices.stockid"; + } else { + $Category = "stockmaster.stockid = prices.stockid AND stockmaster.categoryid = '" . $_POST['StockCat'] . "'"; + } /*end of else StockCat */ + $sql = "SELECT stockmaster.stockid, + stockmaster.description, + (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) as cost, + prices.price as price, prices.debtorno as customer, prices.branchcode as branch + FROM stockmaster, prices + WHERE " . $Category . " + AND prices.price" . $Comparator . "(stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) * " . $_POST['Margin'] . " + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "'"; + $result = DB_query($sql, $db); + $numrow = DB_num_rows($result); + $sqlcat = "SELECT categorydescription + FROM stockcategory + WHERE categoryid='" . $_POST['StockCat'] . "'"; + $ResultCat = DB_query($sqlcat, $db); + $Category = DB_fetch_array($ResultCat); + $sqltype = "SELECT sales_type + FROM salestypes + WHERE typeabbrev='" . $_POST['SalesType'] . "'"; + $ResultType = DB_query($sqltype, $db); + $Type = DB_fetch_array($ResultType); + if (isset($Category[0])) { + $Cat = $Category[0]; + } else { + $Cat = "All Category"; + } /*end of else Category */ + echo '<div class="page_help_text">' . _('Items in category ') . '' . $Cat . '' . _(' With Price ') . '' . $Comparator . '' . $_POST['Margin'] . '' . _(' times ') . '' . _('Cost in Price List ') . '' . $Type['0'] . '</div><br><br>'; + if ($numrow != 0) { + echo "<table>"; + echo '<tr><th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Cost') . '</th> + <th>' . _('Current Margin') . '</th> + <th>' . _('Price Proposed') . '</th> + <th>' . _('Price in pricelist') . '</th> + <tr>'; + $k = 0; //row colour counter + echo '<form action="PricesByCost.php" method="POST" name="' . _('update') . '">'; + while ($myrow = DB_fetch_array($result)) { + //update database if update pressed + if ($_POST['submit'] == 'Update') { + //Update Prices + $SQLUpdate = "UPDATE prices + SET price = '" . $_POST[$myrow['0']] . "' + WHERE `prices`.`stockid` = '" . $myrow['0'] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND prices.debtorno ='" . $myrow['customer'] . "' + AND prices.branchcode ='" . $myrow['branch'] . "'"; + $Resultup = DB_query($SQLUpdate, $db); + } + if ($k == 1) { + echo '<tr class="EvenTableRows">'; + $k = 0; + } else { + echo '<tr class="OddTableRows">'; + $k = 1; + } + //get cost + if ($myrow['cost'] == "") { + $Cost = "0"; + } else { + $Cost = $myrow['cost']; + } /*end of else Cost */ + //get qty price + if (isset($_POST[$myrow['0']])) { + $price = $_POST[$myrow['0']]; + } else { + $price = $myrow['price']; + } /*end of else price */ + //variable for update data + echo ' + <input type="hidden" value=' . $_POST['StockCat'] . ' name=' . _('StockCat') . ' /> + <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') . ' /> + <input type="hidden" value=' . $myrow['0'] . ' name=' . _('Id') . ' /> + <input type="hidden" value=' . $_POST['Price'] . ' name=' . _('Price') . ' /> + '; + //variable for current margin + $currentmargin = $price / $Cost; + //variable for proposed + $proposed = $Cost * $_POST['Margin']; + echo ' <td>' . $myrow['0'] . '</td> + <td>' . $myrow['1'] . '</td> + <td>' . $myrow['customer'] . '</td> + <td>' . $myrow['branch'] . '</td> + <td class="number">' . number_format($Cost, 2) . '</td> + <td class="number">' . number_format($currentmargin, 2) . '</td> + <td class="number">' . number_format($proposed, 2) . '</td> + <td><input type="text" class="number" name="' . $myrow['0'] . '" MAXLENGTH =14 size=15 value="' . $price . '"></td> + </tr> '; + } //end of looping + echo '<tr> + <td style="text-align:right" colspan=4><input type=submit name=submit value=' . _("Update") . '></td> + <td style="text-align:left" colspan=3><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><input type=submit value=' . _("Back") . '><a/></td> + </tr></form>'; + } else { + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Back') . '<a/></div><p>'; + } +} 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>"; + $SQL = 'SELECT categoryid, categorydescription + FROM stockcategory + ORDER BY categorydescription'; + $result1 = DB_query($SQL, $db); + echo '<tr> + <td>' . _('Category') . ':</td> + <td><select name="StockCat">'; + echo '<option value="all">' . _('All Categories') . ''; + while ($myrow1 = DB_fetch_array($result1)) { + echo '<option value="' . $myrow1['categoryid'] . '">' . $myrow1['categorydescription']; + } + echo '</select></td></tr>'; + echo '<tr><td>' . _('Price') . ' + <select name="Comparator">'; + echo '<option value="1">' . _('Less than or equal to') . ''; + echo '<option value="2">' . _('Greater than or equal to') . ''; + if ($_SESSION['WeightedAverageCosting']==1) { + echo '</select>'.' '. _('Average Cost') . ' x </td>'; + } else { + echo '</select>'.' '. _('Standard Cost') . ' x </td>'; + } + echo '<td> + <input type="text" class="number" name="Margin" MAXLENGTH =10 size=11 value=0></td></tr>'; + $result = DB_query('SELECT typeabbrev, sales_type FROM salestypes ', $db); + echo '<tr><td>' . _('Sales Type') . '/' . _('Price List') . ":</td> + <td><select name='SalesType'>"; + while ($myrow = DB_fetch_array($result)) { + if ($_POST['SalesType'] == $myrow['typeabbrev']) { + echo "<option selected value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + } else { + echo "<option value='" . $myrow['typeabbrev'] . "'>" . $myrow['sales_type']; + } + } //end while loop + DB_data_seek($result, 0); + $result = DB_query('SELECT currency, currabrev FROM currencies', $db); + echo '</select></td></tr> + <tr><td>' . _('Currency') . ":</td> + <td><select name='CurrCode'>"; + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['CurrCode']) and $_POST['CurrCode'] == $myrow['currabrev']) { + echo '<option selected value=' . $myrow['currabrev'] . '>' . $myrow['currency']; + } else { + echo '<option value=' . $myrow['currabrev'] . '>' . $myrow['currency']; + } + } //end while loop + DB_data_seek($result, 0); + 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 Property changes on: trunk/PricesByCost.php ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-29 10:21:00 UTC (rev 3332) +++ trunk/doc/Change.log.html 2010-01-29 15:58:05 UTC (rev 3333) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>29/01/10 Pak Ricard: PricesByCost.php - New script to view or update prices by cost</p> <p>29/01/10 Zhiguo Yuan: SupplierCredit.php - Bring credit note scrpt in line with the invoice script</p> <p>29/01/10 Victor Onofrei: Partial Romanian translation</p> <p>27/01/10 Sajatmiko Akbar Wibowo: Updated Indonesian translation files</p> Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-01-29 10:21:00 UTC (rev 3332) +++ trunk/index.php 2010-01-29 15:58:05 UTC (rev 3333) @@ -659,6 +659,11 @@ </tr> <tr> <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php?' . SID . '">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> + </td> + </tr> + <tr> + <td class="menu_group_item"> <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?' . SID . '">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> </td> </tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-02-02 11:06:57
|
Revision: 3334 http://web-erp.svn.sourceforge.net/web-erp/?rev=3334&view=rev Author: tim_schofield Date: 2010-02-02 11:06:47 +0000 (Tue, 02 Feb 2010) Log Message: ----------- Harald: api_xml-rpc.php.php - Corrections to descriptions. Modified Paths: -------------- trunk/api/api_xml-rpc.php trunk/doc/Change.log.html Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2010-01-29 15:58:05 UTC (rev 3333) +++ trunk/api/api_xml-rpc.php 2010-02-02 11:06:47 UTC (rev 3334) @@ -970,7 +970,7 @@ unset($Parameter); unset($ReturnValue); - $Description = _(''); + $Description = _('Inserts a sales invoice into the debtortrans table and does the relevant GL entries'); $Parameter[0]['name'] = _('Invoice Details'); $Parameter[0]['description'] = _('An array of index/value items describing the invoice.'); $Parameter[1]['name'] = _('User name'); @@ -1000,6 +1000,7 @@ unset($Parameter); unset($ReturnValue); + $Description = _('This function is used to insert a new Sales Credit to the webERP database.'); $Parameter[0]['name'] = _('Credit Details'); $Parameter[0]['description'] = _('An array of index/value items describing the credit. All values must be negative.'); $Parameter[1]['name'] = _('User name'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-29 15:58:05 UTC (rev 3333) +++ trunk/doc/Change.log.html 2010-02-02 11:06:47 UTC (rev 3334) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>02/02/10 Harald: api_xml-rpc.php.php - Corrections to descriptions.</p> <p>29/01/10 Pak Ricard: PricesByCost.php - New script to view or update prices by cost</p> <p>29/01/10 Zhiguo Yuan: SupplierCredit.php - Bring credit note scrpt in line with the invoice script</p> <p>29/01/10 Victor Onofrei: Partial Romanian translation</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-02-02 14:27:05
|
Revision: 3335 http://web-erp.svn.sourceforge.net/web-erp/?rev=3335&view=rev Author: tim_schofield Date: 2010-02-02 14:26:59 +0000 (Tue, 02 Feb 2010) Log Message: ----------- Chris Franks: BOMInquiry.php - Show the labour and verhead costs for the parent item Modified Paths: -------------- trunk/BOMInquiry.php trunk/doc/Change.log.html Modified: trunk/BOMInquiry.php =================================================================== --- trunk/BOMInquiry.php 2010-02-02 11:06:47 UTC (rev 3334) +++ trunk/BOMInquiry.php 2010-02-02 14:26:59 UTC (rev 3335) @@ -17,11 +17,11 @@ echo "<form action=" . $_SERVER['PHP_SELF'] . "?" . SID ." method=post><b><br></b>". '<div class="page_help_text">'. _('Select a manufactured part') . " (" . _('or Assembly or Kit part') . ") " . _('to view the costed bill of materials') . "." . "<br><font size=1>" . - _('Parts must be defined in the stock item entry') . "/" . _('modification screen as manufactured') . + _('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 align='center' cellpadding=3 colspan=4><tr><td><font size=1>" . _('Enter text extracts in the') . + ."</font><br><table align='center' 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') . + <td><font size=3><b>" . _('OR') . "</b></font></td><td><font size=1>" . _('Enter extract of the') . " <b>" . _('Stock Code') . "</b>:</font></td><td><input tabindex='2' type='Text' name='StockCode' size=15 maxlength=20></td> </tr></table><br><div class='centre'><input tabindex='3' type=submit name='Search' VALUE=" . _('Search Now') . "></div><br>"; } @@ -131,8 +131,15 @@ } if (isset($StockID) and $StockID!=""){ - $result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='" . $StockID . "'",$db); - $myrow = DB_fetch_row($result); + /*CCF modification */ +// $result = DB_query("SELECT description, units FROM stockmaster WHERE stockid='" . $StockID . "'",$db); + $result = DB_query("SELECT description, units, labourcost, overheadcost FROM stockmaster WHERE stockid='" . $StockID . "'",$db); + /*CCF end modification */ + $myrow = DB_fetch_array($result); + /*CCF modification */ + $ParentLabourCost = $myrow['labourcost']; + $ParentOverheadCost = $myrow['overheadcost']; + /*CCF end modification */ echo "<div class='centre'><br><font size=4><b>" . $myrow[0] . ' : ' . _('per') . ' ' . $myrow[1] . "</b></font></div>"; @@ -155,7 +162,7 @@ prnMsg(_('The bill of material for this part is not set up') . ' - ' . _('there are no components defined for it'),'warn'); } else { - echo "<table cellpadding=2 BORDER=2>"; + echo "<table cellpadding=2 border=2>"; $TableHeader = '<tr> <th>' . _('Component') . '</th> <th>' . _('Description') . '</th> @@ -201,6 +208,15 @@ $j++; } + /*CCF modification */ + $TotalCost += $ParentLabourCost; + echo '<tr> + <td colspan=4 class=number><b>' . _('Labour Cost') . '</b></td> + <td class=number><b>' . number_format($ParentLabourCost,2) . '</b></td> </tr>'; + $TotalCost += $ParentOverheadCost; + echo '<tr><td colspan=4 class=number><b>' . _('Overhead Cost') . '</b></td> + <td class=number><b>' . number_format($ParentOverheadCost,2) . '</b></td></tr>'; + /*CCF end modification */ echo '<tr> <td colspan=4 class=number><b>' . _('Total Cost') . '</b></td> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-02 11:06:47 UTC (rev 3334) +++ trunk/doc/Change.log.html 2010-02-02 14:26:59 UTC (rev 3335) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>02/02/10 Chris Franks: BOMInquiry.php - Show the labour and verhead costs for the parent item</p> <p>02/02/10 Harald: api_xml-rpc.php.php - Corrections to descriptions.</p> <p>29/01/10 Pak Ricard: PricesByCost.php - New script to view or update prices by cost</p> <p>29/01/10 Zhiguo Yuan: SupplierCredit.php - Bring credit note scrpt in line with the invoice script</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-02-02 15:29:57
|
Revision: 3336 http://web-erp.svn.sourceforge.net/web-erp/?rev=3336&view=rev Author: tim_schofield Date: 2010-02-02 15:29:47 +0000 (Tue, 02 Feb 2010) Log Message: ----------- Pak Ricard: BankReconciliation.php - Correction for multi currency bank accounts Modified Paths: -------------- trunk/BankReconciliation.php trunk/doc/Change.log.html Modified: trunk/BankReconciliation.php =================================================================== --- trunk/BankReconciliation.php 2010-02-02 14:26:59 UTC (rev 3335) +++ trunk/BankReconciliation.php 2010-02-02 15:29:47 UTC (rev 3336) @@ -32,7 +32,7 @@ $BankAccountName = $CurrencyRow[1]; $CalculatedBalance = $_POST['DoExchangeDifference']; - $ExchangeDifference = ($CalculatedBalance - $_POST['BankStatmentBalance'])*$ExRate; + $ExchangeDifference = ($CalculatedBalance - $_POST['BankStatmentBalance'])/$ExRate; include ('includes/SQL_CommonFunctions.inc'); $ExDiffTransNo = GetNextTransNo(36,$db); @@ -155,7 +155,7 @@ echo ' (' . $BankCurrCode . ' @ ' . $ExRate .')'; } echo '</b></td> - <td valign=bottom class=number><b>' . number_format($Balance/$ExRate,2) . '</b></td></tr>'; + <td valign=bottom class=number><b>' . number_format($Balance*$ExRate,2) . '</b></td></tr>'; $SQL = 'SELECT amount/exrate AS amt, amountcleared, @@ -299,7 +299,7 @@ } //end of while loop echo '<tr></tr><tr><td colspan=6>' . _('Total of all uncleared deposits') . '</td><td class=number>' . number_format($TotalUnclearedDeposits,2) . '</td></tr>'; - $FXStatementBalance = ($Balance/$ExRate) - $TotalUnpresentedCheques -$TotalUnclearedDeposits; + $FXStatementBalance = ($Balance*$ExRate) - $TotalUnpresentedCheques -$TotalUnclearedDeposits; echo '<tr></tr><tr><td colspan=6><b>' . _('Bank statement balance should be') . ' (' . $BankCurrCode . ')</b></td><td class=number>' . number_format($FXStatementBalance,2) . '</td></tr>'; if (isset($_POST['DoExchangeDifference'])){ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-02 14:26:59 UTC (rev 3335) +++ trunk/doc/Change.log.html 2010-02-02 15:29:47 UTC (rev 3336) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>02/02/10 Pak Ricard: BankReconciliation.php - Correction for multi currency bank accounts</p> <p>02/02/10 Chris Franks: BOMInquiry.php - Show the labour and verhead costs for the parent item</p> <p>02/02/10 Harald: api_xml-rpc.php.php - Corrections to descriptions.</p> <p>29/01/10 Pak Ricard: PricesByCost.php - New script to view or update prices by cost</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-02-05 16:31:00
|
Revision: 3338 http://web-erp.svn.sourceforge.net/web-erp/?rev=3338&view=rev Author: tim_schofield Date: 2010-02-05 16:30:42 +0000 (Fri, 05 Feb 2010) Log Message: ----------- If authoriastion limit is blank, then use a zero value Modified Paths: -------------- trunk/PO_AuthorisationLevels.php trunk/doc/Change.log.html Modified: trunk/PO_AuthorisationLevels.php =================================================================== --- trunk/PO_AuthorisationLevels.php 2010-02-03 17:09:09 UTC (rev 3337) +++ trunk/PO_AuthorisationLevels.php 2010-02-05 16:30:42 UTC (rev 3338) @@ -26,6 +26,9 @@ } else { $offhold=1; } + if ($_POST['authlevel']=='') { + $_POST['authlevel']=0; + } $sql='SELECT COUNT(*) FROM purchorderauth WHERE userid="'.$_POST['userid'].'" Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-03 17:09:09 UTC (rev 3337) +++ trunk/doc/Change.log.html 2010-02-05 16:30:42 UTC (rev 3338) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>03/02/10 Tim: Payments.php - Correctly show escaped characters in narrative while item hasn't been posted'</p> +<p>05/02/10 Tim: PO_AuthorisationLevels.php - If authoriastion limit is blank, then use a zero value</p> +<p>03/02/10 Tim: Payments.php - Correctly show escaped characters in narrative while item hasn't been posted</p> <p>02/02/10 Pak Ricard: BankReconciliation.php - Correction for multi currency bank accounts</p> <p>02/02/10 Chris Franks: BOMInquiry.php - Show the labour and verhead costs for the parent item</p> <p>02/02/10 Harald: api_xml-rpc.php.php - Corrections to descriptions.</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-02-08 14:18:48
|
Revision: 3339 http://web-erp.svn.sourceforge.net/web-erp/?rev=3339&view=rev Author: tim_schofield Date: 2010-02-08 14:18:40 +0000 (Mon, 08 Feb 2010) Log Message: ----------- Add the lanscape sales invoice Note to the Form Designer Modified Paths: -------------- trunk/FormDesigner.php trunk/PrintCustTrans.php trunk/doc/Change.log.html trunk/includes/PDFTransPageHeader.inc Added Paths: ----------- trunk/companies/weberpdemo/FormDesigns/SalesInvoice.xml Modified: trunk/FormDesigner.php =================================================================== --- trunk/FormDesigner.php 2010-02-05 16:30:42 UTC (rev 3338) +++ trunk/FormDesigner.php 2010-02-08 14:18:40 UTC (rev 3339) @@ -5,7 +5,7 @@ $title = _('Form Designer'); include('includes/header.inc'); function FontSizes() { - return array(6, 8, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24); //Possible font sizes + return array(6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24); //Possible font sizes } function SimpleTextLine($key) { /* Displays a table row containing the attributes for a @@ -108,6 +108,9 @@ case 'GoodsReceived.xml': echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PDFGrn.php?' . SID .'GRNNo=Preview&PONo=1">'; break; + case 'SalesInvoice.xml': + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PrintCustTrans.php?' . SID .'FromTransNo=Preview&InvOrCredit=Invoice&PrintPDF=True">'; + break; } } else { /* otherwise check that the web server has write premissions on the companies @@ -154,7 +157,7 @@ $Papers=array('A4_Landscape', 'A4_Portrait', 'A3_Landscape', 'A3_Portrait', 'letter_Portrait', 'letter_Landscape', 'legal_Portrait', 'legal_Landscape'); // Possible paper sizes/orientations echo '<form method="post" id="Form" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; echo '<input name=FormName type=hidden value="'.$_POST['FormName'].'">'; -echo '<table width=85% border=1>'; //Start of outer table +echo '<table width=95% border=1>'; //Start of outer table echo '<tr><th width=33%>'._('Form Name').'<input type="text" name="formname" value="'.$FormDesign['name'].'"></th>'; /* Select the paper size/orientation */ echo '<th width=33%>'._('Paper Size').'<select name="PaperSize">'; @@ -186,19 +189,19 @@ $counter=$counter+1; break; case 'SimpleText': - echo '<td colspan=1 valign=top><table width=100% border=1><tr><th colspan=6>'.$key['name'].'</th></tr>'; + echo '<td colspan=1 valign=top><table width=100% border=1><tr><th colspan=6>'.$key['name'].'</th></tr>'."\n"; SimpleTextLine($key); echo '</table></td>'; $counter=$counter+1; break; case 'MultiLineText': - echo '<td colspan=1 valign=top><table width=100% border=1><tr><th colspan=4>'.$key['name'].'</th></tr>'; + echo '<td colspan=1 valign=top><table width=100% border=1><tr><th colspan=4>'.$key['name'].'</th></tr>'."\n"; MultiTextLine($key); echo '</table></td>'; $counter=$counter+1; break; case 'ElementArray': - echo '<td colspan=1 valign=top><table width=100% border=1><tr><th colspan=7>'.$key['name'].'</th></tr>'; + echo '<td colspan=1 valign=top><table width=100% border=1><tr><th colspan=7>'.$key['name'].'</th></tr>'."\n"; foreach ($key as $subkey) { if ($subkey['type']=='SimpleText') { echo '<tr>'; @@ -238,6 +241,15 @@ echo '</table></td>'; $counter=$counter+1; break; + case 'Line': + echo '<td colspan=1 valign=top><table width=100% border=1><tr><th colspan=6>'.$key['name'].'</th></tr>'; + echo '<td class=number>'._('Start x co-ordinate').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'startx" size=4 maxlength=4 value="'.$key->startx.'"></td>'; + echo '<td class=number>'._('Start y co-ordinate').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'starty" size=4 maxlength=4 value="'.$key->starty.'"></td></tr><tr>'; + echo '<td class=number>'._('End x co-ordinate').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'endx" size=4 maxlength=4 value="'.$key->endx.'"></td>'; + echo '<td class=number>'._('End y co-ordinate').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'endy" size=4 maxlength=4 value="'.$key->endy.'"></td>'; + echo '</table></td>'; + $counter=$counter+1; + break; } if ($counter==4) { // If the row is full start a new one $counter=1; Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2010-02-05 16:30:42 UTC (rev 3338) +++ trunk/PrintCustTrans.php 2010-02-08 14:18:40 UTC (rev 3339) @@ -1,89 +1,55 @@ <?php - /* $Id$ */ - $PageSecurity = 1; - -include('includes/session.inc'); - +include ('includes/session.inc'); if (isset($_GET['FromTransNo'])) { $FromTransNo = trim($_GET['FromTransNo']); } elseif (isset($_POST['FromTransNo'])) { $FromTransNo = trim($_POST['FromTransNo']); } - if (isset($_GET['InvOrCredit'])) { $InvOrCredit = $_GET['InvOrCredit']; } elseif (isset($_POST['InvOrCredit'])) { $InvOrCredit = $_POST['InvOrCredit']; } - if (isset($_GET['PrintPDF'])) { $PrintPDF = $_GET['PrintPDF']; } elseif (isset($_POST['PrintPDF'])) { $PrintPDF = $_POST['PrintPDF']; } - -if (!isset($_POST['ToTransNo']) - or trim($_POST['ToTransNo'])=='' - or $_POST['ToTransNo'] < $FromTransNo) { - +if (!isset($_POST['ToTransNo']) or trim($_POST['ToTransNo']) == '' or $_POST['ToTransNo'] < $FromTransNo) { $_POST['ToTransNo'] = $FromTransNo; } - $FirstTrans = $FromTransNo; /* Need to start a new page only on subsequent transactions */ - -if (isset($PrintPDF) or isset($_GET['PrintPDF']) - and $PrintPDF!='' - and isset($FromTransNo) - and isset($InvOrCredit) - and $FromTransNo!=''){ - - include ('includes/class.pdf.php'); - require('fpdi/fpdi.php'); - - /* This invoice is hard coded for A4 Landscape invoices or credit notes so can't use PDFStarter.inc */ - - $Page_Width=842; - $Page_Height=595; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=40; - $Right_Margin=30; - -// Javier: now I use the native constructor, better to not use references - $pdf = new Cpdf('L', 'pt', 'A4'); - $pdf->addInfo('Creator', 'webERP http://www.weberp.org'); - $pdf->addInfo('Author', 'webERP ' . $Version); - - if ($InvOrCredit=='Invoice') { - $pdf->addInfo('Title',_('Sales Invoice') . ' ' . $FromTransNo . ' to ' . $_POST['ToTransNo']); - $pdf->addInfo('Subject',_('Invoices from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); +if ($FromTransNo=='Preview') { + $FormDesign = simplexml_load_file(sys_get_temp_dir().'/SalesInvoice.xml'); +} else { + $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/SalesInvoice.xml'); +} +if (isset($PrintPDF) or isset($_GET['PrintPDF']) and $PrintPDF != '' and isset($FromTransNo) and isset($InvOrCredit) and $FromTransNo != '') { + $PaperSize = $FormDesign->PaperSize; + include ('includes/PDFStarter.php'); + require ('fpdi/fpdi.php'); + // Javier: now I use the native constructor, better to not use references + if ($InvOrCredit == 'Invoice') { + $pdf->addInfo('Title', _('Sales Invoice') . ' ' . $FromTransNo . ' to ' . $_POST['ToTransNo']); + $pdf->addInfo('Subject', _('Invoices from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); } else { - $pdf->addInfo('Title',_('Sales Credit Note') ); - $pdf->addInfo('Subject',_('Credit Notes from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); + $pdf->addInfo('Title', _('Sales Credit Note')); + $pdf->addInfo('Subject', _('Credit Notes from') . ' ' . $FromTransNo . ' ' . _('to') . ' ' . $_POST['ToTransNo']); } - -/* Javier: I have brought this piece from the pdf class constructor to get it closer to the admin/user, + /* Javier: I have brought this piece from the pdf class constructor to get it closer to the admin/user, I corrected it to match TCPDF, but it still needs some check, after which, I think it should be moved to each report to provide flexible Document Header and Margins in a per-report basis. */ - $pdf->setAutoPageBreak(0); // Javier: needs check. - $pdf->setPrintHeader(false); // Javier: I added this must be called before Add Page - $pdf->AddPage(); - $pdf->cMargin = 0; // Javier: needs check. -/* END Brought from class.pdf.php constructor */ - -// $pdf->selectFont('helvetica'); + /* END Brought from class.pdf.php constructor */ + // $pdf->selectFont('helvetica'); $FirstPage = true; - $line_height=16; - - while ($FromTransNo <= $_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 - nobble the invoice reprints */ - - if ($InvOrCredit=='Invoice') { + $line_height = $FormDesign->LineHeight; + while ($FromTransNo <= $_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 + nobble the invoice reprints */ + if ($InvOrCredit == 'Invoice') { $sql = 'SELECT debtortrans.trandate, debtortrans.ovamount, debtortrans.ovdiscount, @@ -149,8 +115,7 @@ AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode AND salesorders.fromstkloc=locations.loccode'; - - if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No') { + if (isset($_POST['PrintEDI']) and $_POST['PrintEDI'] == 'No') { $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; } } else { @@ -195,34 +160,36 @@ paymentterms WHERE debtortrans.type=11 AND debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtortrans.transno=' . $FromTransNo .' + AND debtortrans.transno=' . $FromTransNo . ' AND debtortrans.debtorno=debtorsmaster.debtorno AND debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode'; - - if ($_POST['PrintEDI']=='No') { + if ($_POST['PrintEDI'] == 'No') { $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; } } // end else - - $result=DB_query($sql, $db, '', '',false, false); - - if (DB_error_no($db)!=0) { - $title = _('Transaction Print Error Report'); - include ('includes/header.inc'); - prnMsg( _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'),'error'); - if ($debug==1) { - prnMsg (_('The SQL used to get this information that failed was') . "<br />" . $sql,'error'); + if ($FromTransNo!='Preview') { + $result = DB_query($sql, $db, '', '', false, false); + if (DB_error_no($db) != 0) { + $title = _('Transaction Print Error Report'); + include ('includes/header.inc'); + prnMsg(_('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'), 'error'); + if ($debug == 1) { + prnMsg(_('The SQL used to get this information that failed was') . "<br />" . $sql, 'error'); + } + include ('includes/footer.inc'); + exit; } - include ('includes/footer.inc'); - exit; } - if (DB_num_rows($result)==1) { - $myrow = DB_fetch_array($result); - $ExchRate = $myrow['rate']; - if ($InvOrCredit=='Invoice') { - + if ($FromTransNo=='Preview' or DB_num_rows($result) == 1) { + if ($FromTransNo!='Preview') { + $myrow = DB_fetch_array($result); + $ExchRate = $myrow['rate']; + } else { + $ExchRate = 'X'; + } + if ($InvOrCredit == 'Invoice') { $sql = 'SELECT stockmoves.stockid, stockmaster.description, -stockmoves.qty as quantity, @@ -238,7 +205,7 @@ AND stockmoves.transno=' . $FromTransNo . ' AND stockmoves.show_on_inv_crds=1'; } else { - /* only credit notes to be retrieved */ + /* only credit notes to be retrieved */ $sql = 'SELECT stockmoves.stockid, stockmaster.description, stockmoves.qty as quantity, @@ -254,341 +221,269 @@ AND stockmoves.transno=' . $FromTransNo . ' AND stockmoves.show_on_inv_crds=1'; } // end else - - $result=DB_query($sql,$db); - if (DB_error_no($db)!=0) { + if ($FromTransNo!='Preview') { + $result = DB_query($sql, $db); + } + if (DB_error_no($db) != 0) { $title = _('Transaction Print Error Report'); include ('includes/header.inc'); echo '<br>' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); - if ($debug==1) { + if ($debug == 1) { echo '<br>' . _('The SQL used to get this information that failed was') . "<br>$sql"; } - include('includes/footer.inc'); + include ('includes/footer.inc'); exit; } - - if (DB_num_rows($result)>0) { - - $FontSize = 10; + if ($FromTransNo=='Preview' or DB_num_rows($result) > 0) { $PageNumber = 1; - - include('includes/PDFTransPageHeader.inc'); + include ('includes/PDFTransPageHeader.inc'); $FirstPage = False; - while ($myrow2=DB_fetch_array($result)) { - - if ($myrow2['discountpercent']==0) { - $DisplayDiscount =''; + $YPos = $Page_Height - $FormDesign->Data->y; + $Line=1; + while (($FromTransNo=='Preview' and $Line==1) or (isset($result) and $myrow2 = DB_fetch_array($result))) { + if ($myrow2['discountpercent'] == 0) { + $DisplayDiscount = ''; } else { - $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; - $DiscountPrice=$myrow2['fxprice']*(1-$myrow2['discountpercent']); + $DisplayDiscount = number_format($myrow2['discountpercent'] * 100, 2) . '%'; + $DiscountPrice = $myrow2['fxprice'] * (1 - $myrow2['discountpercent']); } - $DisplayNet=number_format($myrow2['fxnet'],2); - $DisplayPrice=$myrow2['fxprice']; - $DisplayQty=$myrow2['quantity']; - - $LeftOvers = $pdf->addTextWrap($Left_Margin+3,$YPos,95,$FontSize,$myrow2['stockid']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,245,$FontSize,$myrow2['description']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+353,$YPos,96,$FontSize,$DisplayPrice,'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+453,$YPos,96,$FontSize,$DisplayQty,'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+553,$YPos,35,$FontSize,$myrow2['units'],'centre'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+590,$YPos,50,$FontSize,$DisplayDiscount,'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+642,$YPos,120,$FontSize,$DisplayNet,'right'); - - $YPos -= ($line_height); - - $lines=explode('\r\n',$myrow2['narrative']); - for ($i=0;$i<sizeOf($lines);$i++) { - while (strlen($lines[$i])>1) { - if ($YPos-$line_height <= $Bottom_Margin) { + $DisplayNet = number_format($myrow2['fxnet'], 2); + $DisplayPrice = $myrow2['fxprice']; + $DisplayQty = $myrow2['quantity']; + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x, $YPos,$FormDesign->Data->Column1->Length, $FormDesign->Data->Column1->FontSize, $myrow2['stockid']); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x, $YPos,$FormDesign->Data->Column2->Length, $FormDesign->Data->Column2->FontSize, $myrow2['description']); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x, $YPos,$FormDesign->Data->Column3->Length, $FormDesign->Data->Column3->FontSize, $DisplayPrice, 'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column4->x, $YPos,$FormDesign->Data->Column4->Length, $FormDesign->Data->Column4->FontSize, $DisplayQty, 'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column5->x, $YPos,$FormDesign->Data->Column5->Length, $FormDesign->Data->Column5->FontSize, $myrow2['units'], 'centre'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column6->x, $YPos,$FormDesign->Data->Column6->Length, $FormDesign->Data->Column6->FontSize, $DisplayDiscount, 'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column7->x, $YPos,$FormDesign->Data->Column7->Length, $FormDesign->Data->Column7->FontSize, $DisplayNet, 'right'); + $YPos-= ($line_height); + $lines = explode('\r\n', $myrow2['narrative']); + for ($i = 0;$i < sizeOf($lines);$i++) { + while (strlen($lines[$i]) > 1) { + if ($YPos - $line_height <= $Bottom_Margin) { /* head up a new invoice/credit note page */ /* draw the vertical column lines right to the bottom */ - PrintLinesToBottom (); - include ('includes/PDFTransPageHeaderPortrait.inc'); - } //end if need a new page headed up - - /* increment a line down for the next line item */ - if (strlen($lines[$i])>1){ - $lines[$i] = $pdf->addTextWrap($Left_Margin+100,$YPos,245,$FontSize,stripslashes($lines[$i])); + PrintLinesToBottom($pdf, $Page_Height, $PageNumber, $FormDesign); + include ('includes/PDFTransPageHeaderPortrait.inc'); + } //end if need a new page headed up + /* increment a line down for the next line item */ + if (strlen($lines[$i]) > 1) { + $lines[$i] = $pdf->addTextWrap($Left_Margin + 100, $YPos, 245, $FontSize, stripslashes($lines[$i])); } - $YPos -= ($line_height); + $YPos-= ($line_height); } } if ($YPos <= $Bottom_Margin) { - /* head up a new invoice/credit note page */ /*draw the vertical column lines right to the bottom */ - PrintLinesToBottom (); + PrintLinesToBottom($pdf, $Page_Height, $PageNumber, $FormDesign); include ('includes/PDFTransPageHeader.inc'); } //end if need a new page headed up + $Line++; } //end while there are line items to print out - } /*end if there are stock movements to show on the invoice or credit note*/ - $YPos -= $line_height; - + } /*end if there are stock movements to show on the invoice or credit note*/ + $YPos-= $line_height; /* check to see enough space left to print the 4 lines for the totals/footer */ - if (($YPos-$Bottom_Margin)<(2*$line_height)) { - - PrintLinesToBottom (); + if (($YPos - $Bottom_Margin) < (2 * $line_height)) { + PrintLinesToBottom($pdf, $Page_Height, $PageNumber, $FormDesign); include ('includes/PDFTransPageHeader.inc'); - } /* Print a column vertical line with enough space for the footer */ /* draw the vertical column lines to 4 lines shy of the bottom to leave space for invoice footer info ie totals etc */ - $pdf->line($Left_Margin+97, $TopOfColHeadings+12,$Left_Margin+97,$Bottom_Margin+(4*$line_height)); - + $pdf->line($FormDesign->DataLines->Line1->startx, $Page_Height - $FormDesign->DataLines->Line1->starty, $FormDesign->DataLines->Line1->endx, $Page_Height - $FormDesign->DataLines->Line1->endy); /* Print a column vertical line */ - $pdf->line($Left_Margin+350, $TopOfColHeadings+12,$Left_Margin+350,$Bottom_Margin+(4*$line_height)); - + $pdf->line($FormDesign->DataLines->Line2->startx, $Page_Height - $FormDesign->DataLines->Line2->starty, $FormDesign->DataLines->Line2->endx, $Page_Height - $FormDesign->DataLines->Line2->endy); /* Print a column vertical line */ - $pdf->line($Left_Margin+450, $TopOfColHeadings+12,$Left_Margin+450,$Bottom_Margin+(4*$line_height)); - + $pdf->line($FormDesign->DataLines->Line3->startx, $Page_Height - $FormDesign->DataLines->Line3->starty, $FormDesign->DataLines->Line3->endx, $Page_Height - $FormDesign->DataLines->Line3->endy); /* Print a column vertical line */ - $pdf->line($Left_Margin+550, $TopOfColHeadings+12,$Left_Margin+550,$Bottom_Margin+(4*$line_height)); - + $pdf->line($FormDesign->DataLines->Line4->startx, $Page_Height - $FormDesign->DataLines->Line4->starty, $FormDesign->DataLines->Line4->endx, $Page_Height - $FormDesign->DataLines->Line4->endy); /* Print a column vertical line */ - $pdf->line($Left_Margin+587, $TopOfColHeadings+12,$Left_Margin+587,$Bottom_Margin+(4*$line_height)); - - $pdf->line($Left_Margin+640, $TopOfColHeadings+12,$Left_Margin+640,$Bottom_Margin+(4*$line_height)); - + $pdf->line($FormDesign->DataLines->Line5->startx, $Page_Height - $FormDesign->DataLines->Line5->starty, $FormDesign->DataLines->Line5->endx, $Page_Height - $FormDesign->DataLines->Line5->endy); + $pdf->line($FormDesign->DataLines->Line6->startx, $Page_Height - $FormDesign->DataLines->Line6->starty, $FormDesign->DataLines->Line6->endx, $Page_Height - $FormDesign->DataLines->Line6->endy); /* Rule off at bottom of the vertical lines */ - $pdf->line($Left_Margin, $Bottom_Margin+(4*$line_height),$Page_Width-$Right_Margin,$Bottom_Margin+(4*$line_height)); - + $pdf->line($FormDesign->LineAboveFooter->startx, $Page_Height - $FormDesign->LineAboveFooter->starty, $FormDesign->LineAboveFooter->endx, $Page_Height - $FormDesign->LineAboveFooter->endy); /* Now print out the footer and totals */ - - if ($InvOrCredit=='Invoice') { - - $DisplaySubTot = number_format($myrow['ovamount'],2); - $DisplayFreight = number_format($myrow['ovfreight'],2); - $DisplayTax = number_format($myrow['ovgst'],2); - $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],2); - + if ($InvOrCredit == 'Invoice') { + $DisplaySubTot = number_format($myrow['ovamount'], 2); + $DisplayFreight = number_format($myrow['ovfreight'], 2); + $DisplayTax = number_format($myrow['ovgst'], 2); + $DisplayTotal = number_format($myrow['ovfreight'] + $myrow['ovgst'] + $myrow['ovamount'], 2); } else { - - $DisplaySubTot = number_format(-$myrow['ovamount'],2); - $DisplayFreight = number_format(-$myrow['ovfreight'],2); - $DisplayTax = number_format(-$myrow['ovgst'],2); - $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],2); + $DisplaySubTot = number_format(-$myrow['ovamount'], 2); + $DisplayFreight = number_format(-$myrow['ovfreight'], 2); + $DisplayTax = number_format(-$myrow['ovgst'], 2); + $DisplayTotal = number_format(-$myrow['ovfreight'] - $myrow['ovgst'] - $myrow['ovamount'], 2); } - /* Print out the invoice text entered */ - $YPos = $Bottom_Margin+(3*$line_height); - /* Print out the payment terms */ - $pdf->addTextWrap($Left_Margin+5,$YPos+3,280,$FontSize,_('Payment Terms') . ': ' . $myrow['terms']); - // $pdf->addText($Page_Width-$Right_Margin-392, $YPos - ($line_height*3)+22,$FontSize, _('Bank Code:***** Bank Account:*****')); - // $FontSize=10; - - $FontSize =8; - $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos-12,280,$FontSize,$myrow['invtext']); - if (strlen($LeftOvers)>0) { - $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos-24,280,$FontSize,$LeftOvers); - if (strlen($LeftOvers)>0) { - $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos-36,280,$FontSize,$LeftOvers); + $pdf->addTextWrap($FormDesign->PaymentTerms->x, $Page_Height - $FormDesign->PaymentTerms->y, $FormDesign->PaymentTerms->Length, $FormDesign->PaymentTerms->FontSize, _('Payment Terms') . ': ' . $myrow['terms']); + // $pdf->addText($Page_Width-$Right_Margin-392, $YPos - ($line_height*3)+22,$FontSize, _('Bank Code:***** Bank Account:*****')); + // $FontSize=10; + $LeftOvers = $pdf->addTextWrap($FormDesign->InvoiceText->x, $Page_Height - $FormDesign->InvoiceText->y, $FormDesign->InvoiceText->Length, $FormDesign->InvoiceText->FontSize, $myrow['invtext']); + if (strlen($LeftOvers) > 0) { + $LeftOvers = $pdf->addTextWrap($FormDesign->InvoiceText->x, $Page_Height - $FormDesign->InvoiceText->y-10, $FormDesign->InvoiceText->Length, $FormDesign->InvoiceText->FontSize, $LeftOvers); + if (strlen($LeftOvers) > 0) { + $LeftOvers = $pdf->addTextWrap($FormDesign->InvoiceText->x, $Page_Height - $FormDesign->InvoiceText->y-20, $FormDesign->InvoiceText->Length, $FormDesign->InvoiceText->FontSize, $LeftOvers); /*If there is some of the InvText leftover after 3 lines 200 wide then it is not printed :( */ } } - $FontSize = 10; - - $pdf->addText($Page_Width-$Right_Margin-220, $YPos+5,$FontSize, _('Sub Total')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+642,$YPos+5,120,$FontSize,$DisplaySubTot, 'right'); - - $pdf->addText($Page_Width-$Right_Margin-220, $YPos-$line_height+5,$FontSize, _('Freight')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+642,$YPos-$line_height+5,120,$FontSize,$DisplayFreight, 'right'); - - $pdf->addText($Page_Width-$Right_Margin-220, $YPos-(2*$line_height)+5,$FontSize, _('Tax')); - $LeftOvers = $pdf->addTextWrap($Left_Margin+642,$YPos-(2*$line_height)+5,120, $FontSize,$DisplayTax, 'right'); - + $pdf->addText($FormDesign->SubTotalCaption->x, $Page_Height - $FormDesign->SubTotalCaption->y, $FormDesign->SubTotalCaption->FontSize, _('Sub Total')); + $LeftOvers = $pdf->addTextWrap($FormDesign->SubTotal->x, $Page_Height - $FormDesign->SubTotal->y, $FormDesign->SubTotal->Length, $FormDesign->SubTotal->FontSize, $DisplaySubTot, 'right'); + $pdf->addText($FormDesign->FreightCaption->x, $Page_Height - $FormDesign->FreightCaption->y, $FormDesign->FreightCaption->FontSize, _('Freight')); + $LeftOvers = $pdf->addTextWrap($FormDesign->Freight->x, $Page_Height - $FormDesign->Freight->y, $FormDesign->Freight->Length, $FormDesign->Freight->FontSize, $DisplayFreight, 'right'); + $pdf->addText($FormDesign->TaxCaption->x, $Page_Height - $FormDesign->TaxCaption->y, $FormDesign->TaxCaption->FontSize, _('Tax')); + $LeftOvers = $pdf->addTextWrap($FormDesign->Tax->x, $Page_Height - $FormDesign->Tax->y, $FormDesign->Tax->Length, $FormDesign->Tax->FontSize, $DisplayTax, 'right'); /*rule off for total */ - $pdf->line($Page_Width-$Right_Margin-222, $YPos-(2*$line_height),$Page_Width-$Right_Margin,$YPos-(2*$line_height)); - + $pdf->line($FormDesign->TotalLine->startx, $Page_Height - $FormDesign->TotalLine->starty, $FormDesign->TotalLine->endx, $Page_Height - $FormDesign->TotalLine->endy); /*vertical to separate totals from comments and ROMALPA */ - $pdf->line($Page_Width-$Right_Margin-222, $YPos+$line_height,$Page_Width-$Right_Margin-222,$Bottom_Margin); - - $YPos+=10; - if ($InvOrCredit=='Invoice') { - $pdf->addText($Page_Width-$Right_Margin-220, $YPos - ($line_height*3)-6,$FontSize, _('TOTAL INVOICE')); - $FontSize=9; - $LeftOvers = $pdf->addTextWrap($Left_Margin+300,$YPos-4,245,$FontSize,$_SESSION['RomalpaClause']); - while (strlen($LeftOvers)>0 AND $YPos > $Bottom_Margin) { - $YPos-=14; - $LeftOvers = $pdf->addTextWrap($Left_Margin+300,$YPos,245,$FontSize,$LeftOvers); + $pdf->line($FormDesign->RomalpaLine->startx, $Page_Height - $FormDesign->RomalpaLine->starty, $FormDesign->RomalpaLine->endx, $Page_Height - $FormDesign->RomalpaLine->endy); + if ($InvOrCredit == 'Invoice') { + $pdf->addText($FormDesign->TotalCaption->x, $Page_Height - $FormDesign->TotalCaption->y, $FormDesign->TotalCaption->FontSize, _('TOTAL INVOICE')); + $YPos=$FormDesign->Romalpa->y; + $LeftOvers = $pdf->addTextWrap($FormDesign->Romalpa->x, $Page_Height - $YPos, $FormDesign->Romalpa->Length, $FormDesign->Romalpa->FontSize, $_SESSION['RomalpaClause']); + while (strlen($LeftOvers) > 0 AND ($Page_Height - $YPos) > $Bottom_Margin) { + $YPos+= $FormDesign->Romalpa->FontSize+1; + $LeftOvers = $pdf->addTextWrap($FormDesign->Romalpa->x, $Page_Height - $YPos, $FormDesign->Romalpa->Length, $FormDesign->Romalpa->FontSize, $LeftOvers); } /* Add Images for Visa / Mastercard / Paypal */ if (file_exists('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg')) { - $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg',$Page_Width/2 -280,$YPos-20,0,40); + $pdf->addJpegFromFile('companies/' . $_SESSION['DatabaseName'] . '/payment.jpg', $FormDesign->CreditCardLogo->x,$Page_Height -$FormDesign->CreditCardLogo->y,$FormDesign->CreditCardLogo->width,$FormDesign->CreditCardLogo->height); } - $pdf->addText($Page_Width-$Right_Margin-472, $YPos - ($line_height*3)+32,$FontSize, ''); - $FontSize=10; +// $pdf->addText($Page_Width - $Right_Margin - 472, $YPos - ($line_height * 3) + 32, $FontSize, ''); } else { - $pdf->addText($Page_Width-$Right_Margin-220, $YPos-($line_height*3),$FontSize, _('TOTAL CREDIT')); - } - $LeftOvers = $pdf->addTextWrap($Left_Margin+642,35,120, $FontSize,$DisplayTotal, 'right'); + $pdf->addText($FormDesign->TotalCaption->x, $Page_Height - $FormDesign->TotalCaption->y, $FormDesign->TotalCaption->FontSize, _('TOTAL CREDIT')); + } + $LeftOvers = $pdf->addTextWrap($FormDesign->Total->x, $Page_Height - $FormDesign->Total->y, $FormDesign->Total->Length, $FormDesign->Total->FontSize, $DisplayTotal, 'right'); } /* end of check to see that there was an invoice record to print */ - $FromTransNo++; - } /* end loop to print invoices */ - - // Start FPDI concatination to append PDF files conditionally to the invoice - // This part taken from FPDI example page -not used yet since change to TCPDF Dec 2009 - class concat_pdf extends FPDI { - - var $files = array(); - - function setFiles($files) { - $this->files = $files; - } - - function concat() { - foreach($this->files as $file) { - if ($file != 'pdf_append/none') { - $pagecount = $this->setSourceFile($file); - for ($i = 1; $i <= $pagecount; $i++) { - $tplidx = $this->ImportPage($i); - $s = $this->getTemplatesize($tplidx); - $this->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); - $this->useTemplate($tplidx); - } + } +} /* end loop to print invoices */ +// Start FPDI concatination to append PDF files conditionally to the invoice +// This part taken from FPDI example page -not used yet since change to TCPDF Dec 2009 +class concat_pdf extends FPDI { + var $files = array(); + function setFiles($files) { + $this->files = $files; + } + function concat() { + foreach($this->files as $file) { + if ($file != 'pdf_append/none') { + $pagecount = $this->setSourceFile($file); + for ($i = 1;$i <= $pagecount;$i++) { + $tplidx = $this->ImportPage($i); + $s = $this->getTemplatesize($tplidx); + $this->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); + $this->useTemplate($tplidx); } } } } - - // $pdf =& new concat_pdf(); - - // Have to get the TransNo again, GET[FromTransNo] is updated on each pass of loop - if (isset($_GET['FromTransNo'])) { - $FromTransNo = trim($_GET['FromTransNo']); - } elseif (isset($_POST['FromTransNo'])) { - $FromTransNo = trim($_POST['FromTransNo']); - } - - if ($InvOrCredit=='Invoice') { - $sql = 'SELECT stockmoves.stockid, stockmaster.appendfile +} +// $pdf =& new concat_pdf(); +// Have to get the TransNo again, GET[FromTransNo] is updated on each pass of loop +if (isset($_GET['FromTransNo'])) { + $FromTransNo = trim($_GET['FromTransNo']); +} elseif (isset($_POST['FromTransNo'])) { + $FromTransNo = trim($_POST['FromTransNo']); +} +if ($InvOrCredit == 'Invoice') { + $sql = 'SELECT stockmoves.stockid, stockmaster.appendfile FROM stockmoves, stockmaster WHERE stockmoves.stockid = stockmaster.stockid AND stockmoves.type=10 AND stockmoves.transno=' . $FromTransNo . ' AND stockmoves.show_on_inv_crds=1'; -// }; - - $result=DB_query($sql,$db); - // Loop the result set and add appendfile if the field is not 0 or none - while ($row=DB_fetch_array($result)) { - if ($row['appendfile'] !='0' AND $row['appendfile'] !=='none') { - $pdf->setFiles(array($_SESSION['reports_dir'] . '/Invoice.pdf','companies/' . $_SESSION['DatabaseName'] . '/pdf_append/' . $row['appendfile'])); + // }; + if ($FromTransNo!='Preview') { + $result = DB_query($sql, $db); + } + // Loop the result set and add appendfile if the field is not 0 or none + while (isset($result) and $row = DB_fetch_array($result)) { + if ($row['appendfile'] != '0' AND $row['appendfile'] !== 'none') { + $pdf->setFiles(array($_SESSION['reports_dir'] . '/Invoice.pdf', 'companies/' . $_SESSION['DatabaseName'] . '/pdf_append/' . $row['appendfile'])); $pdf->concat(); - $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf','I'); + $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf', 'I'); exit; // If EMAIL is selected, send the invoice via email, this is not appending pages yet though + } elseif (isset($_GET['Email'])) { - $pdf->Output($_SESSION['reports_dir'] . '/Invoice.pdf','F'); + $pdf->Output($_SESSION['reports_dir'] . '/Invoice.pdf', 'F'); } else { // If the appendfile field is empty and EMAIL is not selected, just print the invoice without any appended pages - $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf','I'); + $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf', 'I'); exit; } } //End FPDI Concat - - - if (isset($_GET['Email'])){ //email the invoice to address supplied - include('includes/header.inc'); - + if (isset($_GET['Email'])) { //email the invoice to address supplied + include ('includes/header.inc'); include ('includes/htmlMimeMail.php'); - $mail = new htmlMimeMail(); $filename = $_SESSION['reports_dir'] . '/Invoice.pdf'; - $fp = fopen( $_SESSION['reports_dir'] . '/Invoice.pdf','wb'); - fwrite ($fp, $pdfcode); - fclose ($fp); - + $fp = fopen($_SESSION['reports_dir'] . '/Invoice.pdf', 'wb'); + fwrite($fp, $pdfcode); + fclose($fp); $attachment = $mail->getFile($filename); - $mail->setText(_('Please find attached') . ' ' . $InvOrCredit . ' ' . $_GET['FromTransNo'] ); + $mail->setText(_('Please find attached') . ' ' . $InvOrCredit . ' ' . $_GET['FromTransNo']); $mail->SetSubject($InvOrCredit . ' ' . $_GET['FromTransNo']); $mail->addAttachment($attachment, $filename, 'application/pdf'); $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . ' <' . $_SESSION['CompanyRecord']['email'] . '>'); $result = $mail->send(array($_GET['Email'])); - unlink($filename); //delete the temporary file - - $title = _('Emailing') . ' ' .$InvOrCredit . ' ' . _('Number') . ' ' . $FromTransNo; - include('includes/header.inc'); + $title = _('Emailing') . ' ' . $InvOrCredit . ' ' . _('Number') . ' ' . $FromTransNo; + include ('includes/header.inc'); echo "<p>$InvOrCredit " . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('has been emailed to') . ' ' . $_GET['Email']; - include('includes/footer.inc'); + include ('includes/footer.inc'); exit; - } else { - $pdf->OutputD('PrintCustTrans.pdf'); - $pdf-> __destruct(); + $pdf->__destruct(); } - } else { /*The option to print PDF was not hit */ - - $title=_('Select Invoices/Credit Notes To Print'); - include('includes/header.inc'); - - if (!isset($FromTransNo) OR $FromTransNo=='') { - + $title = _('Select Invoices/Credit Notes To Print'); + include ('includes/header.inc'); + 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'] . '?' . SID . "' method='POST'><table class='table1'>"; - 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 '<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 '<tr><td>' . _('Print Invoices or Credit Notes') . '</td><td><select name=InvOrCredit>'; - if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)) { - + if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { echo "<option selected VALUE='Invoice'>" . _('Invoices'); echo "<option VALUE='Credit'>" . _('Credit Notes'); - } else { - echo "<option selected VALUE='Credit'>" . _('Credit Notes'); echo "<option VALUE='Invoice'>" . _('Invoices'); } - echo '</select></td></tr>'; echo '<tr><td>' . _('Print EDI Transactions') . '</td><td><select name=PrintEDI>'; - - if ($InvOrCredit=='Invoice' OR !isset($InvOrCredit)) { - + if ($InvOrCredit == 'Invoice' OR !isset($InvOrCredit)) { echo "<option selected VALUE='No'>" . _('Do not Print PDF EDI Transactions'); echo "<option VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); - } else { - echo "<option VALUE='No'>" . _('Do not Print PDF EDI Transactions'); echo "<option selected VALUE='Yes'>" . _('Print PDF EDI Transactions Too'); } - 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>'; 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></table>"; 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'; - - $result = DB_query($sql,$db); + $result = DB_query($sql, $db); $myrow = DB_fetch_row($result); - echo '<div class="page_help_text"><b>' . _('The last invoice created was number') . ' ' . $myrow[0] . '</b><br>' . _('If only a single invoice is required') . ', ' . _('enter the invoice number to print in the Start transaction number to print field and leave the End transaction number to print field blank') . '. ' . _('Only use the end invoice to print field if you wish to print a sequential range of invoices') . ''; - $sql = 'SELECT typeno FROM systypes WHERE typeid=11'; - - $result = DB_query($sql,$db); + $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'; - } else { - while ($FromTransNo <= $_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 nobble the invoice reprints */ - - if ($InvOrCredit=='Invoice') { - + if ($InvOrCredit == 'Invoice') { $sql = "SELECT debtortrans.trandate, debtortrans.ovamount, @@ -641,7 +536,6 @@ AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode"; } else { - $sql = 'SELECT debtortrans.trandate, debtortrans.ovamount, debtortrans.ovdiscount, @@ -677,37 +571,31 @@ AND debtortrans.branchcode=custbranch.branchcode AND custbranch.salesman=salesman.salesmancode'; } - - $result=DB_query($sql,$db); - if (DB_num_rows($result)==0 OR DB_error_no($db)!=0) { + $result = DB_query($sql, $db); + if (DB_num_rows($result) == 0 OR DB_error_no($db) != 0) { echo '<p>' . _('There was a problem retrieving the invoice or credit note details for note number') . ' ' . $InvoiceToPrint . ' ' . _('from the database') . '. ' . _('To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged') . '. ' . _('To print a credit note only requires the customer, transaction, salesman and branch records be available'); - if ($debug==1) { + if ($debug == 1) { echo _('The SQL used to get this information that failed was') . "<br>$sql"; } break; - include('includes/footer.inc'); + include ('includes/footer.inc'); exit; - } elseif (DB_num_rows($result)==1) { - + } elseif (DB_num_rows($result) == 1) { $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']){ + 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; } - $ExchRate = $myrow['rate']; $PageNumber = 1; - echo "<table class='table1'><tr><td VALIGN=TOP WIDTH=10%><img src='" . $_SESSION['LogoFile'] . "'></td><td bgcolor='#BBBBBB'><b>"; - - if ($InvOrCredit=='Invoice') { - echo '<font size=4>' . _('TAX INVOICE') . ' '; + if ($InvOrCredit == '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>'; - /* Now print out the logo and company name and address */ echo "<table class='table1'><tr><td><font size=4 color='#333333'><b>" . $_SESSION['CompanyRecord']['coyname'] . "</b></font><br>"; echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; @@ -719,11 +607,8 @@ echo _('Telephone') . ': ' . $_SESSION['CompanyRecord']['telephone'] . '<br>'; echo _('Facsimile') . ': ' . $_SESSION['CompanyRecord']['fax'] . '<br>'; echo _('Email') . ': ' . $_SESSION['CompanyRecord']['email'] . '<br>'; - 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'>"; echo $myrow['name'] . '<br>' . $myrow['address1'] . '<br>' . $myrow['address2'] . '<br>' . $myrow['address3'] . '<br>' . $myrow['address4'] . '<br>' . $myrow['address5'] . '<br>' . $myrow['address6']; echo '</td></tr></table>'; @@ -731,22 +616,18 @@ echo _('Page') . ': ' . $PageNumber; echo '</td></tr></table>'; /*end of the main table showing the company name and charge to details */ - - if ($InvOrCredit=='Invoice') { - - echo "<table class='table1'> + if ($InvOrCredit == 'Invoice') { + echo "<table class='table1'> <tr> <td align=left bgcolor='#BBBBBB'><b>" . _('Charge Branch') . ":</b></td> <td align=left bgcolor='#BBBBBB'><b>" . _('Delivered To') . ":</b></td> </tr>"; - echo "<tr> - <td bgcolor='#EEEEEE'>" .$myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td>'; - - echo "<td bgcolor='#EEEEEE'>" . $myrow['deliverto'] . '<br>' . $myrow['deladd1'] . '<br>' . $myrow['deladd2'] . '<br>' . $myrow['deladd3'] . '<br>' . $myrow['deladd4'] . '<br>' . $myrow['deladd5'] . '<br>' . $myrow['deladd6'] . '</td>'; - echo '</tr> + echo "<tr> + <td bgcolor='#EEEEEE'>" . $myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td>'; + echo "<td bgcolor='#EEEEEE'>" . $myrow['deliverto'] . '<br>' . $myrow['deladd1'] . '<br>' . $myrow['deladd2'] . '<br>' . $myrow['deladd3'] . '<br>' . $myrow['deladd4'] . '<br>' . $myrow['deladd5'] . '<br>' . $myrow['deladd6'] . '</td>'; + echo '</tr> </table><hr>'; - - echo "<table class='table1'> + echo "<table class='table1'> <tr> <td align=left bgcolor='#BBBBBB'><b>" . _('Your Order Ref') . "</b></td> <td align=left bgcolor='#BBBBBB'><b>" . _('Our Order No') . "</b></td> @@ -756,9 +637,9 @@ <td align=left bgcolor='#BBBBBB'><b>" . _('Shipper') . "</b></td> <td align=left bgcolor='#BBBBBB'><b>" . _('Consignment Ref') . "</b></td> </tr>"; - echo "<tr> + echo "<tr> <td bgcolor='#EEEEEE'>" . $myrow['customerref'] . "</td> - <td bgcolor='#EEEEEE'>" .$myrow['orderno'] . "</td> + <td bgcolor='#EEEEEE'>" . $myrow['orderno'] . "</td> <td bgcolor='#EEEEEE'>" . ConvertSQLDate($myrow['orddate']) . "</td> <td bgcolor='#EEEEEE'>" . ConvertSQLDate($myrow['trandate']) . "</td> <td bgcolor='#EEEEEE'>" . $myrow['salesmanname'] . "</td> @@ -766,8 +647,7 @@ <td bgcolor='#EEEEEE'>" . $myrow['consignment'] . "</td> </tr> </table>"; - - $sql ="SELECT stockmoves.stockid, + $sql = "SELECT stockmoves.stockid, stockmaster.description, -stockmoves.qty as quantity, stockmoves.discountpercent, @@ -781,25 +661,22 @@ AND stockmoves.type=10 AND stockmoves.transno=' . $FromTransNo . ' AND stockmoves.show_on_inv_crds=1'; - } else { /* then its a credit note */ - - echo "<table WIDTH=50%><tr> + echo "<table WIDTH=50%><tr> <td align=left bgcolor='#BBBBBB'><b>" . _('Branch') . ":</b></td> </tr>"; - echo "<tr> - <td bgcolor='#EEEEEE'>" .$myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td> + echo "<tr> + <td bgcolor='#EEEEEE'>" . $myrow['brname'] . '<br>' . $myrow['braddress1'] . '<br>' . $myrow['braddress2'] . '<br>' . $myrow['braddress3'] . '<br>' . $myrow['braddress4'] . '<br>' . $myrow['braddress5'] . '<br>' . $myrow['braddress6'] . '</td> </tr></table>'; - echo "<hr><table class='table1'><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> + echo "<tr> <td bgcolor='#EEEEEE'>" . ConvertSQLDate($myrow['trandate']) . "</td> <td bgcolor='#EEEEEE'>" . $myrow['salesmanname'] . '</td> </tr></table>'; - - $sql ='SELECT stockmoves.stockid, + $sql = 'SELECT stockmoves.stockid, stockmaster.description, stockmoves.qty as quantity, stockmoves.discountpercent, ((1 - stockmoves.discountpercent) * stockmoves.price * ' . $ExchRate . ' * stockmoves.qty) AS fxnet, @@ -812,20 +689,17 @@ AND stockmoves.transno=' . $FromTransNo . ' AND stockmoves.show_on_inv_crds=1'; } - echo '<hr>'; echo '<div class="centre"><font size=2>' . _('All amounts stated in') . ' ' . $myrow['currcode'] . '</font></div>'; - - $result=DB_query($sql,$db); - if (DB_error_no($db)!=0) { + $result = DB_query($sql, $db); + if (DB_error_no($db) != 0) { echo '<br>' . _('There was a problem retrieving the invoice or credit note stock movement details for invoice number') . ' ' . $FromTransNo . ' ' . _('from the database'); - if ($debug==1){ - echo '<br>' . _('The SQL used to get this information that failed was') . "<br>$sql"; + if ($debug == 1) { + echo '<br>' . _('The SQL used to get this information that failed was') . "<br>$sql"; } exit; } - - if (DB_num_rows($result)>0){ + if (DB_num_rows($result) > 0) { echo "<table class='table1'> <tr><th>" . _('Item Code') . "</th> <th>" . _('Item Description') . "</th> @@ -834,83 +708,62 @@ <th>" . _('Price') . "</th> <th>" . _('Discount') . "</th> <th>" . _('Net') . '</th></tr>'; - - $LineCounter =17; - $k=0; //row colour counter - - while ($myrow2=DB_fetch_array($result)){ - - if ($k==1){ - $RowStarter = '<tr class="EvenTableRows">'; - $k=0; - } else { - $RowStarter = '<tr class="OddTableRows">'; - $k=1; - } - - echo $RowStarter; - - $DisplayPrice = number_format($myrow2['fxprice'],2); - $DisplayQty = number_format($myrow2['quantity'],2); - $DisplayNet = number_format($myrow2['fxnet'],2); - - if ($myrow2['discountpercent']==0){ - $DisplayDiscount =''; - } else { - $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; - } - - printf ('<td>%s</td> + $LineCounter = 17; + $k = 0; //row colour counter + while ($myrow2 = DB_fetch_array($result)) { + if ($k == 1) { + $RowStarter = '<tr class="EvenTableRows">'; + $k = 0; + } else { + $RowStarter = '<tr class="OddTableRows">'; + $k = 1; + } + echo $RowStarter; + $DisplayPrice = number_format($myrow2['fxprice'], 2); + $DisplayQty = number_format($myrow2['quantity'], 2); + $DisplayNet = number_format($myrow2['fxnet'], 2); + if ($myrow2['discountpercent'] == 0) { + $DisplayDiscount = ''; + } else { + $DisplayDiscount = 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); - - if (strlen($myrow2['narrative'])>1){ - echo $RowStarter . '<td></td><td colspan=6>' . $myrow2['narrative'] . '</td></tr>'; + </tr>', $myrow2['stockid'], $myrow2['description'], $DisplayQty, $myrow2['units'], $DisplayPrice, $DisplayDiscount, $DisplayNet); + if (strlen($myrow2['narrative']) > 1) { + echo $RowStarter . '<td></td><td colspan=6>' . $myrow2['narrative'] . '</td></tr>'; $LineCounter++; - } - - $LineCounter++; - - if ($LineCounter == ($_SESSION['PageLength'] - 2)){ - - /* 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='#BBBBBB'><b>"; - - if ($InvOrCredit=='Invoice') { - echo '<font size=4>' . _('TAX INVOICE') . ' '; - } else { - 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>'; - - /*Now print out company name and address */ - echo "<table class='table1'><tr> + } + $LineCounter++; + if ($LineCounter == ($_SESSION['PageLength'] - 2)) { + /* 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='#BBBBBB'><b>"; + if ($InvOrCredit == 'Invoice') { + echo '<font size=4>' . _('TAX INVOICE') . ' '; + } else { + 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>'; + /*Now print out company name and address */ + echo "<table class='table1'><tr> <td><font size=4 color='#333333'><b>" . $_SESSION['CompanyRecord']['coyname'] . '</b></font><br>'; - echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; - echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; - 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 "<table class='table1'><tr> + echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice2'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice3'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice4'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice5'] . '<br>'; + echo $_SESSION['CompanyRecord']['regoffice6'] . '<br>'; + 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 "<table class='table1'><tr> <th>" . _('Item Code') . "</th> <th>" . _('Item Description') . "</th> <th>" . _('Quantity') . "</th> @@ -918,30 +771,24 @@ <th>" . _('Price') . "</th> <th>" . _('Discount') . "</th> <th>" . _('Net') . "</th></tr>"; + $LineCounter = 10; + } //end if need a new page headed up - $LineCounter = 10; - - } //end if need a new page headed up } //end while there are line items to print out echo '</table>'; } /*end if there are stock movements to show on the invoice or credit note*/ - /* check to see enough space left to print the totals/footer */ - $LinesRequiredForText = floor(strlen($myrow['invtext'])/140); - - if ($LineCounter >= ($_SESSION['PageLength'] - 8 - $LinesRequiredForText)){ - + $LinesRequiredForText = floor(strlen($myrow['invtext']) / 140); + if ($LineCounter >= ($_SESSION['PageLength'] - 8 - $LinesRequiredForText)) { /* head up a new invoice/credit note page */ $PageNumber++; echo "<table class='table1'><tr><td VALIGN=TOp><img src='" . $_SESSION['LogoFile'] . "'></td><td bgcolor='#BBBBBB'><b>"; - - if ($InvOrCredit=='Invoice') { - echo '<font size=4>' . _('TAX INVOICE') .' '; + if ($InvOrCredit == '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>'; - /* Print out the logo and company name and address */ echo "<table class='table1'><tr><td><font size=4 color='#333333'><b>" . $_SESSION['CompanyRecord']['coyname'] . "</b></font><br>"; echo $_SESSION['CompanyRecord']['regoffice1'] . '<br>'; @@ -962,35 +809,27 @@ <th>" . _('Price') . "</th> <th>" . _('Discount') . "</th> <th>" . _('Net') . '</th></tr>'; - $LineCounter = 10; } - /* Space out the footer to the bottom of the page */ - echo '<br><br>' . $myrow['invtext']; - - $LineCounter=$LineCounter+2+$LinesRequiredForText; - while ($LineCounter < ($_SESSION['PageLength'] -6)){ + $LineCounter = $LineCounter + 2 + $LinesRequiredForText; + while ($LineCounter < ($_SESSION['PageLength'] - 6)) { echo '<br>'; $LineCounter++; } - /* Now print out the footer and totals */ - - if ($InvOrCredit=='Invoice') { - - $DisplaySubTot = number_format($myrow['ovamount'],2); - $DisplayFreight = number_format($myrow['ovfreight'],2); - $DisplayTax = number_format($myrow['ovgst'],2); - $DisplayTotal = number_format($myrow['ovfreight']+$myrow['ovgst']+$myrow['ovamount'],2); + if ($InvOrCredit == 'Invoice') { + $DisplaySubTot = number_format($myrow['ovamount'], 2); + $DisplayFreight = number_format($myrow['ovfreight'], 2); + $DisplayTax = number_format($myrow['ovgst'], 2); + $DisplayTotal = number_format($myrow['ovfreight'] + $myrow['ovgst'] + $myrow['ovamount'], 2); } else { - $DisplaySubTot = number_format(-$myrow['ovamount'],2); - $DisplayFreight = number_format(-$myrow['ovfreight'],2); - $DisplayTax = number_format(-$myrow['ovgst'],2); - $DisplayTotal = number_format(-$myrow['ovfreight']-$myrow['ovgst']-$myrow['ovamount'],2); + $DisplaySubTot = number_format(-$myrow['ovamount'], 2); + $DisplayFreight = number_format(-$myrow['ovfreight'], 2); + $DisplayTax = number_format(-$myrow['ovgst'], 2); + $DisplayTotal = number_format(-$myrow['ovfreight'] - $myrow['ovgst'] - $myrow['ovamount'], 2); } - /*Print out the invoice text entered */ echo '<table class=table1><tr> <td class=number>' . _('Sub Total') . "</td> @@ -999,11 +838,11 @@ <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> + 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>"; } else { - echo '<tr><td class=number><font color=RED><b>' . _('TOTAL CREDIT') . "</b></font></td> + 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>'; @@ -1011,39 +850,21 @@ $FromTransNo++; } /* end loop to print invoices */ } /*end of if FromTransNo exists */ - include('includes/footer.inc'); + include ('includes/footer.inc'); } /*end of else not PrintPDF */ - - -function PrintLinesToBottom () { - - global $pdf; - global $PageNumber; - global $TopOfColHeadings; - global $Left_Margin; - global $Bottom_Margin; - global $line_height; - +function PrintLinesToBottom($pdf, $Page_Height, $PageNumber, $FormDesign) { /* draw the vertical column lines right to the bottom */ - $pdf->line($Left_Margin+97, $TopOfColHeadings+12,$Left_Margin+97,$Bottom_Margin); - + $pdf->line($FormDesign->DataLines->Line1->startx, $Page_Height - $FormDesign->DataLines->Line1->starty, $FormDesign->DataLines->Line1->endx, $Page_Height - $FormDesign->DataLines->Line1->endy); /* Print a column vertical line */ - $pdf->line($Left_Margin+350, $TopOfColHeadings+12,$Left_Margin+350,$Bottom_Margin); - + $pdf->line($FormDesign->DataLines->Line2->startx, $Page_Height - $FormDesign->DataLines->Line2->starty, $FormDesign->DataLines->Line2->endx, $Page_Height - $FormDesign->DataLines->Line2->endy); /* Print a column vertical line */ - $pdf->line($Left_Margin+450, $TopOfColHeadings+12,$Left_Margin+450,$Bottom_Margin); - + $pdf->line($FormDesign->DataLines->Line3->startx, $Page_Height - $FormDesign->DataLines->Line3->starty, $FormDesign->DataLines->Line3->endx, $Page_Height - $FormDesign->DataLines->Line3->endy); /* Print a column vertical line */ - $pdf->line($Left_Margin+550, $TopOfColHeadings+12,$Left_Margin+550... [truncated message content] |
From: <tim...@us...> - 2010-02-08 14:40:02
|
Revision: 3340 http://web-erp.svn.sourceforge.net/web-erp/?rev=3340&view=rev Author: tim_schofield Date: 2010-02-08 14:39:54 +0000 (Mon, 08 Feb 2010) Log Message: ----------- Change the default font family to Arial Modified Paths: -------------- trunk/css/default/default.css trunk/css/fresh/default.css trunk/css/gel/default.css trunk/css/jelly/default.css trunk/css/professional/default.css trunk/css/professional-rtl/default.css trunk/css/silverwolf/default.css trunk/doc/Change.log.html Modified: trunk/css/default/default.css =================================================================== --- trunk/css/default/default.css 2010-02-08 14:18:40 UTC (rev 3339) +++ trunk/css/default/default.css 2010-02-08 14:39:54 UTC (rev 3340) @@ -18,7 +18,7 @@ /* $Id$*/ body { - font-family: Verdana, Arial, Helvetica, sans-serif; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 14px; background-color: #CCCCDD; margin-left: 5px; @@ -34,7 +34,7 @@ /*links before selection */ a { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; text-decoration: none; @@ -64,7 +64,7 @@ /*table detail items default format */ td { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; text-align: left; } @@ -72,9 +72,9 @@ .dpTD { border: 0; width:20px; - background-color: #EEEEEE; + background-color: #EEEEEE; text-align:right; - cursor:pointer; + cursor:pointer; } .dpDayHighlight { @@ -82,7 +82,7 @@ width:20px; background-color: yellow; text-align:right; - cursor:pointer; + cursor:pointer; } .dpTDHover { @@ -90,7 +90,7 @@ width:20px; background-color: #CCCCCC; text-align:right; - cursor:pointer; + cursor:pointer; } td.number { @@ -136,7 +136,7 @@ } input { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -148,7 +148,7 @@ } select { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -216,7 +216,7 @@ } textarea{ - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -254,7 +254,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -263,7 +263,7 @@ } .callout_main { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; background-color: white; border: none; width: 100%; @@ -302,7 +302,7 @@ /*The main page heading left part before quick menu */ .quick_menu_left { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; border: 0px; @@ -450,7 +450,7 @@ } span.main_menu_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #777777; @@ -484,7 +484,7 @@ } .menu_group_area { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 14px; border: 2px inset white; color: #cc6600; @@ -506,7 +506,7 @@ } .menu_group_headers_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: white; @@ -535,7 +535,7 @@ } .page_title_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 2px; padding-bottom: 2px; font-weight: bold; @@ -547,7 +547,7 @@ DIV.page_help_text { background: lightgrey url(images/help.png) top left no-repeat; BORDER: #a52a2a 1px solid; - padding-top:2px; + padding-top:2px; padding-bottom: 2px; PADDING-LEFT: 10px; Z-INDEX: 1; @@ -556,7 +556,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-weight: normal; font-size: 10px; color: black; @@ -573,7 +573,7 @@ MARGIN: 0 auto; POSITION: static; background: lightgray; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -583,7 +583,7 @@ } span.menu_group_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #777777; @@ -604,21 +604,21 @@ } a.footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; font-size: 8px; } .footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; color: #CCCCCC; font-weight: normal; font-size: 9px; t - + .legal { - font-family: Arial, Helvetica, sans-serif; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 9px; color: #333333; } Modified: trunk/css/fresh/default.css =================================================================== --- trunk/css/fresh/default.css 2010-02-08 14:18:40 UTC (rev 3339) +++ trunk/css/fresh/default.css 2010-02-08 14:39:54 UTC (rev 3340) @@ -17,9 +17,9 @@ /* $Id$*/ body { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif;; font-size: 12px; - background-color: #F1FFDD; + background-color: #F1FFDD; margin-left: 10px; margin-top: 5px; margin-bottom: 0px; @@ -33,7 +33,7 @@ /*links before selection */ a { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif;; font-size: 12px; font-weight: bold; text-decoration: none; @@ -62,7 +62,7 @@ /*table detail items default format */ td { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif;; font-size: 12px; text-align: left; } @@ -70,9 +70,9 @@ .dpTD { border: 0; width:20px; - background-color: #EEEEEE; + background-color: #EEEEEE; text-align:right; - cursor:pointer; + cursor:pointer; } .dpDayHighlight { @@ -80,7 +80,7 @@ width:20px; background-color: yellow; text-align:right; - cursor:pointer; + cursor:pointer; } .dpTDHover { @@ -88,7 +88,7 @@ width:20px; background-color: #CCCCCC; text-align:right; - cursor:pointer; + cursor:pointer; } td.number { @@ -136,7 +136,7 @@ } input { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif;; font-size: 12px; } @@ -148,7 +148,7 @@ } select { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif;; font-size: 12px; } @@ -218,7 +218,7 @@ } textarea{ - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -255,7 +255,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -264,7 +264,7 @@ } .callout_main { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; background-color: #ffffff; border: none; width: 100%; @@ -303,7 +303,7 @@ /*The main page heading left part before quick menu */ .quick_menu_left { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 11px; border: 0px; white-space: nowrap; @@ -432,7 +432,7 @@ } span.main_menu_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #777777; @@ -481,7 +481,7 @@ } .menu_group_headers_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: black; @@ -507,7 +507,7 @@ } .page_title_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 2px; padding-bottom: 2px; font-weight: bold; @@ -519,7 +519,7 @@ DIV.page_help_text { background: lightgrey url(images/help.png) top left no-repeat; BORDER: #a52a2a 1px solid; - padding-top:2px; + padding-top:2px; padding-bottom: 2px; PADDING-LEFT: 10px; Z-INDEX: 1; @@ -528,7 +528,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-weight: normal; font-size: 10px; color: black; @@ -545,7 +545,7 @@ MARGIN: 0 auto; POSITION: static; background: lightgray; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -555,7 +555,7 @@ } span.menu_group_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #777777; @@ -577,14 +577,14 @@ } a.footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; font-size: 8px; } .footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; font-size: 8px; Modified: trunk/css/gel/default.css =================================================================== --- trunk/css/gel/default.css 2010-02-08 14:18:40 UTC (rev 3339) +++ trunk/css/gel/default.css 2010-02-08 14:39:54 UTC (rev 3340) @@ -18,7 +18,7 @@ /* $Id$*/ body { - font-family: Verdana, Arial, Helvetica, sans-serif; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 10px; background-color: #fff; margin-left: 0px; @@ -34,7 +34,7 @@ /*links before selection */ a { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: normal; text-decoration: none; @@ -45,7 +45,7 @@ a:hover { color: #0000AA; text-decoration: none; - + } input:hover{ background: url(images/inputh.png) #eee; @@ -83,7 +83,7 @@ /*table detail items default format */ td { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; text-align: left; } @@ -91,9 +91,9 @@ .dpTD { border: 0; width:20px; - background-color: #EEEEEE; + background-color: #EEEEEE; text-align:right; - cursor:pointer; + cursor:pointer; } .dpDayHighlight { @@ -101,7 +101,7 @@ width:20px; background-color: yellow; text-align:right; - cursor:pointer; + cursor:pointer; } .dpTDHover { @@ -109,7 +109,7 @@ width:20px; background-color: #CCCCCC; text-align:right; - cursor:pointer; + cursor:pointer; } td.number { @@ -161,7 +161,7 @@ background: url(images/input.png) #eee; color:#000; border: 0px 0px 1px 1px #000 dashed; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -174,7 +174,7 @@ select {background:#eee; color:#111; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -246,7 +246,7 @@ background: url(images/input.png) #eee; color:#000; border: 0px 0px 1px 1px #000 dashed; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -283,7 +283,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -292,7 +292,7 @@ } .callout_main { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; background-color: white; border: none; width: 100%; @@ -331,7 +331,7 @@ /*The main page heading left part before quick menu */ .quick_menu_left { background: none; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; border: none; @@ -458,7 +458,7 @@ .main_menu_selected { background: #00f url(images/gelblue.png) 0px -1px repeat-x; /*border: 0px solid #888;*/ -/* position: relative; */ +/* position: relative; */ text-align: center; white-space: nowrap; border: 3px solid #dee; @@ -475,7 +475,7 @@ } span.main_menu_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #fff; @@ -521,7 +521,7 @@ } .menu_group_headers_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: black; @@ -545,7 +545,7 @@ } .page_title_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 2px; padding-bottom: 2px; font-weight: bold; @@ -557,7 +557,7 @@ DIV.page_help_text { background: lightgrey url(images/help.png) top left no-repeat; BORDER: #a52a2a 1px solid; - padding-top:2px; + padding-top:2px; padding-bottom: 2px; PADDING-LEFT: 10px; Z-INDEX: 1; @@ -566,7 +566,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-weight: normal; font-size: 10px; color: black; @@ -583,7 +583,7 @@ MARGIN: 0 auto; POSITION: static; background: lightgray; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -593,7 +593,7 @@ } span.menu_group_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #777777; @@ -616,14 +616,14 @@ } a.footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; font-size: 8px; } .footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; font-size: 8px; Modified: trunk/css/jelly/default.css =================================================================== --- trunk/css/jelly/default.css 2010-02-08 14:18:40 UTC (rev 3339) +++ trunk/css/jelly/default.css 2010-02-08 14:39:54 UTC (rev 3340) @@ -18,7 +18,7 @@ /* $Id$*/ body { - font-family: Verdana, Arial, Helvetica, sans-serif; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 10px; background: #fff; margin-left: 0px; @@ -33,7 +33,7 @@ } /*links before selection */ a { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: normal; text-decoration: none; @@ -44,7 +44,7 @@ a:hover { color: #0000AA; text-decoration: none; - + } /* Table type is used for default tables*/ @@ -66,7 +66,7 @@ /*table detail items default format */ td { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; text-align:left; } @@ -74,9 +74,9 @@ .dpTD { border: 0; width:20px; - background: #EEEEEE; + background: #EEEEEE; text-align:right; - cursor:pointer; + cursor:pointer; } .dpDayHighlight { @@ -84,7 +84,7 @@ width:20px; background: yellow; text-align:right; - cursor:pointer; + cursor:pointer; } .dpTDHover { @@ -92,7 +92,7 @@ width:20px; background: #CCCCCC; text-align:right; - cursor:pointer; + cursor:pointer; } td.number { @@ -118,7 +118,7 @@ div.error { background:red; color: white; - font-style: italic; + font-style: italic; font-weight:bold; border: 3px solid red; PADDING-LEFT: 3px; @@ -146,7 +146,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 2px; padding-bottom: 2px; font-weight: normal; @@ -167,7 +167,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-weight: normal; font-size: 10px; TEXT-ALIGN:center; @@ -184,7 +184,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 2px; padding-bottom: 2px; font-weight: normal; @@ -196,7 +196,7 @@ background: url(images/input.png) #eee; color:#000; border: 0px 0px 1px 1px #000 dashed; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -212,7 +212,7 @@ select {background:#eee; color:#111; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -283,7 +283,7 @@ background: url(images/inputtxt.png) #eee; color:#000; border: 0px 0px 1px 1px #000 dashed; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } textarea:hover{ @@ -322,7 +322,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -332,7 +332,7 @@ .callout_main { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; background: white; border: none; width: 100%; @@ -372,7 +372,7 @@ /*The main page heading left part before quick menu */ .quick_menu_left { background: none; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; border: none; @@ -459,7 +459,7 @@ } .main_menu { - background:none; + background:none; border: 0px; height:28px; } @@ -500,7 +500,7 @@ background: #00f url(images/gelblue.png) 0px -1px repeat-x; /*border: 0px solid #888;*/ text-align: center; - white-space: nowrap; + white-space: nowrap; } .main_menu_selected a{ @@ -514,7 +514,7 @@ } span.main_menu_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #fff; @@ -560,7 +560,7 @@ } .menu_group_headers_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: black; @@ -585,7 +585,7 @@ } .page_title_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 2px; padding-bottom: 2px; font-weight: bold; @@ -597,7 +597,7 @@ DIV.page_help_text { background: lightgrey url(images/help.png) top left no-repeat; BORDER: #a52a2a 1px solid; - padding-top:2px; + padding-top:2px; padding-bottom: 2px; PADDING-LEFT: 10px; Z-INDEX: 1; @@ -606,7 +606,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-weight: normal; font-size: 10px; color: black; @@ -623,7 +623,7 @@ MARGIN: 0 auto; POSITION: static; background: lightgray; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -633,7 +633,7 @@ } span.menu_group_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #777777; @@ -655,14 +655,14 @@ } a.footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; font-size: 8px; } .footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; font-size: 8px; Modified: trunk/css/professional/default.css =================================================================== --- trunk/css/professional/default.css 2010-02-08 14:18:40 UTC (rev 3339) +++ trunk/css/professional/default.css 2010-02-08 14:39:54 UTC (rev 3340) @@ -17,7 +17,7 @@ /* $Id$*/ body { - font-family: Verdana, Arial, Helvetica, sans-serif; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 10px; background-color: #DDDDDD; margin-left: 10px; @@ -33,7 +33,7 @@ /*links before selection */ a { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; font-size: 12px; font-weight: normal; text-decoration: none; @@ -62,7 +62,7 @@ /*table detail items default format */ td { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; font-size: 12px; text-align: left; } @@ -70,9 +70,9 @@ .dpTD { border: 0; width:20px; - background-color: #EEEEEE; + background-color: #EEEEEE; text-align:right; - cursor:pointer; + cursor:pointer; } .dpDayHighlight { @@ -80,7 +80,7 @@ width:20px; background-color: yellow; text-align:right; - cursor:pointer; + cursor:pointer; } .dpTDHover { @@ -88,7 +88,7 @@ width:20px; background-color: #CCCCCC; text-align:right; - cursor:pointer; + cursor:pointer; } td.number { @@ -136,7 +136,7 @@ } input { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; font-size: 12px; } @@ -148,7 +148,7 @@ } select { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; font-size: 12px; } @@ -216,7 +216,7 @@ } textarea{ - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; font-size: 12px; } @@ -253,7 +253,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -262,7 +262,7 @@ } .callout_main { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; background-color: white; border: none; width: 100%; @@ -301,7 +301,7 @@ /*The main page heading left part before quick menu */ .quick_menu_left { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; font-size: 12px; font-weight: bold; border: 0px; @@ -417,7 +417,7 @@ .main_menu_selected { background-color: #CCCCCC; border: 2px inset white; -/* position: relative; */ +/* position: relative; */ text-align: center; white-space: nowrap; } @@ -433,7 +433,7 @@ } span.main_menu_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; font-size: 12px; font-weight: bold; color: #777777; @@ -481,7 +481,7 @@ } .menu_group_headers_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; font-size: 12px; font-weight: bold; color: black; @@ -507,7 +507,7 @@ } .page_title_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; padding-top: 2px; padding-bottom: 2px; font-weight: bold; @@ -519,7 +519,7 @@ DIV.page_help_text { background: lightgrey url(images/help.png) top left no-repeat; BORDER: #a52a2a 1px solid; - padding-top:2px; + padding-top:2px; padding-bottom: 2px; PADDING-LEFT: 10px; Z-INDEX: 1; @@ -528,7 +528,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; font-weight: normal; font-size: 10px; color: black; @@ -545,7 +545,7 @@ MARGIN: 0 auto; POSITION: static; background: lightgray; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -555,7 +555,7 @@ } span.menu_group_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; font-size: 12px; font-weight: normal; color: #777777; @@ -576,14 +576,14 @@ } a.footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; color: black; font-weight: normal; font-size: 8px; } .footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; color: black; font-weight: normal; font-size: 8px; Modified: trunk/css/professional-rtl/default.css =================================================================== --- trunk/css/professional-rtl/default.css 2010-02-08 14:18:40 UTC (rev 3339) +++ trunk/css/professional-rtl/default.css 2010-02-08 14:39:54 UTC (rev 3340) @@ -18,7 +18,7 @@ /* $Id$*/ body { - font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; + font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif; font-size: 10px; background-color: #DDDDDD; margin-left: 10px; @@ -35,7 +35,7 @@ /*links before selection */ a { - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: normal; text-decoration: none; @@ -64,7 +64,7 @@ /*table detail items default format */ td { - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif; font-size: 12px; text-align: left; } @@ -72,9 +72,9 @@ .dpTD { border: 0; width:20px; - background-color: #EEEEEE; + background-color: #EEEEEE; text-align:right; - cursor:pointer; + cursor:pointer; } .dpDayHighlight { @@ -82,7 +82,7 @@ width:20px; background-color: yellow; text-align:right; - cursor:pointer; + cursor:pointer; } .dpTDHover { @@ -90,7 +90,7 @@ width:20px; background-color: #CCCCCC; text-align:right; - cursor:pointer; + cursor:pointer; } td.number { @@ -138,7 +138,7 @@ } input { - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -150,7 +150,7 @@ } select { - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -218,7 +218,7 @@ } textarea{ - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -255,7 +255,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -264,7 +264,7 @@ } .callout_main { - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif; background-color: white; border: none; width: 100%; @@ -303,7 +303,7 @@ /*The main page heading left part before quick menu */ .quick_menu_left { - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; border: 0px; @@ -420,7 +420,7 @@ .main_menu_selected { background-color: #CCCCCC; border: 2px inset white; -/* position: relative; */ +/* position: relative; */ text-align: center; white-space: nowrap; } @@ -436,7 +436,7 @@ } span.main_menu_nolink { - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #777777; @@ -484,7 +484,7 @@ } .menu_group_headers_text { - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Tahoma, Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: black; @@ -510,7 +510,7 @@ } .page_title_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; padding-top: 2px; padding-bottom: 2px; font-weight: bold; @@ -522,7 +522,7 @@ DIV.page_help_text { background: lightgrey url(images/help.png) top left no-repeat; BORDER: #a52a2a 1px solid; - padding-top:2px; + padding-top:2px; padding-bottom: 2px; PADDING-LEFT: 10px; Z-INDEX: 1; @@ -531,7 +531,7 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; font-weight: normal; font-size: 10px; color: black; @@ -548,7 +548,7 @@ MARGIN: 0 auto; POSITION: static; background: lightgray; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; padding-top: 1px; padding-bottom: 1px; font-weight: normal; @@ -558,7 +558,7 @@ } span.menu_group_nolink { - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Tahoma, Arial, Verdana, Helvetica; font-size: 12px; font-weight: normal; color: #777777; @@ -579,14 +579,14 @@ } a.footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica; color: black; font-weight: normal; font-size: 8px; } .footer { - font-family: Tahoma, Verdana, Arial, Helvetica; + font-family: Tahoma, Arial, Verdana, Helvetica; color: black; font-weight: normal; font-size: 8px; Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2010-02-08 14:18:40 UTC (rev 3339) +++ trunk/css/silverwolf/default.css 2010-02-08 14:39:54 UTC (rev 3340) @@ -18,7 +18,7 @@ /* $Id$*/ body { - font-family: Verdana, Arial, Helvetica, sans-serif; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 10px; background-color: #fff; margin-left: 0px; @@ -37,7 +37,7 @@ /*links before selection */ a { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: normal; text-decoration: none; @@ -71,7 +71,7 @@ /*table detail items default format */ td { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; text-align: left; } @@ -100,9 +100,9 @@ .dpTD { border: 0; width:20px; - background-color: #eee; + background-color: #eee; text-align:right; - cursor:pointer; + cursor:pointer; } .dpDayHighlight { @@ -110,7 +110,7 @@ width:20px; background-color: yellow; text-align:right; - cursor:pointer; + cursor:pointer; } .dpTDHover { @@ -118,7 +118,7 @@ width:20px; background-color: #ccc; text-align:right; - cursor:pointer; + cursor:pointer; } div.error { @@ -158,7 +158,7 @@ } input { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -171,7 +171,7 @@ */ select { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -187,7 +187,7 @@ /* From merge, uncomment to apply style font.header_title { } -End merge */ +End merge */ #topMenu { width: 100%; @@ -244,7 +244,7 @@ /* From merge, uncomment to apply styles textarea { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; } @@ -282,17 +282,17 @@ VISIBILITY: visible; MARGIN: 0 auto; POSITION: static; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 1px; padding-bottom: 1px; font-weight: normal; font-size: 10px; TEXT-ALIGN:center; -} +} End Merge */ .callout_main { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; background-color: white; border: none; width: 100%; @@ -331,7 +331,7 @@ /*The main page heading left part before quick menu */ .quick_menu_left { background: none; - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; border: none; @@ -459,7 +459,7 @@ .main_menu_selected { background: #aaa url(images/menu_bg_blue.png) 0px -10px repeat-x; border: 1px solid #888; -/* position: relative; it's not a div but a table */ +/* position: relative; it's not a div but a table */ text-align: center; white-space: nowrap; height: 16pt; @@ -478,7 +478,7 @@ } span.main_menu_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: #777; @@ -520,7 +520,7 @@ } .menu_group_headers_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: bold; color: black; @@ -544,7 +544,7 @@ } .page_title_text { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; padding-top: 2px; padding-bottom: 2px; font-weight: bold; @@ -600,7 +600,7 @@ End merge */ span.menu_group_nolink { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #777; @@ -633,7 +633,7 @@ End merge */ .footer { - font-family: Verdana, Arial, Helvetica; + font-family: Arial, Verdana, Helvetica, sans-serif; color: black; font-weight: normal; font-size: 8px; @@ -653,19 +653,19 @@ } .promo { - font-family: "Times New Roman", Times, serif; + font-family: Arial, Verdana, Helvetica, sans-serif; color: #003; } .titlebar { - font-family: "Times New Roman", Times, serif; + font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 9px; color: white; background-color: #369; } .dingbat { - font-family: Arial, Helvetica, sans-serif; + font-family: Arial, Verdana, Helvetica, sans-serif; background-color: #9c9; color: #066; font-weight: bolder; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-08 14:18:40 UTC (rev 3339) +++ trunk/doc/Change.log.html 2010-02-08 14:39:54 UTC (rev 3340) @@ -1,6 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>16/01/10 Tim: Add the lanscape sales invoice Note to the Form Designer</p> +<p>08/02/10 Tim: Change the default font family to Arial</p> <p>05/02/10 Tim: PO_AuthorisationLevels.php - If authoriastion limit is blank, then use a zero value</p> <p>03/02/10 Tim: Payments.php - Correctly show escaped characters in narrative while item hasn't been posted</p> <p>02/02/10 Pak Ricard: BankReconciliation.php - Correction for multi currency bank accounts</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-02-12 10:31:40
|
Revision: 3341 http://web-erp.svn.sourceforge.net/web-erp/?rev=3341&view=rev Author: tim_schofield Date: 2010-02-12 10:31:30 +0000 (Fri, 12 Feb 2010) Log Message: ----------- Replace deprecated function eregi Modified Paths: -------------- trunk/doc/Change.log.html trunk/install/save.php Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-08 14:39:54 UTC (rev 3340) +++ trunk/doc/Change.log.html 2010-02-12 10:31:30 UTC (rev 3341) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>12/02/10 Tim: Save.php - Replace deprecated function eregi</p> <p>08/02/10 Tim: Change the default font family to Arial</p> <p>05/02/10 Tim: PO_AuthorisationLevels.php - If authoriastion limit is blank, then use a zero value</p> <p>03/02/10 Tim: Payments.php - Correctly show escaped characters in narrative while item hasn't been posted</p> Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2010-02-08 14:39:54 UTC (rev 3340) +++ trunk/install/save.php 2010-02-12 10:31:30 UTC (rev 3341) @@ -35,7 +35,7 @@ } function set_error($message) { - + if(isset($message) AND $message != '') { // Copy values entered into session so user doesn't have to re-enter everything if(isset($_POST['company_name'])) { @@ -44,7 +44,7 @@ $_SESSION['operating_system'] = 'linux'; } else { $_SESSION['operating_system'] = $_POST['operating_system']; - } + } if(!isset($_POST['world_writeable'])) { $_SESSION['world_writeable'] = false; } else { @@ -74,7 +74,7 @@ function default_file_mode($temp_dir) { $v = explode(".",PHP_VERSION); $v = $v[0].$v[1]; - + if($v > 41 && is_writable($temp_dir)) { $filename = $temp_dir.'/test_permissions.txt'; $handle = fopen($filename, 'w'); @@ -103,6 +103,9 @@ return $default_dir_mode; } +function is_valid_email($email) { + return preg_match("/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9_-.]+.[a-zA-Z]+/", $email) > 0; +} if (isset($_POST['path_to_root'])) { $path_to_root = $_POST['path_to_root']; @@ -165,22 +168,22 @@ // Check if user has entered a database host if (!isset($_POST['database_host']) || $_POST['database_host'] == '') { set_error('Please enter a database host name'); -} +} // Check if user has entered a database username if (!isset($_POST['database_username']) || $_POST['database_username'] == '') { set_error('Please enter a database username'); -} +} // Check if user has entered a database password if (!isset($_POST['database_password'])) { set_error('Please enter a database password'); -} +} // Check if user has entered a database name if (!isset($_POST['company_name']) || $_POST['company_name'] == '') { set_error('Please enter a company name'); } else { $_POST['company_name'] = Replace_Dodgy_Characters($_POST['company_name']); } - + if (!isset($_POST['timezone']) || $_POST['timezone'] == ''){ set_error('Please enter timezone'); } @@ -194,14 +197,14 @@ if (!isset($_POST['admin_email']) || $_POST['admin_email'] == ''){ set_error('Please enter an email for the Administrator account'); } else { - if (eregi("^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$", $_POST['admin_email'])==false) { + if (is_valid_email($_POST['admin_email'])==false) { set_error('Please enter a valid email address for the Administrator account'); } } // Get the two admin passwords entered, and check that they match if (!isset($_POST['admin_password']) || $_POST['admin_password'] == '') { set_error('Please enter a password for the Administrator account'); -} +} if (!isset($_POST['admin_repassword']) || $_POST['admin_repassword'] == '') { set_error('Please make sure you re-enter the password for the Administrator account'); } @@ -213,7 +216,7 @@ $config_filename = $path_to_root . '/config.php'; // only make a new company directory structure if we are kicking off a new company // no need to bother if just setting up the demo data -if ($_POST['DemoData']==false){ +if ($_POST['DemoData']==false){ $Result = mkdir($path_to_root . '/companies/' . $_POST['company_name']); $Result = mkdir($path_to_root . '/companies/' . $_POST['company_name'] . '/part_pics'); $Result = mkdir($path_to_root . '/companies/' . $_POST['company_name'] . '/EDI_Incoming_Orders'); @@ -232,8 +235,8 @@ if (substr($ConfigDistributionFile[$i], 0, 8) == '$Version'){ $VersionString = $ConfigDistributionFile[$i]; } -} -//$msg holds the text of the new config.php file +} +//$msg holds the text of the new config.php file $msg = "<?php\n\n"; $msg .= "/* \$Revision: 1.7 $ */\n"; $msg .= "// User configurable variables\n"; @@ -246,15 +249,15 @@ $msg .= $VersionString . "\n\n"; $msg .= "// Connection information for the database\n"; $msg .= "// \$host is the computer ip address or name where the database is located\n"; -$msg .= "// assuming that the web server is also the sql server\n"; +$msg .= "// assuming that the web server is also the sql server\n"; $msg .= "\$host = '" . $_POST['database_host'] . "';\n\n"; -$msg .= "// assuming that the web server is also the sql server\n"; +$msg .= "// assuming that the web server is also the sql server\n"; $msg .= "\$dbType = 'mysqli';\n"; -$msg .= "// assuming that the web server is also the sql server\n"; +$msg .= "// assuming that the web server is also the sql server\n"; $msg .= "\$dbuser = '" . $_POST['database_username'] . "';\n"; -$msg .= "// assuming that the web server is also the sql server\n"; +$msg .= "// assuming that the web server is also the sql server\n"; $msg .= "\$dbpassword = '" . $_POST['database_password'] . "';\n"; $msg .= "// The timezone of the business - this allows the possibility of having;\n"; @@ -271,16 +274,16 @@ $msg .= "\$CryptFunction = 'sha1';\n"; $msg .= "\$DefaultClock = 12;\n"; -$msg .= "\$rootpath = dirname(\$_SERVER['PHP_SELF']);\n"; -$msg .= "if (isset(\$DirectoryLevelsDeep)){\n"; -$msg .= " for (\$i=0;\$i<\$DirectoryLevelsDeep;\$i++){\n"; -$msg .= "\$rootpath = substr(\$rootpath,0, strrpos(\$rootpath,'/'));\n"; -$msg .= "} }\n"; +$msg .= "\$rootpath = dirname(\$_SERVER['PHP_SELF']);\n"; +$msg .= "if (isset(\$DirectoryLevelsDeep)){\n"; +$msg .= " for (\$i=0;\$i<\$DirectoryLevelsDeep;\$i++){\n"; +$msg .= "\$rootpath = substr(\$rootpath,0, strrpos(\$rootpath,'/'));\n"; +$msg .= "} }\n"; -$msg .= "if (\$rootpath == '/' OR \$rootpath == '\\\') {;\n"; -$msg .= "\$rootpath = '';\n"; -$msg .= "}\n"; -$msg .= "error_reporting (E_ALL & ~E_NOTICE);\n"; +$msg .= "if (\$rootpath == '/' OR \$rootpath == '\\\') {;\n"; +$msg .= "\$rootpath = '';\n"; +$msg .= "}\n"; +$msg .= "error_reporting (E_ALL & ~E_NOTICE);\n"; $msg .= "?>"; if (!$zp = fopen($path_to_root . '/config.php', 'w')){ @@ -302,7 +305,7 @@ } if($_POST['install_tables'] == true){ - + /* Need to read in the sql script and process the queries to initate a new DB */ if ($_POST['DemoData'] == true){ //installing the demo data $SQLScriptFile = file($path_to_root . '/sql/mysql/weberp-demo.sql'); @@ -316,15 +319,15 @@ $ScriptFileEntries = sizeof($SQLScriptFile); $SQL =''; $InAFunction = false; - + for ($i=0; $i<$ScriptFileEntries; $i++) { - + $SQLScriptFile[$i] = trim($SQLScriptFile[$i]); - //ignore lines that start with -- or USE or /* - if (substr($SQLScriptFile[$i], 0, 2) != '--' - AND strstr($SQLScriptFile[$i],'/*')==FALSE + //ignore lines that start with -- or USE or /* + if (substr($SQLScriptFile[$i], 0, 2) != '--' + AND strstr($SQLScriptFile[$i],'/*')==FALSE AND strlen($SQLScriptFile[$i])>1){ - + $SQL .= ' ' . $SQLScriptFile[$i]; //check if this line kicks off a function definition - pg chokes otherwise @@ -340,18 +343,18 @@ $result = mysqli_query($db,$SQL); $SQL=''; } - + } //end if its a valid sql line not a comment } //end of for loop around the lines of the sql script -} -$sql = "UPDATE www_users - SET password = '" . sha1($_POST['admin_password']) . "', - email = '".mysqli_real_escape_string($db, $_POST['admin_email']) ."' +} +$sql = "UPDATE www_users + SET password = '" . sha1($_POST['admin_password']) . "', + email = '".mysqli_real_escape_string($db, $_POST['admin_email']) ."' WHERE user_id = 'admin'"; mysqli_query($db,$sql); -$sql = "UPDATE companies - SET coyname = '". mysqli_real_escape_string($db, $_POST['company_name']) . "' - WHERE coycode = 1"; +$sql = "UPDATE companies + SET coyname = '". mysqli_real_escape_string($db, $_POST['company_name']) . "' + WHERE coycode = 1"; mysqli_query($db,$sql); session_unset(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-02-12 10:48:18
|
Revision: 3342 http://web-erp.svn.sourceforge.net/web-erp/?rev=3342&view=rev Author: tim_schofield Date: 2010-02-12 10:48:11 +0000 (Fri, 12 Feb 2010) Log Message: ----------- Update php-gettext to the laterst version and remove reference to deprecated function eregi() Modified Paths: -------------- trunk/doc/Change.log.html trunk/includes/php-gettext/README trunk/includes/php-gettext/gettext.inc trunk/includes/php-gettext/gettext.php trunk/includes/php-gettext/streams.php Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-12 10:31:30 UTC (rev 3341) +++ trunk/doc/Change.log.html 2010-02-12 10:48:11 UTC (rev 3342) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>12/02/10 Tim: Update php-gettext to the laterst version and remove reference to deprecated function eregi()</p> <p>12/02/10 Tim: Save.php - Replace deprecated function eregi</p> <p>08/02/10 Tim: Change the default font family to Arial</p> <p>05/02/10 Tim: PO_AuthorisationLevels.php - If authoriastion limit is blank, then use a zero value</p> Modified: trunk/includes/php-gettext/README =================================================================== --- trunk/includes/php-gettext/README 2010-02-12 10:31:30 UTC (rev 3341) +++ trunk/includes/php-gettext/README 2010-02-12 10:48:11 UTC (rev 3342) @@ -1,9 +1,9 @@ -PHP-gettext 1.0 +PHP-gettext 1.0 (https://launchpad.net/php-gettext) -Copyright 2003, 2006 -- Danilo "angry with PHP[1]" Segan +Copyright 2003, 2006, 2009 -- Danilo "angry with PHP[1]" Segan Licensed under GPLv2 (or any later version, see COPYING) -[1] PHP is actually cyrillic, and translates roughly to +[1] PHP is actually cyrillic, and translates roughly to "works-doesn't-work" (UTF-8: Ради-Не-Ради) @@ -50,37 +50,17 @@ file data, I used imaginary abstract class StreamReader to do all the input (check streams.php). For your convenience, I've already provided two classes for reading files: FileReader and - StringReader (CachedFileReader is a combination of the two: it - loads entire file contents into a string, and then works on that). - See example below for usage. You can for instance use StringReader - when you read in data from a database, or you can create your own - derivative of StreamReader for anything you like. - + StringReader (CachedFileReader is a combination of the two: it + loads entire file contents into a string, and then works on that). + See example below for usage. You can for instance use StringReader + when you read in data from a database, or you can create your own + derivative of StreamReader for anything you like. + Bugs - Plural-forms field in MO header (translation for empty string, - i.e. "") is treated according to PHP syntactic rules (it's - eval()ed). Since these should actually follow C syntax, there are - some problems. + Report them on https://bugs.launchpad.net/php-gettext - For instance, I'm used to using this: - Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : \ - n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; - but it fails with PHP (it sets $plural=2 instead of 0 for $n==1). - - The fix is usually simple, but I'm lazy to go into the details of - PHP operator precedence, and maybe try to fix it. In here, I had - to put everything after the first ':' in parenthesis: - Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : \ - (n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); - That works, and I'm satisfied. - - Besides this one, there are probably a bunch of other bugs, since - I hate PHP (did I mention it already? no? strange), and don't - know it very well. So, feel free to fix any of those and report - them back to me at <da...@kv...>. - Usage Put files streams.php and gettext.php somewhere you can load them @@ -94,19 +74,19 @@ Then, use that as a parameter to gettext_reader constructor: $wohoo = new gettext_reader($streamer); - If you want to disable pre-loading of entire message catalog in - memory (if, for example, you have a multi-thousand message catalog - which you'll use only occasionally), use "false" for second + If you want to disable pre-loading of entire message catalog in + memory (if, for example, you have a multi-thousand message catalog + which you'll use only occasionally), use "false" for second parameter to gettext_reader constructor: $wohoo = new gettext_reader($streamer, false); From now on, you have all the benefits of gettext data at your - disposal, so may run: + disposal, so may run: print $wohoo->translate("This is a test"); print $wohoo->ngettext("%d bird", "%d birds", $birds); You might need to pass parameter "-k" to xgettext to make it - extract all the strings. In above example, try with + extract all the strings. In above example, try with xgettext -ktranslate -kngettext:1,2 file.php what should create messages.po which contains two messages for translation. @@ -118,8 +98,8 @@ Usage with gettext.inc (standard gettext interfaces emulation) - Check example in examples/pig_dropin.php, basically you include - gettext.inc and use all the standard gettext interfaces as + Check example in examples/pig_dropin.php, basically you include + gettext.inc and use all the standard gettext interfaces as documented on: http://www.php.net/gettext @@ -137,20 +117,12 @@ There is also simple "update" script that can be used to generate POT file and to update the translation using msgmerge. -Interesting TODO: +TODO: - o Try to parse "plural-forms" header field, and to follow C syntax - rules. This won't be easy. + o Improve speed to be even more comparable to the native gettext + implementation. -Boring TODO: - - o Learn PHP and fix bugs, slowness and other stuff resulting from - my lack of knowledge (but *maybe*, it's not my knowledge that is - bad, but PHP itself ;-). - - (This is mostly done thanks to Nico Kaiser.) - - o Try to use hash tables in MO files: with pre-loading, would it + o Try to use hash tables in MO files: with pre-loading, would it be useful at all? Never-asked-questions: @@ -160,7 +132,7 @@ Well, it's quite simple. I consider that the first released thing should be labeled "version 1" (first, right?). Zero is there to - indicate that there's zero improvement and/or change compared to + indicate that there's zero improvement and/or change compared to "version 1". I plan to use version numbers 1.0.* for small bugfixes, and to @@ -173,7 +145,7 @@ Mozart's 40th Symphony (there is one like that, right?). o Can I...? - + Yes, you can. This is free software (as in freedom, free speech), and you might do whatever you wish with it, provided you do not limit freedom of others (GPL). Modified: trunk/includes/php-gettext/gettext.inc =================================================================== --- trunk/includes/php-gettext/gettext.inc 2010-02-12 10:31:30 UTC (rev 3341) +++ trunk/includes/php-gettext/gettext.inc 2010-02-12 10:48:11 UTC (rev 3342) @@ -1,9 +1,10 @@ <?php /* Copyright (c) 2005 Steven Armstrong <sa at c-area dot ch> - + Copyright (c) 2009 Danilo Segan <da...@kv...> + Drop in replacement for native gettext. - + This file is part of PHP-gettext. PHP-gettext is free software; you can redistribute it and/or modify @@ -22,15 +23,22 @@ */ /* -LC_CTYPE 0 -LC_NUMERIC 1 -LC_TIME 2 -LC_COLLATE 3 -LC_MONETARY 4 -LC_MESSAGES 5 -LC_ALL 6 +LC_CTYPE 0 +LC_NUMERIC 1 +LC_TIME 2 +LC_COLLATE 3 +LC_MONETARY 4 +LC_MESSAGES 5 +LC_ALL 6 */ + +// LC_MESSAGES is not available if php-gettext is not loaded +// while the other constants are already available from session extension. +if (!defined('LC_MESSAGES')) { + define('LC_MESSAGES', 5); +} + require('streams.php'); require('gettext.php'); @@ -44,6 +52,12 @@ $EMULATEGETTEXT = 0; $CURRENTLOCALE = ''; +/* Class to hold a single domain included in $text_domains. */ +class domain { + var $l10n; + var $path; + var $codeset; +} // Utility functions @@ -51,22 +65,52 @@ * Utility function to get a StreamReader for the given text domain. */ function _get_reader($domain=null, $category=5, $enable_cache=true) { - global $text_domains, $default_domain, $LC_CATEGORIES; - if (!isset($domain)) $domain = $default_domain; - if (!isset($text_domains[$domain]->l10n)) { - // get the current locale - $locale = _setlocale(LC_MESSAGES, 0); - $p = isset($text_domains[$domain]->path) ? $text_domains[$domain]->path : './'; - $path = $p . "$locale/". $LC_CATEGORIES[$category] ."/$domain.mo"; - if (file_exists($path)) { - $input = new FileReader($path); - } - else { - $input = null; - } - $text_domains[$domain]->l10n = new gettext_reader($input, $enable_cache); - } - return $text_domains[$domain]->l10n; + global $text_domains, $default_domain, $LC_CATEGORIES; + if (!isset($domain)) $domain = $default_domain; + if (!isset($text_domains[$domain]->l10n)) { + // get the current locale + $locale = _setlocale(LC_MESSAGES, 0); + $bound_path = isset($text_domains[$domain]->path) ? + $text_domains[$domain]->path : './'; + $subpath = $LC_CATEGORIES[$category] ."/$domain.mo"; + /* Figure out all possible locale names and start with the most + specific ones. I.e. for sr_CS.UTF-8@latin, look through all of + sr_CS.UTF-8@latin, sr_CS@latin, sr@latin, sr_CS.UTF-8, sr_CS, sr. + */ + $locale_names = array(); + if (preg_match("/([a-z]{2,3})" // language code + ."(_([A-Z]{2}))?" // country code + ."(\.([-A-Za-z0-9_]))?" // charset + ."(@([-A-Za-z0-9_]+))?/", // @ modifier + $locale, $matches)) { + list(,$lang,,$country,,$charset,,$modifier) = $matches; + if ($modifier) { + $locale_names = array("${lang}_$country.$charset@$modifier", + "${lang}_$country@$modifier", + "$lang@$modifier"); + } + array_push($locale_names, + "${lang}_$country.$charset", "${lang}_$country", "$lang"); + } + array_push($locale_names, $locale); + + $input = null; + foreach ($locale_names as $locale) { + $full_path = $bound_path . $locale . "/" . $subpath; + if (file_exists($full_path)) { + $input = new FileReader($full_path); + break; + } + } + + if (!array_key_exists($domain, $text_domains)) { + // Initialize an empty domain object. + $text_domains[$domain] = new domain(); + } + $text_domains[$domain]->l10n = new gettext_reader($input, + $enable_cache); + } + return $text_domains[$domain]->l10n; } /** @@ -89,23 +133,23 @@ * Get the codeset for the given domain. */ function _get_codeset($domain=null) { - global $text_domains, $default_domain, $LC_CATEGORIES; - if (!isset($domain)) $domain = $default_domain; - return (isset($text_domains[$domain]->codeset))? $text_domains[$domain]->codeset : ini_get('mbstring.internal_encoding'); + global $text_domains, $default_domain, $LC_CATEGORIES; + if (!isset($domain)) $domain = $default_domain; + return (isset($text_domains[$domain]->codeset))? $text_domains[$domain]->codeset : ini_get('mbstring.internal_encoding'); } /** * Convert the given string to the encoding set by bind_textdomain_codeset. */ function _encode($text) { - $source_encoding = mb_detect_encoding($text); - $target_encoding = _get_codeset(); - if ($source_encoding != $target_encoding) { - return mb_convert_encoding($text, $target_encoding, $source_encoding); - } - else { - return $text; - } + $source_encoding = mb_detect_encoding($text); + $target_encoding = _get_codeset(); + if ($source_encoding != $target_encoding) { + return mb_convert_encoding($text, $target_encoding, $source_encoding); + } + else { + return $text; + } } @@ -119,9 +163,9 @@ function _setlocale($category, $locale) { global $CURRENTLOCALE, $EMULATEGETTEXT; if ($locale === 0) { // use === to differentiate between string "0" - if ($CURRENTLOCALE != '') + if ($CURRENTLOCALE != '') return $CURRENTLOCALE; - else + else // obey LANG variable, maybe extend to support all of LC_* vars // even if we tried to read locale without setting it first return _setlocale($category, $CURRENTLOCALE); @@ -133,12 +177,15 @@ $EMULATEGETTEXT = 0; $CURRENTLOCALE = $ret; } else { - if ($locale == '') // emulate variable support - $CURRENTLOCALE = getenv('LANG'); - else - $CURRENTLOCALE = $locale; + if ($locale == '') // emulate variable support + $CURRENTLOCALE = getenv('LANG'); + else + $CURRENTLOCALE = $locale; $EMULATEGETTEXT = 1; } + // Allow locale to be changed on the go for one translation domain. + global $text_domains, $default_domain; + unset($text_domains[$default_domain]->l10n); return $CURRENTLOCALE; } } @@ -147,84 +194,93 @@ * Sets the path for a domain. */ function _bindtextdomain($domain, $path) { - global $text_domains; - // ensure $path ends with a slash - if ($path[strlen($path) - 1] != '/') $path .= '/'; - elseif ($path[strlen($path) - 1] != '\\') $path .= '\\'; - $text_domains[$domain]->path = $path; + global $text_domains; + // ensure $path ends with a slash ('/' should work for both, but lets still play nice) + if (substr(php_uname(), 0, 7) == "Windows") { + if ($path[strlen($path)-1] != '\\' and $path[strlen($path)-1] != '/') + $path .= '\\'; + } else { + if ($path[strlen($path)-1] != '/') + $path .= '/'; + } + if (!array_key_exists($domain, $text_domains)) { + // Initialize an empty domain object. + $text_domains[$domain] = new domain(); + } + $text_domains[$domain]->path = $path; } /** * Specify the character encoding in which the messages from the DOMAIN message catalog will be returned. */ function _bind_textdomain_codeset($domain, $codeset) { - global $text_domains; - $text_domains[$domain]->codeset = $codeset; + global $text_domains; + $text_domains[$domain]->codeset = $codeset; } /** * Sets the default domain. */ function _textdomain($domain) { - global $default_domain; - $default_domain = $domain; + global $default_domain; + $default_domain = $domain; } /** * Lookup a message in the current domain. */ function _gettext($msgid) { - $l10n = _get_reader(); - //return $l10n->translate($msgid); - return _encode($l10n->translate($msgid)); + $l10n = _get_reader(); + //return $l10n->translate($msgid); + return _encode($l10n->translate($msgid)); } /** * Alias for gettext. */ function __($msgid) { - return _gettext($msgid); + return _gettext($msgid); } /** * Plural version of gettext. */ function _ngettext($single, $plural, $number) { - $l10n = _get_reader(); - //return $l10n->ngettext($single, $plural, $number); - return _encode($l10n->ngettext($single, $plural, $number)); + $l10n = _get_reader(); + //return $l10n->ngettext($single, $plural, $number); + return _encode($l10n->ngettext($single, $plural, $number)); } /** * Override the current domain. */ function _dgettext($domain, $msgid) { - $l10n = _get_reader($domain); - //return $l10n->translate($msgid); - return _encode($l10n->translate($msgid)); + $l10n = _get_reader($domain); + //return $l10n->translate($msgid); + return _encode($l10n->translate($msgid)); } /** * Plural version of dgettext. */ function _dngettext($domain, $single, $plural, $number) { - $l10n = _get_reader($domain); - //return $l10n->ngettext($single, $plural, $number); - return _encode($l10n->ngettext($single, $plural, $number)); + $l10n = _get_reader($domain); + //return $l10n->ngettext($single, $plural, $number); + return _encode($l10n->ngettext($single, $plural, $number)); } /** * Overrides the domain and category for a single lookup. */ function _dcgettext($domain, $msgid, $category) { - $l10n = _get_reader($domain, $category); - //return $l10n->translate($msgid); - return _encode($l10n->translate($msgid)); + $l10n = _get_reader($domain, $category); + //return $l10n->translate($msgid); + return _encode($l10n->translate($msgid)); } /** * Plural version of dcgettext. */ function _dcngettext($domain, $single, $plural, $number, $category) { - $l10n = _get_reader($domain, $category); - //return $l10n->ngettext($single, $plural, $number); - return _encode($l10n->ngettext($single, $plural, $number)); + $l10n = _get_reader($domain, $category); + //return $l10n->ngettext($single, $plural, $number); + return _encode($l10n->ngettext($single, $plural, $number)); } @@ -237,45 +293,45 @@ } function T_bindtextdomain($domain, $path) { - if (_check_locale()) return bindtextdomain($domain, $path); - else return _bindtextdomain($domain, $path); + if (_check_locale()) return bindtextdomain($domain, $path); + else return _bindtextdomain($domain, $path); } function T_bind_textdomain_codeset($domain, $codeset) { // bind_textdomain_codeset is available only in PHP 4.2.0+ - if (_check_locale() and function_exists('bind_textdomain_codeset')) return bind_textdomain_codeset($domain, $codeset); - else return _bind_textdomain_codeset($domain, $codeset); + if (_check_locale() and function_exists('bind_textdomain_codeset')) return bind_textdomain_codeset($domain, $codeset); + else return _bind_textdomain_codeset($domain, $codeset); } function T_textdomain($domain) { - if (_check_locale()) return textdomain($domain); - else return _textdomain($domain); + if (_check_locale()) return textdomain($domain); + else return _textdomain($domain); } function T_gettext($msgid) { - if (_check_locale()) return gettext($msgid); - else return _gettext($msgid); + if (_check_locale()) return gettext($msgid); + else return _gettext($msgid); } function T_($msgid) { - if (_check_locale()) return _($msgid); - return __($msgid); + if (_check_locale()) return _($msgid); + return __($msgid); } function T_ngettext($single, $plural, $number) { - if (_check_locale()) return ngettext($single, $plural, $number); - else return _ngettext($single, $plural, $number); + if (_check_locale()) return ngettext($single, $plural, $number); + else return _ngettext($single, $plural, $number); } function T_dgettext($domain, $msgid) { - if (_check_locale()) return dgettext($domain, $msgid); - else return _dgettext($domain, $msgid); + if (_check_locale()) return dgettext($domain, $msgid); + else return _dgettext($domain, $msgid); } function T_dngettext($domain, $single, $plural, $number) { - if (_check_locale()) return dngettext($domain, $single, $plural, $number); - else return _dngettext($domain, $single, $plural, $number); + if (_check_locale()) return dngettext($domain, $single, $plural, $number); + else return _dngettext($domain, $single, $plural, $number); } function T_dcgettext($domain, $msgid, $category) { - if (_check_locale()) return dcgettext($domain, $msgid, $category); - else return _dcgettext($domain, $msgid, $category); + if (_check_locale()) return dcgettext($domain, $msgid, $category); + else return _dcgettext($domain, $msgid, $category); } function T_dcngettext($domain, $single, $plural, $number, $category) { - if (_check_locale()) return dcngettext($domain, $single, $plural, $number, $category); - else return _dcngettext($domain, $single, $plural, $number, $category); + if (_check_locale()) return dcngettext($domain, $single, $plural, $number, $category); + else return _dcngettext($domain, $single, $plural, $number, $category); } @@ -283,36 +339,36 @@ // Wrappers used as a drop in replacement for the standard gettext functions if (!function_exists('gettext')) { - function bindtextdomain($domain, $path) { - return _bindtextdomain($domain, $path); - } - function bind_textdomain_codeset($domain, $codeset) { - return _bind_textdomain_codeset($domain, $codeset); - } - function textdomain($domain) { - return _textdomain($domain); - } - function gettext($msgid) { - return _gettext($msgid); - } - function _($msgid) { - return __($msgid); - } - function ngettext($single, $plural, $number) { - return _ngettext($single, $plural, $number); - } - function dgettext($domain, $msgid) { - return _dgettext($domain, $msgid); - } - function dngettext($domain, $single, $plural, $number) { - return _dngettext($domain, $single, $plural, $number); - } - function dcgettext($domain, $msgid, $category) { - return _dcgettext($domain, $msgid, $category); - } - function dcngettext($domain, $single, $plural, $number, $category) { - return _dcngettext($domain, $single, $plural, $number, $category); - } + function bindtextdomain($domain, $path) { + return _bindtextdomain($domain, $path); + } + function bind_textdomain_codeset($domain, $codeset) { + return _bind_textdomain_codeset($domain, $codeset); + } + function textdomain($domain) { + return _textdomain($domain); + } + function gettext($msgid) { + return _gettext($msgid); + } + function _($msgid) { + return __($msgid); + } + function ngettext($single, $plural, $number) { + return _ngettext($single, $plural, $number); + } + function dgettext($domain, $msgid) { + return _dgettext($domain, $msgid); + } + function dngettext($domain, $single, $plural, $number) { + return _dngettext($domain, $single, $plural, $number); + } + function dcgettext($domain, $msgid, $category) { + return _dcgettext($domain, $msgid, $category); + } + function dcngettext($domain, $single, $plural, $number, $category) { + return _dcngettext($domain, $single, $plural, $number, $category); + } } -?> \ No newline at end of file +?> Modified: trunk/includes/php-gettext/gettext.php =================================================================== --- trunk/includes/php-gettext/gettext.php 2010-02-12 10:31:30 UTC (rev 3341) +++ trunk/includes/php-gettext/gettext.php 2010-02-12 10:48:11 UTC (rev 3342) @@ -2,7 +2,7 @@ /* Copyright (c) 2003 Danilo Segan <da...@kv...>. Copyright (c) 2005 Nico Kaiser <ni...@si...> - + This file is part of PHP-gettext. PHP-gettext is free software; you can redistribute it and/or modify @@ -20,13 +20,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - + /** * Provides a simple gettext replacement that works independently from * the system's gettext abilities. * It can read MO files and use them for translating strings. * The files are passed to gettext_reader as a Stream (see streams.php) - * + * * This version has the ability to cache all strings and translations to * speed up the string lookup. * While the cache is enabled by default, it can be switched off with the @@ -36,7 +36,7 @@ class gettext_reader { //public: var $error = 0; // public variable that holds error code (0 if no error) - + //private: var $BYTEORDER = 0; // 0: low endian, 1: big endian var $STREAM = NULL; @@ -52,11 +52,11 @@ /* Methods */ - - + + /** * Reads a 32bit Integer from the Stream - * + * * @access private * @return Integer from the Stream */ @@ -72,7 +72,7 @@ /** * Reads an array of Integers from the Stream - * + * * @param int count How many elements should be read * @return Array of Integers */ @@ -85,10 +85,10 @@ return unpack('N'.$count, $this->STREAM->read(4 * $count)); } } - + /** * Constructor - * + * * @param object Reader the StreamReader object * @param boolean enable_cache Enable or disable caching of strings (default on) */ @@ -98,7 +98,7 @@ $this->short_circuit = true; return; } - + // Caching can be turned off $this->enable_cache = $enable_cache; @@ -117,20 +117,20 @@ $this->error = 1; // not MO file return false; } - + // FIXME: Do we care about revision? We should. $revision = $this->readint(); - + $this->total = $this->readint(); $this->originals = $this->readint(); $this->translations = $this->readint(); } - + /** * Loads the translation tables from the MO file into the cache * If caching is enabled, also loads all strings into a cache * to speed up translation lookups - * + * * @access private */ function load_tables() { @@ -138,13 +138,13 @@ is_array($this->table_originals) && is_array($this->table_translations)) return; - + /* get original and translations tables */ $this->STREAM->seekto($this->originals); $this->table_originals = $this->readintarray($this->total * 2); $this->STREAM->seekto($this->translations); $this->table_translations = $this->readintarray($this->total * 2); - + if ($this->enable_cache) { $this->cache_translations = array (); /* read all strings in the cache */ @@ -157,10 +157,10 @@ } } } - + /** * Returns a string from the "originals" table - * + * * @access private * @param int num Offset number of original string * @return string Requested string if found, otherwise '' @@ -174,10 +174,10 @@ $data = $this->STREAM->read($length); return (string)$data; } - + /** * Returns a string from the "translations" table - * + * * @access private * @param int num Offset number of original string * @return string Requested string if found, otherwise '' @@ -191,10 +191,10 @@ $data = $this->STREAM->read($length); return (string)$data; } - + /** * Binary search for string - * + * * @access private * @param string string * @param int start (internally used in recursive function) @@ -232,10 +232,10 @@ return $this->find_string($string, $half, $end); } } - + /** * Translates a string - * + * * @access public * @param string string to be translated * @return string translated string (or original, if not found) @@ -243,8 +243,8 @@ function translate($string) { if ($this->short_circuit) return $string; - $this->load_tables(); - + $this->load_tables(); + if ($this->enable_cache) { // Caching enabled, get translated string from cache if (array_key_exists($string, $this->cache_translations)) @@ -263,15 +263,15 @@ /** * Get possible plural forms from MO header - * + * * @access private * @return string plural form header */ function get_plural_forms() { - // lets assume message number 0 is header + // lets assume message number 0 is header // this is true, right? $this->load_tables(); - + // cache header field for plural forms if (! is_string($this->pluralheader)) { if ($this->enable_cache) { @@ -279,7 +279,7 @@ } else { $header = $this->get_translation_string(0); } - if (eregi("plural-forms: ([^\n]*)\n", $header, $regs)) + if (preg_match("plural-forms: ([^\n]*)\n", $header, $regs)) $expr = $regs[1]; else $expr = "nplurals=2; plural=n == 1 ? 0 : 1;"; @@ -290,7 +290,7 @@ /** * Detects which plural form to take - * + * * @access private * @param n count * @return int array index of the right plural form @@ -300,7 +300,7 @@ $string = str_replace('nplurals',"\$total",$string); $string = str_replace("n",$n,$string); $string = str_replace('plural',"\$plural",$string); - + $total = 0; $plural = 0; @@ -311,7 +311,7 @@ /** * Plural version of gettext - * + * * @access public * @param string single * @param string plural @@ -327,12 +327,12 @@ } // find out the appropriate form - $select = $this->select_string($number); - + $select = $this->select_string($number); + // this should contains all strings separated by NULLs $key = $single.chr(0).$plural; - - + + if ($this->enable_cache) { if (! array_key_exists($key, $this->cache_translations)) { return ($number != 1) ? $plural : $single; Modified: trunk/includes/php-gettext/streams.php =================================================================== --- trunk/includes/php-gettext/streams.php 2010-02-12 10:31:30 UTC (rev 3341) +++ trunk/includes/php-gettext/streams.php 2010-02-12 10:48:11 UTC (rev 3342) @@ -1,6 +1,6 @@ <?php /* - Copyright (c) 2003, 2005 Danilo Segan <da...@kv...>. + Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <da...@kv...>. This file is part of PHP-gettext. @@ -21,29 +21,29 @@ */ -// Simple class to wrap file streams, string streams, etc. -// seek is essential, and it should be byte stream + // Simple class to wrap file streams, string streams, etc. + // seek is essential, and it should be byte stream class StreamReader { // should return a string [FIXME: perhaps return array of bytes?] function read($bytes) { return false; } - + // should return new position function seekto($position) { return false; } - + // returns current position function currentpos() { return false; } - + // returns length of entire stream (limit for seekto()s) function length() { return false; } -} +}; class StringReader { var $_pos; @@ -78,7 +78,7 @@ return strlen($this->_str); } -} +}; class FileReader { @@ -93,8 +93,8 @@ $this->_pos = 0; $this->_fd = fopen($filename,'rb'); if (!$this->_fd) { - $this->error = 3; // Cannot read file, probably permissions - return false; + $this->error = 3; // Cannot read file, probably permissions + return false; } } else { $this->error = 2; // File doesn't exist @@ -105,17 +105,17 @@ function read($bytes) { if ($bytes) { fseek($this->_fd, $this->_pos); - $data = ""; // PHP 5.1.1 does not read more than 8192 bytes in one fread() // the discussions at PHP Bugs suggest it's the intended behaviour + $data = ''; while ($bytes > 0) { $chunk = fread($this->_fd, $bytes); $data .= $chunk; $bytes -= strlen($chunk); } $this->_pos = ftell($this->_fd); - + return $data; } else return ''; } @@ -138,9 +138,9 @@ fclose($this->_fd); } -} +}; -// Preloads entire file in memory first, then creates a StringReader +// Preloads entire file in memory first, then creates a StringReader // over it (it assumes knowledge of StringReader internals) class CachedFileReader extends StringReader { function CachedFileReader($filename) { @@ -150,8 +150,8 @@ $fd = fopen($filename,'rb'); if (!$fd) { - $this->error = 3; // Cannot read file, probably permissions - return false; + $this->error = 3; // Cannot read file, probably permissions + return false; } $this->_str = fread($fd, $length); fclose($fd); @@ -161,7 +161,7 @@ return false; } } -} +}; -?> \ 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: <tim...@us...> - 2010-02-12 10:57:50
|
Revision: 3343 http://web-erp.svn.sourceforge.net/web-erp/?rev=3343&view=rev Author: tim_schofield Date: 2010-02-12 10:57:39 +0000 (Fri, 12 Feb 2010) Log Message: ----------- Update phplot to the laterst version and remove reference to deprecated function eregi() Modified Paths: -------------- trunk/doc/Change.log.html trunk/includes/phplot/phplot.php trunk/includes/phplot/phplot_data.php trunk/includes/phplot/rgb.inc.php Added Paths: ----------- trunk/includes/phplot/COPYING trunk/includes/phplot/ChangeLog trunk/includes/phplot/NEWS.txt trunk/includes/phplot/README.txt Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-12 10:48:11 UTC (rev 3342) +++ trunk/doc/Change.log.html 2010-02-12 10:57:39 UTC (rev 3343) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>12/02/10 Tim: Update phplot to the laterst version and remove reference to deprecated function eregi()</p> <p>12/02/10 Tim: Update php-gettext to the laterst version and remove reference to deprecated function eregi()</p> <p>12/02/10 Tim: Save.php - Replace deprecated function eregi</p> <p>08/02/10 Tim: Change the default font family to Arial</p> Added: trunk/includes/phplot/COPYING =================================================================== --- trunk/includes/phplot/COPYING (rev 0) +++ trunk/includes/phplot/COPYING 2010-02-12 10:57:39 UTC (rev 3343) @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + Added: trunk/includes/phplot/ChangeLog =================================================================== --- trunk/includes/phplot/ChangeLog (rev 0) +++ trunk/includes/phplot/ChangeLog 2010-02-12 10:57:39 UTC (rev 3343) @@ -0,0 +1,848 @@ +This is the Change Log for PHPlot. +The project home page is http://sourceforge.net/projects/phplot/ +----------------------------------------------------------------------------- + +2009-12-24 (lbayuk) ===== Released as 5.1.0 ===== + +2009-12-18 + * Change for bug 1795971 "Fix default data colors": + The default Data Color and Error Bar Color arrays now have 16 + different colors, no duplicates, and nothing so light that it + is invisible. + Using '' or False as the argument to SetDataColors, SetErrorBarColors, + and SetDataBorderColors now re-initializes the map to the defaults. + This was previously undocumented, and in some cases set the map to + something different from the default. + +2009-12-15 + * Cleanup: Remove DrawAxisLegend() - empty function marked TODO, + not really clear what it was meant to do. + +2009-12-14 + * Fix for bug 2914403 "Pie + X/Y titles: Undefined property error": + In DrawGraph(), don't try to draw X or Y titles for pie charts. + + * Feature request 2899921: "allow different format for data and tick + labels"; Bug 2906436: "Fixes for X Tick Labels vs X Data Labels", + and partial implementation of changes from user 'adoll' regarding + tick vs data labels: + + New public functions: + + SetXDataLabelType() : Sets formatting for X Data Labels + + SetYDataLabelType() : Sets formatting for Y Data Labels (bar charts) + + SetXDataLabelAngle() : Sets text angle for X Data Labels + + SetYDataLabelAngle() : Sets text angle for Y Data Label (bar charts) + The defaults for these are set up to be fully backward compatible + with previous releases of PHPlot (except see the next item). + + Re-used function name SetXDataLabelAngle(): + + This has been deprecated and undocumented since 2003-12-07, and + used to just call SetXLabelAngle(). For new behavior, see above. + + Changes to public functions: + + SetXDataLabelPos() and SetXTickLabelPos() no longer cancel each + other out (set the other control variable to 'none'). Instead, + they are both considered before plot drawing. + + Changes to internal functions: + + DrawDataLabel() now uses the font, angle, and color arguments as + provided, and does not substitute values if they are empty. + + SetLabelType() now takes mode='xd' and 'yd' for X Data and Y Data + label formatting; 'x' and 'y' are for tick labels only now. + + Functions that work on Data labels now call FormatLabels() with the + new mode parameter value 'xd' or 'yd, and use the new + data_label_angle variables. + + New CheckLabels(), used by DrawGraph to process label parameters. + + CalcMargins() - Rewritten to handle changes to Tick and Data labels. + + Changes to internal class variables: + + New: x_data_label_angle, y_data_label_angle + + Do not initialize x_tick_label_pos or x_data_label_pos, so that + CheckLabels() can tell if they were set or not and apply defaults. + + Initialize y_data_label_pos to 'none', not 'plotleft'. + + Add 2 more indexes to label_format[] array: 'xd' and 'yd'. + + * Cleanup: + + Delete unused internal class variable: draw_y_data_label_lines + + Delete unused function SetDrawYDataLabelLines() + +2009-12-07 + * Fix bug 1795972 "Fix default point shapes": + + Added 10 new point shapes to the existing 10 shapes. + + Changed the default point shape from all 'diamond' to a + selection of up to 10 different shapes. + + Fixed bug in the code that tried to set the point shapes + and sizes arrays to be the same size. This was not working, + resulting in unexpected point sizes. + + Changed default point size to 6 for all shapes. It was trying + to be "5, 5, 3" but due to several bugs this was not working. + + Do not adjust shape sizes to even numbers (was done for only two + shapes). Instead, consistently truncate size/2 when needed. + NOTE: These may change the look of 'points' and 'linepoints' plots. + + * Changed startup initialization code: + + SetDefaultStyles() was doing some odd things using a variable + called "session_set", with comments referring to non-existent + session support code. This has been removed. There should be + no visible changes from this. PHPlot does not use PHP sessions. + +2009-12-04 + * Fix for bug 2908256, errors in pie charts with bad data array: + (From a Drupal contrib module report by thekevinday.) + With pie charts only, a data array with no valid Y values resulted + in PHP error messages. All other plot types handle this by producing + an image without a graph. + Fixed DrawPieChart to behave this way too. If there are no valid Y + values, or if the sum of all Y values is 0, do not error out, but + don't draw a pie chart either. + Also, pie charts now ignore non-numeric Y values, like other plot types. + +2009-11-20 (lbayuk) + * Fix for bug 2900914 "Problem with display of 0 on Y axis": + Changed how X and Y values are stepped by tick intervals, to avoid + cumulative round-off error. This fixes the problem when Y crosses 0 with + a tick step such as 0.1 resulting in a long label for a very small but + non-zero number. Fixed DrawXTicks, DrawYTicks, and CalcMaxTickLabelSize. + (Originally reported by cncnet) + +2009-11-19 (lbayuk) + * Improve support for using callbacks to annotate plots: + Added new callback 'draw_all', called after all drawing. + Supply plot_area[] as argument to some drawing callbacks. + Added new method GetDeviceXY() to translate from world coordinates. + Allow NULL or '' for $font in DrawText() internal method, meaning to + use the generic font. If callbacks want to use DrawText, this + avoids them having to reference the internal fonts[] array. + +2009-11-01 (lbayuk) + * Address bug report 2886365 "Declare all functions and variables in + PHP5 style" + PHP5 deprecates the use of 'var' to declare a class member variable. + All initialized class member variables are now declared 'public'. + (It was tempting to make most or all 'protected' or 'private', but + that would likely break too much, including the PHPlot Test Suite.) + + Most class member functions which are meant for internal use only are + now declared 'protected', so they cannot be called from scripts + (except in child classes). (Note PHP5 does not deprecate the use of + just 'function' to mean public, so public functions were not changed.) + Internal functions are those documented in the manual under Developer's + Guide, Internal Functions. If your code breaks because you are using + a method which is now protected, please post the details on the help + forum. + + Some member variables which were set in the constructor are now + initialized with the class instead. (No impact.) + + Removed commented-out, FIXME-noted code for interim labels. + +2009-10-12 (lbayuk) + * Bug report 2839547, allow SetImageBorderType('none') to reset the image + border type. Also checked for other cases where there is no reset; + found one that exists (Set[XY]LabelType) but needs to be documented. + +2009-07-09 (lbayuk) + * Added a hook $plot->locale_override which can be set to True to prevent + PHPlot from loading locale settings from the environment with + setlocale(LC_ALL, ''). This is necessary for testing PHPlot on Windows, + where you cannot force a locale with an environment variable. It might + also be needed for people who want PHPlot's locale to differ from the + web server's locale. + +2009-06-12 (lbayuk) ===== Released as 5.0.7 ===== + +2009-06-11 (lbayuk) + * Change PHPlot license to LGPL, per Afan. + phplot.php, phplot_data.php - Change license notice. + rgb.inc.php - Change top comments and remove bottom marker. + COPYING - new file, text of LGPL. + LICENSE.* - removed files - old licenses. + Makefile - change list of distributed files. + + * Fix for bug 2803900: SetRGBArray('large') does not work. The include + file defined a different array name than the main script expected. + (This bug seems to have happened over 8 years ago.) Fixed the array + names to match. Also removed the ./ prefix from the included filename + so it will be found if on the include path but not in the script + directory. Also added error check if the rgb.inc.php include file + is needed and not found. + +2009-05-25 (lbayuk) + * Added new feature to allow partial margin or plot area specification. + You can omit, or specify as NULL, any of the 4 arguments to + SetMarginsPixels() or SetPlotAreaPixels(), and this means PHPlot + should use the automatically calculated margin on that side. + Credit to adoll for this feature. + +2009-05-17 (lbayuk) + * Fix for bug 2791502 "Error plots treat missing Y values as 0": + Plots with data type data-data-error now support missing Y values, + instead of treating them as 0. This works with lines, points, + and linepoints plot types, and also honors SetDrawBrokenLines. + + + * Fix for bug 2792860 "Wrong DataLabelLines with missing Y": + Do not draw X Data Label Lines at points with missing Y values. + + + * Fix for bug 2786350 "Missing Y data results in bad auto-range": + Rewrote FindDataLimits to ignore missing Y values, rather than + treating them as if 0, for calculating range. + Bug report and analysis by mrten. + + * Fix for bug 2786354 "Incorrect auto-range for data-data-error": + For data-data-error data type, apply the positive and negative error + amounts for each Y point to that point only, rather than applying the + largest errors to the overall minimum and maximum Y value for the row. + + Note: The two fixes above can change existing plots which rely on + automatic Y range calculation. The first fix affects plots with + missing Y values and min(Y)>0. The second fix can affect plots using + data-data-error data type and different error values for different + points. In both cases the new Y range can be smaller than before. + +2009-01-20 (lbayuk) ===== Released as 5.0.6 ===== + +2009-01-18 (lbayuk) + * Fix for bug 1891636 "Misaligned TTF X Labels": + PHPlot was using the actual bounding box of each line of text + to allocate space and set the text positioning, but was ignoring the + fact that the text baseline is not the same as the bottom of the + bounding box. This resulted in uneven alignment of the X labels if + they had different heights (for example, month names Jul and Aug). + + PHPlot now calculates the size of text for allocation (SizeText) using + the descenders on the last line, and calculates the size for drawing + (DrawText) only to the baseline. PHPlot also now uses a fixed line + spacing for each line of text in a font, rather than the actual text + height. This allows separately drawn multi-line labels to align. + + * Changes to line spacing when using multi-line labels: + PHPlot was using the class variable line_spacing to mean the + number of pixels between lines of multi-line labels. This made the + spacing too small for larger fonts, and it was not possible to adjust + line spacing for different types of text. + + PHPlot now interprets line_spacing as the number of pixels only + for GD text, and as a scale factor for the font's built-in line + spacing for TrueType text. In addition, a new optional argument is + added to SetFont, SetFontGD, and SetFontTTF to set a line spacing + specific to that type of text. + + * Changes had to be made to the legend drawing code to accommodate the + changes to font handling. + + Note: The line spacing change results in slightly looser spacing on + multi-line TrueType text labels, and slightly taller legends, compared + to version 5.0.5. + +2008-09-21 (lbayuk) + * Interim fix for bug 1932571 "Data-Data Plot fails with same X values". + PHPlot will no longer hang when the range of X values is 0 (that is, when + x_min == x_max). It will arbitrarily set an X range of 1, so the + calculated tick step is not 0. This is a temporary fix. Work on a smarter + X and Y range calculation is in progress, which will handle edge cases + like this better, but it isn't ready and this bug has been open too long. + Credit to andyl for finding the bug. + + * Fix font path: Use DIRECTORY_SEPARATOR constant not '/'. + + Extended the label formatting capabilities, adding 'printf' and 'custom' + types, added a prefix and suffix for 'data' type, and allow format controls + to be included in SetXLabelType and SetYLabelType. + + External changes: + * Added 'printf' label type. The caller specifies the print format as the + 2nd argument to SetXLabelType or SetYLabelType (default '%e'). + $plot->SetXLabelType('printf', '%5.2f'); + + * Added 'custom' label type. The caller supplies a callback (typically a + function name) and optional pass-through argument as the 2nd and 3rd + arguments to Set[XY]LabelType. The function is called as $f($value, $arg) + to return the formatted $value. + $plot->SetXLabelType('custom', 'myfunction', $arg_value); + + * In addition to Set[XY]TimeFormat, the format string for type 'time' can + now be set as the 2nd argument to Set[XY]LabelType. + $plot->SetXLabelType('time', '%H:%M'); + + * In addition to SetPrecision[XY], the precision for type 'data' can now be + set as the 2nd argument to Set[XY]LabelType. A 3rd and 4th argument + can supply a prefix and suffix for 'data' formatting. (All optional) + $plot->SetXLabelType('data', 2, '$', 'US'); + + Internal changes: + * Class variables x_precision, y_precision, x_label_type, y_label_type, + x_time_format, and y_time_format have been removed. + + * New class array variable label_format[], with elements 'x' and 'y' which + are arrays for label formatting. Elements in the sub-arrays are not + initialized until needed. + + * New function SetLabelType, which implements Set[XY]LabelType now. + + * FormatLabel() was rewritten to support the new label formatting. + + Compatibility: + * Any code that directly references class variables related to label + formatting will break, except for data_units_text. Use the documented + function methods instead. Setting data_units_text as a suffix is + deprecated but still works. + + * The 'data' type precision for 'Y' is still used for pie chart labels. + +2008-07-12 (lbayuk) + Multiple comment spelling error fixes. No functional changes. + +2008-07-06 (lbayuk) + Changes to allow mixing GD fixed-font text and TrueType Font (TTF) text + on the same plot. + (This change came from work done trying to fix TTF text positioning, + where it looks like additional information needs to be stored for TrueType + fonts. The old font data structure was awkward to extend, and allowing + mixed GD/TTF text was on the to-do list anyway.) + + External changes: + * SetFontGD(), SetFontTTF(): New functions to set a font, with type. + * SetFont(): Now calls SetFontGD or SetFontTTF depending on $use_ttf. + These changes should be fully compatible with existing programs. + + Internal changes: + * Updated comments explaining SetUseTTF() now sets the default type + (not the only type) of text used. + * Put all the font data into a class array. (Replaces $this->generic_font + with $this->fonts['generic'], etc.) + * ProcessTextGD() and ProcessTextTTF() now take the font array as one + argument, rather than separate arguments for font path and size. + +2008-01-13 (lbayuk) ===== Released as 5.0.5 ===== + * phplot.php: Updated version + * README.txt: Updated for new release + * NEWS.txt: Add text for new release + * Makefile: Remove 'Callbacks' from release target, as this material is + now in the reference manual. + +2008-01-07 (lbayuk) + Copyright updated to 2008 and PHP4 no longer listed as supported. + + Major rewrite of the margin calculation functions to address multiple + problems. Fixes for bugs 1856207 "Margin error with 'xaxis'/'yaxis' + position, 1843012 "Make margins, drawing consistent", and 945439 + "x_tick_label_height not set correctly". + + Note: These changes are inter-dependent and cannot be split up. + + * Defer all calculations to DrawGraph time, to eliminate order dependencies. + These functions now just store their arguments in the object, and all + calculations happen later: + + SetXAxisPosition, SetYAxisPosition + + SetMarginsPixels + + SetPlotAreaPixels (Stores margins, not area, now.) + + SetPlotAreaWorld + + SetXTickIncrement, SetYTickIncrement + + * A new callback 'debug_scale' was added to trace the margin and scale + calculations. + + * CalcMargins was rewritten. Actual sizes of tick and data labels are now + used, rather than guesses like "use size of biggest Y value". A minimum + value (3 x safe_margin, or 15 pixels) applies to each margin. + + * FindDataLimits no longer needs to find the longest data label, since + CalcMargins now does that more precisely. + + * DrawXTitle and DrawYTitle now use position offsets calculated by + CalcMargins. Note: These titles are now offset from the plot area, + not the image area. The titles will move if you had set the plot area + or margins. + + * DrawYTick, DrawXTick rewritten to use pre-calculated offsets, and common + code moved to new CalcTicks(). + + * DrawXDataLabel: Use pre-calculated offsets for text. + + * DrawGraph: Rewrote top section (before drawing anything) to do the + calculations in the proper order, unconditionally. + + * Class variables removed: + x_label_inc, y_label_inc, _x_label_cnt : These were never used. + title_height, x_title_height, y_title_width : Now internal to CalcMargins. + data_limits_done : No more need to remember if FindDataLimits called. + + * New class variables added: + plot_margins_set : Keeps track of user-set plot area or automatic. + x_label_top_offset, x_label_bot_offset, x_offset_axis_offset, + y_label_left_offset, y_label_right_offset, y_label_axis_offset, + x_title_top_offset, x_title_bot_offset, + y_title_left_offset, y_title_left_offset : Label offsets + + * New internal functions: + CalcPlotAreaPixels : Deferred calculations taken out of SetPlotAreaPixels + and SetMarginsPixels. + CalcPlotAreaWorld : Deferred calculations taken out of SetPlotAreaWorld. + CalcAxisPositions : Calculate axis positions, moved from CalcTranslation. + CalcTicks : Calculate X and Y tick interval. This still uses the + same simple method (basically range/10), but now we could drop in a new + algorithm much more easily. This is now also used by CalcMargins. + Code taken out of DrawXTicks and DrawYTicks. + CalcMaxTickLabelSize : So CalcMargins can use the exact tick label sizes. + CalcMaxDataLabelSize : So CalcMargins can use the exact data label sizes. + DrawXTick : Code split out from DrawXTicks for symmetry with DrawYTick. + + +2007-12-13 (lbayuk) + * Changed ProcessTextTTF() so SizeText() will return integers. It rounds + the calculated values up, so the bounding box really contains the text. + This also prevents unneeded float calculations in derived values. + +2007-12-09 (lbayuk) + Major rewrite of the text drawing functions to address multiple problems. + Note: These changes are inter-dependent and cannot be split up. + + * Fixed bug 1813070 "Bad position for multi-line TrueType text": + TTF text is now drawn line-by-line, not as a block, for proper + alignment and positioning. + + * Fixed bug 1813071 "Wrong title height for multi-line TTF text": + Corrected miscalculation of overall height of multi-line TTF titles. + This bug resulted in over-sized margins. + The height is now computed line-by-line, including the inter-line spacing. + + * Fixed bug 1813474 "DrawText alignment arguments wrong": + Corrected meaning of 'top' vs 'bottom' alignment. PHPlot now follows + the usual conventions: 'top' alignment means top of text to reference. + DrawText default for vertical alignment is still 'bottom', but the + meaning was corrected. All callers of DrawText were fixed. + + * Fixed bug 1816844 "Fix order dependency for setting titles": + Defer processing titles strings until DrawGraph(), so there is no + more order dependency (no need to set font before setting title strings). + + * Fixed bug 1819668 "Horiz. align multi-line text: GD vs TTF": + The new text routines draw TTF text line-by-line and correctly do + right-, center-, and left- alignment of each line within a text block. + + * Fixed bug 1826513 "FIXME in DrawLegend: Max label length": + Use actual width of widest legend line to calculate legend box size. + + * Partial fix for bug 945439 "x_tick_label_height not set correctly": + In FindDataLimits(), save the longest data label, not just its length, + and use the actual rendered size of that string in CalcMargins() for + the margin calculations. + Also take into account which of the tick or data labels are visible. + This is not a complete fix, but is a significant improvement. + + The following changes were made related to the above fixes: + + + Replaced internal function TTFBBoxSize(), which didn't work right, with + SizeText(). It returns the orthogonal bounding box of a block of text, + and works with both GD and TTF text. + + + DrawText() and SizeText() call a single function ProcessText(), which is + the only place GD text and TTF text are distinguished. (So eventually + we will be able to mix GD and TTF text on a plot.) + + + New internal functions ProcessTextGD() and ProcessTextTTF() draw (or size) + GD and TTF text respectively. These are only called by ProcessText(). + These are re-implementations which properly position and align text. + + + Removed class variables title_angle, x_title_angle, and y_title_angle. The + titles only work at their fixed angles anyway (0, 0, and 90 respectively). + + + Line spacing set with SetLineSpacing() now affects TTF text as well as + GD text. Previously, it only affected GD text. The default line spacing + happens to be usable for TTF text. + + + Added new callback hook 'debug_textbox' for developing, testing, and + documenting. It provides access to the text area bounding box. + + + Removed unneeded class variables x_tick_label_height, y_tick_label_width, + x_tot_margin, y_tot_margin. + +2007-11-25 + * Improve error handling: + Internal functions PrintError() and DrawError() are now the same. Both + will draw the error message into the image and output it, and then + trigger a user-level error. If no error handler has been set, it will + exit, as before. But now the error message should also get logged, or + written to the standard error stream, depending on the SAPI in use. + You can now establish an error handler to catch most PHPlot errors and + do some cleanup before exit. + + This fix also covers bug #1823774 "Default Font Path and Error Message + Output". + + Fixed the return value of most PHPlot functions, to return False on + error, else True. Since uncaught errors are fatal anyway, this only + affects code with an error handler that returns, which is not + recommended and unsupported at this time. These changes are for + possible future error handling options. + +2007-11-22 + * Fix bug 1836528 "Insufficient checking of parameter values": + Rewrote CheckOption to correctly validate option choices. + (It previously accepted substrings and other incorrect values.) + PHPlot methods that use CheckOption now must be called with valid option + values. Empty strings are also no longer accepted. + +2007-11-17 (lbayuk) + * Change to callbacks to support extra arguments. + The PHPlot class can now pass extra arguments to a callback function. + Callback functions now take the following form: + my_callback($img, $passthru_arg, ...) + Where '...' is zero or more additional arguments supplied by PHPlot to + the callback. Each implemented callback reason will define any + additional arguments it uses. The existing defined callbacks have not + changed and do not currently pass any extra arguments. + +2007-11-10 (lbayuk) + * Fix bug 1827263 "Spoiled up pie-chart if $val is close to zero": + Skip pie slices which would result in an integer angle of zero + degrees, because the GD arc filling function will draw a complete + circle for that case. + Credit to Viacheslav <webdeveloper.ua at gmail.com> for finding this. + + * Removed 8 of the functions (class methods) marked 'deprecated'. Only + deprecated functions which seem to have been for internal use have + been removed. Even old scripts shouldn't be using them, and they are + becoming a problem to maintain. + Removed: SetImageArea() DrawDotSeries() DrawLineSeries() CalcXHeights() + CalcYWidths() DrawLabels() InitImage() DrawDashedLine(). + +2007-10-20 (lbayuk) ===== Released as 5.0.4 ===== + * phplot.php: Updated copyright, version, and authors comments at top. + * README.txt: Updated for new release + * NEWS.txt: Add text for new release + +2007-10-18 (lbayuk) + * Add callbacks - experimental feature: + New functions SetCallback, GetCallback, RemoveCallback. + New internal function DoCallback. + Added callback hooks to DrawGraph. + + Re-arranged code in DrawGraph to bring pie chart drawing into the main + switch on plot type, rather than a special case in its own block. This + makes it easier to follow and easier to add callback hooks. + + * Callbacks: New file, documentation for the new callbacks feature. + (This won't be in the manual while it is an experimental feature.) + +2007-10-15 (lbayuk) + * Fix for bug 1813021: Miss-positioned right-justified vertical GD text. + Fixed DrawText() to correctly position 90 degree right-justified text + drawn in a fixed GD font. This could be seen with 90 degree Y tick + labels. (Found by accident while working on TrueType text problems.) + Also some code cleanup in DrawText: use elseif where appropriate. + +2007-10-09 (lbayuk) + * Code cleanup: Simplify SetIndexColor() and SetIndexDarkColor(). + There is no need to first try ImageColorExact, then ImageColorResolve + if that fails. ImageColorResolve does all that for us. + + Code cleanup: Rewrite SetRGBColor(). It now detects if an unrecognized + color name or color value form is used, and draws an error message. + Before this it would get a PHP index error and "headers already sent" + condition. + + * Code cleanup: Remove duplicated code for loading image files. + Added new class-private function GetImage() which loads an image based + on the image type, and also returns the image size. This replaces + duplicated code in tile_img() and SetInputFile(). + Also fixed comment at top of SetImageFile which said it was deprecated. + It isn't - it is used by the constructor. Moved the function out of the + 'deprecated' area up to below where it is used. + + * Code cleanup: PHPlot should not define or affect anything outside its + own class. + - Removed the check for __FUNCTION__ (PHP 4.3 and up). This is obsolete. + - Do not set error_reporting to E_ALL. Although it is recommended that + scripts do this, it is not the place of loaded classes to do it. + - Remove unused global constant TOTY. + - Removed constants MAXY and MINY. Global constants like this are bad. + These were used as magic index values into data[] to hold min and max Y + values for the row. Instead, put them in separate arrays which are + named data_miny[] and data_maxy[]. (This seems to be only used by the + data line drawing function.) + + Comment cleanup: Remove one commented-out partial function DrawPlotLabel, + and fix another commented-out code fragment in DrawYErrorBar. Both of + these had unmatched braces in them which caused a balance-braces check + to fail. + + * Code cleanup, array padding: Get rid of functions outside the class + and remove the interim fix for PHP 5 (which changed the behavior of + array_merge). Rewrote external function array_pad_array() as a new + class function pad_array(). It does not need access to the class, + but I don't think PHPlot should add to the global namespace more + than necessary. The third argument (array to use for padding) was + never used, so it was removed. It always pads the array with itself. + It now only works on 'usual integer indexed' arrays (0-based + sequential integer index). The was previously required but + undocumented for some of the arrays (like line_widths); now it is + required for all style arrays and will be documented. Now we can pad + the array to the required length, not just N times its previous + length, and we don't need array_merge. Deleted external function + array_merge_php4() as it is no longer used. + + Deleted PHP end marker ?>. You don't need this and it can cause + problems with extra whitespace in your output. + +2007-09-24 (lbayuk) + * Code cleanup: Fix ternary operator misuse. This doesn't change + behavior, but it was annoying me so I fixed it. + Replaced all cases of code like this: $a = ($a > $b) ? $b : $a + With just: if ($a > $b) $a = $b + + * Fix Makefile 'release' target to set owner/group when creating + the tar file. This avoids having to run it as root, but it needs + GNU tar to work. + +2007-09-08 (lbayuk) + * Fix for bug 1790441: Removed the PHPlot quasi-destructor function and + the register_shutdown_function() call which arranged for it to be used. + This was preventing release of memory when a PHPlot object was unset, + because the registered shutdown function held a reference to it. + So rather than improving memory use, it had the opposite effect. + Note: It is no longer necessary or recommended to use reference + assignment ($plot =& new PHPlot) for PHPlot object creation. + Thanks to annajilly for the thorough analysis, bug report, and fix. + +2007-09-05 (lbayuk) + * Rewrote FormatLabel() to ignore blank label values. Adapted from a + patch and feature request submitted by Gerhard Reithofer (exgerhardr). + Blank labels used to produce an error if the LabelType was set to + 'time', and zero if set to 'data'. Now they are just ignored. This + provides a simple way to have labels only at selected intervals when + using time or data formats. For example, you can have a date/time + label at every 10th data point by setting the labels for the other 9 + to be empty strings. Also: Removed $which_pos values 'plotx' and ... [truncated message content] |
From: <tim...@us...> - 2010-02-12 11:05:38
|
Revision: 3344 http://web-erp.svn.sourceforge.net/web-erp/?rev=3344&view=rev Author: tim_schofield Date: 2010-02-12 11:05:31 +0000 (Fri, 12 Feb 2010) Log Message: ----------- Paul: PO_Items.php - Incorrect number of decimal places shown for pricdes less than 1 Modified Paths: -------------- trunk/PO_Items.php trunk/doc/Change.log.html Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2010-02-12 10:57:39 UTC (rev 3343) +++ trunk/PO_Items.php 2010-02-12 11:05:31 UTC (rev 3344) @@ -7,8 +7,8 @@ include('includes/DefinePOClass.php'); include('includes/SQL_CommonFunctions.inc'); -/* Session started in header.inc for password checking - * and authorisation level check +/* Session started in header.inc for password checking + * and authorisation level check */ include('includes/session.inc'); $title = _('Purchase Order Items'); @@ -40,7 +40,7 @@ purchdata.suppliers_partno, stockmaster.pkg_type, stockmaster.units, - stockmaster.netweight, + stockmaster.netweight, stockmaster.kgs, stockmaster.volume FROM purchdata INNER JOIN stockmaster @@ -48,12 +48,12 @@ WHERE purchdata.stockid='" . $_POST['StockID2'] . "' AND purchdata.supplierno='".$_SESSION['PO'.$identifier]->SupplierID."'"; - $ErrMsg = _('The stock record of the stock selected') . ': ' . $_POST['Stock'] . ' ' . + $ErrMsg = _('The stock record of the stock selected') . ': ' . $_POST['Stock'] . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the supplier details and failed was'); $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); $myrow = DB_fetch_row($result); - + $_POST['ItemDescription'] = $myrow[0]; $_POST['suppliers_partno'] = $myrow[1]; $_POST['package'] = $myrow[2]; @@ -104,10 +104,10 @@ $date = date($_SESSION['DefaultDateFormat']); $StatusComment=$date.' - Order Created by <a href="mailto:'.$emailrow['email'].'">'.$_SESSION['PO'.$identifier]->Initiator. '</a> - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br>'; - + /*Get the order number */ $_SESSION['PO'.$identifier]->OrderNo = GetNextTransNo(18, $db); - + /*Insert to purchase order header record */ $sql = "INSERT INTO purchorders ( orderno, @@ -165,9 +165,9 @@ '" . $_SESSION['PO'.$identifier]->SupplierContact . "', '" . $_SESSION['PO'.$identifier]->supptel. "', '" . $_SESSION['PO'.$identifier]->contact . "', - '" . $_SESSION['PO'.$identifier]->version . "', + '" . $_SESSION['PO'.$identifier]->version . "', '" . FormatDateForSQL($date) . "', - '" . $_SESSION['PO'.$identifier]->deliveryby . "', + '" . $_SESSION['PO'.$identifier]->deliveryby . "', '" . 'Pending' . "', '" . $StatusComment . "', '" . FormatDateForSQL($_SESSION['PO'.$identifier]->deliverydate) . "', @@ -220,7 +220,7 @@ '" . $POLine->pcunit . "', '" . $POLine->nw . "', '" . $POLine->gw . "', - '" . $POLine->cuft . "', + '" . $POLine->cuft . "', '" . $POLine->total_quantity . "', '" . $POLine->total_amount . "' )"; @@ -230,7 +230,7 @@ } } /* end of the loop round the detail line items on the order */ echo '<p>'; - prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' . + prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' . $_SESSION['PO'.$identifier]->SupplierName . ' ' . _('has been created'),'success'); echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print') . '" alt="">' . ' ' . _('Print Purchase Order') . ''; @@ -246,7 +246,7 @@ initiator='" . $_SESSION['PO'.$identifier]->Initiator . "', requisitionno= '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', version= '" . $_SESSION['PO'.$identifier]->version . "', - deliveryby='" . $_SESSION['PO'.$identifier]->deliveryby . "', + deliveryby='" . $_SESSION['PO'.$identifier]->deliveryby . "', deliverydate='" . FormatDateForSQL($_SESSION['PO'.$identifier]->deliverydate) . "', revised= '" . FormatDateForSQL($date) . "', intostocklocation='" . $_SESSION['PO'.$identifier]->Location . "', @@ -413,7 +413,7 @@ If ($_POST['Keywords']) { //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - + if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, stockmaster.description, @@ -562,8 +562,8 @@ if ($_SESSION['PO'.$identifier]->GLLink==1) { /*Check for existance of GL Code selected */ - $sql = 'SELECT accountname - FROM chartmaster + $sql = 'SELECT accountname + FROM chartmaster WHERE accountcode =' . $_SESSION['PO'.$identifier]->LineItems[$_POST['LineNo']]->GLCode; $ErrMsg = _('The account name for') . ' ' . $_POST['GLCode'] . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the account details but failed was'); @@ -642,8 +642,8 @@ /*need to check GL Code is valid if GLLink is active */ if ($_SESSION['PO'.$identifier]->GLLink==1){ - $sql = 'SELECT accountname - FROM chartmaster + $sql = 'SELECT accountname + FROM chartmaster WHERE accountcode =' . (int) $_POST['GLCode']; $ErrMsg = _('The account details for') . ' ' . $_POST['GLCode'] . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the details of the account, but failed was'); @@ -691,7 +691,7 @@ 0, $GLAccountName, 2, - $_POST['itemno'], + $_POST['itemno'], $_POST['uom'], $_POST['suppliers_partno'], $_POST['subtotal_amount'], @@ -748,7 +748,7 @@ stockcategory.stockact, chartmaster.accountname, purchdata.price, - purchdata.conversionfactor, + purchdata.conversionfactor, purchdata.supplierdescription, purchdata.suppliersuom, purchdata.suppliers_partno, @@ -761,9 +761,9 @@ WHERE chartmaster.accountcode = stockcategory.stockact AND stockcategory.categoryid = stockmaster.categoryid AND stockmaster.stockid = '". $ItemCode . "' - AND purchdata.effectivefrom = - (SELECT max(effectivefrom) - FROM purchdata + AND purchdata.effectivefrom = + (SELECT max(effectivefrom) + FROM purchdata WHERE purchdata.stockid='". $ItemCode . "' AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "')"; } else { @@ -817,7 +817,7 @@ $myrow['kgs'], '', $Quantity, - $Quantity*$myrow['price'] + $Quantity*$myrow['price'] ); } else { /*There was no supplier purchasing data for the item selected so enter a purchase order line with zero price */ @@ -875,9 +875,9 @@ /*need to set up entry for item description where not a stock item and GL Codes */ if (count($_SESSION['PO'.$identifier]->LineItems)>0 and !isset($_GET['Edit'])){ - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt=""> '.$_SESSION['PO'.$identifier]->SupplierName; - + if (isset($_SESSION['PO'.$identifier]->OrderNo)) { echo ' ' . _('Purchase Order') .' '. $_SESSION['PO'.$identifier]->OrderNo ; } @@ -896,7 +896,7 @@ $_SESSION['PO'.$identifier]->total = 0; $k = 0; //row colour counter - + foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { if ($POLine->Deleted==False) { @@ -909,7 +909,7 @@ if ($POLine->Price > 1) { $DisplayPrice = number_format($POLine->Price,2,'.',''); } else { - $DisplayPrice = number_format($POLine->Price,2,'.',''); + $DisplayPrice = number_format($POLine->Price,4,'.',''); } $DisplayQuantity = number_format($POLine->Quantity,$POLine->DecimalPlaces,'.',''); @@ -920,8 +920,8 @@ echo '<tr class="OddTableRows">'; $k=1; } - $uomsql='SELECT conversionfactor, - suppliersuom, + $uomsql='SELECT conversionfactor, + suppliersuom, unitsofmeasure. unitname FROM purchdata @@ -960,9 +960,9 @@ echo '<br><div class="centre"><input type="submit" name="UpdateLines" value="Update Order Lines">'; echo '<br><input type="submit" name="Commit" value="Process Order">'; if (!isset($_POST['NewItem']) and isset($_GET['Edit'])) { - + /*show a form for putting in a new line item with or without a stock entry */ - + } } /*Only display the order line items if there are any !! */ @@ -972,10 +972,10 @@ echo '<td><input type=text name=ItemDescription size=40></td></tr>'; echo '<tr><td>'._('General Ledger Code').'</td>'; echo '<td><select name="GLCode">'; - $sql='SELECT - accountcode, - accountname - FROM chartmaster + $sql='SELECT + accountcode, + accountname + FROM chartmaster ORDER BY accountcode ASC'; $result=DB_query($sql, $db); while ($myrow=DB_fetch_array($result)) { @@ -1008,7 +1008,7 @@ $DbgMsg = _('The SQL used to retrieve the category details but failed was'); $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); - echo '<table><tr><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . + echo '<table><tr><p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Print') . '" alt="">' . ' ' . _('Search For Stock Items') . ''; echo ":</font></tr><tr><td><select name='StockCat'>"; @@ -1028,7 +1028,7 @@ if (!isset($_POST['Keywords'])) { $_POST['Keywords']=''; } - + if (!isset($_POST['StockCode'])) { $_POST['StockCode']=''; } @@ -1037,7 +1037,7 @@ <td><font size=2>' . _('Enter text extracts in the description') . ":</font></td> <td><input type='text' name='Keywords' size=20 maxlength=25 value='" . $_POST['Keywords'] . "'></td></tr> <tr><td></td> - <td><font size=3><b>" . _('OR') . ' </b></font><font size=2>' . _('Enter extract of the Stock Code') . + <td><font size=3><b>" . _('OR') . ' </b></font><font size=2>' . _('Enter extract of the Stock Code') . ":</font></td> <td><input type='text' name='StockCode' size=15 maxlength=18 value='" . $_POST['StockCode'] . "'></td> </tr> @@ -1081,7 +1081,7 @@ $filename = $myrow['stockid'] . '.jpg'; if (file_exists( $_SESSION['part_pics_dir'] . '/' . $filename) ) { - $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . + $ImageSource = '<img src="'.$rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $myrow['stockid'] . '.jpg" width="50" height="50">'; } else { @@ -1128,7 +1128,7 @@ /*$Maximum_Number_Of_Parts_To_Show defined in config.php */ - prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . + prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' . _('Please restrict your search to only the parts required'),'info'); } echo '<a name="end"></a><br><div class="centre"><input type="submit" name="NewItem" value="Order some"></div>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-12 10:57:39 UTC (rev 3343) +++ trunk/doc/Change.log.html 2010-02-12 11:05:31 UTC (rev 3344) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>12/02/10 Paul: PO_Items.php - Incorrect number of decimal places shown for pricdes less than 1</p> <p>12/02/10 Tim: Update phplot to the laterst version and remove reference to deprecated function eregi()</p> <p>12/02/10 Tim: Update php-gettext to the laterst version and remove reference to deprecated function eregi()</p> <p>12/02/10 Tim: Save.php - Replace deprecated function eregi</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-02-12 11:08:13
|
Revision: 3345 http://web-erp.svn.sourceforge.net/web-erp/?rev=3345&view=rev Author: tim_schofield Date: 2010-02-12 11:07:58 +0000 (Fri, 12 Feb 2010) Log Message: ----------- Thomas Timothy Lie: Completion of Indonesian translation Modified Paths: -------------- trunk/doc/Change.log.html trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-12 11:05:31 UTC (rev 3344) +++ trunk/doc/Change.log.html 2010-02-12 11:07:58 UTC (rev 3345) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>12/02/10 Thomas Timothy Lie: Completion of Indonesian translation</p> <p>12/02/10 Paul: PO_Items.php - Incorrect number of decimal places shown for pricdes less than 1</p> <p>12/02/10 Tim: Update phplot to the laterst version and remove reference to deprecated function eregi()</p> <p>12/02/10 Tim: Update php-gettext to the laterst version and remove reference to deprecated function eregi()</p> Modified: trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po 2010-02-12 11:05:31 UTC (rev 3344) +++ trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po 2010-02-12 11:07:58 UTC (rev 3345) @@ -1,28149 +1,32377 @@ -# Indonesian translation for weberp -# Copyright (c) (c) 2005 Canonical Ltd, and Rosetta Contributors 2005 -# This file is distributed under the same license as the weberp package. -# FIRST AUTHOR <EMAIL@ADDRESS>, 2005. +# Indonesian translations for PACKAGE package. +# Copyright (C) 2009 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Thomas Timothy Lie <tho...@gm...>, 2009. # msgid "" msgstr "" -"Project-Id-Version: weberp\\n" -"Report-Msgid-Bugs-To: \\n" -"POT-Creation-Date: 2009-02-09 09:25+0000\\n" -"PO-Revision-Date: 2006-05-01 23:21+0800\\n" -"Last-Translator: Sajatmiko<saj...@gm...>\\n" -"Language-Team: \\n" -"MIME-Version: 1.0\\n" -"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: weberp\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-10-03 16:20+0800\n" +"PO-Revision-Date: 2009-11-18 22:46+0700\n" +"Last-Translator: Thomas Timothy Lie <tho...@gm...>\n" +"Language-Team: www.baliboss.com <op...@ba...>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -"X-Rosetta-Version: 0.1\\n" -"Plural-Forms: nplurals=1; plural=0\n" -"X-Generator: Rosetta (http://launchpad.ubuntu.com/rosetta/)\n" -"X-Poedit-Language: Indonesian\n" -"X-Poedit-Country: INDONESIA\n" - -#: AccountGroups.php:8 index.php:1038 -msgid "Account Groups" -msgstr "Rekening Grup" - -#: AccountGroups.php:18 -#, fuzzy -msgid "" -"An error occurred in retrieving the account groups of the parent account " -"group during the check for recursion" -msgstr "" -"Sebuah kesalahan muncul ketika mengambil komponen dari BOM selama " -"pemeriksaan untuk rekursi" - -#: AccountGroups.php:19 -#, fuzzy -msgid "" -"The SQL that was used to retrieve the account groups of the parent account " -"group and that failed in the process was" -msgstr "" -"SQL yang digunakan untuk mengambil komponen dari BOM dan yang gagal dalam " -"proses adalah" - -#: AccountGroups.php:61 -#, fuzzy -msgid "The account group name already exists in the database" -msgstr "Nama rekening grup tidak berisi karakter yang dimaksud" - -#: AccountGroups.php:67 -msgid "The account group name cannot contain the character" -msgstr "Nama rekening grup tidak berisi karakter yang dimaksud" - -#: AccountGroups.php:67 AccountSections.php:74 PaymentMethods.php:37 -#: TaxCategories.php:30 TaxProvinces.php:30 UnitsOfMeasure.php:30 -msgid "or the character" -msgstr "atau karakter" - -#: AccountGroups.php:73 -#, fuzzy -msgid "The account group name must be at least one character long" -msgstr "Nama kontak harus lebih dari satu karakter" - -#: AccountGroups.php:80 -msgid "" -"The parent account group selected appears to result in a recursive account " -"structure - select an alternative parent account group or make this group a " -"top level account group" -msgstr "" - -#: AccountGroups.php:99 -msgid "The section in accounts must be an integer" -msgstr "Bagian dalam rekening-rekening harus dalam bentuk integer" - -#: AccountGroups.php:105 -msgid "The sequence in the trial balance must be an integer" -msgstr "Urutan dari neraca percobaan harus dalam bentuk integer." - -#: AccountGroups.php:111 -#, fuzzy -msgid "The sequence in the TB must be numeric and less than" -msgstr "Urutan dari neraca saldo harus kurang dari" - -#: AccountGroups.php:129 AccountSections.php:105 PaymentMethods.php:87 -msgid "Record Updated" -msgstr "Catatan telah diperbarui" - -#: AccountGroups.php:147 AccountSections.php:117 PaymentMethods.php:109 -msgid "Record inserted" -msgstr "Catatan telah masukkan" - -#: AccountGroups.php:167 -msgid "" -"Cannot delete this account group because general ledger accounts have been " -"created using this group" -msgstr "" -"Tidak dapat menghapus grup rekening ini karena rekenging buku besar telah " -"diciptakan dengan grup ini" - -#: AccountGroups.php:168 AccountGroups.php:176 AccountSections.php:138 -#: Areas.php:117 Areas.php:126 BankAccounts.php:149 CreditStatus.php:123 -#: Currencies.php:141 Currencies.php:149 Currencies.php:156 -#: CustomerBranches.php:284 CustomerBranches.php:294 CustomerBranches.php:304 -#: CustomerBranches.php:314 Customers.php:287 Customers.php:296 -#: Customers.php:304 Customers.php:312 CustomerTypes.php:131 -#: CustomerTypes.php:141 Factors.php:129 GLAccounts.php:90 GLAccounts.php:104 -#: Locations.php:217 Locations.php:225 Locations.php:234 Locations.php:242 -#: Locations.php:250 Locations.php:258 Locations.php:266 Locations.php:274 -#: PaymentMethods.php:141 PaymentTerms.php:145 PaymentTerms.php:152 -#: SalesCategories.php:125 SalesCategories.php:133 SalesPeople.php:142 -#: SalesPeople.php:149 SalesTypes.php:145 SalesTypes.php:155 Shippers.php:82 -#: Shippers.php:94 StockCategories.php:165 Stocks.php:442 Stocks.php:451 -#: Stocks.php:459 Stocks.php:467 Stocks.php:475 Stocks.php:483 -#: Suppliers.php:562 Suppliers.php:571 Suppliers.php:579 TaxCategories.php:130 -#: TaxGroups.php:126 TaxGroups.php:133 TaxProvinces.php:125 -#: UnitsOfMeasure.php:140 UnitsOfMeasure.php:147 WorkCentres.php:90 -#: WorkCentres.php:96 WWW_Access.php:84 -msgid "There are" -msgstr "Ada / Terdapat" - -#: AccountGroups.php:168 -msgid "general ledger accounts that refer to this account group" -msgstr "Rekening-rekening buku besar yang merujuk pada grup rekening ini" - -#: AccountGroups.php:175 -#, fuzzy -msgid "" -"Cannot delete this account group because it is a parent account group of " -"other account group(s)" -msgstr "" -"Tidak dapat menghapus rekening ini karena dipakai sebagai salah satu " -"rekening otoritas pajak" - -#: AccountGroups.php:176 -msgid "account groups that have this group as its/there parent account group" -msgstr "" - -#: AccountGroups.php:180 -msgid "group has been deleted" -msgstr "grup telah dihapus" - -#: AccountGroups.php:205 -msgid "Could not get account groups because" -msgstr "tidak dapat mengambil grup rekening karena" - -#: AccountGroups.php:210 -msgid "Group Name" -msgstr "Nama Grup" - -#: AccountGroups.php:211 EDIMessageFormat.php:140 -msgid "Section" -msgstr "Bagian" - -#: AccountGroups.php:212 AccountGroups.php:367 -msgid "Sequence In TB" -msgstr "Urutan di Neraca Saldo" - -#: AccountGroups.php:213 AccountGroups.php:351 GLProfit_Loss.php:8 -#: GLProfit_Loss.php:101 GLProfit_Loss.php:102 GLProfit_Loss.php:149 -#: SelectGLAccount.php:51 SelectGLAccount.php:65 -msgid "Profit and Loss" -msgstr "Laba dan Rugi" - -#: AccountGroups.php:214 AccountGroups.php:312 -#, fuzzy -msgid "Parent Group" -msgstr "Grup Segmen" - -#: AccountGroups.php:230 AccountGroups.php:233 AccountGroups.php:355 -#: AccountGroups.php:357 BOMs.php:127 BOMs.php:689 BOMs.php:691 -#: CompanyPreferences.php:436 CompanyPreferences.php:438 -#: CompanyPreferences.php:448 CompanyPreferences.php:450 -#: CompanyPreferences.php:460 CompanyPreferences.php:462 -#: CustomerBranches.php:398 Customers.php:526 Customers.php:723 -#: Customers.php:726 DeliveryDetails.php:750 DeliveryDetails.php:790 -#: DeliveryDetails.php:793 GLTransInquiry.php:71 Locations.php:341 -#: PaymentMethods.php:197 PaymentMethods.php:198 PaymentMethods.php:257 -#: PaymentMethods.php:263 PDFChequeListing.php:57 -#: PDFDeliveryDifferences.php:55 PDFDIFOT.php:61 PO_Header.php:555 -#: PO_PDFPurchOrder.php:325 PO_PDFPurchOrder.php:328 PurchData.php:229 -#: PurchData.php:375 PurchData.php:378 RecurringSalesOrders.php:469 -#: RecurringSalesOrders.php:472 SalesAnalReptCols.php:278 -#: SalesAnalReptCols.php:383 SalesAnalReptCols.php:386 SalesAnalRepts.php:404 -#: SalesAnalRepts.php:407 SalesAnalRepts.php:430 SalesAnalRepts.php:433 -#: SalesAnalRepts.php:456 SalesAnalRepts.php:459 SelectProduct.php:734 -#: ShipmentCosting.php:612 Stocks.php:795 Stocks.php:797 Stocks.php:809 -#: Stocks.php:811 SystemParameters.php:329 SystemParameters.php:400 -#: SystemParameters.php:408 SystemParameters.php:448 SystemParameters.php:521 -#: SystemParameters.php:529 SystemParameters.php:547 SystemParameters.php:554 -#: SystemParameters.php:663 SystemParameters.php:794 SystemParameters.php:796 -#: SystemParameters.php:806 SystemParameters.php:808 TaxGroups.php:295 -#: TaxGroups.php:364 TaxGroups.php:367 WWW_Users.php:536 WWW_Users.php:538 -msgid "Yes" -msgstr "Ya" - -#: AccountGroups.php:236 AccountGroups.php:360 AccountGroups.php:362 -#: BOMs.php:129 BOMs.php:688 BOMs.php:692 CompanyPreferences.php:435 -#: CompanyPreferences.php:439 CompanyPreferences.php:447 -#: CompanyPreferences.php:451 CompanyPreferences.php:459 -#: CompanyPreferences.php:463 CustomerBranches.php:398 Customers.php:525 -#: Customers.php:722 Customers.php:725 DeliveryDetails.php:751 -#: DeliveryDetails.php:791 DeliveryDetails.php:794 GLTransInquiry.php:125 -#: Locations.php:343 PaymentMethods.php:197 PaymentMethods.php:198 -#: PaymentMethods.php:258 PaymentMethods.php:264 PDFChequeListing.php:56 -#: PDFDeliveryDifferences.php:54 PDFDIFOT.php:60 PO_Header.php:555 -#: PO_PDFPurchOrder.php:326 PO_PDFPurchOrder.php:329 PurchData.php:232 -#: PurchData.php:376 PurchData.php:379 RecurringSalesOrders.php:468 -#: RecurringSalesOrders.php:471 SalesAnalReptCols.php:276 -#: SalesAnalReptCols.php:384 SalesAnalReptCols.php:387 SalesAnalRepts.php:403 -#: SalesAnalRepts.php:406 SalesAnalRepts.php:429 SalesAnalRepts.php:432 -#: SalesAnalRepts.php:455 SalesAnalRepts.php:458 SelectProduct.php:737 -#: ShipmentCosting.php:613 Stocks.php:790 Stocks.php:792 Stocks.php:804 -#: Stocks.php:806 SystemParameters.php:330 SystemParameters.php:401 -#: SystemParameters.php:409 SystemParameters.php:449 SystemParameters.php:522 -#: SystemParameters.php:530 SystemParameters.php:548 SystemParameters.php:555 -#: SystemParameters.php:664 SystemParameters.php:793 SystemParameters.php:797 -#: SystemParameters.php:805 SystemParameters.php:809 TaxGroups.php:297 -#: TaxGroups.php:365 TaxGroups.php:368 WWW_Users.php:535 WWW_Users.php:539 -#: includes/PDFLowGPPageHeader.inc:31 includes/PDFTaxPageHeader.inc:34 -msgid "No" -msgstr "Tidak" - -#: AccountGroups.php:245 AccountSections.php:195 AddCustomerContacts.php:121 -#: AddCustomerNotes.php:121 AddCustomerTypeNotes.php:121 Areas.php:162 -#: BankAccounts.php:202 BOMs.php:149 COGSGLPostings.php:107 -#: COGSGLPostings.php:212 CreditStatus.php:172 Currencies.php:232 -#: CustomerBranches.php:402 Customers.php:752 Customers.php:770 -#: CustomerTypes.php:184 EDIMessageFormat.php:161 FreightCosts.php:240 -#: GeocodeSetup.php:169 GLAccounts.php:317 GLTags.php:58 Locations.php:350 -#: PaymentMethods.php:199 PaymentTerms.php:200 Prices_Customer.php:200 -#: Prices.php:178 PurchData.php:242 SalesCategories.php:261 -#: SalesGLPostings.php:132 SalesGLPostings.php:244 SalesPeople.php:201 -#: SalesTypes.php:204 SelectCustomer.php:620 SelectCustomer.php:636 -#: SelectCustomer.php:668 SelectCustomer.php:684 SelectCustomer.php:715 -#: SelectCustomer.php:731 Shippers.php:142 StockCategories.php:227 -#: SupplierContacts.php:153 TaxAuthorities.php:165 TaxCategories.php:181 -#: TaxGroups.php:177 TaxProvinces.php:176 UnitsOfMeasure.php:199 -#: WorkCentres.php:138 WWW_Access.php:124 WWW_Users.php:276 -#: includes/InputSerialItems.php:82 -#, php-format -msgid "Edit" +"Plural-Forms: nplurals=1; plural=0\n" +"X-Poedit-Language: Indonesian\n" +"X-Poedit-Country: INDONESIA\n" +"X-Poedit-SourceCharset: iso-8859-1\n" + +#: AccountGroups.php:8 +#: index.php:1140 +msgid "Account Groups" +msgstr "Grup Rekening" + +#: AccountGroups.php:18 +msgid "An error occurred in retrieving the account groups of the parent account group during the check for recursion" +msgstr "Kesalahan terjadi saat mengambil grup rekening induk selama pemeriksaan untuk pengulangan (recursion)" + +#: AccountGroups.php:19 +msgid "The SQL that was used to retrieve the account groups of the parent account group and that failed in the process was" +msgstr "SQL yang digunakan untuk mengambil grup rekening induk dan yang gagal dalam proses adalah" + +#: AccountGroups.php:56 +#: AccountGroups.php:93 +msgid "The sql that was used to retrieve the information was" +msgstr "SQL yang digunakan untuk mengambil informasi adalah" + +#: AccountGroups.php:57 +msgid "Could not check whether the group exists because" +msgstr "Tidak dapat menentukan apakah grup tersebut ada karena" + +#: AccountGroups.php:64 +msgid "The account group name already exists in the database" +msgstr "Nama rekening grup tersebut sudah ada di database" + +#: AccountGroups.php:70 +msgid "The account group name cannot contain the character" +msgstr "Nama rekening grup tidak dapat berisi karakter" + +#: AccountGroups.php:70 +#: AccountSections.php:74 +#: PaymentMethods.php:37 +#: TaxCategories.php:30 +#: TaxProvinces.php:30 +#: UnitsOfMeasure.php:30 +msgid "or the character" +msgstr "atau karakter" + +#: AccountGroups.php:76 +msgid "The account group name must be at least one character long" +msgstr "Nama grup rekening minimum 1 karakter" + +#: AccountGroups.php:83 +msgid "The parent account group selected appears to result in a recursive account structure - select an alternative parent account group or make this group a top level account group" +msgstr "Grup rekening induk yang dipilih nampaknya mengakibatkan struktur rekening berulang (recursive) - pilih grup rekening induk yang lain atau jadikan grup ini grup rekening tingkat utama (top level)" + +#: AccountGroups.php:94 +msgid "Could not check whether the group is recursive because" +msgstr "Tidak dapat memeriksa apakah grupnya bersifat berulang (recursive) karena" + +#: AccountGroups.php:106 +msgid "The section in accounts must be an integer" +msgstr "Kelompok rekening harus bilangan bulat" + +#: AccountGroups.php:112 +msgid "The sequence in the trial balance must be an integer" +msgstr "Urutan dari neraca saldo harus bilangan bulat" + +#: AccountGroups.php:118 +msgid "The sequence in the TB must be numeric and less than" +msgstr "Urutan dari neraca saldo harus berupa angka dan kurang dari" + +#: AccountGroups.php:135 +msgid "An error occurred in updating the account group" +msgstr "Kesalahan terjadi saat memperbarui grup rekening" + +#: AccountGroups.php:136 +msgid "The SQL that was used to update the account group was" +msgstr "SQL yang digunakan untuk memperbaharui grup rekening adalah" + +#: AccountGroups.php:138 +#: AccountSections.php:105 +#: PaymentMethods.php:87 +msgid "Record Updated" +msgstr "Data telah diperbaharui" + +#: AccountGroups.php:156 +msgid "An error occurred in inserting the account group" +msgstr "Kesalahan terjadi saat memasukkan grup rekening" + +#: AccountGroups.php:157 +msgid "The SQL that was used to insert the account group was" +msgstr "SQL yang digunakan untuk memasukkan grup rekening adalah" + +#: AccountGroups.php:158 +#: AccountSections.php:117 +#: PaymentMethods.php:109 +msgid "Record inserted" +msgstr "Data telah dimasukkan" + +#: AccountGroups.php:175 +msgid "An error occurred in retrieving the group information from chartmaster" +msgstr "Kesalahan terjadi saat mengambil informasi grup dari tabel chartmaster" + +#: AccountGroups.php:176 +#: AccountGroups.php:186 +msgid "The SQL that was used to retrieve the information was" +msgstr "SQL yang digunakan untuk mengambil informasi adalah" + +#: AccountGroups.php:180 +msgid "Cannot delete this account group because general ledger accounts have been created using this group" +msgstr "Tidak dapat menghapus grup rekening ini karena rekening buku besar telah dibuat menggunakan grup ini" + +#: AccountGroups.php:181 +#: AccountGroups.php:191 +#: AccountSections.php:138 +#: Areas.php:116 +#: Areas.php:125 +#: BankAccounts.php:162 +#: CreditStatus.php:123 +#: Currencies.php:141 +#: Currencies.php:149 +#: Currencies.php:156 +#: CustomerBranches.php:293 +#: CustomerBranches.php:303 +#: CustomerBranches.php:313 +#: CustomerBranches.php:323 +#: Customers.php:290 +#: Customers.php:299 +#: Customers.php:307 +#: Customers.php:315 +#: CustomerTypes.php:150 +#: CustomerTypes.php:160 +#: Factors.php:129 +#: FixedAssetCategories.php:165 +#: FixedAssetItems.php:485 +#: FixedAssetItems.php:494 +#: FixedAssetItems.php:502 +#: FixedAssetItems.php:510 +#: FixedAssetItems.php:518 +#: FixedAssetItems.php:526 +#: GLAccounts.php:90 +#: GLAccounts.php:104 +#: Locations.php:217 +#: Locations.php:225 +#: Locations.php:234 +#: Locations.php:242 +#: Locations.php:250 +#: Locations.php:258 +#: Locations.php:266 +#: Locations.php:274 +#: MRPDemandTypes.php:84 +#: PaymentMethods.php:141 +#: PaymentTerms.php:148 +#: PaymentTerms.php:155 +#: SalesCategories.php:125 +#: SalesCategories.php:133 +#: SalesPeople.php:142 +#: SalesPeople.php:149 +#: SalesTypes.php:145 +#: SalesTypes.php:155 +#: Shippers.php:82 +#: Shippers.php:94 +#: StockCategories.php:153 +#: Stocks.php:467 +#: Stocks.php:476 +#: Stocks.php:484 +#: Stocks.php:492 +#: Stocks.php:500 +#: Stocks.php:508 +#: Suppliers.php:569 +#: Suppliers.php:578 +#: Suppliers.php:586 +#: TaxCategories.php:130 +#: TaxGroups.php:128 +#: TaxGroups.php:135 +#: TaxProvinces.php:125 +#: UnitsOfMeasure.php:140 +#: UnitsOfMeasure.php:147 +#: WorkCentres.php:90 +#: WorkCentres.php:96 +#: WWW_Access.php:84 +msgid "There are" +msgstr "Ada" + +#: AccountGroups.php:181 +msgid "general ledger accounts that refer to this account group" +msgstr "rekening buku besar yang mereferensi pada grup rekening ini" + +#: AccountGroups.php:185 +msgid "An error occurred in retrieving the parent group information" +msgstr "Kesalahan terjadi saat mengambil informasi grup induk" + +#: AccountGroups.php:190 +msgid "Cannot delete this account group because it is a parent account group of other account group(s)" +msgstr "Tidak dapat menghapus grup rekening ini karena digunakan sebagai induk dari grup rekening yang lain" + +#: AccountGroups.php:191 +msgid "account groups that have this group as its/there parent account group" +msgstr "grup rekening yang mempunyai grup ini sebagai grup rekening induk nya" + +#: AccountGroups.php:194 +msgid "An error occurred in deleting the account group" +msgstr "Kesalahan terjadi saat menghapus grup rekening" + +#: AccountGroups.php:195 +msgid "The SQL that was used to delete the account group was" +msgstr "SQL yang digunakan untuk menghapus grup rekening adalah" + +#: AccountGroups.php:197 +msgid "group has been deleted" +msgstr "grup telah dihapus" + +#: AccountGroups.php:222 +msgid "The sql that was used to retrieve the account group information was " +msgstr "SQL yang digunakan untuk mengambil informasi grup rekening adalah " + +#: AccountGroups.php:223 +msgid "Could not get account groups because" +msgstr "Tidak dapat mengambil grup rekening karena" + +#: AccountGroups.php:225 +#: AccountSections.php:176 +#: AddCustomerContacts.php:20 +#: AgedDebtors.php:455 +#: AgedSuppliers.php:267 +#: BOMListing.php:124 +#: BOMs.php:213 +#: BOMs.php:800 +#: DiscountCategories.php:11 +#: DiscountCategories.php:118 +#: DiscountMatrix.php:17 +#: FixedAssetJournal.php:333 +#: FixedAssetLocations.php:8 +#: FixedAssetRegister.php:11 +#: FixedAssetTransfer.php:31 +#: GLBalanceSheet.php:357 +#: GLBudgets.php:29 +#: GLJournal.php:236 +#: PO_AuthorisationLevels.php:9 +#: PO_SelectOSPurchOrder.php:139 +#: SelectCompletedOrder.php:13 +#: SelectCustomer.php:306 +#: SelectGLAccount.php:19 +#: SelectGLAccount.php:87 +#: SelectOrderItems.php:607 +#: SelectOrderItems.php:1351 +#: SelectOrderItems.php:1471 +#: SelectProduct.php:55 +#: SelectSalesOrder.php:159 +#: SelectSupplier.php:12 +#: SelectSupplier.php:225 +#: SelectWorkOrder.php:11 +#: SelectWorkOrder.php:154 +#: Suppliers.php:306 +#: TaxGroups.php:16 +#: WhereUsedInquiry.php:18 +#: WorkCentres.php:111 +#: WorkCentres.php:158 +#: WorkOrderEntry.php:11 +#: WWW_Users.php:28 +msgid "Search" +msgstr "Cari" + +#: AccountGroups.php:229 +msgid "Group Name" +msgstr "Nama Grup" + +#: AccountGroups.php:230 +#: EDIMessageFormat.php:140 +msgid "Section" +msgstr "Kelompok" + +#: AccountGroups.php:231 +#: AccountGroups.php:388 +msgid "Sequence In TB" +msgstr "Urutan di Neraca Saldo" + +#: AccountGroups.php:232 +#: AccountGroups.php:372 +#: GLProfit_Loss.php:8 +#: GLProfit_Loss.php:106 +#: GLProfit_Loss.php:107 +#: GLProfit_Loss.php:154 +#: SelectGLAccount.php:53 +#: SelectGLAccount.php:67 +msgid "Profit and Loss" +msgstr "Laba/Rugi" + +#: AccountGroups.php:233 +#: AccountGroups.php:333 +msgid "Parent Group" +msgstr "Grup Induk" + +#: AccountGroups.php:249 +#: AccountGroups.php:252 +#: AccountGroups.php:376 +#: AccountGroups.php:378 +#: BankAccounts.php:216 +#: BankAccounts.php:359 +#: BankAccounts.php:361 +#: BankAccounts.php:365 +#: BOMs.php:127 +#: BOMs.php:711 +#: BOMs.php:713 +#: CompanyPreferences.php:436 +#: CompanyPreferences.php:438 +#: CompanyPreferences.php:448 +#: CompanyPreferences.php:450 +#: CompanyPreferences.php:460 +#: CompanyPreferences.php:462 +#: CustLoginSetup.php:573 +#: CustLoginSetup.php:575 +#: CustomerBranches.php:406 +#: Customers.php:534 +#: Customers.php:731 +#: Customers.php:734 +#: DeliveryDetails.php:966 +#: DeliveryDetails.php:1006 +#: DeliveryDetails.php:1009 +#: GLTransInquiryNew.php:71 +#: GLTransInquiry.php:71 +#: Locations.php:341 +#: MRPCalendar.php:216 +#: MRP.php:539 +#: MRP.php:543 +#: MRP.php:547 +#: PaymentMethods.php:197 +#: PaymentMethods.php:198 +#: PaymentMethods.php:257 +#: PaymentMethods.php:263 +#: PDFChequeListing.php:57 +#: PDFDeliveryDifferences.php:58 +#: PDFDIFOT.php:61 +#: PO_AuthorisationLevels.php:92 +#: PO_Header.php:816 +#: PO_PDFPurchOrder.php:352 +#: PO_PDFPurchOrder.php:355 +#: PurchData.php:231 +#: PurchData.php:392 +#: PurchData.php:395 +#: RecurringSalesOrders.php:473 +#: RecurringSalesOrders.php:476 +#: SalesAnalReptCols.php:278 +#: SalesAnalReptCols.php:383 +#: SalesAnalReptCols.php:386 +#: SalesAnalRepts.php:404 +#: SalesAnalRepts.php:407 +#: SalesAnalRepts.php:430 +#: SalesAnalRepts.php:433 +#: SalesAnalRepts.php:456 +#: SalesAnalRepts.php:459 +#: SelectProduct.php:732 +#: ShipmentCosting.php:612 +#: Stocks.php:837 +#: Stocks.php:839 +#: Stocks.php:857 +#: Stocks.php:859 +#: SystemParameters.php:351 +#: SystemParameters.php:427 +#: SystemParameters.php:435 +#: SystemParameters.php:475 +#: SystemParameters.php:548 +#: SystemParameters.php:556 +#: SystemParameters.php:574 +#: SystemParameters.php:581 +#: SystemParameters.php:690 +#: SystemParameters.php:821 +#: SystemParameters.php:823 +#: SystemParameters.php:833 +#: SystemParameters.php:835 +#: SystemParameters.php:848 +#: SystemParameters.php:860 +#: SystemParameters.php:862 +#: TaxGroups.php:291 +#: TaxGroups.php:294 +#: TaxGroups.php:343 +#: WWW_Users.php:573 +#: WWW_Users.php:575 +msgid "Yes" +msgstr "Ya" + +#: AccountGroups.php:255 +#: AccountGroups.php:381 +#: AccountGroups.php:383 +#: BankAccounts.php:214 +#: BankAccounts.php:359 +#: BankAccounts.php:361 +#: BankAccounts.php:365 +#: BOMs.php:129 +#: BOMs.php:710 +#: BOMs.php:714 +#: CompanyPreferences.php:435 +#: CompanyPreferences.php:439 +#: CompanyPreferences.php:447 +#: CompanyPreferences.php:451 +#: CompanyPreferences.php:459 +#: CompanyPreferences.php:463 +#: CustLoginSetup.php:572 +#: CustLoginSetup.php:576 +#: CustomerBranches.php:406 +#: Customers.php:533 +#: Customers.php:730 +#: Customers.php:733 +#: DeliveryDetails.php:967 +#: DeliveryDetails.php:1007 +#: DeliveryDetails.php:1010 +#: GLTransInquiryNew.php:128 +#: GLTransInquiry.php:125 +#: Locations.php:343 +#: MRPCalendar.php:218 +#: MRP.php:533 +#: MRP.php:537 +#: MRP.php:541 +#: MRP.php:545 +#: PaymentMethods.php:197 +#: PaymentMethods.php:198 +#: PaymentMethods.php:258 +#: PaymentMethods.php:264 +#: PDFChequeListing.php:56 +#: PDFDeliveryDifferences.php:57 +#: PDFDIFOT.php:60 +#: PO_AuthorisationLevels.php:94 +#: PO_Header.php:816 +#: PO_PDFPurchOrder.php:353 +#: PO_PDFPurchOrder.php:356 +#: PurchData.php:234 +#: PurchData.php:393 +#: PurchData.php:396 +#: RecurringSalesOrders.php:472 +#: RecurringSalesOrders.php:475 +#: SalesAnalReptCols.php:276 +#: SalesAnalReptCols.php:384 +#: SalesAnalReptCols.php:387 +#: SalesAnalRepts.php:403 +#: SalesAnalRepts.php:406 +#: SalesAnalRepts.php:429 +#: SalesAnalRepts.php:432 +#: SalesAnalRepts.php:455 +#: SalesAnalRepts.php:458 +#: SelectProduct.php:735 +#: ShipmentCosting.php:613 +#: Stocks.php:832 +#: Stocks.php:834 +#: Stocks.php:852 +#: Stocks.php:854 +#: SystemParameters.php:352 +#: SystemParameters.php:428 +#: SystemParameters.php:436 +#: SystemParameters.php:476 +#: SystemParameters.php:549 +#: SystemParameters.php:557 +#: SystemParameters.php:575 +#: SystemParameters.php:582 +#: SystemParameters.php:691 +#: SystemParameters.php:820 +#: SystemParameters.php:824 +#: SystemParameters.php:832 +#: SystemParameters.php:836 +#: SystemParameters.php:849 +#: SystemParameters.php:859 +#: SystemParameters.php:863 +#: TaxGroups.php:292 +#: TaxGroups.php:295 +#: TaxGroups.php:345 +#: WWW_Users.php:572 +#: WWW_Users.php:576 +#: includes/PDFLowGPPageHeader.inc:31 +#: includes/PDFTaxPageHeader.inc:34 +msgid "No" +msgstr "No" + +#: AccountGroups.php:264 +#: AccountSections.php:196 +#: AddCustomerContacts.php:125 +#: AddCustomerNotes.php:124 +#: AddCustomerTypeNotes.php:121 +#: Areas.php:161 +#: BankAccounts.php:225 +#: BOMs.php:149 +#: COGSGLPostings.php:107 +#: COGSGLPostings.php:212 +#: CreditStatus.php:172 +#: Currencies.php:232 +#: CustLoginSetup.php:296 +#: CustomerBranches.php:410 +#: Customers.php:760 +#: Customers.php:778 +#: CustomerTypes.php:205 +#: EDIMessageFormat.php:161 +#: FixedAssetCategories.php:225 +#: FixedAssetLocations.php:39 +#: FreightCosts.php:240 +#: GeocodeSetup.php:165 +#: GLAccounts.php:317 +#: GLTags.php:58 +#: Locations.php:350 +#: MRPDemands.php:308 +#: MRPDemandTypes.php:116 +#: PaymentMethods.php:199 +#: PaymentTerms.php:203 +#: PO_AuthorisationLevels.php:102 +#: Prices_Customer.php:200 +#: Prices.php:178 +#: PurchData.php:244 +#: SalesCategories.php:261 +#: SalesGLPostings.php:133 +#: SalesGLPostings.php:245 +#: SalesPeople.php:201 +#: SalesTypes.php:204 +#: SelectCustomer.php:643 +#: SelectCustomer.php:659 +#: SelectCustomer.php:691 +#: SelectCustomer.php:707 +#: SelectCustomer.php:738 +#: SelectCustomer.php:754 +#: Shippers.php:142 +#: StockCategories.php:215 +#: SupplierContacts.php:153 +#: TaxAuthorities.php:165 +#: TaxCategories.php:181 +#: TaxGroups.php:179 +#: TaxProvinces.php:176 +#: UnitsOfMeasure.php:199 +#: WorkCentres.php:138 +#: WWW_Access.php:124 +#: WWW_Users.php:287 +#: includes/InputSerialItems.php:82 +#, php-format +msgid "Edit" msgstr "Edit" - -#: AccountGroups.php:246 AccountSections.php:199 AddCustomerContacts.php:122 -#: AddCustomerNotes.php:122 AddCustomerTypeNotes.php:122 Areas.php:163 -#: BankAccounts.php:203 BOMs.php:151 COGSGLPostings.php:108 -#: COGSGLPostings.php:213 Credit_Invoice.php:369 CreditStatus.php:173 -#: Currencies.php:235 CustomerReceipt.php:793 Customers.php:771 -#: CustomerTypes.php:185 DiscountCategories.php:115 DiscountMatrix.php:116 -#: EDIMessageFormat.php:162 FreightCosts.php:241 GeocodeSetup.php:170 -#: GLAccounts.php:318 GLJournal.php:395 Locations.php:351 -#: PaymentMethods.php:200 Payments.php:829 PaymentTerms.php:201 -#: PO_Items.php:858 Prices_Customer.php:201 Prices.php:179 PurchData.php:243 -#: SalesAnalReptCols.php:293 SalesAnalRepts.php:303 SalesCategories.php:262 -#: SalesGLPostings.php:133 SalesGLPostings.php:245 SalesPeople.php:202 -#: SalesTypes.php:205 SelectCreditItems.php:757 SelectCustomer.php:621 -#: SelectCustomer.php:637 SelectCustomer.php:669 SelectCustomer.php:685 -#: SelectCustomer.php:716 SelectCustomer.php:732 SelectOrderItems.php:1182 -#: Shipments.php:418 Shippers.php:143 SpecialOrder.php:580 -#: StockCategories.php:228 StockCategories.php:509 SuppCreditGRNs.php:89 -#: SuppInvGLAnalysis.php:65 SuppInvGRNs.php:128 SupplierContacts.php:154 -#: SuppShiptChgs.php:80 SuppTransGLAnalysis.php:107 TaxAuthorities.php:166 -#: TaxCategories.php:182 TaxGroups.php:178 TaxProvinces.php:177 -#: UnitsOfMeasure.php:200 WorkCentres.php:139 WWW_Access.php:125 -#: WWW_Users.php:277 includes/InputSerialItemsKeyed.php:53 -#, php-format -msgid "Delete" + +#: AccountGroups.php:265 +#: AccountSections.php:200 +#: AddCustomerContacts.php:126 +#: AddCustomerNotes.php:125 +#: AddCustomerTypeNotes.php:122 +#: Areas.php:162 +#: BankAccounts.php:226 +#: BOMs.php:151 +#: COGSGLPostings.php:108 +#: COGSGLPostings.php:213 +#: Credit_Invoice.php:371 +#: CreditStatus.php:173 +#: Currencies.php:235 +#: CustLoginSetup.php:297 +#: CustomerReceipt.php:798 +#: Customers.php:779 +#: CustomerTypes.php:206 +#: DiscountCategories.php:200 +#: DiscountMatrix.php:172 +#: EDIMessageFormat.php:162 +#: FixedAssetCategories.php:226 +#: FixedAssetJournal.php:391 +#: FreightCosts.php:241 +#: GeocodeSetup.php:166 +#: GLAccounts.php:318 +#: GLJournal.php:393 +#: Locations.php:351 +#: MRPDemands.php:309 +#: MRPDemandTypes.php:117 +#: PaymentMethods.php:200 +#: Payments.php:859 +#: PaymentTerms.php:204 +#: PO_AuthorisationLevels.php:104 +#: PO_Items.php:922 +#: Prices_Customer.php:201 +#: Prices.php:179 +#: PurchData.php:245 +#: SalesAnalReptCols.php:293 +#: SalesAnalRepts.php:303 +#: SalesCategories.php:262 +#: SalesGLPostings.php:134 +#: SalesGLPostings.php:246 +#: SalesPeople.php:202 +#: SalesTypes.php:205 +#: SelectCreditItems.php:762 +#: SelectCustomer.php:644 +#: SelectCustomer.php:660 +#: SelectCustomer.php:692 +#: SelectCustomer.php:708 +#: SelectCustomer.php:739 +#: SelectCustomer.php:755 +#: SelectOrderItems.php:1285 +#: Shipments.php:422 +#: Shippers.php:143 +#: SpecialOrder.php:584 +#: StockCategories.php:216 +#: StockCategories.php:497 +#: SuppCreditGRNs.php:89 +#: SuppInvGLAnalysis.php:65 +#: SuppInvGRNs.php:128 +#: SupplierContacts.php:154 +#: SuppShiptChgs.php:80 +#: SuppTransGLAnalysis.php:107 +#: TaxAuthorities.php:166 +#: TaxCategories.php:182 +#: TaxGroups.php:180 +#: TaxProvinces.php:177 +#: UnitsOfMeasure.php:200 +#: WorkCentres.php:139 +#: WOSerialNos.php:296 +#: WWW_Access.php:125 +#: WWW_Users.php:288 +#: includes/InputSerialItemsKeyed.php:53 +#, php-format +msgid "Delete" msgstr "Hapus" - -#: AccountGroups.php:254 -msgid "Review Account Groups" -msgstr "Tinjau Grup-grup rekening" - -#: AccountGroups.php:285 GLAccounts.php:244 GLAccounts.php:297 -#: Z_ImportGLAccountGroups.php:27 -msgid "Account Group" -msgstr "Grup Rekening" - -#: AccountGroups.php:309 -#, fuzzy -msgid "Account Group Name" -msgstr "Nama Grup Rekening" - -#: AccountGroups.php:319 AccountGroups.php:321 -msgid "Top Level Group" -msgstr "" - -#: AccountGroups.php:335 -msgid "Section In Accounts" -msgstr "Bagian dalam Rekening-rekening" - -#: AccountGroups.php:374 AccountSections.php:262 AddCustomerContacts.php:182 -#: AddCustomerNotes.php:182 AddCustomerTypeNotes.php:182 Areas.php:218 -#: BankAccounts.php:316 BOMs.php:701 COGSGLPostings.php:341 -#: CreditStatus.php:240 Currencies.php:331 DiscountCategories.php:143 -#: DiscountMatrix.php:167 EDIMessageFormat.php:253 FreightCosts.php:336 -#: GeocodeSetup.php:265 GLAccounts.php:267 Locations.php:516 -#: PaymentMethods.php:269 PaymentTerms.php:274 Prices_Customer.php:243 -#: SalesAnalReptCols.php:465 SalesAnalRepts.php:494 SalesGLPostings.php:411 -#: SalesPeople.php:292 Shippers.php:195 StockCategories.php:528 -#: SupplierContacts.php:249 TaxAuthorities.php:303 TaxCategories.php:231 -#: TaxProvinces.php:226 UnitsOfMeasure.php:250 WorkCentres.php:260 -#: WWW_Users.php:557 -msgid "Enter Information" -msgstr "Masukkan Informasi" - -#: AccountSections.php:8 index.php:1043 -msgid "Account Sections" -msgstr "Tahap pengitungan" - -#: AccountSections.php:67 -#, fuzzy -msgid "The account section already exists in the database" -msgstr "Bagian kode yang dimasukkan tidak ada dalam database" - -#: AccountSections.php:74 -msgid "The account section name cannot contain the character" -msgstr "Nama rekening grup tidak dapat berisi karakter yang dimaksud" - -#: AccountSections.php:80 -#, fuzzy -msgid "The account section name must contain at least one character" -msgstr "Nama rekening grup tidak dapat berisi karakter yang dimaksud" - -#: AccountSections.php:86 AccountSections.php:92 -msgid "The section number must be an integer" -msgstr "Bagian dalam rekening-rekening harus dalam bentuk bilangan bulat" - -#: AccountSections.php:137 -msgid "" -"Cannot delete this account section because general ledger accounts groups " -"have been created using this section" -msgstr "" -"Tidak dapat menghapus grup rekening ini karena rekening buku besar telah " -"diciptakan dalam grup ini" - -#: AccountSections.php:138 -msgid "general ledger accounts groups that refer to this account section" -msgstr "" -"Kode-kode pada buku kas besar yang termasuk dalam code keuangan tersebut" - -#: AccountSections.php:149 -msgid "section has been deleted" -msgstr "section telah dihapus" - -#: AccountSections.php:174 -msgid "Could not get account group sections because" -msgstr "kode keuangan tidak dapat di temukan karena" - -#: AccountSections.php:179 AccountSections.php:237 AccountSections.php:254 -msgid "Section Number" -msgstr "Nomor Nagian" - -#: AccountSections.php:180 AccountSections.php:257 -msgid "Section Description" -msgstr "Keterangan barang" - -#: AccountSections.php:197 -msgid "Restricted" -msgstr "terbatas" - -#: AccountSections.php:208 -msgid "Review Account Sections" -msgstr "Tinjau ulang Grup-grup rekening" - -#: AccountSections.php:227 -msgid "Could not retrieve the requested section please try again." -msgstr "Tidak dapat mengambil informasi yang diminta karena" - -#: AddCustomerContacts.php:5 AddCustomerContacts.php:48 SelectCustomer.php:613 -#: SelectCustomer.php:653 -#, fuzzy -msgid "Customer Contacts" -msgstr "permintaan konsumen" - -#: AddCustomerContacts.php:19 CustEDISetup.php:10 Customers.php:385 -#: Z_CheckDebtorsControl.php:20 -#, fuzzy -msgid "Back to Customers" -msgstr "Cari Pelanggan" - -#: AddCustomerContacts.php:30 -#, fuzzy -msgid "The Contact must be an integer." -msgstr "Kode rekening harus berupa integer" - -#: AddCustomerContacts.php:33 -#, fuzzy -msgid "The contact's name must be forty characters or less long" -msgstr "Nama rekening maksimum lima puluh karakter" - -#: AddCustomerContacts.php:36 -#, fuzzy -msgid "The contact's name may not be empty" -msgstr "Nama rekening bank tidak boleh kosong karena" - -#: AddCustomerContacts.php:48 AddCustomerNotes.php:48 -#: AddCustomerTypeNotes.php:48 Areas.php:74 CustomerTypes.php:48 -#: DeliveryDetails.php:476 Factors.php:59 PO_Items.php:208 -#: SalesAnalReptCols.php:128 SalesPeople.php:92 SalesTypes.php:61 -#: Stocks.php:335 Suppliers.php:475 -msgid "has been updated" -msgstr "telah diperbarui" - -#: AddCustomerContacts.php:59 -#, fuzzy -msgid "The contact record has been added" -msgstr "Rekaman matriks diskon telah ditambahkan" - -#: AddCustomerContacts.php:83 -#, fuzzy -msgid "The contact record has been deleted" -msgstr "Rekaman matriks diskon telah dihapus" - -#: AddCustomerContacts.php:93 -#, fuzzy -msgid "Contacts for Customer: <b>" -msgstr "dan untuk Pelanggan" - -#: AddCustomerContacts.php:102 CompanyPreferences.php:226 -#: CustomerBranches.php:365 Customers.php:748 Customers.php:799 -#: SalesPeople.php:183 SelectCustomer.php:616 SuppInvGLAnalysis.php:49 -#: SuppInvGLAnalysis.php:73 SupplierContacts.php:141 SupplierCredit.php:303 -#: SupplierInvoice.php:298 SuppTransGLAnalysis.php:91 -#: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 -#: includes/PDFTaxPageHeader.inc:36 -msgid "Name" + +#: AccountGroups.php:273 +msgid "Review Account Groups" +msgstr "Tinjau Semua Grup Rekening" + +#: AccountGroups.php:291 +msgid "An error occurred in retrieving the account group information" +msgstr "Kesalahan terjadi saat mengambil informasi grup rekening" + +#: AccountGroups.php:292 +msgid "The SQL that was used to retrieve the account group and that failed in the process was" +msgstr "SQL yang digunakan untuk mengambil grup rekening dan yang gagal dalam proses adalah" + +#: AccountGroups.php:306 +#: GLAccounts.php:244 +#: GLAccounts.php:297 +#: Z_ImportGLAccountGroups.php:27 +msgid "Account Group" +msgstr "Grup Rekening" + +#: AccountGroups.php:330 +msgid "Account Group Name" +msgstr "Nama Grup Rekening" + +#: AccountGroups.php:340 +#: AccountGroups.php:342 +msgid "Top Level Group" +msgstr "Grup Tingkat Utama (Top Level)" + +#: AccountGroups.php:356 +msgid "Section In Accounts" +msgstr "Kelompok Rekening" + +#: AccountGroups.php:395 +#: AccountSections.php:262 +#: AddCustomerContacts.php:201 +#: AddCustomerNotes.php:200 +#: AddCustomerTypeNotes.php:183 +#: Areas.php:217 +#: BankAccounts.php:371 +#: BOMs.php:723 +#: COGSGLPostings.php:341 +#: CreditStatus.php:243 +#: Currencies.php:331 +#: CustLoginSetup.php:594 +#: DiscountMatrix.php:135 +#: EDIMessageFormat.php:253 +#: FixedAssetCategories.php:449 +#: FixedAssetLocations.php:63 +#: FreightCosts.php:336 +#: GeocodeSetup.php:261 +#: GLAccounts.php:267 +#: Locations.php:516 +#: MRPDemands.php:424 +#: MRPDemandTypes.php:175 +#: PaymentMethods.php:269 +#: PaymentTerms.php:277 +#: PO_AuthorisationLevels.php:150 +#: Prices_Customer.php:243 +#: SalesAnalReptCols.php:465 +#: SalesAnalRepts.php:494 +#: SalesGLPostings.php:412 +#: SalesPeople.php:292 +#: Shippers.php:195 +#: StockCategories.php:516 +#: SupplierContacts.php:249 +#: TaxAuthorities.php:303 +#: TaxCategories.php:231 +#: TaxProvinces.php:226 +#: UnitsOfMeasure.php:250 +#: WorkCentres.php:260 +#: WWW_Users.php:593 +msgid "Enter Information" +msgstr "Masukkan Informasi" + +#: AccountSections.php:8 +#: index.php:1145 +msgid "Account Sections" +msgstr "Kelompok Rekening" + +#: AccountSections.php:67 +msgid "The account section already exists in the database" +msgstr "Kelompok rekening tersebut sudah ada di database" + +#: AccountSections.php:74 +msgid "The account section name cannot contain the character" +msgstr "Nama kelompok rekening tidak dapat berisi karakter" + +#: AccountSections.php:80 +msgid "The account section name must contain at least one character" +msgstr "Nama kelompok rekening minimum 1 karakter" + +#: AccountSections.php:86 +#: AccountSections.php:92 +msgid "The section number must be an integer" +msgstr "Nomor kelompok rekening harus bilangan bulat" + +#: AccountSections.php:137 +msgid "Cannot delete this account section because general ledger accounts groups have been created using this section" +msgstr "Tidak dapat menghapus kelompok rekening ini karena grup rekening buku besar telah dibuat menggunakan kelompok ini" + +#: AccountSections.php:138 +msgid "general ledger accounts groups that refer to this account section" +msgstr "rekening buku besar yang mereferensi pada kelompok rekening tersebut" + +#: AccountSections.php:149 +msgid "section has been deleted" +msgstr "kelompok telah dihapus" + +#: AccountSections.php:174 +msgid "Could not get account group sections because" +msgstr "Tidak dapat mengambil kelompok grup rekening karena" + +#: AccountSections.php:180 +#: AccountSections.php:238 +#: AccountSections.php:255 +msgid "Section Number" +msgstr "Nomor Kelompok" + +#: AccountSections.php:181 +#: AccountSections.php:258 +msgid "Section Description" +msgstr "Keterangan Kelompok" + +#: AccountSections.php:198 +msgid "Restricted" +msgstr "Terbatas" + +#: AccountSections.php:209 +msgid "Review Account Sections" +msgstr "Tinjau Semua Kelompok Rekening" + +#: AccountSections.php:228 +msgid "Could not retrieve the requested section please try again." +msgstr "Tidak dapat mengambil kelompok yang diminta, silahkan coba kembali." + +#: AddCustomerContacts.php:5 +#: AddCustomerContacts.php:49 +#: SelectCustomer.php:636 +#: SelectCustomer.php:676 +msgid "Customer Contacts" +msgstr "Kontak Person Customer" + +#: AddCustomerContacts.php:19 +#: CustEDISetup.php:10 +#: CustLoginSetup.php:20 +#: Z_CheckDebtorsControl.php:20 +msgid "Back to Customers" +msgstr "Kembali ke Data Customer" + +#: AddCustomerContacts.php:31 +msgid "The Contact must be an integer." +msgstr "Kontak Person tersebut harus bilangan bulat" + +#: AddCustomerContacts.php:34 +msgid "The contact's name must be forty characters or less long" +msgstr "Nama kontak person maksimum 40 karakter" + +#: AddCustomerContacts.php:37 +msgid "The contact's name may not be empty" +msgstr "Nama kontak person tidak boleh kosong" + +#: AddCustomerContacts.php:49 +#: AddCustomerNotes.php:48 +#: AddCustomerTypeNotes.php:48 +#: Areas.php:73 +#: CustomerTypes.php:67 +#: DeliveryDetails.php:672 +#: Factors.php:59 +#: FixedAssetItems.php:353 +#: PO_Items.php:357 +#: SalesAnalReptCols.php:128 +#: SalesPeople.php:92 +#: SalesTypes.php:61 +#: Stocks.php:353 +#: Suppliers.php:482 +msgid "has been updated" +msgstr "telah diperbarui" + +#: AddCustomerContacts.php:60 +msgid "The contact record has been added" +msgstr "Data kontak person telah ditambahkan" + +#: AddCustomerContacts.php:87 +msgid "The contact record has been deleted" +msgstr "Data kontak person telah dihapus" + +#: AddCustomerContacts.php:97 +msgid "Contacts for Customer: <b>" +msgstr "Kontak Person untuk Customer : <b>" + +#: AddCustomerContacts.php:106 +#: CompanyPreferences.php:226 +#: CustomerBranches.php:373 +#: Customers.php:756 +#: Customers.php:807 +#: SalesPeople.php:183 +#: SelectCustomer.php:639 +#: SuppInvGLAnalysis.php:49 +#: SuppInvGLAnalysis.php:73 +#: SupplierContacts.php:141 +#: SupplierCredit.php:303 +#: SupplierInvoice.php:308 +#: SuppTransGLAnalysis.php:91 +#: includes/InputSerialItemsFile.php:84 +#: includes/InputSerialItemsFile.php:124 +#: includes/PDFTaxPageHeader.inc:36 +msgid "Name" msgstr "Nama" - -#: AddCustomerContacts.php:103 AddCustomerContacts.php:175 Customers.php:749 -#: Customers.php:800 SelectCustomer.php:617 WWW_Access.php:108 -#: WWW_Access.php:168 -msgid "Role" -msgstr "Pengaturan" - -#: AddCustomerContacts.php:104 Customers.php:801 -#, fuzzy -msgid "Phone no" -msgstr "No. Telp." - -#: AddCustomerContacts.php:105 AddCustomerContacts.php:179 Customers.php:751 -#: Customers.php:802 SelectCustomer.php:619 SystemParameters.php:270 -msgid "Notes" -msgstr "Catatan " - -#: AddCustomerContacts.php:139 -msgid "Review all contacts for this Customer" -msgstr "" - -#: AddCustomerContacts.php:168 -#, fuzzy -msgid "Contact Code" -msgstr "Kode Kat" - -#: AddCustomerContacts.php:173 Factors.php:212 Factors.php:230 -#: SupplierContacts.php:217 -msgid "Contact Name" -msgstr "Nama Kontak" - -#: AddCustomerContacts.php:177 PO_Header.php:511 SelectCreditItems.php:234 -#: SelectCustomer.php:444 SelectOrderItems.php:583 -#: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:81 -#: includes/PDFTransPageHeaderPortrait.inc:104 -msgid "Phone" -msgstr "Telepon" - -#: AddCustomerNotes.php:5 AddCustomerNotes.php:48 SelectCustomer.php:661 -#: SelectCustomer.php:700 -#, fuzzy -msgid "Customer Notes" -msgstr "Kode Pelanggan" - -#: AddCustomerNotes.php:19 AddCustomerTypeNotes.php:19 -#, fuzzy -msgid "Back to Select Customer" -msgstr "Cari Pelanggan" - -#: AddCustomerNotes.php:30 -#, fuzzy -msgid "The contact priority must be an integer." -msgstr "Kode rekening harus berupa integer" - -#: AddCustomerNotes.php:33 AddCustomerTypeNotes.php:33 -#, fuzzy -msgid "The contact's notes must be two hundred characters or less long" -msgstr "Nama rekening maksimum lima puluh karakter" - -#: AddCustomerNotes.php:36 AddCustomerTypeNotes.php:36 -#, fuzzy -msgid "The contact's notes may not be empty" -msgstr "Nama rekening bank tidak boleh kosong karena" - -#: AddCustomerNotes.php:59 -#, fuzzy -msgid "The contact notes record has been added" -msgstr "Rekaman matriks diskon telah ditambahkan" - -#: AddCustomerNotes.php:83 -#, fuzzy -msgid "The contact note record has been deleted" -msgstr "Rekaman matriks diskon telah dihapus" - -#: AddCustomerNotes.php:93 -#, fuzzy -msgid "Notes for Customer: <b>" -msgstr "dan untuk Pelanggan" - -#: AddCustomerNotes.php:102 AddCustomerNotes.php:177 -#: AddCustomerTypeNotes.php:102 AddCustomerTypeNotes.php:177 -#: BankMatching.php:212 BankReconciliation.php:181 BankReconciliation.php:253 -#: CustomerAllocations.php:347 CustomerAllocations.php:373 -#: CustomerInquiry.php:184 CustomerTransInquiry.php:85 -#: GLAccountInquiry.php:153 GLTransInquiry.php:46 PaymentAllocations.php:73 -#: PrintCustTrans.php:838 PrintCustTransPortrait.php:850 ReverseGRN.php:330 -#: ShipmentCosting.php:494 ShipmentCosting.php:565 Shipments.php:459 -#: StockLocMovements.php:79 StockMovements.php:98 -#: StockSerialItemResearch.php:74 SupplierAllocations.php:466 -#: SupplierAllocations.php:578 SupplierAllocations.php:648 -#: SupplierInquiry.php:191 SupplierTransInquiry.php:87 -#: includes/PDFQuotationPageHeader.inc:91 -#: includes/PDFStatementPageHeader.inc:169 includes/PDFTaxPageHeader.inc:35 -#: includes/PDFTransPageHeader.inc:48 -#: includes/PDFTransPageHeaderPortrait.inc:57 -msgid "Date" -msgstr "Tanggal" - -#: AddCustomerNotes.php:103 AddCustomerTypeNotes.php:103 Stocks.php:799 -msgid "Note" -msgstr "Catatan" - -#: AddCustomerNotes.php:104 AddCustomerNotes.php:175 -msgid "WWW" -msgstr "" - -#: AddCustomerNotes.php:105 AddCustomerNotes.php:179 -#: AddCustomerTypeNotes.php:105 AddCustomerTypeNotes.php:179 -#, fuzzy -msgid "Priority" -msgstr "Laba" - -#: AddCustomerNotes.php:139 -#, fuzzy -msgid "Review all notes for this Customer" -msgstr "Order penjualan untuk Cabang/Pelanggan ini" - -#: AddCustomerNotes.php:168 AddCustomerTypeNotes.php:168 -#, fuzzy -msgid "Note ID" -msgstr "Catatan" - -#: AddCustomerNotes.php:173 -#, fuzzy -msgid "Contact Note" -msgstr "Kode Kat" - -#: AddCustomerTypeNotes.php:5 SelectCustomer.php:708 -#, fuzzy -msgid "Customer Type (Group) Notes" -msgstr "Pelanggan diperbarui" - -#: AddCustomerTypeNotes.php:30 -#, fuzzy -msgid "The Contact priority must be an integer." -msgstr "Kode rekening harus berupa integer" - -#: AddCustomerTypeNotes.php:48 SelectCustomer.php:748 -#, fuzzy -msgid "Customer Group Notes" -msgstr "Pelanggan diperbarui" - -#: AddCustomerTypeNotes.php:59 -#, fuzzy -msgid "The contact group notes record has been added" -msgstr "Rekaman matriks diskon telah ditambahkan" - -#: AddCustomerTypeNotes.php:83 -#, fuzzy -msgid "The contact group note record has been deleted" -msgstr "Rekaman matriks diskon telah dihapus" - -#: AddCustomerTypeNotes.php:93 -#, fuzzy -msgid "Notes for Customer Type: <b>" -msgstr "dan untuk Pelanggan" - -#: AddCustomerTypeNotes.php:104 AddCustomerTypeNotes.php:175 -#, fuzzy -msgid "href" -msgstr "Yang diinginkan" - -#: AddCustomerTypeNotes.php:139 -#, fuzzy -msgid "Review all notes for this Customer Type" -msgstr "Order penjualan untuk Cabang/Pelanggan ini" - -#: AddCustomerTypeNotes.php:173 -#, fuzzy -msgid "Contact Group Note" -msgstr "Nama Grup Rekening" - -#: AgedDebtors.php:18 -msgid "Aged Customer Balance Listing" -msgstr "Daftar Neraca Pelanggan yang lama" - -#: AgedDebtors.php:19 -msgid "Aged Customer Balances" -msgstr "Neraca Pelanggan yang lama" - -#: AgedDebtors.php:266 AgedDebtors.php:362 AgedDebtors.php:430 -msgid "Aged Customer Account Analysis" -msgstr "Analisa Rekening Pelanggan yang lama" - -#: AgedDebtors.php:266 AgedDebtors.php:362 AgedDebtors.php:430 -#: AgedSuppliers.php:104 BOMListing.php:46 BOMListing.php:57 -#: DebtorsAtPeriodEnd.php:59 GLBalanceSheet.php:80 GLBalanceSheet.php:117 -#: GLProfit_Loss.php:149 GLTrialBalance.php:138 InventoryPlanning.php:89 -#: InventoryPlanning.php:159 InventoryPlanning.php:192 -#: InventoryPlanning.php:235 InventoryPlanning.php:269 -#: InventoryValuation.php:71 MailInventoryValuation.php:100 -#: OutstandingGRNs.php:50 PDFCustomerList.php:13 PDFCustomerList.php:233 -#: PDFLowGP.php:17 PDFStockCheckComparison.php:25 -#: PDFStockCheckComparison.php:51 PDFStockCheckComparison.php:258 -#: SelectProduct.php:49 StockCheck.php:38 StockCheck.php:59 StockCheck.php:88 -#: StockCheck.php:138 StockCheck.php:182 SupplierBalsAtPeriodEnd.php:56 -#: SuppPaymentRun.php:106 includes/PDFPaymentRun_PymtFooter.php:52 -#: includes/PDFPaymentRun_PymtFooter.php:111 -#: includes/PDFPaymentRun_PymtFooter.php:149 -#: includes/PDFPaymentRun_PymtFooter.php:181 -#: includes/PDFPaymentRun_PymtFooter.php:213 -msgid "Problem Report" -msgstr "Laporan Problem" - -#: AgedDebtors.php:268 CustomerInquiry.php:81 CustomerInquiry.php:102 -#: DebtorsAtPeriodEnd.php:61 -msgid "The customer details could not be retrieved by the SQL because" -msgstr "Detil pelanggan tidak dapat diambil oleh SQL karena" - -#: AgedDebtors.php:269 AgedDebtors.php:365 AgedDebtors.php:436 -#: AgedSuppliers.php:107 AgedSuppliers.php:187 BOMListing.php:49 -#: Credit_Invoice.php:183 DebtorsAtPeriodEnd.php:62 FTP_RadioBeacon.php:187 -#: GetStockImage.php:152 GLBalanceSheet.php:83 GLBalanceSheet.php:120 -#: GLBalanceSheet.php:288 GLProfit_Loss.php:152 GLProfit_Loss.php:480 -#: GLTrialBalance.php:141 GLTrialBalance.php:337 InventoryPlanning.php:92 -#: InventoryPlanning.php:162 InventoryPlanning.php:195 -#: InventoryPlanning.php:238 InventoryPlanning.php:272 -#: InventoryPlanning.php:327 InventoryValuation.php:74 -#: InventoryValuation.php:182 MailInventoryValuation.php:103 -#: MailInventoryValuation.php:202 OutstandingGRNs.php:53 -#: OutstandingGRNs.php:140 PDFCustomerList.php:236 PDFCustomerList.php:363 -#: PDFGrn.php:58 PDFLowGP.php:61 PDFLowGP.php:110 PDFPriceList.php:104 -#: PDFPriceList.php:183 PDFQuotation.php:233 PDFStockCheckComparison.php:29 -#: PDFStockCheckComparison.php:55 PDFStockCheckComparison.php:262 -#: PDFStockCheckComparison.php:314 PDFStockLocTransfer.php:82 -#: PDFStockNegatives.php:67 PDFStockTransfer.php:66 PO_PDFPurchOrder.php:23 -#: PO_PDFPurchOrder.php:115 PrintCustOrder_generic.php:178 -#: PrintCustOrder.php:179 PrintDeliveryNote.php:175 -#: SalesAnalysis_UserDefined.php:36 SalesAnalysis_UserDefined.php:54 -#: SelectCreditItems.php:25 StockCheck.php:41 StockCheck.php:62 -#: StockCheck.php:91 StockCheck.php:141 StockCheck.php:185 StockCheck.php:254 -#: SupplierBalsAtPeriodEnd.php:59 SuppPaymentRun.php:109 -#: SuppPaymentRun.php:177 SuppPaymentRun.php:208 Tax.php:64 Tax.php:159 -#: Z_DataExport.php:73 Z_DataExport.php:169 Z_DataExport.php:260 -#: Z_DataExport.php:309 Z_DataExport.php:348 Z_DataExport.php:384 -#: Z_DataExport.php:420 Z_DataExport.php:474 Z_poRebuildDefault.php:38 -#: includes/PDFPaymentRun_PymtFooter.php:55 -#: includes/PDFPaymentRun_PymtFooter.php:85 -#: includes/PDFPaymentRun_PymtFooter.php:114 -#: includes/PDFPaymentRun_PymtFooter.php:152 -#: includes/PDFPaymentRun_PymtFooter.php:184 -#: includes/PDFPaymentRun_PymtFooter.php:216 -#: includes/ConstructSQLForUserDefinedSalesReport.inc:180 -#: includes/ConstructSQLForUserDefinedSalesReport.inc:188 -#: includes/ConstructSQLForUserDefinedSalesReport.inc:340 -msgid "Back to the menu" -msgstr "Kembali ke menu" - -#: AgedDebtors.php:364 -msgid "The details of outstanding transactions for customer" -msgstr "Detil dari transaksi yang belum diselesaikan untuk pelanggan" - -#: AgedDebtors.php:364 AgedSuppliers.php:186 GLAccountInquiry.php:145 -#: PO_Items.php:364 PO_Items.php:394 PO_Items.php:496 PO_Items.php:568 -#: PO_Items.php:659 SalesAnalReptCols.php:349 SpecialOrder.php:363 -#: StockLocTransferReceive.php:369 StockQuantityByDate.php:103 -#: includes/SelectOrderItems_IntoCart.inc:49 -msgid "could not be retrieved because" -msgstr "Tidak dapat diambil karena" - -#: AgedDebtors.php:367 AgedSuppliers.php:189 Areas.php:96 -#: ConfirmDispatch_Invoice.php:153 ConfirmDispatch_Invoice.php:905 -#: ConfirmDispatch_Invoice.php:919 Credit_Invoice.php:678 -#: Credit_Invoice.php:700 CustomerReceipt.php:460 CustomerReceipt.php:595 -#: CustomerReceipt.php:623 CustomerTransInquiry.php:77 DeliveryNote.php:151 -#: GLProfit_Loss.php:542 Payments.php:292 PurchData.php:36 PurchData.php:94 -#: PurchData.php:115 ReverseGRN.php:143 ReverseGRN.php:157 ReverseGRN.php:318 -#: SelectCreditItems.php:1388 StockCheck.php:215 StockCostUpdate.php:78 -#: StockCostUpdate.php:88 StockLocStatus.php:126 StockMovements.php:91 -#: StockQuantityByDate.php:79 StockReorderLevel.php:40 StockStatus.php:263 -#: StockTransfers.php:153 StockUsageGraph.php:52 StockUsage.php:124 -#: SupplierInquiry.php:78 SupplierInquiry.php:99 SupplierInquiry.php:129 -#: SupplierInquiry.php:174 SupplierTransInquiry.php:79 SuppPaymentRun.php:112 -#: SuppPaymentRun.php:179 SuppPaymentRun.php:210 WorkOrderCosting.php:381 -#: WorkOrderReceive.php:264 Z_ChangeBranchCode.php:108 -#: Z_ChangeCustomerCode.php:90 Z_DeleteCreditNote.php:57 -#: Z_DeleteInvoice.php:83 includes/PDFPaymentRun_PymtFooter.php:57 -#: includes/PDFPaymentRun_PymtFooter.php:87 -#: includes/PDFPaymentRun_PymtFooter.php:116 -#: includes/PDFPaymentRun_PymtFooter.php:154 -#: includes/PDFPaymentRun_PymtFooter.php:186 -#: includes/PDFPaymentRun_PymtFooter.php:218 includes/ConnectDB_mysqli.inc:55 -#: includes/ConnectDB_mysql.inc:38 -msgid "The SQL that failed was" -msgstr "SQL yang gagal adalah" - -#: AgedDebtors.php:432 -msgid "There are no customers meeting the critiera specified to list" -msgstr "Tidak ada pelanggan yang memenuhi kriteria pada daftar" - -#: AgedDebtors.php:452 -msgid "Aged Debtor Analysis" -msgstr "Analisa Penerima pinjaman berdasarkan Jatuh tempo." - -#: AgedDebtors.php:461 DebtorsAtPeriodEnd.php:132 -msgid "From Customer Code" -msgstr "Dari Kode Pelanggan" - -#: AgedDebtors.php:462 DebtorsAtPeriodEnd.php:133 -msgid "To Customer Code" -msgstr "Ke Kode Pelanggan" - -#: AgedDebtors.php:464 AgedSuppliers.php:280 -msgid "All balances or overdues only" -msgstr "Semua Neraca atau yang terlambat" - -#: AgedDebtors.php:465 -msgid "All customers with balances" -msgstr "Semua pelanggan dengan saldo" - -#: AgedDebtors.php:466 AgedSuppliers.php:283 -msgid "Overdue accounts only" -msgstr "Hanya rekening yang telah jatuh tempo" - -#: AgedDebtors.php:467 -msgid "Held accounts only" -msgstr "Pengirim tidak jelas" - -#: AgedDebtors.php:470 -#, fuzzy -msgid "Only Show Customers Of" -msgstr "Tunjukkan hanya pelanggan yang berdagang dalam" - -#: AgedDebtors.php:482 -msgid "Only show customers trading in" -msgstr "Tunjukkan hanya pelanggan yang berdagang dalam" - -#: AgedDebtors.php:498 -msgid "Summary or detailed report" -msgstr "Laporan umum atau laporan detil" - -#: AgedDebtors.php:500 AgedSuppliers.php:303 InventoryValuation.php:239 -msgid "Summary Report" -msgstr "Laporan Lengkap" - -#: AgedDebtors.php:501 AgedSuppliers.php:304 InventoryValuation.php:240 -msgid "Detailed Report" -msgstr "Laporan Detil" - -#: AgedDebtors.php:504 AgedSuppliers.php:307 BOMListing.php:136 -#: DebtorsAtPeriodEnd.php:150 GLBalanceSheet.php:48 InventoryPlanning.php:389 -#: InventoryValuation.php:243 OutstandingGRNs.php:165 PDFCustomerList.php:422 -#: PDFLowGP.php:146 PDFPriceList.php:245 PDFStockCheckComparison.php:370 -#: PrintCustTrans.php:609 PrintCustTransPortrait.php:620 -#: SupplierBalsAtPeriodEnd.php:152 Tax.php:331 -msgid "Print PDF" -msgstr "Cetak PDF" - -#: AgedSuppliers.php:17 -msgid "Aged Supplier Listing" -msgstr "Daftar pemasok lama" - -#: AgedSuppliers.php:18 -msgid "Aged Suppliers" -msgstr "Pemasok lama" - -#: AgedSuppliers.php:104 -msgid "Aged Supplier Account Analysis" -msgstr "Analisa Rekening Pemasok Lama" - -#: AgedSuppliers.php:106 SupplierBalsAtPeriodEnd.php:58 -msgid "The Supplier details could not be retrieved by the SQL because" -msgstr "Detil pemasok tidak dapat diambil oleh SQL karena" - -#: AgedSuppliers.php:184 -msgid "Aged Supplier Account Analysis - Problem Report" -msgstr "Analisa Rekening Pemasok Lama - Laporan Masalah" - -#: AgedSuppliers.php:186 -msgid "The details of outstanding transactions for Supplier" -msgstr "Detil dari transaksi berjalan untuk para Pemasok" - -#: AgedSuppliers.php:264 -msgid "Aged Supplier Analysis" -msgstr "Analisa Pemasok Lama" - -#: AgedSuppliers.php:273 OutstandingGRNs.php:160 -#: SupplierBalsAtPeriodEnd.php:129 SuppPaymentRun.php:262 -msgid "From Supplier Code" -msgstr "Dari Kode Pemasok" - -#: AgedSuppliers.php:276 OutstandingGRNs.php:162 -#: SupplierBalsAtPeriodEnd.php:131 SuppPaymentRun.php:264 -msgid "To Supplier Code" -msgstr "Ke kode pemasok" - -#: AgedSuppliers.php:282 -msgid "All suppliers with balances" -msgstr "Seluruh pemasok dengan saldo" - -#: AgedSuppliers.php:286 -msgid "For suppliers trading in" -msgstr "Untuk pemasok yang bertransaksi dalam" - -#: AgedSuppliers.php:301 InventoryValuation.php:238 -msgid "Summary or Detailed Report" -msgstr "Laporan umum atau Laporan detil" - -#: Areas.php:7 -msgid "Sales Area Maintenance" -msgstr "Khusus penjual" - -#: Areas.php:40 -#, fuzzy -msgid "The area code must be three characters or less long" -msgstr "Panjang kode daerah tidak boleh lebih dari dua karakter" - -#: Areas.php:45 -#, fuzzy -msgid "The area code entered already exists" -msgstr "Bagian kode yang dimasukkan" - -#: Areas.php:50 -#, fuzzy -msgid "The area description must be twenty five characters or less long" -msgstr "Panjang penjelasan area tidak boleh lebih dari limapuluh karakter" - -#: Areas.php:55 -msgid "The area code may not be empty" -msgstr "Kode are tidak boleh kosong" - -#: Areas.php:60 -msgid "The area description may not be empty" -msgstr "Kolom keterangan mungkin kosong" - -#: Areas.php:74 -msgid "Area code" -msgstr "Kode daerah" - -#: Areas.php:88 -msgid "New area code" -msgstr "Kode daerah yang baru" - -#: Areas.php:88 -msgid "has been inserted" -msgstr "telah ditambahkan" - -#: Areas.php:95 -msgid "The area could not be added or updated because" -msgstr "Daerah tidak dapat ditambahkan atau diperbarui karena" - -#: Areas.php:116 -msgid "" -"Cannot delete this area because customer branches have been created using " -"this area" -msgstr "" -"Tidak dapat menghapus daerah ini karena cabang pelanggan telah diciptakan " -"dengan daerah ini." - -#: Areas.php:117 -msgid "branches using this area code" -msgstr "Cabang-cabang menggunakan kode daerah ini" - -#: Areas.php:125 -msgid "" -"Cannot delete this area because sales analysis ecords exist that use this " -"area" -msgstr "" -"Tidak dapat menghapus bagian ini karena terdapat analisa penjualan pada " -"bagian ini" - -#: Areas.php:126 -msgid "sales analysis records referring this area code" -msgstr "rekaman analisa penjualan mengacu pada kode daerah ini" - -#: Areas.php:133 Areas.php:146 Areas.php:197 Areas.php:208 -msgid "Area Code" -msgstr "Kode Daerah" - -#: Areas.php:133 CustomerTypes.php:147 Factors.php:135 GLAccounts.php:203 -#: Locations.php:298 SalesAnalReptCols.php:214 SalesCategories.php:137 -#: SalesTypes.php:161 StockCategories.php:182 Suppliers.php:588 -#: Z_DeleteInvoice.php:142 -msgid "has been deleted" -msgstr "telah dihapus" - -#: Areas.php:147 Areas.php:213 -msgid "Area Name" -msgstr "Nama Daerah" - -#: Areas.php:173 -msgid "Review Areas Defined" -msgstr "Daerah tinjauan didefinisikan" - -#: AuditTrail.php:7 -msgid "Audit Trail" -msgstr "" - -#: AuditTrail.php:19 -msgid "Incorrerct date format used, please re-enter" -msgstr "" - -#: AuditTrail.php:32 -#, fuzzy -msgid "From Date" -msgstr "dari" - -#: AuditTrail.php:34 -#, fuzzy -msgid "To Date" -msgstr "Tanggal" - -#: AuditTrail.php:38 UserSettings.php:100 -msgid "User ID" -msgstr "ID Pengguna" - -#: AuditTrail.php:51 -#, fuzzy -msgid "Table " -msgstr "Aktif" - -#: AuditTrail.php:62 PO_SelectPurchOrder.php:376 -msgid "View" -msgstr "Lihat" - -#: AuditTrail.php:139 -#, fuzzy -msgid "Date/Time" -msgstr "Tanggal" - -#: AuditTrail.php:140 -#, fuzzy -msgid "User" -msgstr "ID Pengguna" - -#: AuditTrail.php:141 BankReconciliation.php:182 BankReconciliation.php:254 -#: Cus... [truncated message content] |
From: <dai...@us...> - 2010-02-14 06:40:24
|
Revision: 3346 http://web-erp.svn.sourceforge.net/web-erp/?rev=3346&view=rev Author: daintree Date: 2010-02-14 06:40:17 +0000 (Sun, 14 Feb 2010) Log Message: ----------- minor mods to install.txt Modified Paths: -------------- trunk/GoodsReceived.php trunk/doc/INSTALL.txt trunk/doc/README.txt Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2010-02-12 11:07:58 UTC (rev 3345) +++ trunk/GoodsReceived.php 2010-02-14 06:40:17 UTC (rev 3346) @@ -348,7 +348,7 @@ } $CurrentStandardCost = $myrow[0]; - /*Set the purchase order line stdcostunit = weighted average standard cost used for all receipts of this line + /*Set the purchase order line stdcostunit = weighted average / standard cost used for all receipts of this line This assures that the quantity received against the purchase order line multiplied by the weighted average of standard costs received = the total of standard cost posted to GRN suspense*/ $_SESSION['PO']->LineItems[$OrderLine->LineNo]->StandardCost = (($CurrentStandardCost * $OrderLine->ReceiveQty) + ($_SESSION['PO']->LineItems[$OrderLine->LineNo]->StandardCost *$OrderLine->QtyReceived)) / ($OrderLine->ReceiveQty + $OrderLine->QtyReceived); Modified: trunk/doc/INSTALL.txt =================================================================== --- trunk/doc/INSTALL.txt 2010-02-12 11:07:58 UTC (rev 3345) +++ trunk/doc/INSTALL.txt 2010-02-14 06:40:17 UTC (rev 3346) @@ -39,12 +39,14 @@ PHP must have the register globals configuration parameter set to off. This is the default (now). This flag can be set in the php.ini on the server. If it can't be changed on the server's php.ini, it is possibe for apache web servers to alter the configuration using a file called .htaccess. A .htaccess file is included in the webERP directory that ensures the register_globals flag is set to off for those web-servers that support .htaccess files. -In addition the magic_quotes_gpc setting must also be set to off. This is a configuration parameter in the php.ini file on the web-server. If you don't have access to the web-server's php.ini, then the webERP distribution has an .htaccess file to ensure that this is set to off for apache servers and thos other servers that look at the parameters in the .htaccess file. If magic_quotes_gpc is not set to off then this can leave annoying "\" characters in some fields otherwise webERP works as normal. +In addition the magic_quotes_gpc setting must also be set to off. This is a configuration parameter in the php.ini file on the web-server. If you don't have access to the web-server's php.ini, then the webERP distribution has an .htaccess file to ensure that this is set to off for apache servers and those other servers that look at the parameters in the .htaccess file. If magic_quotes_gpc is not set to off then this can leave annoying "\" characters in some fields otherwise webERP works as normal. One more issue with php setup - by default the setting session.use_cookies is set to 1, if it is set to 0 this can also cause problems. -There are a number of traps with PHP installation depending on the web-server - see http://www.weberp.org/wikidocs/FrequentlyAskedQuestionsInstallation +There are a number of traps with PHP installation depending on the web-server - see: + http://www.weberp.org/wikidocs/FrequentlyAskedQuestionsInstallation + The system is developed using MySQL. webERP was also tested up to version 3.05 with the Postgres database server. Postgres is no longer supported due to lack of a developer using and testing with postgres and writing upgrade scripts. Instructions here are for mysql. The installation consists of: @@ -86,9 +88,10 @@ At this point you may wish to add an extra layer of security by restricting access to the webERP system. This is in addition to webERP's own security -system, so you may wish to skip it, but I advise you add it. In your +system, so you may wish to skip it, but it is recommended to add this extra layer. In your .../htdocs/webERP directory (or wherever your webERP's root directory is) amend the file .htaccess thus: + php_flag magic_quotes_gpc off php_flag register_globals off @@ -118,7 +121,7 @@ Use command "htpasswd -n" to create sample lines which will be of the format john.smith:0123456789012345 -Where '0..5' is an encrypted password. Create one line for each webERP user. +Where '0123456789012345' is the encrypted password for john.smith. Create one line for each webERP user. Note that you will need to enter the (unencrypted) password whenever you access the webpages in .../webERP. @@ -217,7 +220,7 @@ enter the web access password if you amended the .htaccess file as discussed above, accept all cookies, and complete the installation form. -You will need to ensure that the directory where you have installed is writable by the system user that the web-server runs as - otherwise the installer will not be able to write the new config.php. +You will need to ensure that the directory where you have installed is writable by the system user that the web-server runs as - otherwise the installer will not be able to write the new config.php file. In step 4 uncheck "Install Tables", because that was done above, and enter the MySQL password to access the system that you used above. @@ -230,14 +233,14 @@ Click 'Install WebERP' -You may wish to examine .../webERP/config.php to verify all is correct. +After you have run the install script you may wish to examine .../webERP/config.php to verify all is correct or change it if you are having any issues. Alternatively, config.php may be created by copying config.distrib.php to config.php and then editing the new config.php file with the parameters required for your installation. If you have created the config.php using the web interface then you may now skip to step 4. config.php contains a series of user defined variables that determine how the system behaves. Critically it contains the user and password of the database connection and the type of database server being used. There is no going forward without the system being provided with this data. It is important to ensure there are no trailing characters at the end of this file - this is a common installation pitfall since some editors add a character at the end of the file. -The file appears as follows for reference purposes. The actual file config.php under the webERP directory with all the other scripts must be edited and saved. As you can see the file is well commented, the critical items are the computer $host, the $dbType, the $dbuser and the $dbpassword - other variables can in most cases be left at their defaults. Note that the sha1 encryption requires the PHP version 4.3 or greater - if you are using a prior version of php - not recommended - you could try md5 encryption. Lines commencing with // are comments and not interpreted by PHP. (Note: In prior versions a variable $DatabaseName used to be required in config.php this is no longer required as the webERP database names available are derived from the directory names under webERP/companies/ - when you create a new database using weberp-new.sql you must also copy the directory structure for the company weberp to another directory under webERP/companies with the same name as the database created. If you are using the demo data and the webERP/sql/mysql/weberp-demo.sql script then the database is created as weberp and the company directory weberp already exists under webERP/companies) +The contents of the config.php file appears as follows for reference purposes. The actual file config.php under the webERP directory with all the other scripts must be edited and saved. As you can see the file is well commented, the critical items are the computer $host, the $dbType, the $dbuser and the $dbpassword - other variables can in most cases be left at their defaults. Note that the sha1 encryption requires the PHP version 4.3 or greater - if you are using a prior version of php - not recommended - you could try md5 encryption. Lines commencing with // are comments and not interpreted by PHP. (Note: In prior versions a variable $DatabaseName used to be required in config.php this is no longer required as the webERP database names available are derived from the directory names under webERP/companies/ - when you create a new database using weberp-new.sql you must also copy the directory structure for the company weberp to another directory under webERP/companies with the same name as the database created. If you are using the demo data and the webERP/sql/mysql/weberp-demo.sql script then the database is created as weberp and the company directory weberp already exists under webERP/companies) // User configurable variables @@ -328,7 +331,7 @@ Now the accounting starts.... -All the standing configuration data is defined from the system setup tab and each link should be reviewed to enter appropriate data for the business. +All the standing configuration data is defined from the system setup tab and each link should be reviewed to enter appropriate data for the business. The manual has a section on Getting Started which is essential reading before going live. Please try not to refer questions about PHP or database configuration @@ -348,4 +351,4 @@ A copy of the GNU General Public License is included in the doc directory along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -Copyright weberp.org 2009 - Contact: in...@we... +Copyright weberp.org 2010 - Contact: in...@we... \ No newline at end of file Modified: trunk/doc/README.txt =================================================================== --- trunk/doc/README.txt 2010-02-12 11:07:58 UTC (rev 3345) +++ trunk/doc/README.txt 2010-02-14 06:40:17 UTC (rev 3346) @@ -12,7 +12,7 @@ The primary means of support queries is through the user mailing list. Please join the list at: http://lists.sourceforge.net/lists/listinfo/web-erp-users -if you have queries. The archives of the mailing lists on sourceforge and the FAQ (see http://www.weberp.org/wikidocs/FrequentlyAskedQuestionsInstallation?v=efe) contain the most common issues with respect to installation. +if you have queries. The archives of the mailing lists on sourceforge and the FAQ (see http://www.weberp.org/wikidocs/FrequentlyAskedQuestionsInstallation) contain the most common issues with respect to installation. Feedback, wants and gripes are encouraged in the interests of improving this applicaton. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lin...@us...> - 2010-02-15 05:17:26
|
Revision: 3347 http://web-erp.svn.sourceforge.net/web-erp/?rev=3347&view=rev Author: lindsayh Date: 2010-02-15 05:17:17 +0000 (Mon, 15 Feb 2010) Log Message: ----------- The API's SearchCustomer function did not return 0 as the first element of the array to indicate success. Modified Paths: -------------- trunk/api/api_customers.php trunk/doc/Change.log.html Modified: trunk/api/api_customers.php =================================================================== --- trunk/api/api_customers.php 2010-02-14 06:40:17 UTC (rev 3346) +++ trunk/api/api_customers.php 2010-02-15 05:17:17 UTC (rev 3347) @@ -535,11 +535,9 @@ FROM debtorsmaster WHERE '.$Field.' LIKE "%'.$Criteria.'%"'; $result = DB_Query($sql, $db); - $i=0; - $DebtorList = array(); + $DebtorList = array(0); // First element: no errors while ($myrow=DB_fetch_array($result)) { - $DebtorList[$i]=$myrow[0]; - $i++; + $DebtorList[]=$myrow[0]; } return $DebtorList; } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-14 06:40:17 UTC (rev 3346) +++ trunk/doc/Change.log.html 2010-02-15 05:17:17 UTC (rev 3347) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>15/02/10 Lindsay: Return no error indication from SearchCustomer() API <p>12/02/10 Thomas Timothy Lie: Completion of Indonesian translation</p> <p>12/02/10 Paul: PO_Items.php - Incorrect number of decimal places shown for pricdes less than 1</p> <p>12/02/10 Tim: Update phplot to the laterst version and remove reference to deprecated function eregi()</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-02-17 22:11:53
|
Revision: 3350 http://web-erp.svn.sourceforge.net/web-erp/?rev=3350&view=rev Author: tim_schofield Date: 2010-02-17 22:11:45 +0000 (Wed, 17 Feb 2010) Log Message: ----------- Pak Ricard: New Petty cash module Modified Paths: -------------- trunk/WWW_Users.php trunk/doc/Change.log.html trunk/index.php trunk/sql/mysql/upgrade3.11.1-3.12.sql Added Paths: ----------- trunk/PcAssignCashToTab.php trunk/PcAuthorizeExpenses.php trunk/PcClaimExpensesFromTab.php trunk/PcExpenses.php trunk/PcExpensesTypeTab.php trunk/PcReportTab.php trunk/PcTabs.php trunk/PcTypeTabs.php Added: trunk/PcAssignCashToTab.php =================================================================== --- trunk/PcAssignCashToTab.php (rev 0) +++ trunk/PcAssignCashToTab.php 2010-02-17 22:11:45 UTC (rev 3350) @@ -0,0 +1,356 @@ +<?php +/* $Revision: 1.0 $ */ + +$PageSecurity = 6; + +include('includes/session.inc'); +$title = _('Assignation of Cash to Petty Cash Tab'); +include('includes/header.inc'); + +if (isset($_POST['SelectedTabs'])){ + $SelectedTabs = strtoupper($_POST['SelectedTabs']); +} elseif (isset($_GET['SelectedTabs'])){ + $SelectedTabs = strtoupper($_GET['SelectedTabs']); +} + +if (isset($_POST['SelectedIndex'])){ + $SelectedIndex = $_POST['SelectedIndex']; +} elseif (isset($_GET['SelectedIndex'])){ + $SelectedIndex = $_GET['SelectedIndex']; +} + +if (isset($_POST['Days'])){ + $Days = $_POST['Days']; +} elseif (isset($_GET['Days'])){ + $Days = $_GET['Days']; +} + +if (isset($Errors)) { + unset($Errors); +} + +$Errors = array(); + +if (isset($_POST['submit'])) { + //initialise no input errors assumed initially before we test + $InputError = 0; + + /* actions to take once the user has clicked the submit button + ie the page has called itself with some user input */ + + $i=1; + + if ($_POST['Amount']==0) { + $InputError = 1; + prnMsg('<br>' . _('The Amount must be inputed'),'error'); + $Errors[$i] = 'TabCode'; + $i++; + } + + $sqlLimit = "SELECT tablimit + FROM pctabs + WHERE tabcode='$SelectedTabs'"; + + $ResultLimit = DB_query($sqlLimit,$db); + $Limit=DB_fetch_array($ResultLimit); + + if (($_POST['CurrentAmount']+$_POST['amount'])>$Limit['tablimit']){ + prnMsg('<br>' . _('The balance after this assignation would be greater than the specified limit for this PC tab'),'warning'); + } + + if ($InputError !=1 AND isset($SelectedIndex) ) { + + $sql = "UPDATE pcashdetails + SET date = '".FormatDateForSQL($_POST['Date'])."', + amount = '" . $_POST['Amount'] . "', + authorized = '0000-00-00', + notes = '" . $_POST['Notes'] . "', + receipt = '" . $_POST['Receipt'] . "' + WHERE counterindex = '$SelectedIndex'"; + $msg = _('Assignation of cash to PC Tab ') . ' ' . $SelectedTabs . ' ' . _('has been updated'); + + } elseif ($InputError !=1 ) { + // Add new record on submit + $sql = "INSERT INTO pcashdetails + (counterindex, + tabcode, + date, + codeexpense, + amount, + authorized, + posted, + notes, + receipt) + VALUES ('', + '" . $_POST['SelectedTabs'] . "', + '".FormatDateForSQL($_POST['Date'])."', + 'ASSIGNCASH', + '" .$_POST['Amount'] . "', + '0000-00-00', + '0', + '" . $_POST['Notes'] . "', + '" . $_POST['Receipt'] . "' + )"; + $msg = _('Assignation of cash to PC Tab ') . ' ' . $_POST["SelectedTabs"] . ' ' . _('has been created'); + } + + if ( $InputError !=1) { + //run the SQL from either of the above possibilites + $result = DB_query($sql,$db); + prnMsg($msg,'success'); + unset($_POST['SelectedExpense']); + unset($_POST['Amount']); + unset($_POST['Notes']); + unset($_POST['Receipt']); + } + +} elseif ( isset($_GET['delete']) ) { + $sql="DELETE FROM pcashdetails + WHERE counterindex='$SelectedIndex'"; + $ErrMsg = _('The assignation of cash record could not be deleted because'); + $result = DB_query($sql,$db,$ErrMsg); + prnMsg(_('Assignation of cash to PC Tab ') . ' ' . $SelectedTabs . ' ' . _('has been deleted') ,'success'); + unset($_GET['delete']); +} + +if (!isset($SelectedTabs)){ + + /* It could still be the second time the page has been run and a record has been selected for modification - SelectedTabs 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 sales types will be displayed with + links to delete or edit each. These will call the same page again and allow update/input + or deletion of the records*/ + + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<p><table border=1>'; //Main table + echo '<td><table>'; // First column + + echo '<tr><td>' . _('Petty Cash Tab To Assign Cash') . ":</td><td><select name='SelectedTabs'>"; + + DB_free_result($result); + $SQL = "SELECT tabcode + FROM pctabs + WHERE authorizer='" . $_SESSION['UserID'] . "' + ORDER BY tabcode"; + + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectTabs']) and $myrow['tabcode']==$_POST['SelectTabs']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow['tabcode'] . "'>" . $myrow['tabcode']; + } + + echo '</select></td></tr>'; + echo '</table>'; // close table in first column + echo '</td></tr></table>'; // close main table + echo '<p><div class="centre"><input type=submit name=process VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + echo '</form>'; +} + +//end of ifs and buts! +if (isset($_POST['process'])OR isset($SelectedTabs)) { + + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Details Of Petty Cash Tab ') . '' .$SelectedTabs. '<a/></div><p>'; + + if (! isset($_GET['edit']) OR isset ($_POST['GO'])){ + + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo "<div class='centre'><p>" . _('Detail Of PC Tab Movements For Last ') .': '; + if(!isset ($Days)){ + $Days=30; + } + echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + echo "<input type=text class=number name='Days' VALUE=" . $Days . " MAXLENGTH =3 size=4> Days "; + echo '<input type=submit name="Go" value="' . _('Go') . '">'; + echo '<p></div></form>'; + + if (isset($_POST['Cancel'])) { + unset($_POST['Amount']); + unset($_POST['Date']); + unset($_POST['Notes']); + unset($_POST['Receipt']); + } + +/* $sql = "SELECT pcashdetails.date, + pcashdetails.codeexpense, + pcexpenses.description + pcashdetails.amount, + pcashdetails.authorized, + pcashdetails.posted, + pcashdetails.notes, + pcashdetails.receipt + FROM pcashdetails, pcexpenses + WHERE pcashdetails.tabcode='$SelectedTabs' + AND pcashdetails.codeexpense = pcexpenses.codeexpense + AND pcashdetails.date >=DATE_SUB(CURDATE(), INTERVAL ".$Days." DAY) + ORDER BY pcashdetails.counterindex Asc"; +*/ + $sql = "SELECT * FROM pcashdetails + WHERE tabcode='$SelectedTabs' + AND date >=DATE_SUB(CURDATE(), INTERVAL ".$Days." DAY) + ORDER BY date, counterindex ASC"; + + + $result = DB_query($sql,$db); + + echo '<br><table BORDER=1>'; + echo "<tr> + <th>" . _('Date') . "</th> + <th>" . _('Expense Code') . "</th> + <th>" . _('Amount') . "</th> + <th>" . _('Authorized') . "</th> + <th>" . _('Notes') . "</th> + <th>" . _('Receipt') . "</th> + </tr>"; + + $k=0; //row colour counter + + while ($myrow = DB_fetch_row($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + $sqldes="SELECT description + FROM pcexpenses + WHERE codeexpense='". $myrow['3'] . "'"; + + $ResultDes = DB_query($sqldes,$db); + $Description=DB_fetch_array($ResultDes); + + if (!isset($Description['0'])){ + $Description['0']='ASSIGNCASH'; + } + + if (($myrow['5'] == "0000-00-00") and ($Description['0'] == 'ASSIGNCASH')){ + // only cash assignations NOT authorized can be modified or deleted + printf("<td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href='%sSelectedIndex=%s&SelectedTabs=$SelectedTabs&Days=$Days&edit=yes'>" . _('Edit') . "</td> + <td><a href='%sSelectedIndex=%s&SelectedTabs=$SelectedTabs&Days=$Days&delete=yes' onclick=\"return confirm('" . _('Are you sure you wish to delete this code and the expense it may have set up?') . "');\">" . _('Delete') . "</td> + </tr>", + ConvertSQLDate($myrow['2']), + $Description['0'], + number_format($myrow['4'],2), + ConvertSQLDate($myrow['5']), + $myrow['7'], + $myrow['8'], + $_SERVER['PHP_SELF'] . '?' . SID, $myrow['0'], + $_SERVER['PHP_SELF'] . '?' . SID, $myrow['0']); + }else{ + printf("<td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + </tr>", + ConvertSQLDate($myrow['2']), + $Description['0'], + number_format($myrow['4'],2), + ConvertSQLDate($myrow['5']), + $myrow['7'], + $myrow['8']); + } + } + //END WHILE LIST LOOP + + $sqlamount="SELECT sum(amount) + FROM pcashdetails + WHERE tabcode='$SelectedTabs'"; + + $ResultAmount = DB_query($sqlamount,$db); + $Amount=DB_fetch_array($ResultAmount); + + if (!isset($Amount['0'])) { + $Amount['0']=0; + } + + echo "<tr><td colspan=4 style=text-align:right >" . _('Current balance') . ":</td> + <td colspan=2>".number_format($Amount['0'],2)."</td></tr>"; + + echo '</table>'; + + } + + if (! isset($_GET['delete'])) { + + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<p><table border=1>'; //Main table + echo '<td><table>'; // First column + + if ( isset($_GET['edit'])) { + + $sql = "SELECT * FROM pcashdetails + WHERE counterindex='$SelectedIndex'"; + + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); + + $_POST['Date'] = ConvertSQLDate($myrow['date']); + $_POST['SelectedExpense'] = $myrow['codeexpense']; + $_POST['Amount'] = $myrow['amount']; + $_POST['Notes'] = $myrow['notes']; + $_POST['Receipt'] = $myrow['receipt']; + + echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + echo "<input type=hidden name='SelectedIndex' VALUE=" . $SelectedIndex. ">"; + echo "<input type=hidden name='CurrentAmount' VALUE=" . $Amount['0']. ">"; + echo "<input type=hidden name='Days' VALUE=" .$Days. ">"; + } + +/* Ricard: needs revision of this date initialization */ + if (!isset($_POST['Date'])) { + $_POST['Date']=Date("d/m/Y"); + } + + echo '<tr><td>' . _('Cash Assignation Date') . ":</td>"; + + echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" size=10 maxlength=10 value=' . $_POST['Date'] . '></td></tr>'; + + + if (!isset($_POST['Amount'])) { + $_POST['Amount']=0; + } + + echo "<tr><td>" . _('Amount') . ":</td><td><input type='Text' class='number' name='Amount' size='12' maxlength='11' value='" . $_POST['Amount'] . "'></td></tr>"; + + if (!isset($_POST['Notes'])) { + $_POST['Notes']=''; + } + + echo "<tr><td>" . _('Notes') . ":</td><td><input type='Text' name='Notes' size=50 maxlength=49 value='" . $_POST['Notes'] . "'></td></tr>"; + + if (!isset($_POST['Receipt'])) { + $_POST['Receipt']=''; + } + + echo "<tr><td>" . _('Receipt') . ":</td><td><input type='Text' name='Receipt' size=50 maxlength=49 value='" . $_POST['Receipt'] . "'></td></tr>"; + + echo "<input type=hidden name='CurrentAmount' VALUE=" . $Amount['0']. ">"; + echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + echo "<input type=hidden name='Days' VALUE=" .$Days. ">"; + + echo '</table>'; // close table in first column + echo '</td></tr></table>'; // close main table + + echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + + echo '</form>'; + + } // end if user wish to delete + +} + +include('includes/footer.inc'); +?> \ No newline at end of file Property changes on: trunk/PcAssignCashToTab.php ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php (rev 0) +++ trunk/PcAuthorizeExpenses.php 2010-02-17 22:11:45 UTC (rev 3350) @@ -0,0 +1,293 @@ + +<?php +/* $Revision: 1.0 $ */ + +$PageSecurity = 6; + +include('includes/session.inc'); +$title = _('Authorization of Petty Cash Expenses'); +include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); + +if (isset($_POST['SelectedTabs'])){ + $SelectedTabs = strtoupper($_POST['SelectedTabs']); +} elseif (isset($_GET['SelectedTabs'])){ + $SelectedTabs = strtoupper($_GET['SelectedTabs']); +} + +if (isset($_POST['SelectedIndex'])){ + $SelectedIndex = $_POST['SelectedIndex']; +} elseif (isset($_GET['SelectedIndex'])){ + $SelectedIndex = $_GET['SelectedIndex']; +} + +if (isset($_POST['Days'])){ + $Days = $_POST['Days']; +} elseif (isset($_GET['Days'])){ + $Days = $_GET['Days']; +} + +if (isset($Errors)) { + unset($Errors); +} + +$Errors = array(); + + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Petty Cash') . '" alt="">' . ' <a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Authorization Of Petty Cash Expenses ') . ''.$SelectedTabs.'<a/>'; + +if (isset($_POST['submit']) or isset($_POST['update']) OR isset($SelectedTabs) OR isset ($_POST['GO'])) { + + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo "<div class='centre'><p>" . _('Detail Of Movement For Last ') .': '; + + if(!isset ($Days)){ + $Days=30; + } + echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + echo "<input type=text class=number name='Days' VALUE=" . $Days . " MAXLENGTH =3 size=4> Days "; + echo '<input type=submit name="Go" value="' . _('Go') . '">'; + echo '<p></div></form>'; + + $sql = "SELECT pcashdetails.counterindex, + pcashdetails.tabcode, + pcashdetails.date, + pcashdetails.codeexpense, + pcashdetails.amount, + pcashdetails.authorized, + pcashdetails.posted, + pcashdetails.notes, + pcashdetails.receipt, + pctabs.glaccountassignment, + pctabs.glaccountpcash, + pctabs.usercode, + pctabs.currency, + currencies.rate + FROM pcashdetails, pctabs, currencies + WHERE pcashdetails.tabcode = pctabs.tabcode + AND pctabs.currency = currencies.currabrev + AND pcashdetails.tabcode = '$SelectedTabs' + AND pcashdetails.date >= DATE_SUB(CURDATE(), INTERVAL ".$Days." DAY) + ORDER BY pcashdetails.date, pcashdetails.counterindex ASC"; + + $result = DB_query($sql,$db); + + echo '<br><table BORDER=1>'; + echo "<tr> + <th>" . _('Date') . "</th> + <th>" . _('Expense Code') . "</th> + <th>" . _('Amount') . "</th> + <th>" . _('Posted') . "</th> + <th>" . _('Notes') . "</th> + <th>" . _('Receipt') . "</th> + <th>" . _('Authorized') . "</th> + </tr>"; + + $k=0; //row colour counter + echo'<form action="PcAuthorizeExpenses.php" method="POST" name="'._('update').'">'; + + while ($myrow=DB_fetch_array($result)) { + + //update database if update pressed + if (($_POST['submit']=='Update') AND isset($_POST[$myrow['counterindex']])){ + + $PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db); + + if ($myrow['rate'] == 1){ // functional currency + $Amount = $myrow['amount']; + }else{ // other currencies + $Amount = $myrow['amount']/$myrow['rate']; + } + + if ($myrow['codeexpense'] == 'ASSIGNCASH'){ + $type = 2; + $AccountFrom = $myrow['glaccountassignment']; + $AccountTo = $myrow['glaccountpcash']; + }else{ + $type = 1; + $Amount = -$Amount; + $AccountFrom = $myrow['glaccountpcash']; + $SQLAccExp = "SELECT glaccount + FROM pcexpenses + WHERE codeexpense = '".$myrow['codeexpense']."'"; + $ResultAccExp = DB_query($SQLAccExp,$db); + $myrowAccExp = DB_fetch_array($ResultAccExp); + $AccountTo = $myrowAccExp['glaccount']; + } + + //get typeno + $typeno = GetNextTransNo($type,$db); + + //build narrative + $narrative= "PettyCash - ".$myrow['tabcode']." - ".$myrow['codeexpense']." - ".$myrow['notes']." - ".$myrow['receipt'].""; + //insert to gltrans + + $sqlFrom="INSERT INTO `gltrans` + (`counterindex`, + `type`, + `typeno`, + `chequeno`, + `trandate`, + `periodno`, + `account`, + `narrative`, + `amount`, + `posted`, + `jobref`, + `tag`) + VALUES (NULL, + '".$type."', + '".$typeno."', + 0, + '".$myrow['date']."', + '".$PeriodNo."', + '".$AccountFrom."', + '".$narrative."', + '".-$Amount."', + 0, + '', + 0)"; + + $ResultFrom = DB_Query($sqlFrom, $db); + + $sqlTo="INSERT INTO `gltrans` + (`counterindex`, + `type`, + `typeno`, + `chequeno`, + `trandate`, + `periodno`, + `account`, + `narrative`, + `amount`, + `posted`, + `jobref`, + `tag`) + VALUES (NULL, + '".$type."', + '".$typeno."', + 0, + '".$myrow['date']."', + '".$PeriodNo."', + '".$AccountTo."', + '".$narrative."', + '".$Amount."', + 0, + '', + 0)"; + + $ResultTo = DB_Query($sqlTo, $db); + + if ($myrow['codeexpense'] == 'ASSIGNCASH'){ + // if it's a cash assignation we need to updated banktrans table as well. + $ReceiptTransNo = GetNextTransNo( 2, $db); + $SQLBank= 'INSERT INTO banktrans (transno, + type, + bankact, + ref, + exrate, + functionalexrate, + transdate, + banktranstype, + amount, + currcode) + VALUES (' . $ReceiptTransNo . ', + 1, + ' . $AccountFrom . ", '" + . $narrative . " ', + 1, + " . $myrow['rate'] . ", + '" . $myrow['date'] . "', + 'Cash', + " . -$myrow['amount'] . ", + '" . $myrow['currency'] . "' + )"; + $ErrMsg = _('Cannot insert a bank transaction because'); + $DbgMsg = _('Cannot insert a bank transaction with the SQL'); + $resultBank = DB_query($SQLBank,$db,$ErrMsg,$DbgMsg,true); + + } + + $sql = "UPDATE pcashdetails + SET authorized = '".Date('Y-m-d')."', + posted = 1 + WHERE counterindex = '".$myrow['counterindex']."'"; + $resultupdate = DB_query($sql,$db); + } + + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + echo' <td>'.ConvertSQLDate($myrow['date']).'</td> + <td>'.$myrow['codeexpense'].'</td> + <td class="number">'.number_format($myrow['amount'],2).'</td> + <td>'.$myrow['posted'].'</td> + <td>'.$myrow['notes'].'</td> + <td>'.$myrow['receipt'].'</td>'; + + if (isset($_POST[$myrow['counterindex']])){ + echo'<td>'.ConvertSQLDate(Date('Y-m-d')).'</td>'; + }else{ + $Authorizer=ConvertSQLDate($myrow['authorized']); + if(($Authorizer!='00/00/0000')){ + echo'<td>'.ConvertSQLDate($myrow['authorized']).'</td>'; + }else{ + echo '<td align=right><input type="checkbox" name="'.$myrow['counterindex'].'">'; + } + } + + 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> '; + + + } //end of looping + + // Do the postings + include ('includes/GLPostings.inc'); + + echo'<tr><td style="text-align:right" colspan=4><input type=submit name=submit value=' . _("Update") . '></td></tr></form>'; + +} else { /*The option to submit was not hit so display form */ + + +echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<p><table border=1>'; //Main table + echo '<td><table>'; // First column + +echo '<tr><td>' . _('Authorize expenses to Petty Cash Tab') . ":</td><td><select name='SelectedTabs'>"; + + DB_free_result($result); + $SQL = "SELECT tabcode + FROM pctabs + WHERE authorizer='" . $_SESSION['UserID'] . "'"; + + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectTabs']) and $myrow['tabcode']==$_POST['SelectTabs']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow['tabcode'] . "'>" . $myrow['tabcode']; + + } //end while loop get type of tab + + echo '</select></td></tr>'; + + echo '</table>'; // close table in first column + echo '</td></tr></table>'; // close main table + + echo '<p><div class="centre"><input type=submit name=process VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + + echo '</form>'; +} /*end of else not submit */ +include('includes/footer.inc'); +?> Property changes on: trunk/PcAuthorizeExpenses.php ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/PcClaimExpensesFromTab.php =================================================================== --- trunk/PcClaimExpensesFromTab.php (rev 0) +++ trunk/PcClaimExpensesFromTab.php 2010-02-17 22:11:45 UTC (rev 3350) @@ -0,0 +1,364 @@ +<?php +/* $Revision: 1.0 $ */ + +$PageSecurity = 6; + +include('includes/session.inc'); +$title = _('Claim Petty Cash Expenses From Tab'); +include('includes/header.inc'); + + +if (isset($_POST['SelectedTabs'])){ + $SelectedTabs = strtoupper($_POST['SelectedTabs']); +} elseif (isset($_GET['SelectedTabs'])){ + $SelectedTabs = strtoupper($_GET['SelectedTabs']); +} + +if (isset($_POST['SelectedIndex'])){ + $SelectedIndex = $_POST['SelectedIndex']; +} elseif (isset($_GET['SelectedIndex'])){ + $SelectedIndex = $_GET['SelectedIndex']; +} + +if (isset($_POST['Days'])){ + $Days = $_POST['Days']; +} elseif (isset($_GET['Days'])){ + $Days = $_GET['Days']; +} + +if (isset($Errors)) { + unset($Errors); +} + +$Errors = array(); + +if (isset($_POST['submit'])) { +//initialise no input errors assumed initially before we test + $InputError = 0; + + /* actions to take once the user has clicked the submit button + ie the page has called itself with some user input */ + + //first off validate inputs sensible + $i=1; + + if ($_POST['amount']==0) { + $InputError = 1; + prnMsg('<br>' . _('The Amount must be greater than 0'),'error'); + $Errors[$i] = 'TabCode'; + $i++; + } + + if (isset($SelectedIndex) AND $InputError !=1) { + $sql = "UPDATE pcashdetails + SET date = '".FormatDateForSQL($_POST['Date'])."', + codeexpense = '" . $_POST['SelectedExpense'] . "', + amount = '" .- $_POST['amount'] . "', + notes = '" . $_POST['Notes'] . "', + receipt = '" . $_POST['Receipt'] . "' + WHERE counterindex = '$SelectedIndex'"; + + $msg = _('The Expense Claim on Tab') . ' ' . $SelectedTabs . ' ' . _('has been updated'); + + } elseif ($InputError !=1 ) { + + // First check the type is not being duplicated + // Add new record on submit + + $sql = "INSERT INTO pcashdetails + (counterindex, + tabcode, + date, + codeexpense, + amount, + authorized, + posted, + notes, + receipt) + VALUES ('','" . $_POST['SelectedTabs'] . "', + '".FormatDateForSQL($_POST['Date'])."', + '" . $_POST['SelectedExpense'] . "', + '" .- $_POST['amount'] . "', + '', + '', + '" . $_POST['Notes'] . "', + '" . $_POST['Receipt'] . "' + )"; + + $msg = _('The Expense Claim on Tab') . ' ' . $_POST["SelectedTabs"] . ' ' . _('has been created'); + } + + if ( $InputError !=1) { + //run the SQL from either of the above possibilites + $result = DB_query($sql,$db); + prnMsg($msg,'success'); + + unset($_POST['SelectedExpense']); + unset($_POST['amount']); + unset($_POST['Date']); + unset($_POST['Notes']); + unset($_POST['Receipt']); + } + +} elseif ( isset($_GET['delete']) ) { + + $sql="DELETE FROM pcashdetails + WHERE counterindex='$SelectedIndex'"; + $ErrMsg = _('Petty Cash Expense record could not be deleted because'); + $result = DB_query($sql,$db,$ErrMsg); + prnMsg(_('Petty cash Expense record') . ' ' . $SelectedTabs . ' ' . _('has been deleted') ,'success'); + + unset($_GET['delete']); + +}//end of get delete + +if (!isset($SelectedTabs)){ + + /* It could still be the first time the page has been run and a record has been selected for modification - SelectedTabs 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 sales types will be displayed with + links to delete or edit each. These will call the same page again and allow update/input + or deletion of the records*/ + + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<p><table border=1>'; //Main table + echo '<td><table>'; // First column + + echo '<tr><td>' . _('Petty Cash Tabs for User ') . $_SESSION['UserID'] . ":</td><td><select name='SelectedTabs'>"; + + DB_free_result($result); + $SQL = "SELECT tabcode + FROM pctabs + WHERE usercode='" . $_SESSION['UserID'] . "'"; + + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectTabs']) and $myrow['tabcode']==$_POST['SelectTabs']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow['tabcode'] . "'>" . $myrow['tabcode']; + + } //end while loop + + echo '</select></td></tr>'; + echo '</table>'; // close table in first column + echo '</td></tr></table>'; // close main table + + echo '<p><div class="centre"><input type=submit name=process VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + + echo '</form>'; + +} + +//end of ifs and buts! +if (isset($_POST['process'])OR isset($SelectedTabs)) { + + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Petty Cash Tab ') . '' .$SelectedTabs. '<a/></div><p>'; +/* RICARD */ + if (! isset($_GET['edit']) OR isset ($_POST['GO'])){ + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo "<div class='centre'><p>" . _('Detail Of Movements For Last ') .': '; + + if(!isset ($Days)){ + $Days=30; + } + echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + echo "<input type=text class=number name='Days' VALUE=" . $Days . " MAXLENGTH =3 size=4> Days "; + echo '<input type=submit name="Go" value="' . _('Go') . '">'; + echo '<p></div></form>'; + + if (isset($_POST['Cancel'])) { + unset($_POST['SelectedExpense']); + unset($_POST['amount']); + unset($_POST['Date']); + unset($_POST['Notes']); + unset($_POST['Receipt']); + } + + $sql = "SELECT * FROM pcashdetails + WHERE tabcode='$SelectedTabs' + AND date >=DATE_SUB(CURDATE(), INTERVAL ".$Days." DAY) + ORDER BY date, counterindex ASC"; + + $result = DB_query($sql,$db); + + echo '<br><table BORDER=1>'; + echo "<tr> + <th>" . _('Date Of Expense') . "</th> + <th>" . _('Expense Description') . "</th> + <th>" . _('Amount') . "</th> + <th>" . _('Authorized') . "</th> + <th>" . _('Notes') . "</th> + <th>" . _('Receipt') . "</th> + </tr>"; + + $k=0; //row colour counter + + while ($myrow = DB_fetch_row($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + $sqldes="SELECT description + FROM pcexpenses + WHERE codeexpense='". $myrow['3'] . "'"; + + $ResultDes = DB_query($sqldes,$db); + $Description=DB_fetch_array($ResultDes); + + if (!isset($Description['0'])){ + $Description['0']='ASSIGNCASH'; + } + + if (($myrow['5'] == "0000-00-00") and ($Description['0'] != 'ASSIGNCASH')){ + // only movements NOT authorized can be modified or deleted + printf("<td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td><a href='%sSelectedIndex=%s&SelectedTabs=$SelectedTabs&Days=$Days&edit=yes'>" . _('Edit') . "</td> + <td><a href='%sSelectedIndex=%s&SelectedTabs=$SelectedTabs&Days=$Days&delete=yes' onclick=\"return confirm('" . _('Are you sure you wish to delete this code and the expense it may have set up?') . "');\">" . _('Delete') . "</td> + </tr>", + ConvertSQLDate($myrow['2']), + $Description['0'], + number_format($myrow['4'],2), + ConvertSQLDate($myrow['5']), + $myrow['7'], + $myrow['8'], + $_SERVER['PHP_SELF'] . '?' . SID, $myrow['0'], + $_SERVER['PHP_SELF'] . '?' . SID, $myrow['0']); + } else { + printf("<td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + </tr>", + ConvertSQLDate($myrow['2']), + $Description['0'], + number_format($myrow['4'],2), + ConvertSQLDate($myrow['5']), + $myrow['7'], + $myrow['8']); + + } + + } + //END WHILE LIST LOOP + + $sqlamount="SELECT sum(amount) + FROM pcashdetails + WHERE tabcode='$SelectedTabs'"; + + $ResultAmount = DB_query($sqlamount,$db); + $Amount=DB_fetch_array($ResultAmount); + + if (!isset($Amount['0'])) { + $Amount['0']=0; + } + + echo "<tr><td colspan=4 style=text-align:right >" . _('Current balance') . ":</td> + <td colspan=2>".number_format($Amount['0'],2)."</td></tr>"; + + + echo '</table>'; + } + + if (! isset($_GET['delete'])) { + + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<p><table border=1>'; //Main table + echo '<td><table>'; // First column + + + if ( isset($_GET['edit'])) { + $sql = "SELECT * + FROM pcashdetails + WHERE counterindex='$SelectedIndex'"; + + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); + + $_POST['Date'] = ConvertSQLDate($myrow['date']); + $_POST['SelectedExpense'] = $myrow['codeexpense']; + $_POST['Amount'] = -$myrow['amount']; + $_POST['Notes'] = $myrow['notes']; + $_POST['Receipt'] = $myrow['receipt']; + + echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + echo "<input type=hidden name='SelectedIndex' VALUE=" . $SelectedIndex. ">"; + echo "<input type=hidden name='Days' VALUE=" .$Days. ">"; + + }//end of Get Edit + + if (!isset($_POST['Date'])) { + $_POST['Date']=Date("d/m/Y"); + } + + echo '<tr><td>' . _('Date Of Expense') . ":</td>"; + echo '<td><input type=text class="date" alt="'.$_SESSION['DefaultDateFormat'].'" name="Date" size=10 maxlength=10 value=' . $_POST['Date']. '></td></tr>'; + echo '<tr><td>' . _('Code Of Expense') . ":</td><td><select name='SelectedExpense'>"; + + DB_free_result($result); + + $SQL = "SELECT pcexpenses.codeexpense, + pcexpenses.description + FROM pctabexpenses, pcexpenses, pctabs + WHERE pctabexpenses.codeexpense = pcexpenses.codeexpense + AND pctabexpenses.typetabcode = pctabs.typetabcode + AND pctabs.tabcode = '$SelectedTabs' + ORDER BY pcexpenses.codeexpense ASC"; + + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow['codeexpense'] . "'>" . $myrow['codeexpense'] . ' - ' . $myrow['description']; + + } //end while loop + + echo '</select></td></tr>'; + + if (!isset($_POST['Amount'])) { + $_POST['Amount']=0; + } + + echo "<tr><td>" . _('Amount') . ":</td><td><input type='Text' class='number' name='amount' size='12' maxlength='11' value='" . $_POST['Amount'] . "'></td></tr>"; + + if (!isset($_POST['Notes'])) { + $_POST['Notes']=''; + } + + echo "<tr><td>" . _('Notes') . ":</td><td><input type='Text' name='Notes' size=50 maxlength=49 value='" . $_POST['Notes'] . "'></td></tr>"; + + if (!isset($_POST['Receipt'])) { + $_POST['Receipt']=''; + } + + echo "<tr><td>" . _('Receipt') . ":</td><td><input type='Text' name='Receipt' size=50 maxlength=49 value='" . $_POST['Receipt'] . "'></td></tr>"; + echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + echo "<input type=hidden name='Days' VALUE=" .$Days. ">"; + echo '</table>'; // close table in first column + echo '</td></tr></table>'; // close main table + echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + echo '</form>'; + + } // end if user wish to delete + +} + +include('includes/footer.inc'); +?> \ No newline at end of file Property changes on: trunk/PcClaimExpensesFromTab.php ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php (rev 0) +++ trunk/PcExpenses.php 2010-02-17 22:11:45 UTC (rev 3350) @@ -0,0 +1,270 @@ +<?php +/* $Revision: 1.0$ */ + +$PageSecurity = 15; + +include('includes/session.inc'); +$title = _('Maintenance Of Petty Cash Of Expenses'); +include('includes/header.inc'); + +if (isset($_POST['SelectedExpense'])){ + $SelectedExpense = strtoupper($_POST['SelectedExpense']); +} elseif (isset($_GET['SelectedExpense'])){ + $SelectedExpense = strtoupper($_GET['SelectedExpense']); +} + +if (isset($Errors)) { + unset($Errors); +} + +$Errors = array(); + +if (isset($_POST['submit'])) { + + //initialise no input errors assumed initially before we test + $InputError = 0; + + /* actions to take once the user has clicked the submit button + ie the page has called itself with some user input */ + + //first off validate inputs sensible + $i=1; + + if ($_POST['codeexpense']=='' OR $_POST['codeexpense']==' ' OR $_POST['codeexpense']==' ') { + $InputError = 1; + prnMsg('<br>' . _('The Expense type code cannot be an empty string or spaces'),'error'); + $Errors[$i] = 'PcExpenses'; + $i++; + } elseif (strlen($_POST['codeexpense']) >20) { + $InputError = 1; + echo prnMsg(_('The Expense code must be twenty characters or less long'),'error'); + $Errors[$i] = 'PcExpenses'; + $i++; + }elseif (strlen($_POST['description']) >50) { + $InputError = 1; + echo prnMsg(_('The tab code must be Fifty characters or less long'),'error'); + $Errors[$i] = 'TypeTabCode'; + $i++; + } + + if (isset($SelectedExpense) AND $InputError !=1) { + + $sql = "UPDATE pcexpenses + SET description = '" . $_POST['description'] . "', + glaccount = '" . $_POST['glaccount'] . "' + WHERE codeexpense = '$SelectedExpense'"; + + $msg = _('The Expenses type') . ' ' . $SelectedExpense . ' ' . _('has been updated'); + } elseif ( $InputError !=1 ) { + + // First check the type is not being duplicated + + $checkSql = "SELECT count(*) + FROM pcexpenses + WHERE codeexpense = '" . $_POST['codeexpense'] . "'"; + + $checkresult = DB_query($checkSql,$db); + $checkrow = DB_fetch_row($checkresult); + + if ( $checkrow[0] > 0 ) { + $InputError = 1; + prnMsg( _('The Expense type ') . $_POST['codeexpense'] . _(' already exist.'),'error'); + } else { + + // Add new record on submit + + $sql = "INSERT INTO pcexpenses + (codeexpense, + description,glaccount) + VALUES ('" . $_POST['codeexpense'] . "', + '" . $_POST['description'] . "', + '" . $_POST['glaccount'] . "')"; + + $msg = _('Expense ') . ' ' . $_POST['codeexpense'] . ' ' . _('has been created'); + $checkSql = "SELECT count(codeexpense) + FROM pcexpenses"; + $result = DB_query($checkSql, $db); + $row = DB_fetch_row($result); + + } + } + + if ( $InputError !=1) { + //run the SQL from either of the above possibilites + $result = DB_query($sql,$db); + prnMsg($msg,'success'); + + unset($SelectedExpense); + unset($_POST['codeexpense']); + unset($_POST['description']); + unset($_POST['glaccount']); + } + +} elseif ( isset($_GET['delete']) ) { + + // PREVENT DELETES IF DEPENDENT RECORDS IN 'PcTabExpenses' + + $sql= "SELECT COUNT(*) + FROM pctabexpenses + WHERE codeexpense='$SelectedExpense'"; + + $ErrMsg = _('The number of type of tabs using this expense code could not be retrieved'); + $result = DB_query($sql,$db,$ErrMsg); + + $myrow = DB_fetch_row($result); + if ($myrow[0]>0) { + prnMsg(_('Cannot delete this petty cash expense because it is used in some tab types') . '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('tab types using this expense code'),'error'); + + } else { + + $sql="DELETE FROM pcexpenses + WHERE codeexpense='$SelectedExpense'"; + $ErrMsg = _('The expense type record could not be deleted because'); + $result = DB_query($sql,$db,$ErrMsg); + prnMsg(_('Expense type') . ' ' . $SelectedExpense . ' ' . _('has been deleted') ,'success'); + unset ($SelectedExpense); + unset($_GET['delete']); + + + } //end if tab type used in transactions +} + +if (!isset($SelectedExpense)){ + +/* It could still be the second time the page has been run and a record has been selected for modification - SelectedExpense 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 sales types 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 * + FROM pcexpenses'; + $result = DB_query($sql,$db); + + echo '<br><table BORDER=1>'; + echo "<tr> + <th>" . _('Code Of Expense') . "</th> + <th>" . _('Description') . "</th> + <th>" . _('Account Code') . "</th> + <th>" . _('Account Description') . "</th> + </tr>"; + + $k=0; //row colour counter + + while ($myrow = DB_fetch_row($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + $sqldesc="SELECT accountname + FROM chartmaster + WHERE accountcode='". $myrow[2] . "'"; + + $ResultDes = DB_query($sqldesc,$db); + $Description=DB_fetch_array($ResultDes); + + 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'] . '?' . SID, $myrow[0], + $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + } + //END WHILE LIST LOOP + echo '</table>'; +} + +//end of ifs and buts! +if (isset($SelectedExpense)) { + + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Petty Cash Expenses Defined') . '</a></div><p>'; +} +if (! isset($_GET['delete'])) { + + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<p><table border=1>'; //Main table + echo '<td><table>'; // First column + + + // The user wish to EDIT an existing type + if ( isset($SelectedExpense) AND $SelectedExpense!='' ) + { + + $sql = "SELECT codeexpense, + description, + glaccount + FROM pcexpenses + WHERE codeexpense='$SelectedExpense'"; + + $result = DB_query($sql, $db); + $myrow = DB_fetch_array($result); + + $_POST['codeexpense'] = $myrow['codeexpense']; + $_POST['description'] = $myrow['description']; + $_POST['glaccount'] = $myrow['glaccount']; + + echo "<input type=hidden name='SelectedExpense' VALUE=" . $SelectedExpense . ">"; + echo "<input type=hidden name='codeexpense' VALUE=" . $_POST['codeexpense']. ">"; + echo "<table> <tr><td>" . _('Code Of Expense') . ":</td><td>"; + + // We dont allow the user to change an existing type code + + echo $_POST['codeexpense'] . '</td></tr>'; + + } else { + + // This is a new type so the user may volunteer a type code + + echo "<table><tr><td>" . _('Code Of Expense') . ":</td><td><input type='Text' + " . (in_array('SalesType',$Errors) ? 'class="inputerror"' : '' ) ." name='codeexpense'></td></tr>"; + + } + + if (!isset($_POST['description'])) { + $_POST['description']=''; + } + echo "<tr><td>" . _('Description') . ":</td><td><input type='Text' name='description' size=50 maxlength=49 value='" . $_POST['description'] . "'></td></tr>"; + + echo '<tr><td>' . _('Account Code') . ":</td><td><select name='glaccount'>"; + + DB_free_result($result); + $SQL = "SELECT accountcode, + accountname + FROM chartmaster + ORDER BY accountcode"; + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['glaccount']) and $myrow['accountcode']==$_POST['glaccount']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow['accountcode'] . "'>" . $myrow['accountcode'] . ' - ' . $myrow['accountname']; + + } //end while loop + + echo '</select></td></tr>'; + + echo '</table>'; // close table in first column + echo '</td></tr></table>'; // close main table + + echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + + echo '</form>'; + +} // end if user wish to delete + + +include('includes/footer.inc'); +?> \ No newline at end of file Property changes on: trunk/PcExpenses.php ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php (rev 0) +++ trunk/PcExpensesTypeTab.php 2010-02-17 22:11:45 UTC (rev 3350) @@ -0,0 +1,217 @@ +<?php +/* $Revision: 1.0 $ */ + +$PageSecurity = 15; + +include('includes/session.inc'); +$title = _('Maintenance Of Petty Cash Expenses For a Type Tab'); +include('includes/header.inc'); + +if (isset($_POST['SelectedType'])){ + $SelectedType = strtoupper($_POST['SelectedType']); +} elseif (isset($_GET['SelectedType'])){ + $SelectedType = strtoupper($_GET['SelectedType']); +} + +if (isset($_POST['SelectedTabs'])){ + $SelectedTabs = strtoupper($_POST['SelectedTabs']); +} elseif (isset($_GET['SelectedTabs'])){ + $SelectedTabs = strtoupper($_GET['SelectedTabs']); +} + +if (isset($Errors)) { + unset($Errors); +} + +$Errors = array(); + +if (isset($_POST['submit'])) { + + if ( $InputError !=1 ) { + + // First check the type is not being duplicated + + $checkSql = "SELECT count(*) + FROM pctabexpenses + WHERE typetabcode= '" . $_POST['SelectedTabs'] . "' + AND codeexpense = '" . $_POST['SelectedExpense'] . "'"; + + $checkresult = DB_query($checkSql,$db); + $checkrow = DB_fetch_row($checkresult); + + if ( $checkrow[0] >0) { + $InputError = 1; + prnMsg( _('The Expense ') . $_POST['codeexpense'] . _(' already exist in this Type of Tab.'),'error'); + } else { + + // Add new record on submit + + $sql = "INSERT INTO pctabexpenses + (typetabcode, + codeexpense) + VALUES ('" . $_POST['SelectedTabs'] . "', + '" . $_POST['SelectedExpense'] . "')"; + + $msg = _('Expense code:') . ' ' . $_POST["SelectedExpense"].' for Type of Tab:' . $_POST["SelectedTabs"] . ' ' . _('has been created'); + $checkSql = "SELECT count(typetabcode) + FROM pctypetabs"; + $result = DB_query($checkSql, $db); + $row = DB_fetch_row($result); + + } + } + + if ( $InputError !=1) { + //run the SQL from either of the above possibilites + $result = DB_query($sql,$db); + prnMsg($msg,'success'); + + unset($_POST['SelectedExpense']); + } + +} elseif ( isset($_GET['delete']) ) { + + + $sql="DELETE FROM pctabexpenses + WHERE typetabcode='$SelectedTabs' + AND codeexpense='$SelectedType'"; + $ErrMsg = _('The Tab Type record could not be deleted because'); + $result = DB_query($sql,$db,$ErrMsg); + prnMsg(_('Expense code').' '. $SelectedTabs . _('for type of tab').' '. $SelectedType .' '. _('has been deleted') ,'success'); + unset ($SelectedType); + unset($_GET['delete']); + + +} + +if (!isset($SelectedTabs)){ + +/* It could still be the second time the page has been run and a record has been selected for modification - SelectedType 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 sales types will be displayed with +links to delete or edit each. These will call the same page again and allow update/input +or deletion of the records*/ +echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<p><table border=1>'; //Main table + echo '<td><table>'; // First column + +echo '<tr><td>' . _('Select Type of Tab') . ":</td><td><select name='SelectedTabs'>"; + + DB_free_result($result); + $SQL = "SELECT typetabcode,typetabdescription + FROM pctypetabs"; + + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectedTabs']) and $myrow['typetabcode']==$_POST['SelectedTabs']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow['typetabcode'] . "'>" . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription']; + + } //end while loop + + echo '</select></td></tr>'; + + echo '</table>'; // close table in first column + echo '</td></tr></table>'; // close main table + + echo '<p><div class="centre"><input type=submit name=process VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + + echo '</form>'; + +} + +//end of ifs and buts! +if (isset($_POST['process'])OR isset($SelectedTabs)) { + + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Expense Codes for Type of Tab ') . '' .$SelectedTabs. '<a/></div><p>'; + + $sql = "SELECT pctabexpenses.codeexpense, pcexpenses.description + FROM pctabexpenses,pcexpenses + WHERE pctabexpenses.codeexpense=pcexpenses.codeexpense + AND pctabexpenses.typetabcode='$SelectedTabs' + ORDER BY pctabexpenses.codeexpense ASC"; + + $result = DB_query($sql,$db); + + echo '<br><table BORDER=1>'; + echo "<tr> + <th>" . _('Expense Code') . "</th> + <th>" . _('Description') . "</th> + </tr>"; + +$k=0; //row colour counter + +while ($myrow = DB_fetch_row($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + printf("<td>%s</td> + <td>%s</td> + <td><a href='%sSelectedType=%s&delete=yes&SelectedTabs=$_POST[SelectedTabs]' onclick=\"return confirm('" . _('Are you sure you wish to delete this code and the expense it may have set up?') . "');\">" . _('Delete') . "</td> + </tr>", + $myrow[0], + $myrow[1], + $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], + $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + } + //END WHILE LIST LOOP + echo '</table>'; + + + + + if (! isset($_GET['delete'])) { + + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<p><table border=1>'; //Main table + echo '<td><table>'; // First column + + + + echo '<tr><td>' . _('Select Expense Code') . ":</td><td><select name='SelectedExpense'>"; + + DB_free_result($result); + $SQL = "SELECT codeexpense,description + FROM pcexpenses"; + + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectedExpense']) and $myrow['codeexpense']==$_POST['SelectedExpense']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow['codeexpense'] . "'>" . $myrow['codeexpense'] . ' - ' . $myrow['description']; + + } //end while loop + + echo '</select></td></tr>'; + + + echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; + + echo '</table>'; // close table in first column + echo '</td></tr></table>'; // close main table + + echo '<p><div class="centre"><input type=submit name=submit VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; + + echo '</form>'; + +} // end if user wish to delete + + +} + + + +include('includes/footer.inc'); +?> \ No newline at end of file Property changes on: trunk/PcExpensesTypeTab.php ___________________________________________________________________ Added: svn:keywords + Id Added: trunk/PcReportTab.php =================================================================== --- trunk/PcReportTab.php (rev 0) +++ trunk/PcReportTab.php 2010-02-17 22:11:45 UTC (rev 3350) @@ -0,0 +1,420 @@ +<?php + +/* $Revision: 1.0 $ */ + +$PageSecurity = 6; + +include ('includes/session.inc'); +include ('includes/SQL_CommonFunctions.inc'); + +$title = _('Petty Cash Management Report'); + +if (isset($_POST['SelectedTabs'])){ + $SelectedTabs = strtoupper($_POST['SelectedTabs']); +} elseif (isset($_GET['SelectedTabs'])){ + $SelectedTabs = strtoupper($_GET['SelectedTabs']); +} + +if ((! isset($_POST['FromDate']) AND ! isset($_POST['ToDate'])) OR isset($_POST['SelectDifferentDate'])){ + + include ('includes/header.inc'); + echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; + + if (!isset($_POST['FromDate'])){ + $_POST['FromDate']=Date($_SESSION['DefaultDateFormat'], mktime(0,0,0,Date('m'),1,Date('Y'))); + } + + if (!isset($_POST['ToDate'])){ + $_POST['ToDate'] = Date($_SESSION['DefaultDateFormat']); + } + + /*Show a form to allow input of criteria for Tabs to show */ + echo '<table>'; + echo '<tr><td>' . _('Code Of Petty Cash Tab') . ":</td><td><select name='SelectedTabs'>"; + + DB_free_result($result); + + if ($_SESSION['AccessLevel'] >= 8){ // GL user (to supervise the supervisor) + $SQL = "SELECT tabcode + FROM pctabs"; + }else{ + $SQL = "SELECT tabcode + FROM pctabs + WHERE authorizer='" . $_SESSION['UserID'] . "'"; + } + $result = DB_query($SQL,$db); + + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectTabs']) and $myrow['tabcode']==$_POST['SelectTabs']) { + echo "<option selected VALUE='"; + } else { + echo "<option VALUE='"; + } + echo $myrow['tabcode'] . "'>" . $myrow['tabcode']; + + } //end while loop get type of tab + + + echo '</select></td></tr>'; + echo'<tr><td>' . _('From Date :') . '</td><td>'; + echo '<input tabindex="2" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="TEXT" name="FromDate" maxlength="10" size="11" VALUE="' . $_POST['FromDate'] . '">'; + echo '</td></tr>'; + echo '<tr><td>' . _('To Date:') .'</td><td>'; + echo '<input tabindex="3" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" type="TEXT" name="ToDate" maxlength="10" size="11" VALUE="' . $_POST['ToDate'] . '">'; + echo '</td></tr></table><br>'; + echo '<div class="centre"><input type=submit Name="ShowTB" Value="' . _('Show HTML') .'">'; + echo "<input type=submit Name='PrintPDF' Value='"._('PrintPDF')."'></div>"; + +} else if (isset($_POST['PrintPDF'])) { + + + include('includes/PDFStarter.php'); + $PageNumber = 0; + $FontSize = 10; + $pdf->addinfo('Title', _('Petty Cash Report Of Tab') ); + $pdf->addinfo('Subject', _('Petty Cash Report Of Tab') ); + $line_height = 12; + + $SQL_FromDate = FormatDateForSQL($_POST['FromDate']); + $SQL_ToDate = FormatDateForSQL($_POST['ToDate']); + + $SQL = "SELECT * FROM pcashdetails + WHERE tabcode='$SelectedTabs' + AND date >='" . $SQL_FromDate . "' AND date <= '" . $SQL_ToDate . "' + ORDER BY date, counterindex ASC"; + + $TabDetail = DB_query($SQL,$db); + +if (DB_error_no($db)!=0){ + include('includes/header.inc'); + prnMsg(_('An error occurred getting the orders details'),'',_('Database Error')); + if ($debug==1){ + prnMsg( _('The SQL used to get the orders that failed was') . '<br>' . $SQL, '',_('Database Error')); + } + include ('includes/footer.inc'); + exit; +} elseif (DB_num_rows($TabDetail)==0){ + include('includes/header.inc'); + prnMsg(_('There were no expenses found in the database within the period from') . ' ' . $_POST['FromDate'] . ' ' . _('to') . ' '. $_POST['ToDate'] . '. ' . _('Please try again selecting a different date range'),'warn'); + if ($debug==1) { + prnMsg(_('The SQL that returned no rows was') . '<br>' . $SQL,'',_('Database Error')); + } + include('includes/footer.inc'); + exit; +} + + include('includes/PDFTabReportHeader.inc'); + + $SqlTabs = "SELECT * FROM pctabs + WHERE tabcode='$SelectedTabs'"; + + $TabResult = DB_query($SqlTabs, $db, _('No Petty Cash tabs were returned by the SQL because'), _('The SQL that failed was:')); + + $Tabs=DB_fetch_array($TabResult); + + $SqlBalance = "SELECT SUM(amount) FROM pcashdetails + WHERE tabcode='$SelectedTabs' + AND date<'".$SQL_FromDate."'"; + + $TabBalance = DB_query($SqlBalance, + $db); + + $Balance=DB_fetch_array($TabBalance); + + if( !isset($Balance['0'])){ + $Balance['0']=0; + } + + $YPos -= (2 * $line_height); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Tab Code :')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+90,$YPos,20,$FontSize,_(': ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,70,$FontSize,$SelectedTabs); + $LeftOvers = $pdf->addTextWrap($Left_Margin+290,$YPos,70,$FontSize,_('From ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+320,$YPos,20,$FontSize,_(': ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+340,$YPos,70,$FontSize,$_POST['FromDate']); + + $YPos -= $line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('User ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+90,$YPos,20,$FontSize,_(': ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,70,$FontSize,$Tabs['usercode']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+290,$YPos,70,$FontSize,_('To ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+320,$YPos,20,$FontSize,_(': ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+340,$YPos,70,$FontSize,$_POST['ToDate']); + + $YPos -= $line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Authorizer ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+90,$YPos,20,$FontSize,_(': ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,70,$FontSize,$Tabs['authorizer']); + + $YPos -= $line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,_('Currency ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+90,$YPos,20,$FontSize,_(': ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,70,$FontSize,$Tabs['currency']); + + $YPos -= $line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,40,$FontSize,_('Balance before ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+40,$YPos,70,$FontSize,$_POST['FromDate']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+90,$YPos,20,$FontSize,_(': ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,70,$FontSize,number_format($Balance['0'],2)); + $LeftOvers = $pdf->addTextWrap($Left_Margin+140,$YPos,70,$FontSize,$Tabs['currency']); + + $YPos -= (2 * $line_height); + $pdf->line($Page_Width-$Right_Margin, $YPos+$line_height,$Left_Margin, $YPos+$line_height); + + $YPos -= (2 * $line_height); + $FontSize = 8; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,70,$FontSize,_('Date Of Expense')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+70,$YPos,100,$FontSize,_('Description')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+200,$YPos,100,$FontSize,_('Amount')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,_('Note')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,100,$FontSize,_('Receipt')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+420,$YPos,100,$FontSize,_('Date Authorizer')); + $pdf->selectFont('./fonts/Helvetica.afm'); + $YPos -= (2 * $line_height); + + while ($myrow=DB_fetch_array($TabDetail)) { + + $sqldes="SELECT description + FROM pcexpenses + WHERE codeexpense='". $myrow[3] . "'"; + + $ResultDes = DB_query($sqldes,$db); + $Description=DB_fetch_array($ResultDes); + + if (!isset($Description[0])){ + $Description[0]='ASSIGNCASH'; + } + + // Print total for each account + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,70,$FontSize,ConvertSQLDate($myrow['date'])); + $LeftOvers = $pdf->addTextWrap($Left_Margin+70,$YPos,130,$FontSize,$Description[0]); + $LeftOvers = $pdf->addTextWrap($Left_Margin+180,$YPos,50,$FontSize,number_format($myrow['amount'],2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos,100,$FontSize,$myrow['notes']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,70,$FontSize,$myrow['receipt']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+430,$YPos,70,$FontSize,ConvertSQLDate($myrow['authorized'])); + $YPos -= $line_height; + + } //end of while loop + + $sqlamount="SELECT sum(amount) + FROM pcashdetails + WHERE tabcode='$SelectedTabs' + AND date<='".$SQL_ToDate."'"; + + $ResultAmount = DB_query($sqlamount,$db); + $Amount=DB_fetch_array($ResultAmount); + + if (!isset($Amount[0])) { + $Amount[0]=0; + } + + + + $YPos -= (2 * $line_height); + $pdf->line($Left_Margin+250, $YPos+$line_height,$Left_Margin+500, $YPos+$line_height); + $LeftOvers = $pdf->addTextWrap($Left_Margin+70,$YPos,100,$FontSize,_('Balance at')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+110,$YPos,70,$FontSize,$_POST['ToDate']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+160,$YPos,20,$FontSize,_(': ')); + $LeftOvers = $pdf->addTextWrap($Left_Margin+160,$YPos,70,$FontSize,number_format($Amount[0],2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+240,$YPos,70,$FontSize,$Tabs['currency']); + $pdf->line($Page_Width-$Right_Margin, $YPos+$line_height,$Left_Margin, $YPos+$line_height); + + $pdfcode = $pdf->output(); + $len = strlen($pdfcode); + + if ($len<=20){ + $title = _('Print Report Tab Error'); + include('includes/header.inc'); + echo '<p>'; + prnMsg( _('There were no entries to print out for the selections specified') ); + echo '<br><a href="'. $rootpath.'/index.php?' . SID . '">'. _('Back to the menu'). '</a>'; + include('includes/footer.inc'); + exit; + } else { + header('Content-type: application/pdf'); + header('Content-Length: ' . $len); + header('Content-Disposition: inline; filename=TabReports.pdf'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + + $pdf->Output('PcReportTabs.pdf','I'); + + } + exit; +} else { + + include('includes/header.inc'); + + + $SQL_FromDate = FormatDateForSQL($_POST['FromDate']); + $SQL_ToDate = FormatDateForSQL($_POST['ToDate']); + + echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; + echo '<input type=hidden name="FromDate" VALUE="' . $_POST['FromDate'] . '"><input type=hidden name="ToDate" VALUE="' . $_POST['ToDate'] . '">'; + + $SqlTabs = "SELECT * FROM pctabs + WHERE tabcode='$SelectedTabs'"; + + $TabResult = DB_query($SqlTabs, + $db, + _('No Petty Cash Tabs were returned by the SQL because'), + _('The SQL that failed was:')); + + $Tabs=DB_fetch_array($TabResult); + + echo "<br><table >"; + + echo '<tr><td>' . _('Tab Code') . '</td> + <td>:</td> + <td width=200>' . ''.$SelectedTabs.'</td>' . + '<td>' . _('From') . '</td><td>:</td><td>' . + ''.$_POST['FromDate'].'</td></tr>'; + + echo '<tr><td>' . _('User') . '</td> + <td>:</td> + <td>' . ''.$Tabs['usercode'].'</td>'. + '<td>' . _('To') . '</td><td>:</td><td>' . + ''.$_POST['ToDate'].'</td></tr>'; + + echo '<tr><td>' . _('Authorizer') . '</td><td>:</td><td>' . ''.$Tabs['authorizer'].'</td> + </tr>'; + echo '<tr><td>' . _('Currency') . '</td><td>:</td><td>' . ''.$Tabs['currency'].'</td> + </tr>'; + + $SqlBalance = "SELECT SUM(amount) + FROM pcashdetails + WHERE tabcode='$SelectedTabs' + AND date<'".$SQL_FromDate."'"; + + $TabBalance = DB_query($SqlBalance, $db); + + $Balance=DB_fetch_array($TabBalance); + + if( !isset($Balance['0'])){ + $Balance['0']=0; + } + + echo '<tr><td>' . _('Balance before ') . ''.$_POST['FromDate'].'</td><td>:</td><td>' . ''.$Balance['0'].' '.$Tabs['currency'].'</td></tr>'; + + $SqlBalanceNotAut = "S... [truncated message content] |
From: <lin...@us...> - 2010-02-18 06:09:29
|
Revision: 3351 http://web-erp.svn.sourceforge.net/web-erp/?rev=3351&view=rev Author: lindsayh Date: 2010-02-18 06:09:20 +0000 (Thu, 18 Feb 2010) Log Message: ----------- Mostly fixing date formatting for salesorders operations (date format was not recognised by mysql, and thus defaulted). Also added an API method to list branches for a given customer/debtorno. Modified Paths: -------------- trunk/api/api_branches.php trunk/api/api_salesorders.php trunk/api/api_session.inc trunk/api/api_xml-rpc.php trunk/doc/Change.log.html trunk/includes/DateFunctions.inc Modified: trunk/api/api_branches.php =================================================================== --- trunk/api/api_branches.php 2010-02-17 22:11:45 UTC (rev 3350) +++ trunk/api/api_branches.php 2010-02-18 06:09:20 UTC (rev 3351) @@ -527,12 +527,17 @@ return $Errors; } $sql='SELECT * FROM custbranch WHERE debtorno="'.$DebtorNumber.'" and branchcode="'.$BranchCode.'"'; - $result = DB_Query($sql, $db); - if (sizeof($Errors)==0) { - return DB_fetch_array($result); - } else { - return $Errors; + $result = api_DB_Query($sql, $db); + if (DB_error_no($result) != 0 ) + $Errors[0] = DatabaseUpdateFailed; + else + { + $Errors[0] = 0; + if (DB_num_rows($result) > 0) + $Errors += DB_fetch_array($result); } + + return $Errors; } Modified: trunk/api/api_salesorders.php =================================================================== --- trunk/api/api_salesorders.php 2010-02-17 22:11:45 UTC (rev 3350) +++ trunk/api/api_salesorders.php 2010-02-18 06:09:20 UTC (rev 3351) @@ -5,6 +5,13 @@ //revision 1.14 */ +// InsertSalesOrderHeader and ModifySalesOrderHeader have date fields +// which need to be converted to the appropriate format. This is +// a list of such fields used to detect date values and format appropriately. +$SOH_DateFields = array ('orddate', 'deliverydate', + 'datepackingslipprinted', + 'quotedate', 'confirmeddate' ); + /* Check that the custmerref field is 50 characters or less long */ function VerifyCustomerRef($customerref, $i, $Errors) { if (strlen($customerref)>50) { @@ -330,9 +337,12 @@ } $FieldNames=''; $FieldValues=''; + global $SOH_DateFields; $OrderHeader['orderno'] = GetNextTransNo(30,$db); foreach ($OrderHeader as $key => $value) { $FieldNames.=$key.', '; + if (in_array($key, $SOH_DateFields) ) + $value = FormatDateforSQL($value); // Fix dates $FieldValues.='"'.$value.'", '; } $sql = 'INSERT INTO salesorders ('.substr($FieldNames,0,-2).') '. @@ -424,8 +434,11 @@ if (isset($OrderHeader['quotation'])){ $Errors=VerifyQuotation($OrderHeader['quotation'], sizeof($Errors), $Errors); } + global $SOH_DateFields; $sql='UPDATE salesorders SET '; foreach ($OrderHeader as $key => $value) { + if (in_array($key, $SOH_DateFields) ) + $value = FormatDateforSQL($value); // Fix dates $sql .= $key.'="'.$value.'", '; } $sql = substr($sql,0,-2).' WHERE orderno="'.$OrderHeader['orderno'].'"'; @@ -481,6 +494,10 @@ $FieldValues=''; foreach ($OrderLine as $key => $value) { $FieldNames.=$key.', '; + if ($key == 'actualdispatchdate') { + $value = FormatDateWithTimeForSQL($value); + } elseif ($key == 'itemdue') + $value = FormatDateForSQL($value); $FieldValues.='"'.$value.'", '; } $sql = 'INSERT INTO salesorderdetails ('.substr($FieldNames,0,-2).') '. @@ -533,6 +550,11 @@ } $sql='UPDATE salesorderdetails SET '; foreach ($OrderLine as $key => $value) { + if ($key == 'actualdispatchdate') { + $value = FormatDateWithTimeForSQL($value); + } + elseif ($key == 'itemdue') + $value = FormatDateForSQL($value); $sql .= $key.'="'.$value.'", '; } //$sql = substr($sql,0,-2).' WHERE orderno="'.$OrderLine['orderno'].'" and Modified: trunk/api/api_session.inc =================================================================== --- trunk/api/api_session.inc 2010-02-17 22:11:45 UTC (rev 3350) +++ trunk/api/api_session.inc 2010-02-18 06:09:20 UTC (rev 3351) @@ -42,7 +42,7 @@ /*User is logged in so get configuration parameters - save in session*/ if (isset($_SESSION['db']) AND $_SESSION['db'] != '' ) { - //include($PathPrefix . 'includes/GetConfig.php'); + include($PathPrefix . 'includes/GetConfig.php'); } if(isset($_SESSION['DB_Maintenance'])){ Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2010-02-17 22:11:45 UTC (rev 3350) +++ trunk/api/api_xml-rpc.php 2010-02-18 06:09:20 UTC (rev 3351) @@ -248,7 +248,9 @@ $Parameter[3]['name'] = _('User password'); $Parameter[3]['description'] = _('The weberp password associated with this user name. '); $ReturnValue[0] = _('If successful this function returns a set of key/value pairs containing the details of this branch. ') - ._('The key will be identical with field name from the custbranch table. All fields will be in the set regardless of whether the value was set.').'<p>' + ._('The key will be identical with field name from the ') + .'<a href="../../Z_DescribeTable.php?table=custbranch">'._('custbranch table. ').'</a>' + ._('All fields will be in the set regardless of whether the value was set.').'<p>' ._('Otherwise an array of error codes is returned. '); /*E*/ $GetCustomerBranch_sig = array(array($xmlrpcStruct,$xmlrpcString,$xmlrpcString), Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-17 22:11:45 UTC (rev 3350) +++ trunk/doc/Change.log.html 2010-02-18 06:09:20 UTC (rev 3351) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>18/02/10 Lindsay: API: date formatting in api_salesorders.php; added FormatDateWithTimeForSQL function to includes/DateFunctions.inc <p>16/02/10 Pak Ricard: New Petty cash module</p> <p>16/02/10 Lindsay: Added GetCustomerBranchCodes() to API, and aoi_DB_query function to record DB error message and SQL causing it.</p> <p>15/02/10 Lindsay: Return no error indication from SearchCustomer() API</p> Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2010-02-17 22:11:45 UTC (rev 3350) +++ trunk/includes/DateFunctions.inc 2010-02-18 06:09:20 UTC (rev 3351) @@ -423,6 +423,14 @@ }// end of function +function FormatDateWithTimeForSQL ($datetime) { + // Split the time off, fix date and add the time to returned value. + $dt = explode(' ', $datetime); + + return FormatDateForSQL( $dt[0] ) . ' ' . $dt[1]; +} + + function Date1GreaterThanDate2 ($Date1, $Date2) { /* returns 1 true if Date1 is greater than Date 2 */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lin...@us...> - 2010-02-19 09:46:24
|
Revision: 3352 http://web-erp.svn.sourceforge.net/web-erp/?rev=3352&view=rev Author: lindsayh Date: 2010-02-19 09:46:15 +0000 (Fri, 19 Feb 2010) Log Message: ----------- Added severl 'global $db' entries to included files as the API doesn't necessarily include them in the global context. As a result, sales order entry via the API works for both original and new API styles. Including putting the correct date into the records! Modified Paths: -------------- trunk/api/api_login.php trunk/api/api_session.inc trunk/api/api_xml-rpc.php trunk/doc/Change.log.html trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc trunk/includes/ConnectDB_postgres.inc trunk/includes/GetConfig.php trunk/includes/MiscFunctions.php Modified: trunk/api/api_login.php =================================================================== --- trunk/api/api_login.php 2010-02-18 06:09:20 UTC (rev 3351) +++ trunk/api/api_login.php 2010-02-19 09:46:15 UTC (rev 3352) @@ -29,6 +29,7 @@ switch ($rc) { case UL_OK: $RetCode[0] = 0; // All is well + DoSetup(); // Additional setting up break; case UL_NOTVALID: case UL_BLOCKED: @@ -92,4 +93,61 @@ return $retmsg; } + + +/* + * Some initialisation cannot be done until the user is logged in. This + * function should be called when a successful login occurs. + */ + +function DoSetup() +{ + global $PathPrefix; + if (isset($_SESSION['db']) AND $_SESSION['db'] != '' ) + include($PathPrefix . 'includes/GetConfig.php'); + + $db = $_SESSION['db']; // Used a bit in the following. + if(isset($_SESSION['DB_Maintenance'])){ + if ($_SESSION['DB_Maintenance']!=0) { + if (DateDiff(Date($_SESSION['DefaultDateFormat']), + ConvertSQLDate($_SESSION['DB_Maintenance_LastRun']) + ,'d') > $_SESSION['DB_Maintenance']){ + + /*Do the DB maintenance routing for the DB_type selected */ + DB_Maintenance($db); + //purge the audit trail if necessary + if (isset($_SESSION['MonthsAuditTrail'])){ + $sql = "DELETE FROM audittrail + WHERE transactiondate <= '" . Date('Y-m-d', mktime(0,0,0, Date('m')-$_SESSION['MonthsAuditTrail'])) . "'"; + $ErrMsg = _('There was a problem deleting expired audit-trail history'); + $result = DB_query($sql,$db); + } + $_SESSION['DB_Maintenance_LastRun'] = Date('Y-m-d'); + } + } + } + + /*Check to see if currency rates need to be updated */ + if (isset($_SESSION['UpdateCurrencyRatesDaily'])){ + if ($_SESSION['UpdateCurrencyRatesDaily']!=0) { + if (DateDiff(Date($_SESSION['DefaultDateFormat']), + ConvertSQLDate($_SESSION['UpdateCurrencyRatesDaily']) + ,'d')> 0){ + + $CurrencyRates = GetECBCurrencyRates(); // gets rates from ECB see includes/MiscFunctions.php + /*Loop around the defined currencies and get the rate from ECB */ + $CurrenciesResult = DB_query('SELECT currabrev FROM currencies',$db); + while ($CurrencyRow = DB_fetch_row($CurrenciesResult)){ + if ($CurrencyRow[0]!=$_SESSION['CompanyRecord']['currencydefault']){ + $UpdateCurrRateResult = DB_query('UPDATE currencies SET + rate=' . GetCurrencyRate ($CurrencyRow[0],$CurrencyRates) . " + WHERE currabrev='" . $CurrencyRow[0] . "'",$db); + } + } + $_SESSION['UpdateCurrencyRatesDaily'] = Date('Y-m-d'); + $UpdateConfigResult = DB_query("UPDATE config SET confvalue = '" . Date('Y-m-d') . "' WHERE confname='UpdateCurrencyRatesDaily'",$db); + } + } + } +} ?> \ No newline at end of file Modified: trunk/api/api_session.inc =================================================================== --- trunk/api/api_session.inc 2010-02-18 06:09:20 UTC (rev 3351) +++ trunk/api/api_session.inc 2010-02-19 09:46:15 UTC (rev 3352) @@ -40,54 +40,6 @@ $_SESSION['AttemptsCounter'] = 0; } -/*User is logged in so get configuration parameters - save in session*/ -if (isset($_SESSION['db']) AND $_SESSION['db'] != '' ) { - include($PathPrefix . 'includes/GetConfig.php'); -} - -if(isset($_SESSION['DB_Maintenance'])){ - if ($_SESSION['DB_Maintenance']!=0) { - if (DateDiff(Date($_SESSION['DefaultDateFormat']), - ConvertSQLDate($_SESSION['DB_Maintenance_LastRun']) - ,'d') > $_SESSION['DB_Maintenance']){ - - /*Do the DB maintenance routing for the DB_type selected */ - DB_Maintenance($db); - //purge the audit trail if necessary - if (isset($_SESSION['MonthsAuditTrail'])){ - $sql = "DELETE FROM audittrail - WHERE transactiondate <= '" . Date('Y-m-d', mktime(0,0,0, Date('m')-$_SESSION['MonthsAuditTrail'])) . "'"; - $ErrMsg = _('There was a problem deleting expired audit-trail history'); - $result = DB_query($sql,$db); - } - $_SESSION['DB_Maintenance_LastRun'] = Date('Y-m-d'); - } - } -} - -/*Check to see if currency rates need to be updated */ -if (isset($_SESSION['UpdateCurrencyRatesDaily'])){ - if ($_SESSION['UpdateCurrencyRatesDaily']!=0) { - if (DateDiff(Date($_SESSION['DefaultDateFormat']), - ConvertSQLDate($_SESSION['UpdateCurrencyRatesDaily']) - ,'d')> 0){ - - $CurrencyRates = GetECBCurrencyRates(); // gets rates from ECB see includes/MiscFunctions.php - /*Loop around the defined currencies and get the rate from ECB */ - $CurrenciesResult = DB_query('SELECT currabrev FROM currencies',$db); - while ($CurrencyRow = DB_fetch_row($CurrenciesResult)){ - if ($CurrencyRow[0]!=$_SESSION['CompanyRecord']['currencydefault']){ - $UpdateCurrRateResult = DB_query('UPDATE currencies SET - rate=' . GetCurrencyRate ($CurrencyRow[0],$CurrencyRates) . " - WHERE currabrev='" . $CurrencyRow[0] . "'",$db); - } - } - $_SESSION['UpdateCurrencyRatesDaily'] = Date('Y-m-d'); - $UpdateConfigResult = DB_query("UPDATE config SET confvalue = '" . Date('Y-m-d') . "' WHERE confname='UpdateCurrencyRatesDaily'",$db); - } - } -} -// include('../includes/GetConfig.php'); if ($_SESSION['HTTPS_Only']==1){ if ($_SERVER['HTTPS']!='on'){ prnMsg(_('webERP is configured to allow only secure socket connections. Pages must be called with https://') . ' .....','error'); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2010-02-18 06:09:20 UTC (rev 3351) +++ trunk/api/api_xml-rpc.php 2010-02-19 09:46:15 UTC (rev 3352) @@ -222,7 +222,7 @@ function xmlrpc_GetCustomerBranchCodes($xmlrpcmsg){ ob_start('ob_file_callback'); -/*x*/ if ($xmlrpcmsg->getNumParams() == 4) +/*x*/ if ($xmlrpcmsg->getNumParams() == 3) /*x*/ { /*x*/ $rtn = new xmlrpcresp( php_xmlrpc_encode(GetCustomerBranchCodes($xmlrpcmsg->getParam( 0 )->scalarval( ), /*x*/ $xmlrpcmsg->getParam( 1 )->scalarval( ), Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-18 06:09:20 UTC (rev 3351) +++ trunk/doc/Change.log.html 2010-02-19 09:46:15 UTC (rev 3352) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>19/02/10 Lindsay: Bug fixing to make SalesOrder entry work for old and new API.</p> <p>18/02/10 Lindsay: API: date formatting in api_salesorders.php; added FormatDateWithTimeForSQL function to includes/DateFunctions.inc <p>16/02/10 Pak Ricard: New Petty cash module</p> <p>16/02/10 Lindsay: Added GetCustomerBranchCodes() to API, and aoi_DB_query function to record DB error message and SQL causing it.</p> Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2010-02-18 06:09:20 UTC (rev 3351) +++ trunk/includes/ConnectDB_mysql.inc 2010-02-19 09:46:15 UTC (rev 3352) @@ -4,6 +4,7 @@ define ('LIKE','LIKE'); +global $db; // Make sure it IS global, regardless of our context $db = mysql_connect($host.':'.$mysqlport , $dbuser, $dbpassword); if ( !$db ) { Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2010-02-18 06:09:20 UTC (rev 3351) +++ trunk/includes/ConnectDB_mysqli.inc 2010-02-19 09:46:15 UTC (rev 3352) @@ -9,6 +9,7 @@ define ('LIKE','LIKE'); +global $db; // Make sure it IS global, regardless of our context $db = mysqli_connect($host , $dbuser, $dbpassword,$_SESSION['DatabaseName'], $mysqlport); /* check connection */ Modified: trunk/includes/ConnectDB_postgres.inc =================================================================== --- trunk/includes/ConnectDB_postgres.inc 2010-02-18 06:09:20 UTC (rev 3351) +++ trunk/includes/ConnectDB_postgres.inc 2010-02-19 09:46:15 UTC (rev 3352) @@ -18,6 +18,7 @@ } } +global $db; // Make sure it IS global, regardless of our context $db = pg_connect( $PgConnStr ); if ( !$db ) { Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2010-02-18 06:09:20 UTC (rev 3351) +++ trunk/includes/GetConfig.php 2010-02-19 09:46:15 UTC (rev 3352) @@ -4,6 +4,7 @@ /* $Id$*/ if(isset($ForceConfigReload) and $ForceConfigReload==TRUE OR !isset($_SESSION['CompanyDefaultsLoaded'])) { + global $db; // It is global, we may not be. $sql = 'SELECT confname, confvalue FROM config'; // dont care about the order by $ConfigResult = DB_query($sql,$db); while( $myrow = DB_fetch_row($ConfigResult) ) { Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2010-02-18 06:09:20 UTC (rev 3351) +++ trunk/includes/MiscFunctions.php 2010-02-19 09:46:15 UTC (rev 3352) @@ -202,4 +202,70 @@ return $myrow['decimalplaces']; } + +// Lindsay debug stuff +function LogBackTrace( $dest = 0 ) { + error_log( "***BEGIN STACK BACKTRACE***", $dest ); + + $stack = debug_backtrace(); + // Leave out our frame and the topmost - huge for xmlrpc! + for( $ii = 1; $ii < count( $stack ) - 3; $ii++ ) + { + $frame = $stack[$ii]; + $msg = "FRAME " . $ii . ": "; + if( isset( $frame['file'] ) ) + $msg .= "; file=" . $frame['file']; + if( isset( $frame['line'] ) ) + $msg .= "; line=" . $frame['line']; + if( isset( $frame['function'] ) ) + $msg .= "; function=" . $frame['function']; + if( isset( $frame['args'] ) ) + { + // Either function args, or included file name(s) + $msg .= ' ('; + foreach( $frame['args'] as $val ) + { + $typ = gettype( $val ); + switch( $typ ) + { + case 'array': + $msg .= '[ '; + foreach( $val as $v2 ) + { + if( gettype( $v2 ) == 'array' ) + { + $msg .= '[ '; + foreach( $v2 as $v3 ) + $msg .= $v3; + $msg .= ' ]'; + } + else + $msg .= $v2 . ', '; + } + + $msg .= ' ]'; + break; + + case 'string': + $msg .= $val . ', '; + break; + + case 'integer': + $msg .= sprintf( "%d, ", $val ); + break; + + default: + $msg .= '<' . gettype( $val ) . '>, '; + break; + } + } + $msg .= ' )'; + } + error_log( $msg, $dest ); + } + + error_log( '++++END STACK BACKTRACE++++', $dest ); + + return; +} ?> \ 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: <lin...@us...> - 2010-02-20 11:28:28
|
Revision: 3354 http://web-erp.svn.sourceforge.net/web-erp/?rev=3354&view=rev Author: lindsayh Date: 2010-02-20 11:28:20 +0000 (Sat, 20 Feb 2010) Log Message: ----------- Fix InsertSalesInvoice to return a value always, and also to return the invoice number generated. InsertSalesCredit always returns a value now. And updated the InsertSalesInvoice description now that I see how it works! Modified Paths: -------------- trunk/api/api_debtortransactions.php trunk/api/api_xml-rpc.php trunk/doc/Change.log.html Modified: trunk/api/api_debtortransactions.php =================================================================== --- trunk/api/api_debtortransactions.php 2010-02-20 07:24:11 UTC (rev 3353) +++ trunk/api/api_debtortransactions.php 2010-02-20 11:28:20 UTC (rev 3354) @@ -369,7 +369,10 @@ $Errors[0] = DatabaseUpdateFailed; } else { $Errors[0]=0; + // Return invoice number too + $Errors[] = $InvoiceDetails['transno']; } + return $Errors; } else { return $Errors; } @@ -478,6 +481,7 @@ } else { $Errors[0]=0; } + return $Errors; } else { return $Errors; } Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2010-02-20 07:24:11 UTC (rev 3353) +++ trunk/api/api_xml-rpc.php 2010-02-20 11:28:20 UTC (rev 3354) @@ -1007,11 +1007,20 @@ $Description = _('Inserts a sales invoice into the debtortrans table and does the relevant GL entries'); $Parameter[0]['name'] = _('Invoice Details'); - $Parameter[0]['description'] = _('An array of index/value items describing the invoice.'); + $Parameter[0]['description'] = _('An array of index/value items describing the invoice.') + ._('The field names can be found ').'<a href="../../Z_DescribeTable.php?table=debtortrans">'._('here ').'</a>' + ._('and are case sensitive. ')._('The values should be of the correct type, and the api will check them before updating the database. ') + ._('The transno key is generated by this call, and if a value is supplied, it will be ignored. ') + ._('Two additional fields are required. "partcode" needs to be a genuine part number, though it appears to serve no real purpose. ') + ._('"salesarea" also is required, though again it appears to serve no useful purpose. ') + ._('It is not necessary to include all the fields in this parameter, the database default value will be used if the field is not given.'); $Parameter[1]['name'] = _('User name'); $Parameter[1]['description'] = _('A valid weberp username. This user should have security access to this data.'); $Parameter[2]['name'] = _('User password'); $Parameter[2]['description'] = _('The weberp password associated with this user name. '); + $ReturnValue[0] = _('This function returns an array of integers. ') + ._('If the first element is zero then the function was successful, and the second element is the invoice number. ') + ._('Otherwise an array of error codes is returned and no insertion takes place. '); /*E*/ $InsertSalesInvoice_sig = array(array($xmlrpcStruct,$xmlrpcStruct), /*x*/ array($xmlrpcStruct,$xmlrpcStruct,$xmlrpcString,$xmlrpcString)); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-20 07:24:11 UTC (rev 3353) +++ trunk/doc/Change.log.html 2010-02-20 11:28:20 UTC (rev 3354) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>20/02/10 Lindsay: Bug fix and better description for API functions for SalesInvoiceEntry/Modify</p> <p>19/02/10 Lindsay: Bug fixing to make SalesOrder entry work for old and new API.</p> <p>18/02/10 Lindsay: API: date formatting in api_salesorders.php; added FormatDateWithTimeForSQL function to includes/DateFunctions.inc <p>16/02/10 Pak Ricard: New Petty cash module</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2010-02-27 07:39:10
|
Revision: 3357 http://web-erp.svn.sourceforge.net/web-erp/?rev=3357&view=rev Author: daintree Date: 2010-02-27 07:39:03 +0000 (Sat, 27 Feb 2010) Log Message: ----------- updates to GLAccountReport.php and new script GLAccountCSV.php in progress Modified Paths: -------------- trunk/GLAccountReport.php trunk/doc/Manual/ManualPettyCash.html Added Paths: ----------- trunk/GLAccountCSV.php Added: trunk/GLAccountCSV.php =================================================================== --- trunk/GLAccountCSV.php (rev 0) +++ trunk/GLAccountCSV.php 2010-02-27 07:39:03 UTC (rev 3357) @@ -0,0 +1,355 @@ +<?php + +/* $Id: $*/ +/* $Revision: 1.00 $ */ + +$PageSecurity = 8; +include ('includes/session.inc'); +$title = _('General Ledger Account Report'); +include('includes/header.inc'); +include('includes/GLPostings.inc'); + +if (isset($_POST['Period'])){ + $SelectedPeriod = $_POST['Period']; +} elseif (isset($_GET['Period'])){ + $SelectedPeriod = $_GET['Period']; +} + +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger Account Inquiry') . '" alt="">' . ' ' . _('General Ledger Account Report') . '</p>'; + +echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</div><br>'; + +echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + +/*Dates in SQL format for the last day of last month*/ +$DefaultPeriodDate = Date ('Y-m-d', Mktime(0,0,0,Date('m'),0,Date('Y'))); + +/*Show a form to allow input of criteria for the report */ +echo '<table> + <tr> + <td>'._('Selected Accounts') . ':</td> + <td><select name="Account[]" multiple>'; +$sql = 'SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode'; +$AccountsResult = DB_query($sql,$db); +$i=0; +while ($myrow=DB_fetch_array($AccountsResult,$db)){ + if(isset($_POST['Account'][$i]) AND $myrow['accountcode'] == $_POST['Account'][$i]){ + echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + $i++; + } else { + echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + } +} +echo '</select></td>'; + +echo '<td>'._('For Period range').':</td> + <td><select Name=Period[] multiple>'; +$sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; +$Periods = DB_query($sql,$db); +$id=0; + +while ($myrow=DB_fetch_array($Periods,$db)){ + if (isset($SelectedPeriod[$id]) and $myrow['periodno'] == $SelectedPeriod[$id]){ + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + $id++; + } else { + echo '<option VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + } +} +echo '</select></td></tr>'; + +//Select the tag +echo '<tr><td>' . _('Select 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 - '._('All tags'); +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']; + } else { + echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + } +} +echo '</select></td></tr>'; +// End select tag + +echo "</table><p> +<div class='centre'><input type=submit name='RunReport' VALUE='"._('Run Report')."'></div></form>"; + +/* End of the Form rest of script is what happens if the show button is hit*/ + +if (isset($_POST['RunReport'])){ + + if (!isset($SelectedPeriod)){ + prnMsg(_('A period or range of periods must be selected from the list box'),'info'); + include('includes/footer.inc'); + exit; + } + if (!isset($_POST['Account'])){ + prnMsg(_('An account or range of accounts must be selected from the list box'),'info'); + include('includes/footer.inc'); + exit; + + } + + + $FilePointer = fopen('./companies/' . $_SESSION['DatabaseName'] . '/' . $_SESSION['ReportsDir'] . '/accounts.csv','w'); + + + foreach ($_POST['Account'] as $SelectedAccount){ + /*Is the account a balance sheet or a profit and loss account */ + $result = DB_query("SELECT chartmaster.accountname, + accountgroups.pandl + FROM accountgroups + INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ + WHERE chartmaster.accountcode=$SelectedAccount",$db); + $AccountDetailRow = DB_fetch_row($result); + $AccountName = $AccountDetailRow[1]; + if ($AccountDetailRow[1]==1){ + $PandLAccount = True; + }else{ + $PandLAccount = False; /*its a balance sheet account */ + } + + $FirstPeriodSelected = min($SelectedPeriod); + $LastPeriodSelected = max($SelectedPeriod); + + if ($_POST['tag']==0) { + $sql= "SELECT type, + typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans, systypes + WHERE gltrans.account = $SelectedAccount + AND systypes.typeid=gltrans.type + AND posted=1 + AND periodno>=$FirstPeriodSelected + AND periodno<=$LastPeriodSelected + ORDER BY periodno, gltrans.trandate, counterindex"; + + } else { + $sql= "SELECT gltrans.type, + gltrans.typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans, systypes + WHERE gltrans.account = $SelectedAccount + AND systypes.typeid=gltrans.type + AND posted=1 + AND periodno>=$FirstPeriodSelected + AND periodno<=$LastPeriodSelected + AND tag='".$_POST['tag']."' + ORDER BY periodno, gltrans.trandate, counterindex"; + } + + $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; + $TransResult = DB_query($sql,$db,$ErrMsg); + + fwrite($FilePointer, $SelectedAccount . ' - ' . $AccountName . ' ' . _('for period'). ' ' . $FirstPeriodSelected . ' ' . _('to') . ' ' . $LastPeriodSelected); + if ($PandLAccount==True) { + $RunningTotal = 0; + } else { + $sql = "SELECT bfwd, + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode= $SelectedAccount + AND chartdetails.period=" . $FirstPeriodSelected; + + $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); + $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); + $ChartDetailRow = DB_fetch_array($ChartDetailsResult); + + $RunningTotal =$ChartDetailRow['bfwd']; + + if ($RunningTotal < 0 ){ //its a credit balance b/fwd + fwrite($FilePointer, _('Brought Forward Balance') . ',,,' . number_format(-$RunningTotal,2)); + } else { //its a debit balance b/fwd + fwrite($FilePointer,_('Brought Forward Balance') . ',,,,' . number_format($RunningTotal,2)); + } + } + $PeriodTotal = 0; + $PeriodNo = -9999; + + $j = 1; + $k=0; //row colour counter + + while ($myrow=DB_fetch_array($TransResult)) { + + if ($myrow['periodno']!=$PeriodNo){ + if ($PeriodNo!=-9999){ //ie its not the first time around + /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ + $sql = "SELECT bfwd, + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode= $SelectedAccount + AND chartdetails.period=" . $PeriodNo; + + $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); + $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); + $ChartDetailRow = DB_fetch_array($ChartDetailsResult); + + if ($PeriodTotal < 0 ){ + fwrite($FilePointer, _('Period Total') . ',,,' . number_format(-$PeriodTotal,2)); + } else { //its a debit balance b/fwd + fwrite($FilePointer,_('Period Total') . ',,,,' . number_format($PeriodTotal,2)); + } + } + $PeriodNo = $myrow['periodno']; + $PeriodTotal = 0; + } + + $RunningTotal += $myrow['amount']; + $PeriodTotal += $myrow['amount']; + + if($myrow['amount']>=0){ + $DebitAmount = number_format($myrow['amount'],2); + $CreditAmount = ''; + } else { + $CreditAmount = number_format(-$myrow['amount'],2); + $DebitAmount = ''; + } + + $FormatedTranDate = ConvertSQLDate($myrow['trandate']); + + $tagsql='SELECT tagdescription FROM tags WHERE tagref='.$myrow['tag']; + $tagresult=DB_query($tagsql,$db); + $tagrow = DB_fetch_array($tagresult); + + // to edit this block + $YPos -=$line_height; + $FontSize=8; + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,30,$FontSize,$myrow['typename']); + $LeftOvers = $pdf->addTextWrap(80,$YPos,30,$FontSize,$myrow['typeno'],'right'); + $LeftOvers = $pdf->addTextWrap(110,$YPos,50,$FontSize,$FormatedTranDate); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize,$DebitAmount,'right'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize,$CreditAmount,'right'); + $LeftOvers = $pdf->addTextWrap(320,$YPos,150,$FontSize,$myrow['narrative']); + $LeftOvers = $pdf->addTextWrap(470,$YPos,80,$FontSize,$tagrow['tagdescription']); + + if ($YPos < $Bottom_Margin + $line_height){ + NewPageHeader(); + $YPos -=$line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,$SelectedAccount . ' - ' . $AccountName); + } + + } + $YPos -=$line_height; + if ($PandLAccount==True){ + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize, _('Total Period Movement')); + } else { /*its a balance sheet account*/ + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Balance C/Fwd')); + } + + if ($RunningTotal >0){ + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$RunningTotal,2) , 'right'); + } else { //its a debit balance b/fwd + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($RunningTotal,2) , 'right'); + } + $YPos -=$line_height; + //draw a line under each account printed + $pdf->line($Left_Margin, $YPos,$Page_Width-$Right_Margin, $YPos); + } /*end for each SelectedAccount */ +} /* end of if PrintReport button hit */ + + +/*Now check that there is some output and print the report out */ +if (count($_POST['Account'])==0) { + prnMsg(_('An account or range of accounts must be selected from the list box'),'info'); + include('includes/footer.inc'); + exit; + +} else { //print the report + + + + + + + + + + + + + +| + +function NewPageHeader () { + global $PageNumber, + $pdf, + $YPos, + $Page_Height, + $Page_Width, + $Top_Margin, + $FontSize, + $Left_Margin, + $Right_Margin, + $line_height; + $SelectedAccount; + $AccountName; + + /*PDF page header for GL Account report */ + + if ($PageNumber > 1){ + $pdf->newPage(); + } + + $FontSize=10; + $YPos= $Page_Height-$Top_Margin; + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,$_SESSION['CompanyRecord']['coyname']); + + $YPos -=$line_height; + + $FontSize=10; + + $ReportTitle = _('GL Account Report'); + + + $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos,450,$FontSize, $ReportTitle . ' ' . _('for all stock locations')); + + $FontSize=8; + $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-120,$YPos,120,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber); + + $YPos -=(2*$line_height); + + /*Draw a rectangle to put the headings in */ + + $pdf->line($Left_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos+$line_height); + $pdf->line($Left_Margin, $YPos+$line_height,$Left_Margin, $YPos- $line_height); + $pdf->line($Left_Margin, $YPos- $line_height,$Page_Width-$Right_Margin, $YPos- $line_height); + $pdf->line($Page_Width-$Right_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos- $line_height); + + /*set up the headings */ + $XPos = $Left_Margin+1; + + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,30,$FontSize,_('Type'),'centre'); + $LeftOvers = $pdf->addTextWrap(80,$YPos,30,$FontSize,_('Reference'),'centre'); + $LeftOvers = $pdf->addTextWrap(110,$YPos,50,$FontSize,_('Date'),'centre'); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize,_('Debit'),'centre'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize,_('Credit'),'centre'); + $LeftOvers = $pdf->addTextWrap(320,$YPos,150,$FontSize,_('Narrative'),'centre'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,80,$FontSize,_('Tag'),'centre'); + + + $YPos =$YPos - (2*$line_height); + $FontSize=8; +} + +?> Modified: trunk/GLAccountReport.php =================================================================== --- trunk/GLAccountReport.php 2010-02-23 09:26:23 UTC (rev 3356) +++ trunk/GLAccountReport.php 2010-02-27 07:39:03 UTC (rev 3357) @@ -1,390 +1,376 @@ -<?php - -/* $Id: GLAccountInquiry.php 3233 2009-12-16 11:41:34Z tim_schofield $*/ -/* $Revision: 1.28 $ */ - -$PageSecurity = 8; -include ('includes/session.inc'); -$title = _('General Ledger Account Report'); -include('includes/header.inc'); -include('includes/GLPostings.inc'); - - -if (isset($_POST['Period'])){ - $SelectedPeriod = $_POST['Period']; -} elseif (isset($_GET['Period'])){ - $SelectedPeriod = $_GET['Period']; -} - -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger Account Inquiry') . '" alt="">' . ' ' . _('General Ledger Account Report') . '</p>'; - -echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</div><br>'; - -echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; - -/*Dates in SQL format for the last day of last month*/ -$DefaultPeriodDate = Date ('Y-m-d', Mktime(0,0,0,Date('m'),0,Date('Y'))); - -/*Show a form to allow input of criteria for the report */ -echo '<table> - <tr> - <td>'._('Selected Accounts') . ':</td> - <td><select name="Account[]" multiple>'; -$sql = 'SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode'; -$AccountsResult = DB_query($sql,$db); -$i=0; -while ($myrow=DB_fetch_array($AccountsResult,$db)){ - if(isset($_POST['Account'][$i]) AND $myrow['accountcode'] == $_POST['Account'][$i]){ - echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; - $i++; - } else { - echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; - } -} -echo '</select></td>'; - -echo '<td>'._('For Period range').':</td> - <td><select Name=Period[] multiple>'; -$sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; -$Periods = DB_query($sql,$db); -$id=0; - -while ($myrow=DB_fetch_array($Periods,$db)){ - if (isset($SelectedPeriod[$id]) and $myrow['periodno'] == $SelectedPeriod[$id]){ - echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); - $id++; - } else { - echo '<option VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); - } -} -echo '</select></td></tr>'; - -//Select the tag -echo '<tr><td>' . _('Select 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 - '._('All tags'); -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']; - } else { - echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; - } -} -echo '</select></td></tr>'; -// End select tag - -echo "</table><p> -<div class='centre'><input type=submit name='RunReport' VALUE='"._('Run Report')."'></div></form>"; - -/* End of the Form rest of script is what happens if the show button is hit*/ - -if (isset($_POST['RunReport'])){ - - if (!isset($SelectedPeriod)){ - prnMsg(_('A period or range of periods must be selected from the list box'),'info'); - include('includes/footer.inc'); - exit; - } - if (!isset($_POST['Account'])){ - prnMsg(_('An account or range of accounts must be selected from the list box'),'info'); - include('includes/footer.inc'); - exit; - - } - - include('includes/PDFStarter.php'); - -/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ - - $pdf->addInfo('Title',_('GL Account Report')); - $pdf->addInfo('Subject',_('GL Account Report'); - $line_height=12; - $PageNumber = 1; - $FontSize=10; - NewPageHeader(); - - foreach ($_POST['Account'] as $SelectedAccount){ - /*Is the account a balance sheet or a profit and loss account */ - $result = DB_query("SELECT chartmaster.accountname, - accountgroups.pandl - FROM accountgroups - INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ - WHERE chartmaster.accountcode=$SelectedAccount",$db); - $AccountDetailRow = DB_fetch_row($result); - $AccountName = $AccountDetailRow[1]; - if ($AccountDetailRow[1]==1){ - $PandLAccount = True; - }else{ - $PandLAccount = False; /*its a balance sheet account */ - } - - $FirstPeriodSelected = min($SelectedPeriod); - $LastPeriodSelected = max($SelectedPeriod); - - if ($_POST['tag']==0) { - $sql= "SELECT type, - typename, - gltrans.typeno, - trandate, - narrative, - amount, - periodno, - tag - FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected - ORDER BY periodno, gltrans.trandate, counterindex"; - - } else { - $sql= "SELECT type, - typename, - gltrans.typeno, - trandate, - narrative, - amount, - periodno, - tag - FROM gltrans, systypes - WHERE gltrans.account = $SelectedAccount - AND systypes.typeid=gltrans.type - AND posted=1 - AND periodno>=$FirstPeriodSelected - AND periodno<=$LastPeriodSelected - AND tag='".$_POST['tag']."' - ORDER BY periodno, gltrans.trandate, counterindex"; - } - - $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; - $TransResult = DB_query($sql,$db,$ErrMsg); - - if ($YPos < ($Bottom_Margin + (5 * $line_height)){ - NewPageHeader(); - } - - if ($PandLAccount==True) { - $RunningTotal = 0; - } else { - $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode= $SelectedAccount - AND chartdetails.period=" . $FirstPeriodSelected; - - $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); - $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); - $ChartDetailRow = DB_fetch_array($ChartDetailsResult); - - $YPos -=$line_height; - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,$SelectedAccount . ' - ' . $AccountName); - - $RunningTotal =$ChartDetailRow['bfwd']; - if ($RunningTotal < 0 ){ //its a credit balance b/fwd - $YPos -=$line_height; - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,30,$FontSize,$SelectedAccount . ' - ' . $AccountName); - - - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Brought Forward Balance') . '</b><td> - </td></td> - <td class=number><b>' . number_format(-$RunningTotal,2) . '</b></td> - <td></td> - </tr>'; - } else { //its a debit balance b/fwd - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Brought Forward Balance') . '</b></td> - <td class=number><b>' . number_format($RunningTotal,2) . '</b></td> - <td colspan=2></td> - </tr>'; - } - } - $PeriodTotal = 0; - $PeriodNo = -9999; - $ShowIntegrityReport = False; - $j = 1; - $k=0; //row colour counter - - while ($myrow=DB_fetch_array($TransResult)) { - - if ($myrow['periodno']!=$PeriodNo){ - if ($PeriodNo!=-9999){ //ie its not the first time around - /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ - - $sql = "SELECT bfwd, - actual, - period - FROM chartdetails - WHERE chartdetails.accountcode= $SelectedAccount - AND chartdetails.period=" . $PeriodNo; - - $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); - $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); - $ChartDetailRow = DB_fetch_array($ChartDetailsResult); - - echo "<tr bgcolor='#FDFEEF'> - <td colspan=3><b>" . _('Total for period') . ' ' . $PeriodNo . '</b></td>'; - if ($PeriodTotal < 0 ){ //its a credit balance b/fwd - echo '<td></td> - <td class=number><b>' . number_format(-$PeriodTotal,2) . '</b></td> - <td></td> - </tr>'; - } else { //its a debit balance b/fwd - echo '<td class=number><b>' . number_format($PeriodTotal,2) . '</b></td> - <td colspan=2></td> - </tr>'; - } - $IntegrityReport .= '<br>' . _('Period') . ': ' . $PeriodNo . _('Account movement per transaction') . ': ' . number_format($PeriodTotal,2) . ' ' . _('Movement per ChartDetails record') . ': ' . number_format($ChartDetailRow['actual'],2) . ' ' . _('Period difference') . ': ' . number_format($PeriodTotal -$ChartDetailRow['actual'],3); - - if (ABS($PeriodTotal -$ChartDetailRow['actual'])>0.01){ - $ShowIntegrityReport = True; - } - } - $PeriodNo = $myrow['periodno']; - $PeriodTotal = 0; - } - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k++; - } - - $RunningTotal += $myrow['amount']; - $PeriodTotal += $myrow['amount']; - - if($myrow['amount']>=0){ - $DebitAmount = number_format($myrow['amount'],2); - $CreditAmount = ''; - } else { - $CreditAmount = number_format(-$myrow['amount'],2); - $DebitAmount = ''; - } - - $FormatedTranDate = ConvertSQLDate($myrow['trandate']); - - $tagsql='SELECT tagdescription FROM tags WHERE tagref='.$myrow['tag']; - $tagresult=DB_query($tagsql,$db); - $tagrow = DB_fetch_array($tagresult); - - // to edit this block - $YPos -=$line_height; - $FontSize=8; - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,30,$FontSize,$myrow['typename']); - $LeftOvers = $pdf->addTextWrap(80,$YPos,30,$FontSize,$myrow['typeno'],'right'); - $LeftOvers = $pdf->addTextWrap(110,$YPos,50,$FontSize,$FormatedTranDate); - $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize,$DebitAmount,'right'); - $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize,$CreditAmount,'right'); - $LeftOvers = $pdf->addTextWrap(320,$YPos,150,$FontSize,$myrow['narrative']); - $LeftOvers = $pdf->addTextWrap(470,$YPos,80,$FontSize,$tagrow['tagdescription']); - - if ($YPos < $Bottom_Margin + $line_height){ - NewPageHeader(); - $YPos -=$line_height; - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,$SelectedAccount . ' - ' . $AccountName); - } - - } - - echo "<tr bgcolor='#FDFEEF'><td colspan=3><b>"; - if ($PandLAccount==True){ - echo _('Total Period Movement'); - } else { /*its a balance sheet account*/ - echo _('Balance C/Fwd'); - } - echo '</b></td>'; - - if ($RunningTotal >0){ - echo '<td class=number><b>' . number_format(($RunningTotal),2) . '</b></td><td colspan=2></td></tr>'; - }else { - echo '<td></td><td class=number><b>' . number_format((-$RunningTotal),2) . '</b></td><td colspan=2></td></tr>'; - } - echo '</table>'; - echo '<hr />'; - } /*end for each SelectedAccount */ -} /* end of if Show button hit */ - - - -if (isset($ShowIntegrityReport) and $ShowIntegrityReport==True){ - if (!isset($IntegrityReport)) {$IntegrityReport='';} - prnMsg( _('There are differences between the sum of the transactions and the recorded movements in the ChartDetails table') . '. ' . _('A log of the account differences for the periods report shows below'),'warn'); - echo '<p>'.$IntegrityReport; -} -include('includes/footer.inc'); - - -function NewPageHeader () { - global $PageNumber, - $pdf, - $YPos, - $Page_Height, - $Page_Width, - $Top_Margin, - $FontSize, - $Left_Margin, - $Right_Margin, - $line_height; - $SelectedAccount; - $AccountName; - - /*PDF page header for GL Account report */ - - if ($PageNumber > 1){ - $pdf->newPage(); - } - - $FontSize=10; - $YPos= $Page_Height-$Top_Margin; - - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,$_SESSION['CompanyRecord']['coyname']); - - $YPos -=$line_height; - - $FontSize=10; - - $ReportTitle = _('GL Account Report'); - - - $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos,450,$FontSize, $ReportTitle . ' ' . _('for all stock locations')); - - $FontSize=8; - $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-120,$YPos,120,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber); - - $YPos -=(2*$line_height); - - /*Draw a rectangle to put the headings in */ - - $pdf->line($Left_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos+$line_height); - $pdf->line($Left_Margin, $YPos+$line_height,$Left_Margin, $YPos- $line_height); - $pdf->line($Left_Margin, $YPos- $line_height,$Page_Width-$Right_Margin, $YPos- $line_height); - $pdf->line($Page_Width-$Right_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos- $line_height); - - /*set up the headings */ - $XPos = $Left_Margin+1; - - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,30,$FontSize,_('Type'),'centre'); - $LeftOvers = $pdf->addTextWrap(80,$YPos,30,$FontSize,_('Reference'),'centre'); - $LeftOvers = $pdf->addTextWrap(110,$YPos,50,$FontSize,_('Date'),'centre'); - $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize,_('Debit'),'centre'); - $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize,_('Credit'),'centre'); - $LeftOvers = $pdf->addTextWrap(320,$YPos,150,$FontSize,_('Narrative'),'centre'); - $LeftOvers = $pdf->addTextWrap(470,$YPos,80,$FontSize,_('Tag'),'centre'); - - - $YPos =$YPos - (2*$line_height); - $FontSize=8; -} - -?> +<?php + +/* $Id: $*/ +/* $Revision: 1.00 $ */ + +$PageSecurity = 8; +include ('includes/session.inc'); + +if (isset($_POST['Period'])){ + $SelectedPeriod = $_POST['Period']; +} elseif (isset($_GET['Period'])){ + $SelectedPeriod = $_GET['Period']; +} + +if (isset($_POST['RunReport'])){ + + if (!isset($SelectedPeriod)){ + prnMsg(_('A period or range of periods must be selected from the list box'),'info'); + include('includes/footer.inc'); + exit; + } + if (!isset($_POST['Account'])){ + prnMsg(_('An account or range of accounts must be selected from the list box'),'info'); + include('includes/footer.inc'); + exit; + } + + include('includes/PDFStarter.php'); + +/*PDFStarter.php has all the variables for page size and width set up depending on the users default preferences for paper size */ + + $pdf->addInfo('Title',_('GL Account Report')); + $pdf->addInfo('Subject',_('GL Account Report')); + $line_height=12; + $PageNumber = 1; + $FontSize=10; + NewPageHeader(); + + foreach ($_POST['Account'] as $SelectedAccount){ + /*Is the account a balance sheet or a profit and loss account */ + $result = DB_query("SELECT chartmaster.accountname, + accountgroups.pandl + FROM accountgroups + INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ + WHERE chartmaster.accountcode=$SelectedAccount",$db); + $AccountDetailRow = DB_fetch_row($result); + $AccountName = $AccountDetailRow[0]; + if ($AccountDetailRow[1]==1){ + $PandLAccount = True; + }else{ + $PandLAccount = False; /*its a balance sheet account */ + } + + $FirstPeriodSelected = min($SelectedPeriod); + $LastPeriodSelected = max($SelectedPeriod); + + if ($_POST['tag']==0) { + $sql= "SELECT type, + typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans, systypes + WHERE gltrans.account = $SelectedAccount + AND systypes.typeid=gltrans.type + AND posted=1 + AND periodno>=$FirstPeriodSelected + AND periodno<=$LastPeriodSelected + ORDER BY periodno, gltrans.trandate, counterindex"; + + } else { + $sql= "SELECT gltrans.type, + gltrans.typename, + gltrans.typeno, + gltrans.trandate, + gltrans.narrative, + gltrans.amount, + gltrans.periodno, + gltrans.tag + FROM gltrans, systypes + WHERE gltrans.account = $SelectedAccount + AND systypes.typeid=gltrans.type + AND posted=1 + AND periodno>=$FirstPeriodSelected + AND periodno<=$LastPeriodSelected + AND tag='".$_POST['tag']."' + ORDER BY periodno, gltrans.trandate, counterindex"; + } + + $ErrMsg = _('The transactions for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved because') ; + $TransResult = DB_query($sql,$db,$ErrMsg); + + if ($YPos < ($Bottom_Margin + (5 * $line_height))){ //need 5 lines grace otherwise start new page + $PageNumber++; + NewPageHeader(); + } + + $YPos -=$line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,$SelectedAccount . ' - ' . $AccountName . ' ' . ': ' . _('Listing for Period'). ' ' . $FirstPeriodSelected . ' ' . _('to') . ' ' . $LastPeriodSelected); + + if ($PandLAccount==True) { + $RunningTotal = 0; + } else { + $sql = 'SELECT bfwd, + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode=' . $SelectedAccount . + ' AND chartdetails.period=' . $FirstPeriodSelected; + + $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); + $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); + $ChartDetailRow = DB_fetch_array($ChartDetailsResult); + + $RunningTotal =$ChartDetailRow['bfwd']; + $YPos -=$line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Brought Forward Balance')); + + if ($RunningTotal < 0 ){ //its a credit balance b/fwd + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$RunningTotal,2) , 'right'); + } else { //its a debit balance b/fwd + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($RunningTotal,2) , 'right'); + } + } + $PeriodTotal = 0; + $PeriodNo = -9999; + + $j = 1; + $k=0; //row colour counter + + while ($myrow=DB_fetch_array($TransResult)) { + + if ($myrow['periodno']!=$PeriodNo){ + if ($PeriodNo!=-9999){ //ie its not the first time around + /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ + $sql = 'SELECT bfwd, + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode=' . $SelectedAccount . + ' AND chartdetails.period=' . $PeriodNo; + + $ErrMsg = _('The chart details for account') . ' ' . $SelectedAccount . ' ' . _('could not be retrieved'); + $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); + $ChartDetailRow = DB_fetch_array($ChartDetailsResult); + $YPos -=$line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Period Total')); + if ($PeriodTotal < 0 ){ //its a credit balance b/fwd + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$PeriodTotal,2) , 'right'); + } else { //its a debit balance b/fwd + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($PeriodTotal,2) , 'right'); + } + } + $PeriodNo = $myrow['periodno']; + $PeriodTotal = 0; + } + + $RunningTotal += $myrow['amount']; + $PeriodTotal += $myrow['amount']; + + if($myrow['amount']>=0){ + $DebitAmount = number_format($myrow['amount'],2); + $CreditAmount = ''; + } elseif ($myrow['amount']<0){ + $CreditAmount = number_format(-$myrow['amount'],2); + $DebitAmount = ''; + } + + $FormatedTranDate = ConvertSQLDate($myrow['trandate']); + + $tagsql='SELECT tagdescription FROM tags WHERE tagref='.$myrow['tag']; + $tagresult=DB_query($tagsql,$db); + $tagrow = DB_fetch_array($tagresult); + + // to edit this block + $YPos -=$line_height; + $FontSize=8; + + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,30,$FontSize,$myrow['typename']); + $LeftOvers = $pdf->addTextWrap(80,$YPos,30,$FontSize,$myrow['typeno'],'right'); + $LeftOvers = $pdf->addTextWrap(110,$YPos,50,$FontSize,$FormatedTranDate); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize,$DebitAmount,'right'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize,$CreditAmount,'right'); + $LeftOvers = $pdf->addTextWrap(320,$YPos,150,$FontSize,$myrow['narrative']); + $LeftOvers = $pdf->addTextWrap(470,$YPos,80,$FontSize,$tagrow['tagdescription']); + + if ($YPos < ($Bottom_Margin + (5*$line_height))){ + $PageNumber++; + NewPageHeader(); + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize,$SelectedAccount . ' - ' . $AccountName); + } + + } + $YPos -=$line_height; + if ($PandLAccount==True){ + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,200,$FontSize, _('Total Period Movement')); + } else { /*its a balance sheet account*/ + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,150,$FontSize, _('Balance C/Fwd')); + } + if ($RunningTotal < 0){ + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize, number_format(-$RunningTotal,2) , 'right'); + } else { //its a debit balance b/fwd + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize, number_format($RunningTotal,2) , 'right'); + } + $YPos -=$line_height; + //draw a line under each account printed + $pdf->line($Left_Margin, $YPos,$Page_Width-$Right_Margin, $YPos); + $YPos -=$line_height; + } /*end for each SelectedAccount */ + /*Now check that there is some output and print the report out */ + if (count($_POST['Account'])==0) { + prnMsg(_('An account or range of accounts must be selected from the list box'),'info'); + include('includes/footer.inc'); + exit; + + } else { //print the report + + /* + $pdfcode = $pdf->output(); + $len = strlen($pdfcode); + + if ($len<=20){ + $title = _('Print GL Accounts Report Error'); + include('includes/header.inc'); + prnMsg (_('There were no accounts to print out'),'error'); + echo "<br><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a>'; + include('includes/footer.inc'); + exit; + } else { + header('Content-type: application/pdf'); + header('Content-Length: ' . $len); + header('Content-Disposition: inline; filename=GL_Accounts_' . date('Y-m-d') . '.pdf'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + + $pdf->Output('GL_Accounts_' . date('Y-m-d') . '.pdf', 'I'); + } + */ + $pdf->OutputD($_SESSION['DatabaseName'] . '_GL_Accounts_' . date('Y-m-d') . '.pdf'); + $pdf->__destruct(); + } //end if the report has some output +} /* end of if PrintReport button hit */ + else { + $title = _('General Ledger Account Report'); + include('includes/header.inc'); + include('includes/GLPostings.inc'); + + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger Account Inquiry') . '" alt="">' . ' ' . _('General Ledger Account Report') . '</p>'; + + echo '<div class="page_help_text">' . _('Use the keyboard Shift key to select multiple accounts and periods') . '</div><br>'; + + echo "<form method='POST' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + + /*Dates in SQL format for the last day of last month*/ + $DefaultPeriodDate = Date ('Y-m-d', Mktime(0,0,0,Date('m'),0,Date('Y'))); + + /*Show a form to allow input of criteria for the report */ + echo '<table> + <tr> + <td>'._('Selected Accounts') . ':</td> + <td><select name="Account[]" multiple>'; + $sql = 'SELECT accountcode, accountname FROM chartmaster ORDER BY accountcode'; + $AccountsResult = DB_query($sql,$db); + $i=0; + while ($myrow=DB_fetch_array($AccountsResult,$db)){ + if(isset($_POST['Account'][$i]) AND $myrow['accountcode'] == $_POST['Account'][$i]){ + echo '<option selected VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + $i++; + } else { + echo '<option VALUE=' . $myrow['accountcode'] . '>' . $myrow['accountcode'] . ' ' . $myrow['accountname']; + } + } + echo '</select></td>'; + + echo '<td>'._('For Period range').':</td> + <td><select Name=Period[] multiple>'; + $sql = 'SELECT periodno, lastdate_in_period FROM periods ORDER BY periodno DESC'; + $Periods = DB_query($sql,$db); + $id=0; + + while ($myrow=DB_fetch_array($Periods,$db)){ + if (isset($SelectedPeriod[$id]) and $myrow['periodno'] == $SelectedPeriod[$id]){ + echo '<option selected VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + $id++; + } else { + echo '<option VALUE=' . $myrow['periodno'] . '>' . _(MonthAndYearFromSQLDate($myrow['lastdate_in_period'])); + } + } + echo '</select></td></tr>'; + + //Select the tag + echo '<tr><td>' . _('Select 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 - '._('All tags'); + 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']; + } else { + echo '<option value=' . $myrow['tagref'] . '>' . $myrow['tagref'].' - ' .$myrow['tagdescription']; + } + } + echo '</select></td></tr>'; + // End select tag + + echo '</table><p> + <div class="centre"> + <input type=submit name="RunReport" VALUE="' ._('Run Report'). '"></div> + </form>'; + + include ('includes/footer.inc'); + exit; +} + + + +function NewPageHeader () { + global $PageNumber, + $pdf, + $YPos, + $Page_Height, + $Page_Width, + $Top_Margin, + $FontSize, + $Left_Margin, + $Right_Margin, + $line_height; + $SelectedAccount; + $AccountName; + + /*PDF page header for GL Account report */ + + if ($PageNumber > 1){ + $pdf->newPage(); + } + + $FontSize=10; + $YPos= $Page_Height-$Top_Margin; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,$_SESSION['CompanyRecord']['coyname']); + $YPos -=$line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,_('GL Account Report')); + $FontSize=8; + $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-120,$YPos,120,$FontSize,_('Printed') . ': ' . Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber); + + $YPos -=(2*$line_height); + + /*Draw a rectangle to put the headings in */ + + $pdf->line($Left_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos+$line_height); + $pdf->line($Left_Margin, $YPos+$line_height,$Left_Margin, $YPos- $line_height); + $pdf->line($Left_Margin, $YPos- $line_height,$Page_Width-$Right_Margin, $YPos- $line_height); + $pdf->line($Page_Width-$Right_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos- $line_height); + + /*set up the headings */ + $XPos = $Left_Margin+1; + + $LeftOvers = $pdf->addTextWrap($XPos,$YPos,30,$FontSize,_('Type'),'centre'); + $LeftOvers = $pdf->addTextWrap(80,$YPos,30,$FontSize,_('Reference'),'centre'); + $LeftOvers = $pdf->addTextWrap(110,$YPos,50,$FontSize,_('Date'),'centre'); + $LeftOvers = $pdf->addTextWrap(160,$YPos,50,$FontSize,_('Debit'),'centre'); + $LeftOvers = $pdf->addTextWrap(210,$YPos,50,$FontSize,_('Credit'),'centre'); + $LeftOvers = $pdf->addTextWrap(320,$YPos,150,$FontSize,_('Narrative'),'centre'); + $LeftOvers = $pdf->addTextWrap(470,$YPos,80,$FontSize,_('Tag'),'centre'); + + $YPos =$YPos - (2*$line_height); +} +?> \ No newline at end of file Modified: trunk/doc/Manual/ManualPettyCash.html =================================================================== --- trunk/doc/Manual/ManualPettyCash.html 2010-02-23 09:26:23 UTC (rev 3356) +++ trunk/doc/Manual/ManualPettyCash.html 2010-02-27 07:39:03 UTC (rev 3357) @@ -13,7 +13,7 @@ <br><br> Once any transacion in the petty cash system has been posted can not be modified, edited or deleted in any way. Once posted, that's it. <br><br> -<font size="+1"><b>Set up general parameters</b></font> +<font size="+1"><b>Setup General Parameters</b></font> <br><br><b>Set up expenses</b> <br><br>Definition of expenses allowed to be used in the Petty Cash system. This table is used to isolate non-accountant users (most of workers/users of webERP) from the technical details and names used in accounting. E.g.: Code Expense: FUEL-COMMERCIAL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-03-01 07:38:55
|
Revision: 3358 http://web-erp.svn.sourceforge.net/web-erp/?rev=3358&view=rev Author: tim_schofield Date: 2010-03-01 07:38:49 +0000 (Mon, 01 Mar 2010) Log Message: ----------- PcUathorizeExpenses.php - Remove blank line at the start of file, and correct for instance where $SelectedTabs is not set Modified Paths: -------------- trunk/PcAuthorizeExpenses.php trunk/doc/Change.log.html Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2010-02-27 07:39:03 UTC (rev 3357) +++ trunk/PcAuthorizeExpenses.php 2010-03-01 07:38:49 UTC (rev 3358) @@ -1,4 +1,3 @@ - <?php /* $Revision: 1.0 $ */ @@ -33,14 +32,16 @@ $Errors = array(); +if (isset($SelectedTabs)) { + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Petty Cash') . '" alt="">' . ' <a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Authorization Of Petty Cash Expenses ') . ''.$SelectedTabs.'<a/>'; +} else { + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Petty Cash') . '" alt="">' . ' <a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Authorization Of Petty Cash Expenses ') . '<a/>'; +} +if (isset($_POST['submit']) or isset($_POST['update']) OR isset($SelectedTabs) OR isset ($_POST['GO'])) { -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Petty Cash') . '" alt="">' . ' <a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Authorization Of Petty Cash Expenses ') . ''.$SelectedTabs.'<a/>'; - -if (isset($_POST['submit']) or isset($_POST['update']) OR isset($SelectedTabs) OR isset ($_POST['GO'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; echo "<div class='centre'><p>" . _('Detail Of Movement For Last ') .': '; - + if(!isset ($Days)){ $Days=30; } @@ -48,7 +49,7 @@ echo "<input type=text class=number name='Days' VALUE=" . $Days . " MAXLENGTH =3 size=4> Days "; echo '<input type=submit name="Go" value="' . _('Go') . '">'; echo '<p></div></form>'; - + $sql = "SELECT pcashdetails.counterindex, pcashdetails.tabcode, pcashdetails.date, @@ -69,9 +70,9 @@ AND pcashdetails.tabcode = '$SelectedTabs' AND pcashdetails.date >= DATE_SUB(CURDATE(), INTERVAL ".$Days." DAY) ORDER BY pcashdetails.date, pcashdetails.counterindex ASC"; - + $result = DB_query($sql,$db); - + echo '<br><table BORDER=1>'; echo "<tr> <th>" . _('Date') . "</th> @@ -85,12 +86,12 @@ $k=0; //row colour counter echo'<form action="PcAuthorizeExpenses.php" method="POST" name="'._('update').'">'; - + while ($myrow=DB_fetch_array($result)) { - - //update database if update pressed - if (($_POST['submit']=='Update') AND isset($_POST[$myrow['counterindex']])){ + //update database if update pressed + if (($_POST['submit']=='Update') AND isset($_POST[$myrow['counterindex']])){ + $PeriodNo = GetPeriod(ConvertSQLDate($myrow['date']), $db); if ($myrow['rate'] == 1){ // functional currency @@ -100,11 +101,11 @@ } if ($myrow['codeexpense'] == 'ASSIGNCASH'){ - $type = 2; + $type = 2; $AccountFrom = $myrow['glaccountassignment']; $AccountTo = $myrow['glaccountpcash']; }else{ - $type = 1; + $type = 1; $Amount = -$Amount; $AccountFrom = $myrow['glaccountpcash']; $SQLAccExp = "SELECT glaccount @@ -114,7 +115,7 @@ $myrowAccExp = DB_fetch_array($ResultAccExp); $AccountTo = $myrowAccExp['glaccount']; } - + //get typeno $typeno = GetNextTransNo($type,$db); @@ -122,19 +123,19 @@ $narrative= "PettyCash - ".$myrow['tabcode']." - ".$myrow['codeexpense']." - ".$myrow['notes']." - ".$myrow['receipt'].""; //insert to gltrans - $sqlFrom="INSERT INTO `gltrans` - (`counterindex`, - `type`, - `typeno`, - `chequeno`, - `trandate`, - `periodno`, - `account`, - `narrative`, - `amount`, - `posted`, - `jobref`, - `tag`) + $sqlFrom="INSERT INTO `gltrans` + (`counterindex`, + `type`, + `typeno`, + `chequeno`, + `trandate`, + `periodno`, + `account`, + `narrative`, + `amount`, + `posted`, + `jobref`, + `tag`) VALUES (NULL, '".$type."', '".$typeno."', @@ -147,22 +148,22 @@ 0, '', 0)"; - + $ResultFrom = DB_Query($sqlFrom, $db); - $sqlTo="INSERT INTO `gltrans` - (`counterindex`, - `type`, - `typeno`, - `chequeno`, - `trandate`, - `periodno`, - `account`, - `narrative`, - `amount`, - `posted`, - `jobref`, - `tag`) + $sqlTo="INSERT INTO `gltrans` + (`counterindex`, + `type`, + `typeno`, + `chequeno`, + `trandate`, + `periodno`, + `account`, + `narrative`, + `amount`, + `posted`, + `jobref`, + `tag`) VALUES (NULL, '".$type."', '".$typeno."', @@ -175,9 +176,9 @@ 0, '', 0)"; - + $ResultTo = DB_Query($sqlTo, $db); - + if ($myrow['codeexpense'] == 'ASSIGNCASH'){ // if it's a cash assignation we need to updated banktrans table as well. $ReceiptTransNo = GetNextTransNo( 2, $db); @@ -214,7 +215,7 @@ WHERE counterindex = '".$myrow['counterindex']."'"; $resultupdate = DB_query($sql,$db); } - + if ($k==1){ echo '<tr class="EvenTableRows">'; $k=0; @@ -229,7 +230,7 @@ <td>'.$myrow['posted'].'</td> <td>'.$myrow['notes'].'</td> <td>'.$myrow['receipt'].'</td>'; - + if (isset($_POST[$myrow['counterindex']])){ echo'<td>'.ConvertSQLDate(Date('Y-m-d')).'</td>'; }else{ @@ -245,13 +246,13 @@ echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; echo "<input type=hidden name='Days' VALUE=" .$Days. ">"; echo' </tr> '; - - + + } //end of looping - - // Do the postings - include ('includes/GLPostings.inc'); - + + // Do the postings + include ('includes/GLPostings.inc'); + echo'<tr><td style="text-align:right" colspan=4><input type=submit name=submit value=' . _("Update") . '></td></tr></form>'; } else { /*The option to submit was not hit so display form */ @@ -277,17 +278,17 @@ echo "<option VALUE='"; } echo $myrow['tabcode'] . "'>" . $myrow['tabcode']; - + } //end while loop get type of tab echo '</select></td></tr>'; - + echo '</table>'; // close table in first column echo '</td></tr></table>'; // close main table echo '<p><div class="centre"><input type=submit name=process VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; - - echo '</form>'; + + echo '</form>'; } /*end of else not submit */ include('includes/footer.inc'); ?> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-02-27 07:39:03 UTC (rev 3357) +++ trunk/doc/Change.log.html 2010-03-01 07:38:49 UTC (rev 3358) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>01/03/10 Tim: PcUathorizeExpenses.php - Remove blank line at the start of file, and correct for instance where $SelectedTabs is not set</p> <p>20/02/10 Lindsay: Bug fix and better description for API functions for SalesInvoiceEntry/Modify</p> <p>19/02/10 Lindsay: Bug fixing to make SalesOrder entry work for old and new API.</p> <p>18/02/10 Lindsay: API: date formatting in api_salesorders.php; added FormatDateWithTimeForSQL function to includes/DateFunctions.inc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-03-01 07:43:32
|
Revision: 3359 http://web-erp.svn.sourceforge.net/web-erp/?rev=3359&view=rev Author: tim_schofield Date: 2010-03-01 07:43:25 +0000 (Mon, 01 Mar 2010) Log Message: ----------- Harald: PcExpensesTypeTabv.php - Missing Gettext function Modified Paths: -------------- trunk/PcExpensesTypeTab.php trunk/doc/Change.log.html Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2010-03-01 07:38:49 UTC (rev 3358) +++ trunk/PcExpensesTypeTab.php 2010-03-01 07:43:25 UTC (rev 3359) @@ -38,7 +38,7 @@ $checkresult = DB_query($checkSql,$db); $checkrow = DB_fetch_row($checkresult); - + if ( $checkrow[0] >0) { $InputError = 1; prnMsg( _('The Expense ') . $_POST['codeexpense'] . _(' already exist in this Type of Tab.'),'error'); @@ -52,7 +52,7 @@ VALUES ('" . $_POST['SelectedTabs'] . "', '" . $_POST['SelectedExpense'] . "')"; - $msg = _('Expense code:') . ' ' . $_POST["SelectedExpense"].' for Type of Tab:' . $_POST["SelectedTabs"] . ' ' . _('has been created'); + $msg = _('Expense code:') . ' ' . $_POST["SelectedExpense"].' '._('for Type of Tab:') . $_POST["SelectedTabs"] . ' ' . _('has been created'); $checkSql = "SELECT count(typetabcode) FROM pctypetabs"; $result = DB_query($checkSql, $db); @@ -65,14 +65,14 @@ //run the SQL from either of the above possibilites $result = DB_query($sql,$db); prnMsg($msg,'success'); - + unset($_POST['SelectedExpense']); } } elseif ( isset($_GET['delete']) ) { - $sql="DELETE FROM pctabexpenses + $sql="DELETE FROM pctabexpenses WHERE typetabcode='$SelectedTabs' AND codeexpense='$SelectedType'"; $ErrMsg = _('The Tab Type record could not be deleted because'); @@ -81,7 +81,7 @@ unset ($SelectedType); unset($_GET['delete']); - + } if (!isset($SelectedTabs)){ @@ -109,31 +109,31 @@ echo "<option VALUE='"; } echo $myrow['typetabcode'] . "'>" . $myrow['typetabcode'] . ' - ' . $myrow['typetabdescription']; - - } //end while loop - + + } //end while loop + echo '</select></td></tr>'; - + echo '</table>'; // close table in first column echo '</td></tr></table>'; // close main table echo '<p><div class="centre"><input type=submit name=process VALUE="' . _('Accept') . '"><input type=submit name=Cancel VALUE="' . _('Cancel') . '"></div>'; - + echo '</form>'; } //end of ifs and buts! if (isset($_POST['process'])OR isset($SelectedTabs)) { - + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Expense Codes for Type of Tab ') . '' .$SelectedTabs. '<a/></div><p>'; - + $sql = "SELECT pctabexpenses.codeexpense, pcexpenses.description FROM pctabexpenses,pcexpenses WHERE pctabexpenses.codeexpense=pcexpenses.codeexpense AND pctabexpenses.typetabcode='$SelectedTabs' ORDER BY pctabexpenses.codeexpense ASC"; - + $result = DB_query($sql,$db); echo '<br><table BORDER=1>'; @@ -164,10 +164,10 @@ } //END WHILE LIST LOOP echo '</table>'; - - - - + + + + if (! isset($_GET['delete'])) { echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; @@ -191,14 +191,14 @@ echo "<option VALUE='"; } echo $myrow['codeexpense'] . "'>" . $myrow['codeexpense'] . ' - ' . $myrow['description']; - - } //end while loop - + + } //end while loop + echo '</select></td></tr>'; - - + + echo "<input type=hidden name='SelectedTabs' VALUE=" . $SelectedTabs . ">"; - + echo '</table>'; // close table in first column echo '</td></tr></table>'; // close main table @@ -207,8 +207,8 @@ echo '</form>'; } // end if user wish to delete - - + + } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-03-01 07:38:49 UTC (rev 3358) +++ trunk/doc/Change.log.html 2010-03-01 07:43:25 UTC (rev 3359) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> -<p>01/03/10 Tim: PcUathorizeExpenses.php - Remove blank line at the start of file, and correct for instance where $SelectedTabs is not set</p> +<p>01/03/10 Harald: PcExpensesTypeTabv.php - Missing Gettext function</p> +<p>01/03/10 Tim: PcAuthorizeExpenses.php - Remove blank line at the start of file, and correct for instance where $SelectedTabs is not set</p> <p>20/02/10 Lindsay: Bug fix and better description for API functions for SalesInvoiceEntry/Modify</p> <p>19/02/10 Lindsay: Bug fixing to make SalesOrder entry work for old and new API.</p> <p>18/02/10 Lindsay: API: date formatting in api_salesorders.php; added FormatDateWithTimeForSQL function to includes/DateFunctions.inc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-03-01 07:45:49
|
Revision: 3360 http://web-erp.svn.sourceforge.net/web-erp/?rev=3360&view=rev Author: tim_schofield Date: 2010-03-01 07:45:42 +0000 (Mon, 01 Mar 2010) Log Message: ----------- Harald: PcExpensesTypeTabv.php - Missing space, and bad end tag Modified Paths: -------------- trunk/PcExpensesTypeTab.php trunk/doc/Change.log.html Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2010-03-01 07:43:25 UTC (rev 3359) +++ trunk/PcExpensesTypeTab.php 2010-03-01 07:45:42 UTC (rev 3360) @@ -126,7 +126,7 @@ //end of ifs and buts! if (isset($_POST['process'])OR isset($SelectedTabs)) { - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Expense Codes for Type of Tab ') . '' .$SelectedTabs. '<a/></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Expense Codes for Type of Tab ') . ' ' .$SelectedTabs. '</a></div><p>'; $sql = "SELECT pctabexpenses.codeexpense, pcexpenses.description FROM pctabexpenses,pcexpenses Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-03-01 07:43:25 UTC (rev 3359) +++ trunk/doc/Change.log.html 2010-03-01 07:45:42 UTC (rev 3360) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>01/03/10 Harald: PcExpensesTypeTabv.php - Missing space, and bad end tag</p> <p>01/03/10 Harald: PcExpensesTypeTabv.php - Missing Gettext function</p> <p>01/03/10 Tim: PcAuthorizeExpenses.php - Remove blank line at the start of file, and correct for instance where $SelectedTabs is not set</p> <p>20/02/10 Lindsay: Bug fix and better description for API functions for SalesInvoiceEntry/Modify</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-03-01 07:51:35
|
Revision: 3361 http://web-erp.svn.sourceforge.net/web-erp/?rev=3361&view=rev Author: tim_schofield Date: 2010-03-01 07:51:29 +0000 (Mon, 01 Mar 2010) Log Message: ----------- Harald: PcExpensesTypeTabv.php - Missing space Modified Paths: -------------- trunk/PcExpensesTypeTab.php trunk/doc/Change.log.html Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2010-03-01 07:45:42 UTC (rev 3360) +++ trunk/PcExpensesTypeTab.php 2010-03-01 07:51:29 UTC (rev 3361) @@ -52,7 +52,7 @@ VALUES ('" . $_POST['SelectedTabs'] . "', '" . $_POST['SelectedExpense'] . "')"; - $msg = _('Expense code:') . ' ' . $_POST["SelectedExpense"].' '._('for Type of Tab:') . $_POST["SelectedTabs"] . ' ' . _('has been created'); + $msg = _('Expense code:') . ' ' . $_POST["SelectedExpense"].' '._('for Type of Tab:') .' '. $_POST["SelectedTabs"] . ' ' . _('has been created'); $checkSql = "SELECT count(typetabcode) FROM pctypetabs"; $result = DB_query($checkSql, $db); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-03-01 07:45:42 UTC (rev 3360) +++ trunk/doc/Change.log.html 2010-03-01 07:51:29 UTC (rev 3361) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>01/03/10 Harald: PcExpensesTypeTabv.php - Missing space</p> <p>01/03/10 Harald: PcExpensesTypeTabv.php - Missing space, and bad end tag</p> <p>01/03/10 Harald: PcExpensesTypeTabv.php - Missing Gettext function</p> <p>01/03/10 Tim: PcAuthorizeExpenses.php - Remove blank line at the start of file, and correct for instance where $SelectedTabs is not set</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-03-01 07:57:09
|
Revision: 3362 http://web-erp.svn.sourceforge.net/web-erp/?rev=3362&view=rev Author: tim_schofield Date: 2010-03-01 07:57:03 +0000 (Mon, 01 Mar 2010) Log Message: ----------- Harald: PcExpensesTypeTabv.php - Correct message on deletion of tab Modified Paths: -------------- trunk/PcExpensesTypeTab.php trunk/doc/Change.log.html Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2010-03-01 07:51:29 UTC (rev 3361) +++ trunk/PcExpensesTypeTab.php 2010-03-01 07:57:03 UTC (rev 3362) @@ -77,7 +77,7 @@ AND codeexpense='$SelectedType'"; $ErrMsg = _('The Tab Type record could not be deleted because'); $result = DB_query($sql,$db,$ErrMsg); - prnMsg(_('Expense code').' '. $SelectedTabs . _('for type of tab').' '. $SelectedType .' '. _('has been deleted') ,'success'); + prnMsg(_('Expense code').' '. $SelectedType .' '. _('for type of tab').' '. $SelectedTabs .' '. _('has been deleted') ,'success'); unset ($SelectedType); unset($_GET['delete']); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-03-01 07:51:29 UTC (rev 3361) +++ trunk/doc/Change.log.html 2010-03-01 07:57:03 UTC (rev 3362) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>01/03/10 Harald: PcExpensesTypeTabv.php - Correct message on deletion of tab</p> <p>01/03/10 Harald: PcExpensesTypeTabv.php - Missing space</p> <p>01/03/10 Harald: PcExpensesTypeTabv.php - Missing space, and bad end tag</p> <p>01/03/10 Harald: PcExpensesTypeTabv.php - Missing Gettext function</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-03-01 08:28:36
|
Revision: 3363 http://web-erp.svn.sourceforge.net/web-erp/?rev=3363&view=rev Author: tim_schofield Date: 2010-03-01 08:28:30 +0000 (Mon, 01 Mar 2010) Log Message: ----------- Pak Ricard: PDFPriceList.php - Updated price list report Modified Paths: -------------- trunk/PDFPriceList.php trunk/doc/Change.log.html Modified: trunk/PDFPriceList.php =================================================================== --- trunk/PDFPriceList.php 2010-03-01 07:57:03 UTC (rev 3362) +++ trunk/PDFPriceList.php 2010-03-01 08:28:30 UTC (rev 3363) @@ -1,21 +1,22 @@ <?php +/* $Revision: 1.14 $ */ -/* $Id$*/ -/* $Revision: 1.15 $ */ - $PageSecurity = 2; include('includes/session.inc'); -if (isset($_POST['PrintPDF']) - and isset($_POST['FromCriteria']) - and strlen($_POST['FromCriteria'])>=1 - and isset($_POST['ToCriteria']) - and strlen($_POST['ToCriteria'])>=1){ +If (isset($_POST['PrintPDF']) + AND isset($_POST['FromCriteria']) + AND strlen($_POST['FromCriteria'])>=1 + AND isset($_POST['ToCriteria']) + AND strlen($_POST['ToCriteria'])>=1){ include('includes/PDFStarter.php'); - $pdf->addInfo('Title', _('Price Listing Report') ); - $pdf->addInfo('Subject', _('Price List') ); + $FontSize=10; + $pdf->addinfo('Title', _('Price Listing Report') ); + $pdf->addinfo('Subject', _('Price List') ); + + $PageNumber=1; $line_height=12; @@ -43,6 +44,7 @@ $SQL = "SELECT prices.typeabbrev, prices.stockid, stockmaster.description, + stockmaster.longdescription, prices.currabrev, prices.price, stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS standardcost, @@ -77,6 +79,7 @@ $SQL = "SELECT prices.typeabbrev, prices.stockid, stockmaster.description, + stockmaster.longdescription, prices.currabrev, prices.price, stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost as standardcost, @@ -97,8 +100,6 @@ } $PricesResult = DB_query($SQL,$db,'','',false,false); - $ListSize = count ($PricesResult); //Javier - if (DB_error_no($db) !=0) { $title = _('Price List') . ' - ' . _('Problem Report....'); include('includes/header.inc'); @@ -115,20 +116,22 @@ $CurrCode =''; $Category = ''; $CatTot_Val=0; - while ($PriceList = DB_fetch_array($PricesResult,$db)){ + $Pos=$Page_Height-$Top_Margin-$YPos+20; + While ($PriceList = DB_fetch_array($PricesResult,$db)){ + if ($CurrCode != $PriceList['currabrev']){ $FontSize=10; - $YPos -=(2*$line_height); + $YPos -= $line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,300-$Left_Margin,$FontSize, $PriceList['currabrev'] . ' ' . _('Prices')); $CurrCode = $PriceList['currabrev']; $FontSize = 8; $YPos -= $line_height; } - if ($Category!= $PriceList['categoryid']){ + if ($Category!=$PriceList['categoryid']){ $FontSize=10; - $YPos -=(2*$line_height); + $YPos -= $line_height; $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,300-$Left_Margin,$FontSize,$PriceList['categoryid'] . ' - ' . $PriceList['categorydescription']); $Category = $PriceList['categoryid']; $CategoryName = $PriceList['categorydescription']; @@ -137,10 +140,20 @@ } $YPos -=$line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,$PriceList['stockid']); + $LeftOvers = $pdf->addTextWrap(190,$YPos,260,$FontSize,$PriceList['description']); + $DisplayUnitPrice = number_format($PriceList['price'],2); + $LeftOvers = $pdf->addTextWrap(440,$YPos,60,$FontSize,$DisplayUnitPrice, 'right'); + if ($PriceList['price']!=0){ + $DisplayGPPercent = (int)(($PriceList['price']-$PriceList['standardcost'])*100/$PriceList['price']) . '%'; + } else { + $DisplayGPPercent = 0; + } - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,60,$FontSize,$PriceList['stockid']); - $LeftOvers = $pdf->addTextWrap(120,$YPos,260,$FontSize,$PriceList['description']); + if ($_POST['ShowGPPercentages']=='Yes'){ + $LeftOvers = $pdf->addTextWrap(530,$YPos,20,$FontSize,$DisplayGPPercent, 'right'); + } if ($_POST['CustomerSpecials']=='Customer Special Prices Only'){ /*Need to show to which branch the price relates */ @@ -150,60 +163,73 @@ $LeftOvers = $pdf->addTextWrap(320,$YPos,130,$FontSize,_('All'),'left'); } - } + }else If ($_POST['CustomerSpecials']=='Full Description'){ - $DisplayUnitPrice = number_format($PriceList['price'],2); + if(file_exists($_SESSION['part_pics_dir'] . '/' .$PriceList['stockid'].'.jpg') ) { + $img = imagecreatefromjpeg($_SESSION['part_pics_dir'] . '/' .$PriceList['stockid'].'.jpg'); + $width = imagesx( $img ); + $height = imagesy( $img ); + if($width>$height){ + $LeftOvers = $pdf->Image($_SESSION['part_pics_dir'] . '/'.$PriceList['stockid'].'.jpg',120,$Page_Height-$Top_Margin-$YPos+20,50,0); + }else{ + $LeftOvers = $pdf->Image($_SESSION['part_pics_dir'] . '/'.$PriceList['stockid'].'.jpg',120,$Page_Height-$Top_Margin-$YPos+20,0,40); + } + }/*end checked file exist*/ - if ($PriceList['price']!=0){ - $DisplayGPPercent = (int)(($PriceList['price']-$PriceList['standardcost'])*100/$PriceList['price']) . '%'; - } else { - $DisplayGPPercent = 0; - } + $Split = explode("\r\n", $PriceList['longdescription']); + $FontSize2=6; + for ($i=0; $i<=count($Split); $i++) + { + if(count($Split)==1){ + $YPos -=(1*$line_height); + $LeftOvers = $pdf->addTextWrap(190,$YPos,260,$FontSize2,$Split[$i]); + $YPos -=(1*$line_height); + $LeftOvers = $pdf->addTextWrap(190,$YPos,260,$FontSize2,''); + }elseif(count($Split)==2){ + $YPos -=(1*$line_height); + $LeftOvers = $pdf->addTextWrap(190,$YPos,260,$FontSize2,$Split[$i]); + }elseif(count($Split)>=3){ + $YPos -=(1*$line_height); + $LeftOvers = $pdf->addTextWrap(190,$YPos,260,$FontSize2,$Split[$i]); + } - $LeftOvers = $pdf->addTextWrap(440,$YPos,60,$FontSize,$DisplayUnitPrice, 'right'); - if ($_POST['ShowGPPercentages']=='Yes'){ - $LeftOvers = $pdf->addTextWrap(530,$YPos,20,$FontSize,$DisplayGPPercent, 'right'); - } + }/*end for*/ + }/*end if*/ + + + if ($YPos < $Bottom_Margin + $line_height){ include('includes/PDFPriceListPageHeader.inc'); + } } /*end inventory valn while loop */ + $FontSize =10; /*Print out the category totals */ -// Javier: this was actually the Price List that was PDF-Created but it seems it was intended to be only the check that I named ListSize. -/* $FontSize =10; - $FileName= $_SESSION['DatabaseName'] . '_' .'PriceList_' . date('Y-m-d').'.pdf'; -// $pdfcode = $pdf->output(); - $pdfcode = $pdf->OutputD($Filename); - $len = strlen($pdfcode); */ -// if ($len<=20){ - if ($ListSize == 0) { + $pdfcode = $pdf->output(); + $len = strlen($pdfcode); + + if ($len<=20){ $title = _('Print Price List Error'); include('includes/header.inc'); prnMsg(_('There were no price details to print out for the customer or category specified'),'warn'); echo '<br><a href="'.$rootpath.'/index.php?' . SID . '">'. _('Back to the menu').'</a>'; include('includes/footer.inc'); exit; - } else { - -// Javier: TCPDF sends its own http header, it's an error to send it twice. - /* header('Content-type: application/pdf'); + } else { + header('Content-type: application/pdf'); header('Content-Length: ' . $len); header('Content-Disposition: inline; filename=PriceList.pdf'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); */ -// $FontSize =10; - $FileName= $_SESSION['DatabaseName'] . '_' .'PriceList_' . date('Y-m-d').'.pdf'; -// $pdf->Output($FileName,'I'); -// Javier: This is a recursive script, so it needs to be downloaded. - $pdf->OutputD($FileName); - $pdf-> __destruct(); + header('Pragma: public'); + $FileName=$_SESSION['DatabaseName'].'_'.date('Y-m-d').'.pdf'; + $pdf->Output($FileName,'I'); } } else { /*The option to print PDF was not hit */ @@ -220,7 +246,7 @@ $sql='SELECT categoryid, categorydescription FROM stockcategory ORDER BY categoryid'; $CatResult= DB_query($sql,$db); - while ($myrow = DB_fetch_array($CatResult)){ + While ($myrow = DB_fetch_array($CatResult)){ echo "<option VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categoryid'] . ' - ' . $myrow['categorydescription']; } echo '</select></td></tr>'; @@ -230,7 +256,7 @@ /*Set the index for the categories result set back to 0 */ DB_data_seek($CatResult,0); - while ($myrow = DB_fetch_array($CatResult)){ + While ($myrow = DB_fetch_array($CatResult)){ echo '<option VALUE="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' . $myrow['categorydescription']; } echo '</select></td></tr>'; @@ -250,14 +276,14 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Price Listing Type'). ':</td><td><select name="CustomerSpecials">'; - echo '<option Value="Customer Special Prices Only">'. _('Customer Special Prices Only'); echo '<option selected Value="Sales Type Prices">'. _('Default Sales Type Prices'); + echo '<option Value="Customer Special Prices Only">'. _('Customer Special Prices Only'); + echo '<option Value="Full Description">'. _('Full Description'); echo '</select></td></tr>'; - /*echo '</table><div class="centre"><input type=Submit Name="PrintPDF" Value="'. _('Print PDF'). '"></div>';*/ - echo '</table><div class="centre"><input type=Submit Name="PrintPDF" Value="'. _('Print PDF'). '"></div></form>'; + echo '</table><div class="centre"><input type=Submit Name="PrintPDF" Value="'. _('Print PDF'). '"></div>'; } include('includes/footer.inc'); } /*end of else not PrintPDF */ -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-03-01 07:57:03 UTC (rev 3362) +++ trunk/doc/Change.log.html 2010-03-01 08:28:30 UTC (rev 3363) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p></p> +<p>01/03/10 Pak Ricard: PDFPriceList.php - Updated price list report</p> <p>01/03/10 Harald: PcExpensesTypeTabv.php - Correct message on deletion of tab</p> <p>01/03/10 Harald: PcExpensesTypeTabv.php - Missing space</p> <p>01/03/10 Harald: PcExpensesTypeTabv.php - Missing space, and bad end tag</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |