From: <dai...@us...> - 2009-12-18 20:46:41
|
Revision: 3254 http://web-erp.svn.sourceforge.net/web-erp/?rev=3254&view=rev Author: daintree Date: 2009-12-18 20:46:33 +0000 (Fri, 18 Dec 2009) Log Message: ----------- change charset to hard coded utf-8 in 7 scripts no gettext change of character set is possible anymore Modified Paths: -------------- trunk/EmailConfirmation.php trunk/Logout.php trunk/config.distrib.php trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc trunk/includes/Login.php trunk/includes/class.pdf.php trunk/includes/header.inc trunk/install/save.php Modified: trunk/EmailConfirmation.php =================================================================== --- trunk/EmailConfirmation.php 2009-12-18 11:11:41 UTC (rev 3253) +++ trunk/EmailConfirmation.php 2009-12-18 20:46:33 UTC (rev 3254) @@ -21,7 +21,7 @@ $MailTo = $_GET['EMail']; $headers = 'From: Bethany Manufacturing <sa...@be...>' . '\n'; -$headers .= 'MIME-Version: 1.0\n' . 'Content-Type: text/html; charset="' . _('ISO-8859-1') . '"\n'; +$headers .= 'MIME-Version: 1.0\n' . 'Content-Type: text/html; charset="utf-8"\n'; /*retrieve the order details from the database to print */ $ErrMsg = _('There was a problem retrieving the order header details for Order Number') . ' ' . $_GET['TransNo'] . ' ' . _('from the database'); Modified: trunk/Logout.php =================================================================== --- trunk/Logout.php 2009-12-18 11:11:41 UTC (rev 3253) +++ trunk/Logout.php 2009-12-18 20:46:33 UTC (rev 3254) @@ -9,7 +9,7 @@ <html> <head> <title><?php echo $_SESSION['CompanyRecord']['coyname'];?> - <?php echo _('Log Off'); ?></title> - <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _('ISO-8859-1'); ?>" /> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="css/<?php echo $theme;?>/login.css" type="text/css" /> </head> Modified: trunk/config.distrib.php =================================================================== --- trunk/config.distrib.php 2009-12-18 11:11:41 UTC (rev 3253) +++ trunk/config.distrib.php 2009-12-18 20:46:33 UTC (rev 3254) @@ -6,7 +6,7 @@ //--------------------------------------------------- //DefaultLanguage to use for the login screen and the setup of new users - the users language selection will override -$DefaultLanguage ='en_GB'; +$DefaultLanguage ='en_GB.utf8'; // Whether to display the demo login and password or not on the login screen $allow_demo_mode = True; Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2009-12-18 11:11:41 UTC (rev 3253) +++ trunk/includes/ConnectDB_mysql.inc 2009-12-18 20:46:33 UTC (rev 3254) @@ -136,7 +136,7 @@ } function DB_escape_string($String){ - return mysql_real_escape_string(htmlspecialchars($String, ENT_COMPAT, _('ISO-8859-1'))); + return mysql_real_escape_string(htmlspecialchars($String, ENT_COMPAT, 'utf-8')); } function DB_show_tables(&$Conn){ Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2009-12-18 11:11:41 UTC (rev 3253) +++ trunk/includes/ConnectDB_mysqli.inc 2009-12-18 20:46:33 UTC (rev 3254) @@ -159,7 +159,7 @@ function DB_escape_string($String){ global $db; - return mysqli_real_escape_string($db, htmlspecialchars($String, ENT_COMPAT, _('ISO-8859-1'))); + return mysqli_real_escape_string($db, htmlspecialchars($String, ENT_COMPAT,'utf-8')); } function DB_show_tables(&$Conn){ Modified: trunk/includes/Login.php =================================================================== --- trunk/includes/Login.php 2009-12-18 11:11:41 UTC (rev 3253) +++ trunk/includes/Login.php 2009-12-18 20:46:33 UTC (rev 3254) @@ -13,7 +13,7 @@ <html> <head> <title>webERP Login screen</title> - <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _('ISO-8859-1'); ?>" /> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <link rel="stylesheet" href="css/<?php echo $theme;?>/login.css" type="text/css" /> </head> Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2009-12-18 11:11:41 UTC (rev 3253) +++ trunk/includes/class.pdf.php 2009-12-18 20:46:33 UTC (rev 3254) @@ -23,7 +23,7 @@ public function __construct($DocOrientation='P', $DocUnits='mm', $DocPaper='A4') { - parent::__construct($DocOrientation, $DocUnits, $DocPaper, true, _('ISO-8859-1'), false); + parent::__construct($DocOrientation, $DocUnits, $DocPaper, true, 'utf-8', false); $this->setuserpdffont(); } Modified: trunk/includes/header.inc =================================================================== --- trunk/includes/header.inc 2009-12-18 11:11:41 UTC (rev 3253) +++ trunk/includes/header.inc 2009-12-18 20:46:33 UTC (rev 3254) @@ -7,7 +7,7 @@ // $title - should be defined in the page this file is included with if (!headers_sent()){ - header('Content-type: text/html; charset=' . _('ISO-8859-1')); + header('Content-type: text/html; charset=utf-8'); } echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; @@ -16,7 +16,7 @@ echo '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>' . $title . '</title>'; echo '<link rel="shortcut icon" href="'. $rootpath.'/favicon.ico" />'; echo '<link rel="icon" href="' . $rootpath.'/favicon.ico" />'; - echo '<meta http-equiv="Content-Type" content="text/html; charset=' . _('ISO-8859-1') . '" />'; + echo '<meta http-equiv="Content-Type" content="text/html; charset="utf-8" />'; echo '<link href="'.$rootpath. '/css/'. $_SESSION['Theme'] .'/default.css" rel="stylesheet" type="text/css" />'; echo '<script type="text/javascript" src = "'.$rootpath.'/javascripts/MiscFunctions.js"></script>'; echo '</head>'; Modified: trunk/install/save.php =================================================================== --- trunk/install/save.php 2009-12-18 11:11:41 UTC (rev 3253) +++ trunk/install/save.php 2009-12-18 20:46:33 UTC (rev 3254) @@ -239,9 +239,9 @@ $msg .= "// User configurable variables\n"; $msg .= "//---------------------------------------------------\n\n"; $msg .= "//DefaultLanguage to use for the login screen and the setup of new users - the users language selection will override\n"; -$msg .= "\$DefaultLanguage ='en_GB';\n\n"; +$msg .= "\$DefaultLanguage ='en_GB.utf8';\n\n"; $msg .= "// Whether to display the demo login and password or not on the login screen\n"; -$msg .= "\$allow_demo_mode = True;\n\n"; +$msg .= "\$allow_demo_mode = False;\n\n"; $msg .= "// webERP version\n\n"; $msg .= $VersionString . "\n\n"; $msg .= "// Connection information for the database\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-12-19 10:35:22
|
Revision: 3255 http://web-erp.svn.sourceforge.net/web-erp/?rev=3255&view=rev Author: tim_schofield Date: 2009-12-19 10:35:12 +0000 (Sat, 19 Dec 2009) Log Message: ----------- Improvements to the top sales items report. Modified Paths: -------------- trunk/TopItems.php trunk/doc/Change.log.html Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2009-12-18 20:46:33 UTC (rev 3254) +++ trunk/TopItems.php 2009-12-19 10:35:12 UTC (rev 3255) @@ -1,86 +1,67 @@ <?php - -/* $Id$*/ - +/* $Revision: 1.3 $ */ $PageSecurity = 2; - /* Session started in session.inc for password checking and authorisation level check config.php is in turn included in session.inc*/ - -include('includes/session.inc'); +include ('includes/session.inc'); $title = _('Top Items Searching'); -include('includes/header.inc'); -//check if input already -if(!($_POST['Location'] and $_POST['NumberOfDays'] and $_POST['Customers'] and $_POST['NumberOfTopItems'] and $_POST['order'])){ - - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . - _('Top Sales Order Search') . '" alt="">' . ' ' . _('Top Sales Order Search') . '</p>'; - +include ('includes/header.inc'); +//check if input already +if (!(isset($_POST['Location']) and isset($_POST['NumberOfDays']) and isset($_POST['Customers']) and isset($_POST['NumberOfTopItems']) and isset($_POST['order']))) { + echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Top Sales Order Search') . '" alt="">' . ' ' . _('Top Sales Order Search') . '</p>'; echo "<form action=" . $_SERVER['PHP_SELF'] . '?' . SID . ' name="SelectCustomer" method=POST>'; - echo '<table cellpadding=3 colspan=4>'; - //to view store location echo '<tr><td width="150">' . _('Select Location') . ' </td><td>:</td><td><select name=Location>'; - - $sql='SELECT loccode,locationname + $sql = 'SELECT loccode, + locationname FROM `locations`'; - - $result= DB_query($sql,$db); - echo"<option value='All'>" ._('All'); - While ($myrow = DB_fetch_array($result)){ - echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['loccode'] . " - " . $myrow['locationname']; - } - echo "</select></td></tr>"; - - //to view list of customer - + $result = DB_query($sql, $db); + echo "<option value='All'>" . _('All'); + while ($myrow = DB_fetch_array($result)) { + echo "<option VALUE='" . $myrow['loccode'] . "'>" . $myrow['loccode'] . " - " . $myrow['locationname']; + } + echo "</select></td></tr>"; + //to view list of customer echo '<tr><td width="150">' . _('Select Customer Type') . ' </td><td>:</td><td><select name=Customers>'; - - $sql='SELECT typename,typeid - FROM `debtortype`'; - - $result= DB_query($sql,$db); - - echo"<option value='All'>" ._('All'); - While ($myrow = DB_fetch_array($result)){ - echo "<option VALUE='" . $myrow['typeid'] . "'>" . $myrow['typename'] ; - } - echo "</select></td> + $sql = 'SELECT typename, + typeid + FROM debtortype'; + $result = DB_query($sql, $db); + echo "<option value='All'>" . _('All'); + while ($myrow = DB_fetch_array($result)) { + echo "<option VALUE='" . $myrow['typeid'] . "'>" . $myrow['typename']; + } + echo "</select></td> </tr>"; - //view order by list to display - echo '<tr> <td width="150">' . _('Select Order By ') . ' </td> + echo '<tr> <td width="150">' . _('Select Order By ') . ' </td> <td>:</td> <td><select name=order>'; - echo' <option value=TotalInvoiced>' . _('Total Pieces') . ''; - echo' <option value=ValueSales>' . _('Value of Sales') . ''; - echo ' </select></td> + echo ' <option value=TotalInvoiced>' . _('Total Pieces') . ''; + echo ' <option value=ValueSales>' . _('Value of Sales') . ''; + echo ' </select></td> </tr>'; - //View number of days - echo'<tr><td>' ._('Number Of Days').' </td><td>:</td> + echo '<tr><td>' . _('Number Of Days') . ' </td><td>:</td> <td><input class="number" tabindex="3" type="Text" name=NumberOfDays size="8" maxlength="8"></td> </tr>'; //view number of NumberOfTopItems items - echo'<tr> + echo '<tr> <td>' . _('Number Of Top Items') . ' </td><td>:</td> <td><input class="number" tabindex="4" type="Text" name=NumberOfTopItems size="8" maxlength="8"></td> </tr> <tr> <td></td> <td></td> - <td><input tabindex=5 type=submit Value="'. _('Search'). '"></td> + <td><input tabindex=5 type=submit Value="' . _('Search') . '"></td> </tr> </form>'; -} -else{ - -// everything below here to view NumberOfTopItems items sale on selected location - -//the situation if the location and customer type selected "All" - if(($_POST['Location']=="All")and($_POST['Customers']=="All")){ - $SQL=" +} else { + // everything below here to view NumberOfTopItems items sale on selected location + //the situation if the location and customer type selected "All" + if (($_POST['Location'] == "All") and ($_POST['Customers'] == "All")) { + $SQL = " SELECT salesorderdetails.stkcode, SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, @@ -90,14 +71,13 @@ WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorderdetails.ActualDispatchDate >= DATE_SUB(CURDATE(), INTERVAL ".$_POST[NumberOfDays]." DAY) + AND salesorderdetails.ActualDispatchDate >= DATE_SUB(CURDATE(), INTERVAL " . $_POST['NumberOfDays'] . " DAY) GROUP BY salesorderdetails.stkcode - ORDER BY ".$_POST["order"]." DESC - LIMIT 0,".$_POST[NumberOfTopItems].""; - } - else{ //the situation if only location type selected "All" - if($_POST['Location']=="All"){ - $SQL=" + ORDER BY " . $_POST["order"] . " DESC + LIMIT 0," . $_POST['NumberOfTopItems'] . ""; + } else { //the situation if only location type selected "All" + if ($_POST['Location'] == "All") { + $SQL = " SELECT salesorderdetails.stkcode, SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, @@ -107,16 +87,15 @@ WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.typeid = '" . $_POST["Customers"]."' - AND salesorderdetails.ActualDispatchDate >= DATE_SUB(CURDATE(), INTERVAL ".$_POST[NumberOfDays]." DAY) + AND debtorsmaster.typeid = '" . $_POST["Customers"] . "' + AND salesorderdetails.ActualDispatchDate >= DATE_SUB(CURDATE(), INTERVAL " . $_POST['NumberOfDays'] . " DAY) GROUP BY salesorderdetails.stkcode - ORDER BY ".$_POST["order"]." DESC - LIMIT 0,".$_POST[NumberOfTopItems].""; - } - else { + ORDER BY " . $_POST["order"] . " DESC + LIMIT 0," . $_POST[NumberOfTopItems] . ""; + } else { //the situation if the customer type selected "All" - if($_POST['Customers']=="All"){ - $SQL=" + if ($_POST['Customers'] == "All") { + $SQL = " SELECT salesorderdetails.stkcode, SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, @@ -126,16 +105,14 @@ WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.fromstkloc = '" . $_POST["Location"]."' - AND salesorderdetails.ActualDispatchDate >= DATE_SUB(CURDATE(), INTERVAL ".$_POST[NumberOfDays]." DAY) + AND salesorders.fromstkloc = '" . $_POST["Location"] . "' + AND salesorderdetails.ActualDispatchDate >= DATE_SUB(CURDATE(), INTERVAL " . $_POST['NumberOfDays'] . " DAY) GROUP BY salesorderdetails.stkcode - ORDER BY ".$_POST["order"]." DESC - LIMIT 0,".$_POST[NumberOfTopItems].""; - - } - else{ - //the situation if the location and customer type not selected "All" - $SQL=" + ORDER BY " . $_POST["order"] . " DESC + LIMIT 0," . $_POST[NumberOfTopItems] . ""; + } else { + //the situation if the location and customer type not selected "All" + $SQL = " SELECT salesorderdetails.stkcode, SUM(salesorderdetails.qtyinvoiced) TotalInvoiced, SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS ValueSales, @@ -145,85 +122,70 @@ WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.fromstkloc = '".$_POST["Location"]."' - AND debtorsmaster.typeid = '".$_POST['Customers']."' - AND salesorderdetails.ActualDispatchDate >= DATE_SUB(CURDATE(), INTERVAL ".$_POST[NumberOfDays]." DAY) + AND salesorders.fromstkloc = '" . $_POST["Location"] . "' + AND debtorsmaster.typeid = '" . $_POST['Customers'] . "' + AND salesorderdetails.ActualDispatchDate >= DATE_SUB(CURDATE(), INTERVAL " . $_POST['NumberOfDays'] . " DAY) GROUP BY salesorderdetails.stkcode - ORDER BY ".$_POST["order"]." DESC - LIMIT 0,".$_POST[NumberOfTopItems].""; - - } - } + ORDER BY " . $_POST["order"] . " DESC + LIMIT 0," . $_POST[NumberOfTopItems] . ""; + } } - - $result = DB_query($SQL,$db); - echo '<p class="page_title_text" align="center"><strong>' . _('Top Sales Items List') . '</strong></p>'; - echo "<form action=PDFTopItems.php method='GET'> <table class='table1'>"; - $TableHeader = '<tr><th><strong>' . _('Code') . '</strong></th> + } + $result = DB_query($SQL, $db); + echo '<p class="page_title_text" align="center"><strong>' . _('Top Sales Items List') . '</strong></p>'; + echo "<form action=PDFTopItems.php method='GET'> <table class='table1'>"; + $TableHeader = '<tr><th><strong>' . _('#') . '</strong></th> + <th><strong>' . _('Code') . '</strong></th> <th><strong>' . _('Description') . '</strong></th> <th><strong>' . _('Total Invoiced') . '</strong></th> <th><strong>' . _('Units') . '</strong></th> <th><strong>' . _('Value Sales') . '</strong></th> <th><strong>' . _('On Hand') . '</strong></th>'; - echo $TableHeader; - echo' - <input type="hidden" value='.$_POST["Location"].' name=location /> - <input type="hidden" value='.$_POST["order"].' name=order /> - <input type="hidden" value='.$_POST["NumberOfDays"].' name=numberofdays /> - <input type="hidden" value='.$_POST["Customers"].' name=customers /> - <input type="hidden" value='.$_POST["NumberOfTopItems"].' name=NumberOfTopItems /> + echo $TableHeader; + echo ' + <input type="hidden" value=' . $_POST["Location"] . ' name=location /> + <input type="hidden" value=' . $_POST["order"] . ' name=order /> + <input type="hidden" value=' . $_POST["NumberOfDays"] . ' name=numberofdays /> + <input type="hidden" value=' . $_POST["Customers"] . ' name=customers /> + <input type="hidden" value=' . $_POST["NumberOfTopItems"] . ' name=NumberOfTopItems /> '; - - - - $k=0; //row colour counter - - while ($myrow=DB_fetch_array($result)) { - - //find the quantity onhand item - $sqloh="SELECT sum(quantity)as qty + $k = 0; //row colour counter + $i = 1; + while ($myrow = DB_fetch_array($result)) { + //find the quantity onhand item + $sqloh = "SELECT sum(quantity)as qty FROM `locstock` WHERE stockid='" . $myrow['0'] . "'"; - $oh = db_query($sqloh,$db,$ErrMsg); - $ohRow = db_fetch_row($oh); - - - - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k=1; - } - - - - $val=number_format($myrow['2'],2); - - printf('<td>%s</font></td> + $oh = db_query($sqloh, $db, $ErrMsg); + $ohRow = db_fetch_row($oh); + if ($k == 1) { + echo '<tr class="EvenTableRows">'; + $k = 0; + } else { + echo '<tr class="OddTableRows">'; + $k = 1; + } + $val = number_format($myrow['2'], 2); + printf('<td class="number">%s</td> + <td>%s</font></td> <td>%s</td> <td class="number">%s</td> <td>%s</td> <td class="number">%s</td> <td class="number">%s</td> - </tr>', - $myrow['0'], - $myrow['3'], - $myrow['1'],//total invoice here - $myrow['4'],//unit - $val,//value sales here - $ohRow[0]//on hand - - ); - - } - echo'</table>'; -// echo '<td style="text-align:center" colspan=6><a href="javascript:history.go(-1)" title="Return to previous page"><input type=Button Name="Back" Value="' . _('Back') . '"></a></font>   '; - echo '<div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print To PDF') . '"></div>'; - echo '</form>'; -//end of the else statement -} - -include('includes/footer.inc'); + </tr>', $i, $myrow['0'], $myrow['3'], $myrow['1'], //total invoice here + $myrow['4'], //unit + $val, //value sales here + $ohRow[0] //on hand + ); + $i+= 1; + } + echo '</table>'; + // echo '<td style="text-align:center" colspan=6><a href="javascript:history.go(-1)" title="Return to previous page"><input type=Button Name="Back" Value="' . _('Back') . '"></a></font>   '; + echo '<div class="centre"><input type=Submit Name="PrintPDF" Value="' . _('Print To PDF') . '"></div>'; + echo '</form>'; + //end of the else statement + +} +include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2009-12-18 20:46:33 UTC (rev 3254) +++ trunk/doc/Change.log.html 2009-12-19 10:35:12 UTC (rev 3255) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>19/12/09 Pak Ricard: TopItems.php - Improvements to the top sales items report. <p>18/12/09 Tim: UserSettings.php - added new pdflanguage field to allow user pdf language support to be specified <p>17/12/09 Tim: class.pdf.php - Corrections to addTextWrap() function <p>17/12/09 Tim: PrintSalesOrder_generic.php - Correctly set $Copy for when not customer copy. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-12-23 13:58:24
|
Revision: 3256 http://web-erp.svn.sourceforge.net/web-erp/?rev=3256&view=rev Author: tim_schofield Date: 2009-12-23 12:26:18 +0000 (Wed, 23 Dec 2009) Log Message: ----------- Rename rtl theme to remove the space from the name Modified Paths: -------------- trunk/doc/Change.log.html Added Paths: ----------- trunk/css/professional-rtl/ Removed Paths: ------------- trunk/css/professional- rtl/ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2009-12-19 10:35:12 UTC (rev 3255) +++ trunk/doc/Change.log.html 2009-12-23 12:26:18 UTC (rev 3256) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>23/12/09 Tim: Rename rtl theme to remove the space. <p>19/12/09 Pak Ricard: TopItems.php - Improvements to the top sales items report. <p>18/12/09 Tim: UserSettings.php - added new pdflanguage field to allow user pdf language support to be specified <p>17/12/09 Tim: class.pdf.php - Corrections to addTextWrap() function This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-12-24 11:07:48
|
Revision: 3257 http://web-erp.svn.sourceforge.net/web-erp/?rev=3257&view=rev Author: tim_schofield Date: 2009-12-24 11:07:36 +0000 (Thu, 24 Dec 2009) Log Message: ----------- Move the purchase ordering printing parameters to a separate file for the form designer. Modified Paths: -------------- trunk/PO_PDFPurchOrder.php trunk/SelectOrderItems.php trunk/api/api_stock.php trunk/doc/Change.log.html trunk/includes/PO_PDFOrderPageHeader.inc trunk/includes/class.pdf.php Added Paths: ----------- trunk/companies/weberpdemo/FormDesigns/ trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/utf-8_xfer:3160-3162 + /branches/utf-8:3087 /branches/utf-8_xfer:3160-3162 Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2009-12-23 12:26:18 UTC (rev 3256) +++ trunk/PO_PDFPurchOrder.php 2009-12-24 11:07:36 UTC (rev 3257) @@ -142,17 +142,18 @@ }//if there is a valid order number if (isset($MakePDFThenDisplayIt) or isset($MakePDFThenEmailIt)) { + $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/PurchaseOrder.xml'); - $PaperSize = 'A4_Landscape'; + $PaperSize = $FormDesign->PaperSize; - include('includes/PDFStarter.php'); - $pdf->addInfo('Title', _('Purchase Order') ); - $pdf->addInfo('Subject', _('Purchase Order Number' ) . ' ' . $OrderNo); - $line_height = 16; - $PageNumber = 1; + include('includes/PDFStarter.php'); + $pdf->addInfo('Title', _('Purchase Order') ); + $pdf->addInfo('Subject', _('Purchase Order Number' ) . ' ' . $OrderNo); + $line_height = $FormDesign->LineHeight; + $PageNumber = 1; - /* Then there's an order to print and its not been printed already (or its been flagged for reprinting) - Now ... Has it got any line items */ + /* Then there's an order to print and its not been printed already (or its been flagged for reprinting) + Now ... Has it got any line items */ $ErrMsg = _('There was a problem retrieving the line details for order number') . ' ' . $OrderNo . ' ' . _('from the database'); @@ -175,32 +176,12 @@ include('includes/PO_PDFOrderPageHeader.inc'); - $YPos-=$line_height; + $YPos=$Page_Height - $FormDesign->Data->y; $OrderTotal = 0; while ($POLine=DB_fetch_array($result)){ - /*$sql = "SELECT supplierdescription - FROM purchdata - WHERE stockid='" . $POLine['itemcode'] . "' - AND supplierno ='" . $POHeader['supplierno'] . "'"; - $SuppDescRslt = DB_query($sql,$db); - - $ItemDescription=''; - - if (DB_error_no($db)==0){ - if (DB_num_rows($SuppDescRslt)==1){ - $SuppDescRow = DB_fetch_row($SuppDescRslt); - if (strlen($SuppDescRow[0])>2){ - $ItemDescription = $SuppDescRow[0]; - } - } - } - if (strlen($ItemDescription)<2){ - $ItemDescription = $POLine['itemdescription']; - }*/ - $DisplayQty = number_format($POLine['quantityord'],$POLine['decimalplaces']); if ($_POST['ShowAmounts']=='Yes'){ $DisplayPrice = number_format($POLine['unitprice'],2); @@ -230,13 +211,13 @@ } $OrderTotal += ($POLine['unitprice']*$POLine['quantityord']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+1,$YPos,94,$FontSize,$POLine['itemcode'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+1+94,$YPos,270,$FontSize,$Desc, 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+1+94+260,$YPos,85,$FontSize,$DisplayQty, 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+1+94+270+85+3,$YPos,37,$FontSize,$POLine['units'], 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+1+94+270+85+3+37,$YPos,60,$FontSize,$DisplayDelDate, 'left'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+1+94+270+85+40+60,$YPos,85,$FontSize,$DisplayPrice, 'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+1+94+270+85+40+60+85,$YPos,85,$FontSize,$DisplayLineTotal, 'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$YPos,$FormDesign->Data->Column1->length,$FormDesign->Data->Column1->FontSize,$POLine['itemcode'], 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$YPos,$FormDesign->Data->Column2->length,$FormDesign->Data->Column2->FontSize,$Desc, 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x,$YPos,$FormDesign->Data->Column3->length,$FormDesign->Data->Column3->FontSize,$DisplayQty, 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column4->x,$YPos,$FormDesign->Data->Column4->length,$FormDesign->Data->Column4->FontSize,$POLine['units'], 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column5->x,$YPos,$FormDesign->Data->Column5->length,$FormDesign->Data->Column5->FontSize,$DisplayDelDate, 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column6->x,$YPos,$FormDesign->Data->Column6->length,$FormDesign->Data->Column6->FontSize,$DisplayPrice, 'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column7->x,$YPos,$FormDesign->Data->Column7->length,$FormDesign->Data->Column7->FontSize,$DisplayLineTotal, 'right'); if (strlen($LeftOvers)>1){ $LeftOvers = $pdf->addTextWrap($Left_Margin+1+94,$YPos-$line_height,270,$FontSize,$LeftOvers, 'left'); @@ -266,8 +247,8 @@ $DisplayOrderTotal = "----"; } $YPos = $Bottom_Margin + $line_height; - $pdf->addText(450,$YPos, 14, _('Order Total - excl tax'). ' ' . $POHeader['currcode']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+1+94+270+85+40+60+75,$YPos,95,14,$DisplayOrderTotal, 'right'); + $pdf->addText($FormDesign->OrderTotalCaption->x,$Page_Height - $FormDesign->OrderTotalCaption->y, $FormDesign->OrderTotalCaption->FontSize, _('Order Total - excl tax'). ' ' . $POHeader['currcode']); + $LeftOvers = $pdf->addTextWrap($FormDesign->OrderTotal->x,$Page_Height - $FormDesign->OrderTotal->y,$Page_Height - $FormDesign->OrderTotal->length,$FormDesign->OrderTotal->FontSize,$DisplayOrderTotal, 'right'); } /*end if there are order details to show on the order*/ //} /* end of check to see that there was an order selected to print */ @@ -275,18 +256,7 @@ //failed var to allow us to print if the email fails. $failed = false; if ($MakePDFThenDisplayIt){ - /* UldisN - $buf = $pdf->output(); - $len = strlen($buf); - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=PurchaseOrder.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('PurchOrder.pdf','I'); - */ + $pdf->OutputD($_SESSION['DatabaseName'] . '_PurchaseOrder_' . date('Y-m-d') . '.pdf');//UldisN $pdf->__destruct(); //UldisN Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2009-12-23 12:26:18 UTC (rev 3256) +++ trunk/SelectOrderItems.php 2009-12-24 11:07:36 UTC (rev 3257) @@ -1526,7 +1526,7 @@ } if (isset($SearchResult)) { - + $j = 1; echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID .'identifier='.$identifier . ' method=post name="orderform">'; echo '<table class="table1">'; echo '<tr><td colspan=><input type="hidden" name="previous" value='.number_format($Offset-1).'><input tabindex='.number_format($j+7).' type="submit" name="Prev" value="'._('Prev').'"></td>'; @@ -1541,7 +1541,7 @@ <th>' . _('Available') . '</th> <th>' . _('Quantity') . '</th></tr>'; echo $TableHeader; - $j = 1; + $k=0; //row colour counter while ($myrow=DB_fetch_array($SearchResult)) { Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2009-12-23 12:26:18 UTC (rev 3256) +++ trunk/api/api_stock.php 2009-12-24 11:07:36 UTC (rev 3257) @@ -782,16 +782,16 @@ ',"api adjustment",'.$Quantity.','.$newqoh.')'; $locstocksql='UPDATE locstock SET quantity = quantity + '.$Quantity.' WHERE loccode="'. $Location.'" AND stockid="'.$StockID.'"'; - $glupdatesql1='INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) - VALUES (17,'.GetNextTransactionNo(17, $db).',"'.$TranDate. - '",'.GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). - ','.$adjglact.','.$itemdetails['materialcost']*-$Quantity. - ',"'.$StockID.' x '.$Quantity.' @ '.$itemdetails['materialcost'].'")'; - $glupdatesql2='INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) - VALUES (17,'.GetNextTransactionNo(17, $db).',"'.$TranDate. - '",'.GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). - ','.$stockact.','.$itemdetails['materialcost']*$Quantity. - ',"'.$StockID.' x '.$Quantity.' @ '.$itemdetails['materialcost'].'")'; + $glupdatesql1="INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) + VALUES (17,".GetNextTransactionNo(17, $db).",'".$TranDate. + "','"GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). + ",".$adjglact.",".$itemdetails['materialcost']*-$Quantity. + ",'".$StockID." x ".$Quantity." @ ".$itemdetails['materialcost']."')"; + $glupdatesql2="INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) + VALUES (17,".GetNextTransactionNo(17, $db).",'".$TranDate. + "',".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). + ",".$stockact.",".$itemdetails['materialcost']*$Quantity. + ",'".$StockID." x ".$Quantity." @ ".$itemdetails['materialcost']."')"; $systypessql = 'UPDATE systypes set typeno='.GetNextTransactionNo(17, $db).' where typeid=17'; DB_Txn_Begin($db); Added: trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml =================================================================== --- trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml (rev 0) +++ trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml 2009-12-24 11:07:36 UTC (rev 3257) @@ -0,0 +1,273 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<form name="Purchase Order"> + <PaperSize name="Paper size">A4_Landscape</PaperSize> + <LineHeight name "Line height">16</LineHeight> + <logo type="logo" name="Logo"> + <x>0</x> + <y>62</y> + <width>0</width> + <height>60</height> + </logo> + <OrderNumber type="SimpleText" name="Order Number"> + <FontSize>15</FontSize> + <x>391</x> + <y>46</y> + </OrderNumber> + <ViewingOnly type="SimpleText" name="Viewing only text"> + <FontSize>16</FontSize> + <x>391</x> + <y>62</y> + </ViewingOnly> + <PageNumber type="SimpleText" name="Page number"> + <FontSize>10</FontSize> + <x>762</x> + <y>70</y> + </PageNumber> + <TaxAuthority type="SimpleText" name="Tax Authority"> + <FontSize>10</FontSize> + <x>40</x> + <y>106</y> + </TaxAuthority> + <CompanyName type="SimpleText" name="Company name"> + <FontSize>10</FontSize> + <x>40</x> + <y>122</y> + </CompanyName> + <CompanyAddress type="ElementArray" name="Company address"> + <Line1 type="SimpleText" name="Company address line 1"> + <FontSize>10</FontSize> + <x>40</x> + <y>132</y> + </Line1> + <Line2 type="SimpleText" name="Company address line 2"> + <FontSize>10</FontSize> + <x>40</x> + <y>142</y> + </Line2> + <Line3 type="SimpleText" name="Company address line 3"> + <FontSize>10</FontSize> + <x>40</x> + <y>152</y> + </Line3> + <Line4 type="SimpleText" name="Company address line 4"> + <FontSize>10</FontSize> + <x>40</x> + <y>162</y> + </Line4> + <Line5 type="SimpleText" name="Company address line 5"> + <FontSize>10</FontSize> + <x>40</x> + <y>172</y> + </Line5> + </CompanyAddress> + <CompanyPhone type="SimpleText" name="Company phone number"> + <FontSize>10</FontSize> + <x>40</x> + <y>182</y> + </CompanyPhone> + <CompanyFax type="SimpleText" name="Company fax number"> + <FontSize>10</FontSize> + <x>40</x> + <y>192</y> + </CompanyFax> + <CompanyEmail type="SimpleText" name="Company email address"> + <FontSize>10</FontSize> + <x>40</x> + <y>202</y> + </CompanyEmail> + <DeliveryAddress type="ElementArray" name="Delivery address"> + <Caption type="SimpleText" name="Delivery address caption"> + <FontSize>12</FontSize> + <x>448</x> + <y>154</y> + </Caption> + <Line1 type="SimpleText" name="Delivery address line 1"> + <FontSize>12</FontSize> + <x>448</x> + <y>166</y> + </Line1> + <Line2 type="SimpleText" name="Delivery address line 2"> + <FontSize>12</FontSize> + <x>448</x> + <y>178</y> + </Line2> + <Line3 type="SimpleText" name="Delivery address line 3"> + <FontSize>12</FontSize> + <x>448</x> + <y>190</y> + </Line3> + <Line4 type="SimpleText" name="Delivery address line 4"> + <FontSize>12</FontSize> + <x>448</x> + <y>202</y> + </Line4> + <Line5 type="SimpleText" name="Delivery address line 5"> + <FontSize>12</FontSize> + <x>448</x> + <y>214</y> + </Line5> + <Line6 type="SimpleText" name="Delivery address line 6"> + <FontSize>12</FontSize> + <x>448</x> + <y>226</y> + </Line6> + </DeliveryAddress> + <DeliveryAddressBox type="CurvedRectangle" name="Delivery address box"> + <x>446</x> + <y>145</y> + <width>240</width> + <height>80</height> + <radius>10</radius> + </DeliveryAddressBox> + <SupplierName type="SimpleText" name="Supplier name"> + <FontSize>12</FontSize> + <x>41</x> + <y>246</y> + </SupplierName> + <SupplierAddress type="ElementArray" name="Supplier address"> + <Line1 type="SimpleText" name="Supplier address line 1"> + <FontSize>12</FontSize> + <x>71</x> + <y>262</y> + </Line1> + <Line2 type="SimpleText" name="Supplier address line 2"> + <FontSize>12</FontSize> + <x>71</x> + <y>274</y> + </Line2> + <Line3 type="SimpleText" name="Supplier address line 3"> + <FontSize>12</FontSize> + <x>71</x> + <y>286</y> + </Line3> + <Line4 type="SimpleText" name="Supplier address line 4"> + <FontSize>12</FontSize> + <x>71</x> + <y>298</y> + </Line4> + </SupplierAddress> + <OrderDate type="SimpleText" name="Order date"> + <FontSize>12</FontSize> + <x>446</x> + <y>262</y> + </OrderDate> + <Initiator type="SimpleText" name="Order initiator"> + <FontSize>12</FontSize> + <x>446</x> + <y>278</y> + </Initiator> + <PaymentTerms type="SimpleText" name="Payment terms"> + <FontSize>12</FontSize> + <x>446</x> + <y>290</y> + </PaymentTerms> + <Comments type="MultiLineText" name="Comments"> + <FontSize>12</FontSize> + <Length>250</Length> + <x>446</x> + <y>302</y> + </Comments> + <Currency type="SimpleText" name="Currency text"> + <FontSize>12</FontSize> + <x>40</x> + <y>312</y> + </Currency> + <HeaderRectangle type="Rectangle" name="Header rectangle"> + <x>40</x> + <y>320</y> + <width>772</width> + <height>32</height> + </HeaderRectangle> + <Headings type="ElementArray" name="Column headings"> + <Column1 type="SimpleText" name="Column heading 1"> + <FontSize>10</FontSize> + <x>41</x> + <y>330</y> + </Column1> + <Column2 type="SimpleText" name="Column heading 2"> + <FontSize>10</FontSize> + <x>136</x> + <y>330</y> + </Column2> + <Column3 type="SimpleText" name="Column heading 3"> + <FontSize>10</FontSize> + <x>441</x> + <y>330</y> + </Column3> + <Column4 type="SimpleText" name="Column heading 4"> + <FontSize>10</FontSize> + <x>491</x> + <y>330</y> + </Column4> + <Column5 type="SimpleText" name="Column heading 5"> + <FontSize>10</FontSize> + <x>526</x> + <y>330</y> + </Column5> + <Column6 type="SimpleText" name="Column heading 6"> + <FontSize>10</FontSize> + <x>641</x> + <y>330</y> + </Column6> + <Column7 type="SimpleText" name="Column heading 7"> + <FontSize>10</FontSize> + <x>761</x> + <y>330</y> + </Column7> + </Headings> + <DataRectangle type="Rectangle" name="Header rectangle"> + <x>40</x> + <y>352</y> + <width>772</width> + <height>213</height> + </DataRectangle> + <Data type="ElementArray" name="Column Data"> + <y>362</y> + <Column1 type="DataText" name="Data column 1"> + <FontSize>10</FontSize> + <x>41</x> + <length>94</length> + </Column1> + <Column2 type="DataText" name="Data column 2"> + <FontSize>10</FontSize> + <x>136</x> + <length>270</length> + </Column2> + <Column3 type="DataText" name="Data column 3"> + <FontSize>10</FontSize> + <x>441</x> + <length>85</length> + </Column3> + <Column4 type="DataText" name="Data column 4"> + <FontSize>10</FontSize> + <x>491</x> + <length>37</length> + </Column4> + <Column5 type="DataText" name="Data column 5"> + <FontSize>10</FontSize> + <x>526</x> + <length>60</length> + </Column5> + <Column6 type="DataText" name="Data column 6"> + <FontSize>10</FontSize> + <x>591</x> + <length>85</length> + </Column6> + <Column7 type="DataText" name="Data column 7"> + <FontSize>10</FontSize> + <x>721</x> + <length>85</length> + </Column7> + </Data> + <OrderTotalCaption type="SimpleText" name="Order total caption"> + <FontSize>14</FontSize> + <x>450</x> + <y>549</y> + </OrderTotalCaption> + <OrderTotal type="MultiLineText" name="Order total"> + <FontSize>14</FontSize> + <x>665</x> + <y>549</y> + <length>135</length> + </OrderTotal> +</form> \ No newline at end of file Property changes on: trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2009-12-23 12:26:18 UTC (rev 3256) +++ trunk/doc/Change.log.html 2009-12-24 11:07:36 UTC (rev 3257) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>24/12/09 Tim: Move the purchase ordering printing parameters to a separate file for the form designer. <p>23/12/09 Tim: Rename rtl theme to remove the space. <p>19/12/09 Pak Ricard: TopItems.php - Improvements to the top sales items report. <p>18/12/09 Tim: UserSettings.php - added new pdflanguage field to allow user pdf language support to be specified Modified: trunk/includes/PO_PDFOrderPageHeader.inc =================================================================== --- trunk/includes/PO_PDFOrderPageHeader.inc 2009-12-23 12:26:18 UTC (rev 3256) +++ trunk/includes/PO_PDFOrderPageHeader.inc 2009-12-24 11:07:36 UTC (rev 3257) @@ -10,150 +10,87 @@ $pdf->newPage(); } -$YPos = $Page_Height - $Top_Margin - ($line_height*2); +$pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin+$FormDesign->logo->x,$Page_Height- $FormDesign->logo->y,$FormDesign->logo->width,$FormDesign->logo->height); +$pdf->addText($FormDesign->OrderNumber->x,$Page_Height- $FormDesign->OrderNumber->y,$FormDesign->OrderNumber->FontSize, _('Purchase Order Number'). ' ' . $OrderNo); -$pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin,$YPos,0,60); - -$FontSize=15; - -$XPos = $Page_Width/2 - 30; - -$pdf->addText($XPos,$YPos+$line_height,$FontSize, _('Purchase Order Number'). ' ' . $OrderNo); - if ($ViewingOnly!=0) { - $FontSize=16; - $pdf->addText($XPos,$YPos,$FontSize, _('FOR VIEWING ONLY') . ', ' . _('DO NOT SEND TO SUPPLIER') ); - $pdf->addText($XPos,$YPos-$line_height,$FontSize, _('SUPPLIERS') . ' - ' . _('THIS IS NOT AN ORDER') ); + $pdf->addText($FormDesign->ViewingOnly->x,$Page_Height - $FormDesign->ViewingOnly->y,$FormDesign->ViewingOnly->FontSize, _('FOR VIEWING ONLY') . ', ' . _('DO NOT SEND TO SUPPLIER') ); + $pdf->addText($FormDesign->ViewingOnly->x,$Page_Height - $FormDesign->ViewingOnly->y-$line_height,$FormDesign->ViewingOnly->FontSize, _('SUPPLIERS') . ' - ' . _('THIS IS NOT AN ORDER') ); } -$YPos -= ($line_height*3); -$FontSize=10; -$XPos = $Page_Width-$Right_Margin-50; -$pdf->addText($XPos,$YPos +40, $FontSize, _('Page') . ': ' .$PageNumber); +$pdf->addText($FormDesign->PageNumber->x,$Page_Height - $FormDesign->PageNumber->y, $FormDesign->PageNumber->FontSize, _('Page') . ': ' .$PageNumber); +/*Now print out the company Tax authority reference */ +$pdf->addText($FormDesign->TaxAuthority->x,$Page_Height - $FormDesign->TaxAuthority->y, $FormDesign->TaxAuthority->FontSize, $_SESSION['TaxAuthorityReferenceName'] . ' ' . $_SESSION['CompanyRecord']['gstno']); /*Now print out the company name and address */ -$XPos = $Left_Margin; -$YPos -= 1*$line_height; -$pdf->addText($Left_Margin,$YPos, $FontSize, $_SESSION['TaxAuthorityReferenceName'] . ' ' . $_SESSION['CompanyRecord']['gstno']); -$pdf->addText($Left_Margin,$YPos-(0.8*$line_height), $FontSize, $_SESSION['CompanyRecord']['coyname']); -$pdf->addText($Left_Margin,$YPos-(1.6*$line_height), $FontSize, $_SESSION['CompanyRecord']['regoffice1']); -$pdf->addText($Left_Margin,$YPos-(2.4*$line_height), $FontSize, $_SESSION['CompanyRecord']['regoffice2']); -$pdf->addText($Left_Margin,$YPos-(3.2*$line_height), $FontSize, $_SESSION['CompanyRecord']['regoffice3'] . ' ' . $_SESSION['CompanyRecord']['regoffice4'] . ' ' . $_SESSION['CompanyRecord']['regoffice5']); -$pdf->addText($Left_Margin,$YPos-(4*$line_height), $FontSize, _('Ph'). ': ' . $_SESSION['CompanyRecord']['telephone'] . ' ' ._('Fax').': ' . $_SESSION['CompanyRecord']['fax'] ); -$pdf->addText($Left_Margin,$YPos-(4.8*$line_height), $FontSize, _('Email'). ': ' . $_SESSION['CompanyRecord']['email']); +$pdf->addText($FormDesign->CompanyName->x,$Page_Height - $FormDesign->CompanyName->y, $FormDesign->CompanyName->FontSize, $_SESSION['CompanyRecord']['coyname']); +$pdf->addText($FormDesign->CompanyAddress->Line1->x,$Page_Height - $FormDesign->CompanyAddress->Line1->y, $FormDesign->CompanyAddress->Line1->FontSize, $_SESSION['CompanyRecord']['regoffice1']); +$pdf->addText($FormDesign->CompanyAddress->Line2->x,$Page_Height - $FormDesign->CompanyAddress->Line2->y, $FormDesign->CompanyAddress->Line2->FontSize, $_SESSION['CompanyRecord']['regoffice2']); +$pdf->addText($FormDesign->CompanyAddress->Line3->x,$Page_Height - $FormDesign->CompanyAddress->Line3->y, $FormDesign->CompanyAddress->Line3->FontSize, $_SESSION['CompanyRecord']['regoffice3']); +$pdf->addText($FormDesign->CompanyAddress->Line4->x,$Page_Height - $FormDesign->CompanyAddress->Line4->y, $FormDesign->CompanyAddress->Line4->FontSize, $_SESSION['CompanyRecord']['regoffice4']); +$pdf->addText($FormDesign->CompanyAddress->Line5->x,$Page_Height - $FormDesign->CompanyAddress->Line5->y, $FormDesign->CompanyAddress->Line5->FontSize, $_SESSION['CompanyRecord']['regoffice5']); +$pdf->addText($FormDesign->CompanyPhone->x,$Page_Height - $FormDesign->CompanyPhone->y, $FormDesign->CompanyPhone->FontSize, _('Tel'). ': ' . $_SESSION['CompanyRecord']['telephone']); +$pdf->addText($FormDesign->CompanyFax->x,$Page_Height - $FormDesign->CompanyFax->y, $FormDesign->CompanyFax->FontSize, _('Fax').': ' . $_SESSION['CompanyRecord']['fax']); +$pdf->addText($FormDesign->CompanyEmail->x,$Page_Height - $FormDesign->CompanyEmail->y, $FormDesign->CompanyEmail->FontSize, _('Email'). ': ' .$_SESSION['CompanyRecord']['email']); -$YPos -=2*$line_height; - /*Now the delivery details */ -$YPos -= 8; -$XPos = $Page_Width/2 + 25; -$FontSize=12; -$pdf->addText($XPos+2,$YPos, $FontSize, _('Deliver To') . ':' ); -$pdf->addText($XPos+2,$YPos-$line_height, $FontSize, $POHeader['deladd1']); -$pdf->addText($XPos+2,$YPos-(2*$line_height), $FontSize, $POHeader['deladd2']); -$pdf->addText($XPos+2,$YPos-(3*$line_height), $FontSize, $POHeader['deladd3'] . ' ' . $POHeader['deladd4'] . ' ' . $POHeader['deladd5']); -$pdf->addText($XPos+2,$YPos-(4*$line_height), $FontSize, $POHeader['deladd6']); +$pdf->addText($FormDesign->DeliveryAddress->Caption->x,$Page_Height - $FormDesign->DeliveryAddress->Caption->y, $FormDesign->DeliveryAddress->Caption->FontSize, _('Deliver To') . ':' ); +$pdf->addText($FormDesign->DeliveryAddress->Line1->x,$Page_Height - $FormDesign->DeliveryAddress->Line1->y, $FormDesign->DeliveryAddress->Line1->FontSize, $POHeader['deladd1']); +$pdf->addText($FormDesign->DeliveryAddress->Line2->x,$Page_Height - $FormDesign->DeliveryAddress->Line2->y, $FormDesign->DeliveryAddress->Line2->FontSize, $POHeader['deladd2']); +$pdf->addText($FormDesign->DeliveryAddress->Line3->x,$Page_Height - $FormDesign->DeliveryAddress->Line3->y, $FormDesign->DeliveryAddress->Line3->FontSize, $POHeader['deladd3']); +$pdf->addText($FormDesign->DeliveryAddress->Line4->x,$Page_Height - $FormDesign->DeliveryAddress->Line4->y, $FormDesign->DeliveryAddress->Line4->FontSize, $POHeader['deladd4']); +$pdf->addText($FormDesign->DeliveryAddress->Line5->x,$Page_Height - $FormDesign->DeliveryAddress->Line5->y, $FormDesign->DeliveryAddress->Line5->FontSize, $POHeader['deladd5']); +$pdf->addText($FormDesign->DeliveryAddress->Line6->x,$Page_Height - $FormDesign->DeliveryAddress->Line6->y, $FormDesign->DeliveryAddress->Line6->FontSize, $POHeader['deladd6']); /*draw a nice curved corner box around the delivery to address */ -/*from the top right */ -$pdf->partEllipse($XPos+250-10,$YPos+10,0,90,10,10); -/*line to the top left */ -$pdf->line($XPos+250-10, $YPos+20,$XPos+10, $YPos+20); -/*Do top left corner */ -$pdf->partEllipse($XPos+10, $YPos+10,90,180,10,10); -/*Do a line to the bottom left corner */ -$pdf->line($XPos+10, $YPos-70-10,$XPos+250-10, $YPos-70-10); -/*Now do the bottom left corner 180 - 270 coming back west*/ -$pdf->partEllipse($XPos+10, $YPos-70,180,270,10,10); -/*Now a line to the bottom right */ -$pdf->line($XPos, $YPos-70,$XPos, $YPos+10); -/*Now do the bottom right corner */ -$pdf->partEllipse($XPos+250-10, $YPos-70,270,360,10,10); -/*Finally join up to the top right corner where started */ -$pdf->line($XPos+250, $YPos-70,$XPos+250, $YPos+10); +$pdf->RoundRectangle($FormDesign->DeliveryAddressBox->x, $Page_Height - $FormDesign->DeliveryAddressBox->y,$FormDesign->DeliveryAddressBox->width, $FormDesign->DeliveryAddressBox->height, $FormDesign->DeliveryAddressBox->radius); +/*Now the Supplier details */ +$pdf->addText($FormDesign->SupplierName->x,$Page_Height - $FormDesign->SupplierName->y, $FormDesign->SupplierName->FontSize, _('To').': '); +$pdf->addText($FormDesign->SupplierName->x+30,$Page_Height - $FormDesign->SupplierName->y, $FormDesign->SupplierName->FontSize, $POHeader['suppname']); +$pdf->addText($FormDesign->SupplierAddress->Line1->x,$Page_Height - $FormDesign->SupplierAddress->Line1->y, $FormDesign->SupplierAddress->Line1->FontSize, $POHeader['address1']); +$pdf->addText($FormDesign->SupplierAddress->Line2->x,$Page_Height - $FormDesign->SupplierAddress->Line2->y, $FormDesign->SupplierAddress->Line2->FontSize, $POHeader['address2']); +$pdf->addText($FormDesign->SupplierAddress->Line3->x,$Page_Height - $FormDesign->SupplierAddress->Line3->y, $FormDesign->SupplierAddress->Line3->FontSize, $POHeader['address3']); +$pdf->addText($FormDesign->SupplierAddress->Line4->x,$Page_Height - $FormDesign->SupplierAddress->Line4->y, $FormDesign->SupplierAddress->Line4->FontSize, $POHeader['address4']); +/*Now the Order date */ +$pdf->addText($FormDesign->OrderDate->x,$Page_Height - $FormDesign->OrderDate->y, $FormDesign->OrderDate->FontSize, _('Order Date') . ':' ); +$pdf->addText($FormDesign->OrderDate->x+70,$Page_Height - $FormDesign->OrderDate->y, $FormDesign->OrderDate->FontSize, ConvertSQLDate($POHeader['orddate'])); -/*end of the small table showing the coy name and delivery address details */ +/*Now the Initiator */ +$pdf->addText($FormDesign->Initiator->x,$Page_Height - $FormDesign->Initiator->y, $FormDesign->Initiator->FontSize, _('Initiator').': '); +$pdf->addText($FormDesign->Initiator->x+70,$Page_Height - $FormDesign->Initiator->y, $FormDesign->Initiator->FontSize, $POHeader['initiator']); -$XPos = $Left_Margin; -$YPos -= ($line_height*4.5); /* 4 lines down */ - -/* -PDF_moveto($p, $XPos+230, $YPos-100); -PDF_arc($p, $XPos+220, $YPos, 10, 0, 90); -PDF_arc($p, $XPos+5, $YPos, 10, 90, 180); -PDF_arc($p, $XPos+5, $YPos-100, 10, 180, 270); -PDF_arc($p, $XPos+220, $YPos-100, 10, 270, 360); -PDF_stroke($p); - - - -$font=PDF_findfont($p,"Helvetica-Bold","host",0); -PDF_setfont($p, $font, 12.0); - -*/ -$YPos -= 20; -$pdf->addText($XPos+1,$YPos, $FontSize, _('To').': '); - -$YPos-=$line_height; -$pdf->addText($XPos+1,$YPos, $FontSize, $POHeader['suppname']); -$pdf->addText($XPos+1,$YPos-$line_height, $FontSize, $POHeader['address1']); -$pdf->addText($XPos+1,$YPos-(2*$line_height), $FontSize, $POHeader['address2']); -$pdf->addText($XPos+1,$YPos-(3*$line_height), $FontSize, $POHeader['address3']); -$pdf->addText($XPos+1,$YPos-(4*$line_height), $FontSize, $POHeader['address4']); - - -$XPos = $Page_Width/2 + 25; -$pdf->addText($XPos,$YPos, $FontSize, _('Order Date') . ':' ); -$pdf->addText($XPos+70,$YPos, $FontSize, ConvertSQLDate($POHeader['orddate'])); - - -$YPos -= $line_height; -$pdf->addText($XPos,$YPos, $FontSize, _('Initiator').': '); -$pdf->addText($XPos+70,$YPos, $FontSize, $POHeader['initiator']); - -$YPos -= $line_height; -$pdf->addText($XPos,$YPos, $FontSize, _('Comments') . ':' ); -$YPos -= $line_height; -$LeftOvers = $pdf->addTextWrap($XPos, $YPos,250,$FontSize,$POHeader['comments'], 'left'); -if (strlen($LeftOvers)>0){ - $LeftOvers = $pdf->addTextWrap($XPos, $YPos-$line_height,250,$FontSize,$LeftOvers, 'left'); -} - +/*Find the description of the payment terms and display */ $sql='SELECT terms FROM paymentterms where termsindicator="'.$POHeader['paymentterms'].'"'; $termsresult=DB_query($sql, $db); $myrow=DB_fetch_array($termsresult); -$pdf->addText($XPos+2,$YPos-($line_height), $FontSize, _('Payment Terms').' : '.$myrow['terms']); +$pdf->addText($FormDesign->PaymentTerms->x,$Page_Height - $FormDesign->PaymentTerms->y, $FormDesign->PaymentTerms->FontSize, _('Payment Terms').' : '.$myrow['terms']); -$XPos = $Left_Margin; -$YPos -= ($line_height*2); -$pdf->addText($Left_Margin,$YPos, $FontSize, _('All amounts stated in').' - ' . $POHeader['currcode']); +/*Now the Comments split over two lines if necessary */ +$LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x, $Page_Height - $FormDesign->Comments->y,$FormDesign->Comments->Length,$FormDesign->Comments->FontSize,_('Comments') . ':' .$POHeader['comments'], 'left'); +if (strlen($LeftOvers)>0){ + $LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x, $Page_Height - $FormDesign->Comments->y-$line_height,$FormDesign->Comments->Length,$FormDesign->Comments->FontSize,$LeftOvers, 'left'); +} +/*Now the currency the order is in */ +$pdf->addText($FormDesign->Currency->x,$Page_Height - $FormDesign->Currency->y,$FormDesign->Currency->FontSize, _('All amounts stated in').' - ' . $POHeader['currcode']); -$YPos -= ($line_height*.5); -/*draw a square grid for entering line items */ -$pdf->line($Left_Margin, $YPos, $Page_Width-$Right_Margin, $YPos); -$pdf->line($Page_Width-$Right_Margin, $YPos, $Page_Width-$Right_Margin, $Bottom_Margin); -$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin, $Left_Margin, $Bottom_Margin); -$pdf->line($Left_Margin, $Bottom_Margin, $Left_Margin, $YPos); +/*draw a square grid for entering line headings */ +$pdf->Rectangle($FormDesign->HeaderRectangle->x, $Page_Height - $FormDesign->HeaderRectangle->y, $FormDesign->HeaderRectangle->width,$FormDesign->HeaderRectangle->height); -$YPos -= $line_height; /*Set up headings */ -$FontSize=10; -$pdf->addText($Left_Margin+1,$YPos, $FontSize, _('Code') ); -$pdf->addText($Left_Margin+95,$YPos, $FontSize, _('Item Description') ); -$pdf->addText($Left_Margin+400,$YPos, $FontSize, _('Quantity') ); -$pdf->addText($Left_Margin+450,$YPos, $FontSize, _('Unit') ); -$pdf->addText($Left_Margin+485,$YPos, $FontSize, _('Date Reqd')); -$pdf->addText($Left_Margin+600,$YPos, $FontSize, _('Price') ); -$pdf->addText($Left_Margin+680,$YPos, $FontSize, _('Total') ); +$pdf->addText($FormDesign->Headings->Column1->x,$Page_Height - $FormDesign->Headings->Column1->y, $FormDesign->Headings->Column1->FontSize, _('Code') ); +$pdf->addText($FormDesign->Headings->Column2->x,$Page_Height - $FormDesign->Headings->Column2->y, $FormDesign->Headings->Column2->FontSize, _('Item Description') ); +$pdf->addText($FormDesign->Headings->Column3->x,$Page_Height - $FormDesign->Headings->Column3->y, $FormDesign->Headings->Column3->FontSize, _('Quantity') ); +$pdf->addText($FormDesign->Headings->Column4->x,$Page_Height - $FormDesign->Headings->Column4->y, $FormDesign->Headings->Column4->FontSize, _('Unit') ); +$pdf->addText($FormDesign->Headings->Column5->x,$Page_Height - $FormDesign->Headings->Column5->y, $FormDesign->Headings->Column5->FontSize, _('Date Reqd')); +$pdf->addText($FormDesign->Headings->Column6->x,$Page_Height - $FormDesign->Headings->Column6->y, $FormDesign->Headings->Column6->FontSize, _('Price') ); +$pdf->addText($FormDesign->Headings->Column7->x,$Page_Height - $FormDesign->Headings->Column7->y, $FormDesign->Headings->Column7->FontSize, _('Total') ); -$YPos-=$line_height; +/*draw a rectangle to hold the data lines */ +$pdf->Rectangle($FormDesign->DataRectangle->x, $Page_Height - $FormDesign->DataRectangle->y, $FormDesign->DataRectangle->width,$FormDesign->DataRectangle->height); -/*draw a line */ -$pdf->line($Left_Margin, $YPos, $Page_Width-$Right_Margin, $YPos); - ?> \ No newline at end of file Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2009-12-23 12:26:18 UTC (rev 3256) +++ trunk/includes/class.pdf.php 2009-12-24 11:07:36 UTC (rev 3257) @@ -215,7 +215,32 @@ $this->Output($DocumentFilename,'D'); } + function RoundRectangle($XPos, $YPos, $Width, $Height, $Radius) { + /*from the top right */ + $this->partEllipse($XPos+$Width,$YPos,0,90,$Radius,$Radius); + /*line to the top left */ + $this->line($XPos+$Width, $YPos+$Radius,$XPos+$Radius, $YPos+$Radius); + /*Do top left corner */ + $this->partEllipse($XPos+$Radius, $YPos,90,180,$Radius,$Radius); + /*Do a line to the bottom left corner */ + $this->line($XPos+$Radius, $YPos-$Height-$Radius,$XPos+$Width, $YPos-$Height-$Radius); + /*Now do the bottom left corner 180 - 270 coming back west*/ + $this->partEllipse($XPos+$Radius, $YPos-$Height,180,270,$Radius,$Radius); + /*Now a line to the bottom right */ + $this->line($XPos, $YPos-$Height,$XPos, $YPos); + /*Now do the bottom right corner */ + $this->partEllipse($XPos+$Width, $YPos-$Height,270,360,$Radius,$Radius); + /*Finally join up to the top right corner where started */ + $this->line($XPos+$Width+$Radius, $YPos-$Height,$XPos+$Width+$Radius, $YPos); + } + function Rectangle($XPos, $YPos, $Width, $Height) { + $this->line($XPos, $YPos, $XPos+$Width, $YPos); + $this->line($XPos+$Width, $YPos, $XPos+$Width, $YPos-$Height); + $this->line($XPos+$Width, $YPos-$Height, $XPos, $YPos-$Height); + $this->line($XPos, $YPos-$Height, $XPos, $YPos); + } + function addTextWrap($xb, $yb, $w, $h, $txt, $align='J', $border=0, $fill=0) { // $txt = html_entity_decode($txt); $this->x = $xb; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2009-12-24 15:44:37
|
Revision: 3258 http://web-erp.svn.sourceforge.net/web-erp/?rev=3258&view=rev Author: tim_schofield Date: 2009-12-24 15:44:27 +0000 (Thu, 24 Dec 2009) Log Message: ----------- Old version of xmlrpc library Removed Paths: ------------- trunk/xmlrpc/ Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Added: svn:externals + xmlrpc https://phpxmlrpc.svn.sourceforge.net/svnroot/phpxmlrpc/trunk/xmlrpc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2009-12-28 02:25:09
|
Revision: 3260 http://web-erp.svn.sourceforge.net/web-erp/?rev=3260&view=rev Author: daintree Date: 2009-12-28 02:24:43 +0000 (Mon, 28 Dec 2009) Log Message: ----------- add all the language files as updated as of now. Also added the make_release script to svn new build directory - modified a bit to update the language files - *****need to modify it for your directory structure Modified Paths: -------------- trunk/Credit_Invoice.php trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po Added Paths: ----------- trunk/build/ trunk/build/make_release.sh trunk/locale/cs_CZ.utf8/ trunk/locale/cs_CZ.utf8/LC_MESSAGES/ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/Manual/ trunk/locale/de_DE.utf8/Manual/ManualARInquiries.html trunk/locale/de_DE.utf8/Manual/ManualARReports.html trunk/locale/de_DE.utf8/Manual/ManualARTransactions.html trunk/locale/de_DE.utf8/Manual/ManualAccountsPayable.html trunk/locale/de_DE.utf8/Manual/ManualAccountsReceivable.html trunk/locale/de_DE.utf8/Manual/ManualContents.php trunk/locale/de_DE.utf8/Manual/ManualContributors.html trunk/locale/de_DE.utf8/Manual/ManualCreatingNewSystem.html trunk/locale/de_DE.utf8/Manual/ManualCreditStatus.html trunk/locale/de_DE.utf8/Manual/ManualDevelopmentStructure.html trunk/locale/de_DE.utf8/Manual/ManualFooter.html trunk/locale/de_DE.utf8/Manual/ManualGeneralLedger.html trunk/locale/de_DE.utf8/Manual/ManualGettingStarted.html trunk/locale/de_DE.utf8/Manual/ManualHeader.html trunk/locale/de_DE.utf8/Manual/ManualIntroduction.html trunk/locale/de_DE.utf8/Manual/ManualInventory.html trunk/locale/de_DE.utf8/Manual/ManualManufacturing.html trunk/locale/de_DE.utf8/Manual/ManualMultilanguage.html trunk/locale/de_DE.utf8/Manual/ManualNewScripts.html trunk/locale/de_DE.utf8/Manual/ManualPaymentTerms.html trunk/locale/de_DE.utf8/Manual/ManualPrices.html trunk/locale/de_DE.utf8/Manual/ManualReportBuilder.html trunk/locale/de_DE.utf8/Manual/ManualRequirements.html trunk/locale/de_DE.utf8/Manual/ManualSalesAnalysis.html trunk/locale/de_DE.utf8/Manual/ManualSalesOrders.html trunk/locale/de_DE.utf8/Manual/ManualSalesPeople.html trunk/locale/de_DE.utf8/Manual/ManualSalesTypes.html trunk/locale/de_DE.utf8/Manual/ManualSecuritySchema.html trunk/locale/de_DE.utf8/Manual/ManualSecuritySchemaorig.html trunk/locale/de_DE.utf8/Manual/ManualShipments.html trunk/locale/de_DE.utf8/Manual/ManualSpecialUtilities.html trunk/locale/de_DE.utf8/Manual/ManualSystemConventions.html trunk/locale/de_DE.utf8/Manual/ManualTax.html trunk/locale/de_DE.utf8/Manual/images/ trunk/locale/de_DE.utf8/Manual/images/RBCritSetup.gif trunk/locale/de_DE.utf8/Manual/images/RBDbSetup.gif trunk/locale/de_DE.utf8/Manual/images/RBFldSetup.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmCritSetup.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDbSetup.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDtaBlk.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDtaCoBlk.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDtaCoLine.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDtaFxdLine.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDtaImg.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDtaLine.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDtaPgNum.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDtaRect.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDtaTbl.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDtaText.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmDtaTtl.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmFldSetup.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmName.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmPageSetup.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmShow.gif trunk/locale/de_DE.utf8/Manual/images/RBFrmShowCrit.gif trunk/locale/de_DE.utf8/Manual/images/RBHome.gif trunk/locale/de_DE.utf8/Manual/images/RBPageSetup.gif trunk/locale/de_DE.utf8/Manual/images/RBRptName.gif trunk/locale/el_GR.utf8/ trunk/locale/el_GR.utf8/LC_MESSAGES/ trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/ trunk/locale/fa_IR.utf8/LC_MESSAGES/ trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/ trunk/locale/fr_FR.utf8/LC_MESSAGES/ trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/ trunk/locale/hu_HU.utf8/LC_MESSAGES/ trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/ trunk/locale/id_ID.utf8/GL/ trunk/locale/id_ID.utf8/GL/AccountGroups.csv trunk/locale/id_ID.utf8/GL/AccountSections.csv trunk/locale/id_ID.utf8/GL/GLAccounts.csv trunk/locale/id_ID.utf8/LC_MESSAGES/ trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/ trunk/locale/it_IT.utf8/LC_MESSAGES/ trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/ trunk/locale/ja_JP.utf8/LC_MESSAGES/ trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/ trunk/locale/nl_NL.utf8/LC_MESSAGES/ trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/ trunk/locale/pl_PL.utf8/LC_MESSAGES/ trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/ trunk/locale/pt_BR.utf8/LC_MESSAGES/ trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/ trunk/locale/pt_PT.utf8/LC_MESSAGES/ trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/ trunk/locale/ru_RU.utf8/LC_MESSAGES/ trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/ trunk/locale/sv_SE.utf8/LC_MESSAGES/ trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po Removed Paths: ------------- trunk/locale/en_GB/LC_MESSAGES/ trunk/locale/es_ES/ Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2009-12-24 15:48:31 UTC (rev 3259) +++ trunk/Credit_Invoice.php 2009-12-28 02:24:43 UTC (rev 3260) @@ -183,15 +183,15 @@ } else { /* there are no stock movement records created for that invoice */ - echo "<div class='centre'><a href='$rootpath/index.php?" . SID . "'>" . _('Back to the menu') . '</a></div>'; + echo '<div class="centre"><a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a></div>'; prnMsg( _('There are no line items that were retrieved for this invoice') . '. ' . _('The automatic credit program can not create a credit note from this invoice'),'warn'); - include("includes/footer.inc"); + include('includes/footer.inc'); exit; } //end of checks on returned data set DB_free_result($LineItemsResult); } else { prnMsg( _('This invoice can not be credited using the automatic facility') . '<br>' . _('CRITICAL ERROR') . ': ' . _('Please report that a duplicate DebtorTrans header record was found for invoice') . ' ' . $SESSION['ProcessingCredit'],'warn'); - include("includes/footer.inc"); + include('includes/footer.inc'); exit; } //valid invoice record returned from the entered invoice number @@ -477,7 +477,7 @@ /*Start an SQL transaction */ - $SQL = "BEGIN"; + $SQL = 'BEGIN'; $Result = DB_query($SQL,$db); $DefaultDispatchDate= FormatDateForSQL($DefaultDispatchDate); @@ -626,16 +626,18 @@ if (DB_num_rows($Result)==1){ $LocQtyRow = DB_fetch_row($Result); $QtyOnHandPrior = $LocQtyRow[0]; - } else { + } else { /*There must actually be some error this should never happen */ $QtyOnHandPrior = 0; - } + } } else { $QtyOnHandPrior =0; //because its a dummy/assembly/kitset part } if ($_POST['CreditType']=='Return'){ + /* some want this some do not */ + $SQL = "UPDATE salesorderdetails SET qtyinvoiced = qtyinvoiced - " . $OrderLine->QtyDispatched . ", completed=0 @@ -646,9 +648,12 @@ $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sales order detail record could not be updated for the reduced quantity invoiced because'); $DbgMsg = _('The following SQL to update the sales order detail record was used'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); + + + /* Update location stock records if not a dummy stock item */ - if ($MBFlag=="B" OR $MBFlag=="M") { + if ($MBFlag=='B' OR $MBFlag=='M') { $SQL = "UPDATE locstock SET locstock.quantity = locstock.quantity + " . $OrderLine->QtyDispatched . " @@ -712,7 +717,7 @@ $QtyOnHandPrior =0; //because its a dummy/assembly/kitset part } - if ($Component_MBFlag=="M" OR $Component_MBFlag=="B"){ + if ($Component_MBFlag=='M' OR $Component_MBFlag=='B'){ $SQL = "INSERT INTO stockmoves ( stockid, @@ -874,19 +879,25 @@ foreach($OrderLine->SerialItems as $Item){ /*We need to add the StockSerialItem record and The StockSerialMoves as well */ $SQL = "SELECT quantity from stockserialitems - WHERE stockid='" . $OrderLine->StockID . "' - AND loccode='" . $_SESSION['CreditItems']->Location . "' - AND serialno='" . $Item->BundleRef . "'"; - + WHERE stockid='" . $OrderLine->StockID . "' + AND loccode='" . $_SESSION['CreditItems']->Location . "' + AND serialno='" . $Item->BundleRef . "'"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be selected because'); $DbgMsg = _('The following SQL to select the serial stock item record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); if (DB_num_rows($Result)==0){ - $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, quantity) - VALUES - ('" . $OrderLine->StockID . "', '" . $_SESSION['CreditItems']->Location . "', '" . $Item->BundleRef . "', ". $Item->BundleQty .")"; - + $SQL = "INSERT INTO stockserialitems (stockid, + loccode, + serialno, + quantity) + VALUES + ('" . $OrderLine->StockID . "', + '" . $_SESSION['CreditItems']->Location . "', + '" . $Item->BundleRef . "', + ". $Item->BundleQty .")"; + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -904,7 +915,14 @@ /* now insert the serial stock movement */ - $SQL = "INSERT INTO stockserialmoves (stockmoveno, stockid, serialno, moveqty) VALUES (" . $StkMoveNo . ", '" . $OrderLine->StockID . "', '" . $Item->BundleRef . "', " . $Item->BundleQty . ")"; + $SQL = "INSERT INTO stockserialmoves (stockmoveno, + stockid, + serialno, + moveqty) + VALUES (" . $StkMoveNo . ", + '" . $OrderLine->StockID . "', + '" . $Item->BundleRef . "', + " . $Item->BundleQty . ")"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock movement record could not be inserted because'); $DbgMsg = _('The following SQL to insert the serial stock movement records was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); Added: trunk/build/make_release.sh =================================================================== --- trunk/build/make_release.sh (rev 0) +++ trunk/build/make_release.sh 2009-12-28 02:24:43 UTC (rev 3260) @@ -0,0 +1,112 @@ +#! /bin/bash + +BASE_DIR=/root/httpd/hiawatha/webERP; +OUTPUT_DIR=/root/tmp; +MYSQL_USER=root; +MYSQL_PWD=woofwoof; + +cd $BASE_DIR; + +xgettext --no-wrap --language=PHP -o locale/en_GB.utf8/LC_MESSAGES/messages.pot *php includes/*.php includes/*.inc reportwriter/*.php reportwriter/*.inc reportwriter/forms/*.html reportwriter/admin/*.php reportwriter/admin/*.inc reportwriter/admin/forms/*.html api/*.php + +msgmerge -U --backup=off locale/fr_FR.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/ja_JP.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/nl_NL.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/pl_PL.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/pt_BR.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/pt_PT.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/ru_RU.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/sv_SE.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/en_US.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/zh_CN.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/tr_TR.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/es_ES.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/de_DE.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/it_IT.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/id_ID.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/cs_CZ.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/el_GR.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/fa_IR.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot +msgmerge -U --backup=off locale/hu_HU.utf8/LC_MESSAGES/messages.po locale/en_GB.utf8/LC_MESSAGES/messages.pot + + +msgfmt -o locale/fr_FR.utf8/LC_MESSAGES/messages.mo locale/fr_FR.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/ja_JP.utf8/LC_MESSAGES/messages.mo locale/ja_JP.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/nl_NL.utf8/LC_MESSAGES/messages.mo locale/nl_NL.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/pl_PL.utf8/LC_MESSAGES/messages.mo locale/pl_PL.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/pt_BR.utf8/LC_MESSAGES/messages.mo locale/pt_BR.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/pt_PT.utf8/LC_MESSAGES/messages.mo locale/pt_PT.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/ru_RU.utf8/LC_MESSAGES/messages.mo locale/ru_RU.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/sv_SE.utf8/LC_MESSAGES/messages.mo locale/sv_SE.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/en_US.utf8/LC_MESSAGES/messages.mo locale/en_US.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/zh_CN.utf8/LC_MESSAGES/messages.mo locale/zh_CN.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/tr_TR.utf8/LC_MESSAGES/messages.mo locale/tr_TR.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/es_ES.utf8/LC_MESSAGES/messages.mo locale/es_ES.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/de_DE.utf8/LC_MESSAGES/messages.mo locale/de_DE.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/it_IT.utf8/LC_MESSAGES/messages.mo locale/it_IT.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/id_ID.utf8/LC_MESSAGES/messages.mo locale/id_ID.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/cs_CZ.utf8/LC_MESSAGES/messages.mo locale/cs_CZ.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/el_GR.utf8/LC_MESSAGES/messages.mo locale/el_GR.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/fa_IR.utf8/LC_MESSAGES/messages.mo locale/fa_IR.utf8/LC_MESSAGES/messages.po +msgfmt -o locale/hu_HU.utf8/LC_MESSAGES/messages.mo locale/hu_HU.utf8/LC_MESSAGES/messages.po + +echo "SET FOREIGN_KEY_CHECKS = 0;" > $BASE_DIR/sql/mysql/weberp-new.sql + +mysqldump -u$MYSQL_USER -p$MYSQL_PWD --skip-opt --create-options --skip-set-charset --no-data weberpdemo >> $BASE_DIR/sql/mysql/weberp-new.sql + +mysqldump -u$MYSQL_USER -p$MYSQL_PWD --skip-opt --skip-set-charset --quick --no-create-info weberpdemo \ + accountgroups \ + bankaccounts \ + chartmaster \ + companies \ + cogsglpostings \ + currencies \ + holdreasons \ + locations \ + paymentterms \ + salesglpostings \ + systypes \ + taxauthorities \ + taxgroups \ + taxauthrates \ + taxcategories \ + taxprovinces \ + www_users \ + edi_orders_segs \ + edi_orders_seg_groups \ + config \ + unitsofmeasure \ + paymentmethods \ + securitygroups \ + securitytokens \ + securityroles \ + accountsection \ + > $BASE_DIR/sql/mysql/weberp-base.sql + +mysqldump -u$MYSQL_USER -p$MYSQL_PWD --skip-opt --skip-set-charset --quick --no-create-info weberpdemo > $BASE_DIR/sql/mysql/weberp-demo_data.sql + +rm $BASE_DIR/sql/mysql/weberp-demo.sql +echo "CREATE DATABASE weberpdemo;" > $BASE_DIR/sql/mysql/weberp-demo.sql +echo "USE weberpdemo;" >> $BASE_DIR/sql/mysql/weberp-demo.sql + +cat $BASE_DIR/sql/mysql/weberp-new.sql >> $BASE_DIR/sql/mysql/weberp-demo.sql + +cat $BASE_DIR/sql/mysql/weberp-base.sql >> $BASE_DIR/sql/mysql/weberp-new.sql +cat $BASE_DIR/sql/mysql/weberp-demo_data.sql >> $BASE_DIR/sql/mysql/weberp-demo.sql +rm $BASE_DIR/sql/mysql/weberp-demo_data.sql +rm $BASE_DIR/sql/mysql/weberp-base.sql + +# echo "CREATE SCHEMA IF NOT EXISTS weberp DEFAULT CHARACTER SET latin1 DEFAULT COLLATE latin1_swedish_ci;" >> /home/tim/workspace/webERP/sql/mysql/weberp-new.sql +echo "SET FOREIGN_KEY_CHECKS = 1;" >> $BASE_DIR/sql/mysql/weberp-new.sql +echo "UPDATE systypes SET typeno=0;" >> $BASE_DIR/sql/mysql/weberp-new.sql +echo "INSERT INTO shippers VALUES (1,'Default Shipper',0);" >> $BASE_DIR/sql/mysql/weberp-new.sql +echo "UPDATE config SET confvalue='1' WHERE confname='Default_Shipper';" >> $BASE_DIR/sql/mysql/weberp-new.sql + +# echo "CREATE SCHEMA IF NOT EXISTS weberpdemo DEFAULT CHARACTER SET latin1 DEFAULT COLLATE latin1_swedish_ci;" >> /home/tim/workspace/webERP/sql/mysql/weberp-demo.sql +echo "SET FOREIGN_KEY_CHECKS = 1;" >> $BASE_DIR/sql/mysql/weberp-demo.sql + +rm $OUTPUT_DIR/webERP.zip + +cd .. + +zip -r $OUTPUT_DIR/webERP webERP -x \*.svn* Added: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Property changes on: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po (rev 0) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2009-12-28 02:24:43 UTC (rev 3260) @@ -0,0 +1,30870 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: webERP 3.08\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-12-28 14:43+1200\n" +"PO-Revision-Date: 2008-03-19 14:54+0100\n" +"Last-Translator: Milan Horák <str...@ti...>\n" +"Language-Team: Czech <cs...@li...>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Czech\n" +"X-Poedit-Country: CZECH REPUBLIC\n" +"X-Poedit-SourceCharset: utf-8\n" + +#: AccountGroups.php:9 index.php:1156 +msgid "Account Groups" +msgstr "Účetní skupiny" + +#: AccountGroups.php:19 +msgid "" +"An error occurred in retrieving the account groups of the parent account " +"group during the check for recursion" +msgstr "" +"Při rekurzivní kontrole došlo k chybě při získávání účetních skupin " +"rodičovské účetní skupiny" + +#: AccountGroups.php:20 +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 příkaz použitý při získávání účetních skupin rodičovské účetní skupiny " +"byl" + +#: AccountGroups.php:57 AccountGroups.php:94 AccountGroups.php:177 +#: AccountGroups.php:187 +#, fuzzy +msgid "The SQL that was used to retrieve the information was" +msgstr "" +"SQL příkaz použitý při získávání účetních skupin rodičovské účetní skupiny " +"byl" + +#: AccountGroups.php:58 +#, fuzzy +msgid "Could not check whether the group exists because" +msgstr "Nemohu získat účetní skupiny, protože" + +#: AccountGroups.php:65 +#, fuzzy +msgid "The account group name already exists in the database" +msgstr "Název účetní skupiny nemůže obsahovat znak" + +#: AccountGroups.php:71 +msgid "The account group name cannot contain the character" +msgstr "Název účetní skupiny nemůže obsahovat znak" + +#: AccountGroups.php:71 AccountSections.php:75 PaymentMethods.php:38 +#: TaxCategories.php:30 TaxProvinces.php:30 UnitsOfMeasure.php:30 +msgid "or the character" +msgstr "nebo znak" + +#: AccountGroups.php:77 +msgid "The account group name must be at least one character long" +msgstr "Název účetní skupiny musí být dlouhý minimálně jeden znak" + +#: AccountGroups.php:84 +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:95 +#, fuzzy +msgid "Could not check whether the group is recursive because" +msgstr "Nemohu získat účetní skupiny, protože" + +#: AccountGroups.php:107 +msgid "The section in accounts must be an integer" +msgstr "Sekce v účtech musí být celé kladné číslo" + +#: AccountGroups.php:113 +msgid "The sequence in the trial balance must be an integer" +msgstr "" + +#: AccountGroups.php:119 +#, fuzzy +msgid "The sequence in the TB must be numeric and less than" +msgstr "Směnný kurs musí být číslo" + +#: AccountGroups.php:136 +msgid "An error occurred in updating the account group" +msgstr "" + +#: AccountGroups.php:137 +#, fuzzy +msgid "The SQL that was used to update the account group was" +msgstr "" +"SQL příkaz použitý při získávání účetních skupin rodičovské účetní skupiny " +"byl" + +#: AccountGroups.php:139 AccountSections.php:106 PaymentMethods.php:88 +msgid "Record Updated" +msgstr "Záznam aktualizován" + +#: AccountGroups.php:157 +msgid "An error occurred in inserting the account group" +msgstr "" + +#: AccountGroups.php:158 +#, fuzzy +msgid "The SQL that was used to insert the account group was" +msgstr "" +"SQL příkaz použitý při získávání účetních skupin rodičovské účetní skupiny " +"byl" + +#: AccountGroups.php:159 AccountSections.php:118 PaymentMethods.php:110 +msgid "Record inserted" +msgstr "Záznam vložen" + +#: AccountGroups.php:176 +#, fuzzy +msgid "An error occurred in retrieving the group information from chartmaster" +msgstr "" +"Při rekurzivní kontrole došlo k chybě při získávání účetních skupin " +"rodičovské účetní skupiny" + +#: AccountGroups.php:181 +msgid "" +"Cannot delete this account group because general ledger accounts have been " +"created using this group" +msgstr "" + +#: AccountGroups.php:182 AccountGroups.php:192 AccountSections.php:139 +#: Areas.php:117 Areas.php:126 BankAccounts.php:163 CreditStatus.php:124 +#: Currencies.php:142 Currencies.php:150 Currencies.php:157 +#: CustomerBranches.php:294 CustomerBranches.php:304 CustomerBranches.php:314 +#: CustomerBranches.php:324 Customers.php:291 Customers.php:300 +#: Customers.php:308 Customers.php:316 CustomerTypes.php:151 +#: CustomerTypes.php:161 Factors.php:107 FixedAssetCategories.php:175 +#: FixedAssetItems.php:483 FixedAssetItems.php:492 FixedAssetItems.php:500 +#: FixedAssetItems.php:508 FixedAssetItems.php:516 FixedAssetItems.php:524 +#: GLAccounts.php:91 GLAccounts.php:105 Locations.php:218 Locations.php:226 +#: Locations.php:235 Locations.php:243 Locations.php:251 Locations.php:259 +#: Locations.php:267 Locations.php:275 MRPDemandTypes.php:85 +#: PaymentMethods.php:142 PaymentTerms.php:149 PaymentTerms.php:156 +#: 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 "Jsou zde" + +#: AccountGroups.php:182 +msgid "general ledger accounts that refer to this account group" +msgstr "" + +#: AccountGroups.php:186 +#, fuzzy +msgid "An error occurred in retrieving the parent group information" +msgstr "" +"Při rekurzivní kontrole došlo k chybě při získávání účetních skupin " +"rodičovské účetní skupiny" + +#: AccountGroups.php:191 +msgid "" +"Cannot delete this account group because it is a parent account group of " +"other account group(s)" +msgstr "" + +#: AccountGroups.php:192 +msgid "account groups that have this group as its/there parent account group" +msgstr "" + +#: AccountGroups.php:195 +msgid "An error occurred in deleting the account group" +msgstr "" + +#: AccountGroups.php:196 +#, fuzzy +msgid "The SQL that was used to delete the account group was" +msgstr "" +"SQL příkaz použitý při získávání účetních skupin rodičovské účetní skupiny " +"byl" + +#: AccountGroups.php:198 +msgid "group has been deleted" +msgstr "skupina byla smazána" + +#: AccountGroups.php:223 +#, fuzzy +msgid "The sql that was used to retrieve the account group information was " +msgstr "" +"SQL příkaz použitý při získávání účetních skupin rodičovské účetní skupiny " +"byl" + +#: AccountGroups.php:224 +msgid "Could not get account groups because" +msgstr "Nemohu získat účetní skupiny, protože" + +#: AccountGroups.php:226 AccountSections.php:177 AddCustomerContacts.php:21 +#: AgedDebtors.php:467 AgedSuppliers.php:276 BOMListing.php:128 BOMs.php:214 +#: BOMs.php:801 DiscountCategories.php:12 DiscountCategories.php:119 +#: DiscountMatrix.php:18 Factors.php:7 FixedAssetJournal.php:335 +#: FixedAssetLocations.php:10 FixedAssetRegister.php:12 +#: FixedAssetTransfer.php:32 GLBalanceSheet.php:349 GLBudgets.php:30 +#: GLJournal.php:237 PO_AuthorisationLevels.php:12 +#: PO_SelectOSPurchOrder.php:141 PurchData.php:133 PurchData.php:218 +#: SelectCompletedOrder.php:13 SelectCustomer.php:331 SelectGLAccount.php:19 +#: SelectGLAccount.php:87 SelectOrderItems.php:607 SelectOrderItems.php:1352 +#: SelectOrderItems.php:1472 SelectProduct.php:55 SelectSalesOrder.php:159 +#: SelectSupplier.php:12 SelectSupplier.php:227 SelectWorkOrder.php:11 +#: SelectWorkOrder.php:154 Suppliers.php:306 TaxGroups.php:16 TopItems.php:57 +#: WhereUsedInquiry.php:18 WorkCentres.php:111 WorkCentres.php:158 +#: WorkOrderEntry.php:11 WWW_Users.php:37 +msgid "Search" +msgstr "" + +#: AccountGroups.php:230 +msgid "Group Name" +msgstr "Název skupiny" + +#: AccountGroups.php:231 EDIMessageFormat.php:141 +msgid "Section" +msgstr "Sekce" + +#: AccountGroups.php:232 AccountGroups.php:389 +msgid "Sequence In TB" +msgstr "" + +#: AccountGroups.php:233 AccountGroups.php:373 GLProfit_Loss.php:8 +#: GLProfit_Loss.php:104 GLProfit_Loss.php:105 GLProfit_Loss.php:156 +#: SelectGLAccount.php:53 SelectGLAccount.php:67 +msgid "Profit and Loss" +msgstr "Zisky a ztráty" + +#: AccountGroups.php:234 AccountGroups.php:334 +msgid "Parent Group" +msgstr "Rodičovská skupina" + +#: AccountGroups.php:250 AccountGroups.php:253 AccountGroups.php:377 +#: AccountGroups.php:379 BankAccounts.php:217 BankAccounts.php:360 +#: BankAccounts.php:362 BankAccounts.php:366 BOMs.php:128 BOMs.php:712 +#: BOMs.php:714 CompanyPreferences.php:437 CompanyPreferences.php:439 +#: CompanyPreferences.php:449 CompanyPreferences.php:451 +#: CompanyPreferences.php:461 CompanyPreferences.php:463 +#: CustLoginSetup.php:574 CustLoginSetup.php:576 CustomerBranches.php:407 +#: Customers.php:563 Customers.php:804 Customers.php:811 Customers.php:814 +#: DeliveryDetails.php:967 DeliveryDetails.php:1007 DeliveryDetails.php:1010 +#: GLTransInquiry.php:72 Locations.php:342 MRPCalendar.php:218 MRP.php:543 +#: MRP.php:547 MRP.php:551 PaymentMethods.php:198 PaymentMethods.php:199 +#: PaymentMethods.php:258 PaymentMethods.php:264 PDFChequeListing.php:59 +#: PDFDeliveryDifferences.php:60 PDFDIFOT.php:63 PO_AuthorisationLevels.php:95 +#: PO_Header.php:908 PO_PDFPurchOrder.php:356 PO_PDFPurchOrder.php:359 +#: PurchData.php:177 PurchData.php:446 PurchData.php:449 +#: 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:733 ShipmentCosting.php:612 +#: Stocks.php:837 Stocks.php:839 Stocks.php:857 Stocks.php:859 +#: SystemParameters.php:361 SystemParameters.php:437 SystemParameters.php:445 +#: SystemParameters.php:485 SystemParameters.php:558 SystemParameters.php:566 +#: SystemParameters.php:584 SystemParameters.php:591 SystemParameters.php:715 +#: SystemParameters.php:846 SystemParameters.php:848 SystemParameters.php:858 +#: SystemParameters.php:860 SystemParameters.php:914 SystemParameters.php:926 +#: SystemParameters.php:928 TaxGroups.php:291 TaxGroups.php:294 +#: TaxGroups.php:343 WWW_Users.php:592 WWW_Users.php:594 +msgid "Yes" +msgstr "Ano" + +#: AccountGroups.php:256 AccountGroups.php:382 AccountGroups.php:384 +#: BankAccounts.php:215 BankAccounts.php:360 BankAccounts.php:362 +#: BankAccounts.php:366 BOMs.php:130 BOMs.php:711 BOMs.php:715 +#: CompanyPreferences.php:436 CompanyPreferences.php:440 +#: CompanyPreferences.php:448 CompanyPreferences.php:452 +#: CompanyPreferences.php:460 CompanyPreferences.php:464 +#: CustLoginSetup.php:573 CustLoginSetup.php:577 CustomerBranches.php:407 +#: Customers.php:562 Customers.php:802 Customers.php:810 Customers.php:813 +#: DeliveryDetails.php:968 DeliveryDetails.php:1008 DeliveryDetails.php:1011 +#: GLTransInquiry.php:126 Locations.php:344 MRPCalendar.php:220 MRP.php:537 +#: MRP.php:541 MRP.php:545 MRP.php:549 PaymentMethods.php:198 +#: PaymentMethods.php:199 PaymentMethods.php:259 PaymentMethods.php:265 +#: PDFChequeListing.php:58 PDFDeliveryDifferences.php:59 PDFDIFOT.php:62 +#: PO_AuthorisationLevels.php:97 PO_Header.php:908 PO_PDFPurchOrder.php:357 +#: PO_PDFPurchOrder.php:360 PurchData.php:180 PurchData.php:447 +#: PurchData.php:450 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:736 ShipmentCosting.php:613 +#: Stocks.php:832 Stocks.php:834 Stocks.php:852 Stocks.php:854 +#: SystemParameters.php:362 SystemParameters.php:438 SystemParameters.php:446 +#: SystemParameters.php:486 SystemParameters.php:559 SystemParameters.php:567 +#: SystemParameters.php:585 SystemParameters.php:592 SystemParameters.php:716 +#: SystemParameters.php:845 SystemParameters.php:849 SystemParameters.php:857 +#: SystemParameters.php:861 SystemParameters.php:915 SystemParameters.php:925 +#: SystemParameters.php:929 TaxGroups.php:292 TaxGroups.php:295 +#: TaxGroups.php:345 WWW_Users.php:591 WWW_Users.php:595 +#: includes/PDFLowGPPageHeader.inc:31 includes/PDFTaxPageHeader.inc:35 +msgid "No" +msgstr "Ne" + +#: AccountGroups.php:265 AccountSections.php:197 AddCustomerContacts.php:126 +#: AddCustomerNotes.php:125 AddCustomerTypeNotes.php:122 Areas.php:162 +#: BankAccounts.php:226 BOMs.php:150 COGSGLPostings.php:108 +#: COGSGLPostings.php:213 CreditStatus.php:173 Currencies.php:233 +#: CustLoginSetup.php:297 CustomerBranches.php:411 Customers.php:856 +#: Customers.php:888 CustomerTypes.php:206 EDIMessageFormat.php:162 +#: FixedAssetCategories.php:235 FixedAssetLocations.php:81 +#: FreightCosts.php:242 GeocodeSetup.php:166 GLAccounts.php:318 GLTags.php:59 +#: Locations.php:351 MRPDemands.php:309 MRPDemandTypes.php:117 +#: PaymentMethods.php:200 PaymentTerms.php:204 PO_AuthorisationLevels.php:105 +#: Prices_Customer.php:201 Prices.php:179 PurchData.php:189 +#: SalesCategories.php:261 SalesGLPostings.php:133 SalesGLPostings.php:245 +#: SalesPeople.php:201 SalesTypes.php:204 SelectCustomer.php:688 +#: SelectCustomer.php:704 SelectCustomer.php:736 SelectCustomer.php:752 +#: SelectCustomer.php:783 SelectCustomer.php:799 Shippers.php:142 +#: StockCategories.php:215 SupplierContacts.php:153 TaxAuthorities.php:164 +#: TaxCategories.php:181 TaxGroups.php:179 TaxProvinces.php:176 +#: UnitsOfMeasure.php:199 WorkCentres.php:138 WWW_Access.php:124 +#: WWW_Users.php:304 includes/InputSerialItems.php:82 +#, php-format +msgid "Edit" +msgstr "Upravit" + +#: AccountGroups.php:266 AccountSections.php:201 AddCustomerContacts.php:127 +#: AddCustomerNotes.php:126 AddCustomerTypeNotes.php:123 Areas.php:163 +#: BankAccounts.php:227 BOMs.php:152 COGSGLPostings.php:109 +#: COGSGLPostings.php:214 Credit_Invoice.php:372 CreditStatus.php:174 +#: Currencies.php:236 CustLoginSetup.php:298 CustomerReceipt.php:830 +#: Customers.php:889 CustomerTypes.php:207 DiscountCategories.php:201 +#: DiscountMatrix.php:173 EDIMessageFormat.php:163 +#: FixedAssetCategories.php:236 FixedAssetJournal.php:393 +#: FixedAssetLocations.php:83 FreightCosts.php:243 GeocodeSetup.php:167 +#: GLAccounts.php:319 GLJournal.php:394 Locations.php:352 MRPDemands.php:310 +#: MRPDemandTypes.php:118 PaymentMethods.php:201 Payments.php:861 +#: PaymentTerms.php:205 PO_AuthorisationLevels.php:107 PO_Items.php:961 +#: Prices_Customer.php:202 Prices.php:180 PurchData.php:190 +#: 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:689 +#: SelectCustomer.php:705 SelectCustomer.php:737 SelectCustomer.php:753 +#: SelectCustomer.php:784 SelectCustomer.php:800 SelectOrderItems.php:1286 +#: Shipments.php:422 Shippers.php:143 SpecialOrder.php:587 +#: StockCategories.php:216 StockCategories.php:497 SuppCreditGRNs.php:89 +#: SuppInvGLAnalysis.php:65 SuppInvGRNs.php:129 SupplierContacts.php:154 +#: SuppShiptChgs.php:79 SuppTransGLAnalysis.php:107 TaxAuthorities.php:165 +#: 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:305 includes/InputSerialItemsKeyed.php:53 +#, php-format +msgid "Delete" +msgstr "Smazat" + +#: AccountGroups.php:274 +msgid "Review Account Groups" +msgstr "" + +#: AccountGroups.php:292 +#, fuzzy +msgid "An error occurred in retrieving the account group information" +msgstr "" +"Při rekurzivní kontrole došlo k chybě při získávání účetních skupin " +"rodičovské účetní skupiny" + +#: AccountGroups.php:293 +#, fuzzy +msgid "" +"The SQL that was used to retrieve the account group and that failed in the " +"process was" +msgstr "" +"SQL příkaz použitý při získávání účetních skupin rodičovské účetní skupiny " +"byl" + +#: AccountGroups.php:307 GLAccounts.php:245 GLAccounts.php:298 +#: Z_ImportGLAccountGroups.php:28 +msgid "Account Group" +msgstr "Účetní skupina" + +#: AccountGroups.php:331 +#, fuzzy +msgid "Account Group Name" +msgstr "Název účetní skupiny" + +#: AccountGroups.php:341 AccountGroups.php:343 +msgid "Top Level Group" +msgstr "" + +#: AccountGroups.php:357 +msgid "Section In Accounts" +msgstr "Sekce v účtech" + +#: AccountGroups.php:396 AccountSections.php:263 AddCustomerContacts.php:202 +#: AddCustomerNotes.php:201 AddCustomerTypeNotes.php:184 Areas.php:218 +#: BankAccounts.php:372 BOMs.php:724 COGSGLPostings.php:342 +#: CreditStatus.php:244 Currencies.php:332 CustLoginSetup.php:595 +#: DiscountMatrix.php:136 EDIMessageFormat.php:254 +#: FixedAssetCategories.php:459 FixedAssetLocations.php:127 +#: FreightCosts.php:338 GeocodeSetup.php:262 GLAccounts.php:268 +#: Locations.php:517 MRPDemands.php:425 MRPDemandTypes.php:176 +#: PaymentMethods.php:270 PaymentTerms.php:278 PO_AuthorisationLevels.php:166 +#: Prices_Customer.php:244 SalesAnalReptCols.php:465 SalesAnalRepts.php:494 +#: SalesGLPostings.php:412 SalesPeople.php:292 Shippers.php:195 +#: StockCategories.php:516 SupplierContacts.php:249 TaxAuthorities.php:302 +#: TaxCategories.php:231 TaxProvinces.php:226 UnitsOfMeasure.php:250 +#: WorkCentres.php:260 WWW_Users.php:625 +msgid "Enter Information" +msgstr "Vložit informace" + +#: AccountSections.php:9 index.php:1161 +msgid "Account Sections" +msgstr "Sekce účtu" + +#: AccountSections.php:68 +#, fuzzy +msgid "The account section already exists in the database" +msgstr "Název sekce účtu nemůže obsahovat znak" + +#: AccountSections.php:75 +msgid "The account section name cannot contain the character" +msgstr "Název sekce účtu nemůže obsahovat znak" + +#: AccountSections.php:81 +#, fuzzy +msgid "The account section name must contain at least one character" +msgstr "Název sekce účtu nemůže obsahovat znak" + +#: AccountSections.php:87 AccountSections.php:93 +msgid "The section number must be an integer" +msgstr "Číslo sekce musí být celé kladné číslo" + +#: AccountSections.php:138 +msgid "" +"Cannot delete this account section because general ledger accounts groups " +"have been created using this section" +msgstr "" + +#: AccountSections.php:139 +msgid "general ledger accounts groups that refer to this account section" +msgstr "" + +#: AccountSections.php:150 +msgid "section has been deleted" +msgstr "sekce byla smazána" + +#: AccountSections.php:175 +msgid "Could not get account group sections because" +msgstr "" + +#: AccountSections.php:181 AccountSections.php:239 AccountSections.php:256 +msgid "Section Number" +msgstr "Číslo sekce" + +#: AccountSections.php:182 AccountSections.php:259 +msgid "Section Description" +msgstr "Popis sekce" + +#: AccountSections.php:199 +msgid "Restricted" +msgstr "" + +#: AccountSections.php:210 +msgid "Review Account Sections" +msgstr "" + +#: AccountSections.php:229 +msgid "Could not retrieve the requested section please try again." +msgstr "" + +#: AddCustomerContacts.php:6 AddCustomerContacts.php:50 SelectCustomer.php:681 +#: SelectCustomer.php:721 +#, fuzzy +msgid "Customer Contacts" +msgstr "Kód zákazníka" + +#: AddCustomerContacts.php:20 CustEDISetup.php:11 CustLoginSetup.php:21 +#: Z_CheckDebtorsControl.php:20 +msgid "Back to Customers" +msgstr "Zpět k zákazníkům" + +#: AddCustomerContacts.php:32 +#, fuzzy +msgid "The Contact must be an integer." +msgstr "Sekce v účtech musí být celé kladné číslo" + +#: AddCustomerContacts.php:35 +#, fuzzy +msgid "The contact's name must be forty characters or less long" +msgstr "Název měny může být dlouhý maximálně 20 znaků" + +#: AddCustomerContacts.php:38 +#, fuzzy +msgid "The contact's name may not be empty" +msgstr "Kód dlužníka nemůže být prázdný" + +#: AddCustomerContacts.php:50 AddCustomerNotes.php:49 +#: AddCustomerTypeNotes.php:49 Areas.php:74 CustomerTypes.php:68 +#: DeliveryDetails.php:673 Factors.php:47 FixedAssetItems.php:351 +#: PO_Items.php:391 SalesAnalReptCols.php:128 SalesPeople.php:92 +#: SalesTypes.php:61 Stocks.php:353 Suppliers.php:482 +msgid "has been updated" +msgstr "" + +#: AddCustomerContacts.php:61 +msgid "The contact record has been added" +msgstr "" + +#: AddCustomerContacts.php:88 +#, fuzzy +msgid "The contact record has been deleted" +msgstr "sekce byla smazána" + +#: AddCustomerContacts.php:98 +#, fuzzy +msgid "Contacts for Customer: <b>" +msgstr "Kontaktní telefonní číslo" + +#: AddCustomerContacts.php:107 CompanyPreferences.php:227 +#: CustomerBranches.php:374 Customers.php:846 Customers.php:852 +#: Customers.php:917 SalesPeople.php:183 SelectCustomer.php:684 +#: StockDispatch.php:181 StockDispatch.php:193 SuppInvGLAnalysis.php:49 +#: SuppInvGLAnalysis.php:73 SupplierContacts.php:141 SupplierCredit.php:304 +#: SupplierInvoice.php:308 SuppTransGLAnalysis.php:91 +#: includes/InputSerialItemsFile.php:84 includes/InputSerialItemsFile.php:124 +#: includes/PDFTaxPageHeader.inc:37 +msgid "Name" +msgstr "Název" + +#: AddCustomerContacts.php:108 AddCustomerContacts.php:184 Customers.php:847 +#: Customers.php:853 Customers.php:918 SelectCustomer.php:685 +#: WWW_Access.php:108 WWW_Access.php:168 +msgid "Role" +msgstr "" + +#: AddCustomerContacts.php:109 Customers.php:919 +#, fuzzy +msgid "Phone no" +msgstr "Telefon" + +#: AddCustomerContacts.php:110 AddCustomerContacts.php:196 Customers.php:849 +#: Customers.php:855 Customers.php:920 SelectCustomer.php:687 +#: SystemParameters.php:301 WOSerialNos.php:273 WOSerialNos.php:275 +msgid "Notes" +msgstr "" + +#: AddCustomerContacts.php:144 +msgid "Review all contacts for this Customer" +msgstr "" + +#: AddCustomerContacts.php:173 +#, fuzzy +msgid "Contact Code" +msgstr "Kontakt" + +#: AddCustomerContacts.php:178 Factors.php:180 Factors.php:195 +#: SupplierContacts.php:217 +msgid "Contact Name" +msgstr "" + +#: AddCustomerContacts.php:190 PDFRemittanceAdvice.php:248 PO_Header.php:1113 +#: PO_Header.php:1188 SelectCreditItems.php:234 SelectCustomer.php:504 +#: SelectOrderItems.php:637 includes/PDFStatementPageHeader.inc:63 +#: includes/PDFTransPageHeader.inc:82 +#: includes/PDFTransPageHeaderPortrait.inc:105 +msgid "Phone" +msgstr "Telefon" + +#: AddCustomerNotes.php:6 AddCustomerNotes.php:49 SelectCustomer.php:729 +#: SelectCustomer.php:768 +#, fuzzy +msgid "Customer Notes" +msgstr "Kód zákazníka" + +#: AddCustomerNotes.php:20 AddCustomerTypeNotes.php:20 +#, fuzzy +msgid "Back to Select Customer" +msgstr "Zpět k zákazníkům" + +#: AddCustomerNotes.php:31 +#, fuzzy +msgid "The contact priority must be an integer." +msgstr "Sekce v účtech musí být celé kladné číslo" + +#: AddCustomerNotes.php:34 AddCustomerTypeNotes.php:34 +#, fuzzy +msgid "The contact's notes must be two hundred characters or less long" +msgstr "Název měny může být dlouhý maximálně 20 znaků" + +#: AddCustomerNotes.php:37 AddCustomerTypeNotes.php:37 +#, fuzzy +msgid "The contact's notes may not be empty" +msgstr "Kód dlužníka nemůže být prázdný" + +#: AddCustomerNotes.php:60 +#, fuzzy +msgid "The contact notes record has been added" +msgstr "sekce byla smazána" + +#: AddCustomerNotes.php:87 +#, fuzzy +msgid "The contact note record has been deleted" +msgstr "sekce byla smazána" + +#: AddCustomerNotes.php:97 +#, fuzzy +msgid "Notes for Customer: <b>" +msgstr "Kontaktní telefonní číslo" + +#: AddCustomerNotes.php:106 AddCustomerNotes.php:188 +#: AddCustomerTypeNotes.php:103 AddCustomerTypeNotes.php:178 +#: BankMatching.php:214 BankReconciliation.php:182 BankReconciliation.php:254 +#: CustomerAllocations.php:348 CustomerAllocations.php:374 +#: CustomerInquiry.php:190 CustomerTransInquiry.php:86 +#: GLAccountInquiry.php:157 GLTransInquiry.php:47 MRPCalendar.php:213 +#: PaymentAllocations.php:77 PDFRemittanceAdvice.php:309 +#: PrintCustTrans.php:846 PrintCustTransPortrait.php:910 ReverseGRN.php:329 +#: ShipmentCosting.php:494 ShipmentCosting.php:565 Shipments.php:463 +#: StockDispatch.php:183 StockDispatch.php:195 StockLocMovements.php:80 +#: StockMovements.php:98 StockSerialItemResearch.php:74 +#: SupplierAllocations.php:465 SupplierAllocations.php:577 +#: SupplierAllocations.php:647 SupplierInquiry.php:192 +#: SupplierTransInquiry.php:87 includes/PDFQuotationPageHeader.inc:91 +#: includes/PDFStatementPageHeader.inc:169 includes/PDFTaxPageHeader.inc:36 +#: includes/PDFTransPageHeader.inc:49 +#: includes/PDFTransPageHeaderPortrait.inc:58 +msgid "Date" +msgstr "Datum" + +#: AddCustomerNotes.php:107 AddCustomerTypeNotes.php:104 Stocks.php:841 +#: Z_Upgrade_3.10-3.11.php:61 Z_Upgrade_3.10-3.11.php:65 +#: Z_Upgrade_3.10-3.11.php:69 Z_Upgrade_3.10-3.11.php:73 +#: Z_Upgrade_3.10-3.11.php:77 +msgid "Note" +msgstr "" + +#: AddCustomerNotes.php:108 AddCustomerNotes.php:182 +msgid "WWW" +msgstr "" + +#: AddCustomerNotes.php:109 AddCustomerNotes.php:194 +#: AddCustomerTypeNotes.php:106 AddCustomerTypeNotes.php:181 +msgid "Priority" +msgstr "" + +#: AddCustomerNotes.php:143 +#, fuzzy +msgid "Review all notes for this Customer" +msgstr "Zvláštní ceny pro zákazníka" + +#: AddCustomerNotes.php:171 AddCustomerTypeNotes.php:169 +#, fuzzy +msgid "Note ID" +msgstr "Poznámka" + +#: AddCustomerNotes.php:176 +#, fuzzy +msgid "Contact Note" +msgstr "Kontakt" + +#: AddCustomerTypeNotes.php:6 SelectCustomer.php:776 +#, fuzzy +msgid "Customer Type (Group) Notes" +msgstr "Zákazník aktualizován" + +#: AddCustomerTypeNotes.php:31 +#, fuzzy +msgid "The Contact priority must be an integer." +msgstr "Sekce v účtech musí být celé kladné číslo" + +#: AddCustomerTypeNotes.php:49 SelectCustomer.php:816 +#, fuzzy +msgid "Customer Group Notes" +msgstr "Zákazník aktualizován" + +#: AddCustomerTypeNotes.php:60 +#, fuzzy +msgid "The contact group notes record has been added" +msgstr "sekce byla smazána" + +#: AddCustomerTypeNotes.php:84 +#, fuzzy +msgid "The contact group note record has been deleted" +msgstr "sekce byla smazána" + +#: AddCustomerTypeNotes.php:94 +#, fuzzy +msgid "Notes for Customer Type: <b>" +msgstr "Kontaktní telefonní číslo" + +#: AddCustomerTypeNotes.php:105 AddCustomerTypeNotes.php:176 +msgid "href" +msgstr "" + +#: AddCustomerTypeNotes.php:140 +msgid "Review all notes for this Customer Type" +msgstr "" + +#: AddCustomerTypeNotes.php:174 +#, fuzzy +msgid "Contact Group Note" +msgstr "Název účetní skupiny" + +#: AgedDebtors.php:17 +msgid "Aged Customer Balance Listing" +msgstr "" + +#: AgedDebtors.php:18 +msgid "Aged Customer Balances" +msgstr "" + +#: AgedDebtors.php:267 AgedDebtors.php:365 AgedDebtors.php:436 +msgid "Aged Customer Account Analysis" +msgstr "" + +#: AgedDebtors.php:267 AgedDebtors.php:365 AgedDebtors.php:436 +#: AgedSuppliers.php:105 BOMExtendedQty.php:156 BOMIndented.php:149 +#: BOMIndentedReverse.php:148 BOMListing.php:48 BOMListing.php:59 +#: DebtorsAtPeriodEnd.php:58 DebtorsAtPeriodEnd.php:70 GLBalanceSheet.php:88 +#: GLBalanceSheet.php:126 GLProfit_Loss.php:156 GLTagProfit_Loss.php:167 +#: GLTrialBalance.php:140 InventoryPlanning.php:97 InventoryPlanning.php:172 +#: InventoryPlanning.php:207 InventoryPlanning.php:250 +#: InventoryPlanning.php:284 InventoryPlanningPrefSupplier.php:208 +#: InventoryPlanningPrefSupplier.php:276 InventoryPlanningPrefSupplier.php:310 +#: InventoryPlanningPrefSupplier.php:353 InventoryPlanningPrefSupplier.php:387 +#: InventoryQuantities.php:81 InventoryValuation.php:76 +#: MailInventoryValuation.php:115 MRPPlannedPurchaseOrders.php:100 +#: MRPPlannedWorkOrders.php:103 MRPReport.php:133 MRPReschedules.php:35 +#: MRPReschedules.php:47 MRPShortages.php:112 MRPShortages.php:124 +#: OutstandingGRNs.php:51 OutstandingGRNs.php:63 PDFCustomerList.php:20 +#: PDFCustomerList.php:232 PDFCustomerList.php:244 PDFLowGP.php:23 +#: PDFStockCheckComparison.php:35 PDFStockCheckComparison.php:61 +#: PDFStockCheckComparison.php:262 ReorderLevel.php:57 SelectProduct.php:48 +#: StockCheck.php:63 StockCheck.php:135 SuppPriceList.php:118 +#: includes/PDFPaymentRun_PymtFooter.php:146 +msgid "Problem Report" +msgstr "Problém" + +#: AgedDebtors.php:269 CustomerInquiry.php:87 CustomerInquiry.php:108 +#: DebtorsAtPeriodEnd.php:60 +msgid "The customer details could not be retrieved by the SQL because" +msgstr "" + +#: AgedDebtors.php:270 AgedDebtors.php:368 AgedDebtors.php:442 +#: AgedSuppliers.php:108 AgedSuppliers.php:190 BOMExtendedQty.php:159 +#: BOMExtendedQty.php:263 BOMIndented.php:152 BOMIndented.php:238 +#: BOMIndentedReverse.php:151 BOMIndentedReverse.php:235 BOMListing.php:51 +#: Credit_Invoice.php:186 DebtorsAtPeriodEnd.php:61 DebtorsAtPeriodEnd.php:73 +#: FTP_RadioBeacon.php:188 GetStockImage.php:154 GLBalanceSheet.php:91 +#: GLBalanceSheet.php:129 GLBalanceSheet.php:292 GLProfit_Loss.php:159 +#: GLProfit_Loss.php:171 GLTagProfit_Loss.php:170 GLTagProfit_Loss.php:182 +#: GLTrialBalance.php:143 GLTrialBalance.php:155 InventoryPlanning.php:100 +#: InventoryPlanning.php:175 InventoryPlanning.php:210 +#: InventoryPlanning.php:253 InventoryPlanning.php:287 +#: InventoryPlanning.php:350 InventoryPlanningPrefSupplier.php:211 +#: InventoryPlanningPrefSupplier.php:279 InventoryPlanningPrefSupplier.php:313 +#: InventoryPlanningPrefSupplier.php:356 InventoryPlanningPrefSupplier.php:390 +#: InventoryPlanningPrefSupplier.php:446 InventoryQuantities.php:84 +#: InventoryQuantities.php:95 InventoryValuation.php:79 +#: InventoryValuation.php:90 MailInventoryValuation.php:118 +#: MailInventoryValuation.php:214 MRPPlannedPurchaseOrders.php:103 +#: MRPPlannedPurchaseOrders.php:114 MRPPlannedWorkOrders.php:106 +#: MRPPlannedWorkOrders.php:117 MRPReport.php:36 MRPReport.php:47 +#: MRPReport.php:136 MRPReschedules.php:38 MRPReschedules.php:50 +#: MRPShortages.php:115 MRPShortages.php:127 OutstandingGRNs.php:54 +#: OutstandingGRNs.php:66 PDFCustomerList.php:235 PDFCustomerList.php:247 +#: PDFGrn.php:63 PDFLowGP.php:62 PDFLowGP.php:74 PDFPriceList.php:106 +#: PDFPriceList.php:189 PDFQuotation.php:235 PDFRemittanceAdvice.php:76 +#: PDFStockCheckComparison.php:39 PDFStockCheckComparison.php:65 +#: PDFStockCheckComparison.php:266 PDFTopItems.php:161 PO_PDFPurchOrder.php:27 +#: PO_PDFPurchOrder.php:135 PrintCustOrder_generic.php:182 +#: PrintCustOrder.php:198 PrintSalesOrder_generic.php:183 ReorderLevel.php:60 +#: ReorderLevel.php:149 SalesAnalysis_UserDefined.php:37 +#: SelectCreditItems.php:25 StockCheck.php:45 StockCheck.php:66 +#: StockCheck.php:95 StockCheck.php:138 StockCheck.php:149 StockCheck.php:190 +#: StockDispatch.php:89 StockDispatch.php:100 SupplierBalsAtPeriodEnd.php:57 +#: SupplierBalsAtPeriodEnd.php:68 SuppPaymentRun.php:109 +#: SuppPaymentRun.php:120 SuppPaymentRun.php:184 SuppPaymentRun.php:214 +#: SuppPriceList.php:121 Tax.php:64 Tax.php:177 Tax.php:286 +#: 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:37 +#: includes/PDFPaymentRun_PymtFooter.php:55 +#: includes/PDFPaymentRun_PymtFooter.php:84 +#: includes/PDFPaymentRun_PymtFooter.php:113 +#: includes/PDFPaymentRun_PymtFooter.php:149 +#: includes/PDFPaymentRun_PymtFooter.php:180 +#: includes/PDFPaymentRun_PymtFooter.php:212 +#: includes/ConstructSQLForUserDefinedSalesReport.inc:180 +#: includes/ConstructSQLForUserDefinedSalesReport.inc:188 +#: includes/ConstructSQLForUserDefinedSalesReport.inc:340 +msgid "Back to the menu" +msgstr "Zpět do menu" + +#: AgedDebtors.php:367 +msgid "The details of outstanding transactions for customer" +msgstr "" + +#: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountInquiry.php:149 +#: PO_Items.php:546 PO_Items.php:576 PO_Items.php:656 PO_Items.php:794 +#: SalesAnalReptCols.php:349 SpecialOrder.php:368 +#: StockLocTransferReceive.php:370 StockQuantityByDate.php:102 +#: includes/SelectOrderItems_IntoCart.inc:52 +msgid "could not be retrieved because" +msgstr "" + +#: AgedDebtors.php:370 AgedSuppliers.php:192 Areas.php:96 +#: ConfirmDispatch_Invoice.php:154 ConfirmDispatch_Invoice.php:914 +#: ConfirmDispatch_Invoice.php:928 Credit_Invoice.php:686 +#: Credit_Invoice.php:708 CustomerReceipt.php:491 CustomerReceipt.php:632 +#: CustomerReceipt.php:660 CustomerTransInquiry.php:78 DeliveryDetails.php:397 +#: GLProfit_Loss.php:539 GLTagProfit_Loss.php:480 Payments.php:294 +#: PDFRemittanceAdvice.php:78 PurchData.php:83 PurchData.php:101 +#: PurchData.php:206 ReverseGRN.php:142 ReverseGRN.php:156 ReverseGRN.php:317 +#: SelectCreditItems.php:1393 StockCheck.php:220 StockCostUpdate.php:78 +#: StockCostUpdate.php:88 StockLocStatus.php:144 StockMovements.php:91 +#: StockQuantityByDate.php:78 StockReorderLevel.php:39 StockStatus.php:262 +#: StockTransfers.php:153 StockUsageGraph.php:53 StockUsage.php:124 +#: SupplierInquiry.php:78 SupplierInquiry.php:99 SupplierInquiry.php:129 +#: SupplierInquiry.php:174 SupplierTransInquiry.php:79 SuppPaymentRun.php:111 +#: SuppPaymentRun.php:186 SuppPaymentRun.php:216 WorkOrderCosting.php:391 +#: WorkOrderReceive.php:261 WOSerialNos.php:44 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:86 +#: includes/PDFPaymentRun_PymtFooter.php:115 +#: includes/PDFPaymentRun_PymtFooter.php:151 +#: includes/PDFPaymentRun_PymtFooter.php:182 includes/ConnectDB_mysqli.inc:55 +#: includes/ConnectDB_mysql.inc:38 +msgid "The SQL that failed was" +msgstr "SQL příkaz, který selhal, byl" + +#: AgedDebtors.php:438 +msgid "There are no customers meeting the criteria specified to list" +msgstr "" + +#: AgedDebtors.php:464 +msgid "Aged Debtor Analysis" +msgstr "" + +#: AgedDebtors.php:475 DebtorsAtPeriodEnd.php:143 +msgid "From Customer Code" +msgstr "Od kódu zákazníka" + +#: AgedDebtors.php:476 DebtorsAtPeriodEnd.php:144 +msgid "To Customer Code" +msgstr "Do kódu zákazníka" + +#: AgedDebtors.php:478 AgedSuppliers.php:291 +msgid "All balances or overdues only" +msgstr "" + +#: AgedDebtors.php:479 +msgid "All customers with balances" +msgstr "" + +#: AgedDebtors.php:480 AgedSuppliers.php:294 +msgid "Overdue accounts only" +msgstr "" + +#: AgedDebtors.php:481 +msgid "Held accounts only" +msgstr "" + +#: AgedDebtors.php:484 +msgid "Only Show Customers Of" +msgstr "Zobrazit jen zákazníky" + +#: AgedDebtors.php:496 +msgid "Only show customers trading in" +msgstr "" + +#: AgedDebtors.php:512 +msgid "Summary or detailed report" +msgstr "" + +#: AgedDebtors.php:514 AgedSuppliers.php:314 InventoryValuation.php:235 +msgid "Summary Report" +msgstr "" + +#: AgedDebtors.php:515 AgedSuppliers.php:315 InventoryValuation.php:236 +msgid "Detailed Report" +msgstr "" + +#: AgedDebtors.php:518 AgedSuppliers.php:318 BOMExtendedQty.php:297 +#: BOMIndented.php:275 BOMIndentedReverse.php:263 BOMListing.php:140 +#: DebtorsAtPeriodEnd.php:161 InventoryPlanning.php:429 +#: InventoryPlanningPrefSupplier.php:502 InventoryQuantities.php:186 +#: InventoryValuation.php:239 MRPPlannedPurchaseOrders.php:263 +#: MRPPlannedWorkOrders.php:241 MRPReport.php:512 MRPReschedules.php:150 +#: MRPShortages.php:232 OutstandingGRNs.php:181 PDFCustomerList.php:409 +#: PDFLowGP.php:164 PDFPriceList.php:258 PDFRemittanceAdvice.php:153 +#: PDFStockCheckComparison.php:375 PrintCustTrans.php:618 +#: PrintCustTransPortrait.php:680 ReorderLevel.php:226 StockDispatch.php:293 +#: SupplierBalsAtPeriodEnd.php:148 SuppPriceList.php:231 Tax.php:348 +msgid "Print PDF" +msgstr "Tisknout PDF" + +#: AgedSuppliers.php:18 +msgid "Aged Supplier Listing" +msgstr "" + +#: AgedSuppliers.php:19 +msgid "Aged Suppliers" +msgstr "" + +#: AgedSuppliers.php:105 +msgid "Aged Supplier Account Analysis" +msgstr "" + +#: AgedSuppliers.php:107 SupplierBalsAtPeriodEnd.php:56 +msgid "The Supplier details could not be retrieved by the SQL because" +msgstr "" + +#: AgedSuppliers.php:187 +msgid "Aged Supplier Account Analysis - Problem Report" +msgstr "" + +#: AgedSuppliers.php:189 +msgid "The details of outstanding transactions for Supplier" +msgstr "" + +#: AgedSuppliers.php:273 +msgid "Aged Supplier Analysis" +msgstr "" + +#: AgedSuppliers.php:284 OutstandingGRNs.php:176 PDFRemittanceAdvice.php:139 +#: SupplierBalsAtPeriodEnd.php:125 SuppPaymentRun.php:255 +msgid "From Supplier Code" +msgstr "Od kódu dodavatele" + +#: AgedSuppliers.php:287 OutstandingGRNs.php:178 PDFRemittanceAdvice.php:141 +#: SupplierBalsAtPeriodEnd.php:127 SuppPaymentRun.php:257 +msgid "To Supplier Code" +msgstr "Do kódu dodavatele" + +#: AgedSuppliers.php:293 +msgid "All suppliers with balances" +msgstr "" + +#: AgedSuppliers.php:297 +msgid "For suppliers trading in" +msgstr "" + +#: AgedSuppliers.php:312 InventoryValuation.php:234 +msgid "Summary or Detailed Report" +msgstr "" + +#: Areas.php:8 +msgid "Sales Area Maintenance" +msgstr "Nastavení prodejních míst" + +#: Areas.php:41 +msgid "The area code must be three characters or less long" +msgstr "" + +#: Areas.php:46 +msgid "The area code entered already exists" +msgstr "" + +#: Areas.php:51 +msgid "The area description must be twenty five characters or less long" +msgstr "" + +#: Areas.php:56 +msgid "The area code may not be empty" +msgstr "" + +#: Areas.php:61 +msgid "The area description may not be empty" +msgstr "" + +#: Areas.php:74 +msgid "Area code" +msgstr "" + +#: Areas.php:88 +msgid "New area code" +msgstr "" + +#: Areas.php:88 +msgid "has been inserted" +msgstr "" + +#: Areas.php:95 +msgid "The area could not be added or updated because" +msgstr "" + +#: Areas.php:116 +msgid "" +"Cannot delete this area because customer branches have been created using " +"this area" +msgstr "" + +#: Areas.php:117 +msgid "branches using this area code" +msgstr "" + +#: Areas.php:125 +msgid "" +"Cannot delete this area because sales analysis records exist that use this " +"area" +msgstr "" + +#: Areas.php:126 +msgid "sales analysis records referring this area code" +msgstr "" + +#: Areas.php:133 Areas.php:146 Areas.php:197 Areas.php:208 +msgid "Area Code" +msgstr "" + +#: Areas.php:133 CustomerTypes.php:167 Factors.php:112 +#: FixedAssetCategories.php:192 GLAccounts.php:204 Locations.php:299 +#: SalesAnalReptCols.php:214 SalesCategories.php:137 SalesTypes.php:161 +#: StockCategories.php:170 Suppliers.php:595 Z_DeleteInvoice.php:142 +msgid "has been deleted" +msgstr "" + +#: Areas.php:147 Areas.php:213 +msgid "Area Name" +msgstr "" + +#: Areas.php:173 +msgid "Review Areas Defined" +msgstr "" + +#: AuditTrail.php:9 +msgid "Audit Trail" +msgstr "" + +#: AuditTrail.php:21 +msgid "Incorrect date format used, please re-enter" +msgstr "" + +#: AuditTrail.php:34 BOMIndented.php:314 BOMIndentedReverse.php:302 +#: MRPCalendar.php:251 +#, fuzzy +msgid "From Date" +msgstr "Datum" + +#: AuditTrail.php:36 BOMIndented.php:315 BOMIndentedReverse.php:303 +#: MRPCalendar.php:253 +#, fuzzy +msgid "To Date" +msgstr "Datum" + +#: AuditTrail.php:40 PO_AuthorisationLevels.php:87 +#: PO_AuthorisationLevels.php:116 PO_AuthorisationLevels.php:119 +#: UserSettings.php:114 +msgid "User ID" +msgstr "" + +#: AuditTrail.php:53 +#, fuzzy +msgid "Table " +msgstr "Povoleno" + +#: AuditTrail.php:64 PO_SelectPurchOrder.php:370 +msgid "View" +msgstr "" + +#: AuditTrail.php:141 +#, fuzzy +msgid "Date/Time" +msgstr "Datum" + +#: AuditTrail.php:142 includes/header.inc:42 +msgid "User" +msgstr "" + +#: AuditTrail.php:143 BankReconciliation.php:183 BankReconciliation.php:255 +#: CustomerAllocations.php:372 CustomerInquiry.php:188 +#: CustomerTransInquiry.php:19 CustomerTransInqu... [truncated message content] |
From: <tim...@us...> - 2010-01-02 09:54:42
|
Revision: 3266 http://web-erp.svn.sourceforge.net/web-erp/?rev=3266&view=rev Author: tim_schofield Date: 2010-01-02 09:54:35 +0000 (Sat, 02 Jan 2010) Log Message: ----------- Allow pdf output of the asset register. Modified Paths: -------------- trunk/FixedAssetRegister.php trunk/doc/Change.log.html Added Paths: ----------- trunk/includes/PDFAssetRegisterHeader.inc Modified: trunk/FixedAssetRegister.php =================================================================== --- trunk/FixedAssetRegister.php 2010-01-01 16:03:50 UTC (rev 3265) +++ trunk/FixedAssetRegister.php 2010-01-02 09:54:35 UTC (rev 3266) @@ -1,130 +1,76 @@ <?php -/* $Id$*/ $PageSecurity = 11; include('includes/session.inc'); $title = _('Fixed Asset Register'); -include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . - _('Search') . '" alt="">' . ' ' . $title; - -$sql = "SELECT * FROM stockcategory WHERE stocktype='".'A'."'"; -$result = DB_query($sql,$db); - -echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table>'; -echo '<tr><th>'._('Asset Category').'</th>'; -echo '<td><select name=assetcategory>'; -echo '<option value="%">ALL</option>'; -while ($myrow=DB_fetch_array($result)) { - if (isset($_POST['assetcategory']) and $myrow['categoryid']==$_POST['assetcategory']) { - echo '<option selected value='.$myrow['categoryid'].'>'.$myrow['categorydescription'].'</option>'; - } else { - echo '<option value='.$myrow['categoryid'].'>'.$myrow['categorydescription'].'</option>'; - } -} -echo '</select></td></tr>'; - -$sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; -$result = DB_query($sql,$db); +if (isset($_POST['submit']) or isset($_POST['pdf'])) { -echo '<tr><th>'._('Asset Location').'</th>'; -echo '<td><select name=assetlocation>'; -echo '<option value="All">ALL</option>'; -while ($myrow=DB_fetch_array($result)) { - if (isset($_POST['assetlocation']) and $myrow['locationdescription']==$_POST['assetlocation']) { - echo '<option selected value="'.$myrow['locationdescription'].'">'.$myrow['locationdescription'].'</option>'; + if (isset($_POST['pdf'])) { + $PaperSize = 'A4_Landscape'; + include('includes/PDFStarter.php'); } else { - echo '<option value="'.$myrow['locationdescription'].'">'.$myrow['locationdescription'].'</option>'; + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . + _('Search') . '" alt="">' . ' ' . $title; } -} -echo '</select></td></tr>'; - -$sql = "SELECT stockid, description FROM stockmaster LEFT JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid WHERE stocktype='A'"; -$result = DB_query($sql,$db); -echo '<tr><th>'._('Asset Type').'</th>'; -echo '<td><select name=assettype>'; -echo '<option value="%">ALL</option>'; -while ($myrow=DB_fetch_array($result)) { - if (isset($_POST['assettype']) and $myrow['stockid']==$_POST['assettype']) { - echo '<option selected value='.$myrow['stockid'].'>'.$myrow['description'].'</option>'; - } else { - echo '<option value='.$myrow['stockid'].'>'.$myrow['description'].'</option>'; - } -} + $dateFrom = FormatDateForSQL($_POST['fromDate']); + $dateTo = FormatDateForSQL($_POST['toDate']); -echo '</select></td></tr>'; -//FULUSI CHANGE BELOW TO ADD TIME -echo '<tr> - <th>'._(' From Date')."</th> - <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']. - "' name='fromDate' maxlength=10 size=11 value='".$_POST['fromDate']."'></td>"; - -echo '</tr>'; -echo '<tr> - <th>'._('To Date ')."</th> - <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']. - "' name='toDate' maxlength=10 size=11 value='".$_POST['toDate']."'></td>"; - -echo '</tr>'; -//end of FULUSI STUFF - -echo '</table><br>'; - -echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Show Assets') . '"></div>'; - -echo '</form>'; - -if (isset($_POST['submit'])) { - $dateFrom = FormatDateForSQL($_POST['fromDate']); - $dateTo = FormatDateForSQL($_POST['toDate']); - - - $sql='SELECT assetmanager.id, + $sql='SELECT assetmanager.id, assetmanager.stockid, stockmaster.longdescription, stockmaster.categoryid, assetmanager.serialno, - fixedassetlocations.locationdescription, - assetmanager.cost, + fixedassetlocations.locationdescription, + assetmanager.cost, assetmanager.datepurchased, assetmanager.depn, assetmanager.disposalvalue, fixedassetlocations.parentlocationid, assetmanager.location - FROM assetmanager - LEFT JOIN stockmaster ON assetmanager.stockid=stockmaster.stockid - LEFT JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid + FROM assetmanager + LEFT JOIN stockmaster ON assetmanager.stockid=stockmaster.stockid + LEFT JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid LEFT JOIN fixedassetlocations ON assetmanager.location=fixedassetlocations.locationid WHERE stockmaster.categoryid like "'.$_POST['assetcategory'].'" AND stockmaster.stockid like "'.$_POST['assettype'].'" AND assetmanager.datepurchased BETWEEN "'.$dateFrom.'" AND "'.$dateTo.'"'; $result=DB_query($sql, $db); - echo '<br><table width=80% cellspacing="9"><tr>'; - echo '<th colspan=6></th>'; - echo '<th colspan=3>'._('External Depreciation').'</th>'; - echo '<th colspan=3>'._('Internal Depreciation').'</th><th></th></tr><tr>'; - echo '<th>'._('Asset ID').'</th>'; - echo '<th>'._('Stock ID').'</th>'; - echo '<th>'._('Description').'</th>'; - echo '<th>'._('Serial Number').'</th>'; - echo '<th>'._('Location').'</th>'; - echo '<th>'._('Date Acquired').'</th>'; - echo '<th>'._('Cost').'</th>'; - echo '<th>'._('Depreciation').'</th>'; - echo '<th>'._('NBV').'</th>'; - echo '<th>'._('Cost').'</th>'; - echo '<th>'._('Depreciation').'</th>'; - echo '<th>'._('NBV').'</th>'; - echo '<th>'._('Disposal Value').'</th></tr>'; + if (isset($_POST['pdf'])) { + $FontSize=10; + $pdf->addinfo('Title', _('Fixed Asset Register') ); + $PageNumber=1; + $line_height=12; + include('includes/PDFAssetRegisterHeader.inc'); + } else { + echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table>'; + echo '<br><table width=80% cellspacing="9"><tr>'; + echo '<th colspan=6></th>'; + echo '<th colspan=3>'._('External Depreciation').'</th>'; + echo '<th colspan=3>'._('Internal Depreciation').'</th><th></th></tr><tr>'; + echo '<th>'._('Asset ID').'</th>'; + echo '<th>'._('Stock ID').'</th>'; + echo '<th>'._('Description').'</th>'; + echo '<th>'._('Serial Number').'</th>'; + echo '<th>'._('Location').'</th>'; + echo '<th>'._('Date Acquired').'</th>'; + echo '<th>'._('Cost').'</th>'; + echo '<th>'._('Depreciation').'</th>'; + echo '<th>'._('NBV').'</th>'; + echo '<th>'._('Cost').'</th>'; + echo '<th>'._('Depreciation').'</th>'; + echo '<th>'._('NBV').'</th>'; + echo '<th>'._('Disposal Value').'</th></tr>'; + } while ($myrow=DB_fetch_array($result)) { - + $ancestors=array(); $ancestors[0]=$myrow['locationdescription']; $i=0; @@ -153,30 +99,145 @@ } if (in_array($_POST['assetlocation'],$ancestors) or $_POST['assetlocation']=='All') { - - echo '<tr><td style="vertical-align:top">'.$myrow['id'].'</td>'; - echo '<td style="vertical-align:top">'.$myrow['stockid'].'</td>'; - echo '<td style="vertical-align:top">'.$myrow['longdescription'].'</td>'; - echo '<td style="vertical-align:top">'.$myrow['serialno'].'</td>'; - echo '<td>'.$myrow['locationdescription'].'<br>'; - for ($i=1;$i<sizeOf($ancestors)-1;$i++) { - for ($j=0;$j<$i; $j++) { - echo ' '; + if (isset($_POST['pdf'])) { + $LeftOvers = $pdf->addTextWrap($Xpos,$YPos,300-$Left_Margin,$FontSize, $myrow['id']); + $LeftOvers = $pdf->addTextWrap($Xpos+40,$YPos,300-$Left_Margin,$FontSize, $myrow['stockid']); + $LeftOvers = $pdf->addTextWrap($Xpos+80,$YPos,300-$Left_Margin,$FontSize, $myrow['longdescription']); + $LeftOvers = $pdf->addTextWrap($Xpos+250,$YPos,300-$Left_Margin,$FontSize, $myrow['serialno']); + $LeftOvers = $pdf->addTextWrap($Xpos+300,$YPos,300-$Left_Margin,$FontSize, $myrow['locationdescription']); + $TempYPos=$YPos; + for ($i=1;$i<sizeOf($ancestors)-1;$i++) { + for ($j=0;$j<$i; $j++) { + $TempYPos -=(0.8*$line_height); + $LeftOvers = $pdf->addTextWrap($Xpos+300,$TempYPos,300-$Left_Margin,$FontSize, ' '); + } + $LeftOvers = $pdf->addTextWrap($Xpos+300,$TempYPos,300-$Left_Margin,$FontSize, '|_'.$ancestors[$i]); } - echo '|_'.$ancestors[$i].'<br>'; + $LeftOvers = $pdf->addTextWrap($Xpos+380,$YPos,300-$Left_Margin,$FontSize, ConvertSQLDate($myrow['datepurchased'])); + $LeftOvers = $pdf->addTextWrap($Xpos+440,$YPos,55,$FontSize, number_format($myrow['cost'],0), 'right'); + $LeftOvers = $pdf->addTextWrap($Xpos+495,$YPos,55,$FontSize, number_format($myrow['depn'],0), 'right'); + $LeftOvers = $pdf->addTextWrap($Xpos+550,$YPos,50,$FontSize, number_format($myrow['cost']-$myrow['depn'],0), 'right'); + $LeftOvers = $pdf->addTextWrap($Xpos+600,$YPos,55,$FontSize, number_format($myrow['cost'],0),'right'); + $LeftOvers = $pdf->addTextWrap($Xpos+655,$YPos,55,$FontSize, number_format($InternalDepreciation,0),'right'); + $LeftOvers = $pdf->addTextWrap($Xpos+710,$YPos,50,$FontSize, number_format($myrow['cost']-$InternalDepreciation,0),'right'); + $YPos =$TempYPos-(0.8*$line_height); + if ($YPos < $Bottom_Margin + $line_height){ + include('includes/PDFAssetRegisterHeader.inc'); + } + } else { + echo '<tr><td style="vertical-align:top">'.$myrow['id'].'</td>'; + echo '<td style="vertical-align:top">'.$myrow['stockid'].'</td>'; + echo '<td style="vertical-align:top">'.$myrow['longdescription'].'</td>'; + echo '<td style="vertical-align:top">'.$myrow['serialno'].'</td>'; + echo '<td>'.$myrow['locationdescription'].'<br>'; + for ($i=1;$i<sizeOf($ancestors)-1;$i++) { + for ($j=0;$j<$i; $j++) { + echo ' '; + } + echo '|_'.$ancestors[$i].'<br>'; + } + echo '</td><td style="vertical-align:top">'.ConvertSQLDate($myrow['datepurchased']).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost'],2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['depn'],2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost']-$myrow['depn'],2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost'],2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($InternalDepreciation,2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost']-$InternalDepreciation,2).'</td>'; + echo '<td style="vertical-align:top" class=number>'.number_format($myrow['disposalvalue'],2).'</td></tr>'; } - echo '</td><td style="vertical-align:top">'.ConvertSQLDate($myrow['datepurchased']).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost'],2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['depn'],2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost']-$myrow['depn'],2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost'],2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($InternalDepreciation,2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['cost']-$InternalDepreciation,2).'</td>'; - echo '<td style="vertical-align:top" class=number>'.number_format($myrow['disposalvalue'],2).'</td></tr>'; } } + + if (isset($_POST['pdf'])) { + $pdf->Output($_SESSION['DatabaseName'] . '_Asset Register_' . date('Y-m-d').'.pdf', 'I'); + exit; + } else { + echo '<input type=hidden name=fromDate value="'.$_POST['fromDate'].'">'; + echo '<input type=hidden name=toDate value='.$_POST['toDate'].'>'; + echo '<input type=hidden name=assetcategory value='.$_POST['assetcategory'].'>'; + echo '<input type=hidden name=assettype value='.$_POST['assettype'].'>'; + echo '<input type=hidden name=assetlocation value='.$_POST['assetlocation'].'>'; + echo '</table><div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"></div></form>'; + } +} else { + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . + _('Search') . '" alt="">' . ' ' . $title; + $sql = "SELECT * FROM stockcategory WHERE stocktype='".'A'."'"; + $result = DB_query($sql,$db); + + echo '<form name="RegisterForm" method="post" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '"><table>'; + echo '<tr><th>'._('Asset Category').'</th>'; + echo '<td><select name=assetcategory>'; + echo '<option value="%">'._('ALL').'</option>'; + while ($myrow=DB_fetch_array($result)) { + if (isset($_POST['assetcategory']) and $myrow['categoryid']==$_POST['assetcategory']) { + echo '<option selected value='.$myrow['categoryid'].'>'.$myrow['categorydescription'].'</option>'; + } else { + echo '<option value='.$myrow['categoryid'].'>'.$myrow['categorydescription'].'</option>'; + } + } + echo '</select></td></tr>'; + + $sql = "SELECT locationid, locationdescription FROM fixedassetlocations"; + $result = DB_query($sql,$db); + + echo '<tr><th>'._('Asset Location').'</th>'; + echo '<td><select name=assetlocation>'; + echo '<option value="All">'._('ALL').'</option>'; + while ($myrow=DB_fetch_array($result)) { + if (isset($_POST['assetlocation']) and $myrow['locationdescription']==$_POST['assetlocation']) { + echo '<option selected value="'.$myrow['locationdescription'].'">'.$myrow['locationdescription'].'</option>'; + } else { + echo '<option value="'.$myrow['locationdescription'].'">'.$myrow['locationdescription'].'</option>'; + } + } + echo '</select></td></tr>'; + + $sql = "SELECT stockid, description FROM stockmaster LEFT JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid WHERE stocktype='A'"; + $result = DB_query($sql,$db); + + echo '<tr><th>'._('Asset Type').'</th>'; + echo '<td><select name=assettype>'; + echo '<option value="%">'._('ALL').'</option>'; + while ($myrow=DB_fetch_array($result)) { + if (isset($_POST['assettype']) and $myrow['stockid']==$_POST['assettype']) { + echo '<option selected value='.$myrow['stockid'].'>'.$myrow['description'].'</option>'; + } else { + echo '<option value='.$myrow['stockid'].'>'.$myrow['description'].'</option>'; + } + } + + echo '</select></td></tr>'; + + if (empty($_POST['fromDate'])) { + $_POST['fromDate']=date($_SESSION['DefaultDateFormat'], mktime(0, 0, 0, date("m"), date("d"), date("Y")-1)); + } + if (empty($_POST['toDate'])) { + $_POST['toDate']=date($_SESSION['DefaultDateFormat']); + } + + //FULUSI CHANGE BELOW TO ADD TIME + echo '<tr><th>'._(' From Date')."</th><td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']. + "' name='fromDate' maxlength=10 size=11 value='".$_POST['fromDate']."'></td>"; + + echo '</tr>'; + echo '<tr> + <th>'._('To Date ')."</th> + <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']. + "' name='toDate' maxlength=10 size=11 value='".$_POST['toDate']."'></td>"; + + echo '</tr>'; + //end of FULUSI STUFF + + echo '</table><br>'; + + echo '<div class="centre"><input type="Submit" name="submit" value="' . _('Show Assets') . '"></div><br />'; + echo '<div class="centre"><input type="Submit" name="pdf" value="' . _('Print as a pdf') . '"></div>'; + + echo '</form>'; } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-01 16:03:50 UTC (rev 3265) +++ trunk/doc/Change.log.html 2010-01-02 09:54:35 UTC (rev 3266) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>02/01/10 Tim: Allow pdf output of the asset register. <p>24/12/09 Tim: Move the purchase ordering printing parameters to a separate file for the form designer. <p>23/12/09 Tim: Rename rtl theme to remove the space. <p>19/12/09 Pak Ricard: TopItems.php - Improvements to the top sales items report. @@ -43,8 +44,8 @@ <p>17/11/09 Pak Ricard: TopItems.php - Correct typo preventing the correct loading of type of customers. <p>15/11/09 Javier: button_bg.png - quick menu silverwolf button background to follow style of theme <p>15/11/09 Javier: default.css - removed duplicated and restored overwritten classes after the synchronization -<p>15/11/09 Javier: Change.log.html - This file, partially corrected xhtml code and convert tag being text to entities -<p>15/11/09 Javier: default.css - Added in menu_group_item <p> css style to restore and even enhance previous <li> appearance +<p>15/11/09 Javier: Change.log.html - This file, partially corrected xhtml code and convert tag being text to entities +<p>15/11/09 Javier: default.css - Added in menu_group_item <p> css style to restore and even enhance previous <li> appearance <p>15/11/09 Javier: index.php - Complete correction of PhP and xhtml code to follow Zend and W3C standard rules <p>15/11/09 Beth Lesko: DateFunctions.inc - Correction for North American style dates <p>15/11/09 csrbusiness: api_salesorders.php - Correct date checking functions @@ -99,7 +100,7 @@ <p>09/11/09 Javier: CustomerReceipt.php - v1.45 Removed br at Line 783 from html table first column title. <p>09/11/09 Javier: upgrade3.11-3.12.sql - corrected syntax for consistency. <p>08/11/09 Gilles Deacur: SelectCustomer.php - Add in facility to search by customer address -<p>08/11/09 Phil: New DailySalesInquiry.php - show sales for a selected month - day by day with average sales per billing day and GP% - work sponsored by Manny Neri +<p>08/11/09 Phil: New DailySalesInquiry.php - show sales for a selected month - day by day with average sales per billing day and GP% - work sponsored by Manny Neri <p>07/11/09 Tim: update3.10-3.11.sql - Remove FOI config value as feature not in 3.11 <p>07/11/09 Tim: PrintCstTransPortrait.php - Correct $pdf->Output() call to show invoice without saving first <p>07/11/09 Tim: upgrade3.11-3.12.sql - Remove duplicated line and corrected syntax for consistency @@ -234,7 +235,7 @@ <p>08/10/09 Tim: RCFunctions.inc - Fix problem with database criteria statement <p>08/10/09 Tim: WorkOrderIssue.php - Allow for the selection of a date for the manual issue to work orders <p>08/10/09 Pak Ricard: Top sales items report -<p>07/10/09 Phil: Fix PO_Items.php to enable changes to prices and weights +<p>07/10/09 Phil: Fix PO_Items.php to enable changes to prices and weights <p>03/10/09 Tim: upgrade3.11-3.11.1 - Enlarge language field in www_users for utf8 codeset <p>03/10/09 Tim: upgrade3.11-3.12.sql - Enlarge language field in www_users for utf8 codeset <p>03/10/09 Tim: weberp-new.sql - Enlarge language field in www_users for utf8 codeset @@ -271,7 +272,7 @@ <p>08/10/09 Tim: RCFunctions.inc - Fix problem with database criteria statement <p>08/10/09 Tim: WorkOrderIssue.php - Allow for the selection of a date for the manual issue to work orders <p>08/10/09 Pak Ricard: Top sales items report -<p>07/10/09 Phil: Fix PO_Items.php to enable changes to prices and weights +<p>07/10/09 Phil: Fix PO_Items.php to enable changes to prices and weights <p>03/10/09 Tim: upgrade3.11-3.11.1 - Enlarge language field in www_users for utf8 codeset <p>03/10/09 Tim: upgrade3.11-3.12.sql - Enlarge language field in www_users for utf8 codeset <p>03/10/09 Tim: weberp-new.sql - Enlarge language field in www_users for utf8 codeset @@ -325,7 +326,7 @@ <p>28/08/09 David: BankAccounts.php - Correct sql syntax for insert statement <p>28/08/09 Tim: upgrade3.10-3.11.sql - Add comments for use with the upgrade script <p>28/08/09 Tim: Z_Upgrade_3.10-3.11.php - Change upgrade script to handle the case where some upgrades have already been done. -<p>26/08/09 Phil: Fix Shoops CustLoginSetup.php by populating the $ModuleList +<p>26/08/09 Phil: Fix Shoops CustLoginSetup.php by populating the $ModuleList <p>26/08/09 Phil: SelectCustomer.php ORDER BY clause doubled up (now fixed) following salesman login changes <p>26/08/09 Paul: StockCategories.php - Fixed missing closing > in html <p>24/08/09 Phil: Saleman login - modifications to session.inc SelectOrderItems.php SelectCustomer.php WWW_Users.php - added a new field to www_users for salesman login - when entering orders users with this restricted login will only be able to enter orders against the selected salesman (in WWW_Users.php). The user will also only be able to select customers for the selected salesman too. Note that if this user has access to salesanalysis then they will be analyse the sales of all customers @@ -338,7 +339,7 @@ <p>16/08/09 Tim: config.distrib.php - Add mysql port configuration <p>15/08/09 Tim: api_xml-rpc.php - Updates to stock adjustment function <p>15/08/09 Tim: api_stock.php - Updates to stock adjustment function -<p>15/08/09 Tim: Tax.php - Fix problem with conversion of PeriodEndDate +<p>15/08/09 Tim: Tax.php - Fix problem with conversion of PeriodEndDate <p>13/08/09 Tim: Add GetStockCategory() function to api <p>13/08/09 Harald Ringehahn: DateFunctions.inc - Update for all supported date formats <p>13/08/09 Harald Ringehahn: MiscFunctions.js - Update for all supported date formats @@ -413,7 +414,7 @@ <p>13/07/09 Murray: fixed some div centering for SelectCustomer.php <p>10/07/09 Tim: PO_SelectOSPurchOrder.php - Correct sql for mysql strict mode <p>10/07/09 Tim: PO_Header.php - Correction to goods received link -<p>10/07/09 Tim: weberp-new.sql - Remove unecessary data +<p>10/07/09 Tim: weberp-new.sql - Remove unecessary data <p>10/07/09 Tim: weberp-demo.sql - Remove unecessary data (audittrail), and add in 3.11 database changes <p>10/07/09 Tim: sql/mysql/upgrade3.10-3.11.sql - Make alteration to type for notes field in custnotes table <p>10/07/09 Tim: weberp-new.sql - Add in new database changes @@ -719,7 +720,7 @@ <p>03/05/09 Tim: PrintCustTransPortrait.php - Show line description even when on more than one line <p>3/5/09 Phil: Mess with the API to add $_SESSION['AllowedSecurityTokens'] array to provide role based authentication infrastructure to the api_php.php script - now just to add the checking $PageSecurity variable in_array for exposed functions - Tim to check!! <p>2/5/09 Phil: Added new configuration parameters to SystemParameters for DefaultFactoryLocation, AutoCreateWOs and FactoryManagerEmail as preparation for the automatic creation of works orders at the default factory advising the factory manager of the work orders created. -<p>/30/4/09 Phil: DeliveryDetails.php and RecurringSalesOrdersProcess.php made it so sales order headers use the order number from GetNextTransNo (30) as well as the sales order details - and avoiding the inconsistency issues where the auto-increment was out of sync with the systypes typeid=30 typeno +<p>/30/4/09 Phil: DeliveryDetails.php and RecurringSalesOrdersProcess.php made it so sales order headers use the order number from GetNextTransNo (30) as well as the sales order details - and avoiding the inconsistency issues where the auto-increment was out of sync with the systypes typeid=30 typeno <p>02/05/09 Tim: StockCategories.php - Correct form refresh to show changes in stock types when a category is being edited <p>30/4/09 Phil: Add field to Stocks.php for NextSerialNo - where > 0 and Serialised then automatically allocates serial numbers for quantities on new work orders - and work orders will not allow quantities to change once created <p>29/04/09 Tim: StockCategories.php - Change default behaviour to show Stock GL Code @@ -807,7 +808,7 @@ <p>23/03/09 Tim: SuppInvGRNs.php - Add in closing <font> tag and show the suppliers name correctly <p>23/03/09 Tim: StockCategories.php - Correctly check for uninitialised POST variables <p>23/03/09 Tim: SelectOrderItems.php - Correct html for xhtml compatability -<p>23/03/09 Tim: SalesGLPostings.php - Initial assignment of +<p>23/03/09 Tim: SalesGLPostings.php - Initial assignment of <p>23/03/09 Tim: PO_PDFPurchOrder.php - Show purchase order number correctly <p>23/03/09 Tim: PO_Items.php - Only show Purchase order text once <p>23/03/09 Tim: PO_Header.php - Show location address when the lookup address button is pushed @@ -876,7 +877,7 @@ <p>17/2/09 Tim: WorkOrderCosting.php - Correctly calculate cost variances <p>17/2/09 Tim: PrintCustTrans. - Update to correctly email invoice to customer <p>12/2/09 Matt Taylor: BOMInquiry.php BOMs.php Stocks.php WorkOrderReceive.php WorOrderEntry.php includes/SQL_CommonFunctions.inc Z_Im/ortStocks.php - modifications to allow Phantom Items - a new class of item type G - ghost (since P for Phantom could mean purchased). These allow sub-components to be included in the top level of a bill of material as a single line making BOMs simpler to follow and create - the components of ghosts/phantoms are exploded automatically on work order entry so the full requirements show against the work order. -<p>11/2/09 Moxx consulting: first commit of web based install UI +<p>11/2/09 Moxx consulting: first commit of web based install UI <p>10/2/09 Tim: weberp-new.sql - Update data for factor companies and debtortype. <p>10/2/09 Tim: WorkOrderCosting.php - Correct sql to correctly calculate costings. <p>09/2/09 Tim: CustomerAllocations.php - Remove commented code that was preventing gettext from working Added: trunk/includes/PDFAssetRegisterHeader.inc =================================================================== --- trunk/includes/PDFAssetRegisterHeader.inc (rev 0) +++ trunk/includes/PDFAssetRegisterHeader.inc 2010-01-02 09:54:35 UTC (rev 3266) @@ -0,0 +1,84 @@ +<?php +/* $Revision: 1.3 $ */ +/* $Id$*/ +/*PDF page header for price list report */ +if ($PageNumber>1){ + $pdf->newPage(); +} + +$FontSize=10; +$YPos= $Page_Height-$Top_Margin; +$XPos=0; +$pdf->addJpegFromFile($_SESSION['LogoFile'] ,$XPos+20,$YPos-50,0,60); + +if ($_POST['assetcategory']=='%') { + $category=_('All'); +} else { + $categorysql='SELECT categorydescription FROM stockcategory WHERE categoryid="'.$_POST['assetcategory'].'"'; + $categoryresult=DB_query($categorysql, $db); + $categoryrow=DB_fetch_array($categoryresult); + $category=$categoryrow[0]; +} + +if ($_POST['assettype']=='%') { + $type=_('All'); +} else { + $typesql='SELECT description FROM stockmaster WHERE stockid="'.$_POST['assettype'].'"'; + $typeresult=DB_query($typesql, $db); + $typerow=DB_fetch_array($typeresult); + $type=$typerow[0]; +} + +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos,240,$FontSize,$_SESSION['CompanyRecord']['coyname']); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*1),240,$FontSize, _('Asset Category ').' ' . $category ); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*2),240,$FontSize, _('Asset Location ').' ' . $_POST['assetlocation'] ); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*3),240,$FontSize, _('Asset Type').': ' . $type); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*4),240,$FontSize, _('Acquired After').': ' . $_POST['fromDate']); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*5),240,$FontSize, _('and Before').': ' . $_POST['toDate']); +$LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-240,$YPos-($line_height*7),240,$FontSize, _('Page'). ' ' . $PageNumber); + +$YPos -= 60; + +$YPos -=2*$line_height; +//Note, this is ok for multilang as this is the value of a Select, text in option is different + +$YPos -=(2*$line_height); + +/*Draw a rectangle to put the headings in */ +$YTopLeft=$YPos+$line_height; +$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 */ +$FontSize=8; +$Xpos = $Left_Margin+1; +$LeftOvers = $pdf->addTextWrap($Xpos+440,$YPos,300-$Left_Margin,$FontSize, _('<--------------External Depreciation-------------->'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+605,$YPos,300-$Left_Margin,$FontSize, _('<--------------Internal Depreciation-------------->'), 'centre'); +$YPos -=(0.8*$line_height); +$LeftOvers = $pdf->addTextWrap($Xpos,$YPos,40,$FontSize, _('Asset ID'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+40,$YPos,300-$Left_Margin,$FontSize, _('Stock ID'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+80,$YPos,300-$Left_Margin,$FontSize, _('Description'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+250,$YPos,300-$Left_Margin,$FontSize, _('Serial No.'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+300,$YPos,300-$Left_Margin,$FontSize, _('Location'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+380,$YPos,300-$Left_Margin,$FontSize, _('Date Acquired'), 'centre'); +$LeftOvers = $pdf->addTextWrap($Xpos+440,$YPos,55,$FontSize, _('Cost'), 'right'); +$LeftOvers = $pdf->addTextWrap($Xpos+495,$YPos,55,$FontSize, _('Depn'), 'right'); +$LeftOvers = $pdf->addTextWrap($Xpos+550,$YPos,50,$FontSize, _('NBV'), 'right'); +$LeftOvers = $pdf->addTextWrap($Xpos+600,$YPos,55,$FontSize, _('Cost'), 'right'); +$LeftOvers = $pdf->addTextWrap($Xpos+655,$YPos,55,$FontSize, _('Depn'), 'right'); +$LeftOvers = $pdf->addTextWrap($Xpos+710,$YPos,50,$FontSize, _('NBV'), 'right'); + + +$pdf->line($Left_Margin, $YTopLeft,$Page_Width-$Right_Margin, $YTopLeft); +$pdf->line($Left_Margin, $YTopLeft,$Left_Margin, $Bottom_Margin); +$pdf->line($Left_Margin, $Bottom_Margin,$Page_Width-$Right_Margin, $Bottom_Margin); +$pdf->line($Page_Width-$Right_Margin, $Bottom_Margin,$Page_Width-$Right_Margin, $YTopLeft); + +$FontSize=8; +$YPos -= (1.5 * $line_height); + +$PageNumber++; + +?> \ No newline at end of file Property changes on: trunk/includes/PDFAssetRegisterHeader.inc ___________________________________________________________________ Added: svn:keywords + Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2010-01-03 07:28:24
|
Revision: 3267 http://web-erp.svn.sourceforge.net/web-erp/?rev=3267&view=rev Author: daintree Date: 2010-01-03 07:28:17 +0000 (Sun, 03 Jan 2010) Log Message: ----------- Sales Analysis PDFs fixed for TCPDF Javier missed a bracket Modified Paths: -------------- trunk/SalesAnalysis_UserDefined.php trunk/doc/Change.log.html trunk/sql/mysql/upgrade3.11.1-3.12.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/SalesAnalysis_UserDefined.php =================================================================== --- trunk/SalesAnalysis_UserDefined.php 2010-01-02 09:54:35 UTC (rev 3266) +++ trunk/SalesAnalysis_UserDefined.php 2010-01-03 07:28:17 UTC (rev 3267) @@ -17,17 +17,8 @@ include ('includes/PDFSalesAnalysis.inc'); if ($Counter >0) { -// Javier: -/* if ($ListCount == 0) { - $title = _('Printing Sales Analysis Error'); - include('includes/header.inc'); - echo '<br /><a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; - } else { -*/ $pdf->OutputD('SalesAnalysis_' . date('Y-m-d') . '.pdf'); - $pdf-> __destruct(); - } + $pdf->OutputD('SalesAnalysis_' . date('Y-m-d') . '.pdf'); + $pdf-> __destruct(); } else { $pdf-> __destruct(); $title = _('User Defined Sales Analysis Problem'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-02 09:54:35 UTC (rev 3266) +++ trunk/doc/Change.log.html 2010-01-03 07:28:17 UTC (rev 3267) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>3/1/10 Phil: Fix SalesAnalysis_UserDefined.php - one too many brackets and indentation <p>02/01/10 Tim: Allow pdf output of the asset register. <p>24/12/09 Tim: Move the purchase ordering printing parameters to a separate file for the form designer. <p>23/12/09 Tim: Rename rtl theme to remove the space. Modified: trunk/sql/mysql/upgrade3.11.1-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-01-02 09:54:35 UTC (rev 3266) +++ trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-01-03 07:28:17 UTC (rev 3267) @@ -2,7 +2,7 @@ `locationid` char(6) NOT NULL default '', `locationdescription` char(20) NOT NULL default '', PRIMARY KEY (`locationid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; DROP TABLE `assetmanager`; @@ -15,7 +15,7 @@ `depn` double NOT NULL default '0', `datepurchased` date NOT NULL default '0000-00-00', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; UPDATE `www_users` SET `modulesallowed`=(SELECT insert(`modulesallowed`, 15,0,"1,")); INSERT INTO `config` (`confname`, `confvalue`) VALUES ('FrequentlyOrderedItems',0); Modified: trunk/sql/mysql/weberp-new.sql =================================================================== --- trunk/sql/mysql/weberp-new.sql 2010-01-02 09:54:35 UTC (rev 3266) +++ trunk/sql/mysql/weberp-new.sql 2010-01-03 07:28:17 UTC (rev 3267) @@ -2153,7 +2153,7 @@ `password` text NOT NULL, `realname` varchar(35) NOT NULL DEFAULT '', `customerid` varchar(10) NOT NULL DEFAULT '', - `salesman` char(3) NOT NULL, + `salesman` char(3) NOT NULL DEFAULT '', `phone` varchar(30) NOT NULL DEFAULT '', `email` varchar(55) DEFAULT NULL, `defaultlocation` varchar(5) NOT NULL DEFAULT '', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-04 12:25:08
|
Revision: 3269 http://web-erp.svn.sourceforge.net/web-erp/?rev=3269&view=rev Author: tim_schofield Date: 2010-01-04 12:24:44 +0000 (Mon, 04 Jan 2010) Log Message: ----------- Correct typo in sql statement. Modified Paths: -------------- trunk/api/api_stock.php trunk/doc/Change.log.html Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2010-01-03 21:00:49 UTC (rev 3268) +++ trunk/api/api_stock.php 2010-01-04 12:24:44 UTC (rev 3269) @@ -282,7 +282,7 @@ return $Errors; } $PageSecurity =11; //The authorisation required to go to the stock modification script - if ((!in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']))) { + if ((!in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']))) { $Errors[0]=NoAuthorisation; return $Errors; } @@ -784,7 +784,7 @@ $Location.'" AND stockid="'.$StockID.'"'; $glupdatesql1="INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) VALUES (17,".GetNextTransactionNo(17, $db).",'".$TranDate. - "','"GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). + "','".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). ",".$adjglact.",".$itemdetails['materialcost']*-$Quantity. ",'".$StockID." x ".$Quantity." @ ".$itemdetails['materialcost']."')"; $glupdatesql2="INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-03 21:00:49 UTC (rev 3268) +++ trunk/doc/Change.log.html 2010-01-04 12:24:44 UTC (rev 3269) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> -<p>3/1/10 Phil: Fix SalesAnalysis_UserDefined.php - one too many brackets and indentation +<p>04/01/10 Tim: api_stock.php - Correct typo in sql statement. +<p>03/01/10 Phil: Fix SalesAnalysis_UserDefined.php - one too many brackets and indentation <p>02/01/10 Tim: Allow pdf output of the asset register. <p>24/12/09 Tim: Move the purchase ordering printing parameters to a separate file for the form designer. <p>23/12/09 Tim: Rename rtl theme to remove the space. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2010-01-06 04:40:33
|
Revision: 3270 http://web-erp.svn.sourceforge.net/web-erp/?rev=3270&view=rev Author: daintree Date: 2010-01-06 04:40:23 +0000 (Wed, 06 Jan 2010) Log Message: ----------- fix DateFunctions.inc for US format m/d/Y dates the FormatDateForSQL function was munted Modified Paths: -------------- trunk/CustomerBranches.php trunk/EmailCustTrans.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/includes/DateFunctions.inc trunk/includes/SQL_CommonFunctions.inc Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/CustomerBranches.php 2010-01-06 04:40:23 UTC (rev 3270) @@ -577,7 +577,7 @@ if (DB_num_rows($result)==0){ echo '</table>'; prnMsg(_('There are no sales people defined as yet') . ' - ' . _('customer branches must be allocated to a sales person') . '. ' . _('Please use the link below to define at least one sales person'),'error'); - echo "<br><a href='$rootpath/SalesPeople.php?" . SID . "'>"._('Define Sales People').'</a>'; + echo '<p align="center"><a href="' . $rootpath . '/SalesPeople.php?"' . SID . '">'._('Define Sales People') . '</a>'; include('includes/footer.inc'); exit; } Modified: trunk/EmailCustTrans.php =================================================================== --- trunk/EmailCustTrans.php 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/EmailCustTrans.php 2010-01-06 04:40:23 UTC (rev 3270) @@ -5,6 +5,7 @@ $PageSecurity = 2; include ('includes/session.inc'); +include ('includes/SQL_CommonFunctions.inc'); if ($_GET['InvOrCredit']=='Invoice'){ $TransactionType = _('Invoice'); @@ -15,7 +16,7 @@ } $title=_('Email') . ' ' . $TransactionType . ' ' . _('Number') . ' ' . $_GET['FromTransNo']; -if (isset($_POST['DoIt']) AND strlen($_POST['EmailAddr'])>3){ +if (isset($_POST['DoIt']) AND IsEmailAddress($_POST['EmailAddr'])){ if ($_SESSION['InvoicePortraitFormat']==0){ echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PrintCustTrans.php?' . SID . '&FromTransNo=' . $_POST['TransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] .'&Email=' . $_POST['EmailAddr'] . "'>"; @@ -24,20 +25,18 @@ } else { echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PrintCustTransPortrait.php?' . SID . '&FromTransNo=' . $_POST['TransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] .'&Email=' . $_POST['EmailAddr'] . "'>"; - prnMsg(_('The transaction should have been emailed off') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ')' . "<a href='" . $rootpath . '/PrintCustTransPortrait.php?' . SID . '&FromTransNo=' . $_POST['FromTransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] .'&Email=' . $_POST['EmailAddr'] . "'>" . _('click here') . '</a> ' . _('to email the customer transaction'),'success'); + prnMsg(_('The transaction should have been emailed off. If this does not happen (perhaps the browser does not support META Refresh)') . '<a href="' . $rootpath . '/PrintCustTransPortrait.php?' . SID . '&FromTransNo=' . $_POST['FromTransNo'] . '&PrintPDF=Yes&InvOrCredit=' . $_POST['InvOrCredit'] .'&Email=' . $_POST['EmailAddr'] . '">' . _('click here') . '</a> ' . _('to email the customer transaction'),'success'); } exit; } elseif (isset($_POST['DoIt'])) { $_GET['InvOrCredit'] = $_POST['InvOrCredit']; $_GET['FromTransNo'] = $_POST['FromTransNo']; - prnMsg(_('The email address entered is too short to be a valid email address') . '. ' . _('The transaction was not emailed'),'warn'); + prnMsg(_('The email address does not appear to be a valid email address. The transaction was not emailed'),'warn'); } include ('includes/header.inc'); - - echo "<form action='" . $_SERVER['PHP_SELF'] . '?' . SID . "' method=post>"; echo "<input type=hidden name='TransNo' VALUE=" . $_GET['FromTransNo'] . ">"; @@ -45,7 +44,6 @@ echo '<p><table>'; - $SQL = "SELECT email FROM custbranch INNER JOIN debtortrans ON custbranch.debtorno= debtortrans.debtorno Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/PrintCustTrans.php 2010-01-06 04:40:23 UTC (rev 3270) @@ -7,8 +7,6 @@ $PageSecurity = 1; -error_reporting (E_ALL); - include('includes/session.inc'); if (isset($_GET['FromTransNo'])) { @@ -45,7 +43,6 @@ and $FromTransNo!=''){ include ('includes/class.pdf.php'); -// define('FPDF_FONTPATH','font/'); require('fpdi/fpdi.php'); /* This invoice is hard coded for A4 Landscape invoices or credit notes so can't use PDFStarter.inc */ @@ -511,17 +508,11 @@ $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 - } else if (isset($_GET['Email'])) { - $pdf->setFiles(array($_SESSION['reports_dir'] . '/Invoice.pdf')); - $pdf->concat(); - $pdfcode = $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf'); + } elseif (isset($_GET['Email'])) { + $pdfcode = $pdf->Output($_SESSION['reports_dir'] . '/Invoice.pdf','D'); } else { - -// Javier: esto tiene que estar mal, si imprime la factura sin adjuntar nada pq llama a concat? // If the appendfile field is empty and EMAIL is not selected, just print the invoice without any appended pages - $pdf->setFiles(array($_SESSION['reports_dir'] . '/Invoice.pdf')); - $pdf->concat(); - $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf','D'); + $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf','I'); exit; } } Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/PrintCustTransPortrait.php 2010-01-06 04:40:23 UTC (rev 3270) @@ -579,14 +579,9 @@ exit; // If EMAIL is selected, send the invoice via email, this is not appending pages yet though } else if (isset($_GET['Email'])) { - $pdf->setFiles(array($_SESSION['reports_dir'] . '/Invoice.pdf')); - $pdf->concat(); - $pdfcode = $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf'); + $pdfcode = $pdf->Output($_SESSION['reports_dir'] . '/Invoice.pdf','D'); } else { -// Javier: esto tiene que estar mal, si imprime la factura sin adjuntar nada pq llama a concat? // If the appendfile field is empty and EMAIL is not selected, just print the invoice without any appended pages - $pdf->setFiles(array($_SESSION['reports_dir'] . '/Invoice.pdf')); - $pdf->concat(); $pdf->Output($_SESSION['CompanyRecord']['coyname'] . '_Invoice.pdf','I'); exit; } Modified: trunk/includes/DateFunctions.inc =================================================================== --- trunk/includes/DateFunctions.inc 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/includes/DateFunctions.inc 2010-01-06 04:40:23 UTC (rev 3270) @@ -5,7 +5,7 @@ /* date validation and parsing functions -These functions refer to the config variable defining the date format +These functions refer to the session variable defining the date format The date format is defined in SystemParameters called DefaultDateFormat this can be a string either 'd/m/Y' for UK/Australia/New Zealand dates or 'm/d/Y' for US/Canada format dates @@ -49,7 +49,7 @@ if (is_long((int)$Date_Array[0]) AND is_long((int)$Date_Array[1]) AND is_long((int)$Date_Array[2])) { - if (($_SESSION['DefaultDateFormat']=='d/m/Y') || ($_SESSION['DefaultDateFormat']=='d.m.Y')){ + if (($_SESSION['DefaultDateFormat']=='d/m/Y') OR ($_SESSION['DefaultDateFormat']=='d.m.Y')){ if (checkdate((int)$Date_Array[1],(int)$Date_Array[0],(int)$Date_Array[2])){ return 1; @@ -140,7 +140,7 @@ // Returns the timestamp for the financial year end. To find other year ends, -// use $YearIncrement to move back and fgorward. in -1 gives last year end, 1 +// use $YearIncrement to move back and forward. in -1 gives last year end, 1 // gives next year end. function YearEndDate($MonthNo, $YearIncrement) { @@ -416,7 +416,7 @@ } elseif ($_SESSION['DefaultDateFormat']=='d.m.Y') { return $Date_Array[2].'.'.$Date_Array[1].'.'.$Date_Array[0]; } elseif ($_SESSION['DefaultDateFormat']=='m/d/Y') { - return $Date_Array[1].'/'.$Date_Array[2].'/'.$Date_Array[0]; + return $Date_Array[2].'/'.$Date_Array[0].'/'.$Date_Array[1]; } elseif ($_SESSION['DefaultDateFormat']=='Y/m/d') { return $Date_Array[0].'/'.$Date_Array[1].'/'.$Date_Array[2]; } @@ -449,7 +449,7 @@ /*The 0 and 1 elements of the array are switched depending on the format used */ - if (($_SESSION['DefaultDateFormat']=='d/m/Y') || ($_SESSION['DefaultDateFormat']=='d.m.Y')){ + if (($_SESSION['DefaultDateFormat']=='d/m/Y') OR ($_SESSION['DefaultDateFormat']=='d.m.Y')){ if ( ($Date1_array[1] - $Date2_array[1]) >0){ return 1; } elseif (($Date1_array[1] - $Date2_array[1])==0){ @@ -492,7 +492,7 @@ $Date_Array = explode('.',$TranDate); } - if (($_SESSION['DefaultDateFormat']=='d/m/Y') || ($_SESSION['DefaultDateFormat']=='d.m.Y')){ + if (($_SESSION['DefaultDateFormat']=='d/m/Y') OR ($_SESSION['DefaultDateFormat']=='d.m.Y')){ if ($DayInFollowingMonth==0){ /*then it must be set up for DaysBeforeDue type */ $DayDue = $Date_Array[0]+$DaysBeforeDue; @@ -559,7 +559,7 @@ $Date_Array = explode('.',$DateToAddTo); } - if (($_SESSION['DefaultDateFormat']=='d/m/Y') || ($_SESSION['DefaultDateFormat']=='d.m.Y')){ + if (($_SESSION['DefaultDateFormat']=='d/m/Y') OR ($_SESSION['DefaultDateFormat']=='d.m.Y')){ switch ($PeriodString) { case 'd': //Days Modified: trunk/includes/SQL_CommonFunctions.inc =================================================================== --- trunk/includes/SQL_CommonFunctions.inc 2010-01-04 12:24:44 UTC (rev 3269) +++ trunk/includes/SQL_CommonFunctions.inc 2010-01-06 04:40:23 UTC (rev 3270) @@ -326,4 +326,4 @@ } -?> +?> \ 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-01-06 12:53:54
|
Revision: 3276 http://web-erp.svn.sourceforge.net/web-erp/?rev=3276&view=rev Author: tim_schofield Date: 2010-01-06 12:53:48 +0000 (Wed, 06 Jan 2010) Log Message: ----------- Move the modules selection to the left of the screen Modified Paths: -------------- trunk/doc/Change.log.html trunk/index.php Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-06 12:19:52 UTC (rev 3275) +++ trunk/doc/Change.log.html 2010-01-06 12:53:48 UTC (rev 3276) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>06/01/10 Tim: index.php - Move the modules selection to the left of the screen <p>06/01/10 Tim: Form layout designer - Enable each company to have their own layouts for orders/invoices etc <p>04/01/10 Tim: api_stock.php - Correct typo in sql statement. <p>03/01/10 Phil: Fix SalesAnalysis_UserDefined.php - one too many brackets and indentation Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-01-06 12:19:52 UTC (rev 3275) +++ trunk/index.php 2010-01-06 12:53:48 UTC (rev 3276) @@ -52,11 +52,7 @@ } else { /* Security settings DO allow seeing the main menu */ ?> - <table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0"> - <tr> - <td class="main_menu"> - <table class="main_menu"> - <tr> + <table width="100%"><td><table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0"> <?php @@ -75,20 +71,16 @@ $_SESSION['Module']=$ModuleLink[$i]; } if ($ModuleLink[$i] == $_SESSION['Module']){ - echo '<td class="main_menu_selected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td>'; + echo '<tr><td class="main_menu_selected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; } else { - echo '<td class="main_menu_unselected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td>'; + echo '<tr><td class="main_menu_unselected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; } } $i++; } ?> - </tr> - </table> - </td> - </tr> - </table> + </table></td><td> <?php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-06 13:27:54
|
Revision: 3275 http://web-erp.svn.sourceforge.net/web-erp/?rev=3275&view=rev Author: tim_schofield Date: 2010-01-06 12:19:52 +0000 (Wed, 06 Jan 2010) Log Message: ----------- Enable each company to have their own layouts for orders/invoices etc Modified Paths: -------------- trunk/PO_PDFPurchOrder.php trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml trunk/doc/Change.log.html trunk/includes/PO_PDFOrderPageHeader.inc trunk/index.php Added Paths: ----------- trunk/FormDesigner.php Added: trunk/FormDesigner.php =================================================================== --- trunk/FormDesigner.php (rev 0) +++ trunk/FormDesigner.php 2010-01-06 12:19:52 UTC (rev 3275) @@ -0,0 +1,237 @@ +<?php +/* $Id$ */ +$PageSecurity = 14; +include('includes/session.inc'); +$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 +} +function SimpleTextLine($key) { + /* Displays a table row containing the attributes for a + * line of text of type `SimpleText` and the values + * given in the object $key + */ + $FontSizes=FontSizes(); + echo '<td class=number>'._('Font Size').' = '.'</td><td><select name="'.$key['id'].'FontSize">'; + foreach ($FontSizes as $FontSize) { + if ($FontSize==$key->FontSize) { + echo '<option selected value="'.$FontSize.'">'.$FontSize.'</option>'; + } else { + echo '<option value="'.$FontSize.'">'.$FontSize.'</option>'; + } + } + echo '</select></td>'; + /* Display the X co-ordinate (mm from the left hand side of page) */ + echo '<td class=number>'._('x').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'x" size=4 maxlength=4 value="'.$key->x.'"></td>'; + /* Display the Y co-ordinate (mm from the top of the page) */ + echo '<td class=number>'._('y').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'y" size=4 maxlength=4 value="'.$key->y.'"></td>'; +} +function MultiTextLine($key) { + /* Displays a table row containing the attributes for a + * line of text of type `MultiLineText` and the values + * given in the object $key + */ + $FontSizes=FontSizes(); + echo '<td class=number>'._('Font Size').' = '.'</td><td><select name="'.$key['id'].'FontSize">'; + foreach ($FontSizes as $FontSize) { + if ($FontSize==$key->FontSize) { + echo '<option selected value="'.$FontSize.'">'.$FontSize.'</option>'; + } else { + echo '<option value="'.$FontSize.'">'.$FontSize.'</option>'; + } + } + echo '</select></td>'; + /* Display the length of the field in mm */ + echo '<td class=number>'._('Length').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'Length" size=4 maxlength=4 value="'.$key->Length.'"></td></tr><tr>'; + /* Display the X co-ordinate (mm from the left hand side of page) */ + echo '<td class=number>'._('x').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'x" size=4 maxlength=4 value="'.$key->x.'"></td>'; + /* Display the Y co-ordinate (mm from the top of the page) */ + echo '<td class=number>'._('y').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'y" size=4 maxlength=4 value="'.$key->y.'"></td>'; +} +function DataTextLine($key) { + /* Displays a table row containing the attributes for a + * line of text of type `DataText` and the values + * given in the object $key + */ + $FontSizes=FontSizes(); + echo '<td class=number>'._('Font Size').' = '.'</td><td><select name="'.$key['id'].'FontSize">'; + foreach ($FontSizes as $FontSize) { + if ($FontSize==$key->FontSize) { + echo '<option selected value="'.$FontSize.'">'.$FontSize.'</option>'; + } else { + echo '<option value="'.$FontSize.'">'.$FontSize.'</option>'; + } + } + echo '</select></td>'; + /* Display the length of the field in mm */ + echo '<td class=number>'._('Length').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'Length" size=4 maxlength=4 value="'.$key->Length.'"></td>'; + /* Display the X co-ordinate (mm from the left hand side of page) */ + echo '<td class=number>'._('x').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'x" size=4 maxlength=4 value="'.$key->x.'"></td>'; +} +/* If the user has chosen to either preview the form, or + * save it then we first have to get the POST values into a + * simplexml object and then save the file as either a + * temporary file, or into the main code + */ +if (isset($_POST['preview']) or isset($_POST['save'])) { + /*First create a simple xml object from the main file */ + $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/'.$_POST['FormName']); + $FormDesign['name']=$_POST['formname']; + $FormDesign->PaperSize=$_POST['PaperSize']; + $FormDesign->LineHeight=$_POST['LineHeight']; + /*Iterate through the object filling in the values from + * the POST variables */ + foreach ($FormDesign as $key) { + foreach ($key as $subkey=>$value) { + if ($key['type']=='ElementArray') { + foreach ($value as $subsubkey=>$subvalue) { + $value->$subsubkey = $_POST[$value['id'].$subsubkey]; + } + } else { + $key->$subkey = $_POST[$key['id'].$subkey]; + } + } + } + /* If we are just previewing the form then + * save it to the temporary directory and call the + * PDF creating script */ + if (isset($_POST['preview'])) { + $FormDesign->asXML(sys_get_temp_dir().'/'.$_POST['FormName']); + echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PO_PDFPurchOrder.php?' . SID .'OrderNo=Preview">'; + } else { + /* otherwise check that the web server has write premissions on the companies + * directory and save the xml file to the correct directory */ + if (is_writable($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/'.$_POST['FormName'])) { + $FormDesign->asXML($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/'.$_POST['FormName']); + } else { + prnMsg( _('The web server does not have write permissions on the file ').'<br />'.$PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/'.$_POST['FormName']. + '<br />'._('Your changes cannot be saved').'<br />'._('See your system administrator to correct this problem'), 'error'); + } + } +} +/* If no form has been selected to edit, then offer a + * drop down list of possible forms */ +if (empty($_POST['FormName'])) { + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/maintenance.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'<br>'; + echo '<form method="post" id="ChooseForm" action="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; + echo '<table><tr>'; + echo '<td>'. _('Select the form to edit') .'</td><td><select name="FormName">'; + /* Iterate throght the appropriate companies FormDesigns/ directory + * and extract the form name from each of the xml files found */ + if ($handle = opendir($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/')) { + while (false !== ($file = readdir($handle))) { + if ($file[0]!='.') { + $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/'.$file); + echo '<option value="'.$file.'">'.$FormDesign['name'].'</option>'; + } + } + closedir($handle); + } + echo '</select></td></tr></table>'; + echo '<br /><div class="centre"><input tabindex="6" type="submit" name="submit" value="' . _('Edit Form Layout') . '" /></div>'; + echo '</form>'; + include('includes/footer.inc'); + exit; +} // End of if (empty($_POST['FormName'])) +/* If we are not previewing the form then load up the simplexml + * object from the main xml file */ +if (empty($_POST['preview'])) { + $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/'.$_POST['FormName']); +} +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/reports.png" title="' . _('Form Design') . '" alt="">' . ' ' . _('Form Design').'<br />'. $FormDesign['name'] . ''; +echo '<div class="page_help_text">' . _('Enter the changes that you want in the form layout below.') .'<br /> '. _('All measurements are in millimetres') . '.</div><br>'; +$Papers=array('A4_Landscape', 'A4_Portrait', 'A3_Lanscape', 'A3_Portrait'); // 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 '<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">'; +foreach ($Papers as $Paper) { + if ($Paper==$FormDesign->PaperSize) { + echo '<option selected value="'.$Paper.'">'.$Paper.'</option>'; + } else { + echo '<option value="'.$Paper.'">'.$Paper.'</option>'; + } +} +echo '</select></th>'; +/* and the standard line height for the form */ +echo '<th width=33%>'._('Line Height').'<input type="text" class="number" name="LineHeight" size=3 maxlength=3 value="'.$FormDesign->LineHeight.'"></th></tr><tr>'; +$counter=1; // Count how many sub tables are in the row +foreach ($FormDesign as $key) { + switch ($key['type']) { + case 'image': + echo '<td colspan=1 valign=top><table width=100% border=1><tr><th colspan=8>'.$key['name'].'</th></tr>'; + echo '<td class=number>'._('x').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'x" size=4 maxlength=4 value="'.$key->x.'"></td>'; + echo '<td class=number>'._('y').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'y" size=4 maxlength=4 value="'.$key->y.'"></td>'; + echo '<td class=number>'._('Width').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'width" size=4 maxlength=4 value="'.$key->width.'"></td>'; + echo '<td class=number>'._('Height').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'height" size=4 maxlength=4 value="'.$key->height.'"></td>'; + echo '</table></td>'; + $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>'; + 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>'; + 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>'; + foreach ($key as $subkey) { + if ($subkey['type']=='SimpleText') { + echo '<tr>'; + echo '<td>'.$subkey['name'].'</td>'; + SimpleTextLine($subkey); + echo '</tr>'; + } else { + echo '<tr>'; + if ($subkey['type']=='DataText') { + echo '<td>'.$subkey['name'].'</td>'; + DataTextLine($subkey); + } elseif ($subkey['type']=='StartLine') { + echo '<td colspan=3>'.$subkey['name'].' = '.'</td><td><input type="text" class="number" name="StartLine" size=4 maxlength=4 value="'.$key->y.'"></td>'; + } + echo '</tr>'; + } + } + echo '</table></td>'; + $counter=$counter+1; + break; + case 'CurvedRectangle': + echo '<td colspan=1 valign=top><table width=100% border=1><tr><th colspan=6>'.$key['name'].'</th></tr>'; + echo '<td class=number>'._('x').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'x" size=4 maxlength=4 value="'.$key->x.'"></td>'; + echo '<td class=number>'._('y').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'y" size=4 maxlength=4 value="'.$key->y.'"></td>'; + echo '<td class=number>'._('Width').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'width" size=4 maxlength=4 value="'.$key->width.'"></td></tr><tr>'; + echo '<td class=number>'._('Height').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'height" size=4 maxlength=4 value="'.$key->height.'"></td>'; + echo '<td class=number>'._('Radius').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'radius" size=3 maxlength=3 value="'.$key->radius.'"></td>'; + echo '</table></td>'; + $counter=$counter+1; + break; + case 'Rectangle': + echo '<td colspan=1 valign=top><table width=100% border=1><tr><th colspan=6>'.$key['name'].'</th></tr>'; + echo '<td class=number>'._('x').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'x" size=4 maxlength=4 value="'.$key->x.'"></td>'; + echo '<td class=number>'._('y').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'y" size=4 maxlength=4 value="'.$key->y.'"></td></tr><tr>'; + echo '<td class=number>'._('Width').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'width" size=4 maxlength=4 value="'.$key->width.'"></td>'; + echo '<td class=number>'._('Height').' = '.'</td><td><input type="text" class="number" name="'.$key['id'].'height" size=4 maxlength=4 value="'.$key->height.'"></td>'; + echo '</table></td>'; + $counter=$counter+1; + break; + } + if ($counter==4) { // If the row is full start a new one + $counter=1; + echo '</tr><tr>'; + } +} +echo '</tr></table>'; //End of outer table +echo '<br /><div class="centre"><input tabindex="6" type="submit" name="preview" value="' . _('Preview the Form Layout') . '" /></div>'; +echo '<br /><div class="centre"><input tabindex="6" type="submit" name="save" value="' . _('Save the Form Layout') . '" /></div>'; +echo '</form>'; +include('includes/footer.inc'); +?> \ No newline at end of file Property changes on: trunk/FormDesigner.php ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2010-01-06 09:35:10 UTC (rev 3274) +++ trunk/PO_PDFPurchOrder.php 2010-01-06 12:19:52 UTC (rev 3275) @@ -1,48 +1,48 @@ <?php - /* $Id$*/ - /* $Revision: 1.30 $ */ - $PageSecurity = 2; include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); - include('includes/DefinePOClass.php'); - if(!isset($_GET['OrderNo']) && !isset($_POST['OrderNo'])){ - $title = _('Select a Purchase Order'); - include('includes/header.inc'); - echo '<div class="centre"><br><br><br>'; - prnMsg( _('Select a Purchase Order Number to Print before calling this page') , 'error'); - echo '<br><br><br><table class="table_index"> + $title = _('Select a Purchase Order'); + include('includes/header.inc'); + echo '<div class="centre"><br><br><br>'; + prnMsg( _('Select a Purchase Order Number to Print before calling this page') , 'error'); + echo '<br><br><br><table class="table_index"> <tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> - <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> - </td></tr></table></div><br><br><br>'; - include('includes/footer.inc'); - exit(); + <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> + <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> + </td></tr></table></div><br><br><br>'; + include('includes/footer.inc'); + exit(); echo '<div class="centre"><br><br><br>' . _('This page must be called with a purchase order number to print'); echo '<br><a href="'. $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a></div>'; exit; } - if (isset($_GET['OrderNo'])){ $OrderNo = $_GET['OrderNo']; } elseif (isset($_POST['OrderNo'])){ $OrderNo = $_POST['OrderNo']; } - $title = _('Print Purchase Order Number').' '. $OrderNo; - -$sql='SELECT status +/* If we are not previewing the order then find + * the order status */ +if ($OrderNo != 'Preview') { + $sql='SELECT status FROM purchorders WHERE orderno='.$OrderNo; -$result=DB_query($sql, $db); -$myrow=DB_fetch_array($result); -$OrderStatus=$myrow['status']; - + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + $OrderStatus=$myrow['status']; +} else { + /* otherwise set it to Printed */ + $_POST['ShowAmounts']='Yes'; + $OrderStatus = _('Printed'); + $MakePDFThenDisplayIt = True; +} if ($OrderStatus != PurchOrder::STATUS_AUTHORISED and $OrderStatus != PurchOrder::STATUS_PRINTED) { include('includes/header.inc'); prnMsg( _('Purchase orders can only be printed once they have been authorised') . '. ' . @@ -50,22 +50,23 @@ include('includes/footer.inc'); exit; } - $ViewingOnly = 0; if (isset($_GET['ViewingOnly']) && $_GET['ViewingOnly']!='') { $ViewingOnly = $_GET['ViewingOnly']; } elseif (isset($_POST['ViewingOnly']) && $_POST['ViewingOnly']!='') { $ViewingOnly = $_POST['ViewingOnly']; } - - +/* If we are previewing the order then we dont + * want to email it */ +if ($OrderNo != 'Preview') { + $_POST['PrintOrEmail']='Print'; +} if (isset($_POST['DoIt']) AND ($_POST['PrintOrEmail']=='Print' || $ViewingOnly==1) ){ $MakePDFThenDisplayIt = True; } elseif (isset($_POST['DoIt']) AND $_POST['PrintOrEmail']=='Email' AND strlen($_POST['EmailTo'])>6){ $MakePDFThenEmailIt = True; } - -if (isset($OrderNo) && $OrderNo != "" && $OrderNo > 0){ +if (isset($OrderNo) && $OrderNo != "" && $OrderNo > 0 && $OrderNo != 'Preview'){ //Check this up front. Note that the myrow recordset is carried into the actual make pdf section /*retrieve the order details from the database to print */ $ErrMsg = _('There was a problem retrieving the purchase order header details for Order Number'). ' ' . $OrderNo . @@ -96,69 +97,90 @@ ON purchorders.supplierno = suppliers.supplierid WHERE purchorders.orderno=" . $OrderNo; $result=DB_query($sql,$db, $ErrMsg); - - if (DB_num_rows($result)==0){ /*There is ony one order header returned */ - + if (DB_num_rows($result)==0){ /*There is no order header returned */ $title = _('Print Purchase Order Error'); include('includes/header.inc'); echo '<div class="centre"><br><br><br>'; prnMsg( _('Unable to Locate Purchase Order Number') . ' : ' . $OrderNo . ' ', 'error'); echo '<br><br><br><table class="table_index"> <tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> - <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> - </td></tr></table></div><br><br><br>'; + <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li> + <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li> + </td></tr></table></div><br><br><br>'; include('includes/footer.inc'); exit(); - } elseif (DB_num_rows($result)==1){ /*There is only one order header returned */ - - $POHeader = DB_fetch_array($result); - if ($ViewingOnly==0) { - if ($POHeader['allowprint']==0){ - $title = _('Purchase Order Already Printed'); - include('includes/header.inc'); - echo '<p>'; - prnMsg( _('Purchase Order Number').' ' . $OrderNo . ' '. - _('has previously been printed') . '. ' . _('It was printed on'). ' ' . + $POHeader = DB_fetch_array($result); + if ($ViewingOnly==0) { + if ($POHeader['allowprint']==0){ + $title = _('Purchase Order Already Printed'); + include('includes/header.inc'); + echo '<p>'; + prnMsg( _('Purchase Order Number').' ' . $OrderNo . ' '. + _('has previously been printed') . '. ' . _('It was printed on'). ' ' . ConvertSQLDate($POHeader['dateprinted']) . '<br>'. - _('To re-print the order it must be modified to allow a reprint'). '<br>'. - _('This check is there to ensure that duplicate purchase orders are not sent to the supplier resulting in several deliveries of the same supplies'), 'warn'); - echo '<br><table class="table_index"> - <tr><td class="menu_group_item"> - <LI><a href="' . $rootpath . '/PO_PDFPurchOrder.php?' . SID . 'OrderNo=' . $OrderNo . '&ViewingOnly=1">'. + _('To re-print the order it must be modified to allow a reprint'). '<br>'. + _('This check is there to ensure that duplicate purchase orders are not sent to the supplier resulting in several deliveries of the same supplies'), 'warn'); + echo '<br><table class="table_index"> + <tr><td class="menu_group_item"> + <li><a href="' . $rootpath . '/PO_PDFPurchOrder.php?' . SID . 'OrderNo=' . $OrderNo . '&ViewingOnly=1">'. _('Print This Order as a Copy'). '</a> - <LI><a href="' . $rootpath . '/PO_Header.php?' . SID . 'ModifyOrderNumber=' . $OrderNo . '">'. + <li><a href="' . $rootpath . '/PO_Header.php?' . SID . 'ModifyOrderNumber=' . $OrderNo . '">'. _('Modify the order to allow a real reprint'). '</a>' . - '<LI><a href="'. $rootpath .'/PO_SelectPurchOrder.php?' . SID . '">'. + '<li><a href="'. $rootpath .'/PO_SelectPurchOrder.php?' . SID . '">'. _('Select another order'). '</a>'. - '<LI><a href="' . $rootpath . '/index.php?' . SID . '">'. _('Back to the menu').'</a>'; - echo '</BODY></HTML>'; - include('includes/footer.inc'); - exit; - }//AllowedToPrint - }//not ViewingOnly + '<li><a href="' . $rootpath . '/index.php?' . SID . '">'. _('Back to the menu').'</a>'; + include('includes/footer.inc'); + exit; + }//AllowedToPrint + }//not ViewingOnly }// 1 valid record }//if there is a valid order number - +else if ($OrderNo=='Preview') {// We are previewing the order +/* Fill the order header details with dummy data */ + $POHeader['supplierno']=str_pad('',10,'x'); + $POHeader['suppname']=str_pad('',40,'x'); + $POHeader['address1']=str_pad('',40,'x'); + $POHeader['address2']=str_pad('',40,'x'); + $POHeader['address3']=str_pad('',40,'x'); + $POHeader['address4']=str_pad('',30,'x'); + $POHeader['comments']=str_pad('',50,'x'); + $POHeader['orddate']='1900-01-01'; + $POHeader['rate']='0.0000'; + $POHeader['dateprinted']='1900-01-01'; + $POHeader['deladd1']=str_pad('',40,'x'); + $POHeader['deladd2']=str_pad('',40,'x'); + $POHeader['deladd3']=str_pad('',40,'x'); + $POHeader['deladd4']=str_pad('',40,'x'); + $POHeader['deladd5']=str_pad('',20,'x'); + $POHeader['deladd6']=str_pad('',15,'x'); + $POHeader['allowprint']=1; + $POHeader['requisitionno']=str_pad('',15,'x'); + $POHeader['initiator']=str_pad('',50,'x'); + $POHeader['paymentterms']=str_pad('',15,'x'); + $POHeader['currcode']='XXX'; +} // end of If we are previewing the order +/* Load the relevant xml file */ if (isset($MakePDFThenDisplayIt) or isset($MakePDFThenEmailIt)) { - $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/PurchaseOrder.xml'); - + if ($OrderNo=='Preview') { + $FormDesign = simplexml_load_file(sys_get_temp_dir().'/PurchaseOrder.xml'); + } else { + $FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/PurchaseOrder.xml'); + } +// Set the paper size/orintation $PaperSize = $FormDesign->PaperSize; - include('includes/PDFStarter.php'); $pdf->addInfo('Title', _('Purchase Order') ); $pdf->addInfo('Subject', _('Purchase Order Number' ) . ' ' . $OrderNo); $line_height = $FormDesign->LineHeight; $PageNumber = 1; - /* Then there's an order to print and its not been printed already (or its been flagged for reprinting) Now ... Has it got any line items */ - - $ErrMsg = _('There was a problem retrieving the line details for order number') . ' ' . $OrderNo . ' ' . + if ($OrderNo !='Preview') { // It is a real order + $ErrMsg = _('There was a problem retrieving the line details for order number') . ' ' . $OrderNo . ' ' . _('from the database'); - $sql = "SELECT itemcode, - deliverydate, + $sql = "SELECT itemcode, + deliverydate, itemdescription, unitprice, unitname as units, @@ -169,19 +191,25 @@ LEFT JOIN unitsofmeasure ON purchorderdetails.uom=unitsofmeasure.unitid WHERE orderno =" . $OrderNo; - $result=DB_query($sql,$db); - - if (DB_num_rows($result)>0){ - /*Yes there are line items to start the ball rolling with a page header */ - + $result=DB_query($sql,$db); + } + if ($OrderNo=='Preview' or DB_num_rows($result)>0){ + /*Yes there are line items to start the ball rolling with a page header */ include('includes/PO_PDFOrderPageHeader.inc'); - $YPos=$Page_Height - $FormDesign->Data->y; - $OrderTotal = 0; - - while ($POLine=DB_fetch_array($result)){ - + while ((isset($OrderNo) and $OrderNo=='Preview') or (isset($result) and $POLine=DB_fetch_array($result))) { + /* If we are previewing the order then fill the + * order line with dummy data */ + if ($OrderNo=='Preview') { + $POLine['itemcode']=str_pad('',10,'x'); + $POLine['deliverydate']='1900-01-01'; + $POLine['itemdescription']=str_pad('',50,'x'); + $POLine['unitprice']=9999.99; + $POLine['units']=str_pad('',4,'x'); + $POLine['quantityord']=999.99; + $POLine['decimalplaces']=2; + } $DisplayQty = number_format($POLine['quantityord'],$POLine['decimalplaces']); if ($_POST['ShowAmounts']=='Yes'){ $DisplayPrice = number_format($POLine['unitprice'],2); @@ -194,107 +222,97 @@ } else { $DisplayLineTotal = "----"; } - - //check the supplier code from code item - $sqlsupp = "SELECT supplierdescription - FROM purchdata - WHERE stockid='" . $POLine['itemcode'] . "' - AND supplierno ='" . $POHeader['supplierno'] . "' - AND price='".$POLine['unitprice']."'"; - - $SuppResult = DB_query($sqlsupp,$db); - $SuppDescRow = DB_fetch_row($SuppResult); + /* Dont search for supplier data if it is a preview */ + if ($OrderNo !='Preview') { + //check the supplier code from code item + $sqlsupp = "SELECT supplierdescription + FROM purchdata + WHERE stockid='" . $POLine['itemcode'] . "' + AND supplierno ='" . $POHeader['supplierno'] . "' + AND price='".$POLine['unitprice']."'"; + $SuppResult = DB_query($sqlsupp,$db); + $SuppDescRow = DB_fetch_row($SuppResult); + } else { + $SuppDescRow[0]=''; + } if($SuppDescRow[0]==""){ $Desc=$POLine['itemdescription']; }else{ $Desc="".$SuppDescRow['0']." - ".$POLine['itemdescription'].""; } $OrderTotal += ($POLine['unitprice']*$POLine['quantityord']); - - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$YPos,$FormDesign->Data->Column1->length,$FormDesign->Data->Column1->FontSize,$POLine['itemcode'], 'left'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$YPos,$FormDesign->Data->Column2->length,$FormDesign->Data->Column2->FontSize,$Desc, 'left'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x,$YPos,$FormDesign->Data->Column3->length,$FormDesign->Data->Column3->FontSize,$DisplayQty, 'left'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column4->x,$YPos,$FormDesign->Data->Column4->length,$FormDesign->Data->Column4->FontSize,$POLine['units'], 'left'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column5->x,$YPos,$FormDesign->Data->Column5->length,$FormDesign->Data->Column5->FontSize,$DisplayDelDate, 'left'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column6->x,$YPos,$FormDesign->Data->Column6->length,$FormDesign->Data->Column6->FontSize,$DisplayPrice, 'right'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column7->x,$YPos,$FormDesign->Data->Column7->length,$FormDesign->Data->Column7->FontSize,$DisplayLineTotal, 'right'); - + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$YPos,$FormDesign->Data->Column1->Length,$FormDesign->Data->Column1->FontSize,$POLine['itemcode'], 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize,$Desc, 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x,$YPos,$FormDesign->Data->Column3->Length,$FormDesign->Data->Column3->FontSize,$DisplayQty, 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column4->x,$YPos,$FormDesign->Data->Column4->Length,$FormDesign->Data->Column4->FontSize,$POLine['units'], 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column5->x,$YPos,$FormDesign->Data->Column5->Length,$FormDesign->Data->Column5->FontSize,$DisplayDelDate, 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column6->x,$YPos,$FormDesign->Data->Column6->Length,$FormDesign->Data->Column6->FontSize,$DisplayPrice, 'right'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column7->x,$YPos,$FormDesign->Data->Column7->Length,$FormDesign->Data->Column7->FontSize,$DisplayLineTotal, 'right'); if (strlen($LeftOvers)>1){ $LeftOvers = $pdf->addTextWrap($Left_Margin+1+94,$YPos-$line_height,270,$FontSize,$LeftOvers, 'left'); $YPos-=$line_height; } - if ($YPos-$line_height <= $Bottom_Margin){ - /* We reached the end of the page so finsih off the page and start a newy */ + /* We reached the end of the page so finsih off the page and start a newy */ $PageNumber++; include ('includes/PO_PDFOrderPageHeader.inc'); } //end if need a new page headed up - /*increment a line down for the next line item */ $YPos -= $line_height; - + /* If we are previewing we want to stop showing order + * lines after the first one */ + if ($OrderNo=='Preview') { +// unlink(sys_get_temp_dir().'/PurchaseOrder.xml'); + unset($OrderNo); + } } //end while there are line items to print out - if ($YPos-$line_height <= $Bottom_Margin){ // need to ensure space for totals - $PageNumber++; + $PageNumber++; include ('includes/PO_PDFOrderPageHeader.inc'); } //end if need a new page headed up - - if ($_POST['ShowAmounts']=='Yes'){ $DisplayOrderTotal = number_format($OrderTotal,2); } else { $DisplayOrderTotal = "----"; } - $YPos = $Bottom_Margin + $line_height; $pdf->addText($FormDesign->OrderTotalCaption->x,$Page_Height - $FormDesign->OrderTotalCaption->y, $FormDesign->OrderTotalCaption->FontSize, _('Order Total - excl tax'). ' ' . $POHeader['currcode']); - $LeftOvers = $pdf->addTextWrap($FormDesign->OrderTotal->x,$Page_Height - $FormDesign->OrderTotal->y,$Page_Height - $FormDesign->OrderTotal->length,$FormDesign->OrderTotal->FontSize,$DisplayOrderTotal, 'right'); - + $LeftOvers = $pdf->addTextWrap($FormDesign->OrderTotal->x,$Page_Height - $FormDesign->OrderTotal->y,$FormDesign->OrderTotal->Length,$FormDesign->OrderTotal->FontSize,$DisplayOrderTotal, 'right'); } /*end if there are order details to show on the order*/ - //} /* end of check to see that there was an order selected to print */ - - //failed var to allow us to print if the email fails. - $failed = false; - if ($MakePDFThenDisplayIt){ - - $pdf->OutputD($_SESSION['DatabaseName'] . '_PurchaseOrder_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN - - } else { /* must be MakingPDF to email it */ - - /* UldisN - $pdfcode = $pdf->output(); - $fp = fopen( $_SESSION['reports_dir'] . '/PurchOrder.pdf','wb'); - fwrite ($fp, $pdfcode); - fclose ($fp); - */ - - $PdfFileName = $_SESSION['DatabaseName'] . '_PurchaseOrder_' . date('Y-m-d') . '.pdf'; - $ReportsDirName = $_SESSION['reports_dir']; - $pdf->Output($ReportsDirName . '/' . $PdfFileName,'F');//UldisN - $pdf->__destruct(); //UldisN - - include('includes/htmlMimeMail.php'); - - $mail = new htmlMimeMail(); - $attachment = $mail->getFile($ReportsDirName . '/' . $PdfFileName); - $mail->setText( _('Please find herewith our purchase order number').' ' . $OrderNo); - $mail->setSubject( _('Purchase Order Number').' ' . $OrderNo); - $mail->addAttachment($attachment, $PdfFileName, 'application/pdf'); - $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . "<" . $_SESSION['CompanyRecord']['email'] .">"); - $result = $mail->send(array($_POST['EmailTo'])); - if ($result==1){ - $failed = false; - echo '<p>'; - prnMsg( _('Purchase Order'). ' ' . $OrderNo.' ' . _('has been emailed to') .' ' . $_POST['EmailTo'] . ' ' . _('as directed'), 'success'); - } else { - $failed = true; - echo '<p>'; - prnMsg( _('Emailing Purchase order'). ' ' . $OrderNo.' ' . _('to') .' ' . $_POST['EmailTo'] . ' ' . _('failed'), 'error'); - } - - } - + //} /* end of check to see that there was an order selected to print */ + //failed var to allow us to print if the email fails. + $failed = false; + if ($MakePDFThenDisplayIt){ + $pdf->OutputD($_SESSION['DatabaseName'] . '_PurchaseOrder_' . date('Y-m-d') . '.pdf');//UldisN + $pdf->__destruct(); //UldisN + } else { /* must be MakingPDF to email it */ + /* UldisN + $pdfcode = $pdf->output(); + $fp = fopen( $_SESSION['reports_dir'] . '/PurchOrder.pdf','wb'); + fwrite ($fp, $pdfcode); + fclose ($fp); + */ + $PdfFileName = $_SESSION['DatabaseName'] . '_PurchaseOrder_' . date('Y-m-d') . '.pdf'; + $ReportsDirName = $_SESSION['reports_dir']; + $pdf->Output($ReportsDirName . '/' . $PdfFileName,'F');//UldisN + $pdf->__destruct(); //UldisN + include('includes/htmlMimeMail.php'); + $mail = new htmlMimeMail(); + $attachment = $mail->getFile($ReportsDirName . '/' . $PdfFileName); + $mail->setText( _('Please find herewith our purchase order number').' ' . $OrderNo); + $mail->setSubject( _('Purchase Order Number').' ' . $OrderNo); + $mail->addAttachment($attachment, $PdfFileName, 'application/pdf'); + $mail->setFrom($_SESSION['CompanyRecord']['coyname'] . "<" . $_SESSION['CompanyRecord']['email'] .">"); + $result = $mail->send(array($_POST['EmailTo'])); + if ($result==1){ + $failed = false; + echo '<p>'; + prnMsg( _('Purchase Order'). ' ' . $OrderNo.' ' . _('has been emailed to') .' ' . $_POST['EmailTo'] . ' ' . _('as directed'), 'success'); + } else { + $failed = true; + echo '<p>'; + prnMsg( _('Emailing Purchase order'). ' ' . $OrderNo.' ' . _('to') .' ' . $_POST['EmailTo'] . ' ' . _('failed'), 'error'); + } + } if ($ViewingOnly==0 && !$failed) { $commentsql='SELECT initiator,stat_comment FROM purchorders WHERE orderno='.$OrderNo; $commentresult=DB_query($commentsql,$db); @@ -307,23 +325,20 @@ $StatusComment=$date.' - Printed by <a href="mailto:'.$emailrow['email'].'">'.$_SESSION['UserID']. '</a><br>'.$comment; $sql = " - UPDATE purchorders + UPDATE purchorders SET - allowprint = 0, + allowprint = 0, dateprinted = '" . Date('Y-m-d') . "', - status = '" . PurchOrder::STATUS_PRINTED . "', + status = '" . PurchOrder::STATUS_PRINTED . "', stat_comment = '" . $StatusComment . "' WHERE - purchorders.orderno = " . $OrderNo; + purchorders.orderno = " . $OrderNo; $result = DB_query($sql,$db); } - } /* There was enough info to either print or email the purchase order */ else { /*the user has just gone into the page need to ask the question whether to print the order or email it to the supplier */ - include ('includes/header.inc'); echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>'; - if ($ViewingOnly==1){ echo '<input type=hidden name="ViewingOnly" VALUE=1>'; } @@ -331,11 +346,9 @@ echo '<input type=hidden name="OrderNo" VALUE="'. $OrderNo. '">'; echo '<table><tr><td>'. _('Print or Email the Order'). '</td><td> <select name="PrintOrEmail">'; - if (!isset($_POST['PrintOrEmail'])){ $_POST['PrintOrEmail'] = 'Print'; } - if ($_POST['PrintOrEmail']=='Print'){ echo '<option selected VALUE="Print">'. _('Print'); echo '<option VALUE="Email">' . _('Email'); @@ -344,14 +357,11 @@ echo '<option selected VALUE="Email">'. _('Email'); } echo '</select></td></tr>'; - echo '<tr><td>'. _('Show Amounts on the Order'). '</td><td> <select name="ShowAmounts">'; - if (!isset($_POST['ShowAmounts'])){ $_POST['ShowAmounts'] = 'Yes'; } - if ($_POST['ShowAmounts']=='Yes'){ echo '<option selected VALUE="Yes">'. _('Yes'); echo '<option VALUE="No">' . _('No'); @@ -359,7 +369,6 @@ echo '<option VALUE="Yes">'. _('Yes'); echo '<option selected VALUE="No">'. _('No'); } - echo '</select></td></tr>'; if ($_POST['PrintOrEmail']=='Email'){ $ErrMsg = _('There was a problem retrieving the contact details for the supplier'); @@ -369,7 +378,6 @@ ON suppliercontacts.supplierid=purchorders.supplierno WHERE purchorders.orderno=$OrderNo"; $ContactsResult=DB_query($SQL,$db, $ErrMsg); - if (DB_num_rows($ContactsResult)>0){ echo '<tr><td>'. _('Email to') .':</td><td><select name="EmailTo">'; while ($ContactDetails = DB_fetch_array($ContactsResult)){ @@ -395,4 +403,4 @@ echo '</form>'; include('includes/footer.inc'); } -?> +?> \ No newline at end of file Modified: trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml =================================================================== --- trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml 2010-01-06 09:35:10 UTC (rev 3274) +++ trunk/companies/weberpdemo/FormDesigns/PurchaseOrder.xml 2010-01-06 12:19:52 UTC (rev 3275) @@ -1,273 +1,273 @@ -<?xml version="1.0" encoding="UTF-8" ?> +<?xml version="1.0" encoding="UTF-8"?> <form name="Purchase Order"> <PaperSize name="Paper size">A4_Landscape</PaperSize> - <LineHeight name "Line height">16</LineHeight> - <logo type="logo" name="Logo"> + <LineHeight name="Line height">16</LineHeight> + <logo type="image" name="Logo" id="Logo"> <x>0</x> <y>62</y> <width>0</width> <height>60</height> </logo> - <OrderNumber type="SimpleText" name="Order Number"> + <OrderNumber type="SimpleText" name="Order Number" id="OrderNumber"> <FontSize>15</FontSize> <x>391</x> <y>46</y> </OrderNumber> - <ViewingOnly type="SimpleText" name="Viewing only text"> + <ViewingOnly type="SimpleText" name="Viewing only warning text" id="ViewingOnly"> <FontSize>16</FontSize> <x>391</x> <y>62</y> </ViewingOnly> - <PageNumber type="SimpleText" name="Page number"> + <PageNumber type="SimpleText" name="Page number" id="PageNumber"> <FontSize>10</FontSize> <x>762</x> <y>70</y> </PageNumber> - <TaxAuthority type="SimpleText" name="Tax Authority"> + <TaxAuthority type="SimpleText" name="Tax Authority" id="TaxAuthority"> <FontSize>10</FontSize> <x>40</x> <y>106</y> </TaxAuthority> - <CompanyName type="SimpleText" name="Company name"> + <CompanyName type="SimpleText" name="Company name" id="CompanyName"> <FontSize>10</FontSize> <x>40</x> <y>122</y> </CompanyName> <CompanyAddress type="ElementArray" name="Company address"> - <Line1 type="SimpleText" name="Company address line 1"> + <Line1 type="SimpleText" name="Line 1" id="CompanyAddress1"> <FontSize>10</FontSize> <x>40</x> <y>132</y> </Line1> - <Line2 type="SimpleText" name="Company address line 2"> + <Line2 type="SimpleText" name="Line 2" id="CompanyAddress2"> <FontSize>10</FontSize> <x>40</x> <y>142</y> </Line2> - <Line3 type="SimpleText" name="Company address line 3"> + <Line3 type="SimpleText" name="Line 3" id="CompanyAddress3"> <FontSize>10</FontSize> <x>40</x> <y>152</y> </Line3> - <Line4 type="SimpleText" name="Company address line 4"> + <Line4 type="SimpleText" name="Line 4" id="CompanyAddress4"> <FontSize>10</FontSize> <x>40</x> <y>162</y> </Line4> - <Line5 type="SimpleText" name="Company address line 5"> + <Line5 type="SimpleText" name="Line 5" id="CompanyAddress5"> <FontSize>10</FontSize> <x>40</x> <y>172</y> </Line5> </CompanyAddress> - <CompanyPhone type="SimpleText" name="Company phone number"> + <CompanyPhone type="SimpleText" name="Company phone number" id="CompanyPhone"> <FontSize>10</FontSize> <x>40</x> <y>182</y> </CompanyPhone> - <CompanyFax type="SimpleText" name="Company fax number"> + <CompanyFax type="SimpleText" name="Company fax number" id="CompanyFax"> <FontSize>10</FontSize> <x>40</x> <y>192</y> </CompanyFax> - <CompanyEmail type="SimpleText" name="Company email address"> + <CompanyEmail type="SimpleText" name="Company email address" id="CompanyEmail"> <FontSize>10</FontSize> <x>40</x> <y>202</y> </CompanyEmail> <DeliveryAddress type="ElementArray" name="Delivery address"> - <Caption type="SimpleText" name="Delivery address caption"> + <Caption type="SimpleText" name="Caption" id="DeliveryAddressCaption"> <FontSize>12</FontSize> <x>448</x> <y>154</y> </Caption> - <Line1 type="SimpleText" name="Delivery address line 1"> + <Line1 type="SimpleText" name="Line 1" id="DeliveryAddress1"> <FontSize>12</FontSize> <x>448</x> <y>166</y> </Line1> - <Line2 type="SimpleText" name="Delivery address line 2"> + <Line2 type="SimpleText" name="Line 2" id="DeliveryAddress2"> <FontSize>12</FontSize> <x>448</x> <y>178</y> </Line2> - <Line3 type="SimpleText" name="Delivery address line 3"> + <Line3 type="SimpleText" name="Line 3" id="DeliveryAddress3"> <FontSize>12</FontSize> <x>448</x> <y>190</y> </Line3> - <Line4 type="SimpleText" name="Delivery address line 4"> + <Line4 type="SimpleText" name="Line 4" id="DeliveryAddress4"> <FontSize>12</FontSize> <x>448</x> <y>202</y> </Line4> - <Line5 type="SimpleText" name="Delivery address line 5"> + <Line5 type="SimpleText" name="Line 5" id="DeliveryAddress5"> <FontSize>12</FontSize> <x>448</x> <y>214</y> </Line5> - <Line6 type="SimpleText" name="Delivery address line 6"> + <Line6 type="SimpleText" name="Line 6" id="DeliveryAddress6"> <FontSize>12</FontSize> <x>448</x> <y>226</y> </Line6> </DeliveryAddress> - <DeliveryAddressBox type="CurvedRectangle" name="Delivery address box"> + <DeliveryAddressBox type="CurvedRectangle" name="Delivery address box" id="DeliveryAddressBox"> <x>446</x> <y>145</y> <width>240</width> <height>80</height> <radius>10</radius> </DeliveryAddressBox> - <SupplierName type="SimpleText" name="Supplier name"> + <SupplierName type="SimpleText" name="Supplier name" id="SupplierName"> <FontSize>12</FontSize> <x>41</x> <y>246</y> </SupplierName> <SupplierAddress type="ElementArray" name="Supplier address"> - <Line1 type="SimpleText" name="Supplier address line 1"> + <Line1 type="SimpleText" name="Line 1" id="SupplierAddress1"> <FontSize>12</FontSize> <x>71</x> <y>262</y> </Line1> - <Line2 type="SimpleText" name="Supplier address line 2"> + <Line2 type="SimpleText" name="Line 2" id="SupplierAddress2"> <FontSize>12</FontSize> <x>71</x> <y>274</y> </Line2> - <Line3 type="SimpleText" name="Supplier address line 3"> + <Line3 type="SimpleText" name="Line 3" id="SupplierAddress3"> <FontSize>12</FontSize> <x>71</x> <y>286</y> </Line3> - <Line4 type="SimpleText" name="Supplier address line 4"> + <Line4 type="SimpleText" name="Line 4" id="SupplierAddress4"> <FontSize>12</FontSize> <x>71</x> <y>298</y> </Line4> </SupplierAddress> - <OrderDate type="SimpleText" name="Order date"> + <OrderDate type="SimpleText" name="Order date" id="OrderDate"> <FontSize>12</FontSize> <x>446</x> <y>262</y> </OrderDate> - <Initiator type="SimpleText" name="Order initiator"> + <Initiator type="SimpleText" name="Order initiator" id="Initiator"> <FontSize>12</FontSize> <x>446</x> <y>278</y> </Initiator> - <PaymentTerms type="SimpleText" name="Payment terms"> + <PaymentTerms type="SimpleText" name="Payment terms" id="PaymentTerms"> <FontSize>12</FontSize> <x>446</x> <y>290</y> </PaymentTerms> - <Comments type="MultiLineText" name="Comments"> + <Comments type="MultiLineText" name="Comments" id="Comments"> <FontSize>12</FontSize> <Length>250</Length> <x>446</x> <y>302</y> </Comments> - <Currency type="SimpleText" name="Currency text"> + <Currency type="SimpleText" name="Currency text" id="Currency"> <FontSize>12</FontSize> <x>40</x> <y>312</y> </Currency> - <HeaderRectangle type="Rectangle" name="Header rectangle"> + <HeaderRectangle type="Rectangle" name="Header rectangle" id="HeaderRectangle"> <x>40</x> <y>320</y> <width>772</width> <height>32</height> </HeaderRectangle> <Headings type="ElementArray" name="Column headings"> - <Column1 type="SimpleText" name="Column heading 1"> + <Column1 type="SimpleText" name="Heading 1" id="Heading1"> <FontSize>10</FontSize> <x>41</x> <y>330</y> </Column1> - <Column2 type="SimpleText" name="Column heading 2"> + <Column2 type="SimpleText" name="Heading 2" id="Heading2"> <FontSize>10</FontSize> <x>136</x> <y>330</y> </Column2> - <Column3 type="SimpleText" name="Column heading 3"> + <Column3 type="SimpleText" name="Heading 3" id="Heading3"> <FontSize>10</FontSize> <x>441</x> <y>330</y> </Column3> - <Column4 type="SimpleText" name="Column heading 4"> + <Column4 type="SimpleText" name="Heading 4" id="Heading4"> <FontSize>10</FontSize> <x>491</x> <y>330</y> </Column4> - <Column5 type="SimpleText" name="Column heading 5"> + <Column5 type="SimpleText" name="Heading 5" id="Heading5"> <FontSize>10</FontSize> <x>526</x> <y>330</y> </Column5> - <Column6 type="SimpleText" name="Column heading 6"> + <Column6 type="SimpleText" name="Heading 6" id="Heading6"> <FontSize>10</FontSize> <x>641</x> <y>330</y> </Column6> - <Column7 type="SimpleText" name="Column heading 7"> + <Column7 type="SimpleText" name="Heading 7" id="Heading7"> <FontSize>10</FontSize> <x>761</x> <y>330</y> </Column7> </Headings> - <DataRectangle type="Rectangle" name="Header rectangle"> + <DataRectangle type="Rectangle" name="Data rectangle" id="DataRectangle"> <x>40</x> <y>352</y> <width>772</width> <height>213</height> </DataRectangle> <Data type="ElementArray" name="Column Data"> - <y>362</y> - <Column1 type="DataText" name="Data column 1"> + <y type="StartLine" name="Y co-ordinate of first data line" id="DataStartLine">362</y> + <Column1 type="DataText" name="Column 1" id="Data1"> <FontSize>10</FontSize> <x>41</x> - <length>94</length> + <Length>94</Length> </Column1> - <Column2 type="DataText" name="Data column 2"> + <Column2 type="DataText" name="Column 2" id="Data2"> <FontSize>10</FontSize> <x>136</x> - <length>270</length> + <Length>270</Length> </Column2> - <Column3 type="DataText" name="Data column 3"> + <Column3 type="DataText" name="Column 3" id="Data3"> <FontSize>10</FontSize> <x>441</x> - <length>85</length> + <Length>85</Length> </Column3> - <Column4 type="DataText" name="Data column 4"> + <Column4 type="DataText" name="Column 4" id="Data4"> <FontSize>10</FontSize> <x>491</x> - <length>37</length> + <Length>37</Length> </Column4> - <Column5 type="DataText" name="Data column 5"> + <Column5 type="DataText" name="Column 5" id="Data5"> <FontSize>10</FontSize> <x>526</x> - <length>60</length> + <Length>60</Length> </Column5> - <Column6 type="DataText" name="Data column 6"> + <Column6 type="DataText" name="Column 6" id="Data6"> <FontSize>10</FontSize> <x>591</x> - <length>85</length> + <Length>85</Length> </Column6> - <Column7 type="DataText" name="Data column 7"> + <Column7 type="DataText" name="Column 7" id="Data7"> <FontSize>10</FontSize> - <x>721</x> - <length>85</length> + <x>661</x> + <Length>130</Length> </Column7> </Data> - <OrderTotalCaption type="SimpleText" name="Order total caption"> + <OrderTotalCaption type="SimpleText" name="Order total caption" id="OrderTotalCaption"> <FontSize>14</FontSize> <x>450</x> <y>549</y> </OrderTotalCaption> - <OrderTotal type="MultiLineText" name="Order total"> + <OrderTotal type="MultiLineText" name="Order total" id="OrderTotal"> <FontSize>14</FontSize> <x>665</x> <y>549</y> - <length>135</length> + <Length>125</Length> </OrderTotal> </form> \ No newline at end of file Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-06 09:35:10 UTC (rev 3274) +++ trunk/doc/Change.log.html 2010-01-06 12:19:52 UTC (rev 3275) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>06/01/10 Tim: Form layout designer - Enable each company to have their own layouts for orders/invoices etc <p>04/01/10 Tim: api_stock.php - Correct typo in sql statement. <p>03/01/10 Phil: Fix SalesAnalysis_UserDefined.php - one too many brackets and indentation <p>02/01/10 Tim: Allow pdf output of the asset register. Modified: trunk/includes/PO_PDFOrderPageHeader.inc =================================================================== --- trunk/includes/PO_PDFOrderPageHeader.inc 2010-01-06 09:35:10 UTC (rev 3274) +++ trunk/includes/PO_PDFOrderPageHeader.inc 2010-01-06 12:19:52 UTC (rev 3275) @@ -5,25 +5,18 @@ a new page is implicit on the establishment of a new pdf object so only for subsequent pages */ - if ($PageNumber>1){ $pdf->newPage(); } - $pdf->addJpegFromFile($_SESSION['LogoFile'],$Left_Margin+$FormDesign->logo->x,$Page_Height- $FormDesign->logo->y,$FormDesign->logo->width,$FormDesign->logo->height); - $pdf->addText($FormDesign->OrderNumber->x,$Page_Height- $FormDesign->OrderNumber->y,$FormDesign->OrderNumber->FontSize, _('Purchase Order Number'). ' ' . $OrderNo); - if ($ViewingOnly!=0) { $pdf->addText($FormDesign->ViewingOnly->x,$Page_Height - $FormDesign->ViewingOnly->y,$FormDesign->ViewingOnly->FontSize, _('FOR VIEWING ONLY') . ', ' . _('DO NOT SEND TO SUPPLIER') ); $pdf->addText($FormDesign->ViewingOnly->x,$Page_Height - $FormDesign->ViewingOnly->y-$line_height,$FormDesign->ViewingOnly->FontSize, _('SUPPLIERS') . ' - ' . _('THIS IS NOT AN ORDER') ); } - $pdf->addText($FormDesign->PageNumber->x,$Page_Height - $FormDesign->PageNumber->y, $FormDesign->PageNumber->FontSize, _('Page') . ': ' .$PageNumber); - /*Now print out the company Tax authority reference */ $pdf->addText($FormDesign->TaxAuthority->x,$Page_Height - $FormDesign->TaxAuthority->y, $FormDesign->TaxAuthority->FontSize, $_SESSION['TaxAuthorityReferenceName'] . ' ' . $_SESSION['CompanyRecord']['gstno']); - /*Now print out the company name and address */ $pdf->addText($FormDesign->CompanyName->x,$Page_Height - $FormDesign->CompanyName->y, $FormDesign->CompanyName->FontSize, $_SESSION['CompanyRecord']['coyname']); $pdf->addText($FormDesign->CompanyAddress->Line1->x,$Page_Height - $FormDesign->CompanyAddress->Line1->y, $FormDesign->CompanyAddress->Line1->FontSize, $_SESSION['CompanyRecord']['regoffice1']); @@ -34,7 +27,6 @@ $pdf->addText($FormDesign->CompanyPhone->x,$Page_Height - $FormDesign->CompanyPhone->y, $FormDesign->CompanyPhone->FontSize, _('Tel'). ': ' . $_SESSION['CompanyRecord']['telephone']); $pdf->addText($FormDesign->CompanyFax->x,$Page_Height - $FormDesign->CompanyFax->y, $FormDesign->CompanyFax->FontSize, _('Fax').': ' . $_SESSION['CompanyRecord']['fax']); $pdf->addText($FormDesign->CompanyEmail->x,$Page_Height - $FormDesign->CompanyEmail->y, $FormDesign->CompanyEmail->FontSize, _('Email'). ': ' .$_SESSION['CompanyRecord']['email']); - /*Now the delivery details */ $pdf->addText($FormDesign->DeliveryAddress->Caption->x,$Page_Height - $FormDesign->DeliveryAddress->Caption->y, $FormDesign->DeliveryAddress->Caption->FontSize, _('Deliver To') . ':' ); $pdf->addText($FormDesign->DeliveryAddress->Line1->x,$Page_Height - $FormDesign->DeliveryAddress->Line1->y, $FormDesign->DeliveryAddress->Line1->FontSize, $POHeader['deladd1']); @@ -43,10 +35,8 @@ $pdf->addText($FormDesign->DeliveryAddress->Line4->x,$Page_Height - $FormDesign->DeliveryAddress->Line4->y, $FormDesign->DeliveryAddress->Line4->FontSize, $POHeader['deladd4']); $pdf->addText($FormDesign->DeliveryAddress->Line5->x,$Page_Height - $FormDesign->DeliveryAddress->Line5->y, $FormDesign->DeliveryAddress->Line5->FontSize, $POHeader['deladd5']); $pdf->addText($FormDesign->DeliveryAddress->Line6->x,$Page_Height - $FormDesign->DeliveryAddress->Line6->y, $FormDesign->DeliveryAddress->Line6->FontSize, $POHeader['deladd6']); - /*draw a nice curved corner box around the delivery to address */ $pdf->RoundRectangle($FormDesign->DeliveryAddressBox->x, $Page_Height - $FormDesign->DeliveryAddressBox->y,$FormDesign->DeliveryAddressBox->width, $FormDesign->DeliveryAddressBox->height, $FormDesign->DeliveryAddressBox->radius); - /*Now the Supplier details */ $pdf->addText($FormDesign->SupplierName->x,$Page_Height - $FormDesign->SupplierName->y, $FormDesign->SupplierName->FontSize, _('To').': '); $pdf->addText($FormDesign->SupplierName->x+30,$Page_Height - $FormDesign->SupplierName->y, $FormDesign->SupplierName->FontSize, $POHeader['suppname']); @@ -54,33 +44,31 @@ $pdf->addText($FormDesign->SupplierAddress->Line2->x,$Page_Height - $FormDesign->SupplierAddress->Line2->y, $FormDesign->SupplierAddress->Line2->FontSize, $POHeader['address2']); $pdf->addText($FormDesign->SupplierAddress->Line3->x,$Page_Height - $FormDesign->SupplierAddress->Line3->y, $FormDesign->SupplierAddress->Line3->FontSize, $POHeader['address3']); $pdf->addText($FormDesign->SupplierAddress->Line4->x,$Page_Height - $FormDesign->SupplierAddress->Line4->y, $FormDesign->SupplierAddress->Line4->FontSize, $POHeader['address4']); - /*Now the Order date */ $pdf->addText($FormDesign->OrderDate->x,$Page_Height - $FormDesign->OrderDate->y, $FormDesign->OrderDate->FontSize, _('Order Date') . ':' ); $pdf->addText($FormDesign->OrderDate->x+70,$Page_Height - $FormDesign->OrderDate->y, $FormDesign->OrderDate->FontSize, ConvertSQLDate($POHeader['orddate'])); - /*Now the Initiator */ $pdf->addText($FormDesign->Initiator->x,$Page_Height - $FormDesign->Initiator->y, $FormDesign->Initiator->FontSize, _('Initiator').': '); $pdf->addText($FormDesign->Initiator->x+70,$Page_Height - $FormDesign->Initiator->y, $FormDesign->Initiator->FontSize, $POHeader['initiator']); - -/*Find the description of the payment terms and display */ -$sql='SELECT terms FROM paymentterms where termsindicator="'.$POHeader['paymentterms'].'"'; -$termsresult=DB_query($sql, $db); -$myrow=DB_fetch_array($termsresult); -$pdf->addText($FormDesign->PaymentTerms->x,$Page_Height - $FormDesign->PaymentTerms->y, $FormDesign->PaymentTerms->FontSize, _('Payment Terms').' : '.$myrow['terms']); - +/*Find the description of the payment terms and display. + * If it is a preview then just insert dummy data */ +if ($OrderNo != 'Preview') { + $sql='SELECT terms FROM paymentterms where termsindicator="'.$POHeader['paymentterms'].'"'; + $termsresult=DB_query($sql, $db); + $myrow=DB_fetch_array($termsresult); + $pdf->addText($FormDesign->PaymentTerms->x,$Page_Height - $FormDesign->PaymentTerms->y, $FormDesign->PaymentTerms->FontSize, _('Payment Terms').' : '.$myrow['terms']); +} else { + $pdf->addText($FormDesign->PaymentTerms->x,$Page_Height - $FormDesign->PaymentTerms->y, $FormDesign->PaymentTerms->FontSize, _('Payment Terms').' : '.'XXXXXXXX'); +} /*Now the Comments split over two lines if necessary */ $LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x, $Page_Height - $FormDesign->Comments->y,$FormDesign->Comments->Length,$FormDesign->Comments->FontSize,_('Comments') . ':' .$POHeader['comments'], 'left'); if (strlen($LeftOvers)>0){ $LeftOvers = $pdf->addTextWrap($FormDesign->Comments->x, $Page_Height - $FormDesign->Comments->y-$line_height,$FormDesign->Comments->Length,$FormDesign->Comments->FontSize,$LeftOvers, 'left'); } - /*Now the currency the order is in */ $pdf->addText($FormDesign->Currency->x,$Page_Height - $FormDesign->Currency->y,$FormDesign->Currency->FontSize, _('All amounts stated in').' - ' . $POHeader['currcode']); - /*draw a square grid for entering line headings */ $pdf->Rectangle($FormDesign->HeaderRectangle->x, $Page_Height - $FormDesign->HeaderRectangle->y, $FormDesign->HeaderRectangle->width,$FormDesign->HeaderRectangle->height); - /*Set up headings */ $pdf->addText($FormDesign->Headings->Column1->x,$Page_Height - $FormDesign->Headings->Column1->y, $FormDesign->Headings->Column1->FontSize, _('Code') ); $pdf->addText($FormDesign->Headings->Column2->x,$Page_Height - $FormDesign->Headings->Column2->y, $FormDesign->Headings->Column2->FontSize, _('Item Description') ); @@ -89,8 +77,6 @@ $pdf->addText($FormDesign->Headings->Column5->x,$Page_Height - $FormDesign->Headings->Column5->y, $FormDesign->Headings->Column5->FontSize, _('Date Reqd')); $pdf->addText($FormDesign->Headings->Column6->x,$Page_Height - $FormDesign->Headings->Column6->y, $FormDesign->Headings->Column6->FontSize, _('Price') ); $pdf->addText($FormDesign->Headings->Column7->x,$Page_Height - $FormDesign->Headings->Column7->y, $FormDesign->Headings->Column7->FontSize, _('Total') ); - /*draw a rectangle to hold the data lines */ $pdf->Rectangle($FormDesign->DataRectangle->x, $Page_Height - $FormDesign->DataRectangle->y, $FormDesign->DataRectangle->width,$FormDesign->DataRectangle->height); - ?> \ No newline at end of file Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-01-06 09:35:10 UTC (rev 3274) +++ trunk/index.php 2010-01-06 12:19:52 UTC (rev 3275) @@ -778,7 +778,7 @@ <?php echo '<p>• <a href="' . $rootpath . '/BOMs.php?' . SID . '">' . _('Bills Of Material') . '</a></p>'; ?> </td> </tr> - + <tr> <td class="menu_group_item"> <?php echo '<p>• <a href="' . $rootpath . '/MRPDemands.php?' . SID . '">' . _('Master Schedule') . '</a></p>'; ?> @@ -794,7 +794,7 @@ <?php echo '<p>• <a href="' . $rootpath . '/MRP.php?' . SID . '">' . _('MRP Calculation') . '</a></p>'; ?> </td> </tr> - + </table> </td> </tr> @@ -933,6 +933,11 @@ <?php echo '<p>• <a href="' . $rootpath . '/GeocodeSetup.php">' . _('Geocode Setup') . '</a></p>'; ?> </td> </tr> + <tr> + <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/FormDesigner.php">' . _('Form Layout Editor') . '</a></p>'; ?> + </td> + </tr> </table> </td> @@ -1029,7 +1034,7 @@ </td> </tr> <tr></tr> - + <tr> <td class="menu_group_item"> <?php echo '<p>• <a href="' . $rootpath . '/MRPCalendar.php?' . SID . '">' . _('MRP Available Production Days') . '</a></p>'; ?> @@ -1235,7 +1240,7 @@ </td> </tr> </table> -<?php +<?php break; } //end of module switch } /* end of if security allows to see the full menu */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-06 13:56:19
|
Revision: 3277 http://web-erp.svn.sourceforge.net/web-erp/?rev=3277&view=rev Author: tim_schofield Date: 2010-01-06 13:56:13 +0000 (Wed, 06 Jan 2010) Log Message: ----------- Error in sql statement Modified Paths: -------------- trunk/api/api_stock.php trunk/doc/Change.log.html Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2010-01-06 12:53:48 UTC (rev 3276) +++ trunk/api/api_stock.php 2010-01-06 13:56:13 UTC (rev 3277) @@ -784,7 +784,7 @@ $Location.'" AND stockid="'.$StockID.'"'; $glupdatesql1="INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) VALUES (17,".GetNextTransactionNo(17, $db).",'".$TranDate. - "','".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). + "',".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). ",".$adjglact.",".$itemdetails['materialcost']*-$Quantity. ",'".$StockID." x ".$Quantity." @ ".$itemdetails['materialcost']."')"; $glupdatesql2="INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-06 12:53:48 UTC (rev 3276) +++ trunk/doc/Change.log.html 2010-01-06 13:56:13 UTC (rev 3277) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>06/01/10 Tim: api_stock.php - Error in sql statement. <p>06/01/10 Tim: index.php - Move the modules selection to the left of the screen <p>06/01/10 Tim: Form layout designer - Enable each company to have their own layouts for orders/invoices etc <p>04/01/10 Tim: api_stock.php - Correct typo in sql statement. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-06 22:39:40
|
Revision: 3278 http://web-erp.svn.sourceforge.net/web-erp/?rev=3278&view=rev Author: tim_schofield Date: 2010-01-06 22:39:34 +0000 (Wed, 06 Jan 2010) Log Message: ----------- Ensure the modules positioning remains consistent. Modified Paths: -------------- trunk/doc/Change.log.html trunk/index.php Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-06 13:56:13 UTC (rev 3277) +++ trunk/doc/Change.log.html 2010-01-06 22:39:34 UTC (rev 3278) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>06/01/10 Tim: index.php - Ensure the modules positioning remains consistent. <p>06/01/10 Tim: api_stock.php - Error in sql statement. <p>06/01/10 Tim: index.php - Move the modules selection to the left of the screen <p>06/01/10 Tim: Form layout designer - Enable each company to have their own layouts for orders/invoices etc Modified: trunk/index.php =================================================================== --- trunk/index.php 2010-01-06 13:56:13 UTC (rev 3277) +++ trunk/index.php 2010-01-06 22:39:34 UTC (rev 3278) @@ -52,7 +52,7 @@ } else { /* Security settings DO allow seeing the main menu */ ?> - <table width="100%"><td><table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0"> + <table width="100%"><td width="10%" valign="top"><table class="main_menu" width="100%" cellspacing="0" cellpadding="0" border="0"> <?php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-07 13:07:50
|
Revision: 3279 http://web-erp.svn.sourceforge.net/web-erp/?rev=3279&view=rev Author: tim_schofield Date: 2010-01-07 13:07:43 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Change to only allow authorised staff to release invoices from hold Modified Paths: -------------- trunk/PO_AuthorisationLevels.php trunk/SupplierInquiry.php trunk/doc/Change.log.html trunk/sql/mysql/upgrade3.11.1-3.12.sql Modified: trunk/PO_AuthorisationLevels.php =================================================================== --- trunk/PO_AuthorisationLevels.php 2010-01-06 22:39:34 UTC (rev 3278) +++ trunk/PO_AuthorisationLevels.php 2010-01-07 13:07:43 UTC (rev 3279) @@ -12,31 +12,61 @@ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/group_add.png" title="' . _('Search') . '" alt="">' . ' ' . $title.'</p><br>'; $User=''; $Currency=''; -$CanCreate=0; +$CanCreate=1; +$OffHold=1; $AuthLevel=0; if (isset($_POST['Submit'])) { - if ($_POST['cancreate']=='on') { + if (isset($_POST['cancreate']) and $_POST['cancreate']=='on') { $cancreate=0; } else { $cancreate=1; } - $sql='INSERT INTO purchorderauth VALUES( - "'.$_POST['userid'].'", - "'.$_POST['currabrev'].'", - '.$cancreate.', - '.$_POST['authlevel'].')'; - $ErrMsg = _('The authentication details cannot be inserted because'); - $Result=DB_query($sql,$db,$ErrMsg); + if (isset($_POST['offhold']) and $_POST['offhold']=='on') { + $offhold=0; + } else { + $offhold=1; + } + $sql='SELECT COUNT(*) + FROM purchorderauth + WHERE userid="'.$_POST['userid'].'" + AND currabrev="'.$_POST['currabrev'].'"'; + $result=DB_query($sql, $db); + $myrow=DB_fetch_array($result); + if ($myrow[0]==0) { + $sql='INSERT INTO purchorderauth ( + userid, + currabrev, + cancreate, + offhold, + authlevel) + VALUES( + "'.$_POST['userid'].'", + "'.$_POST['currabrev'].'", + '.$cancreate.', + '.$offhold.', + '.$_POST['authlevel'].')'; + $ErrMsg = _('The authentication details cannot be inserted because'); + $Result=DB_query($sql,$db,$ErrMsg); + } else { + prnMsg(_('There already exists an entry for this user/currency combination'), 'error'); + echo '<br />'; + } } if (isset($_POST['Update'])) { - if ($_POST['cancreate']=='on') { + if (isset($_POST['cancreate']) and $_POST['cancreate']=='on') { $cancreate=0; } else { $cancreate=1; } + if (isset($_POST['offhold']) and $_POST['offhold']=='on') { + $offhold=0; + } else { + $offhold=1; + } $sql='UPDATE purchorderauth SET cancreate='.$cancreate.', + offhold='.$offhold.', authlevel='.$_POST['authlevel'].' WHERE userid="'.$_POST['userid'].'" AND currabrev="'.$_POST['currabrev'].'"'; @@ -46,7 +76,7 @@ } if (isset($_GET['Delete'])) { - $sql='DELETE FROM purchorderauth + $sql='DELETE FROM purchorderauth WHERE userid="'.$_GET['UserID'].'" AND currabrev="'.$_GET['Currency'].'"'; @@ -56,8 +86,9 @@ if (isset($_GET['Edit'])) { $sql='SELECT cancreate, - authlevel - FROM purchorderauth + offhold, + authlevel + FROM purchorderauth WHERE userid="'.$_GET['UserID'].'" AND currabrev="'.$_GET['Currency'].'"'; $ErrMsg = _('The authentication details cannot be retrieved because'); @@ -66,17 +97,19 @@ $UserID=$_GET['UserID']; $Currency=$_GET['Currency']; $CanCreate=$myrow['cancreate']; + $OffHold=$myrow['offhold']; $AuthLevel=$myrow['authlevel']; } -$sql='SELECT - purchorderauth.userid, +$sql='SELECT + purchorderauth.userid, www_users.realname, currencies.currabrev, currencies.currency, purchorderauth.cancreate, - purchorderauth.authlevel - FROM (purchorderauth + purchorderauth.offhold, + purchorderauth.authlevel + FROM (purchorderauth LEFT JOIN www_users ON purchorderauth.userid=www_users.userid) LEFT JOIN currencies ON purchorderauth.currabrev=currencies.currabrev'; @@ -88,6 +121,7 @@ echo '<th>'._('User Name').'</th>'; echo '<th>'._('Currency').'</th>'; echo '<th>'._('Create Order').'</th>'; +echo '<th>'._('Can Release').'<br />'. _('Invoices').'</th>'; echo '<th>'._('Authority Level').'</th></tr>'; while ($myrow=DB_fetch_array($Result)) { @@ -96,10 +130,16 @@ } else { $cancreate=_('No'); } + if ($myrow['offhold']==0) { + $offhold=_('Yes'); + } else { + $offhold=_('No'); + } echo '<tr><td>'.$myrow['userid'].'</td>'; echo '<td>'.$myrow['realname'].'</td>'; echo '<td>'.$myrow['currency'].'</td>'; echo '<td>'.$cancreate.'</td>'; + echo '<td>'.$offhold.'</td>'; echo '<td class="number">'.number_format($myrow['authlevel'],2).'</td>'; echo '<td><a href="'.$rootpath.'/PO_AuthorisationLevels.php?' . SID . 'Edit=Yes&UserID=' . $myrow['userid'] . '&Currency='.$myrow['currabrev'].'">'._('Edit').'</td>'; @@ -151,11 +191,18 @@ echo '<tr><td>'._('User can create orders').'</td>'; if ($CanCreate==1) { - echo '<td><input type=checkbox name=cancreate></td</tr>'; + echo '<td><input type=checkbox name=cancreate></td></tr>'; } else { - echo '<td><input type=checkbox checked name=cancreate></td</tr>'; -} + echo '<td><input type=checkbox checked name=cancreate></td></tr>'; +} +echo '<tr><td>'._('User can release invoices').'</td>'; +if ($OffHold==1) { + echo '<td><input type=checkbox name=offhold></td></tr>'; +} else { + echo '<td><input type=checkbox checked name=offhold></td></tr>'; +} + echo '<tr><td>'._('User can authorise orders up to :').'</td>'; echo '<td><input type=input name=authlevel size=11 class=number value='.$AuthLevel.'></td</tr>'; echo '</table>'; Modified: trunk/SupplierInquiry.php =================================================================== --- trunk/SupplierInquiry.php 2010-01-06 22:39:34 UTC (rev 3278) +++ trunk/SupplierInquiry.php 2010-01-07 13:07:43 UTC (rev 3279) @@ -16,7 +16,7 @@ // always figure out the SQL required from the inputs available if(!isset($_GET['SupplierID']) AND !isset($_SESSION['SupplierID'])){ - echo '<br>' . _('To display the enquiry a Supplier must first be selected from the Supplier selection screen') . + echo '<br>' . _('To display the enquiry a Supplier must first be selected from the Supplier selection screen') . "<br><div class='centre'>><a href='". $rootpath . "/SelectSupplier.php'>" . _('Select a Supplier to Inquire On') . '</a></div>'; exit; } else { @@ -35,18 +35,19 @@ } -$SQL = 'SELECT suppliers.suppname, - currencies.currency, +$SQL = 'SELECT suppliers.suppname, + suppliers.currcode, + currencies.currency, paymentterms.terms, SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) AS balance, SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= paymentterms.daysbeforedue THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END - ELSE + ELSE CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, ' . INTERVAL('1', 'MONTH') . '), ' . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ')) >= 0 THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END) AS due, - SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) > paymentterms.daysbeforedue + SUM(CASE WHEN paymentterms.daysbeforedue > 0 THEN + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) > paymentterms.daysbeforedue AND (TO_DAYS(Now()) - TO_DAYS(supptrans.trandate)) >= (paymentterms.daysbeforedue + ' . $_SESSION['PastDueDays1'] . ') THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END ELSE @@ -54,7 +55,7 @@ THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END END) AS overdue1, Sum(CASE WHEN paymentterms.daysbeforedue > 0 THEN - CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + ' . $_SESSION['PastDueDays2'] . ') + CASE WHEN TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(supptrans.trandate) >= (paymentterms.daysbeforedue + ' . $_SESSION['PastDueDays2'] . ') THEN supptrans.ovamount + supptrans.ovgst - supptrans.alloc ELSE 0 END ELSE CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(supptrans.trandate, ' . INTERVAL('1','MONTH') . '), ' . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(supptrans.trandate))', 'DAY') . ')) >= ' . $_SESSION['PastDueDays2'] . ") @@ -85,8 +86,9 @@ $NIL_BALANCE = True; - $SQL = "SELECT suppliers.suppname, - currencies.currency, + $SQL = "SELECT suppliers.suppname, + suppliers.currcode, + currencies.currency, paymentterms.terms FROM suppliers, paymentterms, @@ -113,8 +115,8 @@ $SupplierRecord['overdue2'] = 0; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . - _('Supplier') . '" alt="">' . ' ' . _('Supplier') . ' : ' . $SupplierRecord['suppname'] . ' - (' . _('All amounts stated in') . +echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . + _('Supplier') . '" alt="">' . ' ' . _('Supplier') . ' : ' . $SupplierRecord['suppname'] . ' - (' . _('All amounts stated in') . ' ' . $SupplierRecord['currency'] . ')<br><br>' . _('Terms') . ': ' . $SupplierRecord['terms'] . '</p>'; if (isset($_GET['HoldType']) AND isset($_GET['HoldTrans'])){ @@ -131,43 +133,43 @@ } -echo "<table WIDTH=90% BORDER=1><tr><th>" . _('Total Balance') . - "</th><th>" . _('Current') . - "</th><th>" . _('Now Due') . - "</th><th>" . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . - ' ' . _('Days Overdue') . +echo "<table WIDTH=90% BORDER=1><tr><th>" . _('Total Balance') . + "</th><th>" . _('Current') . + "</th><th>" . _('Now Due') . + "</th><th>" . $_SESSION['PastDueDays1'] . '-' . $_SESSION['PastDueDays2'] . + ' ' . _('Days Overdue') . "</th><th>" . _('Over') . ' ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Overdue') . '</th></tr>'; -echo '<tr><td class=number>' . number_format($SupplierRecord['balance'],2) . - '</td><td class=number>' . number_format(($SupplierRecord['balance'] - $SupplierRecord['due']),2) . - '</td><td class=number>' . number_format(($SupplierRecord['due']-$SupplierRecord['overdue1']),2) . - '</td><td class=number>' . number_format(($SupplierRecord['overdue1']-$SupplierRecord['overdue2']) ,2) . +echo '<tr><td class=number>' . number_format($SupplierRecord['balance'],2) . + '</td><td class=number>' . number_format(($SupplierRecord['balance'] - $SupplierRecord['due']),2) . + '</td><td class=number>' . number_format(($SupplierRecord['due']-$SupplierRecord['overdue1']),2) . + '</td><td class=number>' . number_format(($SupplierRecord['overdue1']-$SupplierRecord['overdue2']) ,2) . '</td><td class=number>' . number_format($SupplierRecord['overdue2'],2) . '</td></tr></table>'; echo "<br><div class='centre'><form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; -echo _('Show all transactions after') . ': ' ."<input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='TransAfterDate' VALUE='" . +echo _('Show all transactions after') . ': ' ."<input type=text class='date' alt='".$_SESSION['DefaultDateFormat']."' name='TransAfterDate' VALUE='" . $_POST['TransAfterDate'] . "' MAXLENGTH =10 size=10> <input type=submit name='Refresh Inquiry' VALUE='" . _('Refresh Inquiry') . "'></form><br>"; echo '</div>'; $DateAfterCriteria = FormatDateForSQL($_POST['TransAfterDate']); -$SQL = "SELECT supptrans.id, - systypes.typename, - supptrans.type, - supptrans.transno, - supptrans.trandate, - supptrans.suppreference, - supptrans.rate, - (supptrans.ovamount + supptrans.ovgst) AS totalamount, - supptrans.alloc AS allocated, - supptrans.hold, - supptrans.settled, +$SQL = "SELECT supptrans.id, + systypes.typename, + supptrans.type, + supptrans.transno, + supptrans.trandate, + supptrans.suppreference, + supptrans.rate, + (supptrans.ovamount + supptrans.ovgst) AS totalamount, + supptrans.alloc AS allocated, + supptrans.hold, + supptrans.settled, supptrans.transtext, supptrans.supplierno - FROM supptrans, - systypes - WHERE supptrans.type = systypes.typeid - AND supptrans.supplierno = '" . $SupplierID . "' - AND supptrans.trandate >= '$DateAfterCriteria' + FROM supptrans, + systypes + WHERE supptrans.type = systypes.typeid + AND supptrans.supplierno = '" . $SupplierID . "' + AND supptrans.trandate >= '$DateAfterCriteria' ORDER BY supptrans.trandate"; $ErrMsg = _('No transactions were returned by the SQL because'); @@ -186,14 +188,14 @@ echo '<table width="90%" cellpadding="2" colspan="7">'; -$TableHeader = "<tr BGCOLOR =#800000><th>" . _('Trans') . ' #' . - "</th><th>" . _('Type') . - "</th><th>" . _('Supplier Ref') . - "</th><th>" . _('Date') . - "</th><th>" . _('Total') . - "</th><th>" . _('Allocated') . - "</th><th>" . _('Balance') . - "</th><th>" . _('Comments') . +$TableHeader = "<tr BGCOLOR =#800000><th>" . _('Trans') . ' #' . + "</th><th>" . _('Type') . + "</th><th>" . _('Supplier Ref') . + "</th><th>" . _('Date') . + "</th><th>" . _('Total') . + "</th><th>" . _('Allocated') . + "</th><th>" . _('Balance') . + "</th><th>" . _('Comments') . "</th><th>" . _('More Info') . "</th><th>" . _('More Info') . '</td></tr>'; @@ -225,70 +227,48 @@ if ($myrow['type'] == 20){ /*Show a link to allow GL postings to be viewed but no link to allocate */ if ($_SESSION['CompanyRecord']['gllink_creditors'] == True){ - If ($myrow['totalamount'] - $myrow['allocated'] == 0){ + if ($myrow['totalamount'] - $myrow['allocated'] == 0){ /*The trans is settled so don't show option to hold */ - printf("<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td align=left>%s</td> - <td><a TARGET='_blank' href='%s/GLTransInquiry.php?%s&TypeID=%s&TransNo=%s'>" . _('View GL Postings') . "</a></td> - <td><a href='%s/PaymentAllocations.php?%sSuppID=%s&InvID=%s'>" . _('View Payments') . '</a></td></tr>', - $myrow['transno'], - $myrow['typename'], - $myrow['suppreference'], - ConvertSQLDate($myrow['trandate']), - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount']-$myrow['allocated'],2), - $myrow['transtext'], - $rootpath, - SID, - $myrow['type'], - $myrow['transno'], - $rootpath, - SID, - $myrow['supplierno'], - $myrow['suppreference']); - + echo "<td>".$myrow['transno']."</td>"; + echo "<td>".$myrow['typename']."</td>"; + echo "<td>".$myrow['suppreference']."</td>"; + echo "<td>".ConvertSQLDate($myrow['trandate'])."</td>"; + echo "<td class=number>".number_format($myrow['totalamount'],2)."</td>"; + echo "<td class=number>".number_format($myrow['allocated'],2)."</td>"; + echo "<td class=number>".number_format($myrow['totalamount']-$myrow['allocated'],2)."</td>"; + echo "<td align=left>".$myrow['transtext']."</td>"; + echo "<td><a target='_blank' href='".$rootpath."/GLTransInquiry.php?".SID."&TypeID=".$myrow['type']."&TransNo=".$myrow['transno']."'>" . _('View GL Postings') . "</a></td>"; + echo "<td><a href='".$rootpath."/PaymentAllocations.php?".SID."SuppID=".$myrow['supplierno']."&InvID=".$myrow['suppreference']."'>" . _('View Payments') . "</a></td></tr>"; } else { - - printf("<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td class=number>%s</td> - <td align=left>%s</td> - <td><a href='%s?%s&HoldType=%s&HoldTrans=%s&HoldStatus=%s&FromDate=%s'>%s</a></td> - <td><a TARGET='_blank' href='%s/GLTransInquiry.php?TypeID=%s&TransNo=%s'>" . - _('View GL Postings') . '</a></td></tr>', - $myrow['transno'], - $myrow['typename'], - $myrow['suppreference'], - ConvertSQLDate($myrow['trandate']), - number_format($myrow['totalamount'],2), - number_format($myrow['allocated'],2), - number_format($myrow['totalamount'] - $myrow['allocated'],2), - $myrow['transtext'], - $_SERVER['PHP_SELF'], - SID, - $myrow['type'], - $myrow['transno'], - $HoldValue, - $_POST['TransAfterDate'], - $HoldValue, - $rootpath, - $myrow['type'], - $myrow['transno']); + echo "<td>".$myrow['transno']."</td>"; + echo "<td>".$myrow['typename']."</td>"; + echo "<td>".$myrow['suppreference']."</td>"; + echo "<td>".ConvertSQLDate($myrow['trandate'])."</td>"; + echo "<td class=number>".number_format($myrow['totalamount'],2)."</td>"; + echo "<td class=number>".number_format($myrow['allocated'],2)."</td>"; + echo "<td class=number>".number_format($myrow['totalamount'] - $myrow['allocated'],2)."</td>"; + echo "<td align=left>".$myrow['transtext']."</td>"; + $authsql='SELECT offhold + FROM purchorderauth + WHERE userid="'.$_SESSION['UserID'] . + '" AND currabrev="'.$SupplierRecord['currcode'].'"'; + $authresult=DB_query($authsql, $db); + $authrow=DB_fetch_array($authresult); + if ($authrow[0]==0) { + echo "<td><a href='".$_SERVER['PHP_SELF']."?".SID."&HoldType=".$myrow['type']."&HoldTrans=".$myrow['transno']. + "&HoldStatus=".$HoldValue."&FromDate=".$_POST['TransAfterDate']."'>".$HoldValue."</a></td>"; + } else { + if ($HoldValue==_('Release')) { + echo "<td>".$HoldValue."</a></td>"; + } else { + echo "<td><a href='".$_SERVER['PHP_SELF']."?".SID."&HoldType=".$myrow['type']."&HoldTrans=".$myrow['transno']. + "&HoldStatus=".$HoldValue."&FromDate=".$_POST['TransAfterDate']."'>".$HoldValue."</a></td>"; + } + } + echo "<td><a target='_blank' href='".$rootpath."/GLTransInquiry.php?TypeID=".$myrow['type']."&TransNo=".$myrow['transno']."'>" ._('View GL Postings') . "</a></td></tr>"; } - } else { if ($myrow['totalamount'] - $myrow['allocated'] == 0){ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-06 22:39:34 UTC (rev 3278) +++ trunk/doc/Change.log.html 2010-01-07 13:07:43 UTC (rev 3279) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>06/01/10 Tim: Change to only allow authorised staff to release invoices from hold <p>06/01/10 Tim: index.php - Ensure the modules positioning remains consistent. <p>06/01/10 Tim: api_stock.php - Error in sql statement. <p>06/01/10 Tim: index.php - Move the modules selection to the left of the screen Modified: trunk/sql/mysql/upgrade3.11.1-3.12.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-01-06 22:39:34 UTC (rev 3278) +++ trunk/sql/mysql/upgrade3.11.1-3.12.sql 2010-01-07 13:07:43 UTC (rev 3279) @@ -48,3 +48,5 @@ INSERT INTO `config` (`confname`, `confvalue`) VALUES ('LogSeverity', '0'); ALTER TABLE `www_users` ADD COLUMN `pdflanguage` tinyint(1) NOT NULL DEFAULT '0'; + +ALTER TABLE `purchorderauth` ADD COLUMN `offhold` tinyint(1) NOT NULL DEFAULT 0; \ 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-01-07 15:42:14
|
Revision: 3280 http://web-erp.svn.sourceforge.net/web-erp/?rev=3280&view=rev Author: tim_schofield Date: 2010-01-07 15:42:08 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Correct errors preventing invoice from printing Modified Paths: -------------- trunk/PrintCustTransPortrait.php trunk/doc/Change.log.html Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2010-01-07 13:07:43 UTC (rev 3279) +++ trunk/PrintCustTransPortrait.php 2010-01-07 15:42:08 UTC (rev 3280) @@ -2,7 +2,7 @@ /* $Id$ */ -/* Javier: This file has 5 PDF Outputs, one FPDI class, and one function, +/* Javier: This file has 5 PDF Outputs, one FPDI class, and one function, The Outputs are L520 and L570, 3 are about FPDI y el 5th is in L457 */ $PageSecurity = 1; @@ -99,7 +99,13 @@ $myrow = DB_fetch_array($result); $DefaultBankAccountNumber = _('Account:') .' ' .$myrow['bankaccountnumber']; $DefaultBankAccountCode = _('Bank Code:') .' ' .$myrow['bankaccountcode']; + } else { + $DefaultBankAccountNumber = ''; + $DefaultBankAccountCode = ''; } + } else { + $DefaultBankAccountNumber = ''; + $DefaultBankAccountCode = ''; } // gather the invoice data @@ -256,7 +262,7 @@ stockmoves.narrative, stockmaster.units, stockmaster.decimalplaces, - stockmoves.discountpercent, + stockmoves.discountpercent, stockmoves.narrative FROM stockmoves, stockmaster @@ -275,7 +281,7 @@ stockmoves.narrative, stockmaster.units, stockmaster.decimalplaces, - stockmoves.discountpercent, + stockmoves.discountpercent, stockmoves.narrative FROM stockmoves, stockmaster @@ -297,7 +303,7 @@ exit; } - + if (DB_num_rows($result)>0){ $FontSize = 10; @@ -307,44 +313,44 @@ $FirstPage = False; while ($myrow2=DB_fetch_array($result)){ - + /*search the unit price*/ $sql='SELECT salesorderdetails.unitprice - FROM salesorderdetails, - debtortrans + FROM salesorderdetails, + debtortrans WHERE debtortrans.transno = ' . $FromTransNo . ' AND debtortrans.order_ = salesorderdetails.orderno AND salesorderdetails.stkcode = "'.$myrow2['stockid'].'"'; - + $resultp=DB_query($sql,$db); $myrow3=DB_fetch_array($resultp); - + /*check the price after discount*/ if ($myrow2['discountpercent']==0){ $DisplayDiscount =''; - $DisplayNet=number_format(($myrow3['unitprice'] * $myrow2['quantity']),2); + $DisplayNet=number_format(($myrow3['unitprice'] * $myrow2['Quantity']),2); $DisplayPrice=$myrow3['unitprice']; - $DisplayQty=$myrow2['quantity']; + $DisplayQty=$myrow2['Quantity']; } else { $DisplayDiscount =number_format($myrow2['discountpercent']*100,2); $DiscountPrice=$myrow2['discountpercent'] * $myrow3['unitprice']; $DisplayPrice=$myrow3['unitprice']; - $DisplayQty=$myrow2['quantity']; - $DisplayNet=number_format((($myrow3['unitprice'] - $DiscountPrice) * $myrow2['quantity']),2); + $DisplayQty=$myrow2['Quantity']; + $DisplayNet=number_format((($myrow3['unitprice'] - $DiscountPrice) * $myrow2['Quantity']),2); } - - + + $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,71,$FontSize,$myrow2['stockid']); $LeftOvers = $pdf->addTextWrap($Left_Margin+80,$YPos,186,$FontSize,$myrow2['description']); $lines=1; - + while ($LeftOvers!='') { $LeftOvers = $pdf->addTextWrap($Left_Margin+80,$YPos-(10*$lines),186,$FontSize,$LeftOvers); $lines++; } - + $LeftOvers = $pdf->addTextWrap($Left_Margin+270,$YPos,76,$FontSize,number_format($myrow3['unitprice'],2),'right'); - $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,36,$FontSize,number_format($myrow2['quantity'],2),'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos,36,$FontSize,number_format($myrow2['Quantity'],2),'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+390,$YPos,26,$FontSize,$myrow2['units'],'center'); $LeftOvers = $pdf->addTextWrap($Left_Margin+420,$YPos,26,$FontSize,$DisplayDiscount,'right'); $LeftOvers = $pdf->addTextWrap($Left_Margin+450,$YPos,72,$FontSize,$DisplayNet,'right'); @@ -405,8 +411,8 @@ PrintLinesToBottom (); include ('includes/PDFTransPageHeaderPortrait.inc'); } //end if need a new page headed up - } /*end while there are line items to print out*/ - + } /*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; @@ -542,7 +548,8 @@ } } - $pdf =& new concat_pdf(); +// $pdf =& new concat_pdf(); + // Have to get the TransNo again, not sure what happens if we have a series of trans nos if (isset($_GET['FromTransNo'])){ $FromTransNo = trim($_GET['FromTransNo']); @@ -571,6 +578,7 @@ $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'])); @@ -909,8 +917,8 @@ <td bgcolor='#EEEEEE'>" . ConvertSQLDate($myrow['trandate']) . "</td> <td bgcolor='#EEEEEE'>" . $myrow['salesmanname'] . '</td> </tr></table>'; - - + + $sql ='SELECT stockmoves.stockid, stockmaster.description, stockmoves.qty as Quantity, Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-07 13:07:43 UTC (rev 3279) +++ trunk/doc/Change.log.html 2010-01-07 15:42:08 UTC (rev 3280) @@ -1,6 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> -<p>06/01/10 Tim: Change to only allow authorised staff to release invoices from hold +<p>07/01/10 Tim: PrintCustTransPortrait.php - Correct errors preventing invoice from printing +<p>07/01/10 Tim: Change to only allow authorised staff to release invoices from hold <p>06/01/10 Tim: index.php - Ensure the modules positioning remains consistent. <p>06/01/10 Tim: api_stock.php - Error in sql statement. <p>06/01/10 Tim: index.php - Move the modules selection to the left of the screen This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-07 19:47:51
|
Revision: 3281 http://web-erp.svn.sourceforge.net/web-erp/?rev=3281&view=rev Author: tim_schofield Date: 2010-01-07 19:47:45 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Changes for new menu layout Modified Paths: -------------- trunk/css/silverwolf/default.css trunk/doc/Change.log.html Modified: trunk/css/silverwolf/default.css =================================================================== --- trunk/css/silverwolf/default.css 2010-01-07 15:42:08 UTC (rev 3280) +++ trunk/css/silverwolf/default.css 2010-01-07 19:47:45 UTC (rev 3281) @@ -125,24 +125,36 @@ background-color: #fddbdb; color: red; border: 1px solid red; + width: 80%; + text-align: center; + margin: 0 auto; } div.warn { background-color: #f5dbfd; color: maroon; border: 1px solid maroon; -} + width: 80%; + text-align: center; + margin: 0 auto; + } div.success { background-color: #b9ecb4; color: #006400; /* darkgreen is not a w3c css valid color */ border: 1px solid #006400; /* darkgreen is not a w3c css valid color */ + width: 80%; + text-align: center; + margin: 0 auto; } div.info { background-color: #c7ccf6; color: navy; border: 1px solid navy; + width: 80%; + text-align: center; + margin: 0 auto; } input { @@ -450,6 +462,7 @@ /* position: relative; it's not a div but a table */ text-align: center; white-space: nowrap; + height: 16pt; } /* From merge, uncomment to apply style Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-07 15:42:08 UTC (rev 3280) +++ trunk/doc/Change.log.html 2010-01-07 19:47:45 UTC (rev 3281) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>07/01/10 Tim: silverwolf/default.css - Changes for new menu layout <p>07/01/10 Tim: PrintCustTransPortrait.php - Correct errors preventing invoice from printing <p>07/01/10 Tim: Change to only allow authorised staff to release invoices from hold <p>06/01/10 Tim: index.php - Ensure the modules positioning remains consistent. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-07 20:14:38
|
Revision: 3282 http://web-erp.svn.sourceforge.net/web-erp/?rev=3282&view=rev Author: tim_schofield Date: 2010-01-07 20:14:28 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Declare $identifier if not already declared before including PO_ReadInOrder.inc Modified Paths: -------------- trunk/GoodsReceived.php trunk/doc/Change.log.html Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2010-01-07 19:47:45 UTC (rev 3281) +++ trunk/GoodsReceived.php 2010-01-07 20:14:28 UTC (rev 3282) @@ -11,7 +11,9 @@ include('includes/DefineSerialItems.php'); include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); - +if (empty($identifier) { + $identifier=''; +} $title = _('Receive Purchase Orders'); include('includes/header.inc'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-07 19:47:45 UTC (rev 3281) +++ trunk/doc/Change.log.html 2010-01-07 20:14:28 UTC (rev 3282) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>07/01/10 Tim: GoodsReceived.php - Declare $identifier if not already declared before including PO_ReadInOrder.inc <p>07/01/10 Tim: silverwolf/default.css - Changes for new menu layout <p>07/01/10 Tim: PrintCustTransPortrait.php - Correct errors preventing invoice from printing <p>07/01/10 Tim: Change to only allow authorised staff to release invoices from hold This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-07 20:41:59
|
Revision: 3284 http://web-erp.svn.sourceforge.net/web-erp/?rev=3284&view=rev Author: tim_schofield Date: 2010-01-07 20:41:53 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Enforce numbers only in input boxes Modified Paths: -------------- trunk/Payments.php trunk/doc/Change.log.html Modified: trunk/Payments.php =================================================================== --- trunk/Payments.php 2010-01-07 20:24:45 UTC (rev 3283) +++ trunk/Payments.php 2010-01-07 20:41:53 UTC (rev 3284) @@ -779,7 +779,7 @@ $_POST['ExRate'] = $SuggestedExRate; } echo '<tr><td>' . _('Payment Exchange Rate') . ':</td> - <td><input type="text" name="ExRate" maxlength=10 size=12 value="' . $_POST['ExRate'] . '"></td> + <td><input class=number type="text" name="ExRate" maxlength=10 size=12 value="' . $_POST['ExRate'] . '"></td> <td>' . $SuggestedExRateText . ' <i>' . _('The exchange rate between the currency of the bank account currency and the currency of the payment') . '. 1 ' . $_SESSION['PaymentDetail']->AccountCurrency . ' = ? ' . $_SESSION['PaymentDetail']->Currency . '</i></td></tr>'; } @@ -946,11 +946,11 @@ echo '<table><tr><td>' . _('Amount of Payment') . ' ' . $_SESSION['PaymentDetail']->Currency . ':</td> - <td><input type="text" name="Amount" maxlength=12 size=13 value=' . $_SESSION['PaymentDetail']->Amount . '></td></tr>'; + <td><input class=number type="text" name="Amount" maxlength=12 size=13 value=' . $_SESSION['PaymentDetail']->Amount . '></td></tr>'; if (isset($_SESSION['PaymentDetail']->SupplierID)){ /*So it is a supplier payment so show the discount entry item */ echo '<tr><td>' . _('Amount of Discount') . ':</td> - <td><input type="text" name="Discount" maxlength=12 size=13 value=' . $_SESSION['PaymentDetail']->Discount . '></td></tr>'; + <td><input class=number type="text" name="Discount" maxlength=12 size=13 value=' . $_SESSION['PaymentDetail']->Discount . '></td></tr>'; echo '<input type="hidden" name="SuppName" value="' . $_SESSION['PaymentDetail']->SuppName . '">'; } else { echo '<input type="hidden" name="discount" Value=0>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-07 20:24:45 UTC (rev 3283) +++ trunk/doc/Change.log.html 2010-01-07 20:41:53 UTC (rev 3284) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>07/01/10 Tim: Payments.php - Enforce numbers only in input boxes <p>07/01/10 Tim: GoodsReceived.php - Declare $identifier if not already declared before including PO_ReadInOrder.inc <p>07/01/10 Tim: silverwolf/default.css - Changes for new menu layout <p>07/01/10 Tim: PrintCustTransPortrait.php - Correct errors preventing invoice from printing This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-08 10:15:25
|
Revision: 3286 http://web-erp.svn.sourceforge.net/web-erp/?rev=3286&view=rev Author: tim_schofield Date: 2010-01-08 10:15:18 +0000 (Fri, 08 Jan 2010) Log Message: ----------- Put a supplier invoice on hold when outside the bounds set up in the config Modified Paths: -------------- trunk/SuppInvGRNs.php trunk/SupplierInvoice.php trunk/doc/Change.log.html trunk/includes/DefineSuppTransClass.php Modified: trunk/SuppInvGRNs.php =================================================================== --- trunk/SuppInvGRNs.php 2010-01-08 02:04:43 UTC (rev 3285) +++ trunk/SuppInvGRNs.php 2010-01-08 10:15:18 UTC (rev 3286) @@ -23,36 +23,36 @@ /*It all stops here if there aint no supplier selected and invoice initiated ie $_SESSION['SuppTrans'] started off*/ } -/*If the user hit the Add to Invoice button then process this first before showing all GRNs on the invoice +/*If the user hit the Add to Invoice button then process this first before showing all GRNs on the invoice otherwise it wouldnt show the latest additions*/ if (isset($_POST['AddPOToTrans']) AND $_POST['AddPOToTrans']!=''){ - foreach($_SESSION['SuppTransTmp']->GRNs as $GRNTmp) { - if ($_POST['AddPOToTrans']==$GRNTmp->PONo) { - $_SESSION['SuppTrans']->Copy_GRN_To_Trans($GRNTmp); - $_SESSION['SuppTransTmp']->Remove_GRN_From_Trans($GRNTmp->GRNNo); - } - } + foreach($_SESSION['SuppTransTmp']->GRNs as $GRNTmp) { + if ($_POST['AddPOToTrans']==$GRNTmp->PONo) { + $_SESSION['SuppTrans']->Copy_GRN_To_Trans($GRNTmp); + $_SESSION['SuppTransTmp']->Remove_GRN_From_Trans($GRNTmp->GRNNo); + } + } } if (isset($_POST['AddGRNToTrans'])){ /*adding a GRN to the invoice */ - foreach($_SESSION['SuppTransTmp']->GRNs as $GRNTmp) { - if (isset($_POST['GRNNo_' . $GRNTmp->GRNNo])) { - $_POST['GRNNo_' . $GRNTmp->GRNNo] = true; - } else { - $_POST['GRNNo_' . $GRNTmp->GRNNo] = false; - } - $Selected = $_POST['GRNNo_' . $GRNTmp->GRNNo]; - if ($Selected==True) { - $_SESSION['SuppTrans']->Copy_GRN_To_Trans($GRNTmp); - $_SESSION['SuppTransTmp']->Remove_GRN_From_Trans($GRNTmp->GRNNo); - } - } + foreach($_SESSION['SuppTransTmp']->GRNs as $GRNTmp) { + if (isset($_POST['GRNNo_' . $GRNTmp->GRNNo])) { + $_POST['GRNNo_' . $GRNTmp->GRNNo] = true; + } else { + $_POST['GRNNo_' . $GRNTmp->GRNNo] = false; + } + $Selected = $_POST['GRNNo_' . $GRNTmp->GRNNo]; + if ($Selected==True) { + $_SESSION['SuppTrans']->Copy_GRN_To_Trans($GRNTmp); + $_SESSION['SuppTransTmp']->Remove_GRN_From_Trans($GRNTmp->GRNNo); + } + } } if (isset($_POST['ModifyGRN'])){ $InputError=False; - + $Hold=False; if ($_POST['This_QuantityInv'] >= ($_POST['QtyRecd'] - $_POST['Prev_QuantityInv'])){ $Complete = True; } else { @@ -60,8 +60,9 @@ } if ($_SESSION['Check_Qty_Charged_vs_Del_Qty']==True) { if (($_POST['This_QuantityInv']+ $_POST['Prev_QuantityInv'])/($_POST['QtyRecd'] ) > (1+ ($_SESSION['OverChargeProportion'] / 100))){ - prnMsg(_('The quantity being invoiced is more than the outstanding quantity by more than') . ' ' . $_SESSION['OverChargeProportion'] . ' ' . _('percent. The system is set up to prohibit this. See the system administrator to modify the set up parameters if necessary'),'error'); - $InputError = True; + prnMsg(_('The quantity being invoiced is more than the outstanding quantity by more than') . ' ' . $_SESSION['OverChargeProportion'] . ' ' . + _('percent. The system is set up to prohibit this so will put this invoice on hold until it is authorised'),'warn'); + $Hold = True; } } if (!is_numeric($_POST['ChgPrice']) AND $_POST['ChgPrice']<0){ @@ -69,14 +70,15 @@ prnMsg(_('The price charged in the suppliers currency is either not numeric or negative') . '. ' . _('The goods received cannot be invoiced at this price'),'error'); } elseif ($_SESSION['Check_Price_Charged_vs_Order_Price'] == True) { if ($_POST['ChgPrice']/$_POST['OrderPrice'] > (1+ ($_SESSION['OverChargeProportion'] / 100))){ - prnMsg(_('The price being invoiced is more than the purchase order price by more than') . ' ' . $_SESSION['OverChargeProportion'] . '%. ' . _('The system is set up to prohibit this') . '. ' . _('See the system administrator to modify the set up parameters if necessary'),'error'); - $InputError = True; + prnMsg(_('The price being invoiced is more than the purchase order price by more than') . ' ' . $_SESSION['OverChargeProportion'] . '%. ' . + _('The system is set up to prohibit this so will put this invoice on hold until it is authorised'),'warn'); + $Hold=True; } } if ($InputError==False){ -// $_SESSION['SuppTrans']->Remove_GRN_From_Trans($_POST['GRNNumber']); - $_SESSION['SuppTrans']->Modify_GRN_To_Trans($_POST['GRNNumber'], +// $_SESSION['SuppTrans']->Remove_GRN_From_Trans($_POST['GRNNumber']); + $_SESSION['SuppTrans']->Modify_GRN_To_Trans($_POST['GRNNumber'], $_POST['PODetailItem'], $_POST['ItemCode'], $_POST['ItemDescription'], @@ -89,7 +91,8 @@ $_POST['StdCostUnit'], $_POST['ShiptRef'], $_POST['JobRef'], - $_POST['GLCode']); + $_POST['GLCode'], + $Hold); } } @@ -180,19 +183,19 @@ echo "<form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post>"; if (!isset( $_SESSION['SuppTransTmp'])){ - $_SESSION['SuppTransTmp'] = new SuppTrans; - while ($myrow=DB_fetch_array($GRNResults)){ + $_SESSION['SuppTransTmp'] = new SuppTrans; + while ($myrow=DB_fetch_array($GRNResults)){ - $GRNAlreadyOnInvoice = False; + $GRNAlreadyOnInvoice = False; - foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - if ($EnteredGRN->GRNNo == $myrow['grnbatch']) { - $GRNAlreadyOnInvoice = True; - } - } - if ($GRNAlreadyOnInvoice == False){ - $_SESSION['SuppTransTmp']->Add_GRN_To_Trans($myrow['grnno'], - $myrow['podetailitem'], + foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ + if ($EnteredGRN->GRNNo == $myrow['grnbatch']) { + $GRNAlreadyOnInvoice = True; + } + } + if ($GRNAlreadyOnInvoice == False){ + $_SESSION['SuppTransTmp']->Add_GRN_To_Trans($myrow['grnno'], + $myrow['podetailitem'], $myrow['itemcode'], $myrow['itemdescription'], $myrow['qtyrecd'], @@ -206,15 +209,15 @@ $myrow['jobref'], $myrow['glcode'], $myrow['orderno']); - } - } + } + } } //if (isset($_POST['GRNNo']) AND $_POST['GRNNo']!=''){ if (isset($_GET['Modify'])){ - $GRNNo = $_GET['Modify']; - $GRNTmp = $_SESSION['SuppTrans']->GRNs[$GRNNo]; + $GRNNo = $_GET['Modify']; + $GRNTmp = $_SESSION['SuppTrans']->GRNs[$GRNNo]; echo '<p><div class="centre"><font size=4 color=BLUE><b>' . _('GRN Selected For Adding To A Purchase Invoice') . '</font></b></div>'; echo "<table> @@ -240,7 +243,7 @@ /* if ($myrow['closed']==1){ //Shipment is closed so pre-empt problems later by warning the user - need to modify the order first echo "<input type=hidden name='ShiptRef' Value=''>"; echo "<p>Unfortunately, the shipment that this purchase order line item was allocated to has been closed - if you add this item to the transaction then no shipments will not be updated. If you wish to allocate the order line item to a different shipment the order must be modified first."; - } else { */ + } else { */ echo "<input type=hidden name='ShiptRef' Value='" . $GRNTmp->ShiptRef . "'>"; // } @@ -259,11 +262,11 @@ echo "<input type=hidden name='PODetailItem' Value='" . $GRNTmp->PODetailItem . "'>"; } else { - if (count( $_SESSION['SuppTransTmp']->GRNs)>0){ /*if there are any outstanding GRNs then */ - echo '<div class="centre"><font size=4 color=BLUE>' . _('Goods Received Yet to be Invoiced From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</div>'; - echo "<table cellpadding=1 colspan=7>"; + if (count( $_SESSION['SuppTransTmp']->GRNs)>0){ /*if there are any outstanding GRNs then */ + echo '<div class="centre"><font size=4 color=BLUE>' . _('Goods Received Yet to be Invoiced From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</div>'; + echo "<table cellpadding=1 colspan=7>"; - $tableheader = "<tr bgcolor=#800000><th>" . _('Select') . "</th> + $tableheader = "<tr bgcolor=#800000><th>" . _('Select') . "</th> <th>" . _('Sequence') . " #</th> <th>" . _('Order') . "</th> <th>" . _('Item Code') . "</th> @@ -274,19 +277,19 @@ <th>" . _('Order Price in') . ' ' . $_SESSION['SuppTrans']->CurrCode . "</th> <th>" . _('Line Value in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; - $i = 0; - $POs = array(); - foreach ($_SESSION['SuppTransTmp']->GRNs as $GRNTmp){ + $i = 0; + $POs = array(); + foreach ($_SESSION['SuppTransTmp']->GRNs as $GRNTmp){ - $_SESSION['SuppTransTmp']->GRNs[$GRNTmp->GRNNo]->This_QuantityInv = $GRNTmp->QtyRecd - $GRNTmp->Prev_QuantityInv; + $_SESSION['SuppTransTmp']->GRNs[$GRNTmp->GRNNo]->This_QuantityInv = $GRNTmp->QtyRecd - $GRNTmp->Prev_QuantityInv; if (isset($POs[$GRNTmp->PONo]) and $POs[$GRNTmp->PONo] != $GRNTmp->PONo) { - $POs[$GRNTmp->PONo] = $GRNTmp->PONo; - echo "<tr><td><input type=Submit Name='AddPOToTrans' Value='" . $GRNTmp->PONo . "'></td><td colspan=3>" . _('Add Whole PO to Invoice') . '</td></tr>'; - $i = 0; - } - if ($i == 0){ - echo $tableheader; + $POs[$GRNTmp->PONo] = $GRNTmp->PONo; + echo "<tr><td><input type=Submit Name='AddPOToTrans' Value='" . $GRNTmp->PONo . "'></td><td colspan=3>" . _('Add Whole PO to Invoice') . '</td></tr>'; + $i = 0; + } + if ($i == 0){ + echo $tableheader; } if (isset($_POST['SelectAll'])) { echo "<tr><td><input type=checkbox checked name='GRNNo_" . $GRNTmp->GRNNo . "'></td>"; @@ -307,14 +310,14 @@ if ($i>15){ $i=0; } - } - echo '</table>'; - echo "<div class='centre'><input type=Submit Name='SelectAll' Value='" . _('Select All') . "'>"; - echo "<input type=Submit Name='DeSelectAll' Value='" . _('Deselect All') . "'>"; - echo "<br><input type=Submit Name='AddGRNToTrans' Value='" . _('Add to Invoice') . "'></div>"; - } + } + echo '</table>'; + echo "<div class='centre'><input type=Submit Name='SelectAll' Value='" . _('Select All') . "'>"; + echo "<input type=Submit Name='DeSelectAll' Value='" . _('Deselect All') . "'>"; + echo "<br><input type=Submit Name='AddGRNToTrans' Value='" . _('Add to Invoice') . "'></div>"; + } } echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2010-01-08 02:04:43 UTC (rev 3285) +++ trunk/SupplierInvoice.php 2010-01-08 10:15:18 UTC (rev 3286) @@ -3,7 +3,7 @@ /* $Id$ */ /*The supplier transaction uses the SuppTrans class to hold the information about the invoice -the SuppTrans class contains an array of GRNs objects - containing details of GRNs for invoicing +the SuppTrans class contains an array of GRNs objects - containing details of GRNs for invoicing Also an array of GLCodes objects - only used if the AP - GL link is effective Also an array of shipment charges for charges to shipments to be apportioned accross the cost of stock items */ @@ -84,31 +84,31 @@ $_SESSION['SuppTrans']->ExRate = $myrow['exrate']; $_SESSION['SuppTrans']->TaxGroup = $myrow['taxgroupid']; $_SESSION['SuppTrans']->TaxGroupDescription = $myrow['taxgroupdescription']; - $_SESSION['SuppTrans']->SupplierID = $myrow['supplierid']; - + $_SESSION['SuppTrans']->SupplierID = $myrow['supplierid']; + if ($myrow['daysbeforedue'] == 0){ $_SESSION['SuppTrans']->Terms = '1' . $myrow['dayinfollowingmonth']; } else { $_SESSION['SuppTrans']->Terms = '0' . $myrow['daysbeforedue']; } $_SESSION['SuppTrans']->SupplierID = $_GET['SupplierID']; - - $LocalTaxProvinceResult = DB_query("SELECT taxprovinceid - FROM locations + + $LocalTaxProvinceResult = DB_query("SELECT taxprovinceid + FROM locations WHERE loccode = '" . $_SESSION['UserStockLocation'] . "'", $db); - + if(DB_num_rows($LocalTaxProvinceResult)==0){ prnMsg(_('The tax province associated with your user account has not been set up in this database. Tax calculations are based on the tax group of the supplier and the tax province of the user entering the invoice. The system administrator should redefine your account with a valid default stocking location and this location should refer to a valid tax province'),'error'); include('includes/footer.inc'); exit; } - + $LocalTaxProvinceRow = DB_fetch_row($LocalTaxProvinceResult); $_SESSION['SuppTrans']->LocalTaxProvince = $LocalTaxProvinceRow[0]; - + $_SESSION['SuppTrans']->GetTaxes(); - - + + $_SESSION['SuppTrans']->GLLink_Creditors = $_SESSION['CompanyRecord']['gllink_creditors']; $_SESSION['SuppTrans']->GRNAct = $_SESSION['CompanyRecord']['grnact']; $_SESSION['SuppTrans']->CreditorsAct = $_SESSION['CompanyRecord']['creditorsact']; @@ -169,7 +169,7 @@ if (!isset($_POST['PostInvoice'])){ - + if (isset($_POST['GRNS']) and $_POST['GRNS'] == _('Enter Against Goods Received')){ /*This ensures that any changes in the page are stored in the session before calling the grn page */ echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . "/SuppInvGRNs.php?" . SID . "'>"; @@ -194,15 +194,15 @@ "<a href='" . $rootpath . "/SuppTransGLAnalysis.php?" . SID . "'>" . _('click here') . '</a> ' . _('to continue') . '.</DIV><br>'; exit; } - + /* everything below here only do if a Supplier is selected fisrt add a header to show who we are making an invoice for */ - + echo "<table BORDER=2 colspan=4><tr><th>" . _('Supplier') . "</th><th>" . _('Currency') . "</th><th>" . _('Terms'). "</th><th>" . _('Tax Authority') . '</th></tr>'; - + echo '<tr><td><font color=blue><b>' . $_SESSION['SuppTrans']->SupplierID . ' - ' . $_SESSION['SuppTrans']->SupplierName . '</b></font></td> <th><font color=blue><b>' . $_SESSION['SuppTrans']->CurrCode . '</b></font></th> @@ -210,39 +210,39 @@ <td><font color=blue><b>' . $_SESSION['SuppTrans']->TaxGroupDescription . '</b></font></td> </tr> </table>'; - + echo "<br><form action='" . $_SERVER['PHP_SELF'] . "?" . SID . "' method=post name=form1>"; - + echo '<table>'; - + echo '<tr><td>' . _('Supplier Invoice Reference') . ":</td> <td><font size=2><input type=TEXT size=20 maxlength=20 name=SuppReference VALUE='" . $_SESSION['SuppTrans']->SuppReference . "'></td>"; - + if (!isset($_SESSION['SuppTrans']->TranDate)){ $_SESSION['SuppTrans']->TranDate= Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y'))); } echo '<td>' . _('Invoice Date') . ' (' . _('in format') . ' ' . $_SESSION['DefaultDateFormat'] . ') :</td> <td><input type="TEXT" class="date" alt="'.$_SESSION['DefaultDateFormat'].'" size="11" maxlength="10" name="TranDate" VALUE="' . $_SESSION['SuppTrans']->TranDate . '"></td>'; - + echo '<td>' . _('Exchange Rate') . ":</td> <td><input type=TEXT class='number' size=11 maxlength=10 name='ExRate' VALUE=" . $_SESSION['SuppTrans']->ExRate . '></td></tr>'; echo '</table>'; - + echo "<br><div class='centre'><input type=submit name='GRNS' VALUE='" . _('Enter Against Goods Received') . "'> "; - + echo "<input type=submit name='Shipts' VALUE='" . _('Enter Against Shipment') . "'> "; - + if ( $_SESSION['SuppTrans']->GLLink_Creditors == 1){ echo "<input type=submit name='GL' VALUE='" . _('Enter General Ledger Analysis') . "'></div>"; } else { echo '</div>'; } - - + + if (count( $_SESSION['SuppTrans']->GRNs)>0){ /*if there are any GRNs selected for invoicing then */ /*Show all the selected GRNs so far from the SESSION['SuppInv']->GRNs array */ - + echo '<table cellpadding=2>'; $tableheader = "<tr bgcolor=#800000><th>" . _('Seq') . " #</th> <th>" . _('Item Code') . "</th> @@ -251,57 +251,57 @@ <th>" . _('Price in') . ' ' . $_SESSION['SuppTrans']->CurrCode . "</th> <th>" . _('Line Total') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; echo $tableheader; - + $TotalGRNValue = 0; - + foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - + echo '<tr><td>' . $EnteredGRN->GRNNo . '</td><td>' . $EnteredGRN->ItemCode . '</td><td>' . $EnteredGRN->ItemDescription . '</td><td class=number>' . number_format($EnteredGRN->This_QuantityInv,2) . '</td><td class=number>' . number_format($EnteredGRN->ChgPrice,2) . '</td><td class=number>' . number_format($EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv,2) . '</td> </tr>'; - + $TotalGRNValue = $TotalGRNValue + ($EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv); - + } - + echo '<tr><td colspan=5 class=number><font color=blue>' . _('Total Value of Goods Charged') . ':</font></td> <td class=number><font color=blue><U>' . number_format($TotalGRNValue,2) . '</U></font></td></tr>'; echo '</table>'; } - + if (count( $_SESSION['SuppTrans']->Shipts) > 0){ /*if there are any Shipment charges on the invoice*/ - + echo '<table cellpadding=2>'; $TableHeader = "<tr><th>" . _('Shipment') . "</th> <th>" . _('Amount') . '</th></tr>'; echo $TableHeader; - + $TotalShiptValue = 0; - + foreach ($_SESSION['SuppTrans']->Shipts as $EnteredShiptRef){ - + echo '<tr><td>' . $EnteredShiptRef->ShiptRef . '</td><td class=number>' . number_format($EnteredShiptRef->Amount,2) . '</td></tr>'; - + $TotalShiptValue = $TotalShiptValue + $EnteredShiptRef->Amount; - + $i++; if ($i > 15){ $i = 0; echo $TableHeader; } } - + echo '<tr><td colspan=2 class=number><font size=4 color=blue>' . _('Total') . ':</font></td> <td class=number><font size=4 color=BLUE><U>' . number_format($TotalShiptValue,2) . '</U></font></td></tr></table>'; } - - + + if ( $_SESSION['SuppTrans']->GLLink_Creditors == 1){ - + if (count($_SESSION['SuppTrans']->GLCodes) > 0){ echo '<br><table cellpadding=2>'; $TableHeader = "<tr><th>" . _('Account') . @@ -311,25 +311,25 @@ <th>" . _('Job') . "</th> <th>" . _('Narrative') . '</th></tr>'; echo $TableHeader; - + $TotalGLValue = 0; - + foreach ($_SESSION['SuppTrans']->GLCodes as $EnteredGLCode){ - + echo '<tr><td>' . $EnteredGLCode->GLCode . '</td><td>' . $EnteredGLCode->GLActName . '</td><td class=number>' . number_format($EnteredGLCode->Amount,2) . '</td><td>' . $EnteredGLCode->ShiptRef . '</td><td>' .$EnteredGLCode->JobRef . '</td><td>' . $EnteredGLCode->Narrative . '</td></tr>'; - + $TotalGLValue = $TotalGLValue + $EnteredGLCode->Amount; - + } - + echo '<tr><td colspan=2 class=number><font size=4 color=blue>' . _('Total') . ':</font></td> <td class=number><font size=4 color=blue><U>' . number_format($TotalGLValue,2) . '</U></font></td> </tr></table>'; } - + if (!isset($TotalGRNValue)){ $TotalGRNValue = 0; } @@ -339,9 +339,9 @@ if (!isset($TotalShiptValue)){ $TotalShiptValue = 0; } - + $_SESSION['SuppTrans']->OvAmount = $TotalGRNValue + $TotalGLValue + $TotalShiptValue; - + echo '<br><table><tr><td>' . _('Amount in supplier currency') . ':</td><td colspan=2 class=number>' . number_format( $_SESSION['SuppTrans']->OvAmount,2) . '</td></tr>'; } else { @@ -349,110 +349,110 @@ ':</td><td colspan=2 class=number><input type=TEXT size=12 maxlength=10 name=OvAmount VALUE=' . number_format( $_SESSION['SuppTrans']->OvAmount,2) . '></td></tr>'; } - + echo "<tr><td colspan=2><input type=Submit name='ToggleTaxMethod' VALUE='" . _('Update Tax Calculation') . "'></td><td><select name='OverRideTax' onChange='ReloadForm(form1.ToggleTaxMethod)'>"; - + if ($_POST['OverRideTax']=='Man'){ echo "<option VALUE='Auto'>" . _('Automatic') . "<option selected VALUE='Man'>" . _('Manual'); } else { echo "<option selected VALUE='Auto'>" . _('Automatic') . "<option VALUE='Man'>" . _('Manual'); } - + echo '</select></td></tr>'; $TaxTotal =0; //initialise tax total - + foreach ($_SESSION['SuppTrans']->Taxes as $Tax) { - + echo '<tr><td>' . $Tax->TaxAuthDescription . '</td><td>'; - + /*Set the tax rate to what was entered */ if (isset($_POST['TaxRate' . $Tax->TaxCalculationOrder])){ $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate = $_POST['TaxRate' . $Tax->TaxCalculationOrder]/100; } - + /*If a tax rate is entered that is not the same as it was previously then recalculate automatically the tax amounts */ - + if (!isset($_POST['OverRideTax']) or $_POST['OverRideTax']=='Auto'){ - + echo ' <input type=TEXT class="number" name=TaxRate' . $Tax->TaxCalculationOrder . ' maxlength=4 size=4 VALUE=' . $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100 . '>%'; - + /*Now recaluclate the tax depending on the method */ if ($Tax->TaxOnTax ==1){ - + $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount = $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * ($_SESSION['SuppTrans']->OvAmount + $TaxTotal); - + } else { /*Calculate tax without the tax on tax */ - + $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount = $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * $_SESSION['SuppTrans']->OvAmount; - + } - - + + echo '<input type=hidden name="TaxAmount' . $Tax->TaxCalculationOrder . '" VALUE=' . round($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2) . '>'; - + echo '</td><td class=number>' . number_format($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2); - + } else { /*Tax being entered manually accept the taxamount entered as is*/ // if (!isset($_POST['TaxAmount' . $Tax->TaxCalculationOrder])) { // $_POST['TaxAmount' . $Tax->TaxCalculationOrder]=0; // } $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount = $_POST['TaxAmount' . $Tax->TaxCalculationOrder]; - + echo ' <input type=hidden name=TaxRate' . $Tax->TaxCalculationOrder . ' VALUE=' . $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * 100 . '>'; echo '</td><td><input type=TEXT class="number" size=12 maxlength=12 name="TaxAmount' . $Tax->TaxCalculationOrder . '" VALUE=' . round($_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount,2) . '>'; } - + $TaxTotal += $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount; - echo '</td></tr>'; + echo '</td></tr>'; } - + $_SESSION['SuppTrans']->OvAmount = round($_SESSION['SuppTrans']->OvAmount,2); - + $DisplayTotal = number_format(( $_SESSION['SuppTrans']->OvAmount + $TaxTotal), 2); - + echo '<tr><td>' . _('Invoice Total') . ':</td><td colspan=2 class=number><b>' . $DisplayTotal . '</b></td></tr></table>'; - + echo '<table><tr><td>' . _('Comments') . '</td><td><textarea name=Comments COLS=40 ROWS=2>' . $_SESSION['SuppTrans']->Comments . '</textarea></td></tr></table>'; - + echo "<p><div class='centre'><input type=submit name='PostInvoice' VALUE='" . _('Enter Invoice') . "'></div>"; - + } else { //do the postings -and dont show the button to process /*First do input reasonableness checks then do the updates and inserts to process the invoice entered */ foreach ($_SESSION['SuppTrans']->Taxes as $Tax) { - - + + /*Set the tax rate to what was entered */ if (isset($_POST['TaxRate' . $Tax->TaxCalculationOrder])){ $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate = $_POST['TaxRate' . $Tax->TaxCalculationOrder]/100; } - + if ($_POST['OverRideTax']=='Auto' OR !isset($_POST['OverRideTax'])){ - + /*Now recaluclate the tax depending on the method */ if ($Tax->TaxOnTax ==1){ - + $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount = $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * ($_SESSION['SuppTrans']->OvAmount + $TaxTotal); - + } else { /*Calculate tax without the tax on tax */ - + $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount = $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxRate * $_SESSION['SuppTrans']->OvAmount; - + } - + } else { /*Tax being entered manually accept the taxamount entered as is*/ $_SESSION['SuppTrans']->Taxes[$Tax->TaxCalculationOrder]->TaxOvAmount = $_POST['TaxAmount' . $Tax->TaxCalculationOrder]; } - + } /*Need to recalc the taxtotal */ @@ -488,9 +488,9 @@ $InputError = True; } else { - $sql = "SELECT count(*) - FROM supptrans - WHERE supplierno='" . $_SESSION['SuppTrans']->SupplierID . "' + $sql = "SELECT count(*) + FROM supptrans + WHERE supplierno='" . $_SESSION['SuppTrans']->SupplierID . "' AND supptrans.suppreference='" . $_POST['SuppReference'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The sql to check for the previous entry of the same invoice failed'); @@ -540,15 +540,15 @@ is created. Also, shipment records are created for the charges in local currency. 2. The order line item is not on a shipment - The cost as originally credited to GRN suspense on arrival of goods is debited to GRN suspense. + The cost as originally credited to GRN suspense on arrival of goods is debited to GRN suspense. Depending on the setting of WeightedAverageCosting: If the order line item is a stock item and WeightedAverageCosting set to OFF then use standard costing ..... Any difference between the std cost and the currency cost charged as converted at the ex rate of of the invoice is written off - to the purchase price variance account applicable to the stock item being invoiced. - Otherwise + to the purchase price variance account applicable to the stock item being invoiced. + Otherwise Recalculate the new weighted average cost of the stock and update the cost - post the difference to the appropriate stock code - + Or if its not a stock item but a nominal item then the GL account in the orignal order is used for the price variance account. */ @@ -558,21 +558,21 @@ /*GL Items are straight forward - just do the debit postings to the GL accounts specified - the credit is to creditors control act done later for the total invoice value + tax*/ - $SQL = 'INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount, - jobref) + $SQL = 'INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount, + jobref) VALUES (20, ' . - $InvoiceNo . ", - '" . $SQLInvoiceDate . "', - " . $PeriodNo . ', - ' . $EnteredGLCode->GLCode . ", - '" . $_SESSION['SuppTrans']->SupplierID . ' ' . $EnteredGLCode->Narrative . "', - " . round($EnteredGLCode->Amount/ $_SESSION['SuppTrans']->ExRate,2) . ", + $InvoiceNo . ", + '" . $SQLInvoiceDate . "', + " . $PeriodNo . ', + ' . $EnteredGLCode->GLCode . ", + '" . $_SESSION['SuppTrans']->SupplierID . ' ' . $EnteredGLCode->Narrative . "', + " . round($EnteredGLCode->Amount/ $_SESSION['SuppTrans']->ExRate,2) . ", '" . $EnteredGLCode->JobRef . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added because'); @@ -588,19 +588,19 @@ /*shipment postings are also straight forward - just do the debit postings to the GRN suspense account these entries are reversed from the GRN suspense when the shipment is closed*/ - $SQL = 'INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + $SQL = 'INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (20, ' . - $InvoiceNo . ", - '" . $SQLInvoiceDate . "', - " . $PeriodNo . ', - ' . $_SESSION['SuppTrans']->GRNAct . ", - '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Shipment charge against') . ' ' . $ShiptChg->ShiptRef . "', + $InvoiceNo . ", + '" . $SQLInvoiceDate . "', + " . $PeriodNo . ', + ' . $_SESSION['SuppTrans']->GRNAct . ", + '" . $_SESSION['SuppTrans']->SupplierID . ' ' . _('Shipment charge against') . ' ' . $ShiptChg->ShiptRef . "', " . $ShiptChg->Amount/ $_SESSION['SuppTrans']->ExRate . ')'; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction for the shipment') . @@ -616,24 +616,24 @@ foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - if (strlen($EnteredGRN->ShiptRef) == 0 OR $EnteredGRN->ShiptRef == 0){ - /*so its not a shipment item + if (strlen($EnteredGRN->ShiptRef) == 0 OR $EnteredGRN->ShiptRef == 0){ + /*so its not a shipment item enter the GL entry to reverse the GRN suspense entry created on delivery at standard cost used on delivery */ if ($EnteredGRN->StdCostUnit * $EnteredGRN->This_QuantityInv != 0) { - $SQL = 'INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (20, ' . $InvoiceNo . ", - '" . $SQLInvoiceDate . "', - " . $PeriodNo . ', - ' . $_SESSION['SuppTrans']->GRNAct . ", + $SQL = 'INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (20, ' . $InvoiceNo . ", + '" . $SQLInvoiceDate . "', + " . $PeriodNo . ', + ' . $_SESSION['SuppTrans']->GRNAct . ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemCode . ' x ' . $EnteredGRN->This_QuantityInv . ' @ ' . - _('std cost of') . ' ' . $EnteredGRN->StdCostUnit . "', + _('std cost of') . ' ' . $EnteredGRN->StdCostUnit . "', " . $EnteredGRN->StdCostUnit * $EnteredGRN->This_QuantityInv . ')'; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added because'); @@ -644,10 +644,10 @@ } - + $PurchPriceVar = round($EnteredGRN->This_QuantityInv * (($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit),2); - - + + /*Yes.... but where to post this difference to - if its a stock item the variance account must be retrieved from the stock category record if its a nominal purchase order item with no stock item then there will be no standard cost and it will all be variance so post it to the account specified in the purchase order detail record */ @@ -669,7 +669,7 @@ The quantity being invoiced here - $EnteredGRN->This_QuantityInv The cost of these items - $EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate */ - + $sql ="SELECT SUM(quantity) FROM locstock WHERE stockid='" . $EnteredGRN->ItemCode . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity on hand could not be retrieved from the database'); $DbgMsg = _('The following SQL to retrieve the total stock quantity was used'); @@ -677,29 +677,29 @@ $QtyRow = DB_fetch_row($Result); $TotalQuantityOnHand = $QtyRow[0]; - - /*The cost adjustment is the price variance / the total quantity in stock - But that's only provided that the total quantity in stock is > the quantity charged on this invoice - + + /*The cost adjustment is the price variance / the total quantity in stock + But that's only provided that the total quantity in stock is > the quantity charged on this invoice + If the quantity on hand is less the amount charged on this invoice then some must have been sold and the price variance on these must be written off to price variances*/ - + $WriteOffToVariances =0; - + if ($EnteredGRN->This_QuantityInv > $TotalQuantityOnHand){ /*So we need to write off some of the variance to variances and only the balance of the quantity in stock to go to stock value */ - + $WriteOffToVariances = ($EnteredGRN->This_QuantityInv - $TotalQuantityOnHand) * (($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit); - $SQL = 'INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + $SQL = 'INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (20, ' . $InvoiceNo . ", '" . $SQLInvoiceDate . "', " . $PeriodNo . ', ' . $StockGLCode['purchpricevaract'] . ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . @@ -715,18 +715,18 @@ } /*Now post any remaining price variance to stock rather than price variances */ - $SQL = 'INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + $SQL = 'INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (20, ' . - $InvoiceNo . ", - '" . $SQLInvoiceDate . "', - " . $PeriodNo . ', - ' . $StockGLCode['stockact'] . ", + $InvoiceNo . ", + '" . $SQLInvoiceDate . "', + " . $PeriodNo . ', + ' . $StockGLCode['stockact'] . ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('Average Cost Adj') . ' - ' . $EnteredGRN->ItemCode . ' x ' . $TotalQuantityOnHand . ' x ' . number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . @@ -738,7 +738,7 @@ $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); /*Now to update the stock cost with the new weighted average */ - + /*Need to consider what to do if the cost has been changed manually between receiving the stock and entering the invoice - this code assumes there has been no cost updates made manually and all the price variance is posted to stock. A nicety or important?? */ @@ -749,10 +749,10 @@ if ($TotalQuantityOnHand>0) { - + $CostIncrement = ($PurchPriceVar - $WriteOffToVariances) / $TotalQuantityOnHand; - $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, + $sql = "UPDATE stockmaster SET lastcost=materialcost+overheadcost+labourcost, materialcost=materialcost+" . $CostIncrement . " WHERE stockid='" . $EnteredGRN->ItemCode . "'"; $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg, True); } else { @@ -762,15 +762,15 @@ } /* End of Weighted Average Costing Code */ - } else { //It must be Standard Costing + } else { //It must be Standard Costing - $SQL = 'INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + $SQL = 'INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (20, ' . $InvoiceNo . ", '" . $SQLInvoiceDate . "', " . $PeriodNo . ', ' . $StockGLCode['purchpricevaract'] . ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . @@ -789,21 +789,21 @@ order price and the actual invoice price since the std cost was made equal to the order price in local currency at the time the goods were received */ - $SQL = 'INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) - VALUES (20, - ' . $InvoiceNo . ", - '" . $SQLInvoiceDate . "', - " . $PeriodNo . ', - ' . $EnteredGRN->GLCode . ", + $SQL = 'INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) + VALUES (20, + ' . $InvoiceNo . ", + '" . $SQLInvoiceDate . "', + " . $PeriodNo . ', + ' . $EnteredGRN->GLCode . ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . $EnteredGRN->ItemDescription . ' x ' . $EnteredGRN->This_QuantityInv . ' x ' . _('price var') . - ' ' . number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', + ' ' . number_format(($EnteredGRN->ChgPrice / $_SESSION['SuppTrans']->ExRate) - $EnteredGRN->StdCostUnit,2) . "', " . $PurchPriceVar . ')'; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The general ledger transaction could not be added for the price variance of the stock item because'); @@ -817,13 +817,13 @@ } else { /*then its a purchase order item on a shipment - whole charge amount to GRN suspense pending closure of the shipment when the variance is calculated and the GRN act cleared up for the shipment */ - $SQL = 'INSERT INTO gltrans (type, - typeno, - trandate, - periodno, - account, - narrative, - amount) + $SQL = 'INSERT INTO gltrans (type, + typeno, + trandate, + periodno, + account, + narrative, + amount) VALUES (20, ' . $InvoiceNo . ", '" . $SQLInvoiceDate . "', " . $PeriodNo . ', ' . $_SESSION['SuppTrans']->GRNAct . ", '" . $_SESSION['SuppTrans']->SupplierID . ' - ' . _('GRN') . ' ' . $EnteredGRN->GRNNo . ' - ' . @@ -902,58 +902,68 @@ } /*Thats the end of the GL postings */ + /*Shoel the invoie be on hold */ + $Hold=0; + foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ + if ($EnteredGRN->Hold) { + $Hold=1; + } + } + /*Now insert the invoice into the SuppTrans table*/ - $SQL = 'INSERT INTO supptrans (transno, - type, - supplierno, - suppreference, - trandate, - duedate, - ovamount, - ovgst, - rate, - transtext) + $SQL = 'INSERT INTO supptrans (transno, + type, + supplierno, + suppreference, + trandate, + duedate, + ovamount, + ovgst, + rate, + transtext, + hold) VALUES ('. $InvoiceNo . ", - 20 , - '" . $_SESSION['SuppTrans']->SupplierID . "', + 20 , + '" . $_SESSION['SuppTrans']->SupplierID . "', '" . $_SESSION['SuppTrans']->SuppReference . "', - '" . $SQLInvoiceDate . "', - '" . FormatDateForSQL($_SESSION['SuppTrans']->DueDate) . "', - " . round($_SESSION['SuppTrans']->OvAmount,2) . ', - ' . round($TaxTotal,2) . ', - ' . $_SESSION['SuppTrans']->ExRate . ", - '" . $_SESSION['SuppTrans']->Comments . "')"; + '" . $SQLInvoiceDate . "', + '" . FormatDateForSQL($_SESSION['SuppTrans']->DueDate) . "', + " . round($_SESSION['SuppTrans']->OvAmount,2) . ', + ' . round($TaxTotal,2) . ', + ' . $_SESSION['SuppTrans']->ExRate . ", + '" . $_SESSION['SuppTrans']->Comments . "', + ".$Hold.")"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier invoice transaction could not be added to the database because'); $DbgMsg = _('The following SQL to insert the supplier invoice was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); - + $SuppTransID = DB_Last_Insert_ID($db,'supptrans','id'); - + /* Insert the tax totals for each tax authority where tax was charged on the invoice */ foreach ($_SESSION['SuppTrans']->Taxes AS $TaxTotals) { - + $SQL = 'INSERT INTO supptranstaxes (supptransid, taxauthid, taxamount) VALUES (' . $SuppTransID . ', ' . $TaxTotals->TaxAuthID . ', ' . $TaxTotals->TaxOvAmount . ')'; - + $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The supplier transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the supplier transaction taxes record was used:'); $Result = DB_query($SQL,$db,$ErrMsg,$DbgMsg,true); } - + /* Now update the GRN and PurchOrderDetails records for amounts invoiced */ foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ $SQL = 'UPDATE purchorderdetails SET qtyinvoiced = qtyinvoiced + ' . $EnteredGRN->This_QuantityInv .', - actprice = ' . $EnteredGRN->ChgPrice . ' + actprice = ' . $EnteredGRN->ChgPrice . ' WHERE podetailitem = ' . $EnteredGRN->PODetailItem; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The quantity invoiced of the purchase order line could not be updated because'); @@ -976,15 +986,15 @@ /* insert the shipment charge records */ - $SQL = 'INSERT INTO shipmentcharges (shiptref, - transtype, - transno, - stockid, - value) - VALUES (' . $EnteredGRN->ShiptRef . ', - 20, - ' . $InvoiceNo . ", - '" . $EnteredGRN->ItemCode . "', + $SQL = 'INSERT INTO shipmentcharges (shiptref, + transtype, + transno, + stockid, + value) + VALUES (' . $EnteredGRN->ShiptRef . ', + 20, + ' . $InvoiceNo . ", + '" . $EnteredGRN->ItemCode . "', " . ($EnteredGRN->This_QuantityInv * $EnteredGRN->ChgPrice) / $_SESSION['SuppTrans']->ExRate . ')'; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment charge record for the shipment') . @@ -1002,18 +1012,18 @@ foreach ($_SESSION['SuppTrans']->Shipts as $ShiptChg){ - $SQL = 'INSERT INTO shipmentcharges (shiptref, - transtype, - transno, - value) - VALUES (' . $ShiptChg->ShiptRef . ', - 20, - ' . $InvoiceNo . ', + $SQL = 'INSERT INTO shipmentcharges (shiptref, + transtype, + transno, + value) + VALUES (' . $ShiptChg->ShiptRef . ', + 20, + ' . $InvoiceNo . ', ' . $ShiptChg->Amount/ $_SESSION['SuppTrans']->ExRate . ')'; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment charge record for the shipment') . + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The shipment charge record for the shipment') . ' ' . $ShiptChg->ShiptRef . ' ' . _('could not be added because'); - + $DbgMsg = _('The following SQL to insert the Shipment charge record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); @@ -1022,11 +1032,11 @@ $SQL="COMMIT"; - + $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The SQL COMMIT failed because'); - + $DbgMsg = _('The SQL COMMIT failed'); - + $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True); prnMsg(_('Supplier invoice number') . ' ' . $InvoiceNo . ' ' . _('has been processed'),'success'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-08 02:04:43 UTC (rev 3285) +++ trunk/doc/Change.log.html 2010-01-08 10:15:18 UTC (rev 3286) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>08/01/10 Tim: Put a supplier invoice on hold when outside the bounds set up in the config <p>07/01/10 Tim: Payments.php - Enforce numbers only in input boxes <p>07/01/10 Tim: GoodsReceived.php - Declare $identifier if not already declared before including PO_ReadInOrder.inc <p>07/01/10 Tim: silverwolf/default.css - Changes for new menu layout Modified: trunk/includes/DefineSuppTransClass.php =================================================================== --- trunk/includes/DefineSuppTransClass.php 2010-01-08 02:04:43 UTC (rev 3285) +++ trunk/includes/DefineSuppTransClass.php 2010-01-08 10:15:18 UTC (rev 3286) @@ -30,6 +30,7 @@ var $LocalTaxProvince; var $TaxGroupDescription; var $Taxes; + var $Hold; function SuppTrans(){ /*Constructor function initialises a new Supplier Transaction object */ @@ -38,12 +39,12 @@ $this->Shipts = array(); $this->Taxes = array(); } - + function GetTaxes () { - + global $db; - - /*Gets the Taxes and rates applicable to the tax group of the supplier + + /*Gets the Taxes and rates applicable to the tax group of the supplier and SESSION['DefaultTaxCategory'] and the taxprovince of the location that the user is setup to use*/ $SQL = "SELECT taxgrouptaxes.calculationorder, @@ -56,16 +57,16 @@ taxauthrates.taxauthority=taxgrouptaxes.taxauthid INNER JOIN taxauthorities ON taxauthrates.taxauthority=taxauthorities.taxid - WHERE taxgrouptaxes.taxgroupid=" . $this->TaxGroup . " - AND taxauthrates.dispatchtaxprovince=" . $this->LocalTaxProvince . " + WHERE taxgrouptaxes.taxgroupid=" . $this->TaxGroup . " + AND taxauthrates.dispatchtaxprovince=" . $this->LocalTaxProvince . " AND taxauthrates.taxcatid = " . $_SESSION['DefaultTaxCategory'] . " ORDER BY taxgrouptaxes.calculationorder"; $ErrMsg = _('The taxes and rates for this item could not be retrieved because'); $GetTaxRatesResult = DB_query($SQL,$db,$ErrMsg); - + while ($myrow = DB_fetch_array($GetTaxRatesResult)){ - + $this->Taxes[$myrow['calculationorder']] = new Tax($myrow['calculationorder'], $myrow['taxauthid'], $myrow['description'], @@ -74,38 +75,38 @@ $myrow['purchtaxglaccount']); } } //end method GetTaxes() - - - function Add_GRN_To_Trans($GRNNo, - $PODetailItem, - $ItemCode, - $ItemDescription, - $QtyRecd, - $Prev_QuantityInv, - $This_QuantityInv, - $OrderPrice, - $ChgPrice, - $Complete, - $StdCostUnit=0, - $ShiptRef, - $JobRef, + + + function Add_GRN_To_Trans($GRNNo, + $PODetailItem, + $ItemCode, + $ItemDescription, + $QtyRecd, + $Prev_QuantityInv, + $This_QuantityInv, + $OrderPrice, + $ChgPrice, + $Complete, + $StdCostUnit=0, + $ShiptRef, + $JobRef, $GLCode, $PONo){ - + if ($This_QuantityInv!=0 AND isset($This_QuantityInv)){ - $this->GRNs[$GRNNo] = new GRNs($GRNNo, - $PODetailItem, + $this->GRNs[$GRNNo] = new GRNs($GRNNo, + $PODetailItem, $ItemCode, - $ItemDescription, - $QtyRecd, - $Prev_QuantityInv, - $This_QuantityInv, - $OrderPrice, - $ChgPrice, - $Complete, - $StdCostUnit, - $ShiptRef, - $JobRef, + $ItemDescription, + $QtyRecd, + $Prev_QuantityInv, + $This_QuantityInv, + $OrderPrice, + $ChgPrice, + $Complete, + $StdCostUnit, + $ShiptRef, + $JobRef, $GLCode, $PONo); Return 1; @@ -113,11 +114,11 @@ Return 0; } - function Modify_GRN_To_Trans($GRNNo, - $PODetailItem, - $ItemCode, - $ItemDescription, - $QtyRecd, + function Modify_GRN_To_Trans($GRNNo, + $PODetailItem, + $ItemCode, + $ItemDescription, + $QtyRecd, $Prev_QuantityInv, $This_QuantityInv, $OrderPrice, @@ -126,7 +127,8 @@ $StdCostUnit, $ShiptRef, $JobRef, - $GLCode){ + $GLCode, + $Hold){ if ($This_QuantityInv!=0 && isset($This_QuantityInv)){ $this->GRNs[$GRNNo]->Modify($PODetailItem, @@ -141,7 +143,8 @@ $StdCostUnit, $ShiptRef, $JobRef, - $GLCode + $GLCode, + $Hold ); Return 1; } @@ -150,22 +153,23 @@ function Copy_GRN_To_Trans($GRNSrc){ if ($GRNSrc->This_QuantityInv!=0 && isset($GRNSrc->This_QuantityInv)){ - + $this->GRNs[$GRNSrc->GRNNo] = new GRNs($GRNSrc->GRNNo, - $GRNSrc->PODetailItem, - $GRNSrc->ItemCode, - $GRNSrc->ItemDescription, - $GRNSrc->QtyRecd, - $GRNSrc->Prev_QuantityInv, - $GRNSrc->This_QuantityInv, - $GRNSrc->OrderPrice, - $GRNSrc->ChgPrice, - $GRNSrc->Complete, - $GRNSrc->StdCostUnit, - $GRNSrc->ShiptRef, - $GRNSrc->JobRef, + $GRNSrc->PODetailItem, + $GRNSrc->ItemCode, + $GRNSrc->ItemDescription, + $GRNSrc->QtyRecd, + $GRNSrc->Prev_QuantityInv, + $GRNSrc->This_QuantityInv, + $GRNSrc->OrderPrice, + $GRNSrc->ChgPrice, + $GRNSrc->Complete, + $GRNSrc->StdCostUnit, + $GRNSrc->ShiptRef, + $GRNSrc->JobRef, $GRNSrc->GLCode, - $GRNSrc->PONo); + $GRNSrc->PONo, + $GRNSrc->Hold); Return 1; } Return 0; @@ -173,11 +177,11 @@ function Add_GLCodes_To_Trans($GLCode, $GLActName, $Amount, $JobRef, $Narrative){ if ($Amount!=0 AND isset($Amount)){ - $this->GLCodes[$this->GLCodesCounter] = new GLCodes($this->GLCodesCounter, - $GLCode, - $GLActName, + $this->GLCodes[$this->GLCodesCounter] = new GLCodes($this->GLCodesCounter, + $GLCode, + $GLActName, $Amount, - $JobRef, + $JobRef, $Narrative); $this->GLCodesCounter++; Return 1; @@ -187,8 +191,8 @@ function Add_Shipt_To_Trans($ShiptRef, $Amount){ if ($Amount!=0){ - $this->Shipts[$this->ShiptCounter] = new Shipment($this->ShiptCounter, - $ShiptRef, + $this->Shipts[$this->ShiptCounter] = new Shipment($this->ShiptCounter, + $ShiptRef, $Amount); $this->ShiptCounter++; Return 1; @@ -227,7 +231,8 @@ var $ShiptRef; var $JobRef; var $GLCode; - Var $PONo; + var $PONo; + var $Hold; function GRNs ($GRNNo, $PODetailItem, @@ -275,7 +280,8 @@ $StdCostUnit, $ShiptRef, $JobRef, - $GLCode){ + $GLCode, + $Hold){ /* Modify function to edit a GRNs object with passed params */ $this->PODetailItem = $PODetailItem; @@ -290,6 +296,7 @@ $this->StdCostUnit = $StdCostUnit; $this->ShiptRef = $ShiptRef; $this->JobRef = $JobRef; + $this->Hold = $Hold; $this->GLCode = $GLCode; } } @@ -337,14 +344,14 @@ Var $TaxOnTax; Var $TaxGLCode; Var $TaxOvAmount; - - function Tax ($TaxCalculationOrder, - $TaxAuthID, - $TaxAuthDescription, - $TaxRate, - $TaxOnTax, + + function Tax ($TaxCalculationOrder, + $TaxAuthID, + $TaxAuthDescription, + $TaxRate, + $TaxOnTax, $TaxGLCode){ - + $this->TaxCalculationOrder = $TaxCalculationOrder; $this->TaxAuthID = $TaxAuthID; $this->TaxAuthDescription = $TaxAuthDescription; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-08 10:33:12
|
Revision: 3287 http://web-erp.svn.sourceforge.net/web-erp/?rev=3287&view=rev Author: tim_schofield Date: 2010-01-08 10:32:55 +0000 (Fri, 08 Jan 2010) Log Message: ----------- Correct errors preventing invoice from printing Modified Paths: -------------- trunk/PrintCustTrans.php trunk/doc/Change.log.html Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2010-01-08 10:15:18 UTC (rev 3286) +++ trunk/PrintCustTrans.php 2010-01-08 10:32:55 UTC (rev 3287) @@ -2,7 +2,7 @@ /* $Id$ */ -/* Javier: This file has 5 PDF Outputs, one FPDI class, one function, +/* Javier: This file has 5 PDF Outputs, one FPDI class, one function, El único q cambió alguien está en L570, 3 son de fpdi y el 5º está en L457 */ $PageSecurity = 1; @@ -60,7 +60,7 @@ $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']); @@ -289,10 +289,10 @@ WHERE debtortrans.transno = ' . $FromTransNo . ' AND debtortrans.order_ = salesorderdetails.orderno AND salesorderdetails.stkcode = "'.$myrow2['stockid'].'"'; - + $resultp=DB_query($sql,$db); $myrow3=DB_fetch_array($resultp); - + /*check the price after discount*/ if ($myrow2['discountpercent']==0) { @@ -480,7 +480,7 @@ } } -$pdf =& new concat_pdf(); +// $pdf =& new concat_pdf(); // Have to get the TransNo again, not sure what happens if we have a series of trans nos if (isset($_GET['FromTransNo'])) { @@ -503,15 +503,15 @@ // 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'])); + $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'); exit; - // If EMAIL is selected, send the invoice via email, this is not appending pages yet though + // If EMAIL is selected, send the invoice via email, this is not appending pages yet though } elseif (isset($_GET['Email'])) { - $pdfcode = $pdf->Output($_SESSION['reports_dir'] . '/Invoice.pdf','D'); + $pdfcode = $pdf->Output($_SESSION['reports_dir'] . '/Invoice.pdf','D'); } else { - // If the appendfile field is empty and EMAIL is not selected, just print the invoice without any appended pages + // 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'); exit; } @@ -554,7 +554,7 @@ } else { /* Javier: este es el más importante según cierta persona ya q es el único q cambió, pero nadie parece saber nada -// Javier: TCPDF sends its own http header, it's an error to send it twice. +// Javier: TCPDF sends its own http header, it's an error to send it twice. header('Content-type: application/pdf'); header('Content-Length: ' . $len); header('Content-Disposition: inline; filename=Customer_trans.pdf'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-08 10:15:18 UTC (rev 3286) +++ trunk/doc/Change.log.html 2010-01-08 10:32:55 UTC (rev 3287) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>08/01/10 Tim: PrintCustTrans.php - Correct errors preventing invoice from printing <p>08/01/10 Tim: Put a supplier invoice on hold when outside the bounds set up in the config <p>07/01/10 Tim: Payments.php - Enforce numbers only in input boxes <p>07/01/10 Tim: GoodsReceived.php - Declare $identifier if not already declared before including PO_ReadInOrder.inc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-09 10:24:44
|
Revision: 3288 http://web-erp.svn.sourceforge.net/web-erp/?rev=3288&view=rev Author: tim_schofield Date: 2010-01-09 10:24:38 +0000 (Sat, 09 Jan 2010) Log Message: ----------- Changes to api session handling. Modified Paths: -------------- trunk/api/api_php.php trunk/api/api_stock.php trunk/api/api_xml-rpc.php trunk/doc/Change.log.html trunk/includes/session.inc Added Paths: ----------- trunk/api/api_login.php trunk/api/api_session.inc trunk/includes/UserLogin.php Added: trunk/api/api_login.php =================================================================== --- trunk/api/api_login.php (rev 0) +++ trunk/api/api_login.php 2010-01-09 10:24:38 UTC (rev 3288) @@ -0,0 +1,47 @@ +<?php +/* $Id$*/ +// Validates user and sets up $_SESSION environment for API users. +function LoginAPI($databasename, $user, $password) { + global $PathPrefix; // For included files + include('../config.php'); + // Include now for the error code values. + include '../includes/UserLogin.php'; /* Login checking and setup */ + $RetCode = array(); // Return result. + if (!isset($_SESSION['DatabaseName']) OR $_SESSION['DatabaseName'] == '' ) { + // Establish the database connection for this session. + $_SESSION['DatabaseName'] = $databasename; + /* Drag in the code to connect to the DB, and some other + * functions. If the connection is established, the + * variable $db will be set as the DB connection id. + * NOTE: This is needed here, as the api_session.inc file + * does NOT include this if there is no database name set. + */ + include('../includes/ConnectDB.inc'); + // Need to ensure we have a connection. + if (!isset($db)) { + $RetCode[0] = NoAuthorisation; + $RetCode[1] = UL_CONFIGERR; + return $RetCode; + } + $_SESSION['db'] = $db; // Set in above include + } + $rc = userLogin($user, $password, $_SESSION['db']); + switch ($rc) { + case UL_OK: + $RetCode[0] = 0; // All is well + break; + case UL_NOTVALID: + case UL_BLOCKED: + case UL_CONFIGERR: + case UL_SHOWLOGIN: + // Following not in use at 18 Nov 09. + case UL_MAINTENANCE: + /* Just return an error for now */ + $RetCode[0] = NoAuthorisation; + $RetCode[1] = $rc; + break; + } + return $RetCode; +} +// ALSO NEED A userLogout FUNCTION +?> \ No newline at end of file Property changes on: trunk/api/api_login.php ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/api/api_php.php =================================================================== --- trunk/api/api_php.php 2010-01-08 10:32:55 UTC (rev 3287) +++ trunk/api/api_php.php 2010-01-09 10:24:38 UTC (rev 3288) @@ -1,13 +1,12 @@ <?php -/* $Id$*/ /* Include session.inc, to allow database connection, and access to miscfunctions, and datefunctions.*/ - $DatabaseName='weberpdemo'; +// $DatabaseName='harlotte'; $AllowAnyone = true; $PathPrefix=dirname(__FILE__).'/../'; - include($PathPrefix.'includes/session.inc'); - $_SESSION['db']=$db; + include('api_session.inc'); +// $_SESSION['db']=$db; include 'api_errorcodes.php'; /* Include SQL_CommonFunctions.inc, to use GetNextTransNo().*/ @@ -16,36 +15,15 @@ /* Get weberp authentication, and return a valid database connection */ function db($user, $password) { - $_SESSION['UserID'] = $user; - $sql = "SELECT fullaccess - FROM www_users - WHERE userid='" . DB_escape_string($user) . "' - AND (password='" . CryptPass(DB_escape_string($password)) . "' - OR password='" . DB_escape_string($password) . "')"; - $Auth_Result = DB_query($sql, $_SESSION['db']); - $myrow=DB_fetch_row($Auth_Result); - if (DB_num_rows($Auth_Result) > 0) { - $_SESSION['AccessLevel'] = $myrow[0]; - $sql = 'SELECT tokenid FROM securitygroups - WHERE secroleid = ' . $_SESSION['AccessLevel']; - $Sec_Result = DB_query($sql, $_SESSION['db']); - - $_SESSION['AllowedPageSecurityTokens'] = array(); - if (DB_num_rows($Sec_Result)==0){ - return NoAuthorisation; - } else { - $i=0; - while ($myrow = DB_fetch_row($Sec_Result)){ - $_SESSION['AllowedPageSecurityTokens'][$i] = $myrow[0]; - $i++; - } - } - return $_SESSION['db']; - } else { + if (!isset($_SESSION['AccessLevel']) OR + $_SESSION['AccessLevel'] == '') { return NoAuthorisation; + } else { + return $_SESSION['db']; } } + include 'api_login.php'; include 'api_customers.php'; include 'api_branches.php'; include 'api_currencies.php'; Added: trunk/api/api_session.inc =================================================================== --- trunk/api/api_session.inc (rev 0) +++ trunk/api/api_session.inc 2010-01-09 10:24:38 UTC (rev 3288) @@ -0,0 +1,142 @@ +<?php +/* $Id$*/ + +if (!isset($PathPrefix)) { + $PathPrefix=''; +} +if (!file_exists($PathPrefix . 'config.php')){ + $rootpath = dirname($_SERVER['PHP_SELF']); + if ($rootpath == '/' OR $rootpath == "\\") { + $rootpath = ''; + } + header('Location:' . $rootpath . '/install/index.php'); +} +include($PathPrefix . 'config.php'); + +if (isset($SessionSavePath)){ + session_save_path($SessionSavePath); +} + +ini_set('session.gc_Maxlifetime',$SessionLifeTime); +ini_set('max_execution_time',$MaximumExecutionTime); + +session_name('webERPapi'); +session_start(); + +include($PathPrefix . 'includes/LanguageSetup.php'); +// Establish a DB connection, if possible. NOTE that this connection +// may not have the same 'value' as any previous connection, so +// save the new one in the session variable. +if (isset($_SESSION['DatabaseName']) AND $_SESSION['DatabaseName'] != '' ) { + include($PathPrefix . 'includes/ConnectDB.inc'); + $_SESSION['db'] = $db; +} +include($PathPrefix . 'includes/DateFunctions.inc'); + +// Un comment to turn off attempts counter +//$_SESSION['AttemptsCounter'] = 0; + +if (!isset($_SESSION['AttemptsCounter'])){ + $_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'); + exit; + } +} + +// Now check that the user as logged in has access to the page being called. The $PageSecurity +// value must be set in the script before header.inc is included. $SecurityGroups is an array of +// arrays defining access for each group of users. These definitions can be modified by a system admin under setup + + +if (!is_array($_SESSION['AllowedPageSecurityTokens']) AND !isset($AllowAnyone)) { + $title = _('Account Error Report'); + include($PathPrefix . 'includes/header.inc'); + echo '<br /><br /><br />'; + prnMsg(_('Security settings have not been defined for your user account. Please advise your system administrator. It could also be that there is a session problem with your PHP web server'),'error'); + include($PathPrefix . 'includes/footer.inc'); + exit; +} + +if (!isset($AllowAnyone)){ + if ((!in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PageSecurity))) { + $title = _('Security Permissions Problem'); + include($PathPrefix . 'includes/header.inc'); + echo '<tr> + <td class="menu_group_items"> + <table width="100%" class="table_index"> + <tr><td class="menu_group_item">'; + echo '<b><font style="size:+1; text-align:center;">' . _('The security settings on your account do not permit you to access this function') . '</font></b>'; + + echo '</td> + </tr> + </table> + </td>'; + + include($PathPrefix . 'includes/footer.inc'); + exit; + } + } + +function CryptPass( $Password ) { + global $CryptFunction; + if ( $CryptFunction == 'sha1' ) { + return sha1($Password); + } elseif ( $CryptFunction == 'md5' ) { + return md5($Password); + } else { + return $Password; + } + } +?> \ No newline at end of file Property changes on: trunk/api/api_session.inc ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/api/api_stock.php =================================================================== --- trunk/api/api_stock.php 2010-01-08 10:32:55 UTC (rev 3287) +++ trunk/api/api_stock.php 2010-01-09 10:24:38 UTC (rev 3288) @@ -1,5 +1,4 @@ <?php -/* $Id$*/ /* Check that the stock code*/ function VerifyStockCode($StockCode, $i, $Errors, $db) { @@ -282,7 +281,7 @@ return $Errors; } $PageSecurity =11; //The authorisation required to go to the stock modification script - if ((!in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']))) { + if ((!in_array($PageSecurity, $_SESSION['AllowedPageSecurityTokens']))) { $Errors[0]=NoAuthorisation; return $Errors; } @@ -550,7 +549,7 @@ } } - function GetStockbalance($StockID, $user, $password) { + function GetStockBalance($StockID, $user = '', $password = '') { $Errors = array(); $db = db($user, $password); if (gettype($db)=='integer') { @@ -782,16 +781,16 @@ ',"api adjustment",'.$Quantity.','.$newqoh.')'; $locstocksql='UPDATE locstock SET quantity = quantity + '.$Quantity.' WHERE loccode="'. $Location.'" AND stockid="'.$StockID.'"'; - $glupdatesql1="INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) - VALUES (17,".GetNextTransactionNo(17, $db).",'".$TranDate. - "',".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). - ",".$adjglact.",".$itemdetails['materialcost']*-$Quantity. - ",'".$StockID." x ".$Quantity." @ ".$itemdetails['materialcost']."')"; - $glupdatesql2="INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) - VALUES (17,".GetNextTransactionNo(17, $db).",'".$TranDate. - "',".GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). - ",".$stockact.",".$itemdetails['materialcost']*$Quantity. - ",'".$StockID." x ".$Quantity." @ ".$itemdetails['materialcost']."')"; + $glupdatesql1='INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) + VALUES (17,'.GetNextTransactionNo(17, $db).',"'.$TranDate. + '",'.GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). + ','.$adjglact.','.$itemdetails['materialcost']*-$Quantity. + ',"'.$StockID.' x '.$Quantity.' @ '.$itemdetails['materialcost'].'")'; + $glupdatesql2='INSERT INTO gltrans (type, typeno, trandate, periodno, account, amount, narrative) + VALUES (17,'.GetNextTransactionNo(17, $db).',"'.$TranDate. + '",'.GetPeriodFromTransactionDate($TranDate, sizeof($Errors), $Errors, $db). + ','.$stockact.','.$itemdetails['materialcost']*$Quantity. + ',"'.$StockID.' x '.$Quantity.' @ '.$itemdetails['materialcost'].'")'; $systypessql = 'UPDATE systypes set typeno='.GetNextTransactionNo(17, $db).' where typeid=17'; DB_Txn_Begin($db); Modified: trunk/api/api_xml-rpc.php =================================================================== --- trunk/api/api_xml-rpc.php 2010-01-08 10:32:55 UTC (rev 3287) +++ trunk/api/api_xml-rpc.php 2010-01-09 10:24:38 UTC (rev 3288) @@ -1,13 +1,47 @@ <?php -/* $Id$*/ include 'api_php.php'; include '../xmlrpc/lib/xmlrpc.inc'; + include '../xmlrpc/lib/xmlrpcs.inc'; + unset($Parameter); unset($ReturnValue); + $Description = _('This function is used to login into the API methods for the specified the database.'); + $Parameter[0]['name'] = _('Database Name'); + $Parameter[0]['description'] = _('The name of the database to use for the transactions to come. '); + $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 integer. '). + _('Zero means the function was successful. '). + _('Otherwise an error code is returned. '); + + $doc = '<tr><td><b><u>'._('Description').'</u></b></td><td colspan=2>' .$Description.'</td></tr> + <tr><td valign="top"><b><u>'._('Parameters').'</u></b></td>'; + for ($i=0; $i<sizeof($Parameter); $i++) { + $doc .= '<tr><td valign="top">'.$Parameter[$i]['name'].'</td><td>'. + $Parameter[$i]['description'].'</td></tr>'; + } + $doc .= '<tr><td valign="top"><b><u>'._('Return Value'); + for ($i=0; $i<sizeof($ReturnValue); $i++) { + $doc .= '<td valign="top">'.$ReturnValue[$i].'</td></tr>'; + } + $doc .= '</table>'; + $Login_sig = array(array($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)); + $Login_doc = $doc; + + function xmlrpc_Login($xmlrpcmsg) { + return new xmlrpcresp(php_xmlrpc_encode(LoginAPI($xmlrpcmsg->getParam(0)->scalarval(), + $xmlrpcmsg->getParam(1)->scalarval(), + $xmlrpcmsg->getParam(2)->scalarval()))); + } + + unset($Parameter); + unset($ReturnValue); $Description = _('This function is used to insert a new customer into the webERP database.'); $Parameter[0]['name'] = _('Customer Details'); $Parameter[0]['description'] = _('A set of key/value pairs where the key must be identical to the name of the field to be updated. ') @@ -553,13 +587,12 @@ $doc .= '<td valign="top">'.$ReturnValue[$i].'</td></tr>'; } $doc .= '</table>'; - $GetStockItem_sig = array(array($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)); + $GetStockItem_sig = array(array($xmlrpcStruct, $xmlrpcString)); $GetStockItem_doc = $doc; function xmlrpc_GetStockItem($xmlrpcmsg) { return new xmlrpcresp(php_xmlrpc_encode(GetStockItem($xmlrpcmsg->getParam(0)->scalarval(), - $xmlrpcmsg->getParam(1)->scalarval(), - $xmlrpcmsg->getParam(2)->scalarval()))); + '', ''))); } unset($Parameter); @@ -598,7 +631,7 @@ $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 stock quantities by location for this stock item. '). + $ReturnValue[0] = _('This function returns an array of stock quantities by location for this stock item. '); $doc = '<tr><td><b><u>'._('Description').'</u></b></td><td colspan=2>' .$Description.'</td></tr> <tr><td valign="top"><b><u>'._('Parameters').'</u></b></td>'; for ($i=0; $i<sizeof($Parameter); $i++) { @@ -610,13 +643,18 @@ $doc .= '<td valign="top">'.$ReturnValue[$i].'</td></tr>'; } $doc .= '</table>'; - $GetStockBalance_sig = array(array($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)); + $GetStockBalance_sig = array(array($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString),array($xmlrpcStruct, $xmlrpcString)); $GetStockBalance_doc = $doc; function xmlrpc_GetStockBalance($xmlrpcmsg) { - return new xmlrpcresp(php_xmlrpc_encode(GetStockBalance($xmlrpcmsg->getParam(0)->scalarval(), + if ($xmlrpcmsg->getNumParams() == 3) + { + return new xmlrpcresp(php_xmlrpc_encode(GetStockBalance($xmlrpcmsg->getParam(0)->scalarval(), $xmlrpcmsg->getParam(1)->scalarval(), $xmlrpcmsg->getParam(2)->scalarval()))); + } else { + return new xmlrpcresp(php_xmlrpc_encode(GetStockBalance($xmlrpcmsg->getParam(0)->scalarval()))); + } } unset($Parameter); @@ -666,7 +704,7 @@ $Parameter[3]['description'] = _('A valid weberp username. This user should have security access to this data.'); $Parameter[4]['name'] = _('User password'); $Parameter[4]['description'] = _('The weberp password associated with this user name. '); - $ReturnValue[0] = _('This function returns zero if the transaction was successful or an array of error codes if not. '). + $ReturnValue[0] = _('This function returns zero if the transaction was successful or an array of error codes if not. '); $doc = '<tr><td><b><u>'._('Description').'</u></b></td><td colspan=2>' .$Description.'</td></tr> <tr><td valign="top"><b><u>'._('Parameters').'</u></b></td>'; for ($i=0; $i<sizeof($Parameter); $i++) { @@ -842,6 +880,18 @@ unset($ReturnValue); unset($doc); unset($Description); + $Description = 'This function is used to start a new sales order.'; + $Parameter[0]['name'] = _('Insert Sales Order Header'); + $Parameter[0]['description'] = _('A set of key/value pairs where the key must be identical to the name of the field to be updated. ') + ._('The field names can be found ').'<a href="../../Z_DescribeTable.php?table=salesorders">'._('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 orderno key is generated by this call, and if a value is supplied, it will be ignored. ') + ._('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] = _('If successful this function returns a two element array; the first element is 0 for success or an error code, while the second element is the order number.'); $doc = '<tr><td><b><u>'._('Description').'</u></b></td><td colspan=2>' .$Description.'</td></tr> <tr><td valign="top"><b><u>'._('Parameters').'</u></b></td>'; for ($i=0; $i<sizeof($Parameter); $i++) { @@ -866,6 +916,17 @@ unset($ReturnValue); unset($doc); unset($Description); + $Description = 'This function is used to modify the header details of a sales order'; + $Parameter[0]['name'] = _('Modify Sales Order Header Details'); + $Parameter[0]['description'] = _('A set of key/value pairs where the key must be identical to the name of the field to be updated. ') + ._('The field names can be found ').'<a href="../../Z_DescribeTable.php?table=salesorders">'._('here ').'</a>' + ._('and are case sensitive. ')._('The values should be of the correct type, and the api will check them before updating the database. ') + ._('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] = _('If successful this function returns a single element array with the value 0; otherwise, it contains all error codes encountered during the update.'); $doc = '<tr><td><b><u>'._('Description').'</u></b></td><td colspan=2>' .$Description.'</td></tr> <tr><td valign="top"><b><u>'._('Parameters').'</u></b></td>'; for ($i=0; $i<sizeof($Parameter); $i++) { @@ -890,6 +951,18 @@ unset($ReturnValue); unset($doc); unset($Description); + $Description = 'This function is used to add line items to a sales order.'; + $Parameter[0]['name'] = _('Insert Sales Order Line'); + $Parameter[0]['description'] = _('A set of key/value pairs where the key must be identical to the name of the field to be updated. ') + ._('The field names can be found ').'<a href="../../Z_DescribeTable.php?table=salesorderdetails">'._('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 orderno key must be one of these values. ') + ._('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; the first element is 0 for success; otherwise the array contains a list of all errors encountered.'); $doc = '<tr><td><b><u>'._('Description').'</u></b></td><td colspan=2>' .$Description.'</td></tr> <tr><td valign="top"><b><u>'._('Parameters').'</u></b></td>'; for ($i=0; $i<sizeof($Parameter); $i++) { @@ -914,6 +987,18 @@ unset($ReturnValue); unset($doc); unset($Description); + $Description = 'This function is used to modify line items on a sales order.'; + $Parameter[0]['name'] = _('Modify Sales Order Line'); + $Parameter[0]['description'] = _('A set of key/value pairs where the key must be identical to the name of the field to be updated. ') + ._('The field names can be found ').'<a href="../../Z_DescribeTable.php?table=salesorderdetails">'._('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 orderno and stkcode keys must be one of these values. ') + ._('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; the first element is 0 for success; otherwise the array contains a list of all errors encountered.'); $doc = '<tr><td><b><u>'._('Description').'</u></b></td><td colspan=2>' .$Description.'</td></tr> <tr><td valign="top"><b><u>'._('Parameters').'</u></b></td>'; for ($i=0; $i<sizeof($Parameter); $i++) { @@ -1602,7 +1687,7 @@ } $doc .= '<tr><td valign="top"><b><u>'._('Return Value'); for ($i=0; $i<sizeof($ReturnValue); $i++) { - $doc .= '<tr><td></td><td valign="top">'.$ReturnValue[$i].'</td></tr>'; + $doc .= '<td valign="top">'.$ReturnValue[$i].'</td></tr>'; } $doc .= '</table>'; $InsertSupplier_sig = array(array($xmlrpcStruct, $xmlrpcStruct, $xmlrpcString, $xmlrpcString)); @@ -2190,6 +2275,10 @@ } $s = new xmlrpc_server( array( + "weberp.xmlrpc_Login" => array( + "function" => "xmlrpc_Login", + "signature" => $Login_sig, + "docstring" => $Login_doc), "weberp.xmlrpc_InsertCustomer" => array( "function" => "xmlrpc_InsertCustomer", "signature" => $InsertCustomer_sig, @@ -2418,7 +2507,7 @@ "function" => "xmlrpc_StockCatPropertyList", "signature" => $StockCatPropertyList_sig, "docstring" => $StockCatPropertyList_doc), - "weberp.xmlrpc_GetGLAccountList" => array( + "weberp.xmlrpc_GetGLAccountList" => array( "function" => "xmlrpc_GetGLAccountList", "signature" => $GetGLAccountList_sig, "docstring" => $GetGLAccountList_doc), @@ -2501,4 +2590,4 @@ ) ); -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-08 10:32:55 UTC (rev 3287) +++ trunk/doc/Change.log.html 2010-01-09 10:24:38 UTC (rev 3288) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>09/01/10 Lindsay: Changes to api session handling. <p>08/01/10 Tim: PrintCustTrans.php - Correct errors preventing invoice from printing <p>08/01/10 Tim: Put a supplier invoice on hold when outside the bounds set up in the config <p>07/01/10 Tim: Payments.php - Enforce numbers only in input boxes Added: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php (rev 0) +++ trunk/includes/UserLogin.php 2010-01-09 10:24:38 UTC (rev 3288) @@ -0,0 +1,124 @@ +<?php + +/* Performs login checks and $_SESSION initialisation */ +/* $Id$*/ + +define('UL_OK', 0); /* User verified, session initialised */ +define('UL_NOTVALID', 1); /* User/password do not agree */ +define('UL_BLOCKED', 2); /* Account locked, too many failed logins */ +define('UL_CONFIGERR', 3); /* Configuration error in webERP or server */ +define('UL_SHOWLOGIN', 4); /* Can this happen? */ +// Following not in use at 18 Nov 09. +define('UL_MAINTENANCE', 5); /* Maintenance mode - no user logins */ + +/* UserLogin + * Function to validate user name, perform validity checks and initialise + * $_SESSION data. + * Returns: + * See define() statements above. + */ + +function userLogin($Name, $Password, $db) { + if (!isset($_SESSION['AccessLevel']) OR $_SESSION['AccessLevel'] == '' OR + (isset($Name) AND $Name != '')) { + /* if not logged in */ + $_SESSION['AccessLevel'] = ''; + $_SESSION['CustomerID'] = ''; + $_SESSION['UserBranch'] = ''; + $_SESSION['SalesmanLogin'] = ''; + $_SESSION['Module'] = ''; + $_SESSION['PageSize'] = ''; + $_SESSION['UserStockLocation'] = ''; + $_SESSION['AttemptsCounter']++; + // Show login screen + if (!isset($Name) or $Name == '') { + return UL_SHOWLOGIN; + } + $sql = "SELECT www_users.fullaccess, + www_users.customerid, + www_users.lastvisitdate, + www_users.pagesize, + www_users.defaultlocation, + www_users.branchcode, + www_users.modulesallowed, + www_users.blocked, + www_users.realname, + www_users.theme, + www_users.displayrecordsmax, + www_users.userid, + www_users.language, + www_users.salesman + FROM www_users + WHERE www_users.userid='" . $Name . "' + AND (www_users.password='" . CryptPass($Password) . "' + OR www_users.password='" . $Password . "')"; + $Auth_Result = DB_query($sql, $db); + // Populate session variables with data base results + if (DB_num_rows($Auth_Result) > 0) { + $myrow = DB_fetch_row($Auth_Result); + if ($myrow[7]==1){ + //the account is blocked + return UL_BLOCKED; + } + /*reset the attempts counter on successful login */ + $_SESSION['AttemptsCounter'] = 0; + $_SESSION['AccessLevel'] = $myrow[0]; + $_SESSION['CustomerID'] = $myrow[1]; + $_SESSION['UserBranch'] = $myrow[5]; + $_SESSION['DefaultPageSize'] = $myrow[3]; + $_SESSION['UserStockLocation'] = $myrow[4]; + $_SESSION['ModulesEnabled'] = explode(",", $myrow[6]); + $_SESSION['UsersRealName'] = $myrow[8]; + $_SESSION['Theme'] = $myrow[9]; +// $_SESSION['UserID'] = $myrow[11]; + $_SESSION['Language'] = $myrow[12]; + $_SESSION['SalesmanLogin'] = $myrow[13]; + if ($myrow[10] > 0) { + $_SESSION['DisplayRecordsMax'] = $myrow[10]; + } else { + $_SESSION['DisplayRecordsMax'] = $_SESSION['DefaultDisplayRecordsMax']; // default comes from config.php + } + $sql = "UPDATE www_users SET lastvisitdate='". date("Y-m-d H:i:s") ."' + WHERE www_users.userid='" . $Name . "'"; + $Auth_Result = DB_query($sql, $db); + /*get the security tokens that the user has access to */ + $sql = 'SELECT tokenid FROM securitygroups + WHERE secroleid = ' . $_SESSION['AccessLevel']; + $Sec_Result = DB_query($sql, $db); + $_SESSION['AllowedPageSecurityTokens'] = array(); + if (DB_num_rows($Sec_Result)==0){ + return UL_CONFIGERR; + } else { + $i=0; + while ($myrow = DB_fetch_row($Sec_Result)){ + $_SESSION['AllowedPageSecurityTokens'][$i] = $myrow[0]; + $i++; + } + } + // Temporary shift - disable log messages. + $_SESSION['UserID'] = $myrow[11]; + } else { // Incorrect password + // 5 login attempts, show failed login screen + if (!isset($_SESSION['AttemptsCounter'])) { + $_SESSION['AttemptsCounter'] = 0; + } elseif ($_SESSION['AttemptsCounter'] >= 5 AND isset($Name)) { + /*User blocked from future accesses until sysadmin releases */ + $sql = "UPDATE www_users + SET blocked=1 + WHERE www_users.userid='" . $Name . "'"; + $Auth_Result = DB_query($sql, $db); + return UL_BLOCKED; + } + return UL_NOTVALID; + } + } // End of userid/password check + // Run with debugging messages for the system administrator(s) but not anyone else + if (in_array(15, $_SESSION['AllowedPageSecurityTokens'])) { + $debug = 1; + } else { + $debug = 0; + } + return UL_OK; /* All is well */ +} + +?> \ No newline at end of file Property changes on: trunk/includes/UserLogin.php ___________________________________________________________________ Added: svn:keywords + Id Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2010-01-08 10:32:55 UTC (rev 3287) +++ trunk/includes/session.inc 2010-01-09 10:24:38 UTC (rev 3288) @@ -1,7 +1,6 @@ <?php +/* $Revision: 1.67 $ */ -/* $Id$ */ - if (!isset($PathPrefix)) { $PathPrefix=''; } @@ -61,132 +60,46 @@ if (!isset($AllowAnyone)){ /* only do security checks if AllowAnyone is not true */ - if (!isset($_SESSION['AccessLevel']) OR $_SESSION['AccessLevel'] == ''){ - -// (isset($_POST['UserNameEntryField']) AND $_POST['UserNameEntryField'] != '')) { + include $PathPrefix . 'includes/UserLogin.php'; /* Login checking and setup */ - /* if not logged in */ + if (isset($_POST['UserNameEntryField']) and isset($_POST['Password'])) { + $rc = userLogin($_POST['UserNameEntryField'], $_POST['Password'], $db); + } else if (empty($_SESSION['DatabaseName'])) { + $rc = UL_SHOWLOGIN; + } else { + $rc = UL_OK; + } - $_SESSION['AccessLevel'] = ''; - $_SESSION['CustomerID'] = ''; - $_SESSION['UserBranch'] = ''; - $_SESSION['SalesmanLogin'] = ''; - $_SESSION['Module'] = ''; - $_SESSION['PageSize'] = ''; - $_SESSION['UserStockLocation'] = ''; - $_SESSION['PDFLanguage']= ''; - $_SESSION['AttemptsCounter']++; + /* Need to set the theme to make login screen nice */ + $theme = (isset($_SESSION['Theme'])) ? $_SESSION['Theme'] : 'silverwolf'; + switch ($rc) { + case UL_OK; + break; + case UL_SHOWLOGIN: + include($PathPrefix . 'includes/Login.php'); + exit; - $theme = 'silverwolf'; + case UL_BLOCKED: + die(include($PathPrefix . 'includes/FailedLogin.php')); - // Show login screen - if (!isset($_POST['UserNameEntryField']) or $_POST['UserNameEntryField'] == '') { - include($PathPrefix . 'includes/Login.php'); - exit; - } + case UL_CONFIGERR: + $title = _('Account Error Report'); + include($PathPrefix . 'includes/header.inc'); + echo '<br /><br /><br />'; + prnMsg(_('Your user role does not have any access defined for webERP. There is an error in the security setup for this user account'),'error'); + include($PathPrefix . 'includes/footer.inc'); + exit; + case UL_NOTVALID: + $demo_text = '<font size="3" color="red"><b>' . _('incorrect password') . '</b></font><br /><b>' . _('The user/password combination') . '<br />' . _('is not a valid user of the system') . '</b>'; + die(include($PathPrefix . 'includes/Login.php')); - $sql = "SELECT www_users.fullaccess, - www_users.customerid, - www_users.lastvisitdate, - www_users.pagesize, - www_users.defaultlocation, - www_users.branchcode, - www_users.modulesallowed, - www_users.blocked, - www_users.realname, - www_users.theme, - www_users.displayrecordsmax, - www_users.userid, - www_users.language, - www_users.salesman, - www_users.pdflanguage - FROM www_users - WHERE www_users.userid='" . DB_escape_string($_POST['UserNameEntryField']) . "' - AND (www_users.password='" . CryptPass(DB_escape_string($_POST['Password'])) . "' - OR www_users.password='" . DB_escape_string($_POST['Password']) . "')"; - $Auth_Result = DB_query($sql, $db); + case UL_MAINTENANCE: + $demo_text = '<font size="3" color="red"><b>' . _('system maintenance') . '</b></font><br /><b>' . _('webERP is not available right now') . '<br />' . _('during maintenance of the system') . '</b>'; + die(include($PathPrefix . 'includes/Login.php')); - // Populate session variables with data base results - if (DB_num_rows($Auth_Result) > 0) { - - $myrow = DB_fetch_row($Auth_Result); - if ($myrow[7]==1){ - //the account is blocked - die(include($PathPrefix . 'includes/FailedLogin.php')); - } - /*reset the attempts counter on successful login */ - $_SESSION['AttemptsCounter'] = 0; - $_SESSION['AccessLevel'] = $myrow[0]; - $_SESSION['CustomerID'] = $myrow[1]; - $_SESSION['UserBranch'] = $myrow[5]; - $_SESSION['DefaultPageSize'] = $myrow[3]; - $_SESSION['UserStockLocation'] = $myrow[4]; - $_SESSION['ModulesEnabled'] = explode(",", $myrow[6]); - $_SESSION['UsersRealName'] = $myrow[8]; - $_SESSION['Theme'] = $myrow[9]; - $_SESSION['UserID'] = $myrow[11]; - $_SESSION['Language'] = $myrow[12]; - $_SESSION['SalesmanLogin'] = $myrow[13]; - $_SESSION['PDFLanguage']= $myrow[14]; - if ($myrow[10] > 0) { - $_SESSION['DisplayRecordsMax'] = $myrow[10]; - } else { - $_SESSION['DisplayRecordsMax'] = $_SESSION['DefaultDisplayRecordsMax']; // default comes from config.php - } - - $sql = "UPDATE www_users SET lastvisitdate='". date("Y-m-d H:i:s") ."' - WHERE www_users.userid='" . DB_escape_string($_POST['UserNameEntryField']) . "'"; - $Auth_Result = DB_query($sql, $db); - - /*get the security tokens that the user has access to */ - $sql = 'SELECT tokenid FROM securitygroups - WHERE secroleid = ' . $_SESSION['AccessLevel']; - $Sec_Result = DB_query($sql, $db); - - $_SESSION['AllowedPageSecurityTokens'] = array(); - if (DB_num_rows($Sec_Result)==0){ - $title = _('Account Error Report'); - include($PathPrefix . 'includes/header.inc'); - echo '<br /><br /><br />'; - prnMsg(_('Your user role does not have any access defined for webERP. There is an error in the security setup for this user account'),'error'); - include($PathPrefix . 'includes/footer.inc'); - exit; - } else { - $i=0; - while ($myrow = DB_fetch_row($Sec_Result)){ - $_SESSION['AllowedPageSecurityTokens'][$i] = $myrow[0]; - $i++; - } - } - - //echo '<meta http-equiv="refresh" content="0" url="' . $_SERVER['PHP_SELF'] . '?' . SID . '">'; - //exit; - } else { // Incorrect password - // 5 login attempts, show failed login screen - if (!isset($_SESSION['AttemptsCounter'])) { - $_SESSION['AttemptsCounter'] = 0; - } elseif ($_SESSION['AttemptsCounter'] >= 5 AND isset($_POST['UserNameEntryField'])) { - /*User blocked from future accesses until sysadmin releases */ - $sql = "UPDATE www_users - SET blocked=1 - WHERE www_users.userid='" . $_POST['UserNameEntryField'] . "'"; - $Auth_Result = DB_query($sql, $db); - die(include($PathPrefix . 'includes/FailedLogin.php')); - } - $demo_text = '<font size="3" color="red"><b>' . _('incorrect password') . '</b></font><br /><b>' . _('The user/password combination') . '<br />' . _('is not a valid user of the system') . '</b>'; - die(include($PathPrefix . 'includes/Login.php')); - } - } // End of userid/password check - // Run with debugging messages for the system administrator(s) but not anyone else - - if (in_array(15, $_SESSION['AllowedPageSecurityTokens'])) { - $debug = 1; - } else { - $debug = 0; } - } /* only do security checks if AllowAnyone is not true */ /*User is logged in so get configuration parameters - save in session*/ @@ -265,7 +178,7 @@ if ($DirEntry != '.' AND $DirEntry !='..'){ $InCompanyDir[] = $DirEntry; //make an array of all files under company directory } - } //loop through list of files in the company directory + } //loop through list of files in the company directory if ($InCompanyDir !== FALSE) { foreach($InCompanyDir as $logofilename) if (strncasecmp($logofilename,'logo.jpg',8) === 0 AND @@ -345,4 +258,4 @@ return $Password; } } -?> +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2010-01-09 19:45:02
|
Revision: 3289 http://web-erp.svn.sourceforge.net/web-erp/?rev=3289&view=rev Author: daintree Date: 2010-01-09 19:44:55 +0000 (Sat, 09 Jan 2010) Log Message: ----------- invoice pricing fixes Modified Paths: -------------- trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/doc/Change.log.html Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2010-01-09 10:24:38 UTC (rev 3288) +++ trunk/PrintCustTrans.php 2010-01-09 19:44:55 UTC (rev 3289) @@ -2,9 +2,6 @@ /* $Id$ */ -/* Javier: This file has 5 PDF Outputs, one FPDI class, one function, - El único q cambió alguien está en L570, 3 son de fpdi y el 5º está en L457 */ - $PageSecurity = 1; include('includes/session.inc'); @@ -55,8 +52,6 @@ $Right_Margin=30; // Javier: now I use the native constructor, better to not use references -// $PageSize = array(0,0,$Page_Width,$Page_Height); -// $pdf = & new Cpdf($PageSize); $pdf = new Cpdf('L', 'pt', 'A4'); $pdf->addInfo('Creator', 'webERP http://www.weberp.org'); $pdf->addInfo('Author', 'webERP ' . $Version); @@ -75,7 +70,6 @@ $pdf->setAutoPageBreak(0); // Javier: needs check. $pdf->setPrintHeader(false); // Javier: I added this must be called before Add Page $pdf->AddPage(); -// $this->SetLineWidth(1); Javier: It was ok for FPDF but now is too gross with TCPDF. TCPDF defaults to 0'57 pt (0'2 mm) which is ok. $pdf->cMargin = 0; // Javier: needs check. /* END Brought from class.pdf.php constructor */ @@ -282,31 +276,15 @@ $FirstPage = False; while ($myrow2=DB_fetch_array($result)) { - /*search the unit price*/ - - $sql = 'SELECT salesorderdetails.unitprice - FROM salesorderdetails, debtortrans - WHERE debtortrans.transno = ' . $FromTransNo . ' - AND debtortrans.order_ = salesorderdetails.orderno - AND salesorderdetails.stkcode = "'.$myrow2['stockid'].'"'; - - $resultp=DB_query($sql,$db); - $myrow3=DB_fetch_array($resultp); - - /*check the price after discount*/ - if ($myrow2['discountpercent']==0) { $DisplayDiscount =''; - $DisplayNet=number_format(($myrow3['unitprice'] * $myrow2['quantity']),2); - $DisplayPrice=$myrow3['unitprice']; - $DisplayQty=$myrow2['quantity']; } else { $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; - $DiscountPrice=$myrow2['discountpercent'] * $myrow3['unitprice']; - $DisplayPrice=$myrow3['unitprice']; - $DisplayQty=$myrow2['quantity']; - $DisplayNet=number_format((($myrow3['unitprice'] - $DiscountPrice) * $myrow2['quantity']),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']); @@ -450,45 +428,40 @@ $FromTransNo++; } /* end loop to print invoices */ -/* Javier: This actually would produce the output, and maybe it should do - $pdfcode = $pdf->output($_SESSION['reports_dir'] . '/Invoice.pdf', "F"); - $len = strlen($pdfcode); Este fichero es especial pq $len anulado en L529 -*/ - -// Start FPDI concatination to append PDF files conditionally to the invoice -// This part taken from FPDI example page -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); + // Start FPDI concatination to append PDF files conditionally to the invoice + // This part taken from FPDI example page + 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, not sure what happens if we have a series of trans nos -if (isset($_GET['FromTransNo'])) { - $FromTransNo = trim($_GET['FromTransNo']); -} elseif (isset($_POST['FromTransNo'])) { - $FromTransNo = trim($_POST['FromTransNo']); -} - + + // $pdf =& new concat_pdf(); + + // Have to get the TransNo again, not sure what happens if we have a series of trans nos + if (isset($_GET['FromTransNo'])) { + $FromTransNo = trim($_GET['FromTransNo']); + } elseif (isset($_POST['FromTransNo'])) { + $FromTransNo = trim($_POST['FromTransNo']); + } + // Check its an Invoice type again, then select appendfile filename // if ($InvOrCredit=='Invoice') { $sql = 'SELECT stockmoves.stockid, stockmaster.appendfile @@ -499,69 +472,54 @@ 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'])); - $pdf->concat(); - $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'])) { - $pdfcode = $pdf->Output($_SESSION['reports_dir'] . '/Invoice.pdf','D'); - } 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'); - exit; + $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'])); + $pdf->concat(); + $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'); + } 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'); + exit; + } } -} -//End FPDI Concat - -/* if ($len <1020){ - include('includes/header.inc'); - echo '<p>' . _('There were no transactions to print in the range selected'); - include('includes/footer.inc'); - exit; - }*/ - + //End FPDI Concat + + 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'); + $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->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'); echo "<p>$InvOrCredit " . _('number') . ' ' . $_GET['FromTransNo'] . ' ' . _('has been emailed to') . ' ' . $_GET['Email']; include('includes/footer.inc'); exit; - + } else { - -/* Javier: este es el más importante según cierta persona ya q es el único q cambió, pero nadie parece saber nada -// Javier: TCPDF sends its own http header, it's an error to send it twice. - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=Customer_trans.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); -*/ + $pdf->OutputD('PrintCustTrans.pdf'); $pdf-> __destruct(); } Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2010-01-09 10:24:38 UTC (rev 3288) +++ trunk/PrintCustTransPortrait.php 2010-01-09 19:44:55 UTC (rev 3289) @@ -2,9 +2,6 @@ /* $Id$ */ -/* Javier: This file has 5 PDF Outputs, one FPDI class, and one function, - The Outputs are L520 and L570, 3 are about FPDI y el 5th is in L457 */ - $PageSecurity = 1; include('includes/session.inc'); @@ -43,11 +40,8 @@ and $FromTransNo!=''){ include ('includes/class.pdf.php'); -// define('FPDF_FONTPATH','font/'); require('fpdi/fpdi.php'); - - $Page_Width=595; $Page_Height=842; $Top_Margin=30; @@ -55,9 +49,6 @@ $Left_Margin=40; $Right_Margin=30; -// Javier: now I use the native constructor, better to not use references -// $PageSize = array(0,0,$Page_Width,$Page_Height); -// $pdf = & new Cpdf($PageSize); $pdf = new Cpdf('P', 'pt', 'A4'); $pdf->addInfo('Author','webERP ' . $Version); $pdf->addInfo('Creator','webERP http://www.weberp.org'); @@ -76,9 +67,7 @@ $pdf->setAutoPageBreak(0); // Javier: needs check. $pdf->setPrintHeader(false); // Javier: I added this must be called before Add Page $pdf->AddPage(); -// $this->SetLineWidth(1); Javier: It was ok for FPDF but now is too gross with TCPDF. TCPDF defaults to 0'57 pt (0'2 mm) which is ok. $pdf->cMargin = 0; // Javier: needs check. -/* END Brought from class.pdf.php constructor */ $FirstPage = true; $line_height=16; @@ -314,32 +303,16 @@ while ($myrow2=DB_fetch_array($result)){ - /*search the unit price*/ - $sql='SELECT salesorderdetails.unitprice - FROM salesorderdetails, - debtortrans - WHERE debtortrans.transno = ' . $FromTransNo . ' - AND debtortrans.order_ = salesorderdetails.orderno - AND salesorderdetails.stkcode = "'.$myrow2['stockid'].'"'; - - $resultp=DB_query($sql,$db); - $myrow3=DB_fetch_array($resultp); - - /*check the price after discount*/ - if ($myrow2['discountpercent']==0){ + if ($myrow2['discountpercent']==0) { $DisplayDiscount =''; - $DisplayNet=number_format(($myrow3['unitprice'] * $myrow2['Quantity']),2); - $DisplayPrice=$myrow3['unitprice']; - $DisplayQty=$myrow2['Quantity']; } else { - $DisplayDiscount =number_format($myrow2['discountpercent']*100,2); - $DiscountPrice=$myrow2['discountpercent'] * $myrow3['unitprice']; - $DisplayPrice=$myrow3['unitprice']; - $DisplayQty=$myrow2['Quantity']; - $DisplayNet=number_format((($myrow3['unitprice'] - $DiscountPrice) * $myrow2['Quantity']),2); + $DisplayDiscount = number_format($myrow2['discountpercent']*100,2) . '%'; + $DiscountPrice=$myrow2['fxprice']*(1-$myrow2['discountpercent']); } + $DisplayPrice=$myrow2['fxprice']; + $DisplayQty=$myrow2['quantity']; + $DisplayNet=number_format($myrow2['fxnet'],2); - $LeftOvers = $pdf->addTextWrap($Left_Margin+5,$YPos,71,$FontSize,$myrow2['stockid']); $LeftOvers = $pdf->addTextWrap($Left_Margin+80,$YPos,186,$FontSize,$myrow2['description']); $lines=1; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-09 10:24:38 UTC (rev 3288) +++ trunk/doc/Change.log.html 2010-01-09 19:44:55 UTC (rev 3289) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> -<p> +<p> +<p>09/01/10 Phil: Fix price for same item on an order priced at different prices - unfortunately, this means that there may be rounding errors on very large currencies as I reverted to the old logic using the stockmoves which use local currency and then converting back to the currency of the invoice - fixed both portrait and landscape <p>09/01/10 Lindsay: Changes to api session handling. <p>08/01/10 Tim: PrintCustTrans.php - Correct errors preventing invoice from printing <p>08/01/10 Tim: Put a supplier invoice on hold when outside the bounds set up in the config This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2010-01-10 07:32:19
|
Revision: 3290 http://web-erp.svn.sourceforge.net/web-erp/?rev=3290&view=rev Author: daintree Date: 2010-01-10 07:32:12 +0000 (Sun, 10 Jan 2010) Log Message: ----------- email invoices Modified Paths: -------------- trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2010-01-09 19:44:55 UTC (rev 3289) +++ trunk/PrintCustTrans.php 2010-01-10 07:32:12 UTC (rev 3290) @@ -429,7 +429,7 @@ } /* end loop to print invoices */ // Start FPDI concatination to append PDF files conditionally to the invoice - // This part taken from FPDI example page + // This part taken from FPDI example page -not used yet since change to TCPDF Dec 2009 class concat_pdf extends FPDI { var $files = array(); @@ -455,21 +455,20 @@ // $pdf =& new concat_pdf(); - // Have to get the TransNo again, not sure what happens if we have a series of trans nos + // 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']); } -// Check its an Invoice type again, then select appendfile filename -// 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'; + 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); Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2010-01-09 19:44:55 UTC (rev 3289) +++ trunk/PrintCustTransPortrait.php 2010-01-10 07:32:12 UTC (rev 3290) @@ -42,12 +42,12 @@ include ('includes/class.pdf.php'); require('fpdi/fpdi.php'); - $Page_Width=595; - $Page_Height=842; - $Top_Margin=30; - $Bottom_Margin=30; - $Left_Margin=40; - $Right_Margin=30; + $Page_Width=595; + $Page_Height=842; + $Top_Margin=30; + $Bottom_Margin=30; + $Left_Margin=40; + $Right_Margin=30; $pdf = new Cpdf('P', 'pt', 'A4'); $pdf->addInfo('Author','webERP ' . $Version); @@ -99,7 +99,7 @@ // gather the invoice data if ($InvOrCredit=='Invoice') { - $sql = 'SELECT debtortrans.trandate, + $sql = 'SELECT debtortrans.trandate, debtortrans.ovamount, debtortrans.ovdiscount, debtortrans.ovfreight, @@ -165,100 +165,100 @@ AND custbranch.salesman=salesman.salesmancode AND salesorders.fromstkloc=locations.loccode'; - if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No'){ - $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; - } - } else { + if (isset($_POST['PrintEDI']) and $_POST['PrintEDI']=='No'){ + $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; + } + } else { - $sql = 'SELECT debtortrans.trandate, - debtortrans.ovamount, - debtortrans.ovdiscount, - debtortrans.ovfreight, - debtortrans.ovgst, - debtortrans.rate, - debtortrans.invtext, - debtorsmaster.invaddrbranch, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - debtorsmaster.currcode, - debtorsmaster.taxref, - custbranch.brname, - custbranch.braddress1, - custbranch.braddress2, - custbranch.braddress3, - custbranch.braddress4, - custbranch.braddress5, - custbranch.braddress6, - custbranch.brpostaddr1, - custbranch.brpostaddr2, - custbranch.brpostaddr3, - custbranch.brpostaddr4, - custbranch.brpostaddr5, - custbranch.brpostaddr6, - salesman.salesmanname, - debtortrans.debtorno, - debtortrans.branchcode, - paymentterms.terms - FROM debtortrans, - debtorsmaster, - custbranch, - salesman, - paymentterms - WHERE debtortrans.type=11 - AND debtorsmaster.paymentterms = paymentterms.termsindicator - AND debtortrans.transno=' . $FromTransNo .' - AND debtortrans.debtorno=debtorsmaster.debtorno - AND debtortrans.debtorno=custbranch.debtorno - AND debtortrans.branchcode=custbranch.branchcode - AND custbranch.salesman=salesman.salesmancode'; + $sql = 'SELECT debtortrans.trandate, + debtortrans.ovamount, + debtortrans.ovdiscount, + debtortrans.ovfreight, + debtortrans.ovgst, + debtortrans.rate, + debtortrans.invtext, + debtorsmaster.invaddrbranch, + debtorsmaster.name, + debtorsmaster.address1, + debtorsmaster.address2, + debtorsmaster.address3, + debtorsmaster.address4, + debtorsmaster.address5, + debtorsmaster.address6, + debtorsmaster.currcode, + debtorsmaster.taxref, + custbranch.brname, + custbranch.braddress1, + custbranch.braddress2, + custbranch.braddress3, + custbranch.braddress4, + custbranch.braddress5, + custbranch.braddress6, + custbranch.brpostaddr1, + custbranch.brpostaddr2, + custbranch.brpostaddr3, + custbranch.brpostaddr4, + custbranch.brpostaddr5, + custbranch.brpostaddr6, + salesman.salesmanname, + debtortrans.debtorno, + debtortrans.branchcode, + paymentterms.terms + FROM debtortrans, + debtorsmaster, + custbranch, + salesman, + paymentterms + WHERE debtortrans.type=11 + AND debtorsmaster.paymentterms = paymentterms.termsindicator + 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'){ - $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; + if ($_POST['PrintEDI']=='No'){ + $sql = $sql . ' AND debtorsmaster.ediinvoices=0'; + } } - } $result=DB_query($sql,$db,'','',false,false); if (DB_error_no($db)!=0) { - $title = _('Transaction Print Error Report'); - include ('includes/header.inc'); + $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; + } + if (DB_num_rows($result)==1){ + $myrow = DB_fetch_array($result); - 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; - } - if (DB_num_rows($result)==1){ - $myrow = DB_fetch_array($result); + $ExchRate = $myrow['rate']; - $ExchRate = $myrow['rate']; - - if ($InvOrCredit=='Invoice'){ - $sql = 'SELECT stockmoves.stkmoveno, - stockmoves.stockid, - stockmaster.description, - stockmaster.serialised, - stockmaster.controlled, - -stockmoves.qty as Quantity, - stockmoves.narrative, - stockmaster.units, - stockmaster.decimalplaces, - stockmoves.discountpercent, - stockmoves.narrative - FROM stockmoves, - stockmaster - WHERE stockmoves.stockid = stockmaster.stockid - AND stockmoves.type=10 - AND stockmoves.transno = '.$FromTransNo.' - AND stockmoves.show_on_inv_crds=1'; + if ($InvOrCredit=='Invoice'){ + $sql = 'SELECT stockmoves.stkmoveno, + stockmoves.stockid, + stockmaster.description, + stockmaster.serialised, + stockmaster.controlled, + -stockmoves.qty as Quantity, + stockmoves.narrative, + stockmaster.units, + stockmaster.decimalplaces, + stockmoves.discountpercent, + stockmoves.narrative + FROM stockmoves, + stockmaster + WHERE stockmoves.stockid = stockmaster.stockid + AND stockmoves.type=10 + AND stockmoves.transno = '.$FromTransNo.' + AND stockmoves.show_on_inv_crds=1'; } else { /* only credit notes to be retrieved */ $sql = 'SELECT stockmoves.stkmoveno, @@ -499,7 +499,7 @@ */ // Start FPDI concatination to append PDF files conditionally to the invoice -// This part taken from FPDI example page +// This part taken from FPDI example page - but not actually used .... yet Muz?? class concat_pdf extends FPDI { var $files = array(); @@ -523,63 +523,44 @@ // $pdf =& new concat_pdf(); -// Have to get the TransNo again, not sure what happens if we have a series of trans nos -if (isset($_GET['FromTransNo'])){ - $FromTransNo = trim($_GET['FromTransNo']); -} elseif (isset($_POST['FromTransNo'])){ - $FromTransNo = trim($_POST['FromTransNo']); -} -// Check its an Invoice type again, then select appendfile filename -//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'; - //}; +// Have to get the TransNo again, $_GET{FromTransNo] is updated with each pass + if (isset($_GET['FromTransNo'])){ + $FromTransNo = trim($_GET['FromTransNo']); + } elseif (isset($_POST['FromTransNo'])){ + $FromTransNo = trim($_POST['FromTransNo']); + } + // Check its an Invoice type again, then select appendfile filename + if ($InvOrCredit=='Invoice'){ + $sql = 'SELECT stockmoves.stockid, stockmaster.appendfile + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid = stockmaster.stockid + WHERE stockmoves.type=10 + AND stockmoves.transno=' . $FromTransNo . ' + AND stockmoves.show_on_inv_crds=1'; + } else { + $sql = 'SELECT stockmoves.stockid, stockmaster.appendfile + FROM stockmoves INNER JOIN stockmaster + ON stockmoves.stockid = stockmaster.stockid + AND stockmoves.type=11 + 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'])); + $pdf->concat(); + } + }//End FPDI Concat - - $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'])); - $pdf->concat(); - $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 - } else if (isset($_GET['Email'])) { - $pdfcode = $pdf->Output($_SESSION['reports_dir'] . '/Invoice.pdf','D'); - } 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'); - exit; - } -}//End FPDI Concat - -/* if ($len <1020){ - include('includes/header.inc'); - echo '<p>' . _('There were no transactions to print in the range selected'); - include('includes/footer.inc'); - exit; - }*/ - if (isset($_GET['Email'])){ //email the invoice to address supplied include('includes/header.inc'); include ('includes/htmlMimeMail.php'); - + $pdf->Output($_SESSION['reports_dir'] . '/Invoice.pdf','F'); + $pdf-> __destruct(); $mail = new htmlMimeMail(); $filename = $_SESSION['reports_dir'] . '/Invoice.pdf'; $fp = fopen( $_SESSION['reports_dir'] . '/Invoice.pdf','wb'); @@ -601,10 +582,7 @@ include('includes/footer.inc'); exit; - } else { - -// Javier: este es el más importante según alguien pq es el único q cambió, despues cambió tb L520 pero no en la factura apaisada - + } else { //its not an email just print the invoice to PDF $pdf->OutputD($_SESSION['DatabaseName'] . '_Invoice' . date('Y-m-d') . '.pdf'); $pdf-> __destruct(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tim...@us...> - 2010-01-12 11:02:33
|
Revision: 3293 http://web-erp.svn.sourceforge.net/web-erp/?rev=3293&view=rev Author: tim_schofield Date: 2010-01-12 11:02:25 +0000 (Tue, 12 Jan 2010) Log Message: ----------- Check thast mrpplannedorders table exists before trying to alter it Modified Paths: -------------- trunk/Z_ChangeStockCode.php trunk/doc/Change.log.html Modified: trunk/Z_ChangeStockCode.php =================================================================== --- trunk/Z_ChangeStockCode.php 2010-01-10 13:15:53 UTC (rev 3292) +++ trunk/Z_ChangeStockCode.php 2010-01-12 11:02:25 UTC (rev 3293) @@ -123,29 +123,34 @@ $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); - echo '<BR>' . _('Changing MRP planned orders information'); + $sql="select count(table_name) from information_schema.tables where table_schema='".$_SESSION['DatabaseName']."' and table_name='mrpplannedorders'"; + $result = DB_query($sql,$db); + $row=DB_fetch_row($result); + if ($row[0]>0) { + echo '<BR>' . _('Changing MRP planned orders information'); - $sql = "UPDATE mrpplannedorders SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'"; - $ErrMsg = _('The SQL to update the mrpplannedorders records failed'); - $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); - echo ' ... ' . _('completed'); - + $sql = "UPDATE mrpplannedorders SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'"; + $ErrMsg = _('The SQL to update the mrpplannedorders records failed'); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + echo ' ... ' . _('completed'); + } + echo '<BR>' . _('Changing MRP requirements information'); $sql = "UPDATE mrprequirements SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'"; $ErrMsg = _('The SQL to update the mrprequirements records failed'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); - + echo '<BR>' . _('Changing MRP supplies information'); $sql = "UPDATE mrpsupplies SET part='" . $_POST['NewStockID'] . "' WHERE part='" . $_POST['OldStockID'] . "'"; $ErrMsg = _('The SQL to update the mrpsupplies records failed'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); - + echo '<br>' . _('Changing sales analysis records'); $sql = "UPDATE salesanalysis SET stockid='" . $_POST['NewStockID'] . "' WHERE stockid='" . $_POST['OldStockID'] . "'"; $ErrMsg = _('The SQL to update Sales Analysis records failed'); @@ -235,14 +240,14 @@ echo '<br>' . _('Changing any image files'); if (file_exists($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg')) { - if (rename($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg', + if (rename($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg', $_SESSION['part_pics_dir'] . '/' .$_POST['NewStockID'].'.jpg')) { echo ' ... ' . _('completed'); } else { echo ' ... ' . _('failed'); } } else { - echo ' ... ' . _('completed'); + echo ' ... ' . _('completed'); } echo '<br>' . _('Changing the item properties table records') . ' - ' . _('parents'); @@ -265,7 +270,7 @@ $ErrMsg = _('The SQL to update the parent stockid worequirements records failed'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); - + echo '<BR>' . _('Changing work order information'); $sql = "UPDATE woitems SET stockid='" . $_POST['NewStockID'] . "' WHERE stockid='" . $_POST['OldStockID'] . "'"; @@ -310,7 +315,7 @@ echo '<tr><td>' . _('New Inventory Code') . ":</td><td><input type=Text name='NewStockID' size=20 maxlength=20></td></tr>"; echo '</table>'; -echo "<input type=submit name='ProcessStockChange' VALUE='" . _('Process') . "'>"; +echo "<div class=centre><input type=submit name='ProcessStockChange' VALUE='" . _('Process') . "'></div>"; echo '</form>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-01-10 13:15:53 UTC (rev 3292) +++ trunk/doc/Change.log.html 2010-01-12 11:02:25 UTC (rev 3293) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>12/01/10 Tim: Z_ChangeStockCode.php - Check thast mrpplannedorders table exists before trying to alter it</p> <p>10/01/10 Tim: StockTransfers.php - Correctly show stockid in links to ther functions.</p> <p>10/01/10 Bryan Nielsen: BOMs.php - syntax error includes() was used not include()</p> <p>09/01/10 Phil: Fix price for same item on an order priced at different prices - unfortunately, this means that there may be rounding errors on very large currencies as I reverted to the old logic using the stockmoves which use local currency and then converting back to the currency of the invoice - fixed both portrait and landscape This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |