From: <dai...@us...> - 2011-03-10 06:24:56
|
Revision: 4506 http://web-erp.svn.sourceforge.net/web-erp/?rev=4506&view=rev Author: daintree Date: 2011-03-10 06:24:48 +0000 (Thu, 10 Mar 2011) Log Message: ----------- launchpad changes and pagination of PrintCustOrder_generic.php Modified Paths: -------------- trunk/MRP.php trunk/PO_Header.php trunk/PrintCustOrder_generic.php trunk/SelectCreditItems.php trunk/SelectSalesOrder.php trunk/SelectSupplier.php trunk/StockQuantityByDate.php trunk/StockStatus.php trunk/SupplierCredit.php trunk/doc/Change.log.html trunk/doc/README.txt trunk/doc/UPGRADING.txt Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/MRP.php 2011-03-10 06:24:48 UTC (rev 4506) @@ -44,11 +44,11 @@ prnMsg(_('Creating first level'),'info'); flush(); // This finds the top level - $sql = "INSERT INTO passbom (part, sortpart) + $sql = 'INSERT INTO passbom (part, sortpart) SELECT bom.component AS part, - CONCAT(bom.parent,'%',bom.component) AS sortpart + CONCAT(bom.parent,"%",bom.component) AS sortpart FROM bom LEFT JOIN bom as bom2 ON bom.parent = bom2.component - WHERE bom2.component IS NULL"; + WHERE bom2.component IS NULL'; $result = DB_query($sql,$db); $lctr = 2; @@ -201,7 +201,7 @@ // Get rid if temporary tables $sql = 'DROP TABLE IF EXISTS tempbom'; -- //$result = DB_query($sql,$db); + //$result = DB_query($sql,$db); $sql = 'DROP TABLE IF EXISTS passbom'; //$result = DB_query($sql,$db); $sql = 'DROP TABLE IF EXISTS passbom2'; @@ -230,7 +230,7 @@ prnMsg(_('Loading requirements from sales orders'),'info'); flush(); - $sql = "INSERT INTO mrprequirements (part, + $sql = 'INSERT INTO mrprequirements (part, daterequired, quantity, mrpdemandtype, @@ -240,22 +240,22 @@ SELECT stkcode, deliverydate, (quantity - qtyinvoiced) AS netqty, - 'SO', + "SO", salesorderdetails.orderno, - '1', + "1", stkcode FROM salesorders, salesorderdetails WHERE salesorders.orderno = salesorderdetails.orderno AND (quantity - qtyinvoiced) > 0 AND salesorderdetails.completed = 0 - AND salesorders.quotation = 0"; + AND salesorders.quotation = 0'; $result = DB_query($sql,$db); prnMsg(_('Loading requirements from work orders'),'info'); flush(); // Definition of demand from SelectProduct.php - $sql = "INSERT INTO mrprequirements (part, + $sql = 'INSERT INTO mrprequirements (part, daterequired, quantity, mrpdemandtype, @@ -265,19 +265,19 @@ SELECT worequirements.stockid, workorders.requiredby, qtypu*(woitems.qtyreqd - woitems.qtyrecd) AS netqty, - 'WO', + "WO", woitems.wo, - '1', + "1", parentstockid FROM woitems INNER JOIN worequirements ON woitems.stockid=worequirements.parentstockid INNER JOIN workorders ON woitems.wo=workorders.wo AND woitems.wo=worequirements.wo - WHERE workorders.closed=0"; + WHERE workorders.closed=0'; $result = DB_query($sql,$db); - $sql = "INSERT INTO mrprequirements (part, + $sql = 'INSERT INTO mrprequirements (part, daterequired, quantity, mrpdemandtype, @@ -289,15 +289,15 @@ quantity, mrpdemandtype, demandid, - '1', + "1", stockid - FROM mrpdemands"; + FROM mrpdemands'; if ($_POST['usemrpdemands'] == 'y') { $result = DB_query($sql,$db); prnMsg(_('Loading requirements based on mrpdemands'),'info'); flush(); } - $sql = "INSERT INTO mrprequirements (part, + $sql = 'INSERT INTO mrprequirements (part, daterequired, quantity, mrpdemandtype, @@ -307,12 +307,12 @@ SELECT stockid, NOW(), (reorderlevel - quantity) AS reordqty, - 'REORD', - '1', - '1', + "REORD", + "1", + "1", stockid FROM locstock - WHERE reorderlevel > quantity"; + WHERE reorderlevel > quantity'; $result = DB_query($sql,$db); prnMsg(_('Loading requirements based on reorder level'),'info'); flush(); @@ -339,7 +339,7 @@ prnMsg(_('Loading supplies from purchase orders'),'info'); flush(); - $sql = "INSERT INTO mrpsupplies (id, + $sql = 'INSERT INTO mrpsupplies (id, part, duedate, supplyquantity, @@ -351,16 +351,16 @@ purchorderdetails.itemcode, purchorderdetails.deliverydate, (quantityord - quantityrecd) AS netqty, - 'PO', + "PO", purchorderdetails.orderno, purchorderdetails.deliverydate, 0 FROM purchorderdetails, purchorders WHERE purchorderdetails.orderno = purchorders.orderno - AND purchorders.status != 'Cancelled' - AND purchorders.status != 'Rejected' - AND(quantityord - quantityrecd) > 0"; + AND purchorders.status != "Cancelled" + AND purchorders.status != "Rejected" + AND(quantityord - quantityrecd) > 0'; $result = DB_query($sql,$db); prnMsg(_('Loading supplies from inventory on hand'),'info'); @@ -382,7 +382,7 @@ } // End of foreach $WhereLocation .= ')'; } - $sql = "INSERT INTO mrpsupplies (id, + $sql = 'INSERT INTO mrpsupplies (id, part, duedate, supplyquantity, @@ -392,21 +392,21 @@ updateflag) SELECT Null, stockid, - '0000-00-00', + "0000-00-00", SUM(quantity), - 'QOH', + "QOH", 1, - '0000-00-00', + "0000-00-00", 0 FROM locstock - WHERE quantity > 0 ". + WHERE quantity > 0 ' . $WhereLocation . - "GROUP BY stockid"; + 'GROUP BY stockid'; $result = DB_query($sql,$db); prnMsg(_('Loading supplies from work orders'),'info'); flush(); - $sql = "INSERT INTO mrpsupplies (id, + $sql = 'INSERT INTO mrpsupplies (id, part, duedate, supplyquantity, @@ -418,13 +418,13 @@ stockid, workorders.requiredby, (woitems.qtyreqd-woitems.qtyrecd) AS netqty, - 'WO', + "WO", woitems.wo, workorders.requiredby, 0 FROM woitems INNER JOIN workorders ON woitems.wo=workorders.wo - WHERE workorders.closed=0"; + WHERE workorders.closed=0'; $result = DB_query($sql,$db); $sql = 'ALTER TABLE mrpsupplies ADD INDEX part(part)'; @@ -436,15 +436,15 @@ prnMsg(_('Creating planned orders table'),'info'); flush(); $result = DB_query('DROP TABLE IF EXISTS mrpplannedorders',$db); - $sql = 'CREATE TABLE mrpplannedorders (id int(11) NOT NULL auto_increment, - part char(20), - duedate date, - supplyquantity double, - ordertype varchar(6), - orderno int(11), - mrpdate date, - updateflag smallint(6), - PRIMARY KEY (id))'; + $sql = 'CREATE TABLE mrpplannedorders (id int(11) NOT NULL auto_increment, + part char(20), + duedate date, + supplyquantity double, + ordertype varchar(6), + orderno int(11), + mrpdate date, + updateflag smallint(6), + PRIMARY KEY (id)) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of mrpplannedorders failed because')); // Find the highest and lowest level number Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/PO_Header.php 2011-03-10 06:24:48 UTC (rev 4506) @@ -618,7 +618,7 @@ ON stockmaster.stockid = purchdata.stockid WHERE stockmaster.stockid='".$Purch_Item. "' AND purchdata.supplierno ='" . $_GET['SelectedSupplier'] . "'"; - $Result=DB_query($sql, $db); + $result=DB_query($sql, $db); $PurchItemRow=DB_fetch_array($result); if (!isset($PurchItemRow['conversionfactor'])) { Modified: trunk/PrintCustOrder_generic.php =================================================================== --- trunk/PrintCustOrder_generic.php 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/PrintCustOrder_generic.php 2011-03-10 06:24:48 UTC (rev 4506) @@ -9,6 +9,7 @@ include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); + //Get Out if we have no order number to work with If (!isset($_GET['TransNo']) OR $_GET['TransNo']==""){ $title = _('Select Order To Print'); @@ -119,6 +120,7 @@ for ($i=1;$i<=2;$i++){ /*Print it out twice one copy for customer and one for office */ if ($i==2){ + $PageNumber = 1; $pdf->newPage(); } /* Now ... Has the order got any line items still outstanding to be invoiced */ Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/SelectCreditItems.php 2011-03-10 06:24:48 UTC (rev 4506) @@ -72,7 +72,7 @@ //insert wildcard characters in spaces $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; - $SQL = "SELECT + $SQL = 'SELECT custbranch.debtorno, custbranch.brname, custbranch.contactname, @@ -80,7 +80,7 @@ custbranch.faxno, custbranch.branchcode FROM custbranch - WHERE custbranch.brname " . LIKE . "'" . $SearchString . "' + WHERE custbranch.brname ' . LIKE . " '" . $SearchString . "' AND custbranch.disabletrans=0"; } elseif (strlen($_POST['CustCode'])>0){ @@ -1102,12 +1102,12 @@ /* Insert the tax totals for each tax authority where tax was charged on the invoice */ foreach ($TaxTotals AS $TaxAuthID => $TaxAmount) { - $SQL = "INSERT INTO debtortranstaxes (debtortransid, + $SQL = 'INSERT INTO debtortranstaxes (debtortransid, taxauthid, taxamount) - VALUES ('" . $CreditTransID . "', - '" . $TaxAuthID . "', - '" . -($TaxAmount)/$_SESSION['CurrencyRate'] . "')"; + VALUES (' . $CreditTransID . ', + ' . $TaxAuthID . ', + ' . -($TaxAmount)/$_SESSION['CurrencyRate'] . ')'; $ErrMsg =_('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The debtor transaction taxes records could not be inserted because'); $DbgMsg = _('The following SQL to insert the debtor transaction taxes record was used'); Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/SelectSalesOrder.php 2011-03-10 06:24:48 UTC (rev 4506) @@ -2,12 +2,258 @@ /* $Id$*/ -//$PageSecurity = 2; - include('includes/session.inc'); $title = _('Search Outstanding Sales Orders'); include('includes/header.inc'); + +if (isset($_POST['PlacePO'])){ /*user hit button to place PO for selected orders */ + /*Note the button would not have been displayed if the user had no authority to create purchase orders */ + $OrdersToPlacePOFor = ''; + for ($i=1;$i<count($_POST);$i++){ + if ($_POST['PlacePO_' . $i]== 'on') { + if ($OrdersToPlacePOFor==''){ + $OrdersToPlacePOFor .= ' orderno=' . $_POST['OrderNo_PO_'.$i]; + } else { + $OrdersToPlacePOFor .= ' OR orderno=' . $_POST['OrderNo_PO_'.$i]; + } + } + } + if (strlen($OrdersToPlacePOFor)==''){ + prnMsg(_('There were no sales orders checked to place purchase orders for. No purchase orders will be created.'),'info'); + } else { + /* Now build SQL of items to purchase with purchasing data and preferred suppliers - sorted by preferred supplier */ + $sql = "SELECT purchdata.supplierno, + purchdata.stockid, + purchdata.price, + purchdata.suppliers_partno, + purchdata.supplierdescription, + purchdata.conversionfactor, + purchdata.leadtime, + stockmaster.kgs, + stockmaster.cuft + SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS OrderQty + FROM purchdata INNER JOIN salesorderdetails ON + purchdata.stockid = salesorderdetails.stkcode + INNER JOIN stockmaster ON + purchdata.stockid = stockmaster.stockid + WHERE purchdata.preferred=1 + AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' + AND (" . $OrdersToPlacePOFor . ") + GROUP BY purchdata.supplierno, + purchdata.stockid, + purchdata.price, + purchdata.suppliers_partno, + purchdata.supplierdescription, + purchdata.conversionfactor, + purchdata.leadtime, + stockmaster.kgs, + stockmaster.cuft + ORDER BY purchdata.supplierno, + purchdata.stockid"; + $ErrMsg = _('Unable to retrieve the items on the selected orders for creating purchase orders for'); + $ItemResult = DB_query($sql,$db,$ErrMsg); + $SupplierID = ''; + while ($ItemRow = DB_fetch_array($ItemResult)){ + $SupplierID = $ItemRow['supplierno']; + /*Now get all the required details for the supplier */ + + + + + + + + + $result = DB_Txn_Begin($db); + + /*figure out what status to set the order to */ + if (IsEmailAddress($_SESSION['UserEmail'])){ + $UserDetails = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; + } else { + $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; + } + if ($_SESSION['AutoAuthorisePO']==1) { //if the user has authority to authorise the PO then it will automatically be authorised + $AuthSQL ="SELECT authlevel + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$_SESSION['PO'.$identifier]->CurrCode."'"; + + $AuthResult=DB_query($AuthSQL,$db); + $AuthRow=DB_fetch_array($AuthResult); + + if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $_SESSION['PO'.$identifier]->Order_Value()) { //user has authority to authrorise as well as create the order + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br />'; + $_SESSION['PO'.$identifier]->AllowPrintPO=1; + $_SESSION['PO'.$identifier]->Status = 'Authorised'; + } else { // no authority to authorise this order + if (DB_num_rows($AuthResult) ==0){ + $AuthMessage = _('Your authority to approve purchase orders in') . ' ' . $_SESSION['PO'.$identifier]->CurrCode . ' ' . _('has not yet been set up') . '<br />'; + } else { + $AuthMessage = _('You can only authorise up to').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthorityLevel.'.<br />'; + } + + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. + $_SESSION['PO'.$identifier]->CurrCode . ' '. $_SESSION['PO'.$identifier]->Order_Value() .'. '. + $AuthMessage . + _('If you think this is a mistake please contact the systems administrator') . '<br />'. + _('The order will be created with a status of pending and will require authorisation'), 'warn'); + + $_SESSION['PO'.$identifier]->AllowPrintPO=0; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br />'; + $_SESSION['PO'.$identifier]->Status = 'Pending'; + } + } else { //auto authorise is set to off + $_SESSION['PO'.$identifier]->AllowPrintPO=0; + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '.$_SESSION['PO'.$identifier]->StatusMessage.'<br />'; + $_SESSION['PO'.$identifier]->Status = 'Pending'; + } + + if ($_SESSION['ExistingOrder']==0){ /*its a new order to be inserted */ + + //Do we need to check authorisation to create - no because already trapped when new PO session started + + /*Get the order number */ + $_SESSION['PO'.$identifier]->OrderNo = GetNextTransNo(18, $db); + + /*Insert to purchase order header record */ + $sql = "INSERT INTO purchorders ( orderno, + supplierno, + comments, + orddate, + rate, + initiator, + requisitionno, + intostocklocation, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + suppdeladdress1, + suppdeladdress2, + suppdeladdress3, + suppdeladdress4, + suppdeladdress5, + suppdeladdress6, + suppliercontact, + supptel, + contact, + version, + revised, + deliveryby, + status, + stat_comment, + deliverydate, + paymentterms, + allowprint) + VALUES( '" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $_SESSION['PO'.$identifier]->SupplierID . "', + '" . $_SESSION['PO'.$identifier]->Comments . "', + '" . Date('Y-m-d') . "', + '" . $_SESSION['PO'.$identifier]->ExRate . "', + '" . $_SESSION['PO'.$identifier]->Initiator . "', + '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', + '" . $_SESSION['PO'.$identifier]->Location . "', + '" . $_SESSION['PO'.$identifier]->DelAdd1 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd2 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd3 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd4 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd5 . "', + '" . $_SESSION['PO'.$identifier]->DelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->Tel . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', + '" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', + '" . $_SESSION['PO'.$identifier]->SupplierContact . "', + '" . $_SESSION['PO'.$identifier]->SuppTel. "', + '" . $_SESSION['PO'.$identifier]->Contact . "', + '" . $_SESSION['PO'.$identifier]->Version . "', + '" . Date('Y-m-d') . "', + '" . $_SESSION['PO'.$identifier]->DeliveryBy . "', + '" . $_SESSION['PO'.$identifier]->Status . "', + '" . $StatusComment . "', + '" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', + '" . $_SESSION['PO'.$identifier]->PaymentTerms. "', + '" . $_SESSION['PO'.$identifier]->AllowPrintPO . "' + )"; + + $ErrMsg = _('The purchase order header record could not be inserted into the database because'); + $DbgMsg = _('The SQL statement used to insert the purchase order header record and failed was'); + $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + + /*Insert the purchase order detail records */ + foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) { + if ($POLine->Deleted==False) { + $sql = "INSERT INTO purchorderdetails ( orderno, + itemcode, + deliverydate, + itemdescription, + glcode, + unitprice, + quantityord, + shiptref, + jobref, + itemno, + suppliersunit, + suppliers_partno, + subtotal_amount, + package, + pcunit, + netweight, + kgs, + cuft, + total_quantity, + total_amount, + assetid, + conversionfactor ) + VALUES ( + '" . $_SESSION['PO'.$identifier]->OrderNo . "', + '" . $POLine->StockID . "', + '" . FormatDateForSQL($POLine->ReqDelDate) . "', + '" . $POLine->ItemDescription . "', + '" . $POLine->GLCode . "', + '" . $POLine->Price . "', + '" . $POLine->Quantity . "', + '" . $POLine->ShiptRef . "', + '" . $POLine->JobRef . "', + '" . $POLine->ItemNo . "', + '" . $POLine->SuppliersUnit . "', + '" . $POLine->Suppliers_PartNo . "', + '" . $POLine->SubTotal_Amount . "', + '" . $POLine->Package . "', + '" . $POLine->PcUnit . "', + '" . $POLine->NetWeight . "', + '" . $POLine->KGs . "', + '" . $POLine->CuFt . "', + '" . $POLine->Total_Quantity . "', + '" . $POLine->Total_Amount . "', + '" . $POLine->AssetID . "', + '" . $POLine->ConversionFactor . "')"; + $ErrMsg =_('One of the purchase order detail records could not be inserted into the database because'); + $DbgMsg =_('The SQL statement used to insert the purchase order detail record and failed was'); + + $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + } + } /* end of the loop round the detail line items on the order */ + echo '<p>'; + prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' . + $_SESSION['PO'.$identifier]->SupplierName . ' ' . _('has been created'),'success'); + } + } +}/*end of purchase order creation code */ +/* ******************************************************************************************* */ + + + + +/*To the sales order selection form */ + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/sales.png" title="' . _('Sales') . '" alt="" />' . ' ' . _('Outstanding Sales Orders') . '</p> '; echo '<form action=' . $_SERVER['PHP_SELF'] .'?' .SID . ' method=post>'; @@ -410,37 +656,53 @@ /*show a table of the orders returned by the SQL */ if (DB_num_rows($SalesOrdersResult)>0) { - echo '<table cellpadding=2 colspan=7 width=95% class=selection>'; + + /* Get users authority to place POs */ + $AuthSql="SELECT cancreate + FROM purchorderauth + WHERE userid='". $_SESSION['UserID'] . "'"; + + /*we don't know what currency these orders might be in but if no authority at all then don't show option*/ + $AuthResult=DB_query($AuthSQL,$db); + $AuthRow=DB_fetch_array($AuthResult); + echo '<table cellpadding=2 colspan=7 width=95% class=selection>'; + if (isset($_POST['Quotations']) and $_POST['Quotations']=='Orders_Only'){ - $tableheader = "<tr> - <th>" . _('Modify') . "</th> - <th>" . _('Invoice') . "</th> - <th>" . _('Dispatch Note') . "</th> - <th>" . _('Sales Order') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Branch') . "</th> - <th>" . _('Cust Order') . " #</th> - <th>" . _('Order Date') . "</th> - <th>" . _('Req Del Date') . "</th> - <th>" . _('Delivery To') . "</th> - <th>" . _('Order Total') . "</th></tr>"; - } else { - $tableheader = "<tr> - <th>" . _('Modify') . "</th> - <th>" . _('Print Quote') . "</th> - <th>" . _('Customer') . "</th> - <th>" . _('Branch') . "</th> - <th>" . _('Cust Ref') . " #</th> - <th>" . _('Quote Date') . "</th> - <th>" . _('Req Del Date') . "</th> - <th>" . _('Delivery To') . "</th> - <th>" . _('Quote Total') . "</th></tr>"; + $tableheader = '<tr> + <th>' . _('Modify') . '</th> + <th>' . _('Invoice') . '</th> + <th>' . _('Dispatch Note') . '</th> + <th>' . _('Sales Order') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Cust Order') . ' #</th> + <th>' . _('Order Date') . '</th> + <th>' . _('Req Del Date') . '</th> + <th>' . _('Delivery To') . '</th> + <th>' . _('Order Total') . '</th>'; + if ($AuthRow['cancreate']==0){ //If cancreate==0 then this means the user can create orders hmmm!! + $tableheader .= '<th>' . _('Place PO') . '</th></tr>'; + } else { + $tableheader .= '</tr>'; + } + } else { /* displaying only quotations */ + $tableheader = '<tr> + <th>' . _('Modify') . '</th> + <th>' . _('Print Quote') . '</th> + <th>' . _('Customer') . '</th> + <th>' . _('Branch') . '</th> + <th>' . _('Cust Ref') . ' #</th> + <th>' . _('Quote Date') . '</th> + <th>' . _('Req Del Date') . '</th> + <th>' . _('Delivery To') . '</th> + <th>' . _('Quote Total') . '</th></tr>'; } echo $tableheader; } - $j = 1; + $i = 1; + $j = 1; $k=0; //row colour counter while ($myrow=DB_fetch_array($SalesOrdersResult)) { @@ -474,30 +736,64 @@ } if ($_POST['Quotations']=='Orders_Only'){ - printf("<td><a href='%s'>%s</a></td> - <td><a href='%s'>" . _('Invoice') . "</a></td> - <td><a target='_blank' href='%s'>" . $PrintText . " <IMG SRC='" .$rootpath."/css/".$theme."/images/pdf.png' title='" . _('Click for PDF') . "'></a></td> - <td><a target='_blank' href='%s'>" . $PrintText . " <IMG SRC='" .$rootpath."/css/".$theme."/images/pdf.png' title='" . _('Click for PDF') . "'></a></td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td> - <td class=number>%s</td> - </tr>", - $ModifyPage, - $myrow['orderno'], - $Confirm_Invoice, - $PrintDispatchNote, - $PrintSalesOrder, - $myrow['name'], - $myrow['brname'], - $myrow['customerref'], - $FormatedOrderDate, - $FormatedDelDate, - $myrow['deliverto'], - $FormatedOrderValue); + + /*Check authority to create POs if user has authority then show the check boxes to select sales orders to place POs for otherwise don't provide this option */ + if ($AuthRow['cancreate']==0){ //cancreate==0 if the user can create POs + printf("<td><a href='%s'>%s</a></td> + <td><a href='%s'>" . _('Invoice') . "</a></td> + <td><a target='_blank' href='%s'>" . $PrintText . " <IMG SRC='" .$rootpath."/css/".$theme."/images/pdf.png' title='" . _('Click for PDF') . "'></a></td> + <td><a target='_blank' href='%s'>" . $PrintText . " <IMG SRC='" .$rootpath."/css/".$theme."/images/pdf.png' title='" . _('Click for PDF') . "'></a></td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + <td><input type=checkbox name=PlacePO_%s><input type=hidden name=OrderNo_PO_%s value=%s></td> + </tr>", + $ModifyPage, + $myrow['orderno'], + $Confirm_Invoice, + $PrintDispatchNote, + $PrintSalesOrder, + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedOrderDate, + $FormatedDelDate, + $myrow['deliverto'], + $FormatedOrderValue, + $i, + $i, + $myrow['orderno']); + } else { /*User is not authorised to create POs so don't even show the option */ + printf("<td><a href='%s'>%s</a></td> + <td><a href='%s'>" . _('Invoice') . "</a></td> + <td><a target='_blank' href='%s'>" . $PrintText . " <IMG SRC='" .$rootpath."/css/".$theme."/images/pdf.png' title='" . _('Click for PDF') . "'></a></td> + <td><a target='_blank' href='%s'>" . $PrintText . " <IMG SRC='" .$rootpath."/css/".$theme."/images/pdf.png' title='" . _('Click for PDF') . "'></a></td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td> + <td class=number>%s</td> + </tr>", + $ModifyPage, + $myrow['orderno'], + $Confirm_Invoice, + $PrintDispatchNote, + $PrintSalesOrder, + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedOrderDate, + $FormatedDelDate, + $myrow['deliverto'], + $FormatedOrderValue); + } + } else { /*must be quotes only */ printf("<td><a href='%s'>%s</a></td> <td><a href='%s'>" . $PrintText . "</a></td> @@ -520,7 +816,7 @@ $myrow['deliverto'], $FormatedOrderValue); } - + $i++; $j++; if ($j == 12){ $j=1; @@ -529,7 +825,9 @@ //end of page full new headings if } //end of while loop - + if ($_POST['Quotations']=='Orders_Only' AND $AuthRow['cancreate']==0){ //cancreate==0 means can create POs + echo '<tr><td colspan="10"><td><td colspan="2"><input type="submit" name="PlacePO" value="' . _('Place PO') . '" onclick="return confirm(\'' . _('This will create purchase orders for all the items on the checked sales orders above, based on the preferred supplier purchasing data held in the system. Are You Absolutely Sure?') . '\');"></td</tr>'; + } echo '</table>'; } Modified: trunk/SelectSupplier.php =================================================================== --- trunk/SelectSupplier.php 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/SelectSupplier.php 2011-03-10 06:24:48 UTC (rev 4506) @@ -155,28 +155,28 @@ <th width=33%>" . _('Supplier Maintenance') . "</th> </tr>"; echo '<tr><td valign=top class="select">'; /* Inquiry Options */ - echo "<a href=\"$rootpath/SupplierInquiry.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Supplier Account Inquiry') . '</a><br>'; + echo "<a href=\"$rootpath/SupplierInquiry.php?SupplierID=" . $_SESSION['SupplierID'] . "\">" . _('Supplier Account Inquiry') . '</a><br>'; echo '<br>'; - echo "<br><a href='$rootpath/PO_SelectOSPurchOrder.php?" . SID . '&SelectedSupplier=' . $_SESSION['SupplierID'] . "'>" . _('Add / Receive / View Outstanding Purchase Orders') . '</a>'; - echo "<br><a href='$rootpath/PO_SelectPurchOrder.php?" . SID . '&SelectedSupplier=' . $_SESSION['SupplierID'] . "'>" . _('View All Purchase Orders') . '</a><br>'; + echo "<br><a href='$rootpath/PO_SelectOSPurchOrder.php?SelectedSupplier=" . $_SESSION['SupplierID'] . "'>" . _('Add / Receive / View Outstanding Purchase Orders') . '</a>'; + echo "<br><a href='$rootpath/PO_SelectPurchOrder.php?SelectedSupplier=" . $_SESSION['SupplierID'] . "'>" . _('View All Purchase Orders') . '</a><br>'; wikiLink('Supplier', $_SESSION['SupplierID']); - echo "<br><a href='$rootpath/ShiptsList.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "&SupplierName=".urlencode($SupplierName)."'>" . _('List all open shipments for') .' '.$SupplierName. '</a>'; - echo "<br><a href='$rootpath/Shipt_Select.php?" . SID . '&SelectedSupplier=' . $_SESSION['SupplierID'] . "'>" . _('Search / Modify / Close Shipments') . '</a>'; - echo "<br><a href='$rootpath/SuppPriceList.php?" . SID . '&SelectedSupplier=' . $_SESSION['SupplierID'] . "'>" . _('Supplier Price List') . '</a>'; + echo "<br><a href='$rootpath/ShiptsList.php?SupplierID=" . $_SESSION['SupplierID'] . "&SupplierName=".urlencode($SupplierName)."'>" . _('List all open shipments for') .' '.$SupplierName. '</a>'; + echo "<br><a href='" . $rootpath . '/Shipt_Select.php?SelectedSupplier=' . $_SESSION['SupplierID'] . "'>" . _('Search / Modify / Close Shipments') . '</a>'; + echo "<br><a href='" . $rootpath . '/SuppPriceList.php?SelectedSupplier=' . $_SESSION['SupplierID'] . "'>" . _('Supplier Price List') . '</a>'; echo '</td><td valign=top class="select">'; /* Supplier Transactions */ - echo "<a href=\"$rootpath/PO_Header.php?" . SID . '&NewOrder=Yes&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Enter a Purchase Order for This Supplier') . '</a><br>'; - echo "<a href=\"$rootpath/SupplierInvoice.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Enter a Suppliers Invoice') . '</a><br>'; - echo "<a href=\"$rootpath/SupplierCredit.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . '&New=True' . "\">" . _('Enter a Suppliers Credit Note') . '</a><br>'; - echo "<a href=\"$rootpath/Payments.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Enter a Payment to, or Receipt from the Supplier') . '</a><br>'; + echo "<a href=\"$rootpath/PO_Header.php?NewOrder=Yes&SupplierID=" . $_SESSION['SupplierID'] . "\">" . _('Enter a Purchase Order for This Supplier') . '</a><br>'; + echo "<a href=\"$rootpath/SupplierInvoice.php?SupplierID=" . $_SESSION['SupplierID'] . "\">" . _('Enter a Suppliers Invoice') . '</a><br>'; + echo "<a href=\"$rootpath/SupplierCredit.php?New=true&SupplierID=" . $_SESSION['SupplierID'] . "\">" . _('Enter a Suppliers Credit Note') . '</a><br>'; + echo "<a href=\"$rootpath/Payments.php?SupplierID=" . $_SESSION['SupplierID'] . "\">" . _('Enter a Payment to, or Receipt from the Supplier') . '</a><br>'; echo '<br>'; - echo "<br><a href='$rootpath/ReverseGRN.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "'>" . _('Reverse an Outstanding Goods Received Note (GRN)') . '</a>'; + echo "<br><a href='$rootpath/ReverseGRN.php?&SupplierID=" . $_SESSION['SupplierID'] . "'>" . _('Reverse an Outstanding Goods Received Note (GRN)') . '</a>'; echo '</td><td valign=top class="select">'; /* Supplier Maintenance */ echo '<a href="' . $rootpath . '/Suppliers.php?">' . _('Add a New Supplier') . '</a><br>'; - echo "<a href=\"$rootpath/Suppliers.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Modify Or Delete Supplier Details') . '</a>'; - echo "<br><a href=\"$rootpath/SupplierContacts.php?" . SID . '&SupplierID=' . $_SESSION['SupplierID'] . "\">" . _('Add/Modify/Delete Supplier Contacts') . '</a>'; + echo "<a href=\"$rootpath/Suppliers.php?SupplierID=" . $_SESSION['SupplierID'] . "\">" . _('Modify Or Delete Supplier Details') . '</a>'; + echo "<br><a href=\"$rootpath/SupplierContacts.php?&SupplierID=" . $_SESSION['SupplierID'] . "\">" . _('Add/Modify/Delete Supplier Contacts') . '</a>'; echo '<br>'; - echo "<br><a href='$rootpath/Shipments.php?" . SID . "&NewShipment=Yes'>" . _('Set Up A New Shipment') . '</a>'; - echo "<br><a href='$rootpath/SuppLoginSetup.php?" . SID . "'>" . _('Supplier Login Configuration') . '</a>'; + echo "<br><a href='$rootpath/Shipments.php?NewShipment=Yes'>" . _('Set Up A New Shipment') . '</a>'; + echo "<br><a href='$rootpath/SuppLoginSetup.php'>" . _('Supplier Login Configuration') . '</a>'; echo '</td></tr></table>'; } else { // Supplier is not selected yet Modified: trunk/StockQuantityByDate.php =================================================================== --- trunk/StockQuantityByDate.php 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/StockQuantityByDate.php 2011-03-10 06:24:48 UTC (rev 4506) @@ -22,16 +22,17 @@ echo '<table class=selection><tr>'; echo '<td>' . _('For Stock Category') . ":</td> <td><select name='StockCategory'> "; +echo '<option value="All">' . _('All') . '</option>'; while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockCategory']) AND $_POST['StockCategory']!='All'){ if ($myrow['categoryid'] == $_POST['StockCategory']){ - echo "<option selected VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo "<option selected VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; } else { - echo "<option VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo "<option VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; } }else { - echo "<option VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription']; + echo "<option VALUE='" . $myrow['categoryid'] . "'>" . $myrow['categorydescription'] . '</option>'; } } echo '</select></td>'; @@ -69,14 +70,21 @@ $TotalQuantity = 0; -if(isset($_POST['ShowStatus']) AND Is_Date($_POST['OnHandDate'])) -{ - $sql = "SELECT stockid, - description, - decimalplaces - FROM stockmaster - WHERE categoryid = '" . $_POST['StockCategory'] . "' - AND (mbflag='M' OR mbflag='B')"; +if(isset($_POST['ShowStatus']) AND Is_Date($_POST['OnHandDate'])) { + if ($_POST['StockCategory']='All') { + $sql = "SELECT stockid, + description, + decimalplaces + FROM stockmaster + WHERE (mbflag='M' OR mbflag='B')"; + } else { + $sql = "SELECT stockid, + description, + decimalplaces + FROM stockmaster + WHERE categoryid = '" . $_POST['StockCategory'] . "' + AND (mbflag='M' OR mbflag='B')"; + } $ErrMsg = _('The stock items in the category selected cannot be retrieved because'); $DbgMsg = _('The SQL that failed was'); Modified: trunk/StockStatus.php =================================================================== --- trunk/StockStatus.php 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/StockStatus.php 2011-03-10 06:24:48 UTC (rev 4506) @@ -274,22 +274,25 @@ $k=1; while ($myrow=DB_fetch_array($MovtsResult)) { - if ($LastPrice != $myrow['price'] or $LastDiscount != $myrow['discount']) { /* consolidate price history for records with same price/discount */ - if ($qty) { + if ($LastPrice != $myrow['price'] OR $LastDiscount != $myrow['discount']) { /* consolidate price history for records with same price/discount */ + if (isset($qty)) { $DateRange=ConvertSQLDate($FromDate); if ($FromDate != $ToDate) { $DateRange .= ' - ' . ConvertSQLDate($ToDate); } $PriceHistory[] = array($DateRange, $qty, $LastPrice, $LastDiscount); $k++; - if ($k > 9) break; /* 10 price records is enough to display */ - if ($myrow['trandate'] < FormatDateForSQL(time() - 366*86400)) + if ($k > 9) { + break; /* 10 price records is enough to display */ + } + if ($myrow['trandate'] < FormatDateForSQL(DateAdd(date($_SESSION['DefaultDateFormat']),'y', -1))) { break; /* stop displaying pirce history more than a year old once we have at least one to display */ + } } - $LastPrice = $myrow['price']; - $LastDiscount = $myrow['discount']; + $LastPrice = $myrow['price']; + $LastDiscount = $myrow['discountpercent']; $ToDate = $myrow['trandate']; - $qty = 0; + $qty = 0; } $qty += $myrow['qty']; $FromDate = $myrow['trandate']; @@ -302,8 +305,8 @@ $PriceHistory[] = array($DateRange, $qty, $LastPrice, $LastDiscount); } if (isset($PriceHistory)) { - echo '<p>' . _('Pricing history for sales of') . ' ' . $StockID . ' ' . _('to') . ' ' . $DebtorNo; - echo '<table cellpadding="2" class="selection">'; + echo '<br /><table cellpadding="4" class="selection">'; + echo '<tr><th colspan=4><font color=navy size=2>' . _('Pricing history for sales of') . ' ' . $StockID . ' ' . _('to') . ' ' . $DebtorNo . '</font></th></tr>'; $tableheader = "<tr> <th>" . _('Date Range') . "</th> <th>" . _('Quantity') . "</th> Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/SupplierCredit.php 2011-03-10 06:24:48 UTC (rev 4506) @@ -36,7 +36,7 @@ //echo "<a href='" . $rootpath . '/SelectSupplier.php?' . SID . "'>" . _('Back to Suppliers') . '</a><br>'; if (isset($_GET['New'])) { - unset($_SESSION['SuppTrans']); + unset($_SESSION['SuppTrans']); } if (!isset($_SESSION['SuppTrans']->SupplierName)) { @@ -615,8 +615,8 @@ }elseif ($_SESSION['SuppTrans']->ExRate <= 0){ $InputError = True; prnMsg(_('The credit note as entered cannot be processed because the exchange rate for the credit note has been entered as a negative or zero number') . '. ' . _('The exchange rate is expected to show how many of the suppliers currency there are in 1 of the local currency'),'warn'); - }elseif ($_SESSION['SuppTrans']->OvAmount < round($TotalGRNValue + $TotalGLValue + $TotalAssetValue + $TotalShiptValue + $TotalContractsValue,2)){ - prnMsg(_('The credit note total as entered is less than the sum of the shipment charges, the general ledger entries (if any) and the charges for goods received, contracts and fixed assets. There must be a mistake somewhere, the credit note as entered will not be processed'),'error'); + }elseif ($_SESSION['SuppTrans']->OvAmount < round($TotalShiptValue + $TotalGLValue + $TotalAssetValue + $TotalGRNValue,2)){ + prnMsg(_('The credit note total as entered is less than the sum of the shipment charges') . ', ' . _('the general ledger entries (if any) and the charges for goods received') . '. ' . _('There must be a mistake somewhere') . ', ' . _('the credit note as entered will not be processed'),'error'); $InputError = True; } else { @@ -722,15 +722,15 @@ foreach ($_SESSION['SuppTrans']->Assets as $AssetAddition){ /* only the GL entries if the creditors->GL integration is enabled */ - $SQL = "INSERT INTO gltrans (type, + $SQL = 'INSERT INTO gltrans (type, typeno, trandate, periodno, account, narrative, amount) - VALUES (21, '" . - $CreditNoteNo . "', + VALUES (21, ' . + $CreditNoteNo . ", '" . $SQLCreditNoteDate . "', '" . $PeriodNo . "', '". $AssetAddition->CostAct . "', Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/doc/Change.log.html 2011-03-10 06:24:48 UTC (rev 4506) @@ -1,8 +1,11 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>10/3/11: Phil fix pagination of PrintCustOrder_generic.php - second copy was not restarting page numbers</p> +<p>10/3/11: Tims launchpad fixes brought in MRP.php fix for table charset utf8 so joins work correctly; typeo in PO_Header preventing purchasing data being retrieved ($result not $Result); correct sql on searching for customer in SelectCreditItems.php; StockStatus.php pricing history bug resolved (4450); StockQuantityByDate.php now allowed to show for all categories - enclosed 'All' in gettext</p> +<p>8/3/11: Tim/Phil PO_Items.php in committing an order detail the assetid of 'Not an Asset' was being inserted to an integer field. Modified $_POST['AssetID'] to = 0 if it was 'Not an Asset' as advised by Tim</p> <p>8/3/11:Phil fix SalesAnalysis reports for TCPDF as reported by Joe Zhou</p> <p>5/3/11: Kovács Attila fix to Stocks.php to use ANSI GROUP BY for aggregate functions SQL</p> -<p>5/3/11: Kovács Attila fix to LanguageSetup.php to use utf-8 not ISO-8859-1. Phil hardcoded UTF- now as no dynamic changing of character set required all translations are utf-8</p> +<p>5/3/11: Kovács Attila fix to LanguageSetup.php to use utf-8 not ISO-8859-1. Phil hardcoded UTF-8 now as no dynamic changing of character set required all translations are utf-8</p> <p>3/3/11: Exson/Baran/Phil fix to customer login to ensure that other customers orders are not displayed when searching by customer ref or order no</p> <p>3/3/11: Tim launchpad mods to revision 4441 including change to allow supplier currency to be changed if there are no transactions already against the supplier. Ensure credit note session variable is unset before attempting to create a new credit note from the supplier form. Tim's work to add perisable expiry dates to the serial items logic - affects quite a few scripts. Headings to stock check script even if no quantity is shown. Portrait quotations. Not included change to default delivery date to the date the customer requested - left to be the current day's date. Not included Tim's unit pricing work .. yet launchpad revisions 4442-4447 inclusive</p> <p>27/2/11: Phil/Tim/Peter launchpad added category option for MRPShortages.php links with matching quotes in WorkOrderEntry</p> Modified: trunk/doc/README.txt =================================================================== --- trunk/doc/README.txt 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/doc/README.txt 2011-03-10 06:24:48 UTC (rev 4506) @@ -4,29 +4,27 @@ Thankyou for using webERP. -Installation instructions are in the file INSTALL.txt in the doc directory. It is important to read the INSTALL.txt file in its entirety before proceeding. In fact a printout is not a bad idea. +Installation instructions are in the file INSTALL.txt in the doc directory. It is important to read the INSTALL.txt file in its entirety before proceeding. A printout is recommended. The user documentation contains a wealth of information and is installed under the doc/Manual directory in html format. Links to it are available from the application itself. SUPPORT -The primary means of support queries is through the user mailing list. +The primary means of support queries is through the user mailing list. Please join the list at: http://lists.sourceforge.net/lists/listinfo/web-erp-users if you have queries. The archives of the mailing lists on sourceforge and the FAQ (see http://www.weberp.org/wikidocs/FrequentlyAskedQuestionsInstallation) contain the most common issues with respect to installation. -Feedback, wants and gripes are encouraged in the interests of improving this applicaton. +Feedback, wants and gripes are encouraged in the interests of improving the applicaton. -DEVELOPING +DEVELOPING -All contributions of code are needed and encouraged. -Guidelines for contributing code are in the document at http://www.weberp.org/wikidocs/ContributingtowebERP developers should read this document carefully and follow the guidelines therein. Standards and conventions used in the code are rigorously applied in the interests of consistency and readability. Code submitted that does not conform to these standards will be changed so it does where possible. +Contributions of code are documents including HOW-TOs with screen-shots etc are encouraged. Contributions in the form of bug reports or other feedback through the mainling lists above are also encouraged. +Guidelines for contributing code are in the document at http://www.weberp.org/wikidocs/ContributingtowebERP developers should read this document carefully and follow the guidelines therein. Standards and conventions used in the code are rigorously applied in the interests of consistency and readability. Code submitted that does not conform to these standards will be changed so it does where possible. If the job to make the code conform to webERP standards is too large then the code will not be included. TRANSLATIONS -Translations that have been contributed are distributed as separate language archives. These must be downloaded separately from: +All available translations are now included in the archive downloaded. -http://sourceforge.net/project/showfiles.php?group_id=70949 - Translators should read the document http://www.weberp.org/HowToTranslate which describes how to translate webERP. Translations must be installed under the webERP/locale directory and the locale must be available on the web-server. @@ -42,4 +40,4 @@ A copy of the GNU General Public License is included in the doc directory along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -Copyright weberp.org 2010 - Contact: in...@we... \ No newline at end of file +Copyright weberp.org 2011 - Contact: in...@we... \ No newline at end of file Modified: trunk/doc/UPGRADING.txt =================================================================== --- trunk/doc/UPGRADING.txt 2011-03-08 09:32:48 UTC (rev 4505) +++ trunk/doc/UPGRADING.txt 2011-03-10 06:24:48 UTC (rev 4506) @@ -2,6 +2,8 @@ /* $Id$*/ +From version 4.01 database upgrades are now automatically processed if the version number of the code is different to the version number of the database. The first login will require the system administrator to allow the system to upgrade it's own database. A backup of the database prior to the running the upgrade is advisable. The new upgrade system will not be able to identify versions prior to 3.11 so it is necessary to select the version being upgraded from manaully. It can process database upgrades from version 3.00 onwards. + From version 3.05 an upgrade script will be provided that applies the database modifications automatically and does any data conversions required for the new scripts to work. The upgrade script to convert a 3.05 database to work with 3.06 scripts is: @@ -13,7 +15,7 @@ Previous to version 3.05, the database conversion had to be done manually - the instructions to complete upgrades from older versions are provided below: -CONVERTING THE DATABASE +CONVERTING THE DATABASE MANUALY - THE DETAIL As each new version is released the new php scripts will use new database fields or changed field names. A a consequence, the new scripts will most likely not work unless the database structure has been converted to the new database structure. Normally the changes to the database between versions are small. However, between 2.9b and 3.0 the changes were significant and the upgrade script may take some time to run. It should not be run from a phpMyAdmin window since PHP will time out long before the upgrade script will have finished. @@ -26,9 +28,9 @@ where XX.XX is the old version number and YY.YY is the new version number. No other users should be using the database. The upgrade script will need to be edited to use the name of the database that your webERP installation was created with - by default this is weberp. If the default has not been changed then the following line will need to be added to the upgrade script - right at the beginning: - + use weberp; - + A similar line will be required but substituting the name of the database that your installation uses where the default database name has been changed. @@ -58,7 +60,7 @@ There are extensive changes to the database and the upgrade2.9b-3.0.sql may take some time to run depending on how much data there is in the system. A backup of the 2.9b database dump should be taken prior to attempting to run the upgrade script. -IMPORTANT: Note that version of mysql 4.1.8 or greater is required because from the mysql change log: +IMPORTANT: Note that version of mysql 4.1.8 or greater is required because from the mysql change log: "Fix two hangs: FOREIGN KEY constraints treated table and database names as case-insensitive. RENAME TABLE t TO T would hang in an endless loop if t had a foreign key constraint defined on it. Fix also a hang over the dictionary mutex that would occur if one tried in ALTER TABLE or RENAME TABLE to create a foreign key constraint name that collided with another existing name. (Bug #3478)" @@ -71,6 +73,6 @@ 3.05 now has Dave Premo's report writer scripts included in the distribution - additional tables are required for this functionality. Also, 3.05 allows for weighted average stock valuation - using the existing data fields and retaining integrated general ledger stock values. This requires cost information to be copied over into the grns table. The upgrade script Z_Upgrade_3.04-3.05.php applies all the additional tables to the database and does the data conversions required wihtout any manual intervention. -NOTES ON UPGRADING FROM 3.11 to 3.12 +NOTES ON UPGRADING FROM 3.11 to 4.x -PHP 5 is now required because of the simpleXML module of PHP only comes with PHP 5. This is used on the new XML definition of report formats. \ No newline at end of file +PHP 5 is now required because of the simpleXML module of PHP only comes with PHP 5+. This is used on the new XML definition of report formats. \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |