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. |
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. |
From: <dai...@us...> - 2011-03-11 20:24:10
|
Revision: 4507 http://web-erp.svn.sourceforge.net/web-erp/?rev=4507&view=rev Author: daintree Date: 2011-03-11 20:24:03 +0000 (Fri, 11 Mar 2011) Log Message: ----------- Exson fix all htmlentities to use ENTQUOTES, UTF-8 option Modified Paths: -------------- trunk/AccountGroups.php trunk/Contracts.php trunk/GLJournal.php trunk/PO_SelectPurchOrder.php trunk/PageSecurity.php trunk/SelectCreditItems.php trunk/SelectOrderItems.php trunk/SelectSalesOrder.php trunk/doc/Change.log.html trunk/includes/MiscFunctions.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/AccountGroups.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -68,7 +68,7 @@ } if (ContainsIllegalCharacters($_POST['GroupName'])) { $InputError = 1; - prnMsg( _('The account group name cannot contain the character') . " '&' " . _('or the character') ." '",'error'); + prnMsg( _('The account group name cannot contain the character') . " '&' " . _('or the character') ."' '",'error'); $Errors[$i] = 'GroupName'; $i++; } @@ -257,13 +257,13 @@ break; } //end of switch statement - echo '<td>' . htmlentities($myrow[0]) . '</td> + echo '<td>' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '</td> <td>' . $myrow[1] . '</td> <td>' . $myrow[2] . '</td> <td>' . $PandLText . '</td> <td>' . $myrow[4] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0]) . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0]) . '&delete=1">' . _('Delete') .'</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>'; } //END WHILE LIST LOOP echo '</table>'; @@ -353,9 +353,9 @@ while ( $grouprow = DB_fetch_array($groupresult) ) { if (isset($_POST['ParentGroupName']) and $_POST['ParentGroupName']==$grouprow['groupname']) { - echo '<option selected="selected" value="'.htmlentities($grouprow['groupname']).'">' .htmlentities($grouprow['groupname']).'</option>'; + echo '<option selected="selected" value="'.htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'">' .htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'</option>'; } else { - echo '<option value="'.htmlentities($grouprow['groupname']).'">' .htmlentities($grouprow['groupname']).'</option>'; + echo '<option value="'.htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'">' .htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'</option>'; } } echo '</select>'; Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/Contracts.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -792,13 +792,13 @@ $k=1; } if ($LastCustomer != $myrow['name']) { - echo '<td>'.htmlentities($myrow['name']).'</td>'; + echo '<td>'.htmlentities($myrow['name'], ENT_QUOTES,'UTF-8').'</td>'; } else { echo '<td></td>'; } - echo '<td><input tabindex="'.($j+5).'" type="submit" name="SubmitCustomerSelection' . $j .'" value="'.htmlentities($myrow['brname']).'" /></td> + echo '<td><input tabindex="'.($j+5).'" type="submit" name="SubmitCustomerSelection' . $j .'" value="'.htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8').'" /></td> <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'" /> - <td>'.htmlentities($myrow['contactname']).'</td> + <td>'.htmlentities($myrow['contactname'], ENT_QUOTES,'UTF-8') .'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> </tr>'; Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/GLJournal.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -249,175 +249,173 @@ $_SESSION['JournalDetail']->JnlDate = Date($_SESSION['DefaultDateFormat'],mktime(0,0,0,date('m'),0,date('Y'))); } - echo '<table><tr> - <td colspan="5"><table class="selection"><tr><td>'._('Date to Process Journal').":</td> - <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='JournalProcessDate' maxlength='10' size='11' value='" . - $_SESSION['JournalDetail']->JnlDate . "' /></td>"; - echo '<td>' . _('Type') . ':</td> - <td><select name="JournalType">'; +echo '<table><tr> + <td colspan="5"><table class="selection"><tr><td>'._('Date to Process Journal').":</td> + <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='JournalProcessDate' maxlength='10' size='11' value='" . + $_SESSION['JournalDetail']->JnlDate . "' /></td>"; +echo '<td>' . _('Type') . ':</td> + <td><select name="JournalType">'; - if ($_POST['JournalType'] == 'Reversing'){ - echo "<option selected='True' value = 'Reversing'>" . _('Reversing')."</option>"; - echo "<option value = 'Normal'>" . _('Normal')."</option>"; - } else { - echo "<option value = 'Reversing'>" . _('Reversing')."</option>"; - echo "<option selected='True' value = 'Normal'>" . _('Normal')."</option>"; - } +if ($_POST['JournalType'] == 'Reversing'){ + echo '<option selected="True" value = "Reversing">' . _('Reversing').'</option>'; + echo '<option value = "Normal">' . _('Normal').'</option>'; +} else { + echo '<option value = "Reversing">' . _('Reversing').'</option>'; + echo '<option selected="True" value = "Normal">' . _('Normal') . '</option>'; +} - echo '</select></td> - </tr> - </table>'; - /* close off the table in the first column */ +echo '</select></td> + </tr> + </table>'; +/* close off the table in the first column */ - echo '<br />'; - echo '<table class="selection" width="70%">'; - /* Set upthe form for the transaction entry for a GL Payment Analysis item */ +echo '<br />'; +echo '<table class="selection" width="70%">'; +/* Set upthe form for the transaction entry for a GL Payment Analysis item */ - echo '<tr><th colspan="3"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Line Entry') . '</b></font></div></th></tr>'; +echo '<tr><th colspan="3"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Line Entry') . '</b></font></div></th></tr>'; - /*now set up a GLCode field to select from avaialble GL accounts */ - echo '<tr><th>' . _('GL Tag') . '</th>'; - echo '<th>' . _('GL Account Code') . '</th>'; - echo '<th>' . _('Select GL Account') . '</th></tr>'; +/*now set up a GLCode field to select from avaialble GL accounts */ +echo '<tr><th>' . _('GL Tag') . '</th>'; +echo '<th>' . _('GL Account Code') . '</th>'; +echo '<th>' . _('Select GL Account') . '</th></tr>'; /* Set upthe form for the transaction entry for a GL Payment Analysis item */ - //Select the tag - echo '<tr><td><select name="tag">'; +//Select the tag +echo '<tr><td><select name="tag">'; - $SQL = "SELECT tagref, - tagdescription - FROM tags - ORDER BY tagref"; +$SQL = 'SELECT tagref, + tagdescription + FROM tags + ORDER BY tagref'; - $result=DB_query($SQL,$db); - echo '<option value="0">0 - None</option>'; - while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ - echo '<option selected value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription']."</option>"; - } else { - echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription']."</option>"; - } +$result=DB_query($SQL,$db); +echo '<option value="0">0 - None</option>'; +while ($myrow=DB_fetch_array($result)){ + if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ + echo '<option selected value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'].'</option>'; + } else { + echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } - echo '</select></td>'; +} +echo '</select></td>'; // End select tag - if (!isset($_POST['GLManualCode'])) { - $_POST['GLManualCode']=''; - } - echo '<td><input class="number" type="text" Name="GLManualCode" Maxlength="12" size="12" onChange="inArray(this.value, GLCode.options,'. - "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . - ' value="'. $_POST['GLManualCode'] .'" /></td>'; +if (!isset($_POST['GLManualCode'])) { + $_POST['GLManualCode']=''; +} +echo '<td><input class="number" type="text" Name="GLManualCode" Maxlength="12" size="12" onChange="inArray(this.value, GLCode.options,'. + "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . + ' value="'. $_POST['GLManualCode'] .'" /></td>'; - $sql="SELECT accountcode, - accountname - FROM chartmaster - ORDER BY accountcode"; +$sql="SELECT accountcode, + accountname + FROM chartmaster + ORDER BY accountcode"; - $result=DB_query($sql, $db); - echo '<td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; - echo '<option value="">' . _('Select a general ledger account code') . '</option>'; - while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow['accountcode']){ - echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'])."</option>"; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'])."</option>"; - } +$result=DB_query($sql, $db); +echo '<td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; +echo '<option value="">' . _('Select a general ledger account code') . '</option>'; +while ($myrow=DB_fetch_array($result)){ + if (isset($_POST['tag']) and $_POST['tag']==$myrow['accountcode']){ + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'], ENT_QUOTES,'UTF-8') . '</option>'; + } else { + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'], ENT_QUOTES,'UTF-8') .'</option>'; } - echo '</select></td>'; +} +echo '</select></td>'; - if (!isset($_POST['GLNarrative'])) { - $_POST['GLNarrative'] = ''; - } - if (!isset($_POST['Credit'])) { - $_POST['Credit'] = ''; - } - if (!isset($_POST['Debit'])) { - $_POST['Debit'] = ''; - } +if (!isset($_POST['GLNarrative'])) { + $_POST['GLNarrative'] = ''; +} +if (!isset($_POST['Credit'])) { + $_POST['Credit'] = ''; +} +if (!isset($_POST['Debit'])) { + $_POST['Debit'] = ''; +} - echo '</tr><tr><th>' . _('Debit') . "</th>".'<td><input type="text" class="number" Name = "Debit" ' . - 'onChange="eitherOr(this, '.'Credit'.')"'. - ' Maxlength="12" size="10" value="' . $_POST['Debit'] . '" /></td>'; - echo '</tr><tr><th>' . _('Credit') . "</th>".'<td><input type="text" class="number" Name = "Credit" ' . - 'onChange="eitherOr(this, '.'Debit'.')"'. - ' Maxlength="12" size="10" value="' . $_POST['Credit'] . '" /></td>'; - echo '</tr><tr><td></td><td></td><th>'. _('Narrative'). '</th>'; - echo '</tr><tr><th></th><th>' . _('GL Narrative') . "</th>"; +echo '</tr><tr><th>' . _('Debit') . '</th>'.'<td><input type="text" class="number" Name = "Debit" ' . + 'onChange="eitherOr(this, '.'Credit'.')"'. + ' Maxlength="12" size="10" value="' . $_POST['Debit'] . '" /></td>'; +echo '</tr><tr><th>' . _('Credit') . "</th>".'<td><input type="text" class="number" Name = "Credit" ' . + 'onChange="eitherOr(this, '.'Debit'.')"'. + ' Maxlength="12" size="10" value="' . $_POST['Credit'] . '" /></td>'; +echo '</tr><tr><td></td><td></td><th>'. _('Narrative'). '</th>'; +echo '</tr><tr><th></th><th>' . _('GL Narrative') . "</th>"; - echo '<td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td>'; +echo '<td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td>'; - echo '</tr></table><br />'; /*Close the main table */ - echo "<div class='centre'><input type='submit' name='Process' value='" . _('Accept') . "' /></div><br /><br />"; +echo '</tr></table><br />'; /*Close the main table */ +echo "<div class='centre'><input type='submit' name='Process' value='" . _('Accept') . "' /></div><br /><br />"; - echo "<table class='selection' width='85%'>"; +echo '<table class="selection" width="85%">'; - echo '<tr><th colspan="6"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Summary') . '</b></font></div></th></tr>'; - echo "<tr> - <th>"._('GL Tag')."</th> - <th>"._('GL Account')."</th> - <th>"._('Debit')."</th> - <th>"._('Credit')."</th> - <th>"._('Narrative').'</th></tr>'; +echo '<tr><th colspan="6"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Summary') . '</b></font></div></th></tr>'; +echo '<tr> + <th>'._('GL Tag').'</th> + <th>'._('GL Account').'</th> + <th>'._('Debit').'</th> + <th>'._('Credit').'</th> + <th>'._('Narrative').'</th></tr>'; - $debittotal=0; - $credittotal=0; - $j=0; +$debittotal=0; +$credittotal=0; +$j=0; - foreach ($_SESSION['JournalDetail']->GLEntries as $JournalItem) { - if ($j==1) { - echo '<tr class="OddTableRows">'; - $j=0; - } else { - echo '<tr class="EvenTableRows">'; - $j++; - } - $sql="SELECT tagdescription - FROM tags - WHERE tagref='".$JournalItem->tag . "'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - if ($JournalItem->tag==0) { - $tagdescription='None'; - } else { - $tagdescription=$myrow[0]; - } - echo "<td>" . $JournalItem->tag . ' - ' . $tagdescription . "</td>"; - echo "<td>" . $JournalItem->GLCode . ' - ' . $JournalItem->GLActName . "</td>"; - if($JournalItem->Amount>0) - { - echo "<td class='number'>" . number_format($JournalItem->Amount,2) . '</td><td></td>'; - $debittotal=$debittotal+$JournalItem->Amount; - } - elseif($JournalItem->Amount<0) - { - $credit=(-1 * $JournalItem->Amount); - echo "<td></td> - <td class='number'>" . number_format($credit,2) . '</td>'; - $credittotal=$credittotal+$credit; - } +foreach ($_SESSION['JournalDetail']->GLEntries as $JournalItem) { + if ($j==1) { + echo '<tr class="OddTableRows">'; + $j=0; + } else { + echo '<tr class="EvenTableRows">'; + $j++; + } + $sql="SELECT tagdescription + FROM tags + WHERE tagref='".$JournalItem->tag . "'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); + if ($JournalItem->tag==0) { + $tagdescription='None'; + } else { + $tagdescription=$myrow[0]; + } + echo '<td>' . $JournalItem->tag . ' - ' . $tagdescription . '</td>'; + echo '<td>' . $JournalItem->GLCode . ' - ' . $JournalItem->GLActName . '</td>'; + if ($JournalItem->Amount>0) { + echo '<td class="number">' . number_format($JournalItem->Amount,2) . '</td><td></td>'; + $debittotal=$debittotal+$JournalItem->Amount; + + } elseif($JournalItem->Amount<0) { + $credit=(-1 * $JournalItem->Amount); + echo '<td></td> + <td class="number">' . number_format($credit,2) . '</td>'; + $credittotal=$credittotal+$credit; + } - echo '<td>' . $JournalItem->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $JournalItem->ID . "'>"._('Delete').'</a></td> - </tr>'; - } + echo '<td>' . $JournalItem->Narrative . "</td> + <td><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $JournalItem->ID . "'>"._('Delete').'</a></td> + </tr>'; +} - echo '<tr class="EvenTableRows"><td></td> - <td class="number"><b> Total </b></td> - <td class="number"><b>' . number_format($debittotal,2) . '</b></td> - <td class="number"><b>' . number_format($credittotal,2) . '</b></td></tr>'; - if ($debittotal!=$credittotal) { - echo '<td align="center" style="background-color: #fddbdb"><b>Required to balance - </b>' . - number_format(abs($debittotal-$credittotal),2); - } - if ($debittotal>$credittotal) { - echo ' Credit</td></tr>'; - } else if ($debittotal<$credittotal) { - echo ' Debit</td></tr>'; - } - echo '</table>'; +echo '<tr class="EvenTableRows"><td></td> + <td class="number"><b> Total </b></td> + <td class="number"><b>' . number_format($debittotal,2) . '</b></td> + <td class="number"><b>' . number_format($credittotal,2) . '</b></td></tr>'; +if ($debittotal!=$credittotal) { + echo '<td align="center" style="background-color: #fddbdb"><b>Required to balance - </b>' . + number_format(abs($debittotal-$credittotal),2); +} +if ($debittotal>$credittotal) { + echo ' Credit</td></tr>'; +} else if ($debittotal<$credittotal) { + echo ' Debit</td></tr>'; +} +echo '</table>'; if (ABS($_SESSION['JournalDetail']->JournalTotal)<0.001 AND $_SESSION['JournalDetail']->GLItemCounter > 0){ echo "<br /><br /><div class='centre'><input type='submit' name='CommitBatch' value='"._('Accept and Process Journal')."' /></div>"; Modified: trunk/PO_SelectPurchOrder.php =================================================================== --- trunk/PO_SelectPurchOrder.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/PO_SelectPurchOrder.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -121,10 +121,10 @@ } } echo '</select> ' . _('Order Status:') .' <select name="Status">'; - if (!isset($_POST['Status']) OR $_POST['Status']=='Pending_Authorised'){ - echo '<option selected value="Pending_Authorised">' . _('Pending and Authorised') . '</option>'; + if (!isset($_POST['Status']) OR $_POST['Status']=='Pending_Authorised_Completed'){ + echo '<option selected value="Pending_Authorised_Completed">' . _('Pending/Authorised/Completed') . '</option>'; } else { - echo '<option value="Pending_Authorised">' . _('Pending and Authorised') . '</option>'; + echo '<option value="Pending_Authorised_Completed">' . _('Pending/Authorised/Completed') . '</option>'; } if ($_POST['Status']=='Pending'){ echo '<option selected value="Pending">' . _('Pending') . '</option>'; @@ -136,6 +136,11 @@ } else { echo '<option value="Authorised">' . _('Authorised') . '</option>'; } + if ($_POST['Status']=='Completed'){ + echo '<option selected value="Completed">' . _('Completed') . '</option>'; + } else { + echo '<option value="Completed">' . _('Completed') . '</option>'; + } if ($_POST['Status']=='Cancelled'){ echo '<option selected value="Cancelled">' . _('Cancelled') . '</option>'; } else { @@ -207,8 +212,8 @@ else { //figure out the SQL required from the inputs available - if (!isset($_POST['Status']) OR $_POST['Status']=='Pending_Authorised'){ - $StatusCriteria = " AND (purchorders.status='Pending' OR purchorders.status='Authorised' OR purchorders.status='Printed') "; + if (!isset($_POST['Status']) OR $_POST['Status']=='Pending_Authorised_Completed'){ + $StatusCriteria = " AND (purchorders.status='Pending' OR purchorders.status='Authorised' OR purchorders.status='Printed' OR purchorders.status='Completed') "; }elseif ($_POST['Status']=='Authorised'){ $StatusCriteria = " AND (purchorders.status='Authorised' OR purchorders.status='Printed')"; }elseif ($_POST['Status']=='Pending'){ @@ -217,25 +222,26 @@ $StatusCriteria = " AND purchorders.status='Rejected' "; }elseif ($_POST['Status']=='Cancelled'){ $StatusCriteria = " AND purchorders.status='Cancelled' "; + } elseif($_POST['Status']=='Completed'){ + $StatusCriteria = " AND purchorders.status='Completed' "; } - if (isset($OrderNumber) && $OrderNumber != "") { $SQL = "SELECT purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - purchorders.status, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorders.orderno='" . $OrderNumber . "' - GROUP BY purchorders.orderno"; + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + purchorders.status, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders, + purchorderdetails, + suppliers + WHERE purchorders.orderno = purchorderdetails.orderno + AND purchorders.supplierno = suppliers.supplierid + AND purchorders.orderno='" . $OrderNumber . "' + GROUP BY purchorders.orderno"; } else { /* $DateAfterCriteria = FormatDateforSQL($OrdersAfterDate); */ if (empty($_POST['StockLocation'])) { @@ -244,106 +250,106 @@ if (isset($SelectedSupplier)) { if (isset($SelectedStockItem)) { $SQL = "SELECT purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - purchorders.status, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorderdetails.itemcode='" . $SelectedStockItem . "' - AND purchorders.supplierno='" . $SelectedSupplier . "' - AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + purchorders.status, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders, + purchorderdetails, + suppliers + WHERE purchorders.orderno = purchorderdetails.orderno + AND purchorders.supplierno = suppliers.supplierid + AND purchorderdetails.itemcode='" . $SelectedStockItem . "' + AND purchorders.supplierno='" . $SelectedSupplier . "' + AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } else { $SQL = "SELECT purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - purchorders.status, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorders.supplierno='" . $SelectedSupplier . "' - AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + purchorders.status, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders, + purchorderdetails, + suppliers + WHERE purchorders.orderno = purchorderdetails.orderno + AND purchorders.supplierno = suppliers.supplierid + AND purchorders.supplierno='" . $SelectedSupplier . "' + AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } } else { //no supplier selected if (isset($SelectedStockItem)) { $SQL = "SELECT purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - purchorders.status, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorderdetails.itemcode='" . $SelectedStockItem . "' - AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + purchorders.status, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders, + purchorderdetails, + suppliers + WHERE purchorders.orderno = purchorderdetails.orderno + AND purchorders.supplierno = suppliers.supplierid + AND purchorderdetails.itemcode='" . $SelectedStockItem . "' + AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } else { $SQL = "SELECT purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - purchorders.status, - suppliers.currcode, - sum(purchorderdetails.unitprice*purchorderdetails.quantityord) as ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + purchorders.status, + suppliers.currcode, + sum(purchorderdetails.unitprice*purchorderdetails.quantityord) as ordervalue + FROM purchorders, + purchorderdetails, + suppliers + WHERE purchorders.orderno = purchorderdetails.orderno + AND purchorders.supplierno = suppliers.supplierid + AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } } //end selected supplier @@ -377,17 +383,17 @@ $ViewPurchOrder = $rootpath . '/PO_OrderDetails.php?' . SID . 'OrderNo=' . $myrow['orderno']; $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); $FormatedOrderValue = number_format($myrow['ordervalue'], 2); - /* View Supplier Currency Requisition Order Date Initiator Order Total + /* View Supplier Currency Requisition Order Date Initiator Order Total ModifyPage, $myrow["orderno"], $myrow["suppname"], $myrow["currcode"], $myrow["requisitionno"] $FormatedOrderDate, $myrow["initiator"] $FormatedOrderValue Order Status*/ - echo "<td><a href='" . $ViewPurchOrder . "'>" . $myrow['orderno'] . "</a></td> - <td>" . $myrow['suppname'] . "</td> - <td>" . $myrow['currcode'] . "</td> - <td>" . $myrow['requisitionno'] . "</td> - <td>" . $FormatedOrderDate . "</td> - <td>" . $myrow['initiator'] . "</td> - <td class=number>" . $FormatedOrderValue . "</td> - <td>" . _($myrow['status']) . "</td> - </tr>"; + echo '<td><a href="' . $ViewPurchOrder . '">' . $myrow['orderno'] . '</a></td> + <td>' . $myrow['suppname'] . '</td> + <td>' . $myrow['currcode'] . '</td> + <td>' . $myrow['requisitionno'] . '</td> + <td>' . $FormatedOrderDate . '</td> + <td>' . $myrow['initiator'] . '</td> + <td class=number>' . $FormatedOrderValue . '</td> + <td>' . _($myrow['status']) . '</td> + </tr>'; //$myrow['status'] is a string which has gettext translations from PO_Header.php script $j++; Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/PageSecurity.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -40,9 +40,9 @@ echo '<td><select name="'.$myrow['script'].'">'; while ($mytokenrow=DB_fetch_array($TokenResult)) { if ($mytokenrow['tokenid']==$myrow['pagesecurity']) { - echo '<option selected="True" value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname']).'</option>'; + echo '<option selected="True" value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname'], ENT_QUOTES,'UTF-8') .'</option>'; } else { - echo '<option value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname']).'</option>'; + echo '<option value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname'], ENT_QUOTES,'UTF-8') .'</option>'; } } echo '</select></td></tr>'; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/SelectCreditItems.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -5,8 +5,6 @@ /*The credit selection screen uses the Cart class used for the making up orders some of the variable names refer to order - please think credit when you read order */ -//$PageSecurity = 3; - include('includes/DefineCartClass.php'); include('includes/DefineSerialItems.php'); /* Session started in session.inc for password checking and authorisation level check */ Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/SelectOrderItems.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -660,7 +660,7 @@ } else { echo '<td></td>'; } - echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname']) . '"></td> + echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8'). '"></td> <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'] .' - '.$myrow['branchcode'].'"> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/SelectSalesOrder.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -53,135 +53,153 @@ purchdata.stockid"; $ErrMsg = _('Unable to retrieve the items on the selected orders for creating purchase orders for'); $ItemResult = DB_query($sql,$db,$ErrMsg); + /*Now get the default delivery address details from the users default stock location */ + $sql = "SELECT locationame, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; + $ErrMsg = _('The delivery address for the order could not be obtained from the user default stock location'); + $DelAddResult = DB_query($sql, $db,$ErrMsg); + $DelAddRow = DB_fetch_array($DelAddResult); + $SupplierID = ''; + if (IsEmailAddress($_SESSION['UserEmail'])){ + $UserDetails = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; + } else { + $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; + } + 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 ($SupplierID != $ItemRow['supplierno']){ + /* This order item is purchased from a different supplier so need to finish off the authorisation of the previous order and start a new order */ - 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 />'; + if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { + //if the user has authority to authorise the PO then it should be created as authorised + $AuthSQL ="SELECT authlevel + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$SuppRow['currcode']."'"; + + $AuthResult=DB_query($AuthSQL,$db); + $AuthRow=DB_fetch_array($AuthResult); + + if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; + $result = DB_query("UPDATE purchorders SET allowprint=1, + status='Authorised', + statuscomment='" . $StatusComment . "' + WHERE orderno='" . $OrderNo . "'", + $db); + } else { // no authority to authorise this order + if (DB_num_rows($AuthResult) ==0){ + $AuthMessage = _('Your authority to approve purchase orders in') . ' ' .$SuppRow['currcode'] . ' ' . _('has not yet been set up') . '<br />'; + } else { + $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; + } + + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. + $SuppRow['currcode'] . ' '. $Order_Value .'. '. + $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. + _('The order has been created with a status of pending and will require authorisation'), 'warn'); } - - prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. - $_SESSION['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'; + } //end of authorisation status settings + + if ($SupplierID !=''){ //then we have just added a purchase order + DB_Txn_Commit($db); } - } 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 + /*Starting a new purchase order with a different supplier */ + $result = DB_Txn_Begin($db); + $OrderNo = GetNextTransNo(18, $db); //get the next PO number - /*Get the order number */ - $_SESSION['PO'.$identifier]->OrderNo = GetNextTransNo(18, $db); - + $SupplierID = $ItemRow['supplierno']; + $Order_Value =0; + /*Now get all the required details for the supplier */ + $sql = "SELECT address1, + address2, + address3, + address4, + address5, + address6, + suppliercontact, + telephone, + paymentterms, + currcode, + rate + FROM suppliers INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev + WHERE supplierno='" . $SupplierID . "'"; + + $ErrMsg = _('Could not get the supplier information for the order'); + $SuppResult = DB_query($sql, $db, $ErrMsg); + $SuppRow = DB_fetch_array($SuppResult); + + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; /*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 . "' - )"; + supplierno, + orddate, + rate, + initiator, + intostocklocation, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + suppdeladdress1, + suppdeladdress2, + suppdeladdress3, + suppdeladdress4, + suppdeladdress5, + suppdeladdress6, + supptel, + version, + revised, + deliveryby, + status, + stat_comment, + deliverydate, + paymentterms, + allowprint) + VALUES( '" . $OrderNo . "', + '" . $SupplierID . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['rate'] . "', + '" . $_SESSION['UsersRealName'] . "', + '" . $_SESSION['UserStockLocation'] . "', + '" . $DelAddRow['locationname'] . "', + '" . $DelAddRow['deladd1'] . "', + '" . $DelAddRow['deladd2'] . "', + '" . $DelAddRow['deladd3'] . "', + '" . $DelAddRow['deladd4'] . "', + '" . $DelAddRow['deladd5'] . "', + '" . $DelAddRow['deladd6'] . "', + '" . $DelAddRow['tel'] . "', + '" . $SuppRow['address1'] . "', + '" . $SuppRow['address2'] . "', + '" . $SuppRow['address3'] . "', + '" . $SuppRow['address4'] . "', + '" . $SuppRow['address5'] . "', + '" . $SuppRow['address6'] . "', + '" . $SuppRow['telephone'] . "', + '1.0', + '" . Date('Y-m-d') . "', + '" . $_SESSION['Default_Shipper'] . "', + 'Pending', + '" . $StatusComment . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['paymentterms'] . "', + 0)"; $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'); @@ -191,50 +209,50 @@ 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 . "')"; + 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'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/doc/Change.log.html 2011-03-11 20:24:03 UTC (rev 4507) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>12/3/11: Exson fix all htmlentities to use ENTQUOTES, 'UTF-8' option so other character sets work with it</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> Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/includes/MiscFunctions.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -114,8 +114,7 @@ OR strstr($CheckVariable,"\"") OR strstr($CheckVariable,'&') OR strstr($CheckVariable,"\\") - OR strstr($CheckVariable,'"') - OR strstr($CheckVariable,' ')){ + OR strstr($CheckVariable,'"')){ return true; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-11 20:24:10
|
Revision: 4507 http://web-erp.svn.sourceforge.net/web-erp/?rev=4507&view=rev Author: daintree Date: 2011-03-11 20:24:03 +0000 (Fri, 11 Mar 2011) Log Message: ----------- Exson fix all htmlentities to use ENTQUOTES, UTF-8 option Modified Paths: -------------- trunk/AccountGroups.php trunk/Contracts.php trunk/GLJournal.php trunk/PO_SelectPurchOrder.php trunk/PageSecurity.php trunk/SelectCreditItems.php trunk/SelectOrderItems.php trunk/SelectSalesOrder.php trunk/doc/Change.log.html trunk/includes/MiscFunctions.php Modified: trunk/AccountGroups.php =================================================================== --- trunk/AccountGroups.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/AccountGroups.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -68,7 +68,7 @@ } if (ContainsIllegalCharacters($_POST['GroupName'])) { $InputError = 1; - prnMsg( _('The account group name cannot contain the character') . " '&' " . _('or the character') ." '",'error'); + prnMsg( _('The account group name cannot contain the character') . " '&' " . _('or the character') ."' '",'error'); $Errors[$i] = 'GroupName'; $i++; } @@ -257,13 +257,13 @@ break; } //end of switch statement - echo '<td>' . htmlentities($myrow[0]) . '</td> + echo '<td>' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '</td> <td>' . $myrow[1] . '</td> <td>' . $myrow[2] . '</td> <td>' . $PandLText . '</td> <td>' . $myrow[4] . '</td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0]) . '">' . _('Edit') . '</a></td>'; - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0]) . '&delete=1">' . _('Delete') .'</a></td></tr>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '">' . _('Edit') . '</a></td>'; + echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&SelectedAccountGroup=' . htmlentities($myrow[0], ENT_QUOTES,'UTF-8') . '&delete=1">' . _('Delete') .'</a></td></tr>'; } //END WHILE LIST LOOP echo '</table>'; @@ -353,9 +353,9 @@ while ( $grouprow = DB_fetch_array($groupresult) ) { if (isset($_POST['ParentGroupName']) and $_POST['ParentGroupName']==$grouprow['groupname']) { - echo '<option selected="selected" value="'.htmlentities($grouprow['groupname']).'">' .htmlentities($grouprow['groupname']).'</option>'; + echo '<option selected="selected" value="'.htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'">' .htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'</option>'; } else { - echo '<option value="'.htmlentities($grouprow['groupname']).'">' .htmlentities($grouprow['groupname']).'</option>'; + echo '<option value="'.htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'">' .htmlentities($grouprow['groupname'], ENT_QUOTES,'UTF-8').'</option>'; } } echo '</select>'; Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/Contracts.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -792,13 +792,13 @@ $k=1; } if ($LastCustomer != $myrow['name']) { - echo '<td>'.htmlentities($myrow['name']).'</td>'; + echo '<td>'.htmlentities($myrow['name'], ENT_QUOTES,'UTF-8').'</td>'; } else { echo '<td></td>'; } - echo '<td><input tabindex="'.($j+5).'" type="submit" name="SubmitCustomerSelection' . $j .'" value="'.htmlentities($myrow['brname']).'" /></td> + echo '<td><input tabindex="'.($j+5).'" type="submit" name="SubmitCustomerSelection' . $j .'" value="'.htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8').'" /></td> <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].' - '.$myrow['branchcode'].'" /> - <td>'.htmlentities($myrow['contactname']).'</td> + <td>'.htmlentities($myrow['contactname'], ENT_QUOTES,'UTF-8') .'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> </tr>'; Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/GLJournal.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -249,175 +249,173 @@ $_SESSION['JournalDetail']->JnlDate = Date($_SESSION['DefaultDateFormat'],mktime(0,0,0,date('m'),0,date('Y'))); } - echo '<table><tr> - <td colspan="5"><table class="selection"><tr><td>'._('Date to Process Journal').":</td> - <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='JournalProcessDate' maxlength='10' size='11' value='" . - $_SESSION['JournalDetail']->JnlDate . "' /></td>"; - echo '<td>' . _('Type') . ':</td> - <td><select name="JournalType">'; +echo '<table><tr> + <td colspan="5"><table class="selection"><tr><td>'._('Date to Process Journal').":</td> + <td><input type='text' class='date' alt='".$_SESSION['DefaultDateFormat']."' name='JournalProcessDate' maxlength='10' size='11' value='" . + $_SESSION['JournalDetail']->JnlDate . "' /></td>"; +echo '<td>' . _('Type') . ':</td> + <td><select name="JournalType">'; - if ($_POST['JournalType'] == 'Reversing'){ - echo "<option selected='True' value = 'Reversing'>" . _('Reversing')."</option>"; - echo "<option value = 'Normal'>" . _('Normal')."</option>"; - } else { - echo "<option value = 'Reversing'>" . _('Reversing')."</option>"; - echo "<option selected='True' value = 'Normal'>" . _('Normal')."</option>"; - } +if ($_POST['JournalType'] == 'Reversing'){ + echo '<option selected="True" value = "Reversing">' . _('Reversing').'</option>'; + echo '<option value = "Normal">' . _('Normal').'</option>'; +} else { + echo '<option value = "Reversing">' . _('Reversing').'</option>'; + echo '<option selected="True" value = "Normal">' . _('Normal') . '</option>'; +} - echo '</select></td> - </tr> - </table>'; - /* close off the table in the first column */ +echo '</select></td> + </tr> + </table>'; +/* close off the table in the first column */ - echo '<br />'; - echo '<table class="selection" width="70%">'; - /* Set upthe form for the transaction entry for a GL Payment Analysis item */ +echo '<br />'; +echo '<table class="selection" width="70%">'; +/* Set upthe form for the transaction entry for a GL Payment Analysis item */ - echo '<tr><th colspan="3"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Line Entry') . '</b></font></div></th></tr>'; +echo '<tr><th colspan="3"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Line Entry') . '</b></font></div></th></tr>'; - /*now set up a GLCode field to select from avaialble GL accounts */ - echo '<tr><th>' . _('GL Tag') . '</th>'; - echo '<th>' . _('GL Account Code') . '</th>'; - echo '<th>' . _('Select GL Account') . '</th></tr>'; +/*now set up a GLCode field to select from avaialble GL accounts */ +echo '<tr><th>' . _('GL Tag') . '</th>'; +echo '<th>' . _('GL Account Code') . '</th>'; +echo '<th>' . _('Select GL Account') . '</th></tr>'; /* Set upthe form for the transaction entry for a GL Payment Analysis item */ - //Select the tag - echo '<tr><td><select name="tag">'; +//Select the tag +echo '<tr><td><select name="tag">'; - $SQL = "SELECT tagref, - tagdescription - FROM tags - ORDER BY tagref"; +$SQL = 'SELECT tagref, + tagdescription + FROM tags + ORDER BY tagref'; - $result=DB_query($SQL,$db); - echo '<option value="0">0 - None</option>'; - while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ - echo '<option selected value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription']."</option>"; - } else { - echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription']."</option>"; - } +$result=DB_query($SQL,$db); +echo '<option value="0">0 - None</option>'; +while ($myrow=DB_fetch_array($result)){ + if (isset($_POST['tag']) and $_POST['tag']==$myrow['tagref']){ + echo '<option selected value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'].'</option>'; + } else { + echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } - echo '</select></td>'; +} +echo '</select></td>'; // End select tag - if (!isset($_POST['GLManualCode'])) { - $_POST['GLManualCode']=''; - } - echo '<td><input class="number" type="text" Name="GLManualCode" Maxlength="12" size="12" onChange="inArray(this.value, GLCode.options,'. - "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . - ' value="'. $_POST['GLManualCode'] .'" /></td>'; +if (!isset($_POST['GLManualCode'])) { + $_POST['GLManualCode']=''; +} +echo '<td><input class="number" type="text" Name="GLManualCode" Maxlength="12" size="12" onChange="inArray(this.value, GLCode.options,'. + "'".'The account code '."'".'+ this.value+ '."'".' doesnt exist'."'".')"' . + ' value="'. $_POST['GLManualCode'] .'" /></td>'; - $sql="SELECT accountcode, - accountname - FROM chartmaster - ORDER BY accountcode"; +$sql="SELECT accountcode, + accountname + FROM chartmaster + ORDER BY accountcode"; - $result=DB_query($sql, $db); - echo '<td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; - echo '<option value="">' . _('Select a general ledger account code') . '</option>'; - while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow['accountcode']){ - echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'])."</option>"; - } else { - echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'])."</option>"; - } +$result=DB_query($sql, $db); +echo '<td><select name="GLCode" onChange="return assignComboToInput(this,'.'GLManualCode'.')">'; +echo '<option value="">' . _('Select a general ledger account code') . '</option>'; +while ($myrow=DB_fetch_array($result)){ + if (isset($_POST['tag']) and $_POST['tag']==$myrow['accountcode']){ + echo '<option selected value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'], ENT_QUOTES,'UTF-8') . '</option>'; + } else { + echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlentities($myrow['accountname'], ENT_QUOTES,'UTF-8') .'</option>'; } - echo '</select></td>'; +} +echo '</select></td>'; - if (!isset($_POST['GLNarrative'])) { - $_POST['GLNarrative'] = ''; - } - if (!isset($_POST['Credit'])) { - $_POST['Credit'] = ''; - } - if (!isset($_POST['Debit'])) { - $_POST['Debit'] = ''; - } +if (!isset($_POST['GLNarrative'])) { + $_POST['GLNarrative'] = ''; +} +if (!isset($_POST['Credit'])) { + $_POST['Credit'] = ''; +} +if (!isset($_POST['Debit'])) { + $_POST['Debit'] = ''; +} - echo '</tr><tr><th>' . _('Debit') . "</th>".'<td><input type="text" class="number" Name = "Debit" ' . - 'onChange="eitherOr(this, '.'Credit'.')"'. - ' Maxlength="12" size="10" value="' . $_POST['Debit'] . '" /></td>'; - echo '</tr><tr><th>' . _('Credit') . "</th>".'<td><input type="text" class="number" Name = "Credit" ' . - 'onChange="eitherOr(this, '.'Debit'.')"'. - ' Maxlength="12" size="10" value="' . $_POST['Credit'] . '" /></td>'; - echo '</tr><tr><td></td><td></td><th>'. _('Narrative'). '</th>'; - echo '</tr><tr><th></th><th>' . _('GL Narrative') . "</th>"; +echo '</tr><tr><th>' . _('Debit') . '</th>'.'<td><input type="text" class="number" Name = "Debit" ' . + 'onChange="eitherOr(this, '.'Credit'.')"'. + ' Maxlength="12" size="10" value="' . $_POST['Debit'] . '" /></td>'; +echo '</tr><tr><th>' . _('Credit') . "</th>".'<td><input type="text" class="number" Name = "Credit" ' . + 'onChange="eitherOr(this, '.'Debit'.')"'. + ' Maxlength="12" size="10" value="' . $_POST['Credit'] . '" /></td>'; +echo '</tr><tr><td></td><td></td><th>'. _('Narrative'). '</th>'; +echo '</tr><tr><th></th><th>' . _('GL Narrative') . "</th>"; - echo '<td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td>'; +echo '<td><input type="text" name="GLNarrative" maxlength="100" size="100" value="' . $_POST['GLNarrative'] . '" /></td>'; - echo '</tr></table><br />'; /*Close the main table */ - echo "<div class='centre'><input type='submit' name='Process' value='" . _('Accept') . "' /></div><br /><br />"; +echo '</tr></table><br />'; /*Close the main table */ +echo "<div class='centre'><input type='submit' name='Process' value='" . _('Accept') . "' /></div><br /><br />"; - echo "<table class='selection' width='85%'>"; +echo '<table class="selection" width="85%">'; - echo '<tr><th colspan="6"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Summary') . '</b></font></div></th></tr>'; - echo "<tr> - <th>"._('GL Tag')."</th> - <th>"._('GL Account')."</th> - <th>"._('Debit')."</th> - <th>"._('Credit')."</th> - <th>"._('Narrative').'</th></tr>'; +echo '<tr><th colspan="6"><div class="centre"><font size="3" color="blue"><b>' . _('Journal Summary') . '</b></font></div></th></tr>'; +echo '<tr> + <th>'._('GL Tag').'</th> + <th>'._('GL Account').'</th> + <th>'._('Debit').'</th> + <th>'._('Credit').'</th> + <th>'._('Narrative').'</th></tr>'; - $debittotal=0; - $credittotal=0; - $j=0; +$debittotal=0; +$credittotal=0; +$j=0; - foreach ($_SESSION['JournalDetail']->GLEntries as $JournalItem) { - if ($j==1) { - echo '<tr class="OddTableRows">'; - $j=0; - } else { - echo '<tr class="EvenTableRows">'; - $j++; - } - $sql="SELECT tagdescription - FROM tags - WHERE tagref='".$JournalItem->tag . "'"; - $result=DB_query($sql, $db); - $myrow=DB_fetch_row($result); - if ($JournalItem->tag==0) { - $tagdescription='None'; - } else { - $tagdescription=$myrow[0]; - } - echo "<td>" . $JournalItem->tag . ' - ' . $tagdescription . "</td>"; - echo "<td>" . $JournalItem->GLCode . ' - ' . $JournalItem->GLActName . "</td>"; - if($JournalItem->Amount>0) - { - echo "<td class='number'>" . number_format($JournalItem->Amount,2) . '</td><td></td>'; - $debittotal=$debittotal+$JournalItem->Amount; - } - elseif($JournalItem->Amount<0) - { - $credit=(-1 * $JournalItem->Amount); - echo "<td></td> - <td class='number'>" . number_format($credit,2) . '</td>'; - $credittotal=$credittotal+$credit; - } +foreach ($_SESSION['JournalDetail']->GLEntries as $JournalItem) { + if ($j==1) { + echo '<tr class="OddTableRows">'; + $j=0; + } else { + echo '<tr class="EvenTableRows">'; + $j++; + } + $sql="SELECT tagdescription + FROM tags + WHERE tagref='".$JournalItem->tag . "'"; + $result=DB_query($sql, $db); + $myrow=DB_fetch_row($result); + if ($JournalItem->tag==0) { + $tagdescription='None'; + } else { + $tagdescription=$myrow[0]; + } + echo '<td>' . $JournalItem->tag . ' - ' . $tagdescription . '</td>'; + echo '<td>' . $JournalItem->GLCode . ' - ' . $JournalItem->GLActName . '</td>'; + if ($JournalItem->Amount>0) { + echo '<td class="number">' . number_format($JournalItem->Amount,2) . '</td><td></td>'; + $debittotal=$debittotal+$JournalItem->Amount; + + } elseif($JournalItem->Amount<0) { + $credit=(-1 * $JournalItem->Amount); + echo '<td></td> + <td class="number">' . number_format($credit,2) . '</td>'; + $credittotal=$credittotal+$credit; + } - echo '<td>' . $JournalItem->Narrative . "</td> - <td><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $JournalItem->ID . "'>"._('Delete').'</a></td> - </tr>'; - } + echo '<td>' . $JournalItem->Narrative . "</td> + <td><a href='" . $_SERVER['PHP_SELF'] . '?' . SID . '&Delete=' . $JournalItem->ID . "'>"._('Delete').'</a></td> + </tr>'; +} - echo '<tr class="EvenTableRows"><td></td> - <td class="number"><b> Total </b></td> - <td class="number"><b>' . number_format($debittotal,2) . '</b></td> - <td class="number"><b>' . number_format($credittotal,2) . '</b></td></tr>'; - if ($debittotal!=$credittotal) { - echo '<td align="center" style="background-color: #fddbdb"><b>Required to balance - </b>' . - number_format(abs($debittotal-$credittotal),2); - } - if ($debittotal>$credittotal) { - echo ' Credit</td></tr>'; - } else if ($debittotal<$credittotal) { - echo ' Debit</td></tr>'; - } - echo '</table>'; +echo '<tr class="EvenTableRows"><td></td> + <td class="number"><b> Total </b></td> + <td class="number"><b>' . number_format($debittotal,2) . '</b></td> + <td class="number"><b>' . number_format($credittotal,2) . '</b></td></tr>'; +if ($debittotal!=$credittotal) { + echo '<td align="center" style="background-color: #fddbdb"><b>Required to balance - </b>' . + number_format(abs($debittotal-$credittotal),2); +} +if ($debittotal>$credittotal) { + echo ' Credit</td></tr>'; +} else if ($debittotal<$credittotal) { + echo ' Debit</td></tr>'; +} +echo '</table>'; if (ABS($_SESSION['JournalDetail']->JournalTotal)<0.001 AND $_SESSION['JournalDetail']->GLItemCounter > 0){ echo "<br /><br /><div class='centre'><input type='submit' name='CommitBatch' value='"._('Accept and Process Journal')."' /></div>"; Modified: trunk/PO_SelectPurchOrder.php =================================================================== --- trunk/PO_SelectPurchOrder.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/PO_SelectPurchOrder.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -121,10 +121,10 @@ } } echo '</select> ' . _('Order Status:') .' <select name="Status">'; - if (!isset($_POST['Status']) OR $_POST['Status']=='Pending_Authorised'){ - echo '<option selected value="Pending_Authorised">' . _('Pending and Authorised') . '</option>'; + if (!isset($_POST['Status']) OR $_POST['Status']=='Pending_Authorised_Completed'){ + echo '<option selected value="Pending_Authorised_Completed">' . _('Pending/Authorised/Completed') . '</option>'; } else { - echo '<option value="Pending_Authorised">' . _('Pending and Authorised') . '</option>'; + echo '<option value="Pending_Authorised_Completed">' . _('Pending/Authorised/Completed') . '</option>'; } if ($_POST['Status']=='Pending'){ echo '<option selected value="Pending">' . _('Pending') . '</option>'; @@ -136,6 +136,11 @@ } else { echo '<option value="Authorised">' . _('Authorised') . '</option>'; } + if ($_POST['Status']=='Completed'){ + echo '<option selected value="Completed">' . _('Completed') . '</option>'; + } else { + echo '<option value="Completed">' . _('Completed') . '</option>'; + } if ($_POST['Status']=='Cancelled'){ echo '<option selected value="Cancelled">' . _('Cancelled') . '</option>'; } else { @@ -207,8 +212,8 @@ else { //figure out the SQL required from the inputs available - if (!isset($_POST['Status']) OR $_POST['Status']=='Pending_Authorised'){ - $StatusCriteria = " AND (purchorders.status='Pending' OR purchorders.status='Authorised' OR purchorders.status='Printed') "; + if (!isset($_POST['Status']) OR $_POST['Status']=='Pending_Authorised_Completed'){ + $StatusCriteria = " AND (purchorders.status='Pending' OR purchorders.status='Authorised' OR purchorders.status='Printed' OR purchorders.status='Completed') "; }elseif ($_POST['Status']=='Authorised'){ $StatusCriteria = " AND (purchorders.status='Authorised' OR purchorders.status='Printed')"; }elseif ($_POST['Status']=='Pending'){ @@ -217,25 +222,26 @@ $StatusCriteria = " AND purchorders.status='Rejected' "; }elseif ($_POST['Status']=='Cancelled'){ $StatusCriteria = " AND purchorders.status='Cancelled' "; + } elseif($_POST['Status']=='Completed'){ + $StatusCriteria = " AND purchorders.status='Completed' "; } - if (isset($OrderNumber) && $OrderNumber != "") { $SQL = "SELECT purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - purchorders.status, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorders.orderno='" . $OrderNumber . "' - GROUP BY purchorders.orderno"; + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + purchorders.status, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders, + purchorderdetails, + suppliers + WHERE purchorders.orderno = purchorderdetails.orderno + AND purchorders.supplierno = suppliers.supplierid + AND purchorders.orderno='" . $OrderNumber . "' + GROUP BY purchorders.orderno"; } else { /* $DateAfterCriteria = FormatDateforSQL($OrdersAfterDate); */ if (empty($_POST['StockLocation'])) { @@ -244,106 +250,106 @@ if (isset($SelectedSupplier)) { if (isset($SelectedStockItem)) { $SQL = "SELECT purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - purchorders.status, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorderdetails.itemcode='" . $SelectedStockItem . "' - AND purchorders.supplierno='" . $SelectedSupplier . "' - AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + purchorders.status, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders, + purchorderdetails, + suppliers + WHERE purchorders.orderno = purchorderdetails.orderno + AND purchorders.supplierno = suppliers.supplierid + AND purchorderdetails.itemcode='" . $SelectedStockItem . "' + AND purchorders.supplierno='" . $SelectedSupplier . "' + AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } else { $SQL = "SELECT purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - purchorders.status, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorders.supplierno='" . $SelectedSupplier . "' - AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + purchorders.status, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders, + purchorderdetails, + suppliers + WHERE purchorders.orderno = purchorderdetails.orderno + AND purchorders.supplierno = suppliers.supplierid + AND purchorders.supplierno='" . $SelectedSupplier . "' + AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } } else { //no supplier selected if (isset($SelectedStockItem)) { $SQL = "SELECT purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - purchorders.status, - suppliers.currcode, - SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorderdetails.itemcode='" . $SelectedStockItem . "' - AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + purchorders.status, + suppliers.currcode, + SUM(purchorderdetails.unitprice*purchorderdetails.quantityord) AS ordervalue + FROM purchorders, + purchorderdetails, + suppliers + WHERE purchorders.orderno = purchorderdetails.orderno + AND purchorders.supplierno = suppliers.supplierid + AND purchorderdetails.itemcode='" . $SelectedStockItem . "' + AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } else { $SQL = "SELECT purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - purchorders.status, - suppliers.currcode, - sum(purchorderdetails.unitprice*purchorderdetails.quantityord) as ordervalue - FROM purchorders, - purchorderdetails, - suppliers - WHERE purchorders.orderno = purchorderdetails.orderno - AND purchorders.supplierno = suppliers.supplierid - AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' - " . $StatusCriteria . " - GROUP BY purchorders.orderno, - suppliers.suppname, - purchorders.orddate, - purchorders.initiator, - purchorders.requisitionno, - purchorders.allowprint, - suppliers.currcode"; + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + purchorders.status, + suppliers.currcode, + sum(purchorderdetails.unitprice*purchorderdetails.quantityord) as ordervalue + FROM purchorders, + purchorderdetails, + suppliers + WHERE purchorders.orderno = purchorderdetails.orderno + AND purchorders.supplierno = suppliers.supplierid + AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "' + " . $StatusCriteria . " + GROUP BY purchorders.orderno, + suppliers.suppname, + purchorders.orddate, + purchorders.initiator, + purchorders.requisitionno, + purchorders.allowprint, + suppliers.currcode"; } } //end selected supplier @@ -377,17 +383,17 @@ $ViewPurchOrder = $rootpath . '/PO_OrderDetails.php?' . SID . 'OrderNo=' . $myrow['orderno']; $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); $FormatedOrderValue = number_format($myrow['ordervalue'], 2); - /* View Supplier Currency Requisition Order Date Initiator Order Total + /* View Supplier Currency Requisition Order Date Initiator Order Total ModifyPage, $myrow["orderno"], $myrow["suppname"], $myrow["currcode"], $myrow["requisitionno"] $FormatedOrderDate, $myrow["initiator"] $FormatedOrderValue Order Status*/ - echo "<td><a href='" . $ViewPurchOrder . "'>" . $myrow['orderno'] . "</a></td> - <td>" . $myrow['suppname'] . "</td> - <td>" . $myrow['currcode'] . "</td> - <td>" . $myrow['requisitionno'] . "</td> - <td>" . $FormatedOrderDate . "</td> - <td>" . $myrow['initiator'] . "</td> - <td class=number>" . $FormatedOrderValue . "</td> - <td>" . _($myrow['status']) . "</td> - </tr>"; + echo '<td><a href="' . $ViewPurchOrder . '">' . $myrow['orderno'] . '</a></td> + <td>' . $myrow['suppname'] . '</td> + <td>' . $myrow['currcode'] . '</td> + <td>' . $myrow['requisitionno'] . '</td> + <td>' . $FormatedOrderDate . '</td> + <td>' . $myrow['initiator'] . '</td> + <td class=number>' . $FormatedOrderValue . '</td> + <td>' . _($myrow['status']) . '</td> + </tr>'; //$myrow['status'] is a string which has gettext translations from PO_Header.php script $j++; Modified: trunk/PageSecurity.php =================================================================== --- trunk/PageSecurity.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/PageSecurity.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -40,9 +40,9 @@ echo '<td><select name="'.$myrow['script'].'">'; while ($mytokenrow=DB_fetch_array($TokenResult)) { if ($mytokenrow['tokenid']==$myrow['pagesecurity']) { - echo '<option selected="True" value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname']).'</option>'; + echo '<option selected="True" value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname'], ENT_QUOTES,'UTF-8') .'</option>'; } else { - echo '<option value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname']).'</option>'; + echo '<option value="'.$mytokenrow['tokenid'].'">'.htmlentities($mytokenrow['tokenname'], ENT_QUOTES,'UTF-8') .'</option>'; } } echo '</select></td></tr>'; Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/SelectCreditItems.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -5,8 +5,6 @@ /*The credit selection screen uses the Cart class used for the making up orders some of the variable names refer to order - please think credit when you read order */ -//$PageSecurity = 3; - include('includes/DefineCartClass.php'); include('includes/DefineSerialItems.php'); /* Session started in session.inc for password checking and authorisation level check */ Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/SelectOrderItems.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -660,7 +660,7 @@ } else { echo '<td></td>'; } - echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname']) . '"></td> + echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8'). '"></td> <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'] .' - '.$myrow['branchcode'].'"> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/SelectSalesOrder.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -53,135 +53,153 @@ purchdata.stockid"; $ErrMsg = _('Unable to retrieve the items on the selected orders for creating purchase orders for'); $ItemResult = DB_query($sql,$db,$ErrMsg); + /*Now get the default delivery address details from the users default stock location */ + $sql = "SELECT locationame, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; + $ErrMsg = _('The delivery address for the order could not be obtained from the user default stock location'); + $DelAddResult = DB_query($sql, $db,$ErrMsg); + $DelAddRow = DB_fetch_array($DelAddResult); + $SupplierID = ''; + if (IsEmailAddress($_SESSION['UserEmail'])){ + $UserDetails = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; + } else { + $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; + } + 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 ($SupplierID != $ItemRow['supplierno']){ + /* This order item is purchased from a different supplier so need to finish off the authorisation of the previous order and start a new order */ - 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 />'; + if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { + //if the user has authority to authorise the PO then it should be created as authorised + $AuthSQL ="SELECT authlevel + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$SuppRow['currcode']."'"; + + $AuthResult=DB_query($AuthSQL,$db); + $AuthRow=DB_fetch_array($AuthResult); + + if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; + $result = DB_query("UPDATE purchorders SET allowprint=1, + status='Authorised', + statuscomment='" . $StatusComment . "' + WHERE orderno='" . $OrderNo . "'", + $db); + } else { // no authority to authorise this order + if (DB_num_rows($AuthResult) ==0){ + $AuthMessage = _('Your authority to approve purchase orders in') . ' ' .$SuppRow['currcode'] . ' ' . _('has not yet been set up') . '<br />'; + } else { + $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; + } + + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. + $SuppRow['currcode'] . ' '. $Order_Value .'. '. + $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. + _('The order has been created with a status of pending and will require authorisation'), 'warn'); } - - prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. - $_SESSION['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'; + } //end of authorisation status settings + + if ($SupplierID !=''){ //then we have just added a purchase order + DB_Txn_Commit($db); } - } 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 + /*Starting a new purchase order with a different supplier */ + $result = DB_Txn_Begin($db); + $OrderNo = GetNextTransNo(18, $db); //get the next PO number - /*Get the order number */ - $_SESSION['PO'.$identifier]->OrderNo = GetNextTransNo(18, $db); - + $SupplierID = $ItemRow['supplierno']; + $Order_Value =0; + /*Now get all the required details for the supplier */ + $sql = "SELECT address1, + address2, + address3, + address4, + address5, + address6, + suppliercontact, + telephone, + paymentterms, + currcode, + rate + FROM suppliers INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev + WHERE supplierno='" . $SupplierID . "'"; + + $ErrMsg = _('Could not get the supplier information for the order'); + $SuppResult = DB_query($sql, $db, $ErrMsg); + $SuppRow = DB_fetch_array($SuppResult); + + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; /*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 . "' - )"; + supplierno, + orddate, + rate, + initiator, + intostocklocation, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + suppdeladdress1, + suppdeladdress2, + suppdeladdress3, + suppdeladdress4, + suppdeladdress5, + suppdeladdress6, + supptel, + version, + revised, + deliveryby, + status, + stat_comment, + deliverydate, + paymentterms, + allowprint) + VALUES( '" . $OrderNo . "', + '" . $SupplierID . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['rate'] . "', + '" . $_SESSION['UsersRealName'] . "', + '" . $_SESSION['UserStockLocation'] . "', + '" . $DelAddRow['locationname'] . "', + '" . $DelAddRow['deladd1'] . "', + '" . $DelAddRow['deladd2'] . "', + '" . $DelAddRow['deladd3'] . "', + '" . $DelAddRow['deladd4'] . "', + '" . $DelAddRow['deladd5'] . "', + '" . $DelAddRow['deladd6'] . "', + '" . $DelAddRow['tel'] . "', + '" . $SuppRow['address1'] . "', + '" . $SuppRow['address2'] . "', + '" . $SuppRow['address3'] . "', + '" . $SuppRow['address4'] . "', + '" . $SuppRow['address5'] . "', + '" . $SuppRow['address6'] . "', + '" . $SuppRow['telephone'] . "', + '1.0', + '" . Date('Y-m-d') . "', + '" . $_SESSION['Default_Shipper'] . "', + 'Pending', + '" . $StatusComment . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['paymentterms'] . "', + 0)"; $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'); @@ -191,50 +209,50 @@ 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 . "')"; + 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'); Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/doc/Change.log.html 2011-03-11 20:24:03 UTC (rev 4507) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>12/3/11: Exson fix all htmlentities to use ENTQUOTES, 'UTF-8' option so other character sets work with it</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> Modified: trunk/includes/MiscFunctions.php =================================================================== --- trunk/includes/MiscFunctions.php 2011-03-10 06:24:48 UTC (rev 4506) +++ trunk/includes/MiscFunctions.php 2011-03-11 20:24:03 UTC (rev 4507) @@ -114,8 +114,7 @@ OR strstr($CheckVariable,"\"") OR strstr($CheckVariable,'&') OR strstr($CheckVariable,"\\") - OR strstr($CheckVariable,'"') - OR strstr($CheckVariable,' ')){ + OR strstr($CheckVariable,'"')){ return true; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-13 04:55:39
|
Revision: 4508 http://web-erp.svn.sourceforge.net/web-erp/?rev=4508&view=rev Author: daintree Date: 2011-03-13 04:55:32 +0000 (Sun, 13 Mar 2011) Log Message: ----------- various Modified Paths: -------------- trunk/SelectSalesOrder.php trunk/Stocks.php trunk/SuppPriceList.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/SelectSalesOrder.php 2011-03-13 04:55:32 UTC (rev 4508) @@ -8,10 +8,11 @@ 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 (isset($_POST['PlacePO_' . $i])) { //checkboxes only set if they are checked if ($OrdersToPlacePOFor==''){ $OrdersToPlacePOFor .= ' orderno=' . $_POST['OrderNo_PO_'.$i]; } else { @@ -30,13 +31,17 @@ purchdata.supplierdescription, purchdata.conversionfactor, purchdata.leadtime, + purchdata.suppliersuom, stockmaster.kgs, - stockmaster.cuft - SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS OrderQty + stockmaster.volume, + stockcategory.stockact, + 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 + INNER JOIN stockcategory ON + stockmaster.categoryid = stockcategory.categoryid WHERE purchdata.preferred=1 AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' AND (" . $OrdersToPlacePOFor . ") @@ -47,223 +52,213 @@ purchdata.supplierdescription, purchdata.conversionfactor, purchdata.leadtime, + purchdata.suppliersuom, stockmaster.kgs, - stockmaster.cuft + stockmaster.volume, + stockcategory.stockact 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); - /*Now get the default delivery address details from the users default stock location */ - $sql = "SELECT locationame, - deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - contact - FROM locations - WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; - $ErrMsg = _('The delivery address for the order could not be obtained from the user default stock location'); - $DelAddResult = DB_query($sql, $db,$ErrMsg); - $DelAddRow = DB_fetch_array($DelAddResult); - $SupplierID = ''; - if (IsEmailAddress($_SESSION['UserEmail'])){ - $UserDetails = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; + if (DB_num_rows($ItemResult)==0){ + prnMsg(_('There might be no supplier purchasing data set up for any items on the selected sales order(s). No purchase orders have been created'),'warn'); } else { - $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; - } - - while ($ItemRow = DB_fetch_array($ItemResult)){ + /*Now get the default delivery address details from the users default stock location */ + $sql = "SELECT locationname, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; + $ErrMsg = _('The delivery address for the order could not be obtained from the user default stock location'); + $DelAddResult = DB_query($sql, $db,$ErrMsg); + $DelAddRow = DB_fetch_array($DelAddResult); - if ($SupplierID != $ItemRow['supplierno']){ - /* This order item is purchased from a different supplier so need to finish off the authorisation of the previous order and start a new order */ + $SupplierID = ''; + if (IsEmailAddress($_SESSION['UserEmail'])){ + $UserDetails = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; + } else { + $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; + } + + while ($ItemRow = DB_fetch_array($ItemResult)){ - if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { - //if the user has authority to authorise the PO then it should be created as authorised - $AuthSQL ="SELECT authlevel - FROM purchorderauth - WHERE userid='".$_SESSION['UserID']."' - AND currabrev='".$SuppRow['currcode']."'"; - - $AuthResult=DB_query($AuthSQL,$db); - $AuthRow=DB_fetch_array($AuthResult); - - if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; - $result = DB_query("UPDATE purchorders SET allowprint=1, - status='Authorised', - statuscomment='" . $StatusComment . "' - WHERE orderno='" . $OrderNo . "'", - $db); - } else { // no authority to authorise this order - if (DB_num_rows($AuthResult) ==0){ - $AuthMessage = _('Your authority to approve purchase orders in') . ' ' .$SuppRow['currcode'] . ' ' . _('has not yet been set up') . '<br />'; - } else { - $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; + if ($SupplierID != $ItemRow['supplierno']){ + /* This order item is purchased from a different supplier so need to finish off the authorisation of the previous order and start a new order */ + + if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { + //if the user has authority to authorise the PO then it should be created as authorised + $AuthSQL ="SELECT authlevel + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$SuppRow['currcode']."'"; + + $AuthResult=DB_query($AuthSQL,$db); + $AuthRow=DB_fetch_array($AuthResult); + + if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; + $result = DB_query("UPDATE purchorders SET allowprint=1, + status='Authorised', + statuscomment='" . $StatusComment . "' + WHERE orderno='" . $OrderNo . "'", + $db); + } else { // no authority to authorise this order + if (DB_num_rows($AuthResult) ==0){ + $AuthMessage = _('Your authority to approve purchase orders in') . ' ' .$SuppRow['currcode'] . ' ' . _('has not yet been set up') . '<br />'; + } else { + $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; + } + + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. + $SuppRow['currcode'] . ' '. $Order_Value .'. '. + $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. + _('The order has been created with a status of pending and will require authorisation'), 'warn'); } + } //end of authorisation status settings - prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. - $SuppRow['currcode'] . ' '. $Order_Value .'. '. - $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. - _('The order has been created with a status of pending and will require authorisation'), 'warn'); + if ($SupplierID !=''){ //then we have just added a purchase order + echo '<p>'; + prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $ItemRow['supplierno'] . ' ' . _('has been created'),'success'); + DB_Txn_Commit($db); } - } //end of authorisation status settings + /*Starting a new purchase order with a different supplier */ + $result = DB_Txn_Begin($db); + include('includes/SQL_CommonFunctions.inc'); + $PO_OrderNo = GetNextTransNo(18, $db); //get the next PO number + + $SupplierID = $ItemRow['supplierno']; + $Order_Value =0; + /*Now get all the required details for the supplier */ + $sql = "SELECT address1, + address2, + address3, + address4, + address5, + address6, + telephone, + paymentterms, + currcode, + rate + FROM suppliers INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev + WHERE supplierid='" . $SupplierID . "'"; + + $ErrMsg = _('Could not get the supplier information for the order'); + $SuppResult = DB_query($sql, $db, $ErrMsg); + $SuppRow = DB_fetch_array($SuppResult); + + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . ' ' . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; + /*Insert to purchase order header record */ + $sql = "INSERT INTO purchorders ( orderno, + supplierno, + orddate, + rate, + initiator, + intostocklocation, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + suppdeladdress1, + suppdeladdress2, + suppdeladdress3, + suppdeladdress4, + suppdeladdress5, + suppdeladdress6, + supptel, + version, + revised, + deliveryby, + status, + stat_comment, + deliverydate, + paymentterms, + allowprint) + VALUES( '" . $PO_OrderNo . "', + '" . $SupplierID . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['rate'] . "', + '" . $_SESSION['UsersRealName'] . "', + '" . $_SESSION['UserStockLocation'] . "', + '" . $DelAddRow['locationname'] . "', + '" . $DelAddRow['deladd1'] . "', + '" . $DelAddRow['deladd2'] . "', + '" . $DelAddRow['deladd3'] . "', + '" . $DelAddRow['deladd4'] . "', + '" . $DelAddRow['deladd5'] . ' ' . $DelAddRow['deladd6'] . "', + '" . $DelAddRow['tel'] . "', + '" . $SuppRow['address1'] . "', + '" . $SuppRow['address2'] . "', + '" . $SuppRow['address3'] . "', + '" . $SuppRow['address4'] . "', + '" . $SuppRow['address5'] . "', + '" . $SuppRow['address6'] . "', + '" . $SuppRow['telephone'] . "', + '1.0', + '" . Date('Y-m-d') . "', + '" . $_SESSION['Default_Shipper'] . "', + 'Pending', + '" . $StatusComment . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['paymentterms'] . "', + 0)"; + + $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); + } //end if it's a new supplier and PO to create - if ($SupplierID !=''){ //then we have just added a purchase order - DB_Txn_Commit($db); - } - /*Starting a new purchase order with a different supplier */ - $result = DB_Txn_Begin($db); - $OrderNo = GetNextTransNo(18, $db); //get the next PO number + /*reminder we are in a loop of the total of each item to place a purchase order for based on a selection of sales orders */ + $DeliveryDate = DateAdd(Date($_SESSION['DefaultDateFormat']),'d',$ItemRow['leadtime']); + $sql = "INSERT INTO purchorderdetails ( orderno, + itemcode, + deliverydate, + itemdescription, + glcode, + unitprice, + quantityord, + suppliersunit, + suppliers_partno, + kgs, + cuft, + conversionfactor ) + VALUES ( + '" . $PO_OrderNo . "', + '" . $ItemRow['stockid'] . "', + '" . FormatDateForSQL($DeliveryDate) . "', + '" . $ItemRow['suppliers_partno'] . ' ' . $ItemRow['supplierdescription'] . "', + '" . $ItemRow['stockact'] . "', + '" . $ItemRow['price'] . "', + '" . $ItemRow['orderqty'] . "', + '" . $ItemRow['suppliersuom'] . "', + '" . $ItemRow['suppliers_partno'] . "', + '" . $ItemRow['kgs'] . "', + '" . $ItemRow['volume'] . "', + '" . $ItemRow['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'); - $SupplierID = $ItemRow['supplierno']; - $Order_Value =0; - /*Now get all the required details for the supplier */ - $sql = "SELECT address1, - address2, - address3, - address4, - address5, - address6, - suppliercontact, - telephone, - paymentterms, - currcode, - rate - FROM suppliers INNER JOIN currencies - ON suppliers.currcode = currencies.currabrev - WHERE supplierno='" . $SupplierID . "'"; - - $ErrMsg = _('Could not get the supplier information for the order'); - $SuppResult = DB_query($sql, $db, $ErrMsg); - $SuppRow = DB_fetch_array($SuppResult); - - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; - /*Insert to purchase order header record */ - $sql = "INSERT INTO purchorders ( orderno, - supplierno, - orddate, - rate, - initiator, - intostocklocation, - deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - suppdeladdress1, - suppdeladdress2, - suppdeladdress3, - suppdeladdress4, - suppdeladdress5, - suppdeladdress6, - supptel, - version, - revised, - deliveryby, - status, - stat_comment, - deliverydate, - paymentterms, - allowprint) - VALUES( '" . $OrderNo . "', - '" . $SupplierID . "', - '" . Date('Y-m-d') . "', - '" . $SuppRow['rate'] . "', - '" . $_SESSION['UsersRealName'] . "', - '" . $_SESSION['UserStockLocation'] . "', - '" . $DelAddRow['locationname'] . "', - '" . $DelAddRow['deladd1'] . "', - '" . $DelAddRow['deladd2'] . "', - '" . $DelAddRow['deladd3'] . "', - '" . $DelAddRow['deladd4'] . "', - '" . $DelAddRow['deladd5'] . "', - '" . $DelAddRow['deladd6'] . "', - '" . $DelAddRow['tel'] . "', - '" . $SuppRow['address1'] . "', - '" . $SuppRow['address2'] . "', - '" . $SuppRow['address3'] . "', - '" . $SuppRow['address4'] . "', - '" . $SuppRow['address5'] . "', - '" . $SuppRow['address6'] . "', - '" . $SuppRow['telephone'] . "', - '1.0', - '" . Date('Y-m-d') . "', - '" . $_SESSION['Default_Shipper'] . "', - 'Pending', - '" . $StatusComment . "', - '" . Date('Y-m-d') . "', - '" . $SuppRow['paymentterms'] . "', - 0)"; - - $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 */ + $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + $Order_Value += ($ItemRow['price']*$ItemRow['orderqty']); + } /* end of the loop round the items on the sales order that we wish to place purchase orders for */ + if ($SupplierID !=''){ //then we have just added a purchase order echo '<p>'; - prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' . - $_SESSION['PO'.$identifier]->SupplierName . ' ' . _('has been created'),'success'); - } - } + prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $ItemRow['supplierno'] . ' ' . _('has been created'),'success'); + DB_Txn_Commit($db); + } + $result = DB_query("UPDATE salesorders SET poplaced=1 WHERE " . $OrdersToPlacePOFor,$db); + }/*There were items that had purchasing data set up to create POs for */ + } /* there were sales orders checked to place POs for */ }/*end of purchase order creation code */ /* ******************************************************************************************* */ @@ -389,14 +384,14 @@ while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation'])){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo "<option selected Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']. '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo "<option selected Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']. '</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']. '</option>'; } } @@ -416,7 +411,7 @@ } echo '</select> </td><td>'; - echo "<input type=submit name='SearchOrders' VALUE='" . _('Search') . "'></td>"; + echo '<input type=submit name="SearchOrders" VALUE="' . _('Search') . '"></td>'; echo ' <td><a href="' . $rootpath . '/SelectOrderItems.php?' . SID . '&NewOrder=Yes">' . _('Add Sales Order') . '</a></td></tr></table>'; } @@ -428,16 +423,15 @@ $result1 = DB_query($SQL,$db); - echo "</font>"; - echo "<br /><table class=selection>"; + echo '<br /><table class="selection">'; echo '<tr><th colspan=6><font size=3 color=navy>' . _('To search for sales orders for a specific part use the part selection facilities below'); echo '</th></tr>'; - echo "<tr> - <td><font size=1>" . _('Select a stock category') . ":</font> - <select name='StockCat'>"; + echo '<tr> + <td><font size="1">' . _('Select a stock category') . ':</font> + <select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { - echo "<option VALUE='". $myrow1['categoryid'] . "'>" . $myrow1['categorydescription']; + echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } echo '</select> @@ -455,12 +449,12 @@ if (isset($StockItemsResult) and DB_num_rows($StockItemsResult)>0) { echo '<table cellpadding=2 colspan=7 class=selection>'; - $TableHeader = "<tr> - <th>" . _('Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('On Hand') . "</th> - <th>" . _('Units') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeader; $j = 1; @@ -502,7 +496,7 @@ else { //figure out the SQL required from the inputs available - if (isset($_POST['Quotations']) and $_POST['Quotations']=='Orders_Only'){ + if (isset($_POST['Quotations']) AND $_POST['Quotations']=='Orders_Only'){ $Quotations = 0; } else { $Quotations =1; @@ -519,6 +513,7 @@ salesorders.deliverydate, salesorders.deliverto, salesorders.printedpackingslip, + salesorders.poplaced, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue FROM salesorders, salesorderdetails, @@ -553,7 +548,8 @@ salesorders.orddate, salesorders.deliverydate, salesorders.deliverto, - salesorders.printedpackingslip, + salesorders.printedpackingslip, + salesorders.poplaced, salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent) AS ordervalue FROM salesorders, salesorderdetails, @@ -578,7 +574,8 @@ salesorders.customerref, salesorders.orddate, salesorders.deliverto, - salesorders.printedpackingslip, + salesorders.printedpackingslip, + salesorders.poplaced, salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue FROM salesorders, salesorderdetails, @@ -612,6 +609,7 @@ salesorders.orddate, salesorders.deliverto, salesorders.printedpackingslip, + salesorders.poplaced, salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue FROM salesorders, salesorderdetails, @@ -642,7 +640,8 @@ salesorders.orddate, salesorders.deliverto, salesorders.deliverydate, - salesorders.printedpackingslip, + salesorders.printedpackingslip, + salesorders.poplaced, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue FROM salesorders, salesorderdetails, @@ -676,9 +675,9 @@ if (DB_num_rows($SalesOrdersResult)>0) { /* Get users authority to place POs */ - $AuthSql="SELECT cancreate - FROM purchorderauth - WHERE userid='". $_SESSION['UserID'] . "'"; + $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); @@ -718,7 +717,7 @@ } echo $tableheader; - } + $i = 1; $j = 1; $k=0; //row colour counter @@ -733,120 +732,120 @@ $k++; } - $ModifyPage = $rootpath . "/SelectOrderItems.php?" . SID . '&ModifyOrderNumber=' . $myrow['orderno']; - $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?' . SID . '&OrderNumber=' .$myrow['orderno']; - - if ($_SESSION['PackNoteFormat']==1){ /*Laser printed A4 default */ - $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; - } else { /*pre-printed stationery default */ - $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $myrow['orderno']; + $ModifyPage = $rootpath . "/SelectOrderItems.php?" . SID . '&ModifyOrderNumber=' . $myrow['orderno']; + $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?' . SID . '&OrderNumber=' .$myrow['orderno']; + + if ($_SESSION['PackNoteFormat']==1){ /*Laser printed A4 default */ + $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; + } else { /*pre-printed stationery default */ + $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $myrow['orderno']; + } + $PrintSalesOrder = $rootpath . '/PrintSalesOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; + $PrintQuotation = $rootpath . '/PDFQuotation.php?' . SID . '&QuotationNo=' . $myrow['orderno']; + $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); + $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); + $FormatedOrderValue = number_format($myrow['ordervalue'],2); + + if ($myrow['printedpackingslip']==0) { + $PrintText = _('Print'); + } else { + $PrintText = _('Reprint'); + } + + if ($_POST['Quotations']=='Orders_Only'){ + + /*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 AND $myrow['poplaced']==0){ //cancreate==0 if the user can create POs and not already placed + 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 value><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> + <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'], + $PrintQuotation, + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedOrderDate, + $FormatedDelDate, + $myrow['deliverto'], + $FormatedOrderValue); + } + $i++; + $j++; + if ($j == 12){ + $j=1; + echo $tableheader; + } + //end of page full new headings if + }//end while loop through orders to display + 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>'; } - $PrintSalesOrder = $rootpath . '/PrintSalesOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; - $PrintQuotation = $rootpath . '/PDFQuotation.php?' . SID . '&QuotationNo=' . $myrow['orderno']; - $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); - $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); - $FormatedOrderValue = number_format($myrow['ordervalue'],2); - - if ($myrow['printedpackingslip']==0) { - $PrintText = _('Print'); - } else { - $PrintText = _('Reprint'); - } - - if ($_POST['Quotations']=='Orders_Only'){ - - /*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> - <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'], - $PrintQuotation, - $myrow['name'], - $myrow['brname'], - $myrow['customerref'], - $FormatedOrderDate, - $FormatedDelDate, - $myrow['deliverto'], - $FormatedOrderValue); - } - $i++; - $j++; - if ($j == 12){ - $j=1; - echo $tableheader; - } - //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>'; + echo '</table>'; + } //end if there are some orders to show } ?> Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/Stocks.php 2011-03-13 04:55:32 UTC (rev 4508) @@ -477,7 +477,7 @@ prnMsg( _('Cannot delete this item record because there are bills of material that require this part as a component'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('bills of material that require this part as a component'); } else { - $sql= "SELECT COUNT(*) FROM salesorderdetails WHERE stkcode='".$StockID."' GROUP BY stockid"; + $sql= "SELECT COUNT(*) FROM salesorderdetails WHERE stkcode='".$StockID."' GROUP BY stkcode"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -493,7 +493,7 @@ prnMsg(_('Cannot delete this item because sales analysis records exist for it'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records against this part'); } else { - $sql= "SELECT COUNT(*) FROM purchorderdetails WHERE itemcode='".$StockID."' GROUP BY stockid"; + $sql= "SELECT COUNT(*) FROM purchorderdetails WHERE itemcode='".$StockID."' GROUP BY itemcode"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { Modified: trunk/SuppPriceList.php =================================================================== --- trunk/SuppPriceList.php 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/SuppPriceList.php 2011-03-13 04:55:32 UTC (rev 4508) @@ -21,10 +21,11 @@ $line_height=12; //get supplier - $sqlsup = "SELECT suppname FROM suppliers where supplierid='" . $_POST['supplier'] . "'"; + $sqlsup = "SELECT suppname, currcode FROM suppliers where supplierid='" . $_POST['supplier'] . "'"; $resultsup = db_query($sqlsup,$db); - $RowSup = db_fetch_row($resultsup); - $Supp=$RowSup['0']; + $RowSup = db_fetch_array($resultsup); + $SupplierName=$RowSup['suppname']; + $CurrCode =$RowSup['currcode']; //get category if ($_POST['category']!="all"){ @@ -36,26 +37,22 @@ $Categoryname="ALL"; } - //get currency - $sqlcur="SELECT currcode FROM `suppliers` where supplierid='" . $_POST['supplier'] . "'"; - $resultcur = db_query($sqlcur,$db); - $RowCur = db_fetch_row($resultcur); - $Currency=$RowCur['0']; - + //get date price - if ($_POST['price']=="all"){ - $DatePrice=_('All Price'); + if ($_POST['price']=='all'){ + $DatePrice=_('All Prices'); } else { $DatePrice=_('Current Price'); } //price and category = all - if (($_POST['price']=="all")and($_POST['category']=="all")){ + if (($_POST['price']=='all')and($_POST['category']=='all')){ $sql = "SELECT purchdata.stockid, stockmaster.description, purchdata.price, (purchdata.effectivefrom)as dateprice, - purchdata.supplierdescription + purchdata.supplierdescription, + purchdata.suppliers_partno FROM purchdata,stockmaster WHERE supplierno='" . $_POST['supplier'] . "' AND stockmaster.stockid=purchdata.stockid @@ -72,7 +69,8 @@ WHERE purchdata.stockid = stockmaster.stockid ORDER BY effectivefrom DESC LIMIT 0,1) AS dateprice, - purchdata.supplierdescription + purchdata.supplierdescription, + purchdata.suppliers_partno FROM purchdata, stockmaster WHERE supplierno = '" . $_POST['supplier'] . "' AND stockmaster.stockid = purchdata.stockid @@ -86,7 +84,8 @@ stockmaster.description, purchdata.price, (purchdata.effectivefrom)as dateprice, - purchdata.supplierdescription + purchdata.supplierdescription, + purchdata.suppliers_partno FROM purchdata,stockmaster WHERE supplierno='" . $_POST['supplier'] . "' AND stockmaster.stockid=purchdata.stockid @@ -102,7 +101,8 @@ WHERE purchdata.stockid = stockmaster.stockid ORDER BY effectivefrom DESC LIMIT 0,1) AS dateprice, - purchdata.supplierdescription + purchdata.supplierdescription, + purchdata.suppliers_partno FROM purchdata,stockmaster WHERE supplierno='" . $_POST['supplier'] . "' AND stockmaster.stockid=purchdata.stockid @@ -127,7 +127,7 @@ } PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$Supp,$Categoryname,$Currency,$DatePrice); + $Page_Width,$Right_Margin,$SupplierName,$Categoryname,$CurrCode,$DatePrice); $FontSize=8; $code=''; @@ -148,26 +148,26 @@ $dateprice=date($_SESSION['DefaultDateFormat'], mktime(0,0,0,$DateArray[1],$DateArray[2],$DateArray[0])); //if item has more than 1 price, write only price, date and supplier code for the old ones - if ($code==$myrow[0]){ + if ($code==$myrow['stockid']){ - $pdf->addTextWrap(350,$YPos,50,$FontSize,number_format($myrow[2],2),'right'); + $pdf->addTextWrap(350,$YPos,50,$FontSize,number_format($myrow['price'],2),'right'); $pdf->addTextWrap(430,$YPos,50,$FontSize,$dateprice,'left'); - $pdf->addTextWrap(510,$YPos,40,$FontSize,$myrow[4],'left'); - $code=$myrow[0]; + $pdf->addTextWrap(510,$YPos,40,$FontSize,$myrow['suppliers_partno'],'left'); + $code=$myrow['stockid']; } else { - $code=$myrow[0]; - $pdf->addTextWrap(50,$YPos,90,$FontSize,$myrow[0],'left'); - $pdf->addTextWrap(145,$YPos,215,$FontSize,$myrow[1],'left'); - $pdf->addTextWrap(350,$YPos,50,$FontSize,number_format($myrow[2],2),'right'); + $code=$myrow['stockid']; + $pdf->addTextWrap(50,$YPos,90,$FontSize,$myrow['stockid'],'left'); + $pdf->addTextWrap(145,$YPos,215,$FontSize,$myrow['description'],'left'); + $pdf->addTextWrap(350,$YPos,50,$FontSize,number_format($myrow['price'],2),'right'); $pdf->addTextWrap(430,$YPos,50,$FontSize,$dateprice,'left'); - $pdf->addTextWrap(510,$YPos,40,$FontSize,$myrow[4],'left'); + $pdf->addTextWrap(510,$YPos,40,$FontSize,$myrow['suppliers_partno'],'left'); } if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$Supp,$Categoryname,$Currency,$DatePrice); + $Right_Margin,$SupplierName,$Categoryname,$CurrCode,$DatePrice); } @@ -176,22 +176,13 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$Supp,$Categoryname,$Currency,$DatePrice); + $Right_Margin,$SupplierName,$Categoryname,$CurrCode,$DatePrice); } + + $pdf->OutputD( $_SESSION['DatabaseName'] . '_SupplierPriceList_' . Date('Y-m-d') . '.pdf'); + - $pdfcode = $pdf->output(); - - header('Content-type: application/pdf'); - header("Content-Length: " . $len); - header('Content-Disposition: inline; filename=Supplier Price List.pdf'); - header('Expires: 0'); - header('Cache-Control: private, post-check=0, pre-check=0'); - header('Pragma: public'); - $pdf->Output('SuppPriceList.pdf', 'I'); - - - } else { /*The option to print PDF was not hit so display form */ $title=_('Supplier Price List'); @@ -229,8 +220,8 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Price List') . ':</td><td><select name="price"> '; - echo '<option Value="all">' ._('All Prices').''; - echo '<option Value="current">' ._('Only Current Price').''; + echo '<option Value="all">' ._('All Prices').'</option>'; + echo '<option Value="current">' ._('Only Current Price').'</option>'; echo '</select></td></tr>'; @@ -243,7 +234,7 @@ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$Supp,$Categoryname,$Currency,$DatePrice) { + $Page_Width,$Right_Margin,$SupplierName,$Categoryname,$CurrCode,$DatePrice) { /*PDF page header for Supplier price list */ @@ -264,7 +255,7 @@ Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left'); $YPos -= $line_height; $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Supplier').' '); - $pdf->addTextWrap(95,$YPos,150,$FontSize,_(': ').$Supp); + $pdf->addTextWrap(95,$YPos,150,$FontSize,_(': ').$SupplierName); $YPos -= $line_height; $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Category').' '); @@ -272,7 +263,7 @@ $pdf->addTextWrap(95,$YPos,150,$FontSize,_(': ').$Categoryname); $YPos -= $line_height; $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Currency').' '); - $pdf->addTextWrap(95,$YPos,50,$FontSize,_(': ').$Currency); + $pdf->addTextWrap(95,$YPos,50,$FontSize,_(': ').$CurrCode); $YPos -=(2*$line_height); /*set up the headings */ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/doc/Change.log.html 2011-03-13 04:55:32 UTC (rev 4508) @@ -1,5 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>12/3/11: SelectSalesOrder.php now allows any number of sales orders to be selected and purchase orders placed for the aggregate of items on the selected sales orders</p> +<p>12/3/11: SuppPriceList.php removed a round trip to DB to get currency - fixed function to get pdf to new TCPDF Output </p> <p>12/3/11: Exson fix all htmlentities to use ENTQUOTES, 'UTF-8' option so other character sets work with it</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> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/includes/ConnectDB.inc 2011-03-13 04:55:32 UTC (rev 4508) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03'; //must update manually every time there is a DB change +$Version='4.03.2'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-13 04:55:32 UTC (rev 4508) @@ -816,4 +816,18 @@ UPDATE config SET confvalue='3.12.31' WHERE confname='VersionNumber'; INSERT INTO config (`confname`, `confvalue`) VALUES ('AutoAuthorisePO', '1'); UPDATE config SET confvalue='4.03' WHERE confname='VersionNumber'; +ALTER TABLE `salesorders` ADD `poplaced` TINYINT NOT NULL DEFAULT '0', +ADD INDEX ( `poplaced` ); +UPDATE config SET confvalue='4.03.1' WHERE confname='VersionNumber'; +CREATE TABLE IF NOT EXISTS `fixedassetlocations` ( + `locationid` char(6) NOT NULL DEFAULT '', + `locationdescription` char(20) NOT NULL DEFAULT '', + `parentlocationid` char(6) DEFAULT '', + PRIMARY KEY (`locationid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +INSERT INTO `fixedassetlocations` (`locationid`, `locationdescription`, `parentlocationid`) VALUES +('HEADOF', 'Head Office', ''); +UPDATE config SET confvalue='4.03.2' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-13 04:55:40
|
Revision: 4508 http://web-erp.svn.sourceforge.net/web-erp/?rev=4508&view=rev Author: daintree Date: 2011-03-13 04:55:32 +0000 (Sun, 13 Mar 2011) Log Message: ----------- various Modified Paths: -------------- trunk/SelectSalesOrder.php trunk/Stocks.php trunk/SuppPriceList.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/SelectSalesOrder.php 2011-03-13 04:55:32 UTC (rev 4508) @@ -8,10 +8,11 @@ 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 (isset($_POST['PlacePO_' . $i])) { //checkboxes only set if they are checked if ($OrdersToPlacePOFor==''){ $OrdersToPlacePOFor .= ' orderno=' . $_POST['OrderNo_PO_'.$i]; } else { @@ -30,13 +31,17 @@ purchdata.supplierdescription, purchdata.conversionfactor, purchdata.leadtime, + purchdata.suppliersuom, stockmaster.kgs, - stockmaster.cuft - SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS OrderQty + stockmaster.volume, + stockcategory.stockact, + 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 + INNER JOIN stockcategory ON + stockmaster.categoryid = stockcategory.categoryid WHERE purchdata.preferred=1 AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' AND (" . $OrdersToPlacePOFor . ") @@ -47,223 +52,213 @@ purchdata.supplierdescription, purchdata.conversionfactor, purchdata.leadtime, + purchdata.suppliersuom, stockmaster.kgs, - stockmaster.cuft + stockmaster.volume, + stockcategory.stockact 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); - /*Now get the default delivery address details from the users default stock location */ - $sql = "SELECT locationame, - deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - contact - FROM locations - WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; - $ErrMsg = _('The delivery address for the order could not be obtained from the user default stock location'); - $DelAddResult = DB_query($sql, $db,$ErrMsg); - $DelAddRow = DB_fetch_array($DelAddResult); - $SupplierID = ''; - if (IsEmailAddress($_SESSION['UserEmail'])){ - $UserDetails = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; + if (DB_num_rows($ItemResult)==0){ + prnMsg(_('There might be no supplier purchasing data set up for any items on the selected sales order(s). No purchase orders have been created'),'warn'); } else { - $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; - } - - while ($ItemRow = DB_fetch_array($ItemResult)){ + /*Now get the default delivery address details from the users default stock location */ + $sql = "SELECT locationname, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; + $ErrMsg = _('The delivery address for the order could not be obtained from the user default stock location'); + $DelAddResult = DB_query($sql, $db,$ErrMsg); + $DelAddRow = DB_fetch_array($DelAddResult); - if ($SupplierID != $ItemRow['supplierno']){ - /* This order item is purchased from a different supplier so need to finish off the authorisation of the previous order and start a new order */ + $SupplierID = ''; + if (IsEmailAddress($_SESSION['UserEmail'])){ + $UserDetails = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; + } else { + $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; + } + + while ($ItemRow = DB_fetch_array($ItemResult)){ - if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { - //if the user has authority to authorise the PO then it should be created as authorised - $AuthSQL ="SELECT authlevel - FROM purchorderauth - WHERE userid='".$_SESSION['UserID']."' - AND currabrev='".$SuppRow['currcode']."'"; - - $AuthResult=DB_query($AuthSQL,$db); - $AuthRow=DB_fetch_array($AuthResult); - - if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; - $result = DB_query("UPDATE purchorders SET allowprint=1, - status='Authorised', - statuscomment='" . $StatusComment . "' - WHERE orderno='" . $OrderNo . "'", - $db); - } else { // no authority to authorise this order - if (DB_num_rows($AuthResult) ==0){ - $AuthMessage = _('Your authority to approve purchase orders in') . ' ' .$SuppRow['currcode'] . ' ' . _('has not yet been set up') . '<br />'; - } else { - $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; + if ($SupplierID != $ItemRow['supplierno']){ + /* This order item is purchased from a different supplier so need to finish off the authorisation of the previous order and start a new order */ + + if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { + //if the user has authority to authorise the PO then it should be created as authorised + $AuthSQL ="SELECT authlevel + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$SuppRow['currcode']."'"; + + $AuthResult=DB_query($AuthSQL,$db); + $AuthRow=DB_fetch_array($AuthResult); + + if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; + $result = DB_query("UPDATE purchorders SET allowprint=1, + status='Authorised', + statuscomment='" . $StatusComment . "' + WHERE orderno='" . $OrderNo . "'", + $db); + } else { // no authority to authorise this order + if (DB_num_rows($AuthResult) ==0){ + $AuthMessage = _('Your authority to approve purchase orders in') . ' ' .$SuppRow['currcode'] . ' ' . _('has not yet been set up') . '<br />'; + } else { + $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; + } + + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. + $SuppRow['currcode'] . ' '. $Order_Value .'. '. + $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. + _('The order has been created with a status of pending and will require authorisation'), 'warn'); } + } //end of authorisation status settings - prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. - $SuppRow['currcode'] . ' '. $Order_Value .'. '. - $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. - _('The order has been created with a status of pending and will require authorisation'), 'warn'); + if ($SupplierID !=''){ //then we have just added a purchase order + echo '<p>'; + prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $ItemRow['supplierno'] . ' ' . _('has been created'),'success'); + DB_Txn_Commit($db); } - } //end of authorisation status settings + /*Starting a new purchase order with a different supplier */ + $result = DB_Txn_Begin($db); + include('includes/SQL_CommonFunctions.inc'); + $PO_OrderNo = GetNextTransNo(18, $db); //get the next PO number + + $SupplierID = $ItemRow['supplierno']; + $Order_Value =0; + /*Now get all the required details for the supplier */ + $sql = "SELECT address1, + address2, + address3, + address4, + address5, + address6, + telephone, + paymentterms, + currcode, + rate + FROM suppliers INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev + WHERE supplierid='" . $SupplierID . "'"; + + $ErrMsg = _('Could not get the supplier information for the order'); + $SuppResult = DB_query($sql, $db, $ErrMsg); + $SuppRow = DB_fetch_array($SuppResult); + + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . ' ' . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; + /*Insert to purchase order header record */ + $sql = "INSERT INTO purchorders ( orderno, + supplierno, + orddate, + rate, + initiator, + intostocklocation, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + suppdeladdress1, + suppdeladdress2, + suppdeladdress3, + suppdeladdress4, + suppdeladdress5, + suppdeladdress6, + supptel, + version, + revised, + deliveryby, + status, + stat_comment, + deliverydate, + paymentterms, + allowprint) + VALUES( '" . $PO_OrderNo . "', + '" . $SupplierID . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['rate'] . "', + '" . $_SESSION['UsersRealName'] . "', + '" . $_SESSION['UserStockLocation'] . "', + '" . $DelAddRow['locationname'] . "', + '" . $DelAddRow['deladd1'] . "', + '" . $DelAddRow['deladd2'] . "', + '" . $DelAddRow['deladd3'] . "', + '" . $DelAddRow['deladd4'] . "', + '" . $DelAddRow['deladd5'] . ' ' . $DelAddRow['deladd6'] . "', + '" . $DelAddRow['tel'] . "', + '" . $SuppRow['address1'] . "', + '" . $SuppRow['address2'] . "', + '" . $SuppRow['address3'] . "', + '" . $SuppRow['address4'] . "', + '" . $SuppRow['address5'] . "', + '" . $SuppRow['address6'] . "', + '" . $SuppRow['telephone'] . "', + '1.0', + '" . Date('Y-m-d') . "', + '" . $_SESSION['Default_Shipper'] . "', + 'Pending', + '" . $StatusComment . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['paymentterms'] . "', + 0)"; + + $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); + } //end if it's a new supplier and PO to create - if ($SupplierID !=''){ //then we have just added a purchase order - DB_Txn_Commit($db); - } - /*Starting a new purchase order with a different supplier */ - $result = DB_Txn_Begin($db); - $OrderNo = GetNextTransNo(18, $db); //get the next PO number + /*reminder we are in a loop of the total of each item to place a purchase order for based on a selection of sales orders */ + $DeliveryDate = DateAdd(Date($_SESSION['DefaultDateFormat']),'d',$ItemRow['leadtime']); + $sql = "INSERT INTO purchorderdetails ( orderno, + itemcode, + deliverydate, + itemdescription, + glcode, + unitprice, + quantityord, + suppliersunit, + suppliers_partno, + kgs, + cuft, + conversionfactor ) + VALUES ( + '" . $PO_OrderNo . "', + '" . $ItemRow['stockid'] . "', + '" . FormatDateForSQL($DeliveryDate) . "', + '" . $ItemRow['suppliers_partno'] . ' ' . $ItemRow['supplierdescription'] . "', + '" . $ItemRow['stockact'] . "', + '" . $ItemRow['price'] . "', + '" . $ItemRow['orderqty'] . "', + '" . $ItemRow['suppliersuom'] . "', + '" . $ItemRow['suppliers_partno'] . "', + '" . $ItemRow['kgs'] . "', + '" . $ItemRow['volume'] . "', + '" . $ItemRow['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'); - $SupplierID = $ItemRow['supplierno']; - $Order_Value =0; - /*Now get all the required details for the supplier */ - $sql = "SELECT address1, - address2, - address3, - address4, - address5, - address6, - suppliercontact, - telephone, - paymentterms, - currcode, - rate - FROM suppliers INNER JOIN currencies - ON suppliers.currcode = currencies.currabrev - WHERE supplierno='" . $SupplierID . "'"; - - $ErrMsg = _('Could not get the supplier information for the order'); - $SuppResult = DB_query($sql, $db, $ErrMsg); - $SuppRow = DB_fetch_array($SuppResult); - - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; - /*Insert to purchase order header record */ - $sql = "INSERT INTO purchorders ( orderno, - supplierno, - orddate, - rate, - initiator, - intostocklocation, - deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - suppdeladdress1, - suppdeladdress2, - suppdeladdress3, - suppdeladdress4, - suppdeladdress5, - suppdeladdress6, - supptel, - version, - revised, - deliveryby, - status, - stat_comment, - deliverydate, - paymentterms, - allowprint) - VALUES( '" . $OrderNo . "', - '" . $SupplierID . "', - '" . Date('Y-m-d') . "', - '" . $SuppRow['rate'] . "', - '" . $_SESSION['UsersRealName'] . "', - '" . $_SESSION['UserStockLocation'] . "', - '" . $DelAddRow['locationname'] . "', - '" . $DelAddRow['deladd1'] . "', - '" . $DelAddRow['deladd2'] . "', - '" . $DelAddRow['deladd3'] . "', - '" . $DelAddRow['deladd4'] . "', - '" . $DelAddRow['deladd5'] . "', - '" . $DelAddRow['deladd6'] . "', - '" . $DelAddRow['tel'] . "', - '" . $SuppRow['address1'] . "', - '" . $SuppRow['address2'] . "', - '" . $SuppRow['address3'] . "', - '" . $SuppRow['address4'] . "', - '" . $SuppRow['address5'] . "', - '" . $SuppRow['address6'] . "', - '" . $SuppRow['telephone'] . "', - '1.0', - '" . Date('Y-m-d') . "', - '" . $_SESSION['Default_Shipper'] . "', - 'Pending', - '" . $StatusComment . "', - '" . Date('Y-m-d') . "', - '" . $SuppRow['paymentterms'] . "', - 0)"; - - $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 */ + $result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true); + $Order_Value += ($ItemRow['price']*$ItemRow['orderqty']); + } /* end of the loop round the items on the sales order that we wish to place purchase orders for */ + if ($SupplierID !=''){ //then we have just added a purchase order echo '<p>'; - prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' . - $_SESSION['PO'.$identifier]->SupplierName . ' ' . _('has been created'),'success'); - } - } + prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $ItemRow['supplierno'] . ' ' . _('has been created'),'success'); + DB_Txn_Commit($db); + } + $result = DB_query("UPDATE salesorders SET poplaced=1 WHERE " . $OrdersToPlacePOFor,$db); + }/*There were items that had purchasing data set up to create POs for */ + } /* there were sales orders checked to place POs for */ }/*end of purchase order creation code */ /* ******************************************************************************************* */ @@ -389,14 +384,14 @@ while ($myrow=DB_fetch_array($resultStkLocs)){ if (isset($_POST['StockLocation'])){ if ($myrow['loccode'] == $_POST['StockLocation']){ - echo "<option selected Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']. '</option>'; } } elseif ($myrow['loccode']==$_SESSION['UserStockLocation']){ - echo "<option selected Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option selected Value="' . $myrow['loccode'] . '">' . $myrow['locationname']. '</option>'; } else { - echo "<option Value='" . $myrow['loccode'] . "'>" . $myrow['locationname']; + echo '<option Value="' . $myrow['loccode'] . '">' . $myrow['locationname']. '</option>'; } } @@ -416,7 +411,7 @@ } echo '</select> </td><td>'; - echo "<input type=submit name='SearchOrders' VALUE='" . _('Search') . "'></td>"; + echo '<input type=submit name="SearchOrders" VALUE="' . _('Search') . '"></td>'; echo ' <td><a href="' . $rootpath . '/SelectOrderItems.php?' . SID . '&NewOrder=Yes">' . _('Add Sales Order') . '</a></td></tr></table>'; } @@ -428,16 +423,15 @@ $result1 = DB_query($SQL,$db); - echo "</font>"; - echo "<br /><table class=selection>"; + echo '<br /><table class="selection">'; echo '<tr><th colspan=6><font size=3 color=navy>' . _('To search for sales orders for a specific part use the part selection facilities below'); echo '</th></tr>'; - echo "<tr> - <td><font size=1>" . _('Select a stock category') . ":</font> - <select name='StockCat'>"; + echo '<tr> + <td><font size="1">' . _('Select a stock category') . ':</font> + <select name="StockCat">'; while ($myrow1 = DB_fetch_array($result1)) { - echo "<option VALUE='". $myrow1['categoryid'] . "'>" . $myrow1['categorydescription']; + echo '<option value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>'; } echo '</select> @@ -455,12 +449,12 @@ if (isset($StockItemsResult) and DB_num_rows($StockItemsResult)>0) { echo '<table cellpadding=2 colspan=7 class=selection>'; - $TableHeader = "<tr> - <th>" . _('Code') . "</th> - <th>" . _('Description') . "</th> - <th>" . _('On Hand') . "</th> - <th>" . _('Units') . "</th> - </tr>"; + $TableHeader = '<tr> + <th>' . _('Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('On Hand') . '</th> + <th>' . _('Units') . '</th> + </tr>'; echo $TableHeader; $j = 1; @@ -502,7 +496,7 @@ else { //figure out the SQL required from the inputs available - if (isset($_POST['Quotations']) and $_POST['Quotations']=='Orders_Only'){ + if (isset($_POST['Quotations']) AND $_POST['Quotations']=='Orders_Only'){ $Quotations = 0; } else { $Quotations =1; @@ -519,6 +513,7 @@ salesorders.deliverydate, salesorders.deliverto, salesorders.printedpackingslip, + salesorders.poplaced, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue FROM salesorders, salesorderdetails, @@ -553,7 +548,8 @@ salesorders.orddate, salesorders.deliverydate, salesorders.deliverto, - salesorders.printedpackingslip, + salesorders.printedpackingslip, + salesorders.poplaced, salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent) AS ordervalue FROM salesorders, salesorderdetails, @@ -578,7 +574,8 @@ salesorders.customerref, salesorders.orddate, salesorders.deliverto, - salesorders.printedpackingslip, + salesorders.printedpackingslip, + salesorders.poplaced, salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue FROM salesorders, salesorderdetails, @@ -612,6 +609,7 @@ salesorders.orddate, salesorders.deliverto, salesorders.printedpackingslip, + salesorders.poplaced, salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue FROM salesorders, salesorderdetails, @@ -642,7 +640,8 @@ salesorders.orddate, salesorders.deliverto, salesorders.deliverydate, - salesorders.printedpackingslip, + salesorders.printedpackingslip, + salesorders.poplaced, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue FROM salesorders, salesorderdetails, @@ -676,9 +675,9 @@ if (DB_num_rows($SalesOrdersResult)>0) { /* Get users authority to place POs */ - $AuthSql="SELECT cancreate - FROM purchorderauth - WHERE userid='". $_SESSION['UserID'] . "'"; + $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); @@ -718,7 +717,7 @@ } echo $tableheader; - } + $i = 1; $j = 1; $k=0; //row colour counter @@ -733,120 +732,120 @@ $k++; } - $ModifyPage = $rootpath . "/SelectOrderItems.php?" . SID . '&ModifyOrderNumber=' . $myrow['orderno']; - $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?' . SID . '&OrderNumber=' .$myrow['orderno']; - - if ($_SESSION['PackNoteFormat']==1){ /*Laser printed A4 default */ - $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; - } else { /*pre-printed stationery default */ - $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $myrow['orderno']; + $ModifyPage = $rootpath . "/SelectOrderItems.php?" . SID . '&ModifyOrderNumber=' . $myrow['orderno']; + $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?' . SID . '&OrderNumber=' .$myrow['orderno']; + + if ($_SESSION['PackNoteFormat']==1){ /*Laser printed A4 default */ + $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; + } else { /*pre-printed stationery default */ + $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $myrow['orderno']; + } + $PrintSalesOrder = $rootpath . '/PrintSalesOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; + $PrintQuotation = $rootpath . '/PDFQuotation.php?' . SID . '&QuotationNo=' . $myrow['orderno']; + $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); + $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); + $FormatedOrderValue = number_format($myrow['ordervalue'],2); + + if ($myrow['printedpackingslip']==0) { + $PrintText = _('Print'); + } else { + $PrintText = _('Reprint'); + } + + if ($_POST['Quotations']=='Orders_Only'){ + + /*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 AND $myrow['poplaced']==0){ //cancreate==0 if the user can create POs and not already placed + 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 value><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> + <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'], + $PrintQuotation, + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedOrderDate, + $FormatedDelDate, + $myrow['deliverto'], + $FormatedOrderValue); + } + $i++; + $j++; + if ($j == 12){ + $j=1; + echo $tableheader; + } + //end of page full new headings if + }//end while loop through orders to display + 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>'; } - $PrintSalesOrder = $rootpath . '/PrintSalesOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; - $PrintQuotation = $rootpath . '/PDFQuotation.php?' . SID . '&QuotationNo=' . $myrow['orderno']; - $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); - $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); - $FormatedOrderValue = number_format($myrow['ordervalue'],2); - - if ($myrow['printedpackingslip']==0) { - $PrintText = _('Print'); - } else { - $PrintText = _('Reprint'); - } - - if ($_POST['Quotations']=='Orders_Only'){ - - /*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> - <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'], - $PrintQuotation, - $myrow['name'], - $myrow['brname'], - $myrow['customerref'], - $FormatedOrderDate, - $FormatedDelDate, - $myrow['deliverto'], - $FormatedOrderValue); - } - $i++; - $j++; - if ($j == 12){ - $j=1; - echo $tableheader; - } - //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>'; + echo '</table>'; + } //end if there are some orders to show } ?> Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/Stocks.php 2011-03-13 04:55:32 UTC (rev 4508) @@ -477,7 +477,7 @@ prnMsg( _('Cannot delete this item record because there are bills of material that require this part as a component'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('bills of material that require this part as a component'); } else { - $sql= "SELECT COUNT(*) FROM salesorderdetails WHERE stkcode='".$StockID."' GROUP BY stockid"; + $sql= "SELECT COUNT(*) FROM salesorderdetails WHERE stkcode='".$StockID."' GROUP BY stkcode"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { @@ -493,7 +493,7 @@ prnMsg(_('Cannot delete this item because sales analysis records exist for it'),'warn'); echo '<br>' . _('There are') . ' ' . $myrow[0] . ' ' . _('sales analysis records against this part'); } else { - $sql= "SELECT COUNT(*) FROM purchorderdetails WHERE itemcode='".$StockID."' GROUP BY stockid"; + $sql= "SELECT COUNT(*) FROM purchorderdetails WHERE itemcode='".$StockID."' GROUP BY itemcode"; $result = DB_query($sql,$db); $myrow = DB_fetch_row($result); if ($myrow[0]>0) { Modified: trunk/SuppPriceList.php =================================================================== --- trunk/SuppPriceList.php 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/SuppPriceList.php 2011-03-13 04:55:32 UTC (rev 4508) @@ -21,10 +21,11 @@ $line_height=12; //get supplier - $sqlsup = "SELECT suppname FROM suppliers where supplierid='" . $_POST['supplier'] . "'"; + $sqlsup = "SELECT suppname, currcode FROM suppliers where supplierid='" . $_POST['supplier'] . "'"; $resultsup = db_query($sqlsup,$db); - $RowSup = db_fetch_row($resultsup); - $Supp=$RowSup['0']; + $RowSup = db_fetch_array($resultsup); + $SupplierName=$RowSup['suppname']; + $CurrCode =$RowSup['currcode']; //get category if ($_POST['category']!="all"){ @@ -36,26 +37,22 @@ $Categoryname="ALL"; } - //get currency - $sqlcur="SELECT currcode FROM `suppliers` where supplierid='" . $_POST['supplier'] . "'"; - $resultcur = db_query($sqlcur,$db); - $RowCur = db_fetch_row($resultcur); - $Currency=$RowCur['0']; - + //get date price - if ($_POST['price']=="all"){ - $DatePrice=_('All Price'); + if ($_POST['price']=='all'){ + $DatePrice=_('All Prices'); } else { $DatePrice=_('Current Price'); } //price and category = all - if (($_POST['price']=="all")and($_POST['category']=="all")){ + if (($_POST['price']=='all')and($_POST['category']=='all')){ $sql = "SELECT purchdata.stockid, stockmaster.description, purchdata.price, (purchdata.effectivefrom)as dateprice, - purchdata.supplierdescription + purchdata.supplierdescription, + purchdata.suppliers_partno FROM purchdata,stockmaster WHERE supplierno='" . $_POST['supplier'] . "' AND stockmaster.stockid=purchdata.stockid @@ -72,7 +69,8 @@ WHERE purchdata.stockid = stockmaster.stockid ORDER BY effectivefrom DESC LIMIT 0,1) AS dateprice, - purchdata.supplierdescription + purchdata.supplierdescription, + purchdata.suppliers_partno FROM purchdata, stockmaster WHERE supplierno = '" . $_POST['supplier'] . "' AND stockmaster.stockid = purchdata.stockid @@ -86,7 +84,8 @@ stockmaster.description, purchdata.price, (purchdata.effectivefrom)as dateprice, - purchdata.supplierdescription + purchdata.supplierdescription, + purchdata.suppliers_partno FROM purchdata,stockmaster WHERE supplierno='" . $_POST['supplier'] . "' AND stockmaster.stockid=purchdata.stockid @@ -102,7 +101,8 @@ WHERE purchdata.stockid = stockmaster.stockid ORDER BY effectivefrom DESC LIMIT 0,1) AS dateprice, - purchdata.supplierdescription + purchdata.supplierdescription, + purchdata.suppliers_partno FROM purchdata,stockmaster WHERE supplierno='" . $_POST['supplier'] . "' AND stockmaster.stockid=purchdata.stockid @@ -127,7 +127,7 @@ } PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$Supp,$Categoryname,$Currency,$DatePrice); + $Page_Width,$Right_Margin,$SupplierName,$Categoryname,$CurrCode,$DatePrice); $FontSize=8; $code=''; @@ -148,26 +148,26 @@ $dateprice=date($_SESSION['DefaultDateFormat'], mktime(0,0,0,$DateArray[1],$DateArray[2],$DateArray[0])); //if item has more than 1 price, write only price, date and supplier code for the old ones - if ($code==$myrow[0]){ + if ($code==$myrow['stockid']){ - $pdf->addTextWrap(350,$YPos,50,$FontSize,number_format($myrow[2],2),'right'); + $pdf->addTextWrap(350,$YPos,50,$FontSize,number_format($myrow['price'],2),'right'); $pdf->addTextWrap(430,$YPos,50,$FontSize,$dateprice,'left'); - $pdf->addTextWrap(510,$YPos,40,$FontSize,$myrow[4],'left'); - $code=$myrow[0]; + $pdf->addTextWrap(510,$YPos,40,$FontSize,$myrow['suppliers_partno'],'left'); + $code=$myrow['stockid']; } else { - $code=$myrow[0]; - $pdf->addTextWrap(50,$YPos,90,$FontSize,$myrow[0],'left'); - $pdf->addTextWrap(145,$YPos,215,$FontSize,$myrow[1],'left'); - $pdf->addTextWrap(350,$YPos,50,$FontSize,number_format($myrow[2],2),'right'); + $code=$myrow['stockid']; + $pdf->addTextWrap(50,$YPos,90,$FontSize,$myrow['stockid'],'left'); + $pdf->addTextWrap(145,$YPos,215,$FontSize,$myrow['description'],'left'); + $pdf->addTextWrap(350,$YPos,50,$FontSize,number_format($myrow['price'],2),'right'); $pdf->addTextWrap(430,$YPos,50,$FontSize,$dateprice,'left'); - $pdf->addTextWrap(510,$YPos,40,$FontSize,$myrow[4],'left'); + $pdf->addTextWrap(510,$YPos,40,$FontSize,$myrow['suppliers_partno'],'left'); } if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$Supp,$Categoryname,$Currency,$DatePrice); + $Right_Margin,$SupplierName,$Categoryname,$CurrCode,$DatePrice); } @@ -176,22 +176,13 @@ if ($YPos < $Bottom_Margin + $line_height){ PrintHeader($pdf,$YPos,$PageNumber,$Page_Height,$Top_Margin,$Left_Margin,$Page_Width, - $Right_Margin,$Supp,$Categoryname,$Currency,$DatePrice); + $Right_Margin,$SupplierName,$Categoryname,$CurrCode,$DatePrice); } + + $pdf->OutputD( $_SESSION['DatabaseName'] . '_SupplierPriceList_' . Date('Y-m-d') . '.pdf'); + - $pdfcode = $pdf->output(); - - header('Content-type: application/pdf'); - header("Content-Length: " . $len); - header('Content-Disposition: inline; filename=Supplier Price List.pdf'); - header('Expires: 0'); - header('Cache-Control: private, post-check=0, pre-check=0'); - header('Pragma: public'); - $pdf->Output('SuppPriceList.pdf', 'I'); - - - } else { /*The option to print PDF was not hit so display form */ $title=_('Supplier Price List'); @@ -229,8 +220,8 @@ echo '</select></td></tr>'; echo '<tr><td>' . _('Price List') . ':</td><td><select name="price"> '; - echo '<option Value="all">' ._('All Prices').''; - echo '<option Value="current">' ._('Only Current Price').''; + echo '<option Value="all">' ._('All Prices').'</option>'; + echo '<option Value="current">' ._('Only Current Price').'</option>'; echo '</select></td></tr>'; @@ -243,7 +234,7 @@ function PrintHeader(&$pdf,&$YPos,&$PageNumber,$Page_Height,$Top_Margin,$Left_Margin, - $Page_Width,$Right_Margin,$Supp,$Categoryname,$Currency,$DatePrice) { + $Page_Width,$Right_Margin,$SupplierName,$Categoryname,$CurrCode,$DatePrice) { /*PDF page header for Supplier price list */ @@ -264,7 +255,7 @@ Date($_SESSION['DefaultDateFormat']) . ' ' . _('Page') . ' ' . $PageNumber,'left'); $YPos -= $line_height; $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Supplier').' '); - $pdf->addTextWrap(95,$YPos,150,$FontSize,_(': ').$Supp); + $pdf->addTextWrap(95,$YPos,150,$FontSize,_(': ').$SupplierName); $YPos -= $line_height; $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Category').' '); @@ -272,7 +263,7 @@ $pdf->addTextWrap(95,$YPos,150,$FontSize,_(': ').$Categoryname); $YPos -= $line_height; $pdf->addTextWrap($Left_Margin,$YPos,50,$FontSize,_('Currency').' '); - $pdf->addTextWrap(95,$YPos,50,$FontSize,_(': ').$Currency); + $pdf->addTextWrap(95,$YPos,50,$FontSize,_(': ').$CurrCode); $YPos -=(2*$line_height); /*set up the headings */ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/doc/Change.log.html 2011-03-13 04:55:32 UTC (rev 4508) @@ -1,5 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>12/3/11: SelectSalesOrder.php now allows any number of sales orders to be selected and purchase orders placed for the aggregate of items on the selected sales orders</p> +<p>12/3/11: SuppPriceList.php removed a round trip to DB to get currency - fixed function to get pdf to new TCPDF Output </p> <p>12/3/11: Exson fix all htmlentities to use ENTQUOTES, 'UTF-8' option so other character sets work with it</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> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/includes/ConnectDB.inc 2011-03-13 04:55:32 UTC (rev 4508) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03'; //must update manually every time there is a DB change +$Version='4.03.2'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-11 20:24:03 UTC (rev 4507) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-13 04:55:32 UTC (rev 4508) @@ -816,4 +816,18 @@ UPDATE config SET confvalue='3.12.31' WHERE confname='VersionNumber'; INSERT INTO config (`confname`, `confvalue`) VALUES ('AutoAuthorisePO', '1'); UPDATE config SET confvalue='4.03' WHERE confname='VersionNumber'; +ALTER TABLE `salesorders` ADD `poplaced` TINYINT NOT NULL DEFAULT '0', +ADD INDEX ( `poplaced` ); +UPDATE config SET confvalue='4.03.1' WHERE confname='VersionNumber'; +CREATE TABLE IF NOT EXISTS `fixedassetlocations` ( + `locationid` char(6) NOT NULL DEFAULT '', + `locationdescription` char(20) NOT NULL DEFAULT '', + `parentlocationid` char(6) DEFAULT '', + PRIMARY KEY (`locationid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +INSERT INTO `fixedassetlocations` (`locationid`, `locationdescription`, `parentlocationid`) VALUES +('HEADOF', 'Head Office', ''); +UPDATE config SET confvalue='4.03.2' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-14 09:11:27
|
Revision: 4510 http://web-erp.svn.sourceforge.net/web-erp/?rev=4510&view=rev Author: daintree Date: 2011-03-14 09:11:21 +0000 (Mon, 14 Mar 2011) Log Message: ----------- Show outstanding sales order value in functional currency Modified Paths: -------------- trunk/SelectSalesOrder.php trunk/UpgradeDatabase.php trunk/doc/Change.log.html trunk/includes/LanguageSetup.php trunk/includes/session.inc Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-13 08:28:44 UTC (rev 4509) +++ trunk/SelectSalesOrder.php 2011-03-14 09:11:21 UTC (rev 4510) @@ -106,7 +106,7 @@ $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; $result = DB_query("UPDATE purchorders SET allowprint=1, status='Authorised', - statuscomment='" . $StatusComment . "' + stat_comment='" . $StatusComment . "' WHERE orderno='" . $OrderNo . "'", $db); } else { // no authority to authorise this order @@ -514,16 +514,17 @@ salesorders.deliverto, salesorders.printedpackingslip, salesorders.poplaced, - SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.branchcode = custbranch.branchcode - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorderdetails.completed=0 + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.orderno=". $_REQUEST['OrderNumber'] ." AND salesorders.quotation =" .$Quotations . " GROUP BY salesorders.orderno, @@ -533,7 +534,8 @@ salesorders.orddate, salesorders.deliverydate, salesorders.deliverto, - salesorders.printedpackingslip + salesorders.printedpackingslip, + salesorders.poplaced ORDER BY salesorders.orderno"; } else { /* $DateAfterCriteria = FormatDateforSQL($OrdersAfterDate); */ @@ -550,16 +552,17 @@ salesorders.deliverto, salesorders.printedpackingslip, salesorders.poplaced, - salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorderdetails.completed=0 + salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.quotation =" .$Quotations . " AND salesorderdetails.stkcode='". $_REQUEST['SelectedStockItem'] ."' AND salesorders.debtorno='" . $_REQUEST['SelectedCustomer'] ."' @@ -576,16 +579,18 @@ salesorders.deliverto, salesorders.printedpackingslip, salesorders.poplaced, - salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorders.quotation =" .$Quotations . " + salesorders.deliverydate, + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorders.quotation =" .$Quotations . " AND salesorderdetails.completed=0 AND salesorders.debtorno='" . $_REQUEST['SelectedCustomer'] . "' AND salesorders.fromstkloc = '". $_POST['StockLocation'] . "' @@ -596,7 +601,8 @@ salesorders.customerref, salesorders.orddate, salesorders.deliverto, - salesorders.deliverydate + salesorders.deliverydate, + salesorders.poplaced ORDER BY salesorders.orderno"; } @@ -610,16 +616,18 @@ salesorders.deliverto, salesorders.printedpackingslip, salesorders.poplaced, - salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorderdetails.completed=0 + salesorders.deliverydate, + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.quotation =" .$Quotations . " AND salesorderdetails.stkcode='". $_REQUEST['SelectedStockItem'] . "' AND salesorders.fromstkloc = '". $_POST['StockLocation'] . "' @@ -629,6 +637,7 @@ salesorders.customerref, salesorders.orddate, salesorders.deliverto, + salesorders.poplaced, salesorders.deliverydate, salesorders.printedpackingslip ORDER BY salesorders.orderno"; @@ -642,16 +651,17 @@ salesorders.deliverydate, salesorders.printedpackingslip, salesorders.poplaced, - SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorderdetails.completed=0 + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.quotation =" .$Quotations . " AND salesorders.fromstkloc = '". $_POST['StockLocation'] . "' GROUP BY salesorders.orderno, @@ -661,7 +671,8 @@ salesorders.orddate, salesorders.deliverto, salesorders.deliverydate, - salesorders.printedpackingslip + salesorders.printedpackingslip, + salesorders.poplaced ORDER BY salesorders.orderno"; } @@ -685,7 +696,7 @@ echo '<table cellpadding=2 colspan=7 width=95% class=selection>'; - if (isset($_POST['Quotations']) and $_POST['Quotations']=='Orders_Only'){ + if (isset($_POST['Quotations']) AND $_POST['Quotations']=='Orders_Only'){ $tableheader = '<tr> <th>' . _('Modify') . '</th> <th>' . _('Invoice') . '</th> @@ -697,7 +708,7 @@ <th>' . _('Order Date') . '</th> <th>' . _('Req Del Date') . '</th> <th>' . _('Delivery To') . '</th> - <th>' . _('Order Total') . '</th>'; + <th>' . _('Order Total') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th>'; if ($AuthRow['cancreate']==0){ //If cancreate==0 then this means the user can create orders hmmm!! $tableheader .= '<th>' . _('Place PO') . '</th></tr>'; } else { @@ -713,7 +724,7 @@ <th>' . _('Quote Date') . '</th> <th>' . _('Req Del Date') . '</th> <th>' . _('Delivery To') . '</th> - <th>' . _('Quote Total') . '</th></tr>'; + <th>' . _('Quote Total') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th></tr>'; } echo $tableheader; @@ -721,6 +732,8 @@ $i = 1; $j = 1; $k=0; //row colour counter + $OrdersTotal =0; + while ($myrow=DB_fetch_array($SalesOrdersResult)) { @@ -732,16 +745,16 @@ $k++; } - $ModifyPage = $rootpath . "/SelectOrderItems.php?" . SID . '&ModifyOrderNumber=' . $myrow['orderno']; - $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?' . SID . '&OrderNumber=' .$myrow['orderno']; + $ModifyPage = $rootpath . '/SelectOrderItems.php?ModifyOrderNumber=' . $myrow['orderno']; + $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?OrderNumber=' .$myrow['orderno']; if ($_SESSION['PackNoteFormat']==1){ /*Laser printed A4 default */ - $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; + $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?TransNo=' . $myrow['orderno']; } else { /*pre-printed stationery default */ - $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $myrow['orderno']; + $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?TransNo=' . $myrow['orderno']; } - $PrintSalesOrder = $rootpath . '/PrintSalesOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; - $PrintQuotation = $rootpath . '/PDFQuotation.php?' . SID . '&QuotationNo=' . $myrow['orderno']; + $PrintSalesOrder = $rootpath . '/PrintSalesOrder_generic.php?TransNo=' . $myrow['orderno']; + $PrintQuotation = $rootpath . '/PDFQuotation.php?QuotationNo=' . $myrow['orderno']; $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); $FormatedOrderValue = number_format($myrow['ordervalue'],2); @@ -835,6 +848,7 @@ } $i++; $j++; + $TotalOrders += $myrow['ordervalue']; if ($j == 12){ $j=1; echo $tableheader; @@ -842,9 +856,16 @@ //end of page full new headings if }//end while loop through orders to display 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 '<tr><td colspan="9"><td><td colspan="2" class="number"><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>'; + echo '<tr><td colspan="10" class="number">'; + if ($_POST['Quotations']=='Orders_Only'){ + echo _('Total Order(s) Value in'); + } else { + echo _('Total Quotation(s) Value in'); + } + echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</td><td colspan="1" class="number">' . number_format($TotalOrders,2) . '</td></tr> + </table>'; } //end if there are some orders to show } Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-03-13 08:28:44 UTC (rev 4509) +++ trunk/UpgradeDatabase.php 2011-03-14 09:11:21 UTC (rev 4510) @@ -97,7 +97,7 @@ $SQLScripts[] = './sql/mysql/upgrade3.11.1-4.00.sql'; break; } //end switch - if(isset($_SESSION['VersionNumber']) AND $_SESSION['VersionNumber']< '4.03') { /* VersionNumber is set to '4.03' when upgrade3.11.1-4.00.sql is run */ + if(isset($_SESSION['VersionNumber']) AND strcmp($_SESSION['VersionNumber'],'4.04')<0) { /* VersionNumber is set to '4.04' when upgrade3.11.1-4.00.sql is run */ $SQLScripts[] = './sql/mysql/upgrade3.11.1-4.00.sql'; } } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-13 08:28:44 UTC (rev 4509) +++ trunk/doc/Change.log.html 2011-03-14 09:11:21 UTC (rev 4510) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>14/3/11: SelectSalesOrder.php now lists with sales order value denominated in functional currency with total of listed outstadning sales orders (or quotations) shown at the bottom of the listing</p> <p>12/3/11: Tim Now allow space in codes </p> <p>12/3/11: SelectSalesOrder.php now allows any number of sales orders to be selected and purchase orders placed for the aggregate of items on the selected sales orders</p> <p>12/3/11: SuppPriceList.php removed a round trip to DB to get currency - fixed function to get pdf to new TCPDF Output </p> Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-03-13 08:28:44 UTC (rev 4509) +++ trunk/includes/LanguageSetup.php 2011-03-14 09:11:21 UTC (rev 4510) @@ -75,8 +75,8 @@ } } //if (substr($_SESSION['Language'],0,2) == 'en'){ - $locale_info['thousands_sep'] = ','; - $locale_info['decimal_point'] = '.'; + $locale_info['thousands_sep'] = ','; + $locale_info['decimal_point'] = '.'; /* } else { $locale_info['thousands_sep'] = '.'; Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-13 08:28:44 UTC (rev 4509) +++ trunk/includes/session.inc 2011-03-14 09:11:21 UTC (rev 4510) @@ -124,7 +124,7 @@ } /*If the Code $Version - held in ConnectDB.inc is > than the Database VersionNumber held in config table then do upgrades */ -if (($Version>$_SESSION['VersionNumber']) and (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { +if (strcmp($Version,$_SESSION['VersionNumber'])>0 AND (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { header('Location: UpgradeDatabase.php'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-14 09:11:28
|
Revision: 4510 http://web-erp.svn.sourceforge.net/web-erp/?rev=4510&view=rev Author: daintree Date: 2011-03-14 09:11:21 +0000 (Mon, 14 Mar 2011) Log Message: ----------- Show outstanding sales order value in functional currency Modified Paths: -------------- trunk/SelectSalesOrder.php trunk/UpgradeDatabase.php trunk/doc/Change.log.html trunk/includes/LanguageSetup.php trunk/includes/session.inc Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-13 08:28:44 UTC (rev 4509) +++ trunk/SelectSalesOrder.php 2011-03-14 09:11:21 UTC (rev 4510) @@ -106,7 +106,7 @@ $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; $result = DB_query("UPDATE purchorders SET allowprint=1, status='Authorised', - statuscomment='" . $StatusComment . "' + stat_comment='" . $StatusComment . "' WHERE orderno='" . $OrderNo . "'", $db); } else { // no authority to authorise this order @@ -514,16 +514,17 @@ salesorders.deliverto, salesorders.printedpackingslip, salesorders.poplaced, - SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.branchcode = custbranch.branchcode - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorderdetails.completed=0 + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.orderno=". $_REQUEST['OrderNumber'] ." AND salesorders.quotation =" .$Quotations . " GROUP BY salesorders.orderno, @@ -533,7 +534,8 @@ salesorders.orddate, salesorders.deliverydate, salesorders.deliverto, - salesorders.printedpackingslip + salesorders.printedpackingslip, + salesorders.poplaced ORDER BY salesorders.orderno"; } else { /* $DateAfterCriteria = FormatDateforSQL($OrdersAfterDate); */ @@ -550,16 +552,17 @@ salesorders.deliverto, salesorders.printedpackingslip, salesorders.poplaced, - salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorderdetails.completed=0 + salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.quotation =" .$Quotations . " AND salesorderdetails.stkcode='". $_REQUEST['SelectedStockItem'] ."' AND salesorders.debtorno='" . $_REQUEST['SelectedCustomer'] ."' @@ -576,16 +579,18 @@ salesorders.deliverto, salesorders.printedpackingslip, salesorders.poplaced, - salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorders.quotation =" .$Quotations . " + salesorders.deliverydate, + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorders.quotation =" .$Quotations . " AND salesorderdetails.completed=0 AND salesorders.debtorno='" . $_REQUEST['SelectedCustomer'] . "' AND salesorders.fromstkloc = '". $_POST['StockLocation'] . "' @@ -596,7 +601,8 @@ salesorders.customerref, salesorders.orddate, salesorders.deliverto, - salesorders.deliverydate + salesorders.deliverydate, + salesorders.poplaced ORDER BY salesorders.orderno"; } @@ -610,16 +616,18 @@ salesorders.deliverto, salesorders.printedpackingslip, salesorders.poplaced, - salesorders.deliverydate, SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorderdetails.completed=0 + salesorders.deliverydate, + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.quotation =" .$Quotations . " AND salesorderdetails.stkcode='". $_REQUEST['SelectedStockItem'] . "' AND salesorders.fromstkloc = '". $_POST['StockLocation'] . "' @@ -629,6 +637,7 @@ salesorders.customerref, salesorders.orddate, salesorders.deliverto, + salesorders.poplaced, salesorders.deliverydate, salesorders.printedpackingslip ORDER BY salesorders.orderno"; @@ -642,16 +651,17 @@ salesorders.deliverydate, salesorders.printedpackingslip, salesorders.poplaced, - SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)) AS ordervalue - FROM salesorders, - salesorderdetails, - debtorsmaster, - custbranch - WHERE salesorders.orderno = salesorderdetails.orderno - AND salesorders.debtorno = debtorsmaster.debtorno - AND debtorsmaster.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND salesorderdetails.completed=0 + SUM(salesorderdetails.unitprice*salesorderdetails.quantity*(1-salesorderdetails.discountpercent)/currencies.rate) AS ordervalue + FROM salesorders INNER JOIN salesorderdetails + ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN debtorsmaster + ON salesorders.debtorno = debtorsmaster.debtorno + INNER JOIN custbranch + ON debtorsmaster.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + INNER JOIN currencies + ON debtorsmaster.currcode = currencies.currabrev + WHERE salesorderdetails.completed=0 AND salesorders.quotation =" .$Quotations . " AND salesorders.fromstkloc = '". $_POST['StockLocation'] . "' GROUP BY salesorders.orderno, @@ -661,7 +671,8 @@ salesorders.orddate, salesorders.deliverto, salesorders.deliverydate, - salesorders.printedpackingslip + salesorders.printedpackingslip, + salesorders.poplaced ORDER BY salesorders.orderno"; } @@ -685,7 +696,7 @@ echo '<table cellpadding=2 colspan=7 width=95% class=selection>'; - if (isset($_POST['Quotations']) and $_POST['Quotations']=='Orders_Only'){ + if (isset($_POST['Quotations']) AND $_POST['Quotations']=='Orders_Only'){ $tableheader = '<tr> <th>' . _('Modify') . '</th> <th>' . _('Invoice') . '</th> @@ -697,7 +708,7 @@ <th>' . _('Order Date') . '</th> <th>' . _('Req Del Date') . '</th> <th>' . _('Delivery To') . '</th> - <th>' . _('Order Total') . '</th>'; + <th>' . _('Order Total') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th>'; if ($AuthRow['cancreate']==0){ //If cancreate==0 then this means the user can create orders hmmm!! $tableheader .= '<th>' . _('Place PO') . '</th></tr>'; } else { @@ -713,7 +724,7 @@ <th>' . _('Quote Date') . '</th> <th>' . _('Req Del Date') . '</th> <th>' . _('Delivery To') . '</th> - <th>' . _('Quote Total') . '</th></tr>'; + <th>' . _('Quote Total') . '<br />' . $_SESSION['CompanyRecord']['currencydefault'] . '</th></tr>'; } echo $tableheader; @@ -721,6 +732,8 @@ $i = 1; $j = 1; $k=0; //row colour counter + $OrdersTotal =0; + while ($myrow=DB_fetch_array($SalesOrdersResult)) { @@ -732,16 +745,16 @@ $k++; } - $ModifyPage = $rootpath . "/SelectOrderItems.php?" . SID . '&ModifyOrderNumber=' . $myrow['orderno']; - $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?' . SID . '&OrderNumber=' .$myrow['orderno']; + $ModifyPage = $rootpath . '/SelectOrderItems.php?ModifyOrderNumber=' . $myrow['orderno']; + $Confirm_Invoice = $rootpath . '/ConfirmDispatch_Invoice.php?OrderNumber=' .$myrow['orderno']; if ($_SESSION['PackNoteFormat']==1){ /*Laser printed A4 default */ - $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; + $PrintDispatchNote = $rootpath . '/PrintCustOrder_generic.php?TransNo=' . $myrow['orderno']; } else { /*pre-printed stationery default */ - $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $myrow['orderno']; + $PrintDispatchNote = $rootpath . '/PrintCustOrder.php?TransNo=' . $myrow['orderno']; } - $PrintSalesOrder = $rootpath . '/PrintSalesOrder_generic.php?' . SID . '&TransNo=' . $myrow['orderno']; - $PrintQuotation = $rootpath . '/PDFQuotation.php?' . SID . '&QuotationNo=' . $myrow['orderno']; + $PrintSalesOrder = $rootpath . '/PrintSalesOrder_generic.php?TransNo=' . $myrow['orderno']; + $PrintQuotation = $rootpath . '/PDFQuotation.php?QuotationNo=' . $myrow['orderno']; $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); $FormatedOrderValue = number_format($myrow['ordervalue'],2); @@ -835,6 +848,7 @@ } $i++; $j++; + $TotalOrders += $myrow['ordervalue']; if ($j == 12){ $j=1; echo $tableheader; @@ -842,9 +856,16 @@ //end of page full new headings if }//end while loop through orders to display 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 '<tr><td colspan="9"><td><td colspan="2" class="number"><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>'; + echo '<tr><td colspan="10" class="number">'; + if ($_POST['Quotations']=='Orders_Only'){ + echo _('Total Order(s) Value in'); + } else { + echo _('Total Quotation(s) Value in'); + } + echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</td><td colspan="1" class="number">' . number_format($TotalOrders,2) . '</td></tr> + </table>'; } //end if there are some orders to show } Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2011-03-13 08:28:44 UTC (rev 4509) +++ trunk/UpgradeDatabase.php 2011-03-14 09:11:21 UTC (rev 4510) @@ -97,7 +97,7 @@ $SQLScripts[] = './sql/mysql/upgrade3.11.1-4.00.sql'; break; } //end switch - if(isset($_SESSION['VersionNumber']) AND $_SESSION['VersionNumber']< '4.03') { /* VersionNumber is set to '4.03' when upgrade3.11.1-4.00.sql is run */ + if(isset($_SESSION['VersionNumber']) AND strcmp($_SESSION['VersionNumber'],'4.04')<0) { /* VersionNumber is set to '4.04' when upgrade3.11.1-4.00.sql is run */ $SQLScripts[] = './sql/mysql/upgrade3.11.1-4.00.sql'; } } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-13 08:28:44 UTC (rev 4509) +++ trunk/doc/Change.log.html 2011-03-14 09:11:21 UTC (rev 4510) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>14/3/11: SelectSalesOrder.php now lists with sales order value denominated in functional currency with total of listed outstadning sales orders (or quotations) shown at the bottom of the listing</p> <p>12/3/11: Tim Now allow space in codes </p> <p>12/3/11: SelectSalesOrder.php now allows any number of sales orders to be selected and purchase orders placed for the aggregate of items on the selected sales orders</p> <p>12/3/11: SuppPriceList.php removed a round trip to DB to get currency - fixed function to get pdf to new TCPDF Output </p> Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-03-13 08:28:44 UTC (rev 4509) +++ trunk/includes/LanguageSetup.php 2011-03-14 09:11:21 UTC (rev 4510) @@ -75,8 +75,8 @@ } } //if (substr($_SESSION['Language'],0,2) == 'en'){ - $locale_info['thousands_sep'] = ','; - $locale_info['decimal_point'] = '.'; + $locale_info['thousands_sep'] = ','; + $locale_info['decimal_point'] = '.'; /* } else { $locale_info['thousands_sep'] = '.'; Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2011-03-13 08:28:44 UTC (rev 4509) +++ trunk/includes/session.inc 2011-03-14 09:11:21 UTC (rev 4510) @@ -124,7 +124,7 @@ } /*If the Code $Version - held in ConnectDB.inc is > than the Database VersionNumber held in config table then do upgrades */ -if (($Version>$_SESSION['VersionNumber']) and (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { +if (strcmp($Version,$_SESSION['VersionNumber'])>0 AND (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { header('Location: UpgradeDatabase.php'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-15 09:33:16
|
Revision: 4511 http://web-erp.svn.sourceforge.net/web-erp/?rev=4511&view=rev Author: daintree Date: 2011-03-15 09:33:07 +0000 (Tue, 15 Mar 2011) Log Message: ----------- various Modified Paths: -------------- trunk/CounterSales.php trunk/Locations.php trunk/PricesByCost.php trunk/SelectOrderItems.php trunk/SelectSalesOrder.php trunk/doc/Change.log.html trunk/sql/mysql/upgrade3.11.1-4.00.sql Removed Paths: ------------- trunk/PrintSalesOrder_generic.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/CounterSales.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -66,10 +66,11 @@ $_SESSION['PrintedPackingSlip'] = 0; /*Of course 'cos the order ain't even started !!*/ /*Get the default customer-branch combo from the user's default location record */ $sql = "SELECT cashsalecustomer, - locationname, - taxprovinceid - FROM locations - WHERE loccode='" . $_SESSION['UserStockLocation'] ."'"; + cashsalebranch, + locationname, + taxprovinceid + FROM locations + WHERE loccode='" . $_SESSION['UserStockLocation'] ."'"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0) { prnMsg(_('Your user account does not have a valid default inventory location set up. Please see the system administrator to modify your user account.'),'error'); @@ -78,36 +79,34 @@ } else { $myrow = DB_fetch_array($result); //get the only row returned - if ($myrow['cashsalecustomer']==''){ - prnMsg(_('To use this script it is first necessary to define a cash sales customer for the location that is your default location. The default cash sale customer is defined under set up ->Inventory Locations Maintenance. The customer should be entered using the customer code a hypen then the branch code of the customer to use.'),'error'); + if ($myrow['cashsalecustomer']=='' OR $myrow['cashsalebranch']==''){ + prnMsg(_('To use this script it is first necessary to define a cash sales customer for the location that is your default location. The default cash sale customer is defined under set up ->Inventory Locations Maintenance. The customer should be entered using the customer code and a valid branch code of the customer entered.'),'error'); include('includes/footer.inc'); exit; } - $CashSaleCustomer = explode('-',$myrow['cashsalecustomer']); - - $_SESSION['Items'.$identifier]->Branch = $CashSaleCustomer[1]; - $_SESSION['Items'.$identifier]->DebtorNo = $CashSaleCustomer[0]; + $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; + $_SESSION['Items'.$identifier]->DebtorNo = $myrow['cashsalecustomer']; $_SESSION['Items'.$identifier]->LocationName = $myrow['locationname']; $_SESSION['Items'.$identifier]->Location = $_SESSION['UserStockLocation']; $_SESSION['Items'.$identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; // Now check to ensure this account exists and set defaults */ $sql = "SELECT debtorsmaster.name, - holdreasons.dissallowinvoices, - debtorsmaster.salestype, - salestypes.sales_type, - debtorsmaster.currcode, - debtorsmaster.customerpoline, - paymentterms.terms - FROM debtorsmaster, - holdreasons, - salestypes, - paymentterms - WHERE debtorsmaster.salestype=salestypes.typeabbrev - AND debtorsmaster.holdreason=holdreasons.reasoncode - AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; + holdreasons.dissallowinvoices, + debtorsmaster.salestype, + salestypes.sales_type, + debtorsmaster.currcode, + debtorsmaster.customerpoline, + paymentterms.terms + FROM debtorsmaster, + holdreasons, + salestypes, + paymentterms + WHERE debtorsmaster.salestype=salestypes.typeabbrev + AND debtorsmaster.holdreason=holdreasons.reasoncode + AND debtorsmaster.paymentterms=paymentterms.termsindicator + AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; $ErrMsg = _('The details of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the customer details and failed was') . ':'; @@ -132,19 +131,18 @@ /* now get the branch defaults from the customer branches table CustBranch. */ $sql = "SELECT custbranch.brname, - custbranch.braddress1, - custbranch.defaultshipvia, - custbranch.deliverblind, - custbranch.specialinstructions, - custbranch.estdeliverydays, - custbranch.salesman, - custbranch.taxgroupid, - custbranch.defaultshipvia - FROM custbranch - WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('cannot be retrieved because'); + custbranch.braddress1, + custbranch.defaultshipvia, + custbranch.deliverblind, + custbranch.specialinstructions, + custbranch.estdeliverydays, + custbranch.salesman, + custbranch.taxgroupid, + custbranch.defaultshipvia + FROM custbranch + WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' + AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -210,7 +208,6 @@ } else { /*Not cancelling the order */ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Counter Sales') . '" alt="" />' . ' '; - echo _('Counter Sale') . ' - ' . $_SESSION['Items'.$identifier]->LocationName . ' (' . _('all amounts in') . ' ' . $_SESSION['Items'.$identifier]->DefaultCurrency . ')'; echo '</p>'; } @@ -231,30 +228,30 @@ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else if (strlen($_POST['StockCode'])>0){ @@ -264,55 +261,55 @@ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; + } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -426,11 +423,11 @@ } elseif ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because') . ' '; $KitResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -441,6 +438,7 @@ $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewPOLine = 0; include('includes/SelectOrderItems_IntoCart.inc'); + $_SESSION['Items'.$identifier]->GetTaxes(($_SESSION['Items'.$identifier]->LineCounter - 1)); } } else if ($myrow['mbflag']=='G'){ @@ -449,6 +447,7 @@ prnMsg(_('The system does not currently cater for counter sales of lot controlled or serialised items'),'warn'); } else { /*Its not a kit set item*/ include('includes/SelectOrderItems_IntoCart.inc'); + $_SESSION['Items'.$identifier]->GetTaxes(($_SESSION['Items'.$identifier]->LineCounter - 1)); } } } @@ -515,9 +514,10 @@ if (isset($_POST['Recalculate'])) { foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { $NewItem=$OrderLine->StockID; - $sql = "SELECT stockmaster.mbflag, stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid='". $OrderLine->StockID."'"; + $sql = "SELECT stockmaster.mbflag, + stockmaster.controlled + FROM stockmaster + WHERE stockmaster.stockid='". $OrderLine->StockID."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); $DbgMsg = _('The sql that was used to determine if the part being ordered was a kitset or not was '); @@ -525,11 +525,11 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $OrderLine->StockID. "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $OrderLine->StockID. "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -559,9 +559,9 @@ * controlled items and ghost/phantom items cannot be selected because the SQL to show items to select doesn't show 'em * */ $sql = "SELECT stockmaster.mbflag, - stockmaster.taxcatid - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; + stockmaster.taxcatid + FROM stockmaster + WHERE stockmaster.stockid='". $NewItem ."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); @@ -573,11 +573,11 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -610,8 +610,8 @@ foreach($NewItemArray as $NewItem => $NewItemQty) { if($NewItemQty > 0) { $sql = "SELECT stockmaster.mbflag - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; + FROM stockmaster + WHERE stockmaster.stockid='". $NewItem ."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); @@ -623,11 +623,11 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -670,10 +670,10 @@ } } $result = DB_query("SELECT MAX(discountrate) AS discount - FROM discountmatrix - WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' - AND discountcategory ='" . $OrderLine->DiscCat . "' - AND quantitybreak <'" . $QuantityOfDiscCat . "'",$db); + FROM discountmatrix + WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' + AND discountcategory ='" . $OrderLine->DiscCat . "' + AND quantitybreak <'" . $QuantityOfDiscCat . "'",$db); $myrow = DB_fetch_row($result); if ($myrow[0]!=0){ /* need to update the lines affected */ foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { @@ -697,17 +697,17 @@ <table width="90%" cellpadding="2" colspan="7"> <tr bgcolor="#800000">'; echo '<th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('QOH') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('GP %') . '</th> - <th>' . _('Net') . '</th> - <th>' . _('Tax') . '</th> - <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> - </tr>'; + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('QOH') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('GP %') . '</th> + <th>' . _('Net') . '</th> + <th>' . _('Tax') . '</th> + <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> + </tr>'; $_SESSION['Items'.$identifier]->total = 0; $_SESSION['Items'.$identifier]->totalVolume = 0; @@ -744,8 +744,8 @@ echo '<td><input class="number" tabindex="2" type="text" name="Quantity_' . $OrderLine->LineNumber . '" size="6" maxlength="6" value="' . $OrderLine->Quantity . '" />'; echo '</td> - <td class="number">' . $OrderLine->QOHatLoc . '</td> - <td>' . $OrderLine->Units . '</td>'; + <td class="number">' . $OrderLine->QOHatLoc . '</td> + <td>' . $OrderLine->Units . '</td>'; echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size="16" maxlength="16" value="' . $OrderLine->Price . '" /></td> <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size="5" maxlength="4" value="' . ($OrderLine->DiscountPercent * 100) . '" /></td> Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/Locations.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -31,27 +31,22 @@ prnMsg( _('The location code may not be empty'), 'error'); } if ($_POST['CashSaleCustomer']!=''){ - if (!strstr($_POST['CashSaleCustomer'],'-')){ - $InputError =1; - prnMsg(_('The cash sale customers '.$_POST['CashSaleCustomer'].' account must be a valid customer account separated by " - " then the branch code of the customer entered'), 'error'); - } else { - // $Branch = substr($_POST['CashSaleCustomer'],strpos($_POST['CashSaleCustomer'],' - ')+3); - // $DebtorNo = substr($_POST['CashSaleCustomer'],0,strpos($_POST['CashSaleCustomer'],' - ')); - $arr = explode('-',$_POST['CashSaleCustomer']); - $DebtorNo = $arr[0]; - $Branch = $arr[1]; - $sql = "SELECT * FROM custbranch - WHERE debtorno='" . $DebtorNo . "' - AND branchcode='" . $Branch . "'"; + if ($_POST['CashSaleBranch']==''){ + prnMsg(_('A cash sale customer and branch are necessary to fully setup the counter sales functionality'),'error'); + $InputError =1; + } else { //customer branch is set too ... check it ties up with a valid customer + $sql = "SELECT * FROM custbranch + WHERE debtorno='" . $_POST['CashSaleCustomer'] . "' + AND branchcode='" . $_POST['CashSaleBranch'] . "'"; - // echo $sql; - $result = DB_query($sql,$db); - if (DB_num_rows($result)==0){ - $InputError = 1; - prnMsg(_('The cash sale customer for this location must be a valid customer code separated by " - " then a valid branch code for this customer'),'error'); - } - } + // echo $sql; + $result = DB_query($sql,$db); + if (DB_num_rows($result)==0){ + $InputError = 1; + prnMsg(_('The cash sale customer for this location must be defined with both a valid customer code and a valid branch code for this customer'),'error'); + } + } } //end of checking the customer - branch code entered @@ -79,6 +74,7 @@ contact='" . $_POST['Contact'] . "', taxprovinceid = '" . $_POST['TaxProvince'] . "', cashsalecustomer ='" . $_POST['CashSaleCustomer'] . "', + cashsalebranch ='" . $_POST['CashSaleBranch'] . "', managed = '" . $_POST['Managed'] . "' WHERE loccode = '" . $SelectedLocation . "'"; @@ -102,6 +98,7 @@ unset($_POST['TaxProvince']); unset($_POST['Managed']); unset($_POST['CashSaleCustomer']); + unset($_POST['CashSaleBranch']); unset($SelectedLocation); unset($_POST['Contact']); @@ -132,6 +129,7 @@ contact, taxprovinceid, cashsalecustomer, + cashsalebranch, managed ) VALUES ( @@ -149,6 +147,7 @@ '" . $_POST['Contact'] . "', '" . $_POST['TaxProvince'] . "', '" . $_POST['CashSaleCustomer'] . "', + '" . $_POST['CashSaleBranch'] . "', '" . $_POST['Managed'] . "' )"; @@ -189,6 +188,7 @@ unset($_POST['Email']); unset($_POST['TaxProvince']); unset($_POST['CashSaleCustomer']); + unset($_POST['CashSaleBranch']); unset($_POST['Managed']); unset($SelectedLocation); unset($_POST['Contact']); @@ -356,7 +356,6 @@ echo '<tr><th>' . _('Location Code') . '</th> <th>' . _('Location Name') . '</th> <th>' . _('Tax Province') . '</th> - <th>' . _('Managed') . '</th> </tr>'; $k=0; //row colour counter @@ -368,24 +367,22 @@ echo '<tr class="OddTableRows">'; $k=1; } - +/* warehouse management not implemented ... yet if($myrow['managed'] == 1) { $myrow['managed'] = _('Yes'); } else { $myrow['managed'] = _('No'); } - +*/ printf("<td>%s</td> <td>%s</td> <td>%s</td> - <td>%s</td> <td><a href='%sSelectedLocation=%s'>" . _('Edit') . "</td> <td><a href='%sSelectedLocation=%s&delete=1'>" . _('Delete') . '</td> </tr>', $myrow['loccode'], $myrow['locationname'], $myrow['description'], - $myrow['managed'], $_SERVER['PHP_SELF'] . '?' . SID . '&', $myrow['loccode'], $_SERVER['PHP_SELF'] . '?' . SID . '&', @@ -428,6 +425,7 @@ email, taxprovinceid, cashsalecustomer, + cashsalebranch, managed FROM locations WHERE loccode='" . $SelectedLocation . "'"; @@ -449,6 +447,7 @@ $_POST['Email'] = $myrow['email']; $_POST['TaxProvince'] = $myrow['taxprovinceid']; $_POST['CashSaleCustomer'] = $myrow['cashsalecustomer']; + $_POST['CashSaleBranch'] = $myrow['cashsalebranch']; $_POST['Managed'] = $myrow['managed']; @@ -501,6 +500,9 @@ if (!isset($_POST['CashSaleCustomer'])) { $_POST['CashSaleCustomer'] = ''; } + if (!isset($_POST['CashSaleBranch'])) { + $_POST['CashSaleBranch'] = ''; + } if (!isset($_POST['Managed'])) { $_POST['Managed'] = 0; } @@ -540,9 +542,12 @@ } echo '</select></td></tr>'; - echo '<tr><td>' . _('Default Counter Sales Customer') . ':' . '</td>'; + echo '<tr><td>' . _('Default Counter Sales Customer Code') . ':' . '</td>'; echo '<td><input type="Text" name="CashSaleCustomer" value="' . $_POST['CashSaleCustomer'] . - '" size=25 maxlength=23></td></tr>'; + '" size=11 maxlength=10></td></tr>'; + echo '<tr><td>' . _('Counter Sales Branch Code') . ':' . '</td>'; + echo '<td><input type="Text" name="CashSaleBranch" value="' . $_POST['CashSaleBranch'] . + '" size=11 maxlength=10></td></tr>'; /* This functionality is not written yet ... <tr><td><?php echo _('Enable Warehouse Management') . ':'; ?></td> Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/PricesByCost.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -24,20 +24,20 @@ }/*end of else StockCat */ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - prices.debtorno, - prices.branchcode, - (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) as cost, - prices.price as price, prices.debtorno as customer, prices.branchcode as branch, - prices.startdate, - prices.enddate - FROM stockmaster, prices - WHERE stockmaster.stockid=prices.stockid" . $Category . " - AND stockmaster.discontinued = 0 - AND prices.price" . $Comparator . "(stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) * '" . $_POST['Margin'] . "' - AND prices.typeabbrev ='" . $_POST['SalesType'] . "' - AND prices.currabrev ='" . $_POST['CurrCode'] . "' - AND (prices.enddate>='" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00')"; + stockmaster.description, + prices.debtorno, + prices.branchcode, + (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) as cost, + prices.price as price, prices.debtorno as customer, prices.branchcode as branch, + prices.startdate, + prices.enddate + FROM stockmaster, prices + WHERE stockmaster.stockid=prices.stockid" . $Category . " + AND stockmaster.discontinued = 0 + AND prices.price" . $Comparator . "(stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) * '" . $_POST['Margin'] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND (prices.enddate>='" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00')"; $result = DB_query($sql, $db); $numrow = DB_num_rows($result); @@ -45,25 +45,36 @@ //Update Prices $PriceCounter =0; while ($myrow = DB_fetch_array($result)) { - //update database if update pressed - $SQLUpdate = "UPDATE prices SET price = '" . $_POST['Price_' . $PriceCounter] . "' - WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' - AND prices.typeabbrev ='" . $_POST['SalesType'] . "' - AND prices.currabrev ='" . $_POST['CurrCode'] . "' - AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' - AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' - AND prices.startdate ='" . $_POST['StartDate_' . $PriceCounter] . "' - AND prices.enddate ='" . $_POST['EndDate_' . $PriceCounter] . "'"; - $ResultUpdate = DB_query($SQLUpdate, $db); - $SQLInsert = "INSERT INTO prices ( + + $SQLTestExists = "SELECT price FROM prices + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' + AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' + AND prices.startdate ='" . date('Y-m-d') . "'"; + $TestExistsResult = DB_query($SQLTestExists,$db); + if (DB_num_rows($TestExistsResult)==1){ + //then we are updating + $SQLUpdate = "UPDATE prices SET price = '" . $_POST['Price_' . $PriceCounter] . "' + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' + AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' + AND prices.startdate ='" . date('Y-m-d') . "' + AND prices.enddate ='" . $_POST['EndDate_' . $PriceCounter] . "'"; + $ResultUpdate = DB_query($SQLUpdate, $db); + } else { + //we need to add a new price from today + $SQLInsert = "INSERT INTO prices ( stockid, price, typeabbrev, currabrev, debtorno, branchcode, - startdate, - enddate + startdate ) VALUES ( '" . $_POST['StockID_' . $PriceCounter] . "', '" . $_POST['Price_' . $PriceCounter] . "', @@ -71,10 +82,10 @@ '" . $_POST['CurrCode'] . "', '" . $_POST['DebtorNo_' . $PriceCounter] . "', '" . $_POST['BranchCode_' . $PriceCounter] . "', - '" . date('Y-m-d') . "', - '2030-12-31' + '" . date('Y-m-d') . "' )"; - $ResultInsert = DB_query($SQLInsert, $db); + $ResultInsert = DB_query($SQLInsert, $db); + } $PriceCounter++; } DB_free_result($result); //clear the old result Deleted: trunk/PrintSalesOrder_generic.php =================================================================== --- trunk/PrintSalesOrder_generic.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/PrintSalesOrder_generic.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -1,194 +0,0 @@ -<?php - -/* $Revision: 1.2 $ */ - -/* $Id$*/ - -//$PageSecurity = 2; - -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'); - include('includes/header.inc'); - echo '<div class=centre><br><br><br>'; - prnMsg( _('Select an Order Number to Print before calling this page') , 'error'); - echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; - include('includes/footer.inc'); - exit(); -} - -/*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'); - -$sql = "SELECT salesorders.debtorno, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.deliverblind, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - locations.locationname - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.orderno='" . $_GET['TransNo'] . "'"; - -$result=DB_query($sql,$db, $ErrMsg); - -//If there are no rows, there's a problem. -if (DB_num_rows($result)==0){ - $title = _('Print Packing Slip Error'); - include('includes/header.inc'); - echo '<div class=centre><br><br><br>'; - prnMsg( _('Unable to Locate Order Number') . ' : ' . $_GET['TransNo'] . ' ', 'error'); - echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; - include('includes/footer.inc'); - exit(); -} elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ - - $myrow = DB_fetch_array($result); - /* Place the deliver blind variable into a hold variable to used when - producing the packlist */ - $DeliverBlind = $myrow['deliverblind']; - if ($myrow['printedpackingslip']==1 AND ($_GET['Reprint']!='OK' OR !isset($_GET['Reprint']))){ - $title = _('Print Packing Slip Error'); - include('includes/header.inc'); - echo '<p>'; - prnMsg( _('The packing slip for order number') . ' ' . $_GET['TransNo'] . ' ' . - _('has previously been printed') . '. ' . _('It was printed on'). ' ' . ConvertSQLDate($myrow['datepackingslipprinted']) . - '<br>' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); - echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">' - . _('Do a Re-Print') . ' (' . _('On Pre-Printed Stationery') . ') ' . _('Even Though Previously Printed') . '</a><p>' . - '<a href="' . $rootpath. '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">'. _('Do a Re-Print') . ' (' . _('Plain paper') . ' - ' . _('A4') . ' ' . _('landscape') . ') ' . _('Even Though Previously Printed'). '</a>'; - - echo '<br><br><br>'; - echo _('Or select another Order Number to Print'); - echo '<table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; - - include('includes/footer.inc'); - exit; - }//packing slip has been printed. -} - -/*retrieve the order details from the database to print */ - -/* Then there's an order to print and its not been printed already (or its been flagged for reprinting/ge_Width=807; -) -LETS GO */ -$PaperSize = 'A4_Landscape'; -include('includes/PDFStarter.php'); -$pdf->addInfo('Title', _('Customer Laser Packing Slip') ); -$pdf->addInfo('Subject', _('Laser Packing slip for order') . ' ' . $_GET['TransNo']); -$FontSize=12; - -$ListCount = 0; // UldisN -$Copy=''; - -for ($i=1;$i<=2;$i++){ /*Print it out twice one copy for customer and one for office */ - if ($i==2){ - $pdf->newPage(); - } - - $line_height=24; - - /* Now ... Has the order got any line items still outstanding to be invoiced */ - - $PageNumber = 1; - - $ErrMsg = _('There was a problem retrieving the order header details for Order Number') . ' ' . - $_GET['TransNo'] . ' ' . _('from the database'); - - $sql = "SELECT salesorderdetails.stkcode, - stockmaster.description, - salesorderdetails.quantity, - salesorderdetails.qtyinvoiced, - salesorderdetails.unitprice, - salesorderdetails.narrative - FROM salesorderdetails INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - WHERE salesorderdetails.orderno='" . $_GET['TransNo'] . "'"; - $result=DB_query($sql,$db, $ErrMsg); - - if (DB_num_rows($result)>0){ - /*Yes there are line items to start the ball rolling with a page header */ - include('includes/PDFSalesOrder_generic.inc'); - - while ($myrow2=DB_fetch_array($result)){ - - $ListCount ++; - - $DisplayQty = number_format($myrow2['quantity'],2); - $DisplayPrevDel = number_format($myrow2['qtyinvoiced'],2); - $DisplayQtySupplied = number_format($myrow2['quantity'] - $myrow2['qtyinvoiced'],2); - $itemdesc = $myrow2['description'] . ' - ' . $myrow2['narrative']; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,127,$FontSize,$myrow2['stkcode']); - $LeftOvers = $pdf->addTextWrap(147,$YPos,355,$FontSize,$itemdesc); - $LeftOvers = $pdf->addTextWrap(400,$YPos,85,$FontSize,$DisplayQty,'right'); - $LeftOvers = $pdf->addTextWrap(503,$YPos,85,$FontSize,$DisplayQtySupplied,'right'); - $LeftOvers = $pdf->addTextWrap(602,$YPos,85,$FontSize,$DisplayPrevDel,'right'); - - if ($YPos-$line_height <= 50){ - /* We reached the end of the page so finsih off the page and start a newy */ - $PageNumber++; - include ('includes/PDFSalesOrder_generic.inc'); - } //end if need a new page headed up - else{ - /*increment a line down for the next line item */ - $YPos -= ($line_height); - } - } //end while there are line items to print out - - } /*end if there are order details to show on the order*/ - - $Copy='Customer'; - -} /*end for loop to print the whole lot twice */ - -if ($ListCount == 0){ - $title = _('Print Packing Slip Error'); - include('includes/header.inc'); - echo '<p>'. _('There were no outstanding items on the order to deliver. A packing slip cannot be printed'). - '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">'. _('Print Another Packing Slip/Order'). - '</a>' . '<br>'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; -} else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_SalesOrder_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN - - $sql = "UPDATE salesorders SET printedpackingslip=1, datepackingslipprinted='" . Date('Y-m-d') . "' WHERE salesorders.orderno='" .$_GET['TransNo'] . "'"; - $result = DB_query($sql,$db); -} - -?> \ No newline at end of file Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/SelectOrderItems.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -35,7 +35,7 @@ } -if (empty($_GET['identifier'])) { +if (empty($_GET['identifier'])) { /*unique session identifier to ensure that there is no conflict with other order entry sessions on the same machine */ $identifier=date('U'); } else { @@ -79,51 +79,50 @@ /*read in all the guff from the selected order into the Items cart */ $OrderHeaderSQL = "SELECT salesorders.debtorno, - debtorsmaster.name, - salesorders.branchcode, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.ordertype, - salestypes.sales_type, - salesorders.shipvia, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.contactphone, - salesorders.contactemail, - salesorders.freightcost, - salesorders.deliverydate, - debtorsmaster.currcode, - paymentterms.terms, - salesorders.fromstkloc, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - salesorders.quotation, - salesorders.deliverblind, - debtorsmaster.customerpoline, - locations.locationname, - custbranch.estdeliverydays, - custbranch.salesman - FROM salesorders, - debtorsmaster, - salestypes, - custbranch, - paymentterms, - locations - WHERE salesorders.ordertype=salestypes.typeabbrev - AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND locations.loccode=salesorders.fromstkloc - AND salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; + debtorsmaster.name, + salesorders.branchcode, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.ordertype, + salestypes.sales_type, + salesorders.shipvia, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.contactphone, + salesorders.contactemail, + salesorders.freightcost, + salesorders.deliverydate, + debtorsmaster.currcode, + paymentterms.terms, + salesorders.fromstkloc, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + salesorders.quotation, + salesorders.deliverblind, + debtorsmaster.customerpoline, + locations.locationname, + custbranch.estdeliverydays, + custbranch.salesman + FROM salesorders, + debtorsmaster, + salestypes, + custbranch, + paymentterms, + locations + WHERE salesorders.ordertype=salestypes.typeabbrev + AND salesorders.debtorno = debtorsmaster.debtorno + AND salesorders.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + AND debtorsmaster.paymentterms=paymentterms.termsindicator + AND locations.loccode=salesorders.fromstkloc + AND salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; - $ErrMsg = _('The order cannot be retrieved because'); $GetOrdHdrResult = DB_query($OrderHeaderSQL,$db,$ErrMsg); @@ -338,7 +337,7 @@ LEFT JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno WHERE custbranch.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' OR custbranch.branchcode " . LIKE . " '%" . $_POST['CustCode'] . "%'"; - + if ($_SESSION['SalesmanLogin']!=''){ $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } @@ -346,16 +345,16 @@ ORDER BY custbranch.debtorno'; } elseif (strlen($_POST['CustPhone'])>0){ $SQL = "SELECT custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode, - custbranch.debtorno, - debtorsmaster.name - FROM custbranch - LEFT JOIN debtorsmaster - ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%'"; + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.branchcode, + custbranch.debtorno, + debtorsmaster.name + FROM custbranch + INNER JOIN debtorsmaster + ON custbranch.debtorno=debtorsmaster.debtorno + WHERE custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%'"; if ($_SESSION['SalesmanLogin']!=''){ $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; @@ -370,7 +369,8 @@ if (DB_num_rows($result_CustSelect)==1){ $myrow=DB_fetch_array($result_CustSelect); - $SelectedCustomer= $myrow['debtorno'] . ' - ' . $myrow['branchcode']; + $SelectedCustomer = $myrow['debtorno']; + $SelectedBranch = $myrow['branchcode']; } elseif (DB_num_rows($result_CustSelect)==0){ prnMsg(_('No Customer Branch records contain the search criteria') . ' - ' . _('please try again') . ' - ' . _('Note a Customer Branch Name may be different to the Customer Name'),'info'); } @@ -388,16 +388,16 @@ prnMsg(_('Unable to identify the selected customer'),'error'); } else { $SelectedCustomer = $_POST['SelectedCustomer'.$i]; + $SelectedBranch = $_POST['SelectedBranch'.$i]; } } /* will only be true if page called from customer selection form or set because only one customer record returned from a search so parse the $SelectCustomer string into customer code and branch code */ if (isset($SelectedCustomer)) { - - $CustomerBranchArray = explode('-',$SelectedCustomer); - $_SESSION['Items'.$identifier]->DebtorNo = trim($CustomerBranchArray[0]); - $_SESSION['Items'.$identifier]->Branch = trim($CustomerBranchArray[1]); + $_SESSION['Items'.$identifier]->DebtorNo = trim($SelectedCustomer); + $_SESSION['Items'.$identifier]->Branch = trim($SelectedBranch); + // Now check to ensure this account is not on hold */ $sql = "SELECT debtorsmaster.name, holdreasons.dissallowinvoices, @@ -661,7 +661,7 @@ echo '<td></td>'; } echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8'). '"></td> - <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'] .' - '.$myrow['branchcode'].'"> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'"> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> @@ -1418,7 +1418,7 @@ $SQL="SELECT stockmaster.units, stockmaster.description, stockmaster.stockid, - salesorderdetails.stkcode, + salesorderdetails.stkcode, SUM(qtyinvoiced) salesqty FROM `salesorderdetails`INNER JOIN `stockmaster` ON salesorderdetails.stkcode = stockmaster.stockid @@ -1580,7 +1580,7 @@ echo '</select></td> <td><b>' . _('Enter partial Description') . ':</b><input tabindex=2 type="Text" name="Keywords" size=20 maxlength=25 value="' ; - + if (isset($_POST['Keywords'])) { echo$_POST['Keywords'] ; } Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/SelectSalesOrder.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -5,10 +5,10 @@ include('includes/session.inc'); $title = _('Search Outstanding Sales Orders'); include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); +if (isset($_POST['PlacePO'])){ /*user hit button to place PO for selected orders */ -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++){ @@ -25,235 +25,279 @@ } 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, - purchdata.suppliersuom, - stockmaster.kgs, - stockmaster.volume, - stockcategory.stockact, - 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 - INNER JOIN stockcategory ON - stockmaster.categoryid = stockcategory.categoryid - 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, - purchdata.suppliersuom, - stockmaster.kgs, - stockmaster.volume, - stockcategory.stockact - ORDER BY purchdata.supplierno, - purchdata.stockid"; + purchdata.stockid, + purchdata.price, + purchdata.suppliers_partno, + purchdata.supplierdescription, + purchdata.conversionfactor, + purchdata.leadtime, + purchdata.suppliersuom, + stockmaster.kgs, + stockmaster.volume, + stockcategory.stockact, + 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 + INNER JOIN stockcategory ON + stockmaster.categoryid = stockcategory.categoryid + 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, + purchdata.suppliersuom, + stockmaster.kgs, + stockmaster.volume, + stockcategory.stockact + 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); - + if (DB_num_rows($ItemResult)==0){ prnMsg(_('There might be no supplier purchasing data set up for any items on the selected sales order(s). No purchase orders have been created'),'warn'); } else { /*Now get the default delivery address details from the users default stock location */ $sql = "SELECT locationname, - deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - contact - FROM locations - WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; $ErrMsg = _('The delivery address for the order could not be obtained from the user default stock location'); $DelAddResult = DB_query($sql, $db,$ErrMsg); $DelAddRow = DB_fetch_array($DelAddResult); - + $SupplierID = ''; + if (IsEmailAddress($_SESSION['UserEmail'])){ $UserDetails = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; } else { $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; } - + while ($ItemRow = DB_fetch_array($ItemResult)){ - - if ($SupplierID != $ItemRow['supplierno']){ - /* This order item is purchased from a different supplier so need to finish off the authorisation of the previous order and start a new order */ - - if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { + + if ($SupplierID != $ItemRow['supplierno']){ + /* This order item is purchased from a different supplier so need to finish off the authorisation of the previous order and start a new order */ + + if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { + /* if an order is/has been created already and the supplier of this item has changed - so need to finish off the order */ //if the user has authority to authorise the PO then it should be created as authorised $AuthSQL ="SELECT authlevel - FROM purchorderauth - WHERE userid='".$_SESSION['UserID']."' - AND currabrev='".$SuppRow['currcode']."'"; - + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$SuppRow['currcode']."'"; + $AuthResult=DB_query($AuthSQL,$db); $AuthRow=DB_fetch_array($AuthResult); - + if ($AuthRow['authlevel']=''){ + $AuthRow['authlevel'] = 0; + } + if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; - $result = DB_query("UPDATE purchorders SET allowprint=1, - status='Authorised', - stat_comment='" . $StatusComment . "' - WHERE orderno='" . $OrderNo . "'", - $db); + $StatusComment = date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . ' ' . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; + $ErrMsg = _('Could not update purchase order status to Authorised'); + $Debug = _('The SQL that failed was'); + $result = DB_query("UPDATE purchorders SET allowprint=1, + status='Authorised', + stat_comment='" . $StatusComment . "' + WHERE orderno='" . $PO_OrderNo . "'", + $db,$ErrMsg,$DbgMsg,true); } else { // no authority to authorise this order if (DB_num_rows($AuthResult) ==0){ $AuthMessage = _('Your authority to approve purchase orders in') . ' ' .$SuppRow['currcode'] . ' ' . _('has not yet been set up') . '<br />'; } else { $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; } - + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. $SuppRow['currcode'] . ' '. $Order_Value .'. '. $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. _('The order has been created with a status of pending and will require authorisation'), 'warn'); } } //end of authorisation status settings - + if ($SupplierID !=''){ //then we have just added a purchase order - echo '<p>'; - prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $ItemRow['supplierno'] . ' ' . _('has been created'),'success'); + echo '<p />'; + prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $SupplierID . ' ' . _('has been created'),'success'); DB_Txn_Commit($db); } - /*Starting a new purchase order with a different supplier */ + + /*Starting a new purchase order with a different supplier */ $result = DB_Txn_Begin($db); - include('includes/SQL_CommonFunctions.inc'); + $PO_OrderNo = GetNextTransNo(18, $db); //get the next PO number - + $SupplierID = $ItemRow['supplierno']; $Order_Value =0; /*Now get all the required details for the supplier */ $sql = "SELECT address1, - address2, - address3, - address4, - address5, - address6, - telephone, - paymentterms, - currcode, - rate - FROM suppliers INNER JOIN currencies - ON suppliers.currcode = currencies.currabrev - WHERE supplierid='" . $SupplierID . "'"; - + address2, + address3, + address4, + address5, + address6, + telephone, + paymentterms, + currcode, + rate + FROM suppliers INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev + WHERE supplierid='" . $SupplierID . "'"; + $ErrMsg = _('Could not get the supplier information for the order'); $SuppResult = DB_query($sql, $db, $ErrMsg); $SuppRow = DB_fetch_array($SuppResult); - + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . ' ' . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; /*Insert to purchase order header record */ - $sql = "INSERT INTO purchorders ( orderno, - supplierno, - orddate, - rate, - initiator, - intostocklocation, - deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - suppdeladdress1, - suppdeladdress2, - suppdeladdress3, - suppdeladdress4, - suppdeladdress5, - suppdeladdress6, - supptel, - version, - revised, - deliveryby, - status, - stat_comment, - deliverydate, - paymentterms, - allowprint) - VALUES( '" . $PO_OrderNo . "', - '" . $SupplierID . "', - '" . Date('Y-m-d') . "', - '" . $SuppRow['rate'] . "', - '" . $_SESSION['UsersRealName'] . "', - '" . $_SESSION['UserStockLocation'] . "', - '" . $DelAddRow['locationname'] . "', - '" . $DelAddRow['deladd1'] . "', - '" . $DelAddRow['deladd2'] . "', - '" . $DelAddRow['deladd3'] . "', - '" . $DelAddRow['deladd4'] . "', - '" . $DelAddRow['deladd5'] . ' ' . $DelAddRow['deladd6'] . "', - '" . $DelAddRow['tel'] . "', - '" . $SuppRow['address1'] . "', - '" . $SuppRow['address2'] . "', - '" . $SuppRow['address3'] . "', - '" . $SuppRow['address4'] . "', - '" . $SuppRow['address5'] . "', - '" . $SuppRow['address6'] . "', - '" . $SuppRow['telephone'] . "', - '1.0', - '" . Date('Y-m-d') . "', - '" . $_SESSION['Default_Shipper'] . "', - 'Pending', - '" . $StatusComment . "', - '" . Date('Y-m-d') . "', - '" . $SuppRow['paymentterms'] . "', - 0)"; - + $sql = "INSERT INTO purchorders ( orderno, + supplierno, + orddate, + rate, + initiator, + intostocklocation, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + suppdeladdress1, + suppdeladdress2, + suppdeladdress3, + suppdeladdress4, + suppdeladdress5, + suppdeladdress6, + supptel, + version, + revised, + deliveryby, + status, + stat_comment, + deliverydate, + paymentterms, + allowprint) + VALUES( '" . $PO_OrderNo . "', + '" . $SupplierID . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['rate'] . "', + '" . $_SESSION['UsersRealName'] . "', + ... [truncated message content] |
From: <dai...@us...> - 2011-03-15 09:33:16
|
Revision: 4511 http://web-erp.svn.sourceforge.net/web-erp/?rev=4511&view=rev Author: daintree Date: 2011-03-15 09:33:07 +0000 (Tue, 15 Mar 2011) Log Message: ----------- various Modified Paths: -------------- trunk/CounterSales.php trunk/Locations.php trunk/PricesByCost.php trunk/SelectOrderItems.php trunk/SelectSalesOrder.php trunk/doc/Change.log.html trunk/sql/mysql/upgrade3.11.1-4.00.sql Removed Paths: ------------- trunk/PrintSalesOrder_generic.php Modified: trunk/CounterSales.php =================================================================== --- trunk/CounterSales.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/CounterSales.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -66,10 +66,11 @@ $_SESSION['PrintedPackingSlip'] = 0; /*Of course 'cos the order ain't even started !!*/ /*Get the default customer-branch combo from the user's default location record */ $sql = "SELECT cashsalecustomer, - locationname, - taxprovinceid - FROM locations - WHERE loccode='" . $_SESSION['UserStockLocation'] ."'"; + cashsalebranch, + locationname, + taxprovinceid + FROM locations + WHERE loccode='" . $_SESSION['UserStockLocation'] ."'"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0) { prnMsg(_('Your user account does not have a valid default inventory location set up. Please see the system administrator to modify your user account.'),'error'); @@ -78,36 +79,34 @@ } else { $myrow = DB_fetch_array($result); //get the only row returned - if ($myrow['cashsalecustomer']==''){ - prnMsg(_('To use this script it is first necessary to define a cash sales customer for the location that is your default location. The default cash sale customer is defined under set up ->Inventory Locations Maintenance. The customer should be entered using the customer code a hypen then the branch code of the customer to use.'),'error'); + if ($myrow['cashsalecustomer']=='' OR $myrow['cashsalebranch']==''){ + prnMsg(_('To use this script it is first necessary to define a cash sales customer for the location that is your default location. The default cash sale customer is defined under set up ->Inventory Locations Maintenance. The customer should be entered using the customer code and a valid branch code of the customer entered.'),'error'); include('includes/footer.inc'); exit; } - $CashSaleCustomer = explode('-',$myrow['cashsalecustomer']); - - $_SESSION['Items'.$identifier]->Branch = $CashSaleCustomer[1]; - $_SESSION['Items'.$identifier]->DebtorNo = $CashSaleCustomer[0]; + $_SESSION['Items'.$identifier]->Branch = $myrow['cashsalebranch']; + $_SESSION['Items'.$identifier]->DebtorNo = $myrow['cashsalecustomer']; $_SESSION['Items'.$identifier]->LocationName = $myrow['locationname']; $_SESSION['Items'.$identifier]->Location = $_SESSION['UserStockLocation']; $_SESSION['Items'.$identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; // Now check to ensure this account exists and set defaults */ $sql = "SELECT debtorsmaster.name, - holdreasons.dissallowinvoices, - debtorsmaster.salestype, - salestypes.sales_type, - debtorsmaster.currcode, - debtorsmaster.customerpoline, - paymentterms.terms - FROM debtorsmaster, - holdreasons, - salestypes, - paymentterms - WHERE debtorsmaster.salestype=salestypes.typeabbrev - AND debtorsmaster.holdreason=holdreasons.reasoncode - AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; + holdreasons.dissallowinvoices, + debtorsmaster.salestype, + salestypes.sales_type, + debtorsmaster.currcode, + debtorsmaster.customerpoline, + paymentterms.terms + FROM debtorsmaster, + holdreasons, + salestypes, + paymentterms + WHERE debtorsmaster.salestype=salestypes.typeabbrev + AND debtorsmaster.holdreason=holdreasons.reasoncode + AND debtorsmaster.paymentterms=paymentterms.termsindicator + AND debtorsmaster.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; $ErrMsg = _('The details of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->DebtorNo . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the customer details and failed was') . ':'; @@ -132,19 +131,18 @@ /* now get the branch defaults from the customer branches table CustBranch. */ $sql = "SELECT custbranch.brname, - custbranch.braddress1, - custbranch.defaultshipvia, - custbranch.deliverblind, - custbranch.specialinstructions, - custbranch.estdeliverydays, - custbranch.salesman, - custbranch.taxgroupid, - custbranch.defaultshipvia - FROM custbranch - WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' - AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; - - $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('cannot be retrieved because'); + custbranch.braddress1, + custbranch.defaultshipvia, + custbranch.deliverblind, + custbranch.specialinstructions, + custbranch.estdeliverydays, + custbranch.salesman, + custbranch.taxgroupid, + custbranch.defaultshipvia + FROM custbranch + WHERE custbranch.branchcode='" . $_SESSION['Items'.$identifier]->Branch . "' + AND custbranch.debtorno = '" . $_SESSION['Items'.$identifier]->DebtorNo . "'"; + $ErrMsg = _('The customer branch record of the customer selected') . ': ' . $_SESSION['Items'.$identifier]->Branch . ' ' . _('cannot be retrieved because'); $DbgMsg = _('SQL used to retrieve the branch details was') . ':'; $result =DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -210,7 +208,6 @@ } else { /*Not cancelling the order */ echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/inventory.png" title="' . _('Counter Sales') . '" alt="" />' . ' '; - echo _('Counter Sale') . ' - ' . $_SESSION['Items'.$identifier]->LocationName . ' (' . _('all amounts in') . ' ' . $_SESSION['Items'.$identifier]->DefaultCurrency . ')'; echo '</p>'; } @@ -231,30 +228,30 @@ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, - stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, + stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.description " . LIKE . " '" . $SearchString . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.description " . LIKE . " '" . $SearchString . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else if (strlen($_POST['StockCode'])>0){ @@ -264,55 +261,55 @@ if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.stockid " . LIKE . " '" . $SearchString . "' + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } else { if ($_POST['StockCat']=='All'){ $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - ORDER BY stockmaster.stockid"; - } else { + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + ORDER BY stockmaster.stockid"; + } else { $SQL = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units - FROM stockmaster, stockcategory - WHERE stockmaster.categoryid=stockcategory.categoryid - AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') - AND stockmaster.mbflag <>'G' - AND stockmaster.controlled <> 1 - AND stockmaster.discontinued=0 - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid"; + stockmaster.description, + stockmaster.units + FROM stockmaster, stockcategory + WHERE stockmaster.categoryid=stockcategory.categoryid + AND (stockcategory.stocktype='F' OR stockcategory.stocktype='D') + AND stockmaster.mbflag <>'G' + AND stockmaster.controlled <> 1 + AND stockmaster.discontinued=0 + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid"; } } @@ -426,11 +423,11 @@ } elseif ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because') . ' '; $KitResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -441,6 +438,7 @@ $NewItemQty = $KitParts['quantity'] * $ParentQty; $NewPOLine = 0; include('includes/SelectOrderItems_IntoCart.inc'); + $_SESSION['Items'.$identifier]->GetTaxes(($_SESSION['Items'.$identifier]->LineCounter - 1)); } } else if ($myrow['mbflag']=='G'){ @@ -449,6 +447,7 @@ prnMsg(_('The system does not currently cater for counter sales of lot controlled or serialised items'),'warn'); } else { /*Its not a kit set item*/ include('includes/SelectOrderItems_IntoCart.inc'); + $_SESSION['Items'.$identifier]->GetTaxes(($_SESSION['Items'.$identifier]->LineCounter - 1)); } } } @@ -515,9 +514,10 @@ if (isset($_POST['Recalculate'])) { foreach ($_SESSION['Items'.$identifier]->LineItems as $OrderLine) { $NewItem=$OrderLine->StockID; - $sql = "SELECT stockmaster.mbflag, stockmaster.controlled - FROM stockmaster - WHERE stockmaster.stockid='". $OrderLine->StockID."'"; + $sql = "SELECT stockmaster.mbflag, + stockmaster.controlled + FROM stockmaster + WHERE stockmaster.stockid='". $OrderLine->StockID."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); $DbgMsg = _('The sql that was used to determine if the part being ordered was a kitset or not was '); @@ -525,11 +525,11 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $OrderLine->StockID. "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $OrderLine->StockID. "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -559,9 +559,9 @@ * controlled items and ghost/phantom items cannot be selected because the SQL to show items to select doesn't show 'em * */ $sql = "SELECT stockmaster.mbflag, - stockmaster.taxcatid - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; + stockmaster.taxcatid + FROM stockmaster + WHERE stockmaster.stockid='". $NewItem ."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); @@ -573,11 +573,11 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -610,8 +610,8 @@ foreach($NewItemArray as $NewItem => $NewItemQty) { if($NewItemQty > 0) { $sql = "SELECT stockmaster.mbflag - FROM stockmaster - WHERE stockmaster.stockid='". $NewItem ."'"; + FROM stockmaster + WHERE stockmaster.stockid='". $NewItem ."'"; $ErrMsg = _('Could not determine if the part being ordered was a kitset or not because'); @@ -623,11 +623,11 @@ if ($myrow=DB_fetch_array($KitResult)){ if ($myrow['mbflag']=='K'){ /*It is a kit set item */ $sql = "SELECT bom.component, - bom.quantity - FROM bom - WHERE bom.parent='" . $NewItem . "' - AND bom.effectiveto > '" . Date('Y-m-d') . "' - AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; + bom.quantity + FROM bom + WHERE bom.parent='" . $NewItem . "' + AND bom.effectiveto > '" . Date('Y-m-d') . "' + AND bom.effectiveafter < '" . Date('Y-m-d') . "'"; $ErrMsg = _('Could not retrieve kitset components from the database because'); $KitResult = DB_query($sql,$db,$ErrMsg); @@ -670,10 +670,10 @@ } } $result = DB_query("SELECT MAX(discountrate) AS discount - FROM discountmatrix - WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' - AND discountcategory ='" . $OrderLine->DiscCat . "' - AND quantitybreak <'" . $QuantityOfDiscCat . "'",$db); + FROM discountmatrix + WHERE salestype='" . $_SESSION['Items'.$identifier]->DefaultSalesType . "' + AND discountcategory ='" . $OrderLine->DiscCat . "' + AND quantitybreak <'" . $QuantityOfDiscCat . "'",$db); $myrow = DB_fetch_row($result); if ($myrow[0]!=0){ /* need to update the lines affected */ foreach ($_SESSION['Items'.$identifier]->LineItems as $StkItems_2) { @@ -697,17 +697,17 @@ <table width="90%" cellpadding="2" colspan="7"> <tr bgcolor="#800000">'; echo '<th>' . _('Item Code') . '</th> - <th>' . _('Item Description') . '</th> - <th>' . _('Quantity') . '</th> - <th>' . _('QOH') . '</th> - <th>' . _('Unit') . '</th> - <th>' . _('Price') . '</th> - <th>' . _('Discount') . '</th> - <th>' . _('GP %') . '</th> - <th>' . _('Net') . '</th> - <th>' . _('Tax') . '</th> - <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> - </tr>'; + <th>' . _('Item Description') . '</th> + <th>' . _('Quantity') . '</th> + <th>' . _('QOH') . '</th> + <th>' . _('Unit') . '</th> + <th>' . _('Price') . '</th> + <th>' . _('Discount') . '</th> + <th>' . _('GP %') . '</th> + <th>' . _('Net') . '</th> + <th>' . _('Tax') . '</th> + <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> + </tr>'; $_SESSION['Items'.$identifier]->total = 0; $_SESSION['Items'.$identifier]->totalVolume = 0; @@ -744,8 +744,8 @@ echo '<td><input class="number" tabindex="2" type="text" name="Quantity_' . $OrderLine->LineNumber . '" size="6" maxlength="6" value="' . $OrderLine->Quantity . '" />'; echo '</td> - <td class="number">' . $OrderLine->QOHatLoc . '</td> - <td>' . $OrderLine->Units . '</td>'; + <td class="number">' . $OrderLine->QOHatLoc . '</td> + <td>' . $OrderLine->Units . '</td>'; echo '<td><input class="number" type="text" name="Price_' . $OrderLine->LineNumber . '" size="16" maxlength="16" value="' . $OrderLine->Price . '" /></td> <td><input class="number" type="text" name="Discount_' . $OrderLine->LineNumber . '" size="5" maxlength="4" value="' . ($OrderLine->DiscountPercent * 100) . '" /></td> Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/Locations.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -31,27 +31,22 @@ prnMsg( _('The location code may not be empty'), 'error'); } if ($_POST['CashSaleCustomer']!=''){ - if (!strstr($_POST['CashSaleCustomer'],'-')){ - $InputError =1; - prnMsg(_('The cash sale customers '.$_POST['CashSaleCustomer'].' account must be a valid customer account separated by " - " then the branch code of the customer entered'), 'error'); - } else { - // $Branch = substr($_POST['CashSaleCustomer'],strpos($_POST['CashSaleCustomer'],' - ')+3); - // $DebtorNo = substr($_POST['CashSaleCustomer'],0,strpos($_POST['CashSaleCustomer'],' - ')); - $arr = explode('-',$_POST['CashSaleCustomer']); - $DebtorNo = $arr[0]; - $Branch = $arr[1]; - $sql = "SELECT * FROM custbranch - WHERE debtorno='" . $DebtorNo . "' - AND branchcode='" . $Branch . "'"; + if ($_POST['CashSaleBranch']==''){ + prnMsg(_('A cash sale customer and branch are necessary to fully setup the counter sales functionality'),'error'); + $InputError =1; + } else { //customer branch is set too ... check it ties up with a valid customer + $sql = "SELECT * FROM custbranch + WHERE debtorno='" . $_POST['CashSaleCustomer'] . "' + AND branchcode='" . $_POST['CashSaleBranch'] . "'"; - // echo $sql; - $result = DB_query($sql,$db); - if (DB_num_rows($result)==0){ - $InputError = 1; - prnMsg(_('The cash sale customer for this location must be a valid customer code separated by " - " then a valid branch code for this customer'),'error'); - } - } + // echo $sql; + $result = DB_query($sql,$db); + if (DB_num_rows($result)==0){ + $InputError = 1; + prnMsg(_('The cash sale customer for this location must be defined with both a valid customer code and a valid branch code for this customer'),'error'); + } + } } //end of checking the customer - branch code entered @@ -79,6 +74,7 @@ contact='" . $_POST['Contact'] . "', taxprovinceid = '" . $_POST['TaxProvince'] . "', cashsalecustomer ='" . $_POST['CashSaleCustomer'] . "', + cashsalebranch ='" . $_POST['CashSaleBranch'] . "', managed = '" . $_POST['Managed'] . "' WHERE loccode = '" . $SelectedLocation . "'"; @@ -102,6 +98,7 @@ unset($_POST['TaxProvince']); unset($_POST['Managed']); unset($_POST['CashSaleCustomer']); + unset($_POST['CashSaleBranch']); unset($SelectedLocation); unset($_POST['Contact']); @@ -132,6 +129,7 @@ contact, taxprovinceid, cashsalecustomer, + cashsalebranch, managed ) VALUES ( @@ -149,6 +147,7 @@ '" . $_POST['Contact'] . "', '" . $_POST['TaxProvince'] . "', '" . $_POST['CashSaleCustomer'] . "', + '" . $_POST['CashSaleBranch'] . "', '" . $_POST['Managed'] . "' )"; @@ -189,6 +188,7 @@ unset($_POST['Email']); unset($_POST['TaxProvince']); unset($_POST['CashSaleCustomer']); + unset($_POST['CashSaleBranch']); unset($_POST['Managed']); unset($SelectedLocation); unset($_POST['Contact']); @@ -356,7 +356,6 @@ echo '<tr><th>' . _('Location Code') . '</th> <th>' . _('Location Name') . '</th> <th>' . _('Tax Province') . '</th> - <th>' . _('Managed') . '</th> </tr>'; $k=0; //row colour counter @@ -368,24 +367,22 @@ echo '<tr class="OddTableRows">'; $k=1; } - +/* warehouse management not implemented ... yet if($myrow['managed'] == 1) { $myrow['managed'] = _('Yes'); } else { $myrow['managed'] = _('No'); } - +*/ printf("<td>%s</td> <td>%s</td> <td>%s</td> - <td>%s</td> <td><a href='%sSelectedLocation=%s'>" . _('Edit') . "</td> <td><a href='%sSelectedLocation=%s&delete=1'>" . _('Delete') . '</td> </tr>', $myrow['loccode'], $myrow['locationname'], $myrow['description'], - $myrow['managed'], $_SERVER['PHP_SELF'] . '?' . SID . '&', $myrow['loccode'], $_SERVER['PHP_SELF'] . '?' . SID . '&', @@ -428,6 +425,7 @@ email, taxprovinceid, cashsalecustomer, + cashsalebranch, managed FROM locations WHERE loccode='" . $SelectedLocation . "'"; @@ -449,6 +447,7 @@ $_POST['Email'] = $myrow['email']; $_POST['TaxProvince'] = $myrow['taxprovinceid']; $_POST['CashSaleCustomer'] = $myrow['cashsalecustomer']; + $_POST['CashSaleBranch'] = $myrow['cashsalebranch']; $_POST['Managed'] = $myrow['managed']; @@ -501,6 +500,9 @@ if (!isset($_POST['CashSaleCustomer'])) { $_POST['CashSaleCustomer'] = ''; } + if (!isset($_POST['CashSaleBranch'])) { + $_POST['CashSaleBranch'] = ''; + } if (!isset($_POST['Managed'])) { $_POST['Managed'] = 0; } @@ -540,9 +542,12 @@ } echo '</select></td></tr>'; - echo '<tr><td>' . _('Default Counter Sales Customer') . ':' . '</td>'; + echo '<tr><td>' . _('Default Counter Sales Customer Code') . ':' . '</td>'; echo '<td><input type="Text" name="CashSaleCustomer" value="' . $_POST['CashSaleCustomer'] . - '" size=25 maxlength=23></td></tr>'; + '" size=11 maxlength=10></td></tr>'; + echo '<tr><td>' . _('Counter Sales Branch Code') . ':' . '</td>'; + echo '<td><input type="Text" name="CashSaleBranch" value="' . $_POST['CashSaleBranch'] . + '" size=11 maxlength=10></td></tr>'; /* This functionality is not written yet ... <tr><td><?php echo _('Enable Warehouse Management') . ':'; ?></td> Modified: trunk/PricesByCost.php =================================================================== --- trunk/PricesByCost.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/PricesByCost.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -24,20 +24,20 @@ }/*end of else StockCat */ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - prices.debtorno, - prices.branchcode, - (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) as cost, - prices.price as price, prices.debtorno as customer, prices.branchcode as branch, - prices.startdate, - prices.enddate - FROM stockmaster, prices - WHERE stockmaster.stockid=prices.stockid" . $Category . " - AND stockmaster.discontinued = 0 - AND prices.price" . $Comparator . "(stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) * '" . $_POST['Margin'] . "' - AND prices.typeabbrev ='" . $_POST['SalesType'] . "' - AND prices.currabrev ='" . $_POST['CurrCode'] . "' - AND (prices.enddate>='" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00')"; + stockmaster.description, + prices.debtorno, + prices.branchcode, + (stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) as cost, + prices.price as price, prices.debtorno as customer, prices.branchcode as branch, + prices.startdate, + prices.enddate + FROM stockmaster, prices + WHERE stockmaster.stockid=prices.stockid" . $Category . " + AND stockmaster.discontinued = 0 + AND prices.price" . $Comparator . "(stockmaster.materialcost + stockmaster.labourcost + stockmaster.overheadcost) * '" . $_POST['Margin'] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND (prices.enddate>='" . Date('Y-m-d') . "' OR prices.enddate='0000-00-00')"; $result = DB_query($sql, $db); $numrow = DB_num_rows($result); @@ -45,25 +45,36 @@ //Update Prices $PriceCounter =0; while ($myrow = DB_fetch_array($result)) { - //update database if update pressed - $SQLUpdate = "UPDATE prices SET price = '" . $_POST['Price_' . $PriceCounter] . "' - WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' - AND prices.typeabbrev ='" . $_POST['SalesType'] . "' - AND prices.currabrev ='" . $_POST['CurrCode'] . "' - AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' - AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' - AND prices.startdate ='" . $_POST['StartDate_' . $PriceCounter] . "' - AND prices.enddate ='" . $_POST['EndDate_' . $PriceCounter] . "'"; - $ResultUpdate = DB_query($SQLUpdate, $db); - $SQLInsert = "INSERT INTO prices ( + + $SQLTestExists = "SELECT price FROM prices + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' + AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' + AND prices.startdate ='" . date('Y-m-d') . "'"; + $TestExistsResult = DB_query($SQLTestExists,$db); + if (DB_num_rows($TestExistsResult)==1){ + //then we are updating + $SQLUpdate = "UPDATE prices SET price = '" . $_POST['Price_' . $PriceCounter] . "' + WHERE stockid = '" . $_POST['StockID_' . $PriceCounter] . "' + AND prices.typeabbrev ='" . $_POST['SalesType'] . "' + AND prices.currabrev ='" . $_POST['CurrCode'] . "' + AND prices.debtorno ='" . $_POST['DebtorNo_' . $PriceCounter] . "' + AND prices.branchcode ='" . $_POST['BranchCode_' . $PriceCounter] . "' + AND prices.startdate ='" . date('Y-m-d') . "' + AND prices.enddate ='" . $_POST['EndDate_' . $PriceCounter] . "'"; + $ResultUpdate = DB_query($SQLUpdate, $db); + } else { + //we need to add a new price from today + $SQLInsert = "INSERT INTO prices ( stockid, price, typeabbrev, currabrev, debtorno, branchcode, - startdate, - enddate + startdate ) VALUES ( '" . $_POST['StockID_' . $PriceCounter] . "', '" . $_POST['Price_' . $PriceCounter] . "', @@ -71,10 +82,10 @@ '" . $_POST['CurrCode'] . "', '" . $_POST['DebtorNo_' . $PriceCounter] . "', '" . $_POST['BranchCode_' . $PriceCounter] . "', - '" . date('Y-m-d') . "', - '2030-12-31' + '" . date('Y-m-d') . "' )"; - $ResultInsert = DB_query($SQLInsert, $db); + $ResultInsert = DB_query($SQLInsert, $db); + } $PriceCounter++; } DB_free_result($result); //clear the old result Deleted: trunk/PrintSalesOrder_generic.php =================================================================== --- trunk/PrintSalesOrder_generic.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/PrintSalesOrder_generic.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -1,194 +0,0 @@ -<?php - -/* $Revision: 1.2 $ */ - -/* $Id$*/ - -//$PageSecurity = 2; - -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'); - include('includes/header.inc'); - echo '<div class=centre><br><br><br>'; - prnMsg( _('Select an Order Number to Print before calling this page') , 'error'); - echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; - include('includes/footer.inc'); - exit(); -} - -/*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'); - -$sql = "SELECT salesorders.debtorno, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.deliverblind, - debtorsmaster.name, - debtorsmaster.address1, - debtorsmaster.address2, - debtorsmaster.address3, - debtorsmaster.address4, - debtorsmaster.address5, - debtorsmaster.address6, - shippers.shippername, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - locations.locationname - FROM salesorders, - debtorsmaster, - shippers, - locations - WHERE salesorders.debtorno=debtorsmaster.debtorno - AND salesorders.shipvia=shippers.shipper_id - AND salesorders.fromstkloc=locations.loccode - AND salesorders.orderno='" . $_GET['TransNo'] . "'"; - -$result=DB_query($sql,$db, $ErrMsg); - -//If there are no rows, there's a problem. -if (DB_num_rows($result)==0){ - $title = _('Print Packing Slip Error'); - include('includes/header.inc'); - echo '<div class=centre><br><br><br>'; - prnMsg( _('Unable to Locate Order Number') . ' : ' . $_GET['TransNo'] . ' ', 'error'); - echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; - include('includes/footer.inc'); - exit(); -} elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ - - $myrow = DB_fetch_array($result); - /* Place the deliver blind variable into a hold variable to used when - producing the packlist */ - $DeliverBlind = $myrow['deliverblind']; - if ($myrow['printedpackingslip']==1 AND ($_GET['Reprint']!='OK' OR !isset($_GET['Reprint']))){ - $title = _('Print Packing Slip Error'); - include('includes/header.inc'); - echo '<p>'; - prnMsg( _('The packing slip for order number') . ' ' . $_GET['TransNo'] . ' ' . - _('has previously been printed') . '. ' . _('It was printed on'). ' ' . ConvertSQLDate($myrow['datepackingslipprinted']) . - '<br>' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); - echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">' - . _('Do a Re-Print') . ' (' . _('On Pre-Printed Stationery') . ') ' . _('Even Though Previously Printed') . '</a><p>' . - '<a href="' . $rootpath. '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">'. _('Do a Re-Print') . ' (' . _('Plain paper') . ' - ' . _('A4') . ' ' . _('landscape') . ') ' . _('Even Though Previously Printed'). '</a>'; - - echo '<br><br><br>'; - echo _('Or select another Order Number to Print'); - echo '<table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; - - include('includes/footer.inc'); - exit; - }//packing slip has been printed. -} - -/*retrieve the order details from the database to print */ - -/* Then there's an order to print and its not been printed already (or its been flagged for reprinting/ge_Width=807; -) -LETS GO */ -$PaperSize = 'A4_Landscape'; -include('includes/PDFStarter.php'); -$pdf->addInfo('Title', _('Customer Laser Packing Slip') ); -$pdf->addInfo('Subject', _('Laser Packing slip for order') . ' ' . $_GET['TransNo']); -$FontSize=12; - -$ListCount = 0; // UldisN -$Copy=''; - -for ($i=1;$i<=2;$i++){ /*Print it out twice one copy for customer and one for office */ - if ($i==2){ - $pdf->newPage(); - } - - $line_height=24; - - /* Now ... Has the order got any line items still outstanding to be invoiced */ - - $PageNumber = 1; - - $ErrMsg = _('There was a problem retrieving the order header details for Order Number') . ' ' . - $_GET['TransNo'] . ' ' . _('from the database'); - - $sql = "SELECT salesorderdetails.stkcode, - stockmaster.description, - salesorderdetails.quantity, - salesorderdetails.qtyinvoiced, - salesorderdetails.unitprice, - salesorderdetails.narrative - FROM salesorderdetails INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid - WHERE salesorderdetails.orderno='" . $_GET['TransNo'] . "'"; - $result=DB_query($sql,$db, $ErrMsg); - - if (DB_num_rows($result)>0){ - /*Yes there are line items to start the ball rolling with a page header */ - include('includes/PDFSalesOrder_generic.inc'); - - while ($myrow2=DB_fetch_array($result)){ - - $ListCount ++; - - $DisplayQty = number_format($myrow2['quantity'],2); - $DisplayPrevDel = number_format($myrow2['qtyinvoiced'],2); - $DisplayQtySupplied = number_format($myrow2['quantity'] - $myrow2['qtyinvoiced'],2); - $itemdesc = $myrow2['description'] . ' - ' . $myrow2['narrative']; - $LeftOvers = $pdf->addTextWrap($XPos,$YPos,127,$FontSize,$myrow2['stkcode']); - $LeftOvers = $pdf->addTextWrap(147,$YPos,355,$FontSize,$itemdesc); - $LeftOvers = $pdf->addTextWrap(400,$YPos,85,$FontSize,$DisplayQty,'right'); - $LeftOvers = $pdf->addTextWrap(503,$YPos,85,$FontSize,$DisplayQtySupplied,'right'); - $LeftOvers = $pdf->addTextWrap(602,$YPos,85,$FontSize,$DisplayPrevDel,'right'); - - if ($YPos-$line_height <= 50){ - /* We reached the end of the page so finsih off the page and start a newy */ - $PageNumber++; - include ('includes/PDFSalesOrder_generic.inc'); - } //end if need a new page headed up - else{ - /*increment a line down for the next line item */ - $YPos -= ($line_height); - } - } //end while there are line items to print out - - } /*end if there are order details to show on the order*/ - - $Copy='Customer'; - -} /*end for loop to print the whole lot twice */ - -if ($ListCount == 0){ - $title = _('Print Packing Slip Error'); - include('includes/header.inc'); - echo '<p>'. _('There were no outstanding items on the order to deliver. A packing slip cannot be printed'). - '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">'. _('Print Another Packing Slip/Order'). - '</a>' . '<br>'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; - include('includes/footer.inc'); - exit; -} else { - $pdf->OutputD($_SESSION['DatabaseName'] . '_SalesOrder_' . date('Y-m-d') . '.pdf');//UldisN - $pdf->__destruct(); //UldisN - - $sql = "UPDATE salesorders SET printedpackingslip=1, datepackingslipprinted='" . Date('Y-m-d') . "' WHERE salesorders.orderno='" .$_GET['TransNo'] . "'"; - $result = DB_query($sql,$db); -} - -?> \ No newline at end of file Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/SelectOrderItems.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -35,7 +35,7 @@ } -if (empty($_GET['identifier'])) { +if (empty($_GET['identifier'])) { /*unique session identifier to ensure that there is no conflict with other order entry sessions on the same machine */ $identifier=date('U'); } else { @@ -79,51 +79,50 @@ /*read in all the guff from the selected order into the Items cart */ $OrderHeaderSQL = "SELECT salesorders.debtorno, - debtorsmaster.name, - salesorders.branchcode, - salesorders.customerref, - salesorders.comments, - salesorders.orddate, - salesorders.ordertype, - salestypes.sales_type, - salesorders.shipvia, - salesorders.deliverto, - salesorders.deladd1, - salesorders.deladd2, - salesorders.deladd3, - salesorders.deladd4, - salesorders.deladd5, - salesorders.deladd6, - salesorders.contactphone, - salesorders.contactemail, - salesorders.freightcost, - salesorders.deliverydate, - debtorsmaster.currcode, - paymentterms.terms, - salesorders.fromstkloc, - salesorders.printedpackingslip, - salesorders.datepackingslipprinted, - salesorders.quotation, - salesorders.deliverblind, - debtorsmaster.customerpoline, - locations.locationname, - custbranch.estdeliverydays, - custbranch.salesman - FROM salesorders, - debtorsmaster, - salestypes, - custbranch, - paymentterms, - locations - WHERE salesorders.ordertype=salestypes.typeabbrev - AND salesorders.debtorno = debtorsmaster.debtorno - AND salesorders.debtorno = custbranch.debtorno - AND salesorders.branchcode = custbranch.branchcode - AND debtorsmaster.paymentterms=paymentterms.termsindicator - AND locations.loccode=salesorders.fromstkloc - AND salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; + debtorsmaster.name, + salesorders.branchcode, + salesorders.customerref, + salesorders.comments, + salesorders.orddate, + salesorders.ordertype, + salestypes.sales_type, + salesorders.shipvia, + salesorders.deliverto, + salesorders.deladd1, + salesorders.deladd2, + salesorders.deladd3, + salesorders.deladd4, + salesorders.deladd5, + salesorders.deladd6, + salesorders.contactphone, + salesorders.contactemail, + salesorders.freightcost, + salesorders.deliverydate, + debtorsmaster.currcode, + paymentterms.terms, + salesorders.fromstkloc, + salesorders.printedpackingslip, + salesorders.datepackingslipprinted, + salesorders.quotation, + salesorders.deliverblind, + debtorsmaster.customerpoline, + locations.locationname, + custbranch.estdeliverydays, + custbranch.salesman + FROM salesorders, + debtorsmaster, + salestypes, + custbranch, + paymentterms, + locations + WHERE salesorders.ordertype=salestypes.typeabbrev + AND salesorders.debtorno = debtorsmaster.debtorno + AND salesorders.debtorno = custbranch.debtorno + AND salesorders.branchcode = custbranch.branchcode + AND debtorsmaster.paymentterms=paymentterms.termsindicator + AND locations.loccode=salesorders.fromstkloc + AND salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; - $ErrMsg = _('The order cannot be retrieved because'); $GetOrdHdrResult = DB_query($OrderHeaderSQL,$db,$ErrMsg); @@ -338,7 +337,7 @@ LEFT JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno WHERE custbranch.debtorno " . LIKE . " '%" . $_POST['CustCode'] . "%' OR custbranch.branchcode " . LIKE . " '%" . $_POST['CustCode'] . "%'"; - + if ($_SESSION['SalesmanLogin']!=''){ $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; } @@ -346,16 +345,16 @@ ORDER BY custbranch.debtorno'; } elseif (strlen($_POST['CustPhone'])>0){ $SQL = "SELECT custbranch.brname, - custbranch.contactname, - custbranch.phoneno, - custbranch.faxno, - custbranch.branchcode, - custbranch.debtorno, - debtorsmaster.name - FROM custbranch - LEFT JOIN debtorsmaster - ON custbranch.debtorno=debtorsmaster.debtorno - WHERE custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%'"; + custbranch.contactname, + custbranch.phoneno, + custbranch.faxno, + custbranch.branchcode, + custbranch.debtorno, + debtorsmaster.name + FROM custbranch + INNER JOIN debtorsmaster + ON custbranch.debtorno=debtorsmaster.debtorno + WHERE custbranch.phoneno " . LIKE . " '%" . $_POST['CustPhone'] . "%'"; if ($_SESSION['SalesmanLogin']!=''){ $SQL .= " AND custbranch.salesman='" . $_SESSION['SalesmanLogin'] . "'"; @@ -370,7 +369,8 @@ if (DB_num_rows($result_CustSelect)==1){ $myrow=DB_fetch_array($result_CustSelect); - $SelectedCustomer= $myrow['debtorno'] . ' - ' . $myrow['branchcode']; + $SelectedCustomer = $myrow['debtorno']; + $SelectedBranch = $myrow['branchcode']; } elseif (DB_num_rows($result_CustSelect)==0){ prnMsg(_('No Customer Branch records contain the search criteria') . ' - ' . _('please try again') . ' - ' . _('Note a Customer Branch Name may be different to the Customer Name'),'info'); } @@ -388,16 +388,16 @@ prnMsg(_('Unable to identify the selected customer'),'error'); } else { $SelectedCustomer = $_POST['SelectedCustomer'.$i]; + $SelectedBranch = $_POST['SelectedBranch'.$i]; } } /* will only be true if page called from customer selection form or set because only one customer record returned from a search so parse the $SelectCustomer string into customer code and branch code */ if (isset($SelectedCustomer)) { - - $CustomerBranchArray = explode('-',$SelectedCustomer); - $_SESSION['Items'.$identifier]->DebtorNo = trim($CustomerBranchArray[0]); - $_SESSION['Items'.$identifier]->Branch = trim($CustomerBranchArray[1]); + $_SESSION['Items'.$identifier]->DebtorNo = trim($SelectedCustomer); + $_SESSION['Items'.$identifier]->Branch = trim($SelectedBranch); + // Now check to ensure this account is not on hold */ $sql = "SELECT debtorsmaster.name, holdreasons.dissallowinvoices, @@ -661,7 +661,7 @@ echo '<td></td>'; } echo '<td><input tabindex='.($j+5).' type=submit name="SubmitCustomerSelection' . $j .'" value="' . htmlentities($myrow['brname'], ENT_QUOTES,'UTF-8'). '"></td> - <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'] .' - '.$myrow['branchcode'].'"> + <input type="hidden" name="SelectedCustomer' . $j .'" value="'.$myrow['debtorno'].'"><input type="hidden" name="SelectedBranch' . $j .'" value="'. $myrow['branchcode'].'"> <td>'.$myrow['contactname'].'</td> <td>'.$myrow['phoneno'].'</td> <td>'.$myrow['faxno'].'</td> @@ -1418,7 +1418,7 @@ $SQL="SELECT stockmaster.units, stockmaster.description, stockmaster.stockid, - salesorderdetails.stkcode, + salesorderdetails.stkcode, SUM(qtyinvoiced) salesqty FROM `salesorderdetails`INNER JOIN `stockmaster` ON salesorderdetails.stkcode = stockmaster.stockid @@ -1580,7 +1580,7 @@ echo '</select></td> <td><b>' . _('Enter partial Description') . ':</b><input tabindex=2 type="Text" name="Keywords" size=20 maxlength=25 value="' ; - + if (isset($_POST['Keywords'])) { echo$_POST['Keywords'] ; } Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-14 09:11:21 UTC (rev 4510) +++ trunk/SelectSalesOrder.php 2011-03-15 09:33:07 UTC (rev 4511) @@ -5,10 +5,10 @@ include('includes/session.inc'); $title = _('Search Outstanding Sales Orders'); include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); +if (isset($_POST['PlacePO'])){ /*user hit button to place PO for selected orders */ -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++){ @@ -25,235 +25,279 @@ } 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, - purchdata.suppliersuom, - stockmaster.kgs, - stockmaster.volume, - stockcategory.stockact, - 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 - INNER JOIN stockcategory ON - stockmaster.categoryid = stockcategory.categoryid - 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, - purchdata.suppliersuom, - stockmaster.kgs, - stockmaster.volume, - stockcategory.stockact - ORDER BY purchdata.supplierno, - purchdata.stockid"; + purchdata.stockid, + purchdata.price, + purchdata.suppliers_partno, + purchdata.supplierdescription, + purchdata.conversionfactor, + purchdata.leadtime, + purchdata.suppliersuom, + stockmaster.kgs, + stockmaster.volume, + stockcategory.stockact, + 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 + INNER JOIN stockcategory ON + stockmaster.categoryid = stockcategory.categoryid + 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, + purchdata.suppliersuom, + stockmaster.kgs, + stockmaster.volume, + stockcategory.stockact + 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); - + if (DB_num_rows($ItemResult)==0){ prnMsg(_('There might be no supplier purchasing data set up for any items on the selected sales order(s). No purchase orders have been created'),'warn'); } else { /*Now get the default delivery address details from the users default stock location */ $sql = "SELECT locationname, - deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - contact - FROM locations - WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode = '" .$_SESSION['UserStockLocation'] . "'"; $ErrMsg = _('The delivery address for the order could not be obtained from the user default stock location'); $DelAddResult = DB_query($sql, $db,$ErrMsg); $DelAddRow = DB_fetch_array($DelAddResult); - + $SupplierID = ''; + if (IsEmailAddress($_SESSION['UserEmail'])){ $UserDetails = ' <a href="mailto:' . $_SESSION['UserEmail'] . '">' . $_SESSION['UsersRealName']. '</a>'; } else { $UserDetails = ' ' . $_SESSION['UsersRealName'] . ' '; } - + while ($ItemRow = DB_fetch_array($ItemResult)){ - - if ($SupplierID != $ItemRow['supplierno']){ - /* This order item is purchased from a different supplier so need to finish off the authorisation of the previous order and start a new order */ - - if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { + + if ($SupplierID != $ItemRow['supplierno']){ + /* This order item is purchased from a different supplier so need to finish off the authorisation of the previous order and start a new order */ + + if ($SupplierID !='' AND $_SESSION['AutoAuthorisePO']==1) { + /* if an order is/has been created already and the supplier of this item has changed - so need to finish off the order */ //if the user has authority to authorise the PO then it should be created as authorised $AuthSQL ="SELECT authlevel - FROM purchorderauth - WHERE userid='".$_SESSION['UserID']."' - AND currabrev='".$SuppRow['currcode']."'"; - + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$SuppRow['currcode']."'"; + $AuthResult=DB_query($AuthSQL,$db); $AuthRow=DB_fetch_array($AuthResult); - + if ($AuthRow['authlevel']=''){ + $AuthRow['authlevel'] = 0; + } + if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order - $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; - $result = DB_query("UPDATE purchorders SET allowprint=1, - status='Authorised', - stat_comment='" . $StatusComment . "' - WHERE orderno='" . $OrderNo . "'", - $db); + $StatusComment = date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created and Authorised by') . ' ' . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; + $ErrMsg = _('Could not update purchase order status to Authorised'); + $Debug = _('The SQL that failed was'); + $result = DB_query("UPDATE purchorders SET allowprint=1, + status='Authorised', + stat_comment='" . $StatusComment . "' + WHERE orderno='" . $PO_OrderNo . "'", + $db,$ErrMsg,$DbgMsg,true); } else { // no authority to authorise this order if (DB_num_rows($AuthResult) ==0){ $AuthMessage = _('Your authority to approve purchase orders in') . ' ' .$SuppRow['currcode'] . ' ' . _('has not yet been set up') . '<br />'; } else { $AuthMessage = _('You can only authorise up to').' '.$SuppRow['currcode'].' '.$AuthRow['authlevel'].'.<br />'; } - + prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. $SuppRow['currcode'] . ' '. $Order_Value .'. '. $AuthMessage . _('If you think this is a mistake please contact the systems administrator') . '<br />'. _('The order has been created with a status of pending and will require authorisation'), 'warn'); } } //end of authorisation status settings - + if ($SupplierID !=''){ //then we have just added a purchase order - echo '<p>'; - prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $ItemRow['supplierno'] . ' ' . _('has been created'),'success'); + echo '<p />'; + prnMsg(_('Purchase Order') . ' ' . $PO_OrderNo . ' ' . _('on') . ' ' . $SupplierID . ' ' . _('has been created'),'success'); DB_Txn_Commit($db); } - /*Starting a new purchase order with a different supplier */ + + /*Starting a new purchase order with a different supplier */ $result = DB_Txn_Begin($db); - include('includes/SQL_CommonFunctions.inc'); + $PO_OrderNo = GetNextTransNo(18, $db); //get the next PO number - + $SupplierID = $ItemRow['supplierno']; $Order_Value =0; /*Now get all the required details for the supplier */ $sql = "SELECT address1, - address2, - address3, - address4, - address5, - address6, - telephone, - paymentterms, - currcode, - rate - FROM suppliers INNER JOIN currencies - ON suppliers.currcode = currencies.currabrev - WHERE supplierid='" . $SupplierID . "'"; - + address2, + address3, + address4, + address5, + address6, + telephone, + paymentterms, + currcode, + rate + FROM suppliers INNER JOIN currencies + ON suppliers.currcode = currencies.currabrev + WHERE supplierid='" . $SupplierID . "'"; + $ErrMsg = _('Could not get the supplier information for the order'); $SuppResult = DB_query($sql, $db, $ErrMsg); $SuppRow = DB_fetch_array($SuppResult); - + $StatusComment=date($_SESSION['DefaultDateFormat']).' - ' . _('Order Created by') . ' ' . $UserDetails . ' - '._('Auto created from sales orders') .'<br />'; /*Insert to purchase order header record */ - $sql = "INSERT INTO purchorders ( orderno, - supplierno, - orddate, - rate, - initiator, - intostocklocation, - deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - suppdeladdress1, - suppdeladdress2, - suppdeladdress3, - suppdeladdress4, - suppdeladdress5, - suppdeladdress6, - supptel, - version, - revised, - deliveryby, - status, - stat_comment, - deliverydate, - paymentterms, - allowprint) - VALUES( '" . $PO_OrderNo . "', - '" . $SupplierID . "', - '" . Date('Y-m-d') . "', - '" . $SuppRow['rate'] . "', - '" . $_SESSION['UsersRealName'] . "', - '" . $_SESSION['UserStockLocation'] . "', - '" . $DelAddRow['locationname'] . "', - '" . $DelAddRow['deladd1'] . "', - '" . $DelAddRow['deladd2'] . "', - '" . $DelAddRow['deladd3'] . "', - '" . $DelAddRow['deladd4'] . "', - '" . $DelAddRow['deladd5'] . ' ' . $DelAddRow['deladd6'] . "', - '" . $DelAddRow['tel'] . "', - '" . $SuppRow['address1'] . "', - '" . $SuppRow['address2'] . "', - '" . $SuppRow['address3'] . "', - '" . $SuppRow['address4'] . "', - '" . $SuppRow['address5'] . "', - '" . $SuppRow['address6'] . "', - '" . $SuppRow['telephone'] . "', - '1.0', - '" . Date('Y-m-d') . "', - '" . $_SESSION['Default_Shipper'] . "', - 'Pending', - '" . $StatusComment . "', - '" . Date('Y-m-d') . "', - '" . $SuppRow['paymentterms'] . "', - 0)"; - + $sql = "INSERT INTO purchorders ( orderno, + supplierno, + orddate, + rate, + initiator, + intostocklocation, + deladd1, + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + suppdeladdress1, + suppdeladdress2, + suppdeladdress3, + suppdeladdress4, + suppdeladdress5, + suppdeladdress6, + supptel, + version, + revised, + deliveryby, + status, + stat_comment, + deliverydate, + paymentterms, + allowprint) + VALUES( '" . $PO_OrderNo . "', + '" . $SupplierID . "', + '" . Date('Y-m-d') . "', + '" . $SuppRow['rate'] . "', + '" . $_SESSION['UsersRealName'] . "', + ... [truncated message content] |
From: <dai...@us...> - 2011-03-18 05:45:28
|
Revision: 4512 http://web-erp.svn.sourceforge.net/web-erp/?rev=4512&view=rev Author: daintree Date: 2011-03-18 05:45:21 +0000 (Fri, 18 Mar 2011) Log Message: ----------- Marcos Change Supplier code Modified Paths: -------------- trunk/CustomerBranches.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/Stocks.php trunk/UserSettings.php trunk/Z_index.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/CustomerBranches.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -52,7 +52,7 @@ $_POST['BranchCode'] = strtoupper($_POST['BranchCode']); - if (strstr($_POST['BranchCode'],"'") OR strstr($_POST['BranchCode'],'"') OR strstr($_POST['BranchCode'],'&')) { + if (ContainsIllegalCharacters($_POST['BranchCode']) OR strstr($_POST['BranchCode'],' ')) { $InputError = 1; prnMsg(_('The Branch code cannot contain any of the following characters')." - & \'",'error'); $Errors[$i] = 'BranchCode'; Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/Customers.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -41,7 +41,7 @@ prnMsg( _('The customer number already exists in the database'),'error'); $Errors[$i] = 'DebtorNo'; $i++; - } elseif (strlen($_POST['CustName']) > 40 OR strlen($_POST['CustName'])==0) { + }elseif (strlen($_POST['CustName']) > 40 OR strlen($_POST['CustName'])==0) { $InputError = 1; prnMsg( _('The customer name must be entered and be forty characters or less long'),'error'); $Errors[$i] = 'CustName'; @@ -51,7 +51,7 @@ prnMsg( _('The debtor code cannot be empty'),'error'); $Errors[$i] = 'DebtorNo'; $i++; - } elseif ($_SESSION['AutoDebtorNo']==0 AND ContainsIllegalCharacters($_POST['DebtorNo'])) { + } elseif ($_SESSION['AutoDebtorNo']==0 AND (ContainsIllegalCharacters($_POST['DebtorNo']) OR strpos($_POST['DebtorNo'], ' '))) { $InputError = 1; prnMsg( _('The customer code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'DebtorNo'; Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/DailyBankTransactions.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -82,7 +82,8 @@ ON banktrans.type=systypes.typeid WHERE bankact='".$_POST['BankAccount']."' AND transdate>='" . FormatDateForSQL($_POST['FromTransDate']) . "' - AND transdate<='" . FormatDateForSQL($_POST['ToTransDate']) . "'"; + AND transdate<='" . FormatDateForSQL($_POST['ToTransDate']) . "' + ORDER BY banktrans.transdate"; $result = DB_query($sql, $db); if (DB_num_rows($result)==0) { prnMsg(_('There are no transactions for this account in the date range selected'), 'info'); Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/Stocks.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -100,7 +100,7 @@ $Errors[$i] = 'StockID'; $i++; } - if (ContainsIllegalCharacters($StockID)) { + if (ContainsIllegalCharacters($StockID) OR strstr($StockID,' ')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); $Errors[$i] = 'StockID'; Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/UserSettings.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -10,8 +10,8 @@ _('User Settings') . '" alt="" />' . ' ' . _('User Settings') . '</p>'; $PDFLanguages = array(_('Latin Western Languages'), - _('Eastern European Russian Japanese Korean Hebrew Arabic Thai'), - _('Chinese')); + _('Eastern European Russian Japanese Korean Hebrew Arabic Thai'), + _('Chinese')); if (isset($_POST['Modify'])) { Modified: trunk/Z_index.php =================================================================== --- trunk/Z_index.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/Z_index.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -13,6 +13,7 @@ echo "<p><a href='$rootpath/Z_ChangeCustomerCode.php?" . SID . "'>". _('Change A Customer Code') . '</a>'; echo "<p><a href='$rootpath/Z_ChangeBranchCode.php?" . SID . "'>" . _('Change A Customer Branch Code') . '</a>'; echo "<p><a href='$rootpath/Z_ChangeStockCode.php?" . SID . "'>" . _('Change An Inventory Item Code') . '</a>'; + echo "<p><a href='$rootpath/Z_ChangeSupplierCode.php?" . SID . "'>" . _('Change A Supplier Code') . '</a>'; echo "<p><a href='$rootpath/Z_PriceChanges.php?" . SID . "'>" . _('Bulk Change Customer Pricing') . '</a>'; echo "<p><a href='$rootpath/Z_BottomUpCosts.php?" . SID . "'>" . _('Update costs for all BOM items, from the bottom up') . '</a>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/doc/Change.log.html 2011-03-18 05:45:21 UTC (rev 4512) @@ -1,5 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>18/3/11: Marcos Garcia Trejo Added Z_ChangeSupplierCode.php +<p>18/3/11: Ricard add orderby transdate to DailyBankTransactions.php +<p>18/3/11: Phil check for Customers.php CustomerBranches.php and Stocks.php now traps codes containing spaces - as well as other illegal characters</p> <p>15/3/11: Phil PricesByCost.php - made it update prices where there is already a price starting on today's date</p> <p>15/3/11: Phil SelectOrderItems.php customer selection now done using a hidden $_POST rather than parsing debtorno hyphen branchcode.</p> <p>15/3/11: Phil Locations.php new field for CounterSales branch code - instead of parsing it from a single field with a hyphen in it. CounterSales.php now uses the new field for customer branch</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/includes/ConnectDB.inc 2011-03-18 05:45:21 UTC (rev 4512) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.2'; //must update manually every time there is a DB change +$Version='4.03.4'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-18 05:45:21 UTC (rev 4512) @@ -833,4 +833,6 @@ UPDATE config SET confvalue='4.03.2' WHERE confname='VersionNumber'; ALTER TABLE locations ADD cashsalebranch varchar(10) DEFAULT ''; ALTER TABLE `locations` CHANGE `cashsalecustomer` `cashsalecustomer` VARCHAR( 10 ) DEFAULT ''; -UPDATE config SET confvalue='4.03.3' WHERE confname='VersionNumber'; \ No newline at end of file +UPDATE config SET confvalue='4.03.3' WHERE confname='VersionNumber'; +INSERT INTO `weberpdemo`.`scripts` (`script`, `pagesecurity`, `description`) VALUES ('Z_ChangeSupplierCode.php', '15', 'Script to change a supplier code accross all tables necessary'); +UPDATE config SET confvalue='4.03.4' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-18 05:45:28
|
Revision: 4512 http://web-erp.svn.sourceforge.net/web-erp/?rev=4512&view=rev Author: daintree Date: 2011-03-18 05:45:21 +0000 (Fri, 18 Mar 2011) Log Message: ----------- Marcos Change Supplier code Modified Paths: -------------- trunk/CustomerBranches.php trunk/Customers.php trunk/DailyBankTransactions.php trunk/Stocks.php trunk/UserSettings.php trunk/Z_index.php trunk/doc/Change.log.html trunk/includes/ConnectDB.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/CustomerBranches.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -52,7 +52,7 @@ $_POST['BranchCode'] = strtoupper($_POST['BranchCode']); - if (strstr($_POST['BranchCode'],"'") OR strstr($_POST['BranchCode'],'"') OR strstr($_POST['BranchCode'],'&')) { + if (ContainsIllegalCharacters($_POST['BranchCode']) OR strstr($_POST['BranchCode'],' ')) { $InputError = 1; prnMsg(_('The Branch code cannot contain any of the following characters')." - & \'",'error'); $Errors[$i] = 'BranchCode'; Modified: trunk/Customers.php =================================================================== --- trunk/Customers.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/Customers.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -41,7 +41,7 @@ prnMsg( _('The customer number already exists in the database'),'error'); $Errors[$i] = 'DebtorNo'; $i++; - } elseif (strlen($_POST['CustName']) > 40 OR strlen($_POST['CustName'])==0) { + }elseif (strlen($_POST['CustName']) > 40 OR strlen($_POST['CustName'])==0) { $InputError = 1; prnMsg( _('The customer name must be entered and be forty characters or less long'),'error'); $Errors[$i] = 'CustName'; @@ -51,7 +51,7 @@ prnMsg( _('The debtor code cannot be empty'),'error'); $Errors[$i] = 'DebtorNo'; $i++; - } elseif ($_SESSION['AutoDebtorNo']==0 AND ContainsIllegalCharacters($_POST['DebtorNo'])) { + } elseif ($_SESSION['AutoDebtorNo']==0 AND (ContainsIllegalCharacters($_POST['DebtorNo']) OR strpos($_POST['DebtorNo'], ' '))) { $InputError = 1; prnMsg( _('The customer code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error'); $Errors[$i] = 'DebtorNo'; Modified: trunk/DailyBankTransactions.php =================================================================== --- trunk/DailyBankTransactions.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/DailyBankTransactions.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -82,7 +82,8 @@ ON banktrans.type=systypes.typeid WHERE bankact='".$_POST['BankAccount']."' AND transdate>='" . FormatDateForSQL($_POST['FromTransDate']) . "' - AND transdate<='" . FormatDateForSQL($_POST['ToTransDate']) . "'"; + AND transdate<='" . FormatDateForSQL($_POST['ToTransDate']) . "' + ORDER BY banktrans.transdate"; $result = DB_query($sql, $db); if (DB_num_rows($result)==0) { prnMsg(_('There are no transactions for this account in the date range selected'), 'info'); Modified: trunk/Stocks.php =================================================================== --- trunk/Stocks.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/Stocks.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -100,7 +100,7 @@ $Errors[$i] = 'StockID'; $i++; } - if (ContainsIllegalCharacters($StockID)) { + if (ContainsIllegalCharacters($StockID) OR strstr($StockID,' ')) { $InputError = 1; prnMsg(_('The stock item code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error'); $Errors[$i] = 'StockID'; Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/UserSettings.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -10,8 +10,8 @@ _('User Settings') . '" alt="" />' . ' ' . _('User Settings') . '</p>'; $PDFLanguages = array(_('Latin Western Languages'), - _('Eastern European Russian Japanese Korean Hebrew Arabic Thai'), - _('Chinese')); + _('Eastern European Russian Japanese Korean Hebrew Arabic Thai'), + _('Chinese')); if (isset($_POST['Modify'])) { Modified: trunk/Z_index.php =================================================================== --- trunk/Z_index.php 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/Z_index.php 2011-03-18 05:45:21 UTC (rev 4512) @@ -13,6 +13,7 @@ echo "<p><a href='$rootpath/Z_ChangeCustomerCode.php?" . SID . "'>". _('Change A Customer Code') . '</a>'; echo "<p><a href='$rootpath/Z_ChangeBranchCode.php?" . SID . "'>" . _('Change A Customer Branch Code') . '</a>'; echo "<p><a href='$rootpath/Z_ChangeStockCode.php?" . SID . "'>" . _('Change An Inventory Item Code') . '</a>'; + echo "<p><a href='$rootpath/Z_ChangeSupplierCode.php?" . SID . "'>" . _('Change A Supplier Code') . '</a>'; echo "<p><a href='$rootpath/Z_PriceChanges.php?" . SID . "'>" . _('Bulk Change Customer Pricing') . '</a>'; echo "<p><a href='$rootpath/Z_BottomUpCosts.php?" . SID . "'>" . _('Update costs for all BOM items, from the bottom up') . '</a>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/doc/Change.log.html 2011-03-18 05:45:21 UTC (rev 4512) @@ -1,5 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>18/3/11: Marcos Garcia Trejo Added Z_ChangeSupplierCode.php +<p>18/3/11: Ricard add orderby transdate to DailyBankTransactions.php +<p>18/3/11: Phil check for Customers.php CustomerBranches.php and Stocks.php now traps codes containing spaces - as well as other illegal characters</p> <p>15/3/11: Phil PricesByCost.php - made it update prices where there is already a price starting on today's date</p> <p>15/3/11: Phil SelectOrderItems.php customer selection now done using a hidden $_POST rather than parsing debtorno hyphen branchcode.</p> <p>15/3/11: Phil Locations.php new field for CounterSales branch code - instead of parsing it from a single field with a hyphen in it. CounterSales.php now uses the new field for customer branch</p> Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/includes/ConnectDB.inc 2011-03-18 05:45:21 UTC (rev 4512) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.2'; //must update manually every time there is a DB change +$Version='4.03.4'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-15 09:33:07 UTC (rev 4511) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-18 05:45:21 UTC (rev 4512) @@ -833,4 +833,6 @@ UPDATE config SET confvalue='4.03.2' WHERE confname='VersionNumber'; ALTER TABLE locations ADD cashsalebranch varchar(10) DEFAULT ''; ALTER TABLE `locations` CHANGE `cashsalecustomer` `cashsalecustomer` VARCHAR( 10 ) DEFAULT ''; -UPDATE config SET confvalue='4.03.3' WHERE confname='VersionNumber'; \ No newline at end of file +UPDATE config SET confvalue='4.03.3' WHERE confname='VersionNumber'; +INSERT INTO `weberpdemo`.`scripts` (`script`, `pagesecurity`, `description`) VALUES ('Z_ChangeSupplierCode.php', '15', 'Script to change a supplier code accross all tables necessary'); +UPDATE config SET confvalue='4.03.4' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-18 22:51:14
|
Revision: 4514 http://web-erp.svn.sourceforge.net/web-erp/?rev=4514&view=rev Author: daintree Date: 2011-03-18 22:51:07 +0000 (Fri, 18 Mar 2011) Log Message: ----------- add country to packing slips Modified Paths: -------------- trunk/PrintCustOrder_generic.php trunk/SelectSalesOrder.php trunk/doc/Change.log.html trunk/includes/PDFOrderPageHeader.inc trunk/includes/PDFOrderPageHeader_generic.inc Modified: trunk/PrintCustOrder_generic.php =================================================================== --- trunk/PrintCustOrder_generic.php 2011-03-18 05:48:23 UTC (rev 4513) +++ trunk/PrintCustOrder_generic.php 2011-03-18 22:51:07 UTC (rev 4514) @@ -4,8 +4,6 @@ /* $Revision: 1.20 $ */ -//$PageSecurity = 2; - include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -14,12 +12,12 @@ If (!isset($_GET['TransNo']) OR $_GET['TransNo']==""){ $title = _('Select Order To Print'); include('includes/header.inc'); - echo '<div class=centre><br><br><br>'; + echo '<div class=centre><br /><br /><br />'; prnMsg( _('Select an Order Number to Print before calling this page') , 'error'); - echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; + echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </td></tr></table></div><br /><br /><br />'; include('includes/footer.inc'); exit(); } @@ -65,12 +63,12 @@ if (DB_num_rows($result)==0){ $title = _('Print Packing Slip Error'); include('includes/header.inc'); - echo '<div class=centre><br><br><br>'; + echo '<div class=centre><br /><br /><br />'; prnMsg( _('Unable to Locate Order Number') . ' : ' . $_GET['TransNo'] . ' ', 'error'); - echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; + echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </td></tr></table></div><br /><br /><br />'; include('includes/footer.inc'); exit(); } elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ @@ -85,17 +83,17 @@ echo '<p>'; prnMsg( _('The packing slip for order number') . ' ' . $_GET['TransNo'] . ' ' . _('has previously been printed') . '. ' . _('It was printed on'). ' ' . ConvertSQLDate($myrow['datepackingslipprinted']) . - '<br>' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); - echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">' + '<br />' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); + echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?TransNo=' . $_GET['TransNo'] . '&Reprint=OK">' . _('Do a Re-Print') . ' (' . _('On Pre-Printed Stationery') . ') ' . _('Even Though Previously Printed') . '</a><p>' . - '<a href="' . $rootpath. '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">'. _('Do a Re-Print') . ' (' . _('Plain paper') . ' - ' . _('A4') . ' ' . _('landscape') . ') ' . _('Even Though Previously Printed'). '</a>'; + '<a href="' . $rootpath. '/PrintCustOrder_generic.php?TransNo=' . $_GET['TransNo'] . '&Reprint=OK">'. _('Do a Re-Print') . ' (' . _('Plain paper') . ' - ' . _('A4') . ' ' . _('landscape') . ') ' . _('Even Though Previously Printed'). '</a>'; - echo '<br><br><br>'; + echo '<br /><br /><br />'; echo _('Or select another Order Number to Print'); echo '<table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </td></tr></table></div><br /><br /><br />'; include('includes/footer.inc'); exit; @@ -115,8 +113,9 @@ $FontSize=12; $line_height=24; $PageNumber = 1; +$Copy = 'Office'; -$ListCount = 0; // UldisN +$ListCount = 0; for ($i=1;$i<=2;$i++){ /*Print it out twice one copy for customer and one for office */ if ($i==2){ @@ -173,28 +172,15 @@ } /*end for loop to print the whole lot twice */ -//$pdfcode = $pdf->output(); -//$len = strlen($pdfcode); -//if ($len<=20){ if ($ListCount == 0) { //UldisN $title = _('Print Packing Slip Error'); include('includes/header.inc'); echo '<p>'. _('There were no outstanding items on the order to deliver') . '. ' . _('A packing slip cannot be printed'). - '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">'. _('Print Another Packing Slip/Order'). - '</a>' . '<br>'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + '<br /><a href="' . $rootpath . '/SelectSalesOrder.php">'. _('Print Another Packing Slip/Order'). + '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { -/* UldisN - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=PackingSlip.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('PrintCustOrder.pdf', 'I'); -*/ $pdf->OutputD($_SESSION['DatabaseName'] . '_PackingSlip_' . date('Y-m-d') . '.pdf');//UldisN $pdf->__destruct(); //UldisN $sql = "UPDATE salesorders SET printedpackingslip=1, datepackingslipprinted='" . Date('Y-m-d') . "' WHERE salesorders.orderno='" .$_GET['TransNo'] . "'"; Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-18 05:48:23 UTC (rev 4513) +++ trunk/SelectSalesOrder.php 2011-03-18 22:51:07 UTC (rev 4514) @@ -885,7 +885,7 @@ } $i++; $j++; - $TotalOrders += $myrow['ordervalue']; + $OrdersTotal += $myrow['ordervalue']; if ($j == 12){ $j=1; echo $tableheader; @@ -901,7 +901,7 @@ } else { echo '<b>' . _('Total Quotation(s) Value in'); } - echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</b></td><td class="number"><b>' . number_format($TotalOrders,2) . '</b></td></tr> + echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</b></td><td class="number"><b>' . number_format($OrdersTotal,2) . '</b></td></tr> </table>'; } //end if there are some orders to show } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-18 05:48:23 UTC (rev 4513) +++ trunk/doc/Change.log.html 2011-03-18 22:51:07 UTC (rev 4514) @@ -1,7 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> -<p>18/3/11: Marcos Garcia Trejo Added Z_ChangeSupplierCode.php -<p>18/3/11: Ricard add orderby transdate to DailyBankTransactions.php +<p>19/3/11: Phil added country to packing slips </p> +<p>18/3/11: Marcos Garcia Trejo Added Z_ChangeSupplierCode.php </p> +<p>18/3/11: Ricard add orderby transdate to DailyBankTransactions.php</p> <p>18/3/11: Phil check for Customers.php CustomerBranches.php and Stocks.php now traps codes containing spaces - as well as other illegal characters</p> <p>15/3/11: Phil PricesByCost.php - made it update prices where there is already a price starting on today's date</p> <p>15/3/11: Phil SelectOrderItems.php customer selection now done using a hidden $_POST rather than parsing debtorno hyphen branchcode.</p> Modified: trunk/includes/PDFOrderPageHeader.inc =================================================================== --- trunk/includes/PDFOrderPageHeader.inc 2011-03-18 05:48:23 UTC (rev 4513) +++ trunk/includes/PDFOrderPageHeader.inc 2011-03-18 22:51:07 UTC (rev 4514) @@ -11,14 +11,14 @@ $pdf->addText($XPos, $YPos,$FontSize, $myrow['deliverto']); $pdf->addText($XPos, $YPos-13,$FontSize, $myrow['deladd1']); $pdf->addText($XPos, $YPos-26,$FontSize, $myrow['deladd2']); -$pdf->addText($XPos, $YPos-39,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']); +$pdf->addText($XPos, $YPos-39,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5'] . ' ' . $myrow['deladd6']); $YPos = 510; $pdf->addText($XPos, $YPos,$FontSize, $myrow['name']); $pdf->addText($XPos, $YPos-13,$FontSize, $myrow['address1']); $pdf->addText($XPos, $YPos-26,$FontSize, $myrow['address2']); -$pdf->addText($XPos, $YPos-39,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); +$pdf->addText($XPos, $YPos-39,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']. ' ' . $myrow['deladd6']); /*Print Dispatch Date - as current date Modified: trunk/includes/PDFOrderPageHeader_generic.inc =================================================================== --- trunk/includes/PDFOrderPageHeader_generic.inc 2011-03-18 05:48:23 UTC (rev 4513) +++ trunk/includes/PDFOrderPageHeader_generic.inc 2011-03-18 22:51:07 UTC (rev 4514) @@ -41,7 +41,7 @@ $pdf->addText($XPos, $YPos-15,$FontSize, $myrow['deliverto']); $pdf->addText($XPos, $YPos-30,$FontSize, $myrow['deladd1']); $pdf->addText($XPos, $YPos-45,$FontSize, $myrow['deladd2']); -$pdf->addText($XPos, $YPos-60,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']); +$pdf->addText($XPos, $YPos-60,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5'] . ' ' . $myrow['deladd6']); $YPos -= 80; @@ -49,7 +49,7 @@ $pdf->addText($XPos, $YPos-15,$FontSize, $myrow['name']); $pdf->addText($XPos, $YPos-30,$FontSize, $myrow['address1']); $pdf->addText($XPos, $YPos-45,$FontSize, $myrow['address2']); -$pdf->addText($XPos, $YPos-60,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); +$pdf->addText($XPos, $YPos-60,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']. ' ' . $myrow['address6']); $pdf->addText($XPos, $YPos-82,$FontSize, _('Customer No.'). ' : ' . $myrow['debtorno']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-18 22:51:14
|
Revision: 4514 http://web-erp.svn.sourceforge.net/web-erp/?rev=4514&view=rev Author: daintree Date: 2011-03-18 22:51:07 +0000 (Fri, 18 Mar 2011) Log Message: ----------- add country to packing slips Modified Paths: -------------- trunk/PrintCustOrder_generic.php trunk/SelectSalesOrder.php trunk/doc/Change.log.html trunk/includes/PDFOrderPageHeader.inc trunk/includes/PDFOrderPageHeader_generic.inc Modified: trunk/PrintCustOrder_generic.php =================================================================== --- trunk/PrintCustOrder_generic.php 2011-03-18 05:48:23 UTC (rev 4513) +++ trunk/PrintCustOrder_generic.php 2011-03-18 22:51:07 UTC (rev 4514) @@ -4,8 +4,6 @@ /* $Revision: 1.20 $ */ -//$PageSecurity = 2; - include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); @@ -14,12 +12,12 @@ If (!isset($_GET['TransNo']) OR $_GET['TransNo']==""){ $title = _('Select Order To Print'); include('includes/header.inc'); - echo '<div class=centre><br><br><br>'; + echo '<div class=centre><br /><br /><br />'; prnMsg( _('Select an Order Number to Print before calling this page') , 'error'); - echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; + echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php?">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </td></tr></table></div><br /><br /><br />'; include('includes/footer.inc'); exit(); } @@ -65,12 +63,12 @@ if (DB_num_rows($result)==0){ $title = _('Print Packing Slip Error'); include('includes/header.inc'); - echo '<div class=centre><br><br><br>'; + echo '<div class=centre><br /><br /><br />'; prnMsg( _('Unable to Locate Order Number') . ' : ' . $_GET['TransNo'] . ' ', 'error'); - echo '<br><br><br><table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; + echo '<br /><br /><br /><table class="table_index"><tr><td class="menu_group_item"> + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </td></tr></table></div><br /><br /><br />'; include('includes/footer.inc'); exit(); } elseif (DB_num_rows($result)==1){ /*There is only one order header returned - thats good! */ @@ -85,17 +83,17 @@ echo '<p>'; prnMsg( _('The packing slip for order number') . ' ' . $_GET['TransNo'] . ' ' . _('has previously been printed') . '. ' . _('It was printed on'). ' ' . ConvertSQLDate($myrow['datepackingslipprinted']) . - '<br>' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); - echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">' + '<br />' . _('This check is there to ensure that duplicate packing slips are not produced and dispatched more than once to the customer'), 'warn' ); + echo '<p><a href="' . $rootpath . '/PrintCustOrder.php?TransNo=' . $_GET['TransNo'] . '&Reprint=OK">' . _('Do a Re-Print') . ' (' . _('On Pre-Printed Stationery') . ') ' . _('Even Though Previously Printed') . '</a><p>' . - '<a href="' . $rootpath. '/PrintCustOrder_generic.php?' . SID . '&TransNo=' . $_GET['TransNo'] . '&Reprint=OK">'. _('Do a Re-Print') . ' (' . _('Plain paper') . ' - ' . _('A4') . ' ' . _('landscape') . ') ' . _('Even Though Previously Printed'). '</a>'; + '<a href="' . $rootpath. '/PrintCustOrder_generic.php?TransNo=' . $_GET['TransNo'] . '&Reprint=OK">'. _('Do a Re-Print') . ' (' . _('Plain paper') . ' - ' . _('A4') . ' ' . _('landscape') . ') ' . _('Even Though Previously Printed'). '</a>'; - echo '<br><br><br>'; + echo '<br /><br /><br />'; echo _('Or select another Order Number to Print'); echo '<table class="table_index"><tr><td class="menu_group_item"> - <li><a href="'. $rootpath . '/SelectSalesOrder.php?'. SID .'">' . _('Outstanding Sales Orders') . '</a></li> - <li><a href="'. $rootpath . '/SelectCompletedOrder.php?'. SID .'">' . _('Completed Sales Orders') . '</a></li> - </td></tr></table></div><br><br><br>'; + <li><a href="'. $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $rootpath . '/SelectCompletedOrder.php">' . _('Completed Sales Orders') . '</a></li> + </td></tr></table></div><br /><br /><br />'; include('includes/footer.inc'); exit; @@ -115,8 +113,9 @@ $FontSize=12; $line_height=24; $PageNumber = 1; +$Copy = 'Office'; -$ListCount = 0; // UldisN +$ListCount = 0; for ($i=1;$i<=2;$i++){ /*Print it out twice one copy for customer and one for office */ if ($i==2){ @@ -173,28 +172,15 @@ } /*end for loop to print the whole lot twice */ -//$pdfcode = $pdf->output(); -//$len = strlen($pdfcode); -//if ($len<=20){ if ($ListCount == 0) { //UldisN $title = _('Print Packing Slip Error'); include('includes/header.inc'); echo '<p>'. _('There were no outstanding items on the order to deliver') . '. ' . _('A packing slip cannot be printed'). - '<br><a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">'. _('Print Another Packing Slip/Order'). - '</a>' . '<br>'. '<a href="' . $rootpath . '/index.php?' . SID . '">' . _('Back to the menu') . '</a>'; + '<br /><a href="' . $rootpath . '/SelectSalesOrder.php">'. _('Print Another Packing Slip/Order'). + '</a>' . '<br />'. '<a href="' . $rootpath . '/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); exit; } else { -/* UldisN - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=PackingSlip.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('PrintCustOrder.pdf', 'I'); -*/ $pdf->OutputD($_SESSION['DatabaseName'] . '_PackingSlip_' . date('Y-m-d') . '.pdf');//UldisN $pdf->__destruct(); //UldisN $sql = "UPDATE salesorders SET printedpackingslip=1, datepackingslipprinted='" . Date('Y-m-d') . "' WHERE salesorders.orderno='" .$_GET['TransNo'] . "'"; Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2011-03-18 05:48:23 UTC (rev 4513) +++ trunk/SelectSalesOrder.php 2011-03-18 22:51:07 UTC (rev 4514) @@ -885,7 +885,7 @@ } $i++; $j++; - $TotalOrders += $myrow['ordervalue']; + $OrdersTotal += $myrow['ordervalue']; if ($j == 12){ $j=1; echo $tableheader; @@ -901,7 +901,7 @@ } else { echo '<b>' . _('Total Quotation(s) Value in'); } - echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</b></td><td class="number"><b>' . number_format($TotalOrders,2) . '</b></td></tr> + echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</b></td><td class="number"><b>' . number_format($OrdersTotal,2) . '</b></td></tr> </table>'; } //end if there are some orders to show } Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-18 05:48:23 UTC (rev 4513) +++ trunk/doc/Change.log.html 2011-03-18 22:51:07 UTC (rev 4514) @@ -1,7 +1,8 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> -<p>18/3/11: Marcos Garcia Trejo Added Z_ChangeSupplierCode.php -<p>18/3/11: Ricard add orderby transdate to DailyBankTransactions.php +<p>19/3/11: Phil added country to packing slips </p> +<p>18/3/11: Marcos Garcia Trejo Added Z_ChangeSupplierCode.php </p> +<p>18/3/11: Ricard add orderby transdate to DailyBankTransactions.php</p> <p>18/3/11: Phil check for Customers.php CustomerBranches.php and Stocks.php now traps codes containing spaces - as well as other illegal characters</p> <p>15/3/11: Phil PricesByCost.php - made it update prices where there is already a price starting on today's date</p> <p>15/3/11: Phil SelectOrderItems.php customer selection now done using a hidden $_POST rather than parsing debtorno hyphen branchcode.</p> Modified: trunk/includes/PDFOrderPageHeader.inc =================================================================== --- trunk/includes/PDFOrderPageHeader.inc 2011-03-18 05:48:23 UTC (rev 4513) +++ trunk/includes/PDFOrderPageHeader.inc 2011-03-18 22:51:07 UTC (rev 4514) @@ -11,14 +11,14 @@ $pdf->addText($XPos, $YPos,$FontSize, $myrow['deliverto']); $pdf->addText($XPos, $YPos-13,$FontSize, $myrow['deladd1']); $pdf->addText($XPos, $YPos-26,$FontSize, $myrow['deladd2']); -$pdf->addText($XPos, $YPos-39,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']); +$pdf->addText($XPos, $YPos-39,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5'] . ' ' . $myrow['deladd6']); $YPos = 510; $pdf->addText($XPos, $YPos,$FontSize, $myrow['name']); $pdf->addText($XPos, $YPos-13,$FontSize, $myrow['address1']); $pdf->addText($XPos, $YPos-26,$FontSize, $myrow['address2']); -$pdf->addText($XPos, $YPos-39,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); +$pdf->addText($XPos, $YPos-39,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']. ' ' . $myrow['deladd6']); /*Print Dispatch Date - as current date Modified: trunk/includes/PDFOrderPageHeader_generic.inc =================================================================== --- trunk/includes/PDFOrderPageHeader_generic.inc 2011-03-18 05:48:23 UTC (rev 4513) +++ trunk/includes/PDFOrderPageHeader_generic.inc 2011-03-18 22:51:07 UTC (rev 4514) @@ -41,7 +41,7 @@ $pdf->addText($XPos, $YPos-15,$FontSize, $myrow['deliverto']); $pdf->addText($XPos, $YPos-30,$FontSize, $myrow['deladd1']); $pdf->addText($XPos, $YPos-45,$FontSize, $myrow['deladd2']); -$pdf->addText($XPos, $YPos-60,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5']); +$pdf->addText($XPos, $YPos-60,$FontSize, $myrow['deladd3'] . ' ' . $myrow['deladd4'] . ' ' . $myrow['deladd5'] . ' ' . $myrow['deladd6']); $YPos -= 80; @@ -49,7 +49,7 @@ $pdf->addText($XPos, $YPos-15,$FontSize, $myrow['name']); $pdf->addText($XPos, $YPos-30,$FontSize, $myrow['address1']); $pdf->addText($XPos, $YPos-45,$FontSize, $myrow['address2']); -$pdf->addText($XPos, $YPos-60,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']); +$pdf->addText($XPos, $YPos-60,$FontSize, $myrow['address3'] . ' ' . $myrow['address4'] . ' ' . $myrow['address5']. ' ' . $myrow['address6']); $pdf->addText($XPos, $YPos-82,$FontSize, _('Customer No.'). ' : ' . $myrow['debtorno']); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-20 02:51:11
|
Revision: 4515 http://web-erp.svn.sourceforge.net/web-erp/?rev=4515&view=rev Author: daintree Date: 2011-03-20 02:51:01 +0000 (Sun, 20 Mar 2011) Log Message: ----------- remove redundant files Modified Paths: -------------- trunk/UserSettings.php trunk/WWW_Users.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Removed Paths: ------------- trunk/fpdi/decoders/ trunk/fpdi/fpdf_tpl.php trunk/fpdi/fpdi.php trunk/fpdi/fpdi2tcpdf_bridge.php trunk/fpdi/fpdi_pdf_parser.php trunk/fpdi/pdf_context.php trunk/fpdi/pdf_parser.php trunk/fpdi/wrapper_functions-borrar.php trunk/sql/mysql/weberp313iso-demo.sql trunk/sql/mysql/weberp313iso-new.sql Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/UserSettings.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -130,7 +130,6 @@ if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' - AND $LanguageEntry != 'CVS' AND $LanguageEntry != '.svn' AND $LanguageEntry!='.'){ Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/WWW_Users.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -79,7 +79,7 @@ } //comment out except for demo! Do not want anyone modifying demo user. /* - elseif ($_POST['UserID'] == 'demo') { + elseif ($_POST['UserID'] == 'admin') { prnMsg(_('The demonstration user called demo cannot be modified.'),'error'); $InputError = 1; } @@ -215,7 +215,7 @@ // comment out except for demo! Do not want anyopne deleting demo user. /* - if ($SelectedUser == 'demo') { + if ($SelectedUser == 'admin') { prnMsg(_('The demonstration user called demo cannot be deleted'),'error'); } else { */ Deleted: trunk/fpdi/fpdf_tpl.php =================================================================== --- trunk/fpdi/fpdf_tpl.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/fpdf_tpl.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,409 +0,0 @@ -<?php -// -// FPDF_TPL - Version 1.1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -class FPDF_TPL extends FPDF { - /** - * Array of Tpl-Data - * @var array - */ - var $tpls = array(); - - /** - * Current Template-ID - * @var int - */ - var $tpl = 0; - - /** - * "In Template"-Flag - * @var boolean - */ - var $_intpl = false; - - /** - * Nameprefix of Templates used in Resources-Dictonary - * @var string A String defining the Prefix used as Template-Object-Names. Have to beginn with an / - */ - var $tplprefix = "/TPL"; - - /** - * Resources used By Templates and Pages - * @var array - */ - var $_res = array(); - - /** - * Last used Template data - * - * @var array - */ - var $lastUsedTemplateData = array(); - - /** - * Start a Template - * - * This method starts a template. You can give own coordinates to build an own sized - * Template. Pay attention, that the margins are adapted to the new templatesize. - * If you want to write outside the template, for example to build a clipped Template, - * you have to set the Margins and "Cursor"-Position manual after beginTemplate-Call. - * - * If no parameter is given, the template uses the current page-size. - * The Method returns an ID of the current Template. This ID is used later for using this template. - * Warning: A created Template is used in PDF at all events. Still if you don't use it after creation! - * - * @param int $x The x-coordinate given in user-unit - * @param int $y The y-coordinate given in user-unit - * @param int $w The width given in user-unit - * @param int $h The height given in user-unit - * @return int The ID of new created Template - */ - function beginTemplate($x=null, $y=null, $w=null, $h=null) { - if ($this->page <= 0) - $this->error("You have to add a page to fpdf first!"); - - if ($x == null) - $x = 0; - if ($y == null) - $y = 0; - if ($w == null) - $w = $this->w; - if ($h == null) - $h = $this->h; - - // Save settings - $this->tpl++; - $tpl =& $this->tpls[$this->tpl]; - $tpl = array( - 'o_x' => $this->x, - 'o_y' => $this->y, - 'o_AutoPageBreak' => $this->AutoPageBreak, - 'o_bMargin' => $this->bMargin, - 'o_tMargin' => $this->tMargin, - 'o_lMargin' => $this->lMargin, - 'o_rMargin' => $this->rMargin, - 'o_h' => $this->h, - 'o_w' => $this->w, - 'buffer' => '', - 'x' => $x, - 'y' => $y, - 'w' => $w, - 'h' => $h - ); - - $this->SetAutoPageBreak(false); - - // Define own high and width to calculate possitions correct - $this->h = $h; - $this->w = $w; - - $this->_intpl = true; - $this->SetXY($x+$this->lMargin, $y+$this->tMargin); - $this->SetRightMargin($this->w-$w+$this->rMargin); - - return $this->tpl; - } - - /** - * End Template - * - * This method ends a template and reset initiated variables on beginTemplate. - * - * @return mixed If a template is opened, the ID is returned. If not a false is returned. - */ - function endTemplate() { - if ($this->_intpl) { - $this->_intpl = false; - $tpl =& $this->tpls[$this->tpl]; - $this->SetXY($tpl['o_x'], $tpl['o_y']); - $this->tMargin = $tpl['o_tMargin']; - $this->lMargin = $tpl['o_lMargin']; - $this->rMargin = $tpl['o_rMargin']; - $this->h = $tpl['o_h']; - $this->w = $tpl['o_w']; - $this->SetAutoPageBreak($tpl['o_AutoPageBreak'], $tpl['o_bMargin']); - - return $this->tpl; - } else { - return false; - } - } - - /** - * Use a Template in current Page or other Template - * - * You can use a template in a page or in another template. - * You can give the used template a new size like you use the Image()-method. - * All parameters are optional. The width or height is calculated automaticaly - * if one is given. If no parameter is given the origin size as defined in - * beginTemplate() is used. - * The calculated or used width and height are returned as an array. - * - * @param int $tplidx A valid template-Id - * @param int $_x The x-position - * @param int $_y The y-position - * @param int $_w The new width of the template - * @param int $_h The new height of the template - * @retrun array The height and width of the template - */ - function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0) { - if ($this->page <= 0) - $this->error("You have to add a page to fpdf first!"); - - if (!isset($this->tpls[$tplidx])) - $this->error("Template does not exist!"); - - if ($this->_intpl) { - $this->_res['tpl'][$this->tpl]['tpls'][$tplidx] =& $this->tpls[$tplidx]; - } - - $tpl =& $this->tpls[$tplidx]; - $w = $tpl['w']; - $h = $tpl['h']; - - if ($_x == null) - $_x = 0; - if ($_y == null) - $_y = 0; - - $_x += $tpl['x']; - $_y += $tpl['y']; - - $wh = $this->getTemplateSize($tplidx, $_w, $_h); - $_w = $wh['w']; - $_h = $wh['h']; - - $tData = array( - 'x' => $this->x, - 'y' => $this->y, - 'w' => $_w, - 'h' => $_h, - 'scaleX' => ($_w/$w), - 'scaleY' => ($_h/$h), - 'tx' => $_x, - 'ty' => ($this->h-$_y-$_h), - 'lty' => ($this->h-$_y-$_h) - ($this->h-$h) * ($_h/$h) - ); - - $this->_out(sprintf("q %.4F 0 0 %.4F %.4F %.4F cm", $tData['scaleX'], $tData['scaleY'], $tData['tx']*$this->k, $tData['ty']*$this->k)); // Translate - $this->_out(sprintf('%s%d Do Q', $this->tplprefix, $tplidx)); - - $this->lastUsedTemplateData = $tData; - - return array("w" => $_w, "h" => $_h); - } - - /** - * Get The calculated Size of a Template - * - * If one size is given, this method calculates the other one. - * - * @param int $tplidx A valid template-Id - * @param int $_w The width of the template - * @param int $_h The height of the template - * @return array The height and width of the template - */ - function getTemplateSize($tplidx, $_w=0, $_h=0) { - if (!$this->tpls[$tplidx]) - return false; - - $tpl =& $this->tpls[$tplidx]; - $w = $tpl['w']; - $h = $tpl['h']; - - if ($_w == 0 and $_h == 0) { - $_w = $w; - $_h = $h; - } - - if($_w==0) - $_w = $_h*$w/$h; - if($_h==0) - $_h = $_w*$h/$w; - - return array("w" => $_w, "h" => $_h); - } - - /** - * See FPDF/TCPDF-Documentation ;-) - */ - function SetFont($family, $style='', $size=0, $fontfile='') { - if (!is_subclass_of($this, 'TCPDF') && func_num_args() > 3) { - $this->Error('More than 3 arguments for the SetFont method are only available in TCPDF.'); - } - /** - * force the resetting of font changes in a template - */ - if ($this->_intpl) - $this->FontFamily = ''; - - parent::SetFont($family, $style, $size, $fontfile); - - $fontkey = $this->FontFamily.$this->FontStyle; - - if ($this->_intpl) { - $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey]; - } else { - $this->_res['page'][$this->page]['fonts'][$fontkey] =& $this->fonts[$fontkey]; - } - } - - /** - * See FPDF/TCPDF-Documentation ;-) - */ - function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false) { - if (!is_subclass_of($this, 'TCPDF') && func_num_args() > 7) { - $this->Error('More than 7 arguments for the Image method are only available in TCPDF.'); - } - - parent::Image($file, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $ismask, $imgmask, $border, $fitbox, $hidden, $fitonpage); - if ($this->_intpl) { - $this->_res['tpl'][$this->tpl]['images'][$file] =& $this->images[$file]; - } else { - $this->_res['page'][$this->page]['images'][$file] =& $this->images[$file]; - } - } - - /** - * See FPDF-Documentation ;-) - * - * AddPage is not available when you're "in" a template. - */ - function AddPage($orientation='', $format='', $keepmargins=false) { - if ($this->_intpl) - $this->Error('Adding pages in templates isn\'t possible!'); - parent::AddPage($orientation, $format); - } - - /** - * Preserve adding Links in Templates ...won't work - */ - function Link($x, $y, $w, $h, $link, $spaces=0) { - if (!is_subclass_of($this, 'TCPDF') && func_num_args() > 5) { - $this->Error('More than 7 arguments for the Image method are only available in TCPDF.'); - } - - if ($this->_intpl) - $this->Error('Using links in templates aren\'t possible!'); - parent::Link($x, $y, $w, $h, $link, $spaces); - } - - function AddLink() { - if ($this->_intpl) - $this->Error('Adding links in templates aren\'t possible!'); - return parent::AddLink(); - } - - function SetLink($link, $y=0, $page=-1) { - if ($this->_intpl) - $this->Error('Setting links in templates aren\'t possible!'); - parent::SetLink($link, $y, $page); - } - - /** - * Private Method that writes the form xobjects - */ - function _putformxobjects() { - $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; - reset($this->tpls); - foreach($this->tpls AS $tplidx => $tpl) { - - $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer']; - $this->_newobj(); - $this->tpls[$tplidx]['n'] = $this->n; - $this->_out('<<'.$filter.'/Type /XObject'); - $this->_out('/Subtype /Form'); - $this->_out('/FormType 1'); - $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]', - // llx - $tpl['x'], - // lly - -$tpl['y'], - // urx - ($tpl['w']+$tpl['x'])*$this->k, - // ury - ($tpl['h']-$tpl['y'])*$this->k - )); - - if ($tpl['x'] != 0 || $tpl['y'] != 0) { - $this->_out(sprintf('/Matrix [1 0 0 1 %.5F %.5F]', - -$tpl['x']*$this->k*2, $tpl['y']*$this->k*2 - )); - } - - $this->_out('/Resources '); - - $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); - if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) { - $this->_out('/Font <<'); - foreach($this->_res['tpl'][$tplidx]['fonts'] as $font) - $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); - $this->_out('>>'); - } - if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || - isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) - { - $this->_out('/XObject <<'); - if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) { - foreach($this->_res['tpl'][$tplidx]['images'] as $image) - $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); - } - if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) { - foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) - $this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R'); - } - $this->_out('>>'); - } - $this->_out('>>'); - - $this->_out('/Length '.strlen($p).' >>'); - $this->_putstream($p); - $this->_out('endobj'); - } - } - - /** - * Overwritten to add _putformxobjects() after _putimages() - * - */ - function _putimages() { - parent::_putimages(); - $this->_putformxobjects(); - } - - function _putxobjectdict() { - parent::_putxobjectdict(); - - if (count($this->tpls)) { - foreach($this->tpls as $tplidx => $tpl) { - $this->_out(sprintf('%s%d %d 0 R', $this->tplprefix, $tplidx, $tpl['n'])); - } - } - } - - /** - * Private Method - */ - function _out($s) { - if ($this->state==2 && $this->_intpl) { - $this->tpls[$this->tpl]['buffer'] .= $s."\n"; - } else { - parent::_out($s); - } - } -} Deleted: trunk/fpdi/fpdi.php =================================================================== --- trunk/fpdi/fpdi.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/fpdi.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,504 +0,0 @@ -<?php -// -// FPDI - Version 1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -define('FPDI_VERSION','1.3'); - -// Check for TCPDF and remap TCPDF to FPDF -if (class_exists('TCPDF')) { - require_once('fpdi2tcpdf_bridge.php'); -} - -require_once('fpdf_tpl.php'); -require_once('fpdi_pdf_parser.php'); - - -class FPDI extends FPDF_TPL { - /** - * Actual filename - * @var string - */ - var $current_filename; - - /** - * Parser-Objects - * @var array - */ - var $parsers; - - /** - * Current parser - * @var object - */ - var $current_parser; - - /** - * object stack - * @var array - */ - var $_obj_stack; - - /** - * done object stack - * @var array - */ - var $_don_obj_stack; - - /** - * Current Object Id. - * @var integer - */ - var $_current_obj_id; - - /** - * The name of the last imported page box - * @var string - */ - var $lastUsedPageBox; - - var $_importedPages = array(); - - - /** - * Set a source-file - * - * @param string $filename a valid filename - * @return int number of available pages - */ - function setSourceFile($filename) { - $this->current_filename = $filename; - $fn =& $this->current_filename; - - if (!isset($this->parsers[$fn])) - $this->parsers[$fn] = new fpdi_pdf_parser($fn, $this); - $this->current_parser =& $this->parsers[$fn]; - - return $this->parsers[$fn]->getPageCount(); - } - - /** - * Import a page - * - * @param int $pageno pagenumber - * @return int Index of imported page - to use with fpdf_tpl::useTemplate() - */ - function importPage($pageno, $boxName='/CropBox') { - if ($this->_intpl) { - return $this->error('Please import the desired pages before creating a new template.'); - } - - $fn =& $this->current_filename; - - // check if page already imported - $pageKey = $fn.((int)$pageno).$boxName; - if (isset($this->_importedPages[$pageKey])) - return $this->_importedPages[$pageKey]; - - $parser =& $this->parsers[$fn]; - $parser->setPageno($pageno); - - $this->tpl++; - $this->tpls[$this->tpl] = array(); - $tpl =& $this->tpls[$this->tpl]; - $tpl['parser'] =& $parser; - $tpl['resources'] = $parser->getPageResources(); - $tpl['buffer'] = $parser->getContent(); - - if (!in_array($boxName, $parser->availableBoxes)) - return $this->Error(sprintf('Unknown box: %s', $boxName)); - $pageboxes = $parser->getPageBoxes($pageno); - - /** - * MediaBox - * CropBox: Default -> MediaBox - * BleedBox: Default -> CropBox - * TrimBox: Default -> CropBox - * ArtBox: Default -> CropBox - */ - if (!isset($pageboxes[$boxName]) && ($boxName == '/BleedBox' || $boxName == '/TrimBox' || $boxName == '/ArtBox')) - $boxName = '/CropBox'; - if (!isset($pageboxes[$boxName]) && $boxName == '/CropBox') - $boxName = '/MediaBox'; - - if (!isset($pageboxes[$boxName])) - return false; - $this->lastUsedPageBox = $boxName; - - $box = $pageboxes[$boxName]; - $tpl['box'] = $box; - - // To build an array that can be used by PDF_TPL::useTemplate() - $this->tpls[$this->tpl] = array_merge($this->tpls[$this->tpl],$box); - - // An imported page will start at 0,0 everytime. Translation will be set in _putformxobjects() - $tpl['x'] = 0; - $tpl['y'] = 0; - - $page =& $parser->pages[$parser->pageno]; - - // handle rotated pages - $rotation = $parser->getPageRotation($pageno); - $tpl['_rotationAngle'] = 0; - if (isset($rotation[1]) && ($angle = $rotation[1] % 360) != 0) { - $steps = $angle / 90; - - $_w = $tpl['w']; - $_h = $tpl['h']; - $tpl['w'] = $steps % 2 == 0 ? $_w : $_h; - $tpl['h'] = $steps % 2 == 0 ? $_h : $_w; - - $tpl['_rotationAngle'] = $angle*-1; - } - - $this->_importedPages[$pageKey] = $this->tpl; - - return $this->tpl; - } - - function getLastUsedPageBox() { - return $this->lastUsedPageBox; - } - - function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0, $adjustPageSize=false) { - if ($adjustPageSize == true && is_null($_x) && is_null($_y)) { - $size = $this->getTemplateSize($tplidx, $_w, $_h); - $format = array($size['w'], $size['h']); - if ($format[0]!=$this->CurPageFormat[0] || $format[1]!=$this->CurPageFormat[1]) { - $this->w=$format[0]; - $this->h=$format[1]; - $this->wPt=$this->w*$this->k; - $this->hPt=$this->h*$this->k; - $this->PageBreakTrigger=$this->h-$this->bMargin; - $this->CurPageFormat=$format; - $this->PageSizes[$this->page]=array($this->wPt, $this->hPt); - } - } - - $this->_out('q 0 J 1 w 0 j 0 G 0 g'); // reset standard values - $s = parent::useTemplate($tplidx, $_x, $_y, $_w, $_h); - $this->_out('Q'); - return $s; - } - - /** - * Private method, that rebuilds all needed objects of source files - */ - function _putimportedobjects() { - if (is_array($this->parsers) && count($this->parsers) > 0) { - foreach($this->parsers AS $filename => $p) { - $this->current_parser =& $this->parsers[$filename]; - if (isset($this->_obj_stack[$filename]) && is_array($this->_obj_stack[$filename])) { - while(($n = key($this->_obj_stack[$filename])) !== null) { - $nObj = $this->current_parser->pdf_resolve_object($this->current_parser->c,$this->_obj_stack[$filename][$n][1]); - - $this->_newobj($this->_obj_stack[$filename][$n][0]); - - if ($nObj[0] == PDF_TYPE_STREAM) { - $this->pdf_write_value ($nObj); - } else { - $this->pdf_write_value ($nObj[1]); - } - - $this->_out('endobj'); - $this->_obj_stack[$filename][$n] = null; // free memory - unset($this->_obj_stack[$filename][$n]); - reset($this->_obj_stack[$filename]); - } - } - } - } - } - - - /** - * Private Method that writes the form xobjects - */ - function _putformxobjects() { - $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; - reset($this->tpls); - foreach($this->tpls AS $tplidx => $tpl) { - $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer']; - $this->_newobj(); - $cN = $this->n; // TCPDF/Protection: rem current "n" - - $this->tpls[$tplidx]['n'] = $this->n; - $this->_out('<<'.$filter.'/Type /XObject'); - $this->_out('/Subtype /Form'); - $this->_out('/FormType 1'); - - $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]', - (isset($tpl['box']['llx']) ? $tpl['box']['llx'] : $tpl['x'])*$this->k, - (isset($tpl['box']['lly']) ? $tpl['box']['lly'] : -$tpl['y'])*$this->k, - (isset($tpl['box']['urx']) ? $tpl['box']['urx'] : $tpl['w'] + $tpl['x'])*$this->k, - (isset($tpl['box']['ury']) ? $tpl['box']['ury'] : $tpl['h']-$tpl['y'])*$this->k - )); - - $c = 1; - $s = 0; - $tx = 0; - $ty = 0; - - if (isset($tpl['box'])) { - $tx = -$tpl['box']['llx']; - $ty = -$tpl['box']['lly']; - - if ($tpl['_rotationAngle'] <> 0) { - $angle = $tpl['_rotationAngle'] * M_PI/180; - $c=cos($angle); - $s=sin($angle); - - switch($tpl['_rotationAngle']) { - case -90: - $tx = -$tpl['box']['lly']; - $ty = $tpl['box']['urx']; - break; - case -180: - $tx = $tpl['box']['urx']; - $ty = $tpl['box']['ury']; - break; - case -270: - $tx = $tpl['box']['ury']; - $ty = 0; - break; - } - } - } else if ($tpl['x'] != 0 || $tpl['y'] != 0) { - $tx = -$tpl['x']*2; - $ty = $tpl['y']*2; - } - - $tx *= $this->k; - $ty *= $this->k; - - if ($c != 1 || $s != 0 || $tx != 0 || $ty != 0) { - $this->_out(sprintf('/Matrix [%.5F %.5F %.5F %.5F %.5F %.5F]', - $c, $s, -$s, $c, $tx, $ty - )); - } - - $this->_out('/Resources '); - - if (isset($tpl['resources'])) { - $this->current_parser =& $tpl['parser']; - $this->pdf_write_value($tpl['resources']); // "n" will be changed - } else { - $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); - if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) { - $this->_out('/Font <<'); - foreach($this->_res['tpl'][$tplidx]['fonts'] as $font) - $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); - $this->_out('>>'); - } - if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || - isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) - { - $this->_out('/XObject <<'); - if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) { - foreach($this->_res['tpl'][$tplidx]['images'] as $image) - $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); - } - if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) { - foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) - $this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R'); - } - $this->_out('>>'); - } - $this->_out('>>'); - } - - $nN = $this->n; // TCPDF: rem new "n" - $this->n = $cN; // TCPDF: reset to current "n" - $this->_out('/Length '.strlen($p).' >>'); - $this->_putstream($p); - $this->_out('endobj'); - $this->n = $nN; // TCPDF: reset to new "n" - } - - $this->_putimportedobjects(); - } - - /** - * Rewritten to handle existing own defined objects - */ - function _newobj($obj_id=false,$onlynewobj=false) { - if (!$obj_id) { - $obj_id = ++$this->n; - } - - //Begin a new object - if (!$onlynewobj) { - $this->offsets[$obj_id] = is_subclass_of($this, 'TCPDF') ? $this->bufferlen : strlen($this->buffer); - $this->_out($obj_id.' 0 obj'); - $this->_current_obj_id = $obj_id; // for later use with encryption - } - } - - /** - * Writes a value - * Needed to rebuild the source document - * - * @param mixed $value A PDF-Value. Structure of values see cases in this method - */ - function pdf_write_value(&$value) - { - if (is_subclass_of($this, 'TCPDF')) { - parent::pdf_write_value($value); - } - - switch ($value[0]) { - - case PDF_TYPE_TOKEN : - $this->_straightOut($value[1] . ' '); - break; - case PDF_TYPE_NUMERIC : - case PDF_TYPE_REAL : - if (is_float($value[1]) && $value[1] != 0) { - $this->_straightOut(rtrim(rtrim(sprintf('%F', $value[1]), '0'), '.') .' '); - } else { - $this->_straightOut($value[1] . ' '); - } - break; - - case PDF_TYPE_ARRAY : - - // An array. Output the proper - // structure and move on. - - $this->_straightOut('['); - for ($i = 0; $i < count($value[1]); $i++) { - $this->pdf_write_value($value[1][$i]); - } - - $this->_out(']'); - break; - - case PDF_TYPE_DICTIONARY : - - // A dictionary. - $this->_straightOut('<<'); - - reset ($value[1]); - - while (list($k, $v) = each($value[1])) { - $this->_straightOut($k . ' '); - $this->pdf_write_value($v); - } - - $this->_straightOut('>>'); - break; - - case PDF_TYPE_OBJREF : - - // An indirect object reference - // Fill the object stack if needed - $cpfn =& $this->current_parser->filename; - - if (!isset($this->_don_obj_stack[$cpfn][$value[1]])) { - $this->_newobj(false,true); - $this->_obj_stack[$cpfn][$value[1]] = array($this->n, $value); - $this->_don_obj_stack[$cpfn][$value[1]] = array($this->n, $value); // Value is maybee obsolete!!! - } - $objid = $this->_don_obj_stack[$cpfn][$value[1]][0]; - - $this->_out($objid.' 0 R'); - break; - - case PDF_TYPE_STRING : - - // A string. - $this->_straightOut('('.$value[1].')'); - - break; - - case PDF_TYPE_STREAM : - - // A stream. First, output the - // stream dictionary, then the - // stream data itself. - $this->pdf_write_value($value[1]); - $this->_out('stream'); - $this->_out($value[2][1]); - $this->_out('endstream'); - break; - case PDF_TYPE_HEX : - $this->_straightOut('<'.$value[1].'>'); - break; - - case PDF_TYPE_BOOLEAN : - $this->_straightOut($value[1] ? 'true ' : 'false '); - break; - - case PDF_TYPE_NULL : - // The null object. - - $this->_straightOut('null '); - break; - } - } - - - /** - * Modified so not each call will add a newline to the output. - */ - function _straightOut($s) { - if (!is_subclass_of($this, 'TCPDF')) { - if($this->state==2) - $this->pages[$this->page] .= $s; - else - $this->buffer .= $s; - } else { - if ($this->state == 2) { - if (isset($this->footerlen[$this->page]) AND ($this->footerlen[$this->page] > 0)) { - // puts data before page footer - $page = substr($this->getPageBuffer($this->page), 0, -$this->footerlen[$this->page]); - $footer = substr($this->getPageBuffer($this->page), -$this->footerlen[$this->page]); - $this->setPageBuffer($this->page, $page.' '.$s."\n".$footer); - } else { - $this->setPageBuffer($this->page, $s, true); - } - } else { - $this->setBuffer($s); - } - } - } - - /** - * rewritten to close opened parsers - * - */ - function _enddoc() { - parent::_enddoc(); - $this->_closeParsers(); - } - - /** - * close all files opened by parsers - */ - function _closeParsers() { - if ($this->state > 2 && count($this->parsers) > 0) { - foreach ($this->parsers as $k => $_){ - $this->parsers[$k]->closeFile(); - $this->parsers[$k] = null; - unset($this->parsers[$k]); - } - return true; - } - return false; - } - -} \ No newline at end of file Deleted: trunk/fpdi/fpdi2tcpdf_bridge.php =================================================================== --- trunk/fpdi/fpdi2tcpdf_bridge.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/fpdi2tcpdf_bridge.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,171 +0,0 @@ -<?php -// -// FPDI - Version 1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - * This class is used as a bridge between TCPDF and FPDI - * and will create the possibility to use both FPDF and TCPDF - * via one FPDI version. - * - * We'll simply remap TCPDF to FPDF again. - * - * It'll be loaded and extended by FPDF_TPL. - */ -class FPDF extends TCPDF { - - function __get($name) { - switch ($name) { - case 'PDFVersion': - return $this->PDFVersion; - case 'k': - return $this->k; - default: - // Error handling - $this->Error('Cannot access protected property '.get_class($this).':$'.$name.' / Undefined property: '.get_class($this).'::$'.$name); - } - } - - function __set($name, $value) { - switch ($name) { - case 'PDFVersion': - $this->PDFVersion = $value; - break; - default: - // Error handling - $this->Error('Cannot access protected property '.get_class($this).':$'.$name.' / Undefined property: '.get_class($this).'::$'.$name); - } - } - - /** - * Encryption of imported data by FPDI - * - * @param array $value - */ - function pdf_write_value(&$value) { - switch ($value[0]) { - case PDF_TYPE_STRING : - if ($this->encrypted) { - $value[1] = $this->_unescape($value[1]); - $value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]); - $value[1] = $this->_escape($value[1]); - } - break; - - case PDF_TYPE_STREAM : - if ($this->encrypted) { - $value[2][1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[2][1]); - } - break; - - case PDF_TYPE_HEX : - if ($this->encrypted) { - $value[1] = $this->hex2str($value[1]); - $value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]); - - // remake hexstring of encrypted string - $value[1] = $this->str2hex($value[1]); - } - break; - } - } - - /** - * Unescapes a PDF string - * - * @param string $s - * @return string - */ - function _unescape($s) { - $out = ''; - for ($count = 0, $n = strlen($s); $count < $n; $count++) { - if ($s[$count] != '\\' || $count == $n-1) { - $out .= $s[$count]; - } else { - switch ($s[++$count]) { - case ')': - case '(': - case '\\': - $out .= $s[$count]; - break; - case 'f': - $out .= chr(0x0C); - break; - case 'b': - $out .= chr(0x08); - break; - case 't': - $out .= chr(0x09); - break; - case 'r': - $out .= chr(0x0D); - break; - case 'n': - $out .= chr(0x0A); - break; - case "\r": - if ($count != $n-1 && $s[$count+1] == "\n") - $count++; - break; - case "\n": - break; - default: - // Octal-Values - if (ord($s[$count]) >= ord('0') && - ord($s[$count]) <= ord('9')) { - $oct = ''. $s[$count]; - - if (ord($s[$count+1]) >= ord('0') && - ord($s[$count+1]) <= ord('9')) { - $oct .= $s[++$count]; - - if (ord($s[$count+1]) >= ord('0') && - ord($s[$count+1]) <= ord('9')) { - $oct .= $s[++$count]; - } - } - - $out .= chr(octdec($oct)); - } else { - $out .= $s[$count]; - } - } - } - } - return $out; - } - - /** - * Hexadecimal to string - * - * @param string $hex - * @return string - */ - function hex2str($hex) { - return pack('H*', str_replace(array("\r", "\n", ' '), '', $hex)); - } - - /** - * String to hexadecimal - * - * @param string $str - * @return string - */ - function str2hex($str) { - return current(unpack('H*', $str)); - } -} \ No newline at end of file Deleted: trunk/fpdi/fpdi_pdf_parser.php =================================================================== --- trunk/fpdi/fpdi_pdf_parser.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/fpdi_pdf_parser.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,384 +0,0 @@ -<?php -// -// FPDI - Version 1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -require_once('pdf_parser.php'); - -class fpdi_pdf_parser extends pdf_parser { - - /** - * Pages - * Index beginns at 0 - * - * @var array - */ - var $pages; - - /** - * Page count - * @var integer - */ - var $page_count; - - /** - * actual page number - * @var integer - */ - var $pageno; - - /** - * PDF Version of imported Document - * @var string - */ - var $pdfVersion; - - /** - * FPDI Reference - * @var object - */ - var $fpdi; - - /** - * Available BoxTypes - * - * @var array - */ - var $availableBoxes = array('/MediaBox', '/CropBox', '/BleedBox', '/TrimBox', '/ArtBox'); - - /** - * Constructor - * - * @param string $filename Source-Filename - * @param object $fpdi Object of type fpdi - */ - function fpdi_pdf_parser($filename, &$fpdi) { - $this->fpdi =& $fpdi; - - parent::pdf_parser($filename); - - // resolve Pages-Dictonary - $pages = $this->pdf_resolve_object($this->c, $this->root[1][1]['/Pages']); - - // Read pages - $this->read_pages($this->c, $pages, $this->pages); - - // count pages; - $this->page_count = count($this->pages); - } - - /** - * Overwrite parent::error() - * - * @param string $msg Error-Message - */ - function error($msg) { - $this->fpdi->error($msg); - } - - /** - * Get pagecount from sourcefile - * - * @return int - */ - function getPageCount() { - return $this->page_count; - } - - - /** - * Set pageno - * - * @param int $pageno Pagenumber to use - */ - function setPageno($pageno) { - $pageno = ((int) $pageno) - 1; - - if ($pageno < 0 || $pageno >= $this->getPageCount()) { - $this->fpdi->error('Pagenumber is wrong!'); - } - - $this->pageno = $pageno; - } - - /** - * Get page-resources from current page - * - * @return array - */ - function getPageResources() { - return $this->_getPageResources($this->pages[$this->pageno]); - } - - /** - * Get page-resources from /Page - * - * @param array $obj Array of pdf-data - */ - function _getPageResources ($obj) { // $obj = /Page - $obj = $this->pdf_resolve_object($this->c, $obj); - - // If the current object has a resources - // dictionary associated with it, we use - // it. Otherwise, we move back to its - // parent object. - if (isset ($obj[1][1]['/Resources'])) { - $res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Resources']); - if ($res[0] == PDF_TYPE_OBJECT) - return $res[1]; - return $res; - } else { - if (!isset ($obj[1][1]['/Parent'])) { - return false; - } else { - $res = $this->_getPageResources($obj[1][1]['/Parent']); - if ($res[0] == PDF_TYPE_OBJECT) - return $res[1]; - return $res; - } - } - } - - - /** - * Get content of current page - * - * If more /Contents is an array, the streams are concated - * - * @return string - */ - function getContent() { - $buffer = ''; - - if (isset($this->pages[$this->pageno][1][1]['/Contents'])) { - $contents = $this->_getPageContent($this->pages[$this->pageno][1][1]['/Contents']); - foreach($contents AS $tmp_content) { - $buffer .= $this->_rebuildContentStream($tmp_content).' '; - } - } - - return $buffer; - } - - - /** - * Resolve all content-objects - * - * @param array $content_ref - * @return array - */ - function _getPageContent($content_ref) { - $contents = array(); - - if ($content_ref[0] == PDF_TYPE_OBJREF) { - $content = $this->pdf_resolve_object($this->c, $content_ref); - if ($content[1][0] == PDF_TYPE_ARRAY) { - $contents = $this->_getPageContent($content[1]); - } else { - $contents[] = $content; - } - } else if ($content_ref[0] == PDF_TYPE_ARRAY) { - foreach ($content_ref[1] AS $tmp_content_ref) { - $contents = array_merge($contents,$this->_getPageContent($tmp_content_ref)); - } - } - - return $contents; - } - - - /** - * Rebuild content-streams - * - * @param array $obj - * @return string - */ - function _rebuildContentStream($obj) { - $filters = array(); - - if (isset($obj[1][1]['/Filter'])) { - $_filter = $obj[1][1]['/Filter']; - - if ($_filter[0] == PDF_TYPE_TOKEN) { - $filters[] = $_filter; - } else if ($_filter[0] == PDF_TYPE_ARRAY) { - $filters = $_filter[1]; - } - } - - $stream = $obj[2][1]; - - foreach ($filters AS $_filter) { - switch ($_filter[1]) { - case '/FlateDecode': - if (function_exists('gzuncompress')) { - $stream = (strlen($stream) > 0) ? @gzuncompress($stream) : ''; - } else { - $this->fpdi->error(sprintf('To handle %s filter, please compile php with zlib support.',$_filter[1])); - } - if ($stream === false) { - $this->fpdi->error('Error while decompressing stream.'); - } - break; - case null: - $stream = $stream; - break; - default: - if (preg_match('/^\/[a-z85]*$/i', $_filter[1], $filterName) && @include_once('decoders'.$_filter[1].'.php')) { - $filterName = substr($_filter[1],1); - if (class_exists($filterName)) { - $decoder =& new $filterName($this->fpdi); - $stream = $decoder->decode($stream); - } else { - $this->fpdi->error(sprintf('Unsupported Filter: %s',$_filter[1])); - } - } else { - $this->fpdi->error(sprintf('Unsupported Filter: %s',$_filter[1])); - } - } - } - - return $stream; - } - - - /** - * Get a Box from a page - * Arrayformat is same as used by fpdf_tpl - * - * @param array $page a /Page - * @param string $box_index Type of Box @see $availableBoxes - * @return array - */ - function getPageBox($page, $box_index) { - $page = $this->pdf_resolve_object($this->c,$page); - $box = null; - if (isset($page[1][1][$box_index])) - $box =& $page[1][1][$box_index]; - - if (!is_null($box) && $box[0] == PDF_TYPE_OBJREF) { - $tmp_box = $this->pdf_resolve_object($this->c,$box); - $box = $tmp_box[1]; - } - - if (!is_null($box) && $box[0] == PDF_TYPE_ARRAY) { - $b =& $box[1]; - return array('x' => $b[0][1]/$this->fpdi->k, - 'y' => $b[1][1]/$this->fpdi->k, - 'w' => abs($b[0][1]-$b[2][1])/$this->fpdi->k, - 'h' => abs($b[1][1]-$b[3][1])/$this->fpdi->k, - 'llx' => $b[0][1]/$this->fpdi->k, - 'lly' => $b[1][1]/$this->fpdi->k, - 'urx' => $b[2][1]/$this->fpdi->k, - 'ury' => $b[3][1]/$this->fpdi->k, - ); - } else if (!isset ($page[1][1]['/Parent'])) { - return false; - } else { - return $this->getPageBox($this->pdf_resolve_object($this->c, $page[1][1]['/Parent']), $box_index); - } - } - - function getPageBoxes($pageno) { - return $this->_getPageBoxes($this->pages[$pageno-1]); - } - - /** - * Get all Boxes from /Page - * - * @param array a /Page - * @return array - */ - function _getPageBoxes($page) { - $boxes = array(); - - foreach($this->availableBoxes AS $box) { - if ($_box = $this->getPageBox($page,$box)) { - $boxes[$box] = $_box; - } - } - - return $boxes; - } - - /** - * Get the page rotation by pageno - * - * @param integer $pageno - * @return array - */ - function getPageRotation($pageno) { - return $this->_getPageRotation($this->pages[$pageno-1]); - } - - function _getPageRotation ($obj) { // $obj = /Page - $obj = $this->pdf_resolve_object($this->c, $obj); - if (isset ($obj[1][1]['/Rotate'])) { - $res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Rotate']); - if ($res[0] == PDF_TYPE_OBJECT) - return $res[1]; - return $res; - } else { - if (!isset ($obj[1][1]['/Parent'])) { - return false; - } else { - $res = $this->_getPageRotation($obj[1][1]['/Parent']); - if ($res[0] == PDF_TYPE_OBJECT) - return $res[1]; - return $res; - } - } - } - - /** - * Read all /Page(es) - * - * @param object pdf_context - * @param array /Pages - * @param array the result-array - */ - function read_pages (&$c, &$pages, &$result) { - // Get the kids dictionary - $kids = $this->pdf_resolve_object ($c, $pages[1][1]['/Kids']); - - if (!is_array($kids)) - $this->fpdi->Error('Cannot find /Kids in current /Page-Dictionary'); - foreach ($kids[1] as $v) { - $pg = $this->pdf_resolve_object ($c, $v); - if ($pg[1][1]['/Type'][1] === '/Pages') { - // If one of the kids is an embedded - // /Pages array, resolve it as well. - $this->read_pages ($c, $pg, $result); - } else { - $result[] = $pg; - } - } - } - - - - /** - * Get PDF-Version - * - * And reset the PDF Version used in FPDI if needed - */ - function getPDFVersion() { - parent::getPDFVersion(); - $this->fpdi->PDFVersion = max($this->fpdi->PDFVersion, $this->pdfVersion); - } - -} \ No newline at end of file Deleted: trunk/fpdi/pdf_context.php =================================================================== --- trunk/fpdi/pdf_context.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/pdf_context.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,97 +0,0 @@ -<?php -// -// FPDI - Version 1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -class pdf_context { - - /** - * Modi - * - * @var integer 0 = file | 1 = string - */ - var $_mode = 0; - - var $file; - var $buffer; - var $offset; - var $length; - - var $stack; - - // Constructor - - function pdf_context(&$f) { - $this->file =& $f; - if (is_string($this->file)) - $this->_mode = 1; - $this->reset(); - } - - // Optionally move the file - // pointer to a new location - // and reset the buffered data - - function reset($pos = null, $l = 100) { - if ($this->_mode == 0) { - if (!is_null ($pos)) { - fseek ($this->file, $pos); - } - - $this->buffer = $l > 0 ? fread($this->file, $l) : ''; - $this->length = strlen($this->buffer); - if ($this->length < $l) - $this->increase_length($l - $this->length); - } else { - $this->buffer = $this->file; - $this->length = strlen($this->buffer); - } - $this->offset = 0; - $this->stack = array(); - } - - // Make sure that there is at least one - // character beyond the current offset in - // the buffer to prevent the tokenizer - // from attempting to access data that does - // not exist - - function ensure_content() { - if ($this->offset >= $this->length - 1) { - return $this->increase_length(); - } else { - return true; - } - } - - // Forcefully read more data into the buffer - - function increase_length($l=100) { - if ($this->_mode == 0 && feof($this->file)) { - return false; - } else if ($this->_mode == 0) { - $totalLength = $this->length + $l; - do { - $this->buffer .= fread($this->file, $totalLength-$this->length); - } while ((($this->length = strlen($this->buffer)) != $totalLength) && !feof($this->file)); - - return true; - } else { - return false; - } - } -} \ No newline at end of file Deleted: trunk/fpdi/pdf_parser.php =================================================================== --- trunk/fpdi/pdf_parser.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/pdf_parser.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,694 +0,0 @@ -<?php -// -// FPDI - Version 1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -if (!defined ('PDF_TYPE_NULL')) - define ('PDF_TYPE_NULL', 0); -if (!defined ('PDF_TYPE_NUMERIC')) - define ('PDF_TYPE_NUMERIC', 1); -if (!defined ('PDF_TYPE_TOKEN')) - define ('PDF_TYPE_TOKEN', 2); -if (!defined ('PDF_TYPE_HEX')) - define ('PDF_TYPE_HEX', 3); -if (!defined ('PDF_TYPE_STRING')) - define ('PDF_TYPE_STRING', 4); -if (!defined ('PDF_TYPE_DICTIONARY')) - define ('PDF_TYPE_DICTIONARY', 5); -if (!defined ('PDF_TYPE_ARRAY')) - define ('PDF_TYPE_ARRAY', 6); -if (!defined ('PDF_TYPE_OBJDEC')) - define ('PDF_TYPE_OBJDEC', 7); -if (!defined ('PDF_TYPE_OBJREF')) - define ('PDF_TYPE_OBJREF', 8); -if (!defined ('PDF_TYPE_OBJECT')) - define ('PDF_TYPE_OBJECT', 9); -if (!defined ('PDF_TYPE_STREAM')) - define ('PDF_TYPE_STREAM', 10); -if (!defined ('PDF_TYPE_BOOLEAN')) - define ('PDF_TYPE_BOOLEAN', 11); -if (!defined ('PDF_TYPE_REAL')) - define ('PDF_TYPE_REAL', 12); - -require_once('pdf_context.php'); - -class pdf_parser { - - /** - * Filename - * @var string - */ - var $filename; - - /** - * File resource - * @var resource - */ - var $f; - - /** - * PDF Context - * @var object pdf_context-Instance - */ - var $c; - - /** - * xref-Data - * @var array - */ - var $xref; - - /** - * root-Object - * @var array - */ - var $root; - - /** - * PDF version of the loaded document - * @var string - */ - var $pdfVersion; - - /** - * Constructor - * - * @param string $filename Source-Filename - */ - function pdf_parser($filename) { - $this->filename = $filename; - - $this->f = @fopen($this->filename, 'rb'); - - if (!$this->f) - $this->error(sprintf('Cannot open %s !', $filename)); - - $this->getPDFVersion(); - - $this->c =& new pdf_context($this->f); - - // Read xref-Data - $this->pdf_read_xref($this->xref, $this->pdf_find_xref()); - - // Check for Encryption - $this->getEncryption(); - - // Read root - $this->pdf_read_root(); - } - - /** - * Close the opened file - */ - function closeFile() { - if (isset($this->f)) { - fclose($this->f); - unset($this->f); - } - } - - /** - * Print Error and die - * - * @param string $msg Error-Message - */ - function error($msg) { - die('<b>PDF-Parser Error:</b> '.$msg); - } - - /** - * Check Trailer for Encryption - */ - function getEncryption() { - if (isset($this->xref['trailer'][1]['/Encrypt'])) { - $this->error('File is encrypted!'); - } - } - - /** - * Find/Return /Root - * - * @return array - */ - function pdf_find_root() { - if ($this->xref['trailer'][1]['/Root'][0] != PDF_TYPE_OBJREF) { - $this->error('Wrong Type of Root-Element! Must be an indirect reference'); - } - return $this->xref['trailer'][1]['/Root']; - } - - /** - * Read the /Root - */ - function pdf_read_root() { - // read root - $this->root = $this->pdf_resolve_object($this->c, $this->pdf_find_root()); - } - - /** - * Get PDF-Version - * - * And reset the PDF Version used in FPDI if needed - */ - function getPDFVersion() { - fseek($this->f, 0); - preg_match('/\d\.\d/',fread($this->f,16),$m); - if (isset($m[0])) - $this->pdfVersion = $m[0]; - return $this->pdfVersion; - } - - /** - * Find the xref-Table - */ - function pdf_find_xref() { - $toRead = 1500; - - $stat = fseek ($this->f, -$toRead, SEEK_END); - if ($stat === -1) { - fseek ($this->f, 0); - } - $data = fread($this->f, $toRea... [truncated message content] |
From: <dai...@us...> - 2011-03-20 02:51:13
|
Revision: 4515 http://web-erp.svn.sourceforge.net/web-erp/?rev=4515&view=rev Author: daintree Date: 2011-03-20 02:51:01 +0000 (Sun, 20 Mar 2011) Log Message: ----------- remove redundant files Modified Paths: -------------- trunk/UserSettings.php trunk/WWW_Users.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Removed Paths: ------------- trunk/fpdi/decoders/ trunk/fpdi/fpdf_tpl.php trunk/fpdi/fpdi.php trunk/fpdi/fpdi2tcpdf_bridge.php trunk/fpdi/fpdi_pdf_parser.php trunk/fpdi/pdf_context.php trunk/fpdi/pdf_parser.php trunk/fpdi/wrapper_functions-borrar.php trunk/sql/mysql/weberp313iso-demo.sql trunk/sql/mysql/weberp313iso-new.sql Modified: trunk/UserSettings.php =================================================================== --- trunk/UserSettings.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/UserSettings.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -130,7 +130,6 @@ if (is_dir('locale/' . $LanguageEntry) AND $LanguageEntry != '..' - AND $LanguageEntry != 'CVS' AND $LanguageEntry != '.svn' AND $LanguageEntry!='.'){ Modified: trunk/WWW_Users.php =================================================================== --- trunk/WWW_Users.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/WWW_Users.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -79,7 +79,7 @@ } //comment out except for demo! Do not want anyone modifying demo user. /* - elseif ($_POST['UserID'] == 'demo') { + elseif ($_POST['UserID'] == 'admin') { prnMsg(_('The demonstration user called demo cannot be modified.'),'error'); $InputError = 1; } @@ -215,7 +215,7 @@ // comment out except for demo! Do not want anyopne deleting demo user. /* - if ($SelectedUser == 'demo') { + if ($SelectedUser == 'admin') { prnMsg(_('The demonstration user called demo cannot be deleted'),'error'); } else { */ Deleted: trunk/fpdi/fpdf_tpl.php =================================================================== --- trunk/fpdi/fpdf_tpl.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/fpdf_tpl.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,409 +0,0 @@ -<?php -// -// FPDF_TPL - Version 1.1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -class FPDF_TPL extends FPDF { - /** - * Array of Tpl-Data - * @var array - */ - var $tpls = array(); - - /** - * Current Template-ID - * @var int - */ - var $tpl = 0; - - /** - * "In Template"-Flag - * @var boolean - */ - var $_intpl = false; - - /** - * Nameprefix of Templates used in Resources-Dictonary - * @var string A String defining the Prefix used as Template-Object-Names. Have to beginn with an / - */ - var $tplprefix = "/TPL"; - - /** - * Resources used By Templates and Pages - * @var array - */ - var $_res = array(); - - /** - * Last used Template data - * - * @var array - */ - var $lastUsedTemplateData = array(); - - /** - * Start a Template - * - * This method starts a template. You can give own coordinates to build an own sized - * Template. Pay attention, that the margins are adapted to the new templatesize. - * If you want to write outside the template, for example to build a clipped Template, - * you have to set the Margins and "Cursor"-Position manual after beginTemplate-Call. - * - * If no parameter is given, the template uses the current page-size. - * The Method returns an ID of the current Template. This ID is used later for using this template. - * Warning: A created Template is used in PDF at all events. Still if you don't use it after creation! - * - * @param int $x The x-coordinate given in user-unit - * @param int $y The y-coordinate given in user-unit - * @param int $w The width given in user-unit - * @param int $h The height given in user-unit - * @return int The ID of new created Template - */ - function beginTemplate($x=null, $y=null, $w=null, $h=null) { - if ($this->page <= 0) - $this->error("You have to add a page to fpdf first!"); - - if ($x == null) - $x = 0; - if ($y == null) - $y = 0; - if ($w == null) - $w = $this->w; - if ($h == null) - $h = $this->h; - - // Save settings - $this->tpl++; - $tpl =& $this->tpls[$this->tpl]; - $tpl = array( - 'o_x' => $this->x, - 'o_y' => $this->y, - 'o_AutoPageBreak' => $this->AutoPageBreak, - 'o_bMargin' => $this->bMargin, - 'o_tMargin' => $this->tMargin, - 'o_lMargin' => $this->lMargin, - 'o_rMargin' => $this->rMargin, - 'o_h' => $this->h, - 'o_w' => $this->w, - 'buffer' => '', - 'x' => $x, - 'y' => $y, - 'w' => $w, - 'h' => $h - ); - - $this->SetAutoPageBreak(false); - - // Define own high and width to calculate possitions correct - $this->h = $h; - $this->w = $w; - - $this->_intpl = true; - $this->SetXY($x+$this->lMargin, $y+$this->tMargin); - $this->SetRightMargin($this->w-$w+$this->rMargin); - - return $this->tpl; - } - - /** - * End Template - * - * This method ends a template and reset initiated variables on beginTemplate. - * - * @return mixed If a template is opened, the ID is returned. If not a false is returned. - */ - function endTemplate() { - if ($this->_intpl) { - $this->_intpl = false; - $tpl =& $this->tpls[$this->tpl]; - $this->SetXY($tpl['o_x'], $tpl['o_y']); - $this->tMargin = $tpl['o_tMargin']; - $this->lMargin = $tpl['o_lMargin']; - $this->rMargin = $tpl['o_rMargin']; - $this->h = $tpl['o_h']; - $this->w = $tpl['o_w']; - $this->SetAutoPageBreak($tpl['o_AutoPageBreak'], $tpl['o_bMargin']); - - return $this->tpl; - } else { - return false; - } - } - - /** - * Use a Template in current Page or other Template - * - * You can use a template in a page or in another template. - * You can give the used template a new size like you use the Image()-method. - * All parameters are optional. The width or height is calculated automaticaly - * if one is given. If no parameter is given the origin size as defined in - * beginTemplate() is used. - * The calculated or used width and height are returned as an array. - * - * @param int $tplidx A valid template-Id - * @param int $_x The x-position - * @param int $_y The y-position - * @param int $_w The new width of the template - * @param int $_h The new height of the template - * @retrun array The height and width of the template - */ - function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0) { - if ($this->page <= 0) - $this->error("You have to add a page to fpdf first!"); - - if (!isset($this->tpls[$tplidx])) - $this->error("Template does not exist!"); - - if ($this->_intpl) { - $this->_res['tpl'][$this->tpl]['tpls'][$tplidx] =& $this->tpls[$tplidx]; - } - - $tpl =& $this->tpls[$tplidx]; - $w = $tpl['w']; - $h = $tpl['h']; - - if ($_x == null) - $_x = 0; - if ($_y == null) - $_y = 0; - - $_x += $tpl['x']; - $_y += $tpl['y']; - - $wh = $this->getTemplateSize($tplidx, $_w, $_h); - $_w = $wh['w']; - $_h = $wh['h']; - - $tData = array( - 'x' => $this->x, - 'y' => $this->y, - 'w' => $_w, - 'h' => $_h, - 'scaleX' => ($_w/$w), - 'scaleY' => ($_h/$h), - 'tx' => $_x, - 'ty' => ($this->h-$_y-$_h), - 'lty' => ($this->h-$_y-$_h) - ($this->h-$h) * ($_h/$h) - ); - - $this->_out(sprintf("q %.4F 0 0 %.4F %.4F %.4F cm", $tData['scaleX'], $tData['scaleY'], $tData['tx']*$this->k, $tData['ty']*$this->k)); // Translate - $this->_out(sprintf('%s%d Do Q', $this->tplprefix, $tplidx)); - - $this->lastUsedTemplateData = $tData; - - return array("w" => $_w, "h" => $_h); - } - - /** - * Get The calculated Size of a Template - * - * If one size is given, this method calculates the other one. - * - * @param int $tplidx A valid template-Id - * @param int $_w The width of the template - * @param int $_h The height of the template - * @return array The height and width of the template - */ - function getTemplateSize($tplidx, $_w=0, $_h=0) { - if (!$this->tpls[$tplidx]) - return false; - - $tpl =& $this->tpls[$tplidx]; - $w = $tpl['w']; - $h = $tpl['h']; - - if ($_w == 0 and $_h == 0) { - $_w = $w; - $_h = $h; - } - - if($_w==0) - $_w = $_h*$w/$h; - if($_h==0) - $_h = $_w*$h/$w; - - return array("w" => $_w, "h" => $_h); - } - - /** - * See FPDF/TCPDF-Documentation ;-) - */ - function SetFont($family, $style='', $size=0, $fontfile='') { - if (!is_subclass_of($this, 'TCPDF') && func_num_args() > 3) { - $this->Error('More than 3 arguments for the SetFont method are only available in TCPDF.'); - } - /** - * force the resetting of font changes in a template - */ - if ($this->_intpl) - $this->FontFamily = ''; - - parent::SetFont($family, $style, $size, $fontfile); - - $fontkey = $this->FontFamily.$this->FontStyle; - - if ($this->_intpl) { - $this->_res['tpl'][$this->tpl]['fonts'][$fontkey] =& $this->fonts[$fontkey]; - } else { - $this->_res['page'][$this->page]['fonts'][$fontkey] =& $this->fonts[$fontkey]; - } - } - - /** - * See FPDF/TCPDF-Documentation ;-) - */ - function Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false) { - if (!is_subclass_of($this, 'TCPDF') && func_num_args() > 7) { - $this->Error('More than 7 arguments for the Image method are only available in TCPDF.'); - } - - parent::Image($file, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $ismask, $imgmask, $border, $fitbox, $hidden, $fitonpage); - if ($this->_intpl) { - $this->_res['tpl'][$this->tpl]['images'][$file] =& $this->images[$file]; - } else { - $this->_res['page'][$this->page]['images'][$file] =& $this->images[$file]; - } - } - - /** - * See FPDF-Documentation ;-) - * - * AddPage is not available when you're "in" a template. - */ - function AddPage($orientation='', $format='', $keepmargins=false) { - if ($this->_intpl) - $this->Error('Adding pages in templates isn\'t possible!'); - parent::AddPage($orientation, $format); - } - - /** - * Preserve adding Links in Templates ...won't work - */ - function Link($x, $y, $w, $h, $link, $spaces=0) { - if (!is_subclass_of($this, 'TCPDF') && func_num_args() > 5) { - $this->Error('More than 7 arguments for the Image method are only available in TCPDF.'); - } - - if ($this->_intpl) - $this->Error('Using links in templates aren\'t possible!'); - parent::Link($x, $y, $w, $h, $link, $spaces); - } - - function AddLink() { - if ($this->_intpl) - $this->Error('Adding links in templates aren\'t possible!'); - return parent::AddLink(); - } - - function SetLink($link, $y=0, $page=-1) { - if ($this->_intpl) - $this->Error('Setting links in templates aren\'t possible!'); - parent::SetLink($link, $y, $page); - } - - /** - * Private Method that writes the form xobjects - */ - function _putformxobjects() { - $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; - reset($this->tpls); - foreach($this->tpls AS $tplidx => $tpl) { - - $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer']; - $this->_newobj(); - $this->tpls[$tplidx]['n'] = $this->n; - $this->_out('<<'.$filter.'/Type /XObject'); - $this->_out('/Subtype /Form'); - $this->_out('/FormType 1'); - $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]', - // llx - $tpl['x'], - // lly - -$tpl['y'], - // urx - ($tpl['w']+$tpl['x'])*$this->k, - // ury - ($tpl['h']-$tpl['y'])*$this->k - )); - - if ($tpl['x'] != 0 || $tpl['y'] != 0) { - $this->_out(sprintf('/Matrix [1 0 0 1 %.5F %.5F]', - -$tpl['x']*$this->k*2, $tpl['y']*$this->k*2 - )); - } - - $this->_out('/Resources '); - - $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); - if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) { - $this->_out('/Font <<'); - foreach($this->_res['tpl'][$tplidx]['fonts'] as $font) - $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); - $this->_out('>>'); - } - if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || - isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) - { - $this->_out('/XObject <<'); - if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) { - foreach($this->_res['tpl'][$tplidx]['images'] as $image) - $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); - } - if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) { - foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) - $this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R'); - } - $this->_out('>>'); - } - $this->_out('>>'); - - $this->_out('/Length '.strlen($p).' >>'); - $this->_putstream($p); - $this->_out('endobj'); - } - } - - /** - * Overwritten to add _putformxobjects() after _putimages() - * - */ - function _putimages() { - parent::_putimages(); - $this->_putformxobjects(); - } - - function _putxobjectdict() { - parent::_putxobjectdict(); - - if (count($this->tpls)) { - foreach($this->tpls as $tplidx => $tpl) { - $this->_out(sprintf('%s%d %d 0 R', $this->tplprefix, $tplidx, $tpl['n'])); - } - } - } - - /** - * Private Method - */ - function _out($s) { - if ($this->state==2 && $this->_intpl) { - $this->tpls[$this->tpl]['buffer'] .= $s."\n"; - } else { - parent::_out($s); - } - } -} Deleted: trunk/fpdi/fpdi.php =================================================================== --- trunk/fpdi/fpdi.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/fpdi.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,504 +0,0 @@ -<?php -// -// FPDI - Version 1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -define('FPDI_VERSION','1.3'); - -// Check for TCPDF and remap TCPDF to FPDF -if (class_exists('TCPDF')) { - require_once('fpdi2tcpdf_bridge.php'); -} - -require_once('fpdf_tpl.php'); -require_once('fpdi_pdf_parser.php'); - - -class FPDI extends FPDF_TPL { - /** - * Actual filename - * @var string - */ - var $current_filename; - - /** - * Parser-Objects - * @var array - */ - var $parsers; - - /** - * Current parser - * @var object - */ - var $current_parser; - - /** - * object stack - * @var array - */ - var $_obj_stack; - - /** - * done object stack - * @var array - */ - var $_don_obj_stack; - - /** - * Current Object Id. - * @var integer - */ - var $_current_obj_id; - - /** - * The name of the last imported page box - * @var string - */ - var $lastUsedPageBox; - - var $_importedPages = array(); - - - /** - * Set a source-file - * - * @param string $filename a valid filename - * @return int number of available pages - */ - function setSourceFile($filename) { - $this->current_filename = $filename; - $fn =& $this->current_filename; - - if (!isset($this->parsers[$fn])) - $this->parsers[$fn] = new fpdi_pdf_parser($fn, $this); - $this->current_parser =& $this->parsers[$fn]; - - return $this->parsers[$fn]->getPageCount(); - } - - /** - * Import a page - * - * @param int $pageno pagenumber - * @return int Index of imported page - to use with fpdf_tpl::useTemplate() - */ - function importPage($pageno, $boxName='/CropBox') { - if ($this->_intpl) { - return $this->error('Please import the desired pages before creating a new template.'); - } - - $fn =& $this->current_filename; - - // check if page already imported - $pageKey = $fn.((int)$pageno).$boxName; - if (isset($this->_importedPages[$pageKey])) - return $this->_importedPages[$pageKey]; - - $parser =& $this->parsers[$fn]; - $parser->setPageno($pageno); - - $this->tpl++; - $this->tpls[$this->tpl] = array(); - $tpl =& $this->tpls[$this->tpl]; - $tpl['parser'] =& $parser; - $tpl['resources'] = $parser->getPageResources(); - $tpl['buffer'] = $parser->getContent(); - - if (!in_array($boxName, $parser->availableBoxes)) - return $this->Error(sprintf('Unknown box: %s', $boxName)); - $pageboxes = $parser->getPageBoxes($pageno); - - /** - * MediaBox - * CropBox: Default -> MediaBox - * BleedBox: Default -> CropBox - * TrimBox: Default -> CropBox - * ArtBox: Default -> CropBox - */ - if (!isset($pageboxes[$boxName]) && ($boxName == '/BleedBox' || $boxName == '/TrimBox' || $boxName == '/ArtBox')) - $boxName = '/CropBox'; - if (!isset($pageboxes[$boxName]) && $boxName == '/CropBox') - $boxName = '/MediaBox'; - - if (!isset($pageboxes[$boxName])) - return false; - $this->lastUsedPageBox = $boxName; - - $box = $pageboxes[$boxName]; - $tpl['box'] = $box; - - // To build an array that can be used by PDF_TPL::useTemplate() - $this->tpls[$this->tpl] = array_merge($this->tpls[$this->tpl],$box); - - // An imported page will start at 0,0 everytime. Translation will be set in _putformxobjects() - $tpl['x'] = 0; - $tpl['y'] = 0; - - $page =& $parser->pages[$parser->pageno]; - - // handle rotated pages - $rotation = $parser->getPageRotation($pageno); - $tpl['_rotationAngle'] = 0; - if (isset($rotation[1]) && ($angle = $rotation[1] % 360) != 0) { - $steps = $angle / 90; - - $_w = $tpl['w']; - $_h = $tpl['h']; - $tpl['w'] = $steps % 2 == 0 ? $_w : $_h; - $tpl['h'] = $steps % 2 == 0 ? $_h : $_w; - - $tpl['_rotationAngle'] = $angle*-1; - } - - $this->_importedPages[$pageKey] = $this->tpl; - - return $this->tpl; - } - - function getLastUsedPageBox() { - return $this->lastUsedPageBox; - } - - function useTemplate($tplidx, $_x=null, $_y=null, $_w=0, $_h=0, $adjustPageSize=false) { - if ($adjustPageSize == true && is_null($_x) && is_null($_y)) { - $size = $this->getTemplateSize($tplidx, $_w, $_h); - $format = array($size['w'], $size['h']); - if ($format[0]!=$this->CurPageFormat[0] || $format[1]!=$this->CurPageFormat[1]) { - $this->w=$format[0]; - $this->h=$format[1]; - $this->wPt=$this->w*$this->k; - $this->hPt=$this->h*$this->k; - $this->PageBreakTrigger=$this->h-$this->bMargin; - $this->CurPageFormat=$format; - $this->PageSizes[$this->page]=array($this->wPt, $this->hPt); - } - } - - $this->_out('q 0 J 1 w 0 j 0 G 0 g'); // reset standard values - $s = parent::useTemplate($tplidx, $_x, $_y, $_w, $_h); - $this->_out('Q'); - return $s; - } - - /** - * Private method, that rebuilds all needed objects of source files - */ - function _putimportedobjects() { - if (is_array($this->parsers) && count($this->parsers) > 0) { - foreach($this->parsers AS $filename => $p) { - $this->current_parser =& $this->parsers[$filename]; - if (isset($this->_obj_stack[$filename]) && is_array($this->_obj_stack[$filename])) { - while(($n = key($this->_obj_stack[$filename])) !== null) { - $nObj = $this->current_parser->pdf_resolve_object($this->current_parser->c,$this->_obj_stack[$filename][$n][1]); - - $this->_newobj($this->_obj_stack[$filename][$n][0]); - - if ($nObj[0] == PDF_TYPE_STREAM) { - $this->pdf_write_value ($nObj); - } else { - $this->pdf_write_value ($nObj[1]); - } - - $this->_out('endobj'); - $this->_obj_stack[$filename][$n] = null; // free memory - unset($this->_obj_stack[$filename][$n]); - reset($this->_obj_stack[$filename]); - } - } - } - } - } - - - /** - * Private Method that writes the form xobjects - */ - function _putformxobjects() { - $filter=($this->compress) ? '/Filter /FlateDecode ' : ''; - reset($this->tpls); - foreach($this->tpls AS $tplidx => $tpl) { - $p=($this->compress) ? gzcompress($tpl['buffer']) : $tpl['buffer']; - $this->_newobj(); - $cN = $this->n; // TCPDF/Protection: rem current "n" - - $this->tpls[$tplidx]['n'] = $this->n; - $this->_out('<<'.$filter.'/Type /XObject'); - $this->_out('/Subtype /Form'); - $this->_out('/FormType 1'); - - $this->_out(sprintf('/BBox [%.2F %.2F %.2F %.2F]', - (isset($tpl['box']['llx']) ? $tpl['box']['llx'] : $tpl['x'])*$this->k, - (isset($tpl['box']['lly']) ? $tpl['box']['lly'] : -$tpl['y'])*$this->k, - (isset($tpl['box']['urx']) ? $tpl['box']['urx'] : $tpl['w'] + $tpl['x'])*$this->k, - (isset($tpl['box']['ury']) ? $tpl['box']['ury'] : $tpl['h']-$tpl['y'])*$this->k - )); - - $c = 1; - $s = 0; - $tx = 0; - $ty = 0; - - if (isset($tpl['box'])) { - $tx = -$tpl['box']['llx']; - $ty = -$tpl['box']['lly']; - - if ($tpl['_rotationAngle'] <> 0) { - $angle = $tpl['_rotationAngle'] * M_PI/180; - $c=cos($angle); - $s=sin($angle); - - switch($tpl['_rotationAngle']) { - case -90: - $tx = -$tpl['box']['lly']; - $ty = $tpl['box']['urx']; - break; - case -180: - $tx = $tpl['box']['urx']; - $ty = $tpl['box']['ury']; - break; - case -270: - $tx = $tpl['box']['ury']; - $ty = 0; - break; - } - } - } else if ($tpl['x'] != 0 || $tpl['y'] != 0) { - $tx = -$tpl['x']*2; - $ty = $tpl['y']*2; - } - - $tx *= $this->k; - $ty *= $this->k; - - if ($c != 1 || $s != 0 || $tx != 0 || $ty != 0) { - $this->_out(sprintf('/Matrix [%.5F %.5F %.5F %.5F %.5F %.5F]', - $c, $s, -$s, $c, $tx, $ty - )); - } - - $this->_out('/Resources '); - - if (isset($tpl['resources'])) { - $this->current_parser =& $tpl['parser']; - $this->pdf_write_value($tpl['resources']); // "n" will be changed - } else { - $this->_out('<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); - if (isset($this->_res['tpl'][$tplidx]['fonts']) && count($this->_res['tpl'][$tplidx]['fonts'])) { - $this->_out('/Font <<'); - foreach($this->_res['tpl'][$tplidx]['fonts'] as $font) - $this->_out('/F'.$font['i'].' '.$font['n'].' 0 R'); - $this->_out('>>'); - } - if(isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images']) || - isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) - { - $this->_out('/XObject <<'); - if (isset($this->_res['tpl'][$tplidx]['images']) && count($this->_res['tpl'][$tplidx]['images'])) { - foreach($this->_res['tpl'][$tplidx]['images'] as $image) - $this->_out('/I'.$image['i'].' '.$image['n'].' 0 R'); - } - if (isset($this->_res['tpl'][$tplidx]['tpls']) && count($this->_res['tpl'][$tplidx]['tpls'])) { - foreach($this->_res['tpl'][$tplidx]['tpls'] as $i => $tpl) - $this->_out($this->tplprefix.$i.' '.$tpl['n'].' 0 R'); - } - $this->_out('>>'); - } - $this->_out('>>'); - } - - $nN = $this->n; // TCPDF: rem new "n" - $this->n = $cN; // TCPDF: reset to current "n" - $this->_out('/Length '.strlen($p).' >>'); - $this->_putstream($p); - $this->_out('endobj'); - $this->n = $nN; // TCPDF: reset to new "n" - } - - $this->_putimportedobjects(); - } - - /** - * Rewritten to handle existing own defined objects - */ - function _newobj($obj_id=false,$onlynewobj=false) { - if (!$obj_id) { - $obj_id = ++$this->n; - } - - //Begin a new object - if (!$onlynewobj) { - $this->offsets[$obj_id] = is_subclass_of($this, 'TCPDF') ? $this->bufferlen : strlen($this->buffer); - $this->_out($obj_id.' 0 obj'); - $this->_current_obj_id = $obj_id; // for later use with encryption - } - } - - /** - * Writes a value - * Needed to rebuild the source document - * - * @param mixed $value A PDF-Value. Structure of values see cases in this method - */ - function pdf_write_value(&$value) - { - if (is_subclass_of($this, 'TCPDF')) { - parent::pdf_write_value($value); - } - - switch ($value[0]) { - - case PDF_TYPE_TOKEN : - $this->_straightOut($value[1] . ' '); - break; - case PDF_TYPE_NUMERIC : - case PDF_TYPE_REAL : - if (is_float($value[1]) && $value[1] != 0) { - $this->_straightOut(rtrim(rtrim(sprintf('%F', $value[1]), '0'), '.') .' '); - } else { - $this->_straightOut($value[1] . ' '); - } - break; - - case PDF_TYPE_ARRAY : - - // An array. Output the proper - // structure and move on. - - $this->_straightOut('['); - for ($i = 0; $i < count($value[1]); $i++) { - $this->pdf_write_value($value[1][$i]); - } - - $this->_out(']'); - break; - - case PDF_TYPE_DICTIONARY : - - // A dictionary. - $this->_straightOut('<<'); - - reset ($value[1]); - - while (list($k, $v) = each($value[1])) { - $this->_straightOut($k . ' '); - $this->pdf_write_value($v); - } - - $this->_straightOut('>>'); - break; - - case PDF_TYPE_OBJREF : - - // An indirect object reference - // Fill the object stack if needed - $cpfn =& $this->current_parser->filename; - - if (!isset($this->_don_obj_stack[$cpfn][$value[1]])) { - $this->_newobj(false,true); - $this->_obj_stack[$cpfn][$value[1]] = array($this->n, $value); - $this->_don_obj_stack[$cpfn][$value[1]] = array($this->n, $value); // Value is maybee obsolete!!! - } - $objid = $this->_don_obj_stack[$cpfn][$value[1]][0]; - - $this->_out($objid.' 0 R'); - break; - - case PDF_TYPE_STRING : - - // A string. - $this->_straightOut('('.$value[1].')'); - - break; - - case PDF_TYPE_STREAM : - - // A stream. First, output the - // stream dictionary, then the - // stream data itself. - $this->pdf_write_value($value[1]); - $this->_out('stream'); - $this->_out($value[2][1]); - $this->_out('endstream'); - break; - case PDF_TYPE_HEX : - $this->_straightOut('<'.$value[1].'>'); - break; - - case PDF_TYPE_BOOLEAN : - $this->_straightOut($value[1] ? 'true ' : 'false '); - break; - - case PDF_TYPE_NULL : - // The null object. - - $this->_straightOut('null '); - break; - } - } - - - /** - * Modified so not each call will add a newline to the output. - */ - function _straightOut($s) { - if (!is_subclass_of($this, 'TCPDF')) { - if($this->state==2) - $this->pages[$this->page] .= $s; - else - $this->buffer .= $s; - } else { - if ($this->state == 2) { - if (isset($this->footerlen[$this->page]) AND ($this->footerlen[$this->page] > 0)) { - // puts data before page footer - $page = substr($this->getPageBuffer($this->page), 0, -$this->footerlen[$this->page]); - $footer = substr($this->getPageBuffer($this->page), -$this->footerlen[$this->page]); - $this->setPageBuffer($this->page, $page.' '.$s."\n".$footer); - } else { - $this->setPageBuffer($this->page, $s, true); - } - } else { - $this->setBuffer($s); - } - } - } - - /** - * rewritten to close opened parsers - * - */ - function _enddoc() { - parent::_enddoc(); - $this->_closeParsers(); - } - - /** - * close all files opened by parsers - */ - function _closeParsers() { - if ($this->state > 2 && count($this->parsers) > 0) { - foreach ($this->parsers as $k => $_){ - $this->parsers[$k]->closeFile(); - $this->parsers[$k] = null; - unset($this->parsers[$k]); - } - return true; - } - return false; - } - -} \ No newline at end of file Deleted: trunk/fpdi/fpdi2tcpdf_bridge.php =================================================================== --- trunk/fpdi/fpdi2tcpdf_bridge.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/fpdi2tcpdf_bridge.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,171 +0,0 @@ -<?php -// -// FPDI - Version 1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - * This class is used as a bridge between TCPDF and FPDI - * and will create the possibility to use both FPDF and TCPDF - * via one FPDI version. - * - * We'll simply remap TCPDF to FPDF again. - * - * It'll be loaded and extended by FPDF_TPL. - */ -class FPDF extends TCPDF { - - function __get($name) { - switch ($name) { - case 'PDFVersion': - return $this->PDFVersion; - case 'k': - return $this->k; - default: - // Error handling - $this->Error('Cannot access protected property '.get_class($this).':$'.$name.' / Undefined property: '.get_class($this).'::$'.$name); - } - } - - function __set($name, $value) { - switch ($name) { - case 'PDFVersion': - $this->PDFVersion = $value; - break; - default: - // Error handling - $this->Error('Cannot access protected property '.get_class($this).':$'.$name.' / Undefined property: '.get_class($this).'::$'.$name); - } - } - - /** - * Encryption of imported data by FPDI - * - * @param array $value - */ - function pdf_write_value(&$value) { - switch ($value[0]) { - case PDF_TYPE_STRING : - if ($this->encrypted) { - $value[1] = $this->_unescape($value[1]); - $value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]); - $value[1] = $this->_escape($value[1]); - } - break; - - case PDF_TYPE_STREAM : - if ($this->encrypted) { - $value[2][1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[2][1]); - } - break; - - case PDF_TYPE_HEX : - if ($this->encrypted) { - $value[1] = $this->hex2str($value[1]); - $value[1] = $this->_RC4($this->_objectkey($this->_current_obj_id), $value[1]); - - // remake hexstring of encrypted string - $value[1] = $this->str2hex($value[1]); - } - break; - } - } - - /** - * Unescapes a PDF string - * - * @param string $s - * @return string - */ - function _unescape($s) { - $out = ''; - for ($count = 0, $n = strlen($s); $count < $n; $count++) { - if ($s[$count] != '\\' || $count == $n-1) { - $out .= $s[$count]; - } else { - switch ($s[++$count]) { - case ')': - case '(': - case '\\': - $out .= $s[$count]; - break; - case 'f': - $out .= chr(0x0C); - break; - case 'b': - $out .= chr(0x08); - break; - case 't': - $out .= chr(0x09); - break; - case 'r': - $out .= chr(0x0D); - break; - case 'n': - $out .= chr(0x0A); - break; - case "\r": - if ($count != $n-1 && $s[$count+1] == "\n") - $count++; - break; - case "\n": - break; - default: - // Octal-Values - if (ord($s[$count]) >= ord('0') && - ord($s[$count]) <= ord('9')) { - $oct = ''. $s[$count]; - - if (ord($s[$count+1]) >= ord('0') && - ord($s[$count+1]) <= ord('9')) { - $oct .= $s[++$count]; - - if (ord($s[$count+1]) >= ord('0') && - ord($s[$count+1]) <= ord('9')) { - $oct .= $s[++$count]; - } - } - - $out .= chr(octdec($oct)); - } else { - $out .= $s[$count]; - } - } - } - } - return $out; - } - - /** - * Hexadecimal to string - * - * @param string $hex - * @return string - */ - function hex2str($hex) { - return pack('H*', str_replace(array("\r", "\n", ' '), '', $hex)); - } - - /** - * String to hexadecimal - * - * @param string $str - * @return string - */ - function str2hex($str) { - return current(unpack('H*', $str)); - } -} \ No newline at end of file Deleted: trunk/fpdi/fpdi_pdf_parser.php =================================================================== --- trunk/fpdi/fpdi_pdf_parser.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/fpdi_pdf_parser.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,384 +0,0 @@ -<?php -// -// FPDI - Version 1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -require_once('pdf_parser.php'); - -class fpdi_pdf_parser extends pdf_parser { - - /** - * Pages - * Index beginns at 0 - * - * @var array - */ - var $pages; - - /** - * Page count - * @var integer - */ - var $page_count; - - /** - * actual page number - * @var integer - */ - var $pageno; - - /** - * PDF Version of imported Document - * @var string - */ - var $pdfVersion; - - /** - * FPDI Reference - * @var object - */ - var $fpdi; - - /** - * Available BoxTypes - * - * @var array - */ - var $availableBoxes = array('/MediaBox', '/CropBox', '/BleedBox', '/TrimBox', '/ArtBox'); - - /** - * Constructor - * - * @param string $filename Source-Filename - * @param object $fpdi Object of type fpdi - */ - function fpdi_pdf_parser($filename, &$fpdi) { - $this->fpdi =& $fpdi; - - parent::pdf_parser($filename); - - // resolve Pages-Dictonary - $pages = $this->pdf_resolve_object($this->c, $this->root[1][1]['/Pages']); - - // Read pages - $this->read_pages($this->c, $pages, $this->pages); - - // count pages; - $this->page_count = count($this->pages); - } - - /** - * Overwrite parent::error() - * - * @param string $msg Error-Message - */ - function error($msg) { - $this->fpdi->error($msg); - } - - /** - * Get pagecount from sourcefile - * - * @return int - */ - function getPageCount() { - return $this->page_count; - } - - - /** - * Set pageno - * - * @param int $pageno Pagenumber to use - */ - function setPageno($pageno) { - $pageno = ((int) $pageno) - 1; - - if ($pageno < 0 || $pageno >= $this->getPageCount()) { - $this->fpdi->error('Pagenumber is wrong!'); - } - - $this->pageno = $pageno; - } - - /** - * Get page-resources from current page - * - * @return array - */ - function getPageResources() { - return $this->_getPageResources($this->pages[$this->pageno]); - } - - /** - * Get page-resources from /Page - * - * @param array $obj Array of pdf-data - */ - function _getPageResources ($obj) { // $obj = /Page - $obj = $this->pdf_resolve_object($this->c, $obj); - - // If the current object has a resources - // dictionary associated with it, we use - // it. Otherwise, we move back to its - // parent object. - if (isset ($obj[1][1]['/Resources'])) { - $res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Resources']); - if ($res[0] == PDF_TYPE_OBJECT) - return $res[1]; - return $res; - } else { - if (!isset ($obj[1][1]['/Parent'])) { - return false; - } else { - $res = $this->_getPageResources($obj[1][1]['/Parent']); - if ($res[0] == PDF_TYPE_OBJECT) - return $res[1]; - return $res; - } - } - } - - - /** - * Get content of current page - * - * If more /Contents is an array, the streams are concated - * - * @return string - */ - function getContent() { - $buffer = ''; - - if (isset($this->pages[$this->pageno][1][1]['/Contents'])) { - $contents = $this->_getPageContent($this->pages[$this->pageno][1][1]['/Contents']); - foreach($contents AS $tmp_content) { - $buffer .= $this->_rebuildContentStream($tmp_content).' '; - } - } - - return $buffer; - } - - - /** - * Resolve all content-objects - * - * @param array $content_ref - * @return array - */ - function _getPageContent($content_ref) { - $contents = array(); - - if ($content_ref[0] == PDF_TYPE_OBJREF) { - $content = $this->pdf_resolve_object($this->c, $content_ref); - if ($content[1][0] == PDF_TYPE_ARRAY) { - $contents = $this->_getPageContent($content[1]); - } else { - $contents[] = $content; - } - } else if ($content_ref[0] == PDF_TYPE_ARRAY) { - foreach ($content_ref[1] AS $tmp_content_ref) { - $contents = array_merge($contents,$this->_getPageContent($tmp_content_ref)); - } - } - - return $contents; - } - - - /** - * Rebuild content-streams - * - * @param array $obj - * @return string - */ - function _rebuildContentStream($obj) { - $filters = array(); - - if (isset($obj[1][1]['/Filter'])) { - $_filter = $obj[1][1]['/Filter']; - - if ($_filter[0] == PDF_TYPE_TOKEN) { - $filters[] = $_filter; - } else if ($_filter[0] == PDF_TYPE_ARRAY) { - $filters = $_filter[1]; - } - } - - $stream = $obj[2][1]; - - foreach ($filters AS $_filter) { - switch ($_filter[1]) { - case '/FlateDecode': - if (function_exists('gzuncompress')) { - $stream = (strlen($stream) > 0) ? @gzuncompress($stream) : ''; - } else { - $this->fpdi->error(sprintf('To handle %s filter, please compile php with zlib support.',$_filter[1])); - } - if ($stream === false) { - $this->fpdi->error('Error while decompressing stream.'); - } - break; - case null: - $stream = $stream; - break; - default: - if (preg_match('/^\/[a-z85]*$/i', $_filter[1], $filterName) && @include_once('decoders'.$_filter[1].'.php')) { - $filterName = substr($_filter[1],1); - if (class_exists($filterName)) { - $decoder =& new $filterName($this->fpdi); - $stream = $decoder->decode($stream); - } else { - $this->fpdi->error(sprintf('Unsupported Filter: %s',$_filter[1])); - } - } else { - $this->fpdi->error(sprintf('Unsupported Filter: %s',$_filter[1])); - } - } - } - - return $stream; - } - - - /** - * Get a Box from a page - * Arrayformat is same as used by fpdf_tpl - * - * @param array $page a /Page - * @param string $box_index Type of Box @see $availableBoxes - * @return array - */ - function getPageBox($page, $box_index) { - $page = $this->pdf_resolve_object($this->c,$page); - $box = null; - if (isset($page[1][1][$box_index])) - $box =& $page[1][1][$box_index]; - - if (!is_null($box) && $box[0] == PDF_TYPE_OBJREF) { - $tmp_box = $this->pdf_resolve_object($this->c,$box); - $box = $tmp_box[1]; - } - - if (!is_null($box) && $box[0] == PDF_TYPE_ARRAY) { - $b =& $box[1]; - return array('x' => $b[0][1]/$this->fpdi->k, - 'y' => $b[1][1]/$this->fpdi->k, - 'w' => abs($b[0][1]-$b[2][1])/$this->fpdi->k, - 'h' => abs($b[1][1]-$b[3][1])/$this->fpdi->k, - 'llx' => $b[0][1]/$this->fpdi->k, - 'lly' => $b[1][1]/$this->fpdi->k, - 'urx' => $b[2][1]/$this->fpdi->k, - 'ury' => $b[3][1]/$this->fpdi->k, - ); - } else if (!isset ($page[1][1]['/Parent'])) { - return false; - } else { - return $this->getPageBox($this->pdf_resolve_object($this->c, $page[1][1]['/Parent']), $box_index); - } - } - - function getPageBoxes($pageno) { - return $this->_getPageBoxes($this->pages[$pageno-1]); - } - - /** - * Get all Boxes from /Page - * - * @param array a /Page - * @return array - */ - function _getPageBoxes($page) { - $boxes = array(); - - foreach($this->availableBoxes AS $box) { - if ($_box = $this->getPageBox($page,$box)) { - $boxes[$box] = $_box; - } - } - - return $boxes; - } - - /** - * Get the page rotation by pageno - * - * @param integer $pageno - * @return array - */ - function getPageRotation($pageno) { - return $this->_getPageRotation($this->pages[$pageno-1]); - } - - function _getPageRotation ($obj) { // $obj = /Page - $obj = $this->pdf_resolve_object($this->c, $obj); - if (isset ($obj[1][1]['/Rotate'])) { - $res = $this->pdf_resolve_object($this->c, $obj[1][1]['/Rotate']); - if ($res[0] == PDF_TYPE_OBJECT) - return $res[1]; - return $res; - } else { - if (!isset ($obj[1][1]['/Parent'])) { - return false; - } else { - $res = $this->_getPageRotation($obj[1][1]['/Parent']); - if ($res[0] == PDF_TYPE_OBJECT) - return $res[1]; - return $res; - } - } - } - - /** - * Read all /Page(es) - * - * @param object pdf_context - * @param array /Pages - * @param array the result-array - */ - function read_pages (&$c, &$pages, &$result) { - // Get the kids dictionary - $kids = $this->pdf_resolve_object ($c, $pages[1][1]['/Kids']); - - if (!is_array($kids)) - $this->fpdi->Error('Cannot find /Kids in current /Page-Dictionary'); - foreach ($kids[1] as $v) { - $pg = $this->pdf_resolve_object ($c, $v); - if ($pg[1][1]['/Type'][1] === '/Pages') { - // If one of the kids is an embedded - // /Pages array, resolve it as well. - $this->read_pages ($c, $pg, $result); - } else { - $result[] = $pg; - } - } - } - - - - /** - * Get PDF-Version - * - * And reset the PDF Version used in FPDI if needed - */ - function getPDFVersion() { - parent::getPDFVersion(); - $this->fpdi->PDFVersion = max($this->fpdi->PDFVersion, $this->pdfVersion); - } - -} \ No newline at end of file Deleted: trunk/fpdi/pdf_context.php =================================================================== --- trunk/fpdi/pdf_context.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/pdf_context.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,97 +0,0 @@ -<?php -// -// FPDI - Version 1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -class pdf_context { - - /** - * Modi - * - * @var integer 0 = file | 1 = string - */ - var $_mode = 0; - - var $file; - var $buffer; - var $offset; - var $length; - - var $stack; - - // Constructor - - function pdf_context(&$f) { - $this->file =& $f; - if (is_string($this->file)) - $this->_mode = 1; - $this->reset(); - } - - // Optionally move the file - // pointer to a new location - // and reset the buffered data - - function reset($pos = null, $l = 100) { - if ($this->_mode == 0) { - if (!is_null ($pos)) { - fseek ($this->file, $pos); - } - - $this->buffer = $l > 0 ? fread($this->file, $l) : ''; - $this->length = strlen($this->buffer); - if ($this->length < $l) - $this->increase_length($l - $this->length); - } else { - $this->buffer = $this->file; - $this->length = strlen($this->buffer); - } - $this->offset = 0; - $this->stack = array(); - } - - // Make sure that there is at least one - // character beyond the current offset in - // the buffer to prevent the tokenizer - // from attempting to access data that does - // not exist - - function ensure_content() { - if ($this->offset >= $this->length - 1) { - return $this->increase_length(); - } else { - return true; - } - } - - // Forcefully read more data into the buffer - - function increase_length($l=100) { - if ($this->_mode == 0 && feof($this->file)) { - return false; - } else if ($this->_mode == 0) { - $totalLength = $this->length + $l; - do { - $this->buffer .= fread($this->file, $totalLength-$this->length); - } while ((($this->length = strlen($this->buffer)) != $totalLength) && !feof($this->file)); - - return true; - } else { - return false; - } - } -} \ No newline at end of file Deleted: trunk/fpdi/pdf_parser.php =================================================================== --- trunk/fpdi/pdf_parser.php 2011-03-18 22:51:07 UTC (rev 4514) +++ trunk/fpdi/pdf_parser.php 2011-03-20 02:51:01 UTC (rev 4515) @@ -1,694 +0,0 @@ -<?php -// -// FPDI - Version 1.3 -// -// Copyright 2004-2009 Setasign - Jan Slabon -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -if (!defined ('PDF_TYPE_NULL')) - define ('PDF_TYPE_NULL', 0); -if (!defined ('PDF_TYPE_NUMERIC')) - define ('PDF_TYPE_NUMERIC', 1); -if (!defined ('PDF_TYPE_TOKEN')) - define ('PDF_TYPE_TOKEN', 2); -if (!defined ('PDF_TYPE_HEX')) - define ('PDF_TYPE_HEX', 3); -if (!defined ('PDF_TYPE_STRING')) - define ('PDF_TYPE_STRING', 4); -if (!defined ('PDF_TYPE_DICTIONARY')) - define ('PDF_TYPE_DICTIONARY', 5); -if (!defined ('PDF_TYPE_ARRAY')) - define ('PDF_TYPE_ARRAY', 6); -if (!defined ('PDF_TYPE_OBJDEC')) - define ('PDF_TYPE_OBJDEC', 7); -if (!defined ('PDF_TYPE_OBJREF')) - define ('PDF_TYPE_OBJREF', 8); -if (!defined ('PDF_TYPE_OBJECT')) - define ('PDF_TYPE_OBJECT', 9); -if (!defined ('PDF_TYPE_STREAM')) - define ('PDF_TYPE_STREAM', 10); -if (!defined ('PDF_TYPE_BOOLEAN')) - define ('PDF_TYPE_BOOLEAN', 11); -if (!defined ('PDF_TYPE_REAL')) - define ('PDF_TYPE_REAL', 12); - -require_once('pdf_context.php'); - -class pdf_parser { - - /** - * Filename - * @var string - */ - var $filename; - - /** - * File resource - * @var resource - */ - var $f; - - /** - * PDF Context - * @var object pdf_context-Instance - */ - var $c; - - /** - * xref-Data - * @var array - */ - var $xref; - - /** - * root-Object - * @var array - */ - var $root; - - /** - * PDF version of the loaded document - * @var string - */ - var $pdfVersion; - - /** - * Constructor - * - * @param string $filename Source-Filename - */ - function pdf_parser($filename) { - $this->filename = $filename; - - $this->f = @fopen($this->filename, 'rb'); - - if (!$this->f) - $this->error(sprintf('Cannot open %s !', $filename)); - - $this->getPDFVersion(); - - $this->c =& new pdf_context($this->f); - - // Read xref-Data - $this->pdf_read_xref($this->xref, $this->pdf_find_xref()); - - // Check for Encryption - $this->getEncryption(); - - // Read root - $this->pdf_read_root(); - } - - /** - * Close the opened file - */ - function closeFile() { - if (isset($this->f)) { - fclose($this->f); - unset($this->f); - } - } - - /** - * Print Error and die - * - * @param string $msg Error-Message - */ - function error($msg) { - die('<b>PDF-Parser Error:</b> '.$msg); - } - - /** - * Check Trailer for Encryption - */ - function getEncryption() { - if (isset($this->xref['trailer'][1]['/Encrypt'])) { - $this->error('File is encrypted!'); - } - } - - /** - * Find/Return /Root - * - * @return array - */ - function pdf_find_root() { - if ($this->xref['trailer'][1]['/Root'][0] != PDF_TYPE_OBJREF) { - $this->error('Wrong Type of Root-Element! Must be an indirect reference'); - } - return $this->xref['trailer'][1]['/Root']; - } - - /** - * Read the /Root - */ - function pdf_read_root() { - // read root - $this->root = $this->pdf_resolve_object($this->c, $this->pdf_find_root()); - } - - /** - * Get PDF-Version - * - * And reset the PDF Version used in FPDI if needed - */ - function getPDFVersion() { - fseek($this->f, 0); - preg_match('/\d\.\d/',fread($this->f,16),$m); - if (isset($m[0])) - $this->pdfVersion = $m[0]; - return $this->pdfVersion; - } - - /** - * Find the xref-Table - */ - function pdf_find_xref() { - $toRead = 1500; - - $stat = fseek ($this->f, -$toRead, SEEK_END); - if ($stat === -1) { - fseek ($this->f, 0); - } - $data = fread($this->f, $toRea... [truncated message content] |
From: <dai...@us...> - 2011-03-24 09:12:30
|
Revision: 4516 http://web-erp.svn.sourceforge.net/web-erp/?rev=4516&view=rev Author: daintree Date: 2011-03-24 09:12:22 +0000 (Thu, 24 Mar 2011) Log Message: ----------- James SelectProduct.php product image - Phil mods to PDFStockTransfer.php Modified Paths: -------------- trunk/PDFStockTransfer.php trunk/SelectProduct.php trunk/doc/Change.log.html trunk/index.php Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-03-20 02:51:01 UTC (rev 4515) +++ trunk/PDFStockTransfer.php 2011-03-24 09:12:22 UTC (rev 4516) @@ -2,11 +2,35 @@ /* $Id$*/ -/* $Revision: 1.5 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); +if (!isset($_GET['TransferNo'])){ + if (isset($_POST['TransferNo'])){ + if (is_numeric($_POST['TransferNo'])){ + $_GET['TransferNo'] = $_POST['TransferNo']; + } else { + prnMsg(_('The entered transfer reference is expected to be numeric'),'error'); + unset($_POST['TransferNo']); + } + } + if (!isset($_GET['TransferNo'])){ //still not set from a post then + //open a form for entering a transfer number + $title = _('Print Stock Transfer'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print Transfer Note') . '" alt="" />' . ' ' . $title.'</p><br />'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection"><tr>'; + echo '<td>'._('Print Stock Transfer Note').' : '.'</td>'; + echo '<td><input type=text class="number" name="TransferNo" maxlength=10 size=11 /></td></tr>'; + echo '</table>'; + echo '<br><div class="centre"><input type="submit" name="Process" value="' . _('Print Transfer Note') . '"></div></form>'; + include('includes/footer.inc'); + exit(); + } +} + + include('includes/PDFStarter.php'); $pdf->addInfo('Title', _('Stock Transfer Form') ); $FontSize=10; @@ -18,56 +42,43 @@ /*Print out the category totals */ -$sql="SELECT stockid, transno, loccode, trandate, qty from stockmoves where transno='".$_GET['TransferNo']."' and type=16"; +$sql="SELECT stockmoves.stockid, + description, + transno, + stockmoves.loccode, + locationname, + trandate, + qty + FROM stockmoves + INNER JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + INNER JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE transno='".$_GET['TransferNo']."' + AND type=16"; $result=DB_query($sql, $db); -$myrow=DB_fetch_array($result); -$StockID=$myrow[0]; -$FromCode=$myrow[2]; -$Date=$myrow[3]; - -$myrow=DB_fetch_array($result); -$ToCode=$myrow[2]; -$Quantity=$myrow[4]; - -$sql="select description from stockmaster where stockid='".$StockID."'"; -$result=DB_query($sql, $db); - if (DB_num_rows($result) == 0){ + $title = _('Print Stock Transfer - Error'); include ('includes/header.inc'); - prnMsg(_('There are no decription for '.$StockID), 'warn'); + prnMsg(_('There was no transfer found with number') . ': ' . $_GET['TransferNo'], 'error'); + echo '<a href="PDFStockTransfer.php">' . _('Try Again') .'</a>'; include ('includes/footer.inc'); exit; } - +//get the first stock movement which will be the quantity taken from the initiating location $myrow=DB_fetch_array($result); -$Description=$myrow[0]; +$StockID=$myrow['stockid']; +$FromCode=$myrow['loccode']; +$From = $myrow['locationname']; +$Date=$myrow['trandate']; +//get the next row which will be the quantity received in the receiving location +$myNextRow=DB_fetch_array($result); +$ToCode=$myNextRow['loccode']; +$To = $myrow['locationname']; +$Quantity=$myNextRow['qty']; +$Description=$myNextRow['description']; -$sql="select locationname from locations where loccode='".$FromCode."'"; -$result=DB_query($sql, $db); -if (DB_num_rows($result) == 0){ - include ('includes/header.inc'); - prnMsg(_('There are no location From for '.$StockID), 'warn'); - include ('includes/footer.inc'); - exit; -} - -$myrow=DB_fetch_array($result); -$From=$myrow[0]; - -$sql="select locationname from locations where loccode='".$ToCode."'"; -$result=DB_query($sql, $db); - -if (DB_num_rows($result) == 0){ - include ('includes/header.inc'); - prnMsg(_('There are no location To for '.$StockID), 'warn'); - include ('includes/footer.inc'); - exit; -} - -$myrow=DB_fetch_array($result); -$To=$myrow[0]; - $LeftOvers = $pdf->addTextWrap($Left_Margin+1,$YPos-10,300-$Left_Margin,$FontSize, $StockID); $LeftOvers = $pdf->addTextWrap($Left_Margin+75,$YPos-10,300-$Left_Margin,$FontSize, $Description); $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos-10,300-$Left_Margin,$FontSize, $From); @@ -78,30 +89,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos-120,300-$Left_Margin,$FontSize, _('Signed for ').$From.'______________________'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos-160,300-$Left_Margin,$FontSize, _('Signed for ').$To.'______________________'); -/* -$pdfcode = $pdf->output(); -$len = strlen($pdfcode); -if ($len<=20){ - $title = _('Print Price List Error'); - include('includes/header.inc'); - prnMsg(_('There were no stock transfer details to print'),'warn'); - echo '<br><a href="'.$rootpath.'/index.php?' . SID . '">'. _('Back to the menu').'</a>'; - include('includes/footer.inc'); - exit; -} else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=StockTransfer.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('StockTransfer.pdf', 'I'); -} -*/ -$pdf->OutputD($_SESSION['DatabaseName'] . '_StockTransfer_' . date('Y-m-d') . '.pdf');//UldisN -$pdf->__destruct(); //UldisN - - /*end of else not PrintPDF */ -?> +$pdf->OutputD($_SESSION['DatabaseName'] . '_StockTransfer_' . date('Y-m-d') . '.pdf'); +$pdf->__destruct(); +?> \ No newline at end of file Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-03-20 02:51:01 UTC (rev 4515) +++ trunk/SelectProduct.php 2011-03-24 09:12:22 UTC (rev 4516) @@ -35,7 +35,7 @@ $result1 = DB_query($SQL, $db); if (DB_num_rows($result1) == 0) { echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>'; - echo '<br /><a href="' . $rootpath . '/StockCategories.php?' . SID . '">' . _('Define Stock Categories') . '</a>'; + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; exit; } // end of showing search facilities @@ -352,7 +352,7 @@ } else { echo '<td class="select">' . _('No') . '</td>'; } - echo '<td class="select"><a href="' . $rootpath . '/PO_Header.php?' . SID . '&NewOrder=Yes' . '&SelectedSupplier=' . + echo '<td class="select"><a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes' . '&SelectedSupplier=' . $SuppRow['supplierid'] . '&StockID=' . $StockID . '&Quantity='.$SuppRow['minorderqty'].'">' . _('Order') . ' </a></td>'; echo '</tr>'; } @@ -367,47 +367,64 @@ </tr>'; echo '<tr><td valign="top" class="select">'; /*Stock Inquiry Options */ -echo '<a href="' . $rootpath . '/StockMovements.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a><br />'; +echo '<a href="' . $rootpath . '/StockMovements.php?StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a><br />'; if ($Its_A_Kitset_Assembly_Or_Dummy == False) { - echo '<a href="' . $rootpath . '/StockStatus.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Status') . '</a><br />'; - echo '<a href="' . $rootpath . '/StockUsage.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Usage') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '">' . _('Show Stock Status') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '">' . _('Show Stock Usage') . '</a><br />'; } -echo '<a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a><br />'; -echo '<a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a><br />'; +echo '<a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a><br />'; +echo '<a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a><br />'; if ($Its_A_Kitset_Assembly_Or_Dummy == False) { - echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Purchase Orders') . '</a><br />'; - echo '<a href="' . $rootpath . '/PO_SelectPurchOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search All Purchase Orders') . '</a><br />'; - echo '<a href="' . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $StockID . '.jpg?' . SID . '">' . _('Show Part Picture (if available)') . '</a><br />'; + echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Purchase Orders') . '</a><br />'; + echo '<a href="' . $rootpath . '/PO_SelectPurchOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search All Purchase Orders') . '</a><br />'; + echo '<a href="' . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $StockID . '.jpg">' . _('Show Part Picture (if available)') . '</a><br />'; } if ($Its_A_Dummy == False) { - echo '<a href="' . $rootpath . '/BOMInquiry.php?' . SID . '&StockID=' . $StockID . '">' . _('View Costed Bill Of Material') . '</a><br />'; - echo '<a href="' . $rootpath . '/WhereUsedInquiry.php?' . SID . '&StockID=' . $StockID . '">' . _('Where This Item Is Used') . '</a><br />'; + echo '<a href="' . $rootpath . '/BOMInquiry.php?StockID=' . $StockID . '">' . _('View Costed Bill Of Material') . '</a><br />'; + echo '<a href="' . $rootpath . '/WhereUsedInquiry.php?StockID=' . $StockID . '">' . _('Where This Item Is Used') . '</a><br />'; } if ($Its_A_Labour_Item == True) { - echo '<a href="' . $rootpath . '/WhereUsedInquiry.php?' . SID . '&StockID=' . $StockID . '">' . _('Where This Labour Item Is Used') . '</a><br />'; + echo '<a href="' . $rootpath . '/WhereUsedInquiry.php?StockID=' . $StockID . '">' . _('Where This Labour Item Is Used') . '</a><br />'; } wikiLink('Product', $StockID); echo '</td><td valign="top" class="select">'; /* Stock Transactions */ if ($Its_A_Kitset_Assembly_Or_Dummy == False) { - echo '<a href="' . $rootpath . '/StockAdjustments.php?' . SID . '&StockID=' . $StockID . '">' . _('Quantity Adjustments') . '</a><br />'; - echo '<a href="' . $rootpath . '/StockTransfers.php?' . SID . '&StockID=' . $StockID . '">' . _('Location Transfers') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockAdjustments.php?StockID=' . $StockID . '">' . _('Quantity Adjustments') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockTransfers.php?StockID=' . $StockID . '">' . _('Location Transfers') . '</a><br />'; + + if (function_exists('imagecreatefrompng')){ + $StockImgLink = ' + GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. + '&StockID='.urlencode($StockID). + '&text='. + '&width=200'. + '&height=200'. + ' '; + } else { + if( isset($StockID) and file_exists($_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg') ) { + $StockImgLink = ' ' . $_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg '; + } else { + $StockImgLink = _('No Image'); + } + } + if ($myrow['mbflag'] == 'B') { echo '<br />'; $SuppResult = DB_query("SELECT suppliers.suppname, - suppliers.supplierid, - purchdata.preferred, - purchdata.minorderqty - FROM purchdata INNER JOIN suppliers - ON purchdata.supplierno=suppliers.supplierid - WHERE purchdata.stockid = '" . $StockID . "'", $db); + suppliers.supplierid, + purchdata.preferred, + purchdata.minorderqty + FROM purchdata INNER JOIN suppliers + ON purchdata.supplierno=suppliers.supplierid + WHERE purchdata.stockid = '" . $StockID . "'", $db); while ($SuppRow = DB_fetch_array($SuppResult)) { if ($myrow['eoq'] == 0) { $EOQ = $SuppRow['minorderqty']; } else { $EOQ = $myrow['eoq']; } - echo '<a href="' . $rootpath . '/PO_Header.php?' . SID . '&NewOrder=Yes' . '&SelectedSupplier=' . $SuppRow['supplierid'] . + echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes' . '&SelectedSupplier=' . $SuppRow['supplierid'] . '&StockID=' . $StockID . '&Quantity=' . $EOQ . '">' . _('Purchase this Item from') . ' ' . $SuppRow['suppname'] . ' (' . _('default') . ')</a><br />'; /**/ } /* end of while */ @@ -416,21 +433,21 @@ echo '</td><td valign="top" class="select">'; /* Stock Maintenance Options */ echo '<a href="' . $rootpath . '/Stocks.php?">' . _('Add Inventory Items') . '</a><br />'; -echo '<a href="' . $rootpath . '/Stocks.php?' . SID . '&StockID=' . $StockID . '">' . _('Modify Item Details') . '</a><br />'; +echo '<a href="' . $rootpath . '/Stocks.php?StockID=' . $StockID . '">' . _('Modify Item Details') . '</a><br />'; if ($Its_A_Kitset_Assembly_Or_Dummy == False) { - echo '<a href="' . $rootpath . '/StockReorderLevel.php?' . SID . '&StockID=' . $StockID . '">' . _('Maintain Reorder Levels') . '</a><br />'; - echo '<a href="' . $rootpath . '/StockCostUpdate.php?' . SID . '&StockID=' . $StockID . '">' . _('Maintain Standard Cost') . '</a><br />'; - echo '<a href="' . $rootpath . '/PurchData.php?' . SID . '&StockID=' . $StockID . '">' . _('Maintain Purchasing Data') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockReorderLevel.php?StockID=' . $StockID . '">' . _('Maintain Reorder Levels') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockCostUpdate.php?StockID=' . $StockID . '">' . _('Maintain Standard Cost') . '</a><br />'; + echo '<a href="' . $rootpath . '/PurchData.php?StockID=' . $StockID . '">' . _('Maintain Purchasing Data') . '</a><br />'; } if ($Its_A_Labour_Item == True) { - echo '<a href="' . $rootpath . '/StockCostUpdate.php?' . SID . '&StockID=' . $StockID . '">' . _('Maintain Standard Cost') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockCostUpdate.php?StockID=' . $StockID . '">' . _('Maintain Standard Cost') . '</a><br />'; } if (!$Its_A_Kitset) { - echo '<a href="' . $rootpath . '/Prices.php?' . SID . '&Item=' . $StockID . '">' . _('Maintain Pricing') . '</a><br />'; + echo '<a href="' . $rootpath . '/Prices.php?Item=' . $StockID . '">' . _('Maintain Pricing') . '</a><br />'; if (isset($_SESSION['CustomerID']) AND $_SESSION['CustomerID'] != "" AND Strlen($_SESSION['CustomerID']) > 0) { - echo '<a href="' . $rootpath . '/Prices_Customer.php?' . SID . '&Item=' . $StockID . '">' . _('Special Prices for customer') . ' - ' . $_SESSION['CustomerID'] . '</a><br />'; + echo '<a href="' . $rootpath . '/Prices_Customer.php?Item=' . $StockID . '">' . _('Special Prices for customer') . ' - ' . $_SESSION['CustomerID'] . '</a><br />'; } - echo '<a href="' . $rootpath . '/DiscountCategories.php?' . SID . '&StockID=' . $StockID . '">' . _('Maintain Discount Category') . '</a><br />'; + echo '<a href="' . $rootpath . '/DiscountCategories.php?StockID=' . $StockID . '">' . _('Maintain Discount Category') . '</a><br />'; } echo '</td></tr></table>'; } else { @@ -450,7 +467,7 @@ echo '<a href="' . $rootpath . '/Stocks.php?">' . _('Add Inventory Items') . '</a><br />'; echo '</td></tr></table>'; } // end displaying item options if there is one and only one record -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items'). '</p>'; @@ -634,7 +651,7 @@ /* end query for list of records */ /* display list if there is more than one record */ if (isset($searchresult) AND !isset($_POST['Select'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $ListCount = DB_num_rows($searchresult); if ($ListCount > 0) { @@ -707,7 +724,7 @@ <td>".$myrow['description']."</td> <td class='number'>".$qoh."</td> <td>".$myrow['units']."</td> - <td><a target='_blank' href='" . $rootpath . '/StockStatus.php?' . SID . '&StockID=' . $myrow['stockid']."'>" . _('View') . '</a></td> + <td><a target='_blank' href='" . $rootpath . '/StockStatus.php?StockID=' . $myrow['stockid']."'>" . _('View') . '</a></td> </tr>'; $j++; if ($j == 20 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-20 02:51:01 UTC (rev 4515) +++ trunk/doc/Change.log.html 2011-03-24 09:12:22 UTC (rev 4516) @@ -1,5 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>24/3/11: Phil rework PDFStockTransfer.php remove a few round trips to DB and added facility to be able to select a transfer number to reprint - added to main menu</p> +<p>24/3/11: James wer...@ya... Added snall image in middle of SelectProduct.php</p> <p>19/3/11: Phil added country to packing slips </p> <p>18/3/11: Marcos Garcia Trejo Added Z_ChangeSupplierCode.php </p> <p>18/3/11: Ricard add orderby transdate to DailyBankTransactions.php</p> Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-03-20 02:51:01 UTC (rev 4515) +++ trunk/index.php 2011-03-24 09:12:22 UTC (rev 4516) @@ -11,15 +11,15 @@ $ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); /*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ $ModuleList = array(_('Sales'), - _('Receivables'), - _('Payables'), - _('Purchases'), - _('Inventory'), - _('Manufacturing'), - _('General Ledger'), - _('Asset Manager'), - _('Petty Cash'), - _('Setup')); + _('Receivables'), + _('Payables'), + _('Purchases'), + _('Inventory'), + _('Manufacturing'), + _('General Ledger'), + _('Asset Manager'), + _('Petty Cash'), + _('Setup')); if (isset($_GET['Application'])){ /*This is sent by this page (to itself) when the user clicks on a tab */ $_SESSION['Module'] = $_GET['Application']; @@ -39,17 +39,17 @@ <table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?' . SID . '&CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?' . SID . '&NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '&SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> </td> </tr> </table> @@ -65,7 +65,7 @@ <table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php?' . SID . '">' . _('Supplier Tenders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php">' . _('Supplier Tenders') . '</a></p>'; ?> </td> </tr> </table> @@ -93,9 +93,9 @@ $_SESSION['Module']=$ModuleLink[$i]; } if ($ModuleLink[$i] == $_SESSION['Module']){ - echo '<tr><td class="main_menu_selected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr><td class="main_menu_selected"><a href="' . $_SERVER['PHP_SELF'] . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; } else { - echo '<tr><td class="main_menu_unselected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr><td class="main_menu_unselected"><a href="' . $_SERVER['PHP_SELF'] . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; } } $i++; @@ -126,7 +126,7 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?' .sid . '&NewOrder=Yes">' . _('Enter An Order or Quotation') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Enter An Order or Quotation') . '</a></p>'; ?> </td> </tr> <tr> @@ -141,12 +141,12 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SpecialOrder.php?' .sid . '&NewSpecial=Yes">' . _('Special Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SpecialOrder.php?NewSpecial=Yes">' . _('Special Order') . '</a></p>'; ?> </td> </tr> <tr> @@ -165,52 +165,52 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '">' . _('Order Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php">' . _('Order Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php?' . SID . '">' . _('Print Price Lists') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php">' . _('Print Price Lists') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php?' . SID . '">' . _('Order Status Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php">' . _('Order Status Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php?' . SID . '">' . _('Orders Invoiced Reports') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php">' . _('Orders Invoiced Reports') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php?' . SID . '">' . _('Daily Sales Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php">' . _('Daily Sales Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php?' . SID . '">' . _('Order Delivery Differences Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php">' . _('Order Delivery Differences Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php?' . SID . '">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php?' . SID . '">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php?' . SID . '">' . _('Top Sales Items Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php">' . _('Top Sales Items Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFLowGP.php?' . SID . '">' . _('Sales With Low Gross Profit Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFLowGP.php">' . _('Sales With Low Gross Profit Report') . '</a></p>'; ?> </td> </tr> <tr> @@ -228,12 +228,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectContract.php?' . SID . '">' . _('Select Contract') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectContract.php">' . _('Select Contract') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Contracts.php?' . SID . '">' . _('Create Contract') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Contracts.php">' . _('Create Contract') . '</a></p>'; ?> </td> </tr> </table> @@ -266,23 +266,23 @@ <table width="100%"class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">' . _('Select Order to Invoice') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Select Order to Invoice') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCreditItems.php?' .sid . '&NewCredit=Yes">' . _('Create A Credit Note') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCreditItems.php?NewCredit=Yes">' . _('Create A Credit Note') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?' . SID . '&NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php?' . SID . '">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> </td> </tr> </table> @@ -291,63 +291,63 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php?' . SID . '">' . _('Where Allocated Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php">' . _('Where Allocated Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> <?php if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php?' . SID . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; + echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php">' . _('Print Invoices or Credit Notes') . '</a></p>'; } else { - echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php?' . SID . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; + echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php">' . _('Print Invoices or Credit Notes') . '</a></p>'; } ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php?' . SID . '">' . _('Print Statements') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php">' . _('Print Statements') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php?' . SID . '">' . _('Sales Analysis Reports') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php">' . _('Sales Analysis Reports') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php?' . SID . '">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php?' . SID . '">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php?' . SID . '">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php?' . SID . '">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php?' . SID . '">' . _('Sales Graphs') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php">' . _('Sales Graphs') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php?' . SID . '">' . _('List Daily Transactions') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php">' . _('List Daily Transactions') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php?' . SID . '">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> </td> </tr> <tr> @@ -361,12 +361,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Customers.php?' . SID . '">' . _('Add Customer') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Customers.php">' . _('Add Customer') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php?' . SID . '">' . _('Customers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php">' . _('Customers') . '</a></p>'; ?> </td> </tr> </table> @@ -396,7 +396,7 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . SID . '">' . _('Select Supplier') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php">' . _('Select Supplier') . '</a></p>'; ?> </td> </tr> <tr> @@ -410,37 +410,37 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php?' . SID . '">' . _('Aged Supplier Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php">' . _('Aged Supplier Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php?' . SID . '">' . _('Payment Run Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php">' . _('Payment Run Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php?' . SID . '">' . _('Remittance Advices') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php">' . _('Remittance Advices') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php?' . SID . '">' . _('Outstanding GRNs Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php">' . _('Outstanding GRNs Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php?' . SID . '">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php?' . SID . '">' . _('List Daily Transactions') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php">' . _('List Daily Transactions') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTransInquiry.php?' . SID . '">' . _('Supplier Transaction Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SupplierTransInquiry.php">' . _('Supplier Transaction Inquiries') . '</a></p>'; ?> </td> </tr> <tr> @@ -454,12 +454,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php?' . SID . '">' . _('Add Supplier') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php">' . _('Add Supplier') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Factors.php?' . SID . '">' . _('Maintain Factor Companies') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Factors.php">' . _('Maintain Factor Companies') . '</a></p>'; ?> </td> </tr> </table> @@ -487,7 +487,7 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Purchase Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Purchase Orders') . '</a></p>'; ?> </td> </tr> <tr> @@ -497,22 +497,22 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OffersReceived.php?' . SID . '">' . _('Process Tenders and Offers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/OffersReceived.php">' . _('Process Tenders and Offers') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php?' . SID . '">' . _('Orders to Authorise') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php">' . _('Orders to Authorise') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . SID . '">' . _('Shipment Entry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php">' . _('Shipment Entry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php?' . SID . '">' . _('Select A Shipment') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php">' . _('Select A Shipment') . '</a></p>'; ?> </td> </tr> </table> @@ -521,12 +521,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php?' . SID . '">' . _('Purchase Order Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php">' . _('Purchase Order Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/POReport.php?' . SID . '">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/POReport.php">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> </td> </tr> <tr> @@ -566,7 +566,7 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Receive Purchase Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Receive Purchase Orders') . '</a></p>'; ?> </td> </tr> <tr> @@ -576,12 +576,12 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php?' . SID . '">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?' . SID . '">' . _('Inventory Location Transfers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php">' . _('Inventory Location Transfers') . '</a></p>'; ?> </td> </tr> <tr> @@ -591,12 +591,12 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php?' . SID . '">' . _('Reverse Goods Received') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php">' . _('Reverse Goods Received') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php?' . SID . '">' . _('Enter Stock Counts') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php">' . _('Enter Stock Counts') . '</a></p>'; ?> </td> </tr> </table> @@ -620,83 +620,87 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockStatus.php?' . SID . '">' . _('Inventory Item Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockStatus.php">' . _('Inventory Item Status') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockUsage.php?' . SID . '">' . _('Inventory Item Usage') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockUsage.php">' . _('Inventory Item Usage') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryQuantities.php?' . SID . '">' . _('Inventory Quantities') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryQuantities.php">' . _('Inventory Quantities') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevel.php?' . SID . '">' . _('Reorder Level') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevel.php">' . _('Reorder Level') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockDispatch.php?' . SID . '">' . _('Stock Dispatch') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockDispatch.php">' . _('Stock Dispatch') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryValuation.php?' . SID . '">' . _('Inventory Valuation Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryValuation.php">' . _('Inventory Valuation Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanning.php?' . SID . '">' . _('Inventory Planning Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanning.php">' . _('Inventory Planning Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanningPrefSupplier.php?' . SID . '">' . _('Inventory Planning Based On Preferred Supplier Data') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanningPrefSupplier.php">' . _('Inventory Planning Based On Preferred Supplier Data') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCheck.php?' . SID . '">' . _('Inventory Stock Check Sheets') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockCheck.php">' . _('Inventory Stock Check Sheets') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockQties_csv.php?' . SID . '">' . _('Make Inventory Quantities CSV') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockQties_csv.php">' . _('Make Inventory Quantities CSV') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockCheckComparison.php?' . SID . '">' . _('Compare Counts Vs Stock Check Data') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockCheckComparison.php">' . _('Compare Counts Vs Stock Check Data') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocMovements.php?' . SID . '">' . _('All Inventory Movements By Location/Date') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocMovements.php">' . _('All Inventory Movements By Location/Date') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocStatus.php?' . SID . '">' . _('List Inventory Status By Location/Category') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocStatus.php">' . _('List Inventory Status By Location/Category') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockQuantityByDate.php?' . SID . '">' . _('Historical Stock Quantity By Location/Category') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockQuantityByDate.php">' . _('Historical Stock Quantity By Location/Category') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockNegatives.php?' . SID . '">' . _('List Negative Stocks') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockNegatives.php">' . _('List Negative Stocks') . '</a></p>'; ?> </td> </tr> <tr> + <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransListing.php">' . _('Daily Stock Transaction Listing') . '</a></p>'; ?> + </td> + </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransListing.php?' . SID . '">' . _('Daily Stock Transaction Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> </td> </tr> <tr> @@ -710,32 +714,32 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Stocks.php?' . SID . '">' . _('Add A New Item') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Stocks.php">' . _('Add A New Item') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectProduct.php?' . SID . '">' . _('Select An Item') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectProduct.php">' . _('Select An Item') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesCategories.php?' . SID . '">' . _('Sales Category Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesCategories.php">' . _('Sales Category Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PricesBasedOnMarkUp.php?' . SID . '">' . _('Add or Update Prices Based On Costs Or Other Price List') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PricesBasedOnMarkUp.php">' . _('Add or Update Prices Based On Costs Or Other Price List') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php?' . SID . '">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?' . SID . '">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> </td> </tr> </table> @@ -765,12 +769,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WorkOrderEntry.php?' . SID . '">' . _('Work Order Entry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WorkOrderEntry.php">' . _('Work Order Entry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select A Work Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select A Work Order') . '</a></p>'; ?> </td> </tr> </table> @@ -779,57 +783,57 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select A Work Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select A Work Order') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMInquiry.php?' . SID . '">' . _('Costed Bill Of Material Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMInquiry.php">' . _('Costed Bill Of Material Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WhereUsedInquiry.php?' . SID . '">' . _('Where Used Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WhereUsedInquiry.php">' . _('Where Used Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMIndented.php?' . SID . '">' . _('Indented Bill Of Material Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMIndented.php">' . _('Indented Bill Of Material Listing') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMExtendedQty.php?' . SID . '">' . _('List Components Required') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMExtendedQty.php">' . _('List Components Required') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMIndentedReverse.php?' . SID . '">' . _('Indented Where Used Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMIndentedReverse.php">' . _('Indented Where Used Listing') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPReport.php?' . SID . '">' . _('MRP') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPReport.php">' . _('MRP') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPShortages.php?' . SID . '">' . _('MRP Shortages') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPShortages.php">' . _('MRP Shortages') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedPurchaseOrders.php?' . SID . '">' . _('MRP Suggested Purchase Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedPurchaseOrders.php">' . _('MRP Suggested Purchase Orders') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedWorkOrders.php?' . SID . '">' . _('MRP Suggested Work Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedWorkOrders.php">' . _('MRP Suggested Work Orders') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPReschedules.php?' . SID . '">' . _('MRP Reschedules Required') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPReschedules.php">' . _('MRP Reschedules Required') . '</a></p>'; ?> </td> </tr> <tr> @@ -843,28 +847,28 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WorkCentres.php?' . SID . '">' . _('Work Centre') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WorkCentres.php">' . _('Work Centre') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMs.php?' . SID . '">' . _('Bills Of Material') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMs.php">' . _('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>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPDemands.php">' . _('Master Schedule') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPCreateDemands.php?' . SID . '">' . _('Auto Create Master Schedule') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPCreateDemands.php">' . _('Auto Create Master Schedule') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRP.php?' . SID . '">' . _('MRP Calculation') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRP.php">' . _('MRP Calculation') . '</a></p>'; ?> </td> </tr> @@ -932,62 +936,62 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CompanyPreferences.php?' . SID . '">' . _('Company Preferences') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CompanyPreferences.php">' . _('Company Preferences') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SystemParameters.php?' . SID . '">' . _('Configuration Settings') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SystemParameters.php">' . _('Configuration Settings') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WWW_Users.php?' . SID . '">' . _('User Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WWW_Users.php">' . _('User Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WWW_Access.php?' . SID . '">' . _('Role Permissions') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WWW_Access.php">' . _('Role Permissions') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PageSecurity.php?' . SID . '">' . _('Page Security Settings') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PageSecurity.php">' . _('Page Security Settings') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BankAccounts.php?' . SID . '">' . _('Bank Accounts') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BankAccounts.php">' . _('Bank Accounts') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Currencies.php?' . SID . '">' . _('Currency Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Currencies.php">' . _('Currency Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxAuthorities.php?' . SID . '">' . _('Tax Authorities and Rates Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TaxAuthorities.php">' . _('Tax Authorities and Rates Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxGroups.php?' . SID . '">' . _('Tax Group Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TaxGroups.php">' . _('Tax Group Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxProvinces.php?' . SID . '">' . _('Dispatch Tax Province Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TaxProvinces.php">' . _('Dispatch Tax Province Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxCategories.php?' . SI... [truncated message content] |
From: <dai...@us...> - 2011-03-24 09:12:30
|
Revision: 4516 http://web-erp.svn.sourceforge.net/web-erp/?rev=4516&view=rev Author: daintree Date: 2011-03-24 09:12:22 +0000 (Thu, 24 Mar 2011) Log Message: ----------- James SelectProduct.php product image - Phil mods to PDFStockTransfer.php Modified Paths: -------------- trunk/PDFStockTransfer.php trunk/SelectProduct.php trunk/doc/Change.log.html trunk/index.php Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2011-03-20 02:51:01 UTC (rev 4515) +++ trunk/PDFStockTransfer.php 2011-03-24 09:12:22 UTC (rev 4516) @@ -2,11 +2,35 @@ /* $Id$*/ -/* $Revision: 1.5 $ */ - -//$PageSecurity = 2; include('includes/session.inc'); +if (!isset($_GET['TransferNo'])){ + if (isset($_POST['TransferNo'])){ + if (is_numeric($_POST['TransferNo'])){ + $_GET['TransferNo'] = $_POST['TransferNo']; + } else { + prnMsg(_('The entered transfer reference is expected to be numeric'),'error'); + unset($_POST['TransferNo']); + } + } + if (!isset($_GET['TransferNo'])){ //still not set from a post then + //open a form for entering a transfer number + $title = _('Print Stock Transfer'); + include('includes/header.inc'); + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/printer.png" title="' . _('Print Transfer Note') . '" alt="" />' . ' ' . $title.'</p><br />'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post" name="form">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<table class="selection"><tr>'; + echo '<td>'._('Print Stock Transfer Note').' : '.'</td>'; + echo '<td><input type=text class="number" name="TransferNo" maxlength=10 size=11 /></td></tr>'; + echo '</table>'; + echo '<br><div class="centre"><input type="submit" name="Process" value="' . _('Print Transfer Note') . '"></div></form>'; + include('includes/footer.inc'); + exit(); + } +} + + include('includes/PDFStarter.php'); $pdf->addInfo('Title', _('Stock Transfer Form') ); $FontSize=10; @@ -18,56 +42,43 @@ /*Print out the category totals */ -$sql="SELECT stockid, transno, loccode, trandate, qty from stockmoves where transno='".$_GET['TransferNo']."' and type=16"; +$sql="SELECT stockmoves.stockid, + description, + transno, + stockmoves.loccode, + locationname, + trandate, + qty + FROM stockmoves + INNER JOIN stockmaster + ON stockmoves.stockid=stockmaster.stockid + INNER JOIN locations + ON stockmoves.loccode=locations.loccode + WHERE transno='".$_GET['TransferNo']."' + AND type=16"; $result=DB_query($sql, $db); -$myrow=DB_fetch_array($result); -$StockID=$myrow[0]; -$FromCode=$myrow[2]; -$Date=$myrow[3]; - -$myrow=DB_fetch_array($result); -$ToCode=$myrow[2]; -$Quantity=$myrow[4]; - -$sql="select description from stockmaster where stockid='".$StockID."'"; -$result=DB_query($sql, $db); - if (DB_num_rows($result) == 0){ + $title = _('Print Stock Transfer - Error'); include ('includes/header.inc'); - prnMsg(_('There are no decription for '.$StockID), 'warn'); + prnMsg(_('There was no transfer found with number') . ': ' . $_GET['TransferNo'], 'error'); + echo '<a href="PDFStockTransfer.php">' . _('Try Again') .'</a>'; include ('includes/footer.inc'); exit; } - +//get the first stock movement which will be the quantity taken from the initiating location $myrow=DB_fetch_array($result); -$Description=$myrow[0]; +$StockID=$myrow['stockid']; +$FromCode=$myrow['loccode']; +$From = $myrow['locationname']; +$Date=$myrow['trandate']; +//get the next row which will be the quantity received in the receiving location +$myNextRow=DB_fetch_array($result); +$ToCode=$myNextRow['loccode']; +$To = $myrow['locationname']; +$Quantity=$myNextRow['qty']; +$Description=$myNextRow['description']; -$sql="select locationname from locations where loccode='".$FromCode."'"; -$result=DB_query($sql, $db); -if (DB_num_rows($result) == 0){ - include ('includes/header.inc'); - prnMsg(_('There are no location From for '.$StockID), 'warn'); - include ('includes/footer.inc'); - exit; -} - -$myrow=DB_fetch_array($result); -$From=$myrow[0]; - -$sql="select locationname from locations where loccode='".$ToCode."'"; -$result=DB_query($sql, $db); - -if (DB_num_rows($result) == 0){ - include ('includes/header.inc'); - prnMsg(_('There are no location To for '.$StockID), 'warn'); - include ('includes/footer.inc'); - exit; -} - -$myrow=DB_fetch_array($result); -$To=$myrow[0]; - $LeftOvers = $pdf->addTextWrap($Left_Margin+1,$YPos-10,300-$Left_Margin,$FontSize, $StockID); $LeftOvers = $pdf->addTextWrap($Left_Margin+75,$YPos-10,300-$Left_Margin,$FontSize, $Description); $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos-10,300-$Left_Margin,$FontSize, $From); @@ -78,30 +89,7 @@ $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos-120,300-$Left_Margin,$FontSize, _('Signed for ').$From.'______________________'); $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos-160,300-$Left_Margin,$FontSize, _('Signed for ').$To.'______________________'); -/* -$pdfcode = $pdf->output(); -$len = strlen($pdfcode); -if ($len<=20){ - $title = _('Print Price List Error'); - include('includes/header.inc'); - prnMsg(_('There were no stock transfer details to print'),'warn'); - echo '<br><a href="'.$rootpath.'/index.php?' . SID . '">'. _('Back to the menu').'</a>'; - include('includes/footer.inc'); - exit; -} else { - header('Content-type: application/pdf'); - header('Content-Length: ' . $len); - header('Content-Disposition: inline; filename=StockTransfer.pdf'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Pragma: public'); - - $pdf->Output('StockTransfer.pdf', 'I'); -} -*/ -$pdf->OutputD($_SESSION['DatabaseName'] . '_StockTransfer_' . date('Y-m-d') . '.pdf');//UldisN -$pdf->__destruct(); //UldisN - - /*end of else not PrintPDF */ -?> +$pdf->OutputD($_SESSION['DatabaseName'] . '_StockTransfer_' . date('Y-m-d') . '.pdf'); +$pdf->__destruct(); +?> \ No newline at end of file Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2011-03-20 02:51:01 UTC (rev 4515) +++ trunk/SelectProduct.php 2011-03-24 09:12:22 UTC (rev 4516) @@ -35,7 +35,7 @@ $result1 = DB_query($SQL, $db); if (DB_num_rows($result1) == 0) { echo '<p><font size=4 color=red>' . _('Problem Report') . ':</font><br />' . _('There are no stock categories currently defined please use the link below to set them up').'</p>'; - echo '<br /><a href="' . $rootpath . '/StockCategories.php?' . SID . '">' . _('Define Stock Categories') . '</a>'; + echo '<br /><a href="' . $rootpath . '/StockCategories.php">' . _('Define Stock Categories') . '</a>'; exit; } // end of showing search facilities @@ -352,7 +352,7 @@ } else { echo '<td class="select">' . _('No') . '</td>'; } - echo '<td class="select"><a href="' . $rootpath . '/PO_Header.php?' . SID . '&NewOrder=Yes' . '&SelectedSupplier=' . + echo '<td class="select"><a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes' . '&SelectedSupplier=' . $SuppRow['supplierid'] . '&StockID=' . $StockID . '&Quantity='.$SuppRow['minorderqty'].'">' . _('Order') . ' </a></td>'; echo '</tr>'; } @@ -367,47 +367,64 @@ </tr>'; echo '<tr><td valign="top" class="select">'; /*Stock Inquiry Options */ -echo '<a href="' . $rootpath . '/StockMovements.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a><br />'; +echo '<a href="' . $rootpath . '/StockMovements.php?StockID=' . $StockID . '">' . _('Show Stock Movements') . '</a><br />'; if ($Its_A_Kitset_Assembly_Or_Dummy == False) { - echo '<a href="' . $rootpath . '/StockStatus.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Status') . '</a><br />'; - echo '<a href="' . $rootpath . '/StockUsage.php?' . SID . '&StockID=' . $StockID . '">' . _('Show Stock Usage') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockStatus.php?StockID=' . $StockID . '">' . _('Show Stock Status') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockUsage.php?StockID=' . $StockID . '">' . _('Show Stock Usage') . '</a><br />'; } -echo '<a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a><br />'; -echo '<a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a><br />'; +echo '<a href="' . $rootpath . '/SelectSalesOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Sales Orders') . '</a><br />'; +echo '<a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Completed Sales Orders') . '</a><br />'; if ($Its_A_Kitset_Assembly_Or_Dummy == False) { - echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Purchase Orders') . '</a><br />'; - echo '<a href="' . $rootpath . '/PO_SelectPurchOrder.php?' . SID . '&SelectedStockItem=' . $StockID . '">' . _('Search All Purchase Orders') . '</a><br />'; - echo '<a href="' . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $StockID . '.jpg?' . SID . '">' . _('Show Part Picture (if available)') . '</a><br />'; + echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search Outstanding Purchase Orders') . '</a><br />'; + echo '<a href="' . $rootpath . '/PO_SelectPurchOrder.php?SelectedStockItem=' . $StockID . '">' . _('Search All Purchase Orders') . '</a><br />'; + echo '<a href="' . $rootpath . '/' . $_SESSION['part_pics_dir'] . '/' . $StockID . '.jpg">' . _('Show Part Picture (if available)') . '</a><br />'; } if ($Its_A_Dummy == False) { - echo '<a href="' . $rootpath . '/BOMInquiry.php?' . SID . '&StockID=' . $StockID . '">' . _('View Costed Bill Of Material') . '</a><br />'; - echo '<a href="' . $rootpath . '/WhereUsedInquiry.php?' . SID . '&StockID=' . $StockID . '">' . _('Where This Item Is Used') . '</a><br />'; + echo '<a href="' . $rootpath . '/BOMInquiry.php?StockID=' . $StockID . '">' . _('View Costed Bill Of Material') . '</a><br />'; + echo '<a href="' . $rootpath . '/WhereUsedInquiry.php?StockID=' . $StockID . '">' . _('Where This Item Is Used') . '</a><br />'; } if ($Its_A_Labour_Item == True) { - echo '<a href="' . $rootpath . '/WhereUsedInquiry.php?' . SID . '&StockID=' . $StockID . '">' . _('Where This Labour Item Is Used') . '</a><br />'; + echo '<a href="' . $rootpath . '/WhereUsedInquiry.php?StockID=' . $StockID . '">' . _('Where This Labour Item Is Used') . '</a><br />'; } wikiLink('Product', $StockID); echo '</td><td valign="top" class="select">'; /* Stock Transactions */ if ($Its_A_Kitset_Assembly_Or_Dummy == False) { - echo '<a href="' . $rootpath . '/StockAdjustments.php?' . SID . '&StockID=' . $StockID . '">' . _('Quantity Adjustments') . '</a><br />'; - echo '<a href="' . $rootpath . '/StockTransfers.php?' . SID . '&StockID=' . $StockID . '">' . _('Location Transfers') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockAdjustments.php?StockID=' . $StockID . '">' . _('Quantity Adjustments') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockTransfers.php?StockID=' . $StockID . '">' . _('Location Transfers') . '</a><br />'; + + if (function_exists('imagecreatefrompng')){ + $StockImgLink = ' + GetStockImage.php?automake=1&textcolor=FFFFFF&bgcolor=CCCCCC'. + '&StockID='.urlencode($StockID). + '&text='. + '&width=200'. + '&height=200'. + ' '; + } else { + if( isset($StockID) and file_exists($_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg') ) { + $StockImgLink = ' ' . $_SESSION['part_pics_dir'] . '/' .$StockID.'.jpg '; + } else { + $StockImgLink = _('No Image'); + } + } + if ($myrow['mbflag'] == 'B') { echo '<br />'; $SuppResult = DB_query("SELECT suppliers.suppname, - suppliers.supplierid, - purchdata.preferred, - purchdata.minorderqty - FROM purchdata INNER JOIN suppliers - ON purchdata.supplierno=suppliers.supplierid - WHERE purchdata.stockid = '" . $StockID . "'", $db); + suppliers.supplierid, + purchdata.preferred, + purchdata.minorderqty + FROM purchdata INNER JOIN suppliers + ON purchdata.supplierno=suppliers.supplierid + WHERE purchdata.stockid = '" . $StockID . "'", $db); while ($SuppRow = DB_fetch_array($SuppResult)) { if ($myrow['eoq'] == 0) { $EOQ = $SuppRow['minorderqty']; } else { $EOQ = $myrow['eoq']; } - echo '<a href="' . $rootpath . '/PO_Header.php?' . SID . '&NewOrder=Yes' . '&SelectedSupplier=' . $SuppRow['supplierid'] . + echo '<a href="' . $rootpath . '/PO_Header.php?NewOrder=Yes' . '&SelectedSupplier=' . $SuppRow['supplierid'] . '&StockID=' . $StockID . '&Quantity=' . $EOQ . '">' . _('Purchase this Item from') . ' ' . $SuppRow['suppname'] . ' (' . _('default') . ')</a><br />'; /**/ } /* end of while */ @@ -416,21 +433,21 @@ echo '</td><td valign="top" class="select">'; /* Stock Maintenance Options */ echo '<a href="' . $rootpath . '/Stocks.php?">' . _('Add Inventory Items') . '</a><br />'; -echo '<a href="' . $rootpath . '/Stocks.php?' . SID . '&StockID=' . $StockID . '">' . _('Modify Item Details') . '</a><br />'; +echo '<a href="' . $rootpath . '/Stocks.php?StockID=' . $StockID . '">' . _('Modify Item Details') . '</a><br />'; if ($Its_A_Kitset_Assembly_Or_Dummy == False) { - echo '<a href="' . $rootpath . '/StockReorderLevel.php?' . SID . '&StockID=' . $StockID . '">' . _('Maintain Reorder Levels') . '</a><br />'; - echo '<a href="' . $rootpath . '/StockCostUpdate.php?' . SID . '&StockID=' . $StockID . '">' . _('Maintain Standard Cost') . '</a><br />'; - echo '<a href="' . $rootpath . '/PurchData.php?' . SID . '&StockID=' . $StockID . '">' . _('Maintain Purchasing Data') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockReorderLevel.php?StockID=' . $StockID . '">' . _('Maintain Reorder Levels') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockCostUpdate.php?StockID=' . $StockID . '">' . _('Maintain Standard Cost') . '</a><br />'; + echo '<a href="' . $rootpath . '/PurchData.php?StockID=' . $StockID . '">' . _('Maintain Purchasing Data') . '</a><br />'; } if ($Its_A_Labour_Item == True) { - echo '<a href="' . $rootpath . '/StockCostUpdate.php?' . SID . '&StockID=' . $StockID . '">' . _('Maintain Standard Cost') . '</a><br />'; + echo '<a href="' . $rootpath . '/StockCostUpdate.php?StockID=' . $StockID . '">' . _('Maintain Standard Cost') . '</a><br />'; } if (!$Its_A_Kitset) { - echo '<a href="' . $rootpath . '/Prices.php?' . SID . '&Item=' . $StockID . '">' . _('Maintain Pricing') . '</a><br />'; + echo '<a href="' . $rootpath . '/Prices.php?Item=' . $StockID . '">' . _('Maintain Pricing') . '</a><br />'; if (isset($_SESSION['CustomerID']) AND $_SESSION['CustomerID'] != "" AND Strlen($_SESSION['CustomerID']) > 0) { - echo '<a href="' . $rootpath . '/Prices_Customer.php?' . SID . '&Item=' . $StockID . '">' . _('Special Prices for customer') . ' - ' . $_SESSION['CustomerID'] . '</a><br />'; + echo '<a href="' . $rootpath . '/Prices_Customer.php?Item=' . $StockID . '">' . _('Special Prices for customer') . ' - ' . $_SESSION['CustomerID'] . '</a><br />'; } - echo '<a href="' . $rootpath . '/DiscountCategories.php?' . SID . '&StockID=' . $StockID . '">' . _('Maintain Discount Category') . '</a><br />'; + echo '<a href="' . $rootpath . '/DiscountCategories.php?StockID=' . $StockID . '">' . _('Maintain Discount Category') . '</a><br />'; } echo '</td></tr></table>'; } else { @@ -450,7 +467,7 @@ echo '<a href="' . $rootpath . '/Stocks.php?">' . _('Add Inventory Items') . '</a><br />'; echo '</td></tr></table>'; } // end displaying item options if there is one and only one record -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/magnifier.png" title="' . _('Search') . '" alt="" />' . ' ' . _('Search for Inventory Items'). '</p>'; @@ -634,7 +651,7 @@ /* end query for list of records */ /* display list if there is more than one record */ if (isset($searchresult) AND !isset($_POST['Select'])) { - echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method="post">'; + echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; $ListCount = DB_num_rows($searchresult); if ($ListCount > 0) { @@ -707,7 +724,7 @@ <td>".$myrow['description']."</td> <td class='number'>".$qoh."</td> <td>".$myrow['units']."</td> - <td><a target='_blank' href='" . $rootpath . '/StockStatus.php?' . SID . '&StockID=' . $myrow['stockid']."'>" . _('View') . '</a></td> + <td><a target='_blank' href='" . $rootpath . '/StockStatus.php?StockID=' . $myrow['stockid']."'>" . _('View') . '</a></td> </tr>'; $j++; if ($j == 20 AND ($RowIndex + 1 != $_SESSION['DisplayRecordsMax'])) { Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-20 02:51:01 UTC (rev 4515) +++ trunk/doc/Change.log.html 2011-03-24 09:12:22 UTC (rev 4516) @@ -1,5 +1,7 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p> +<p>24/3/11: Phil rework PDFStockTransfer.php remove a few round trips to DB and added facility to be able to select a transfer number to reprint - added to main menu</p> +<p>24/3/11: James wer...@ya... Added snall image in middle of SelectProduct.php</p> <p>19/3/11: Phil added country to packing slips </p> <p>18/3/11: Marcos Garcia Trejo Added Z_ChangeSupplierCode.php </p> <p>18/3/11: Ricard add orderby transdate to DailyBankTransactions.php</p> Modified: trunk/index.php =================================================================== --- trunk/index.php 2011-03-20 02:51:01 UTC (rev 4515) +++ trunk/index.php 2011-03-24 09:12:22 UTC (rev 4516) @@ -11,15 +11,15 @@ $ModuleLink = array('orders', 'AR', 'AP', 'PO', 'stock', 'manuf', 'GL', 'FA', 'PC', 'system'); /*The headings showing on the tabs accross the main index used also in WWW_Users for defining what should be visible to the user */ $ModuleList = array(_('Sales'), - _('Receivables'), - _('Payables'), - _('Purchases'), - _('Inventory'), - _('Manufacturing'), - _('General Ledger'), - _('Asset Manager'), - _('Petty Cash'), - _('Setup')); + _('Receivables'), + _('Payables'), + _('Purchases'), + _('Inventory'), + _('Manufacturing'), + _('General Ledger'), + _('Asset Manager'), + _('Petty Cash'), + _('Setup')); if (isset($_GET['Application'])){ /*This is sent by this page (to itself) when the user clicks on a tab */ $_SESSION['Module'] = $_GET['Application']; @@ -39,17 +39,17 @@ <table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?' . SID . '&CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerInquiry.php?CustomerID=' . $_SESSION['CustomerID'] . '">' . _('Account Status') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?' . SID . '&NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Place An Order') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '&SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?SelectedCustomer=' . $_SESSION['CustomerID'] . '">' . _('Order Status') . '</a></p>'; ?> </td> </tr> </table> @@ -65,7 +65,7 @@ <table class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php?' . SID . '">' . _('Supplier Tenders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SupplierTenders.php">' . _('Supplier Tenders') . '</a></p>'; ?> </td> </tr> </table> @@ -93,9 +93,9 @@ $_SESSION['Module']=$ModuleLink[$i]; } if ($ModuleLink[$i] == $_SESSION['Module']){ - echo '<tr><td class="main_menu_selected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr><td class="main_menu_selected"><a href="' . $_SERVER['PHP_SELF'] . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; } else { - echo '<tr><td class="main_menu_unselected"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '&Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; + echo '<tr><td class="main_menu_unselected"><a href="' . $_SERVER['PHP_SELF'] . '?Application='. $ModuleLink[$i] . '">' . $ModuleList[$i] . '</a></td></tr>'; } } $i++; @@ -126,7 +126,7 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?' .sid . '&NewOrder=Yes">' . _('Enter An Order or Quotation') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectOrderItems.php?NewOrder=Yes">' . _('Enter An Order or Quotation') . '</a></p>'; ?> </td> </tr> <tr> @@ -141,12 +141,12 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Outstanding Sales Orders/Quotations') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SpecialOrder.php?' .sid . '&NewSpecial=Yes">' . _('Special Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SpecialOrder.php?NewSpecial=Yes">' . _('Special Order') . '</a></p>'; ?> </td> </tr> <tr> @@ -165,52 +165,52 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php?' . SID . '">' . _('Order Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCompletedOrder.php">' . _('Order Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php?' . SID . '">' . _('Print Price Lists') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFPriceList.php">' . _('Print Price Lists') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php?' . SID . '">' . _('Order Status Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFOrderStatus.php">' . _('Order Status Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php?' . SID . '">' . _('Orders Invoiced Reports') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFOrdersInvoiced.php">' . _('Orders Invoiced Reports') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php?' . SID . '">' . _('Daily Sales Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/DailySalesInquiry.php">' . _('Daily Sales Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php?' . SID . '">' . _('Order Delivery Differences Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFDeliveryDifferences.php">' . _('Order Delivery Differences Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php?' . SID . '">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFDIFOT.php">' . _('Delivery In Full On Time (DIFOT) Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php?' . SID . '">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesInquiry.php">' . _('Sales Order Detail Or Summary Inquiries') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php?' . SID . '">' . _('Top Sales Items Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TopItems.php">' . _('Top Sales Items Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFLowGP.php?' . SID . '">' . _('Sales With Low Gross Profit Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFLowGP.php">' . _('Sales With Low Gross Profit Report') . '</a></p>'; ?> </td> </tr> <tr> @@ -228,12 +228,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectContract.php?' . SID . '">' . _('Select Contract') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectContract.php">' . _('Select Contract') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Contracts.php?' . SID . '">' . _('Create Contract') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Contracts.php">' . _('Create Contract') . '</a></p>'; ?> </td> </tr> </table> @@ -266,23 +266,23 @@ <table width="100%"class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php?' . SID . '">' . _('Select Order to Invoice') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSalesOrder.php">' . _('Select Order to Invoice') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCreditItems.php?' .sid . '&NewCredit=Yes">' . _('Create A Credit Note') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCreditItems.php?NewCredit=Yes">' . _('Create A Credit Note') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?' . SID . '&NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerReceipt.php?NewReceipt=Yes&Type=Customer">' . _('Enter Receipts') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php?' . SID . '">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerAllocations.php">' . _('Allocate Receipts or Credit Notes') . '</a></p>'; ?> </td> </tr> </table> @@ -291,63 +291,63 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php?' . SID . '">' . _('Where Allocated Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustWhereAlloc.php">' . _('Where Allocated Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> <?php if ($_SESSION['InvoicePortraitFormat']==0){ - echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php?' . SID . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; + echo '<p>• <a href="' . $rootpath . '/PrintCustTrans.php">' . _('Print Invoices or Credit Notes') . '</a></p>'; } else { - echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php?' . SID . '">' . _('Print Invoices or Credit Notes') . '</a></p>'; + echo '<p>• <a href="' . $rootpath . '/PrintCustTransPortrait.php">' . _('Print Invoices or Credit Notes') . '</a></p>'; } ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php?' . SID . '">' . _('Print Statements') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PrintCustStatements.php">' . _('Print Statements') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php?' . SID . '">' . _('Sales Analysis Reports') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesAnalRepts.php">' . _('Sales Analysis Reports') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php?' . SID . '">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/AgedDebtors.php">' . _('Aged Customer Balances/Overdues Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php?' . SID . '">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFBankingSummary.php">' . _('Re-Print A Deposit Listing') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php?' . SID . '">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/DebtorsAtPeriodEnd.php">' . _('Debtor Balances At A Prior Month End') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php?' . SID . '">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFCustomerList.php">' . _('Customer Listing By Area/Salesperson') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php?' . SID . '">' . _('Sales Graphs') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesGraph.php">' . _('Sales Graphs') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php?' . SID . '">' . _('List Daily Transactions') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFCustTransListing.php">' . _('List Daily Transactions') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php?' . SID . '">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CustomerTransInquiry.php">' . _('Customer Transaction Inquiries') . '</a></p>'; ?> </td> </tr> <tr> @@ -361,12 +361,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Customers.php?' . SID . '">' . _('Add Customer') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Customers.php">' . _('Add Customer') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php?' . SID . '">' . _('Customers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectCustomer.php">' . _('Customers') . '</a></p>'; ?> </td> </tr> </table> @@ -396,7 +396,7 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . SID . '">' . _('Select Supplier') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php">' . _('Select Supplier') . '</a></p>'; ?> </td> </tr> <tr> @@ -410,37 +410,37 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php?' . SID . '">' . _('Aged Supplier Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/AgedSuppliers.php">' . _('Aged Supplier Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php?' . SID . '">' . _('Payment Run Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SuppPaymentRun.php">' . _('Payment Run Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php?' . SID . '">' . _('Remittance Advices') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFRemittanceAdvice.php">' . _('Remittance Advices') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php?' . SID . '">' . _('Outstanding GRNs Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/OutstandingGRNs.php">' . _('Outstanding GRNs Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php?' . SID . '">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SupplierBalsAtPeriodEnd.php">' . _('Supplier Balances At A Prior Month End') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php?' . SID . '">' . _('List Daily Transactions') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFSuppTransListing.php">' . _('List Daily Transactions') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SupplierTransInquiry.php?' . SID . '">' . _('Supplier Transaction Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SupplierTransInquiry.php">' . _('Supplier Transaction Inquiries') . '</a></p>'; ?> </td> </tr> <tr> @@ -454,12 +454,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php?' . SID . '">' . _('Add Supplier') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Suppliers.php">' . _('Add Supplier') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Factors.php?' . SID . '">' . _('Maintain Factor Companies') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Factors.php">' . _('Maintain Factor Companies') . '</a></p>'; ?> </td> </tr> </table> @@ -487,7 +487,7 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Purchase Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Purchase Orders') . '</a></p>'; ?> </td> </tr> <tr> @@ -497,22 +497,22 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/OffersReceived.php?' . SID . '">' . _('Process Tenders and Offers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/OffersReceived.php">' . _('Process Tenders and Offers') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php?' . SID . '">' . _('Orders to Authorise') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_AuthoriseMyOrders.php">' . _('Orders to Authorise') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php?' . SID . '">' . _('Shipment Entry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectSupplier.php">' . _('Shipment Entry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php?' . SID . '">' . _('Select A Shipment') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Shipt_Select.php">' . _('Select A Shipment') . '</a></p>'; ?> </td> </tr> </table> @@ -521,12 +521,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php?' . SID . '">' . _('Purchase Order Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectPurchOrder.php">' . _('Purchase Order Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/POReport.php?' . SID . '">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/POReport.php">' . _('Purchase Order Detail Or Summary Inquiries') . '</a></p>'; ?> </td> </tr> <tr> @@ -566,7 +566,7 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . _('Receive Purchase Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Receive Purchase Orders') . '</a></p>'; ?> </td> </tr> <tr> @@ -576,12 +576,12 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php?' . SID . '">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocTransferReceive.php">' . _('Bulk Inventory Transfer') . ' - ' . _('Receive') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php?' . SID . '">' . _('Inventory Location Transfers') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockTransfers.php">' . _('Inventory Location Transfers') . '</a></p>'; ?> </td> </tr> <tr> @@ -591,12 +591,12 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php?' . SID . '">' . _('Reverse Goods Received') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReverseGRN.php">' . _('Reverse Goods Received') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php?' . SID . '">' . _('Enter Stock Counts') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockCounts.php">' . _('Enter Stock Counts') . '</a></p>'; ?> </td> </tr> </table> @@ -620,83 +620,87 @@ </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockStatus.php?' . SID . '">' . _('Inventory Item Status') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockStatus.php">' . _('Inventory Item Status') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockUsage.php?' . SID . '">' . _('Inventory Item Usage') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockUsage.php">' . _('Inventory Item Usage') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryQuantities.php?' . SID . '">' . _('Inventory Quantities') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryQuantities.php">' . _('Inventory Quantities') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevel.php?' . SID . '">' . _('Reorder Level') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevel.php">' . _('Reorder Level') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockDispatch.php?' . SID . '">' . _('Stock Dispatch') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockDispatch.php">' . _('Stock Dispatch') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryValuation.php?' . SID . '">' . _('Inventory Valuation Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryValuation.php">' . _('Inventory Valuation Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanning.php?' . SID . '">' . _('Inventory Planning Report') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanning.php">' . _('Inventory Planning Report') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanningPrefSupplier.php?' . SID . '">' . _('Inventory Planning Based On Preferred Supplier Data') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/InventoryPlanningPrefSupplier.php">' . _('Inventory Planning Based On Preferred Supplier Data') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockCheck.php?' . SID . '">' . _('Inventory Stock Check Sheets') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockCheck.php">' . _('Inventory Stock Check Sheets') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockQties_csv.php?' . SID . '">' . _('Make Inventory Quantities CSV') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockQties_csv.php">' . _('Make Inventory Quantities CSV') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockCheckComparison.php?' . SID . '">' . _('Compare Counts Vs Stock Check Data') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockCheckComparison.php">' . _('Compare Counts Vs Stock Check Data') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocMovements.php?' . SID . '">' . _('All Inventory Movements By Location/Date') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocMovements.php">' . _('All Inventory Movements By Location/Date') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockLocStatus.php?' . SID . '">' . _('List Inventory Status By Location/Category') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockLocStatus.php">' . _('List Inventory Status By Location/Category') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/StockQuantityByDate.php?' . SID . '">' . _('Historical Stock Quantity By Location/Category') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/StockQuantityByDate.php">' . _('Historical Stock Quantity By Location/Category') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockNegatives.php?' . SID . '">' . _('List Negative Stocks') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockNegatives.php">' . _('List Negative Stocks') . '</a></p>'; ?> </td> </tr> <tr> + <td class="menu_group_item"> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransListing.php">' . _('Daily Stock Transaction Listing') . '</a></p>'; ?> + </td> + </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransListing.php?' . SID . '">' . _('Daily Stock Transaction Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PDFStockTransfer.php">' . _('Stock Transfer Note') . '</a></p>'; ?> </td> </tr> <tr> @@ -710,32 +714,32 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Stocks.php?' . SID . '">' . _('Add A New Item') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Stocks.php">' . _('Add A New Item') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectProduct.php?' . SID . '">' . _('Select An Item') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectProduct.php">' . _('Select An Item') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SalesCategories.php?' . SID . '">' . _('Sales Category Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SalesCategories.php">' . _('Sales Category Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PricesBasedOnMarkUp.php?' . SID . '">' . _('Add or Update Prices Based On Costs Or Other Price List') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PricesBasedOnMarkUp.php">' . _('Add or Update Prices Based On Costs Or Other Price List') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php?' . SID . '">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PricesByCost.php">' . _('View or Update Prices Based On Costs') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php?' . SID . '">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/ReorderLevelLocation.php">' . _('Reorder Level By Category/Location') . '</a></p>'; ?> </td> </tr> </table> @@ -765,12 +769,12 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WorkOrderEntry.php?' . SID . '">' . _('Work Order Entry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WorkOrderEntry.php">' . _('Work Order Entry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select A Work Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select A Work Order') . '</a></p>'; ?> </td> </tr> </table> @@ -779,57 +783,57 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php?' . SID . '">' . _('Select A Work Order') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SelectWorkOrder.php">' . _('Select A Work Order') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMInquiry.php?' . SID . '">' . _('Costed Bill Of Material Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMInquiry.php">' . _('Costed Bill Of Material Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WhereUsedInquiry.php?' . SID . '">' . _('Where Used Inquiry') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WhereUsedInquiry.php">' . _('Where Used Inquiry') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMIndented.php?' . SID . '">' . _('Indented Bill Of Material Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMIndented.php">' . _('Indented Bill Of Material Listing') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMExtendedQty.php?' . SID . '">' . _('List Components Required') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMExtendedQty.php">' . _('List Components Required') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMIndentedReverse.php?' . SID . '">' . _('Indented Where Used Listing') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMIndentedReverse.php">' . _('Indented Where Used Listing') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPReport.php?' . SID . '">' . _('MRP') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPReport.php">' . _('MRP') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPShortages.php?' . SID . '">' . _('MRP Shortages') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPShortages.php">' . _('MRP Shortages') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedPurchaseOrders.php?' . SID . '">' . _('MRP Suggested Purchase Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedPurchaseOrders.php">' . _('MRP Suggested Purchase Orders') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedWorkOrders.php?' . SID . '">' . _('MRP Suggested Work Orders') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPPlannedWorkOrders.php">' . _('MRP Suggested Work Orders') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPReschedules.php?' . SID . '">' . _('MRP Reschedules Required') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPReschedules.php">' . _('MRP Reschedules Required') . '</a></p>'; ?> </td> </tr> <tr> @@ -843,28 +847,28 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WorkCentres.php?' . SID . '">' . _('Work Centre') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WorkCentres.php">' . _('Work Centre') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BOMs.php?' . SID . '">' . _('Bills Of Material') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BOMs.php">' . _('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>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPDemands.php">' . _('Master Schedule') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRPCreateDemands.php?' . SID . '">' . _('Auto Create Master Schedule') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRPCreateDemands.php">' . _('Auto Create Master Schedule') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/MRP.php?' . SID . '">' . _('MRP Calculation') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/MRP.php">' . _('MRP Calculation') . '</a></p>'; ?> </td> </tr> @@ -932,62 +936,62 @@ <table width="100%" class="table_index"> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/CompanyPreferences.php?' . SID . '">' . _('Company Preferences') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/CompanyPreferences.php">' . _('Company Preferences') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/SystemParameters.php?' . SID . '">' . _('Configuration Settings') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/SystemParameters.php">' . _('Configuration Settings') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WWW_Users.php?' . SID . '">' . _('User Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WWW_Users.php">' . _('User Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/WWW_Access.php?' . SID . '">' . _('Role Permissions') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/WWW_Access.php">' . _('Role Permissions') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/PageSecurity.php?' . SID . '">' . _('Page Security Settings') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/PageSecurity.php">' . _('Page Security Settings') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/BankAccounts.php?' . SID . '">' . _('Bank Accounts') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/BankAccounts.php">' . _('Bank Accounts') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/Currencies.php?' . SID . '">' . _('Currency Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/Currencies.php">' . _('Currency Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxAuthorities.php?' . SID . '">' . _('Tax Authorities and Rates Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TaxAuthorities.php">' . _('Tax Authorities and Rates Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxGroups.php?' . SID . '">' . _('Tax Group Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TaxGroups.php">' . _('Tax Group Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxProvinces.php?' . SID . '">' . _('Dispatch Tax Province Maintenance') . '</a></p>'; ?> + <?php echo '<p>• <a href="' . $rootpath . '/TaxProvinces.php">' . _('Dispatch Tax Province Maintenance') . '</a></p>'; ?> </td> </tr> <tr> <td class="menu_group_item"> - <?php echo '<p>• <a href="' . $rootpath . '/TaxCategories.php?' . SI... [truncated message content] |
From: <dai...@us...> - 2011-03-26 03:34:03
|
Revision: 4517 http://web-erp.svn.sourceforge.net/web-erp/?rev=4517&view=rev Author: daintree Date: 2011-03-26 03:33:53 +0000 (Sat, 26 Mar 2011) Log Message: ----------- pre 4.03 release Modified Paths: -------------- trunk/PcExpenses.php trunk/PcExpensesTypeTab.php trunk/PcTypeTabs.php trunk/doc/Change.log.html trunk/doc/Manual/ManualContents.php trunk/includes/session.inc trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Added Paths: ----------- trunk/companies/weberpdemo/logo.jpg Removed Paths: ------------- trunk/companies/weberpdemo/logo.jpg trunk/companies/weberpdemo/logo.png trunk/companies/weberpdemo/logo1.jpg trunk/companies/weberpdemo/logo2.jpg trunk/companies/weberpdemo/logo4.jpg trunk/companies/weberpdemo/logo5.jpg trunk/companies/weberpdemo/logo6.jpg trunk/companies/weberpdemo/logo7.jpg Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-03-24 09:12:22 UTC (rev 4516) +++ trunk/PcExpenses.php 2011-03-26 03:33:53 UTC (rev 4517) @@ -35,19 +35,29 @@ if ($_POST['codeexpense']=='' OR $_POST['codeexpense']==' ' OR $_POST['codeexpense']==' ') { $InputError = 1; - prnMsg('<br>' . _('The Expense type code cannot be an empty string or spaces'),'error'); + prnMsg(_('The Expense type code cannot be an empty string or spaces'),'error'); $Errors[$i] = 'PcExpenses'; $i++; } elseif (strlen($_POST['codeexpense']) >20) { $InputError = 1; - echo prnMsg(_('The Expense code must be twenty characters or less long'),'error'); + prnMsg(_('The Expense code must be twenty characters or less long'),'error'); $Errors[$i] = 'PcExpenses'; $i++; - }elseif (strlen($_POST['description']) >50) { + }elseif (ContainsIllegalCharacters($_POST['codeexpense'])){ $InputError = 1; - echo prnMsg(_('The tab code must be Fifty characters or less long'),'error'); + prnMsg(_('The Expense code cannot contain any of the following characters " \' - &'),'error'); + $Errors[$i] = 'PcExpenses'; + $i++; + } elseif (ContainsIllegalCharacters($_POST['description'])){ + $InputError = 1; + prnMsg(_('The Expense description cannot contain any of the following characters " \' - &'),'error'); $Errors[$i] = 'TypeTabCode'; $i++; + } elseif (strlen($_POST['description']) >50) { + $InputError = 1; + prnMsg(_('The tab code must be Fifty characters or less long'),'error'); + $Errors[$i] = 'TypeTabCode'; + $i++; } if (isset($SelectedExpense) AND $InputError !=1) { @@ -71,7 +81,7 @@ if ( $checkrow[0] > 0 ) { $InputError = 1; - prnMsg( _('The Expense type ') . $_POST['codeexpense'] . _(' already exist.'),'error'); + prnMsg( _('The Expense type ') . $_POST['codeexpense'] . _(' already exists.'),'error'); } else { // Add new record on submit Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-03-24 09:12:22 UTC (rev 4516) +++ trunk/PcExpensesTypeTab.php 2011-03-26 03:33:53 UTC (rev 4517) @@ -15,7 +15,10 @@ } elseif (isset($_GET['SelectedType'])){ $SelectedType = strtoupper($_GET['SelectedType']); } - +if (ContainsIllegalCharacters($SelectedType) OR strpos($SelectedType,' ')>0){ + $InputError = 1; + prnMsg(_('The petty cash tab type contain any of the following characters " \' - & or a space'),'error'); +} if (isset($_POST['SelectedTabs'])){ $SelectedTabs = strtoupper($_POST['SelectedTabs']); } elseif (isset($_GET['SelectedTabs'])){ @@ -162,8 +165,8 @@ </tr>", $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + $_SERVER['PHP_SELF'], $myrow[0], + $_SERVER['PHP_SELF'], $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -173,7 +176,7 @@ if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class=selection>'; //Main table Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2011-03-24 09:12:22 UTC (rev 4516) +++ trunk/PcTypeTabs.php 2011-03-26 03:33:53 UTC (rev 4517) @@ -33,18 +33,21 @@ //first off validate inputs sensible $i=1; - if ($_POST['typetabcode']=='' OR $_POST['typetabcode']==' ' OR $_POST['typetabcode']==' ') { + if ($_POST['TypeTabCode']=='' OR $_POST['TypeTabCode']==' ' OR $_POST['TypeTabCode']==' ') { $InputError = 1; prnMsg('<br>' . _('The Tabs type code cannot be an empty string or spaces'),'error'); $Errors[$i] = 'TypeTabCode'; $i++; - } elseif (strlen($_POST['typetabcode']) >20) { + } elseif (strlen($_POST['TypeTabCode']) >20) { $InputError = 1; echo prnMsg(_('The tab code must be twenty characters or less long'),'error'); $Errors[$i] = 'TypeTabCode'; $i++; - }elseif (strlen($_POST['typetabdescription']) >50) { + }elseif (ContainsIllegalCharacters($_POST['TypeTabCode']) OR strpos($_POST['TypeTabCode'],' ')>0){ $InputError = 1; + prnMsg(_('The petty cash tab type code cannot contain any of the following characters " \' - & or a space'),'error'); + } elseif (strlen($_POST['TypeTabDescription']) >50) { + $InputError = 1; echo prnMsg(_('The tab code must be Fifty characters or less long'),'error'); $Errors[$i] = 'TypeTabCode'; $i++; @@ -53,7 +56,7 @@ if (isset($SelectedTab) AND $InputError !=1) { $sql = "UPDATE pctypetabs - SET typetabdescription = '" . $_POST['typetabdescription'] . "' + SET typetabdescription = '" . $_POST['TypeTabDescription'] . "' WHERE typetabcode = '".$SelectedTab."'"; $msg = _('The Tabs type') . ' ' . $SelectedTab . ' ' . _('has been updated'); @@ -63,7 +66,7 @@ $checkSql = "SELECT count(*) FROM pctypetabs - WHERE typetabcode = '" . $_POST['typetabcode'] . "'"; + WHERE typetabcode = '" . $_POST['TypeTabCode'] . "'"; $checkresult = DB_query($checkSql,$db); $checkrow = DB_fetch_row($checkresult); @@ -78,10 +81,10 @@ $sql = "INSERT INTO pctypetabs (typetabcode, typetabdescription) - VALUES ('" . $_POST['typetabcode'] . "', - '" . $_POST['typetabdescription'] . "')"; + VALUES ('" . $_POST['TypeTabCode'] . "', + '" . $_POST['TypeTabDescription'] . "')"; - $msg = _('Tabs type') . ' ' . $_POST["typetabcode"] . ' ' . _('has been created'); + $msg = _('Tabs type') . ' ' . $_POST['TypeTabCode'] . ' ' . _('has been created'); } } @@ -92,35 +95,35 @@ prnMsg($msg,'success'); unset($SelectedTab); - unset($_POST['typetabcode']); - unset($_POST['typetabdescription']); + unset($_POST['TypeTabCode']); + unset($_POST['TypeTabDescription']); } } elseif ( isset($_GET['delete']) ) { // PREVENT DELETES IF DEPENDENT RECORDS IN 'PcTabExpenses' - $sqlpctabexpenses= "SELECT COUNT(*) + $SQLPcTabExpenses= "SELECT COUNT(*) FROM pctabexpenses WHERE typetabcode='".$SelectedTab."'"; $ErrMsg = _('The number of tabs using this Tab type could not be retrieved'); - $resultpctabexpenses = DB_query($sqlpctabexpenses,$db,$ErrMsg); + $ResultPcTabExpenses = DB_query($SQLPcTabExpenses,$db,$ErrMsg); - $myrowpctabexpenses = DB_fetch_row($resultpctabexpenses); + $myrowPcTabExpenses = DB_fetch_row($ResultPcTabExpenses); - $sqlpctabs= "SELECT COUNT(*) + $SqlPcTabs= "SELECT COUNT(*) FROM pctabs WHERE typetabcode='".$SelectedTab."'"; $ErrMsg = _('The number of tabs using this Tab type could not be retrieved'); - $resultpctabs = DB_query($sqlpctabs,$db,$ErrMsg); + $ResultPcTabs = DB_query($SqlPcTabs,$db,$ErrMsg); - $myrowpctabs = DB_fetch_row($resultpctabs); - if ($myrowpctabexpenses[0]>0 or $myrowpctabs[0]>0) { + $myrowPcTabs = DB_fetch_row($ResultPcTabs); + if ($myrowPcTabExpenses[0]>0 or $myrowPcTabs[0]>0) { prnMsg(_('Cannot delete this tab type because tabs have been created using this tab type'),'error'); echo '<br>'; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><div class="centre"><input type=submit name=return VALUE="' . _('Return to list of tab types') . '"></div>'; echo '</form>'; @@ -150,10 +153,10 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr> - <th>" . _('Type Of Tab') . "</th> - <th>" . _('Description') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Type Of Tab') . '</th> + <th>' . _('Description') . '</th> + </tr>'; $k=0; //row colour counter @@ -173,8 +176,8 @@ </tr>", $myrow['0'], $myrow['1'], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow['0'], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow['0']); + $_SERVER['PHP_SELF']. '?', $myrow['0'], + $_SERVER['PHP_SELF']. '?', $myrow['0']); } //END WHILE LIST LOOP echo '</table>'; @@ -183,11 +186,11 @@ //end of ifs and buts! if (isset($SelectedTab)) { - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Types Tabs Defined') . '</a></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Types Tabs Defined') . '</a></div><p>'; } if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table @@ -202,30 +205,30 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['typetabcode'] = $myrow['typetabcode']; - $_POST['typetabdescription'] = $myrow['typetabdescription']; + $_POST['TypeTabCode'] = $myrow['typetabcode']; + $_POST['TypeTabDescription'] = $myrow['typetabdescription']; echo "<input type=hidden name='SelectedTab' VALUE=" . $SelectedTab . ">"; - echo "<input type=hidden name='typetabcode' VALUE=" . $_POST['typetabcode']. ">"; + echo "<input type=hidden name='TypeTabCode' VALUE=" . $_POST['TypeTabCode']. ">"; echo "<table> <tr><td>" . _('Code Of Type Of Tab') . ":</td><td>"; // We dont allow the user to change an existing type code - echo $_POST['typetabcode'] . '</td></tr>'; + echo $_POST['TypeTabCode'] . '</td></tr>'; } else { // This is a new type so the user may volunteer a type code echo "<table class=selection><tr><td>" . _('Code Of Type Of Tab') . ":</td><td><input type='Text' - " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='typetabcode'></td></tr>"; + " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='TypeTabCode'></td></tr>"; } - if (!isset($_POST['typetabdescription'])) { - $_POST['typetabdescription']=''; + if (!isset($_POST['TypeTabDescription'])) { + $_POST['TypeTabDescription']=''; } - echo "<tr><td>" . _('Description Of Type of Tab') . ":</td><td><input type='Text' name='typetabdescription' size=50 maxlength=49 value='" . $_POST['typetabdescription'] . "'></td></tr>"; + echo "<tr><td>" . _('Description Of Type of Tab') . ":</td><td><input type='Text' name='TypeTabDescription' size=50 maxlength=49 value='" . $_POST['TypeTabDescription'] . "'></td></tr>"; echo '</td></tr></table>'; // close main table Deleted: trunk/companies/weberpdemo/logo.jpg =================================================================== (Binary files differ) Copied: trunk/companies/weberpdemo/logo.jpg (from rev 4516, trunk/companies/weberpdemo/logo2.jpg) =================================================================== (Binary files differ) Deleted: trunk/companies/weberpdemo/logo.png =================================================================== --- trunk/companies/weberpdemo/logo.png 2011-03-24 09:12:22 UTC (rev 4516) +++ trunk/companies/weberpdemo/logo.png 2011-03-26 03:33:53 UTC (rev 4517) @@ -1,678 +0,0 @@ -\x89PNG - - |
From: <dai...@us...> - 2011-03-26 03:34:04
|
Revision: 4517 http://web-erp.svn.sourceforge.net/web-erp/?rev=4517&view=rev Author: daintree Date: 2011-03-26 03:33:53 +0000 (Sat, 26 Mar 2011) Log Message: ----------- pre 4.03 release Modified Paths: -------------- trunk/PcExpenses.php trunk/PcExpensesTypeTab.php trunk/PcTypeTabs.php trunk/doc/Change.log.html trunk/doc/Manual/ManualContents.php trunk/includes/session.inc trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/upgrade3.11.1-4.00.sql trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Added Paths: ----------- trunk/companies/weberpdemo/logo.jpg Removed Paths: ------------- trunk/companies/weberpdemo/logo.jpg trunk/companies/weberpdemo/logo.png trunk/companies/weberpdemo/logo1.jpg trunk/companies/weberpdemo/logo2.jpg trunk/companies/weberpdemo/logo4.jpg trunk/companies/weberpdemo/logo5.jpg trunk/companies/weberpdemo/logo6.jpg trunk/companies/weberpdemo/logo7.jpg Modified: trunk/PcExpenses.php =================================================================== --- trunk/PcExpenses.php 2011-03-24 09:12:22 UTC (rev 4516) +++ trunk/PcExpenses.php 2011-03-26 03:33:53 UTC (rev 4517) @@ -35,19 +35,29 @@ if ($_POST['codeexpense']=='' OR $_POST['codeexpense']==' ' OR $_POST['codeexpense']==' ') { $InputError = 1; - prnMsg('<br>' . _('The Expense type code cannot be an empty string or spaces'),'error'); + prnMsg(_('The Expense type code cannot be an empty string or spaces'),'error'); $Errors[$i] = 'PcExpenses'; $i++; } elseif (strlen($_POST['codeexpense']) >20) { $InputError = 1; - echo prnMsg(_('The Expense code must be twenty characters or less long'),'error'); + prnMsg(_('The Expense code must be twenty characters or less long'),'error'); $Errors[$i] = 'PcExpenses'; $i++; - }elseif (strlen($_POST['description']) >50) { + }elseif (ContainsIllegalCharacters($_POST['codeexpense'])){ $InputError = 1; - echo prnMsg(_('The tab code must be Fifty characters or less long'),'error'); + prnMsg(_('The Expense code cannot contain any of the following characters " \' - &'),'error'); + $Errors[$i] = 'PcExpenses'; + $i++; + } elseif (ContainsIllegalCharacters($_POST['description'])){ + $InputError = 1; + prnMsg(_('The Expense description cannot contain any of the following characters " \' - &'),'error'); $Errors[$i] = 'TypeTabCode'; $i++; + } elseif (strlen($_POST['description']) >50) { + $InputError = 1; + prnMsg(_('The tab code must be Fifty characters or less long'),'error'); + $Errors[$i] = 'TypeTabCode'; + $i++; } if (isset($SelectedExpense) AND $InputError !=1) { @@ -71,7 +81,7 @@ if ( $checkrow[0] > 0 ) { $InputError = 1; - prnMsg( _('The Expense type ') . $_POST['codeexpense'] . _(' already exist.'),'error'); + prnMsg( _('The Expense type ') . $_POST['codeexpense'] . _(' already exists.'),'error'); } else { // Add new record on submit Modified: trunk/PcExpensesTypeTab.php =================================================================== --- trunk/PcExpensesTypeTab.php 2011-03-24 09:12:22 UTC (rev 4516) +++ trunk/PcExpensesTypeTab.php 2011-03-26 03:33:53 UTC (rev 4517) @@ -15,7 +15,10 @@ } elseif (isset($_GET['SelectedType'])){ $SelectedType = strtoupper($_GET['SelectedType']); } - +if (ContainsIllegalCharacters($SelectedType) OR strpos($SelectedType,' ')>0){ + $InputError = 1; + prnMsg(_('The petty cash tab type contain any of the following characters " \' - & or a space'),'error'); +} if (isset($_POST['SelectedTabs'])){ $SelectedTabs = strtoupper($_POST['SelectedTabs']); } elseif (isset($_GET['SelectedTabs'])){ @@ -162,8 +165,8 @@ </tr>", $myrow[0], $myrow[1], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow[0]); + $_SERVER['PHP_SELF'], $myrow[0], + $_SERVER['PHP_SELF'], $myrow[0]); } //END WHILE LIST LOOP echo '</table>'; @@ -173,7 +176,7 @@ if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class=selection>'; //Main table Modified: trunk/PcTypeTabs.php =================================================================== --- trunk/PcTypeTabs.php 2011-03-24 09:12:22 UTC (rev 4516) +++ trunk/PcTypeTabs.php 2011-03-26 03:33:53 UTC (rev 4517) @@ -33,18 +33,21 @@ //first off validate inputs sensible $i=1; - if ($_POST['typetabcode']=='' OR $_POST['typetabcode']==' ' OR $_POST['typetabcode']==' ') { + if ($_POST['TypeTabCode']=='' OR $_POST['TypeTabCode']==' ' OR $_POST['TypeTabCode']==' ') { $InputError = 1; prnMsg('<br>' . _('The Tabs type code cannot be an empty string or spaces'),'error'); $Errors[$i] = 'TypeTabCode'; $i++; - } elseif (strlen($_POST['typetabcode']) >20) { + } elseif (strlen($_POST['TypeTabCode']) >20) { $InputError = 1; echo prnMsg(_('The tab code must be twenty characters or less long'),'error'); $Errors[$i] = 'TypeTabCode'; $i++; - }elseif (strlen($_POST['typetabdescription']) >50) { + }elseif (ContainsIllegalCharacters($_POST['TypeTabCode']) OR strpos($_POST['TypeTabCode'],' ')>0){ $InputError = 1; + prnMsg(_('The petty cash tab type code cannot contain any of the following characters " \' - & or a space'),'error'); + } elseif (strlen($_POST['TypeTabDescription']) >50) { + $InputError = 1; echo prnMsg(_('The tab code must be Fifty characters or less long'),'error'); $Errors[$i] = 'TypeTabCode'; $i++; @@ -53,7 +56,7 @@ if (isset($SelectedTab) AND $InputError !=1) { $sql = "UPDATE pctypetabs - SET typetabdescription = '" . $_POST['typetabdescription'] . "' + SET typetabdescription = '" . $_POST['TypeTabDescription'] . "' WHERE typetabcode = '".$SelectedTab."'"; $msg = _('The Tabs type') . ' ' . $SelectedTab . ' ' . _('has been updated'); @@ -63,7 +66,7 @@ $checkSql = "SELECT count(*) FROM pctypetabs - WHERE typetabcode = '" . $_POST['typetabcode'] . "'"; + WHERE typetabcode = '" . $_POST['TypeTabCode'] . "'"; $checkresult = DB_query($checkSql,$db); $checkrow = DB_fetch_row($checkresult); @@ -78,10 +81,10 @@ $sql = "INSERT INTO pctypetabs (typetabcode, typetabdescription) - VALUES ('" . $_POST['typetabcode'] . "', - '" . $_POST['typetabdescription'] . "')"; + VALUES ('" . $_POST['TypeTabCode'] . "', + '" . $_POST['TypeTabDescription'] . "')"; - $msg = _('Tabs type') . ' ' . $_POST["typetabcode"] . ' ' . _('has been created'); + $msg = _('Tabs type') . ' ' . $_POST['TypeTabCode'] . ' ' . _('has been created'); } } @@ -92,35 +95,35 @@ prnMsg($msg,'success'); unset($SelectedTab); - unset($_POST['typetabcode']); - unset($_POST['typetabdescription']); + unset($_POST['TypeTabCode']); + unset($_POST['TypeTabDescription']); } } elseif ( isset($_GET['delete']) ) { // PREVENT DELETES IF DEPENDENT RECORDS IN 'PcTabExpenses' - $sqlpctabexpenses= "SELECT COUNT(*) + $SQLPcTabExpenses= "SELECT COUNT(*) FROM pctabexpenses WHERE typetabcode='".$SelectedTab."'"; $ErrMsg = _('The number of tabs using this Tab type could not be retrieved'); - $resultpctabexpenses = DB_query($sqlpctabexpenses,$db,$ErrMsg); + $ResultPcTabExpenses = DB_query($SQLPcTabExpenses,$db,$ErrMsg); - $myrowpctabexpenses = DB_fetch_row($resultpctabexpenses); + $myrowPcTabExpenses = DB_fetch_row($ResultPcTabExpenses); - $sqlpctabs= "SELECT COUNT(*) + $SqlPcTabs= "SELECT COUNT(*) FROM pctabs WHERE typetabcode='".$SelectedTab."'"; $ErrMsg = _('The number of tabs using this Tab type could not be retrieved'); - $resultpctabs = DB_query($sqlpctabs,$db,$ErrMsg); + $ResultPcTabs = DB_query($SqlPcTabs,$db,$ErrMsg); - $myrowpctabs = DB_fetch_row($resultpctabs); - if ($myrowpctabexpenses[0]>0 or $myrowpctabs[0]>0) { + $myrowPcTabs = DB_fetch_row($ResultPcTabs); + if ($myrowPcTabExpenses[0]>0 or $myrowPcTabs[0]>0) { prnMsg(_('Cannot delete this tab type because tabs have been created using this tab type'),'error'); echo '<br>'; - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo '<form method="post" action="' . $_SERVER['PHP_SELF'] . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><div class="centre"><input type=submit name=return VALUE="' . _('Return to list of tab types') . '"></div>'; echo '</form>'; @@ -150,10 +153,10 @@ $result = DB_query($sql,$db); echo '<table class=selection>'; - echo "<tr> - <th>" . _('Type Of Tab') . "</th> - <th>" . _('Description') . "</th> - </tr>"; + echo '<tr> + <th>' . _('Type Of Tab') . '</th> + <th>' . _('Description') . '</th> + </tr>'; $k=0; //row colour counter @@ -173,8 +176,8 @@ </tr>", $myrow['0'], $myrow['1'], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow['0'], - $_SERVER['PHP_SELF'] . '?' . SID, $myrow['0']); + $_SERVER['PHP_SELF']. '?', $myrow['0'], + $_SERVER['PHP_SELF']. '?', $myrow['0']); } //END WHILE LIST LOOP echo '</table>'; @@ -183,11 +186,11 @@ //end of ifs and buts! if (isset($SelectedTab)) { - echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . '">' . _('Show All Types Tabs Defined') . '</a></div><p>'; + echo '<p><div class="centre"><a href="' . $_SERVER['PHP_SELF'] . '">' . _('Show All Types Tabs Defined') . '</a></div><p>'; } if (! isset($_GET['delete'])) { - echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '?' . SID . '>'; + echo "<form method='post' action=" . $_SERVER['PHP_SELF'] . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p><table class=selection>'; //Main table @@ -202,30 +205,30 @@ $result = DB_query($sql, $db); $myrow = DB_fetch_array($result); - $_POST['typetabcode'] = $myrow['typetabcode']; - $_POST['typetabdescription'] = $myrow['typetabdescription']; + $_POST['TypeTabCode'] = $myrow['typetabcode']; + $_POST['TypeTabDescription'] = $myrow['typetabdescription']; echo "<input type=hidden name='SelectedTab' VALUE=" . $SelectedTab . ">"; - echo "<input type=hidden name='typetabcode' VALUE=" . $_POST['typetabcode']. ">"; + echo "<input type=hidden name='TypeTabCode' VALUE=" . $_POST['TypeTabCode']. ">"; echo "<table> <tr><td>" . _('Code Of Type Of Tab') . ":</td><td>"; // We dont allow the user to change an existing type code - echo $_POST['typetabcode'] . '</td></tr>'; + echo $_POST['TypeTabCode'] . '</td></tr>'; } else { // This is a new type so the user may volunteer a type code echo "<table class=selection><tr><td>" . _('Code Of Type Of Tab') . ":</td><td><input type='Text' - " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='typetabcode'></td></tr>"; + " . (in_array('TypeTabCode',$Errors) ? 'class="inputerror"' : '' ) ." name='TypeTabCode'></td></tr>"; } - if (!isset($_POST['typetabdescription'])) { - $_POST['typetabdescription']=''; + if (!isset($_POST['TypeTabDescription'])) { + $_POST['TypeTabDescription']=''; } - echo "<tr><td>" . _('Description Of Type of Tab') . ":</td><td><input type='Text' name='typetabdescription' size=50 maxlength=49 value='" . $_POST['typetabdescription'] . "'></td></tr>"; + echo "<tr><td>" . _('Description Of Type of Tab') . ":</td><td><input type='Text' name='TypeTabDescription' size=50 maxlength=49 value='" . $_POST['TypeTabDescription'] . "'></td></tr>"; echo '</td></tr></table>'; // close main table Deleted: trunk/companies/weberpdemo/logo.jpg =================================================================== (Binary files differ) Copied: trunk/companies/weberpdemo/logo.jpg (from rev 4516, trunk/companies/weberpdemo/logo2.jpg) =================================================================== (Binary files differ) Deleted: trunk/companies/weberpdemo/logo.png =================================================================== --- trunk/companies/weberpdemo/logo.png 2011-03-24 09:12:22 UTC (rev 4516) +++ trunk/companies/weberpdemo/logo.png 2011-03-26 03:33:53 UTC (rev 4517) @@ -1,678 +0,0 @@ -\x89PNG - - |
From: <dai...@us...> - 2011-03-26 22:11:54
|
Revision: 4518 http://web-erp.svn.sourceforge.net/web-erp/?rev=4518&view=rev Author: daintree Date: 2011-03-26 22:11:47 +0000 (Sat, 26 Mar 2011) Log Message: ----------- SQL ansi fixes - remove typo resulting in visible <td> in WorkOrderIssue.php Modified Paths: -------------- trunk/MRP.php trunk/WorkOrderIssue.php trunk/doc/Change.log.html trunk/doc/README.txt trunk/includes/ConnectDB.inc trunk/includes/ConnectDB_mysqli.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/MRP.php 2011-03-26 22:11:47 UTC (rev 4518) @@ -25,14 +25,14 @@ $result = DB_query('DROP TABLE IF EXISTS levels',$db); $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + sortpart text) DEFAULT CHARSET=utf8'; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); $sql = 'CREATE TEMPORARY TABLE tempbom (parent char(20), - component char(20), - sortpart text, - level int) DEFAULT CHARSET=utf8'; + component char(20), + sortpart text, + level int) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // To create levels, first, find parts in bom that are top level assemblies. // Do this by doing a LEFT JOIN from bom to bom (as bom2), linking @@ -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; @@ -132,32 +132,32 @@ flush(); // Create levels from bomlevels using the highest level number found for a part - $sql = 'CREATE TABLE levels ( + $sql = "CREATE TABLE levels ( part char(20), level int, - leadtime smallint(6) NOT NULL default "0", - pansize double NOT NULL default "0", - shrinkfactor double NOT NULL default "0", - eoq double NOT NULL default "0") DEFAULT CHARSET=utf8'; + leadtime smallint(6) NOT NULL default '0', + pansize double NOT NULL default '0', + shrinkfactor double NOT NULL default '0', + eoq double NOT NULL default '0') DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); $sql = 'INSERT INTO levels (part, - level, - leadtime, - pansize, - shrinkfactor, - eoq) - SELECT bomlevels.part, - MAX(bomlevels.level), - 0, - pansize, - shrinkfactor, - stockmaster.eoq - FROM bomlevels - INNER JOIN stockmaster ON bomlevels.part = stockmaster.stockid - GROUP BY bomlevels.part, - pansize, - shrinkfactor, - stockmaster.eoq'; + level, + leadtime, + pansize, + shrinkfactor, + eoq) + SELECT bomlevels.part, + MAX(bomlevels.level), + 0, + pansize, + shrinkfactor, + stockmaster.eoq + FROM bomlevels + INNER JOIN stockmaster ON bomlevels.part = stockmaster.stockid + GROUP BY bomlevels.part, + pansize, + shrinkfactor, + stockmaster.eoq'; $result = DB_query($sql,$db); $sql = 'ALTER TABLE levels ADD INDEX part(part)'; $result = DB_query($sql,$db); @@ -166,26 +166,26 @@ // are not in bom $sql = 'INSERT INTO levels (part, - level, - leadtime, - pansize, - shrinkfactor, - eoq) - SELECT stockmaster.stockid AS part, - 0, - 0, - stockmaster.pansize, - stockmaster.shrinkfactor, - stockmaster.eoq - FROM stockmaster - LEFT JOIN levels ON stockmaster.stockid = levels.part - WHERE levels.part IS NULL'; + level, + leadtime, + pansize, + shrinkfactor, + eoq) + SELECT stockmaster.stockid AS part, + 0, + 0, + stockmaster.pansize, + stockmaster.shrinkfactor, + stockmaster.eoq + FROM stockmaster + LEFT JOIN levels ON stockmaster.stockid = levels.part + WHERE levels.part IS NULL'; $result = DB_query($sql,$db); // Update leadtime in levels from purchdata. Do it twice so can make sure leadtime from preferred // vendor is used $sql = 'UPDATE levels,purchdata - SET levels.leadtime = purchdata.leadtime + SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid AND purchdata.leadtime > 0'; $result = DB_query($sql,$db); @@ -220,99 +220,98 @@ // CreateLowerLevelRequirement() function. Mostly do this so can distinguish the type // of requirements for the MRPShortageReport so don't show double requirements. $sql = 'CREATE TABLE mrprequirements ( part char(20), - daterequired date, - quantity double, - mrpdemandtype varchar(6), - orderno int(11), - directdemand smallint, - whererequired char(20)) DEFAULT CHARSET=utf8'; + daterequired date, + quantity double, + mrpdemandtype varchar(6), + orderno int(11), + directdemand smallint, + whererequired char(20)) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of mrprequirements failed because')); prnMsg(_('Loading requirements from sales orders'),'info'); flush(); - $sql = 'INSERT INTO mrprequirements (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT stkcode, - deliverydate, - (quantity - qtyinvoiced) AS netqty, - "SO", - salesorderdetails.orderno, - "1", - stkcode - FROM salesorders, salesorderdetails - WHERE salesorders.orderno = salesorderdetails.orderno - AND (quantity - qtyinvoiced) > 0 - AND salesorderdetails.completed = 0 - AND salesorders.quotation = 0'; + $sql = "INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT stkcode, + deliverydate, + (quantity - qtyinvoiced) AS netqty, + 'SO', + salesorderdetails.orderno, + '1', + stkcode + FROM salesorders, salesorderdetails + WHERE salesorders.orderno = salesorderdetails.orderno + AND (quantity - qtyinvoiced) > 0 + AND salesorderdetails.completed = 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, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT worequirements.stockid, - workorders.requiredby, - qtypu*(woitems.qtyreqd - woitems.qtyrecd) AS netqty, - "WO", - woitems.wo, - "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'; + $sql = "INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT worequirements.stockid, + workorders.requiredby, + qtypu*(woitems.qtyreqd - woitems.qtyrecd) AS netqty, + 'WO', + woitems.wo, + '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"; $result = DB_query($sql,$db); - $sql = 'INSERT INTO mrprequirements (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT stockid, - duedate, - quantity, - mrpdemandtype, - demandid, - "1", - stockid - FROM mrpdemands'; + $sql = "INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT stockid, + duedate, + quantity, + mrpdemandtype, + demandid, + '1', + stockid + FROM mrpdemands"; if ($_POST['usemrpdemands'] == 'y') { $result = DB_query($sql,$db); prnMsg(_('Loading requirements based on mrpdemands'),'info'); flush(); } - $sql = 'INSERT INTO mrprequirements (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT stockid, - NOW(), - (reorderlevel - quantity) AS reordqty, - "REORD", - "1", - "1", - stockid - FROM locstock - WHERE reorderlevel > quantity'; + $sql = "INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT stockid, + NOW(), + (reorderlevel - quantity) AS reordqty, + 'REORD', + '1', + '1', + stockid + FROM locstock + WHERE reorderlevel > quantity"; $result = DB_query($sql,$db); prnMsg(_('Loading requirements based on reorder level'),'info'); flush(); @@ -327,40 +326,40 @@ // updateflag is set to 1 in UpdateSupplies if change date when matching requirements to // supplies. Actually only change update flag in the array created from mrpsupplies $sql = 'CREATE TABLE mrpsupplies ( 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'; + 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 mrpsupplies failed because')); prnMsg(_('Loading supplies from purchase orders'),'info'); flush(); - $sql = 'INSERT INTO mrpsupplies (id, - part, - duedate, - supplyquantity, - ordertype, - orderno, - mrpdate, - updateflag) - SELECT Null, - purchorderdetails.itemcode, - purchorderdetails.deliverydate, - (quantityord - quantityrecd) AS netqty, - "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'; + $sql = "INSERT INTO mrpsupplies (id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag) + SELECT Null, + purchorderdetails.itemcode, + purchorderdetails.deliverydate, + (quantityord - quantityrecd) AS netqty, + '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"; $result = DB_query($sql,$db); prnMsg(_('Loading supplies from inventory on hand'),'info'); @@ -382,49 +381,49 @@ } // End of foreach $WhereLocation .= ')'; } - $sql = 'INSERT INTO mrpsupplies (id, - part, - duedate, - supplyquantity, - ordertype, - orderno, - mrpdate, - updateflag) - SELECT Null, - stockid, - "0000-00-00", - SUM(quantity), - "QOH", - 1, - "0000-00-00", - 0 - FROM locstock - WHERE quantity > 0 ' . - $WhereLocation . - 'GROUP BY stockid'; + $sql = "INSERT INTO mrpsupplies (id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag) + SELECT Null, + stockid, + '0000-00-00', + SUM(quantity), + 'QOH', + 1, + '0000-00-00', + 0 + FROM locstock + WHERE quantity > 0 " . + $WhereLocation . + 'GROUP BY stockid'; $result = DB_query($sql,$db); prnMsg(_('Loading supplies from work orders'),'info'); flush(); - $sql = 'INSERT INTO mrpsupplies (id, - part, - duedate, - supplyquantity, - ordertype, - orderno, - mrpdate, - updateflag) - SELECT Null, - stockid, - workorders.requiredby, - (woitems.qtyreqd-woitems.qtyrecd) AS netqty, - "WO", - woitems.wo, - workorders.requiredby, - 0 - FROM woitems INNER JOIN workorders - ON woitems.wo=workorders.wo - WHERE workorders.closed=0'; + $sql = "INSERT INTO mrpsupplies (id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag) + SELECT Null, + stockid, + workorders.requiredby, + (woitems.qtyreqd-woitems.qtyrecd) AS netqty, + 'WO', + woitems.wo, + workorders.requiredby, + 0 + FROM woitems INNER JOIN workorders + ON woitems.wo=workorders.wo + WHERE workorders.closed=0"; $result = DB_query($sql,$db); $sql = 'ALTER TABLE mrpsupplies ADD INDEX part(part)'; @@ -462,7 +461,7 @@ // part, that serves as a gross requirement for a lower level part, so will read down through // the Bill of Materials to generate those requirements in function LevelNetting(). for ($level = $maxlevel; $level >= $minlevel; $level--) { - $sql = 'SELECT * FROM levels WHERE level = "' . $level .'" LIMIT 50000'; //should cover most eventualities!! ... yes indeed :-) + $sql = "SELECT * FROM levels WHERE level = '" . $level ."' LIMIT 50000"; //should cover most eventualities!! ... yes indeed :-) prnMsg('</br>------ ' . _('Processing level') .' ' . $level . ' ------','info'); flush(); @@ -497,19 +496,19 @@ } // End of if } // End of foreach $sql = "INSERT INTO mrpparameters (runtime, - location, - pansizeflag, - shrinkageflag, - eoqflag, - usemrpdemands, - leeway) - VALUES (NOW(), - '" . $locparm . "', - '" . $_POST['pansizeflag'] . "', - '" . $_POST['shrinkageflag'] . "', - '" . $_POST['eoqflag'] . "', - '" . $_POST['usemrpdemands'] . "', - '" . $_POST['Leeway'] . "')"; + location, + pansizeflag, + shrinkageflag, + eoqflag, + usemrpdemands, + leeway) + VALUES (NOW(), + '" . $locparm . "', + '" . $_POST['pansizeflag'] . "', + '" . $_POST['shrinkageflag'] . "', + '" . $_POST['eoqflag'] . "', + '" . $_POST['usemrpdemands'] . "', + '" . $_POST['Leeway'] . "')"; $result = DB_query($sql,$db); } else { // End of if submit isset @@ -556,7 +555,7 @@ } echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<td><table class=selection>'; + echo '<table class=selection>'; // Generate selections for Location echo '<tr><th colspan=3><font color=blue size=3>'._('This Run Details').'</font></th></tr>'; echo '<tr> @@ -804,7 +803,7 @@ $newdate = FormatDateForSQL($dateadd); } - $component = $myrow['component']; + $component = $myrow['component']; $extendedquantity = $myrow['quantity'] * $topquantity; // Commented out the following lines 8/15/09 because the eoq should be considered in the // LevelNetting() function where $excessqty is calculated Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/WorkOrderIssue.php 2011-03-26 22:11:47 UTC (rev 4518) @@ -556,8 +556,8 @@ echo '</select>'; } else { $LocResult = DB_query("SELECT loccode, locationname - FROM locations - WHERE loccode='" . $_POST['FromLocation'] . "'", + FROM locations + WHERE loccode='" . $_POST['FromLocation'] . "'", $db); $LocRow = DB_fetch_array($LocResult); echo '<input type="hidden" name="FromLocation" value="' . $_POST['FromLocation'] . '">'; @@ -615,10 +615,10 @@ echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo "<option selected VALUE='All'>" . _('All'); + echo "<option selected VALUE='All'>" . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo "<option VALUE='All'>" . _('All'); + echo "<option VALUE='All'>" . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { @@ -636,7 +636,7 @@ <td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> <tr><td></td> <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size=15 maxlength=18 VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><input type="Text" name="StockCode" size="15" maxlength="18" VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> </tr> </table> <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> @@ -767,13 +767,13 @@ <td><input type="textbox" name="Qty' . $i .'"></td></tr>'; } echo '<input type="hidden" name="IssueItem" value="' . $_POST['IssueItem'] . '">'; - echo '<tr><td colspan=2><div class=centre><input type=submit name="Process" value="' . _('Process Items Issued') . '"><</div>/td></tr>'; + echo '<tr><td colspan=2><div class=centre><input type=submit name="Process" value="' . _('Process Items Issued') . '"></div></td></tr>'; } //end of lot/batch control } else { //not controlled - an easy one! echo '<input type="hidden" name="IssueItem" value="' . $_POST['IssueItem'] . '">'; echo '<tr><td>' . _('Quantity Issued') . ':</td> <td><input class=number type="textbox" name="Qty"></tr>'; - echo '<tr><td colspan=2><div class=centre><input type=submit name="Process" value="' . _('Process Items Issued') . '"></div></td></tr>'; + echo '<tr><td colspan=2><input type=submit name="Process" value="' . _('Process Items Issued') . '"></div></td></tr>'; } } //end if selecting new item to issue or entering the issued item quantities echo '</table>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/doc/Change.log.html 2011-03-26 22:11:47 UTC (rev 4518) @@ -20,7 +20,7 @@ <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>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-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> Modified: trunk/doc/README.txt =================================================================== --- trunk/doc/README.txt 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/doc/README.txt 2011-03-26 22:11:47 UTC (rev 4518) @@ -2,8 +2,28 @@ /* $Id$*/ -Thankyou for using webERP. +Version 4.03 of webERP +Now fully utf-8 compatible. Now reports can be created in any language using the utf-8 character set, the resultant pdf reports use Adobe CID fonts and the fonts that come with the Adobe Acrobat reader on client computers. This avoids the problem of large pdf downloads on the creation of reports as the alternative is to bundle the enormous utf-8 fonts with the reports. + +Also, this release comes with an automated database upgrade system, so that database changes in later versions will be applied automatically on upgrade of the scripts. + +Other than the re-engineering of pdf reporting using the TCPDF pdf report creation class, that has enabled the utf-8 pdf reporting, the other new areas of functionality since the 3 series include: + +1. Fixed assets module, this allows the recording of fixed asset additions, depreciation calculations on a monthly basis and disposals all integrated with the sale/debtors system with appropriate general ledger journals also created. + +2. Contract Costing functionality that allows contracts to be defined and the costs recorded against the contract. Contracts can be created using items from stock and also other items that might be required to be purchased that are not currently stock items. Contracts can be converted to quotations and from a quotation to a sales order/sale. The final variances on contracts are recorded and a final costing comparison report available. + +3. Significant work has also been done in conjunction with Secunia, the software security testing people, who have scruitinised webERP for security vulnerabilities. Their findings were useful in identifying scripts that needed to be changed. All identified weaknesses have now been removed. + +4. Prices can now be set for a period - with start and end date, to allow for promotional periods where the price should revert back and can be set ahead of time. + +5. Counter Sales functionality to allow sales to be processed to a default cash sales account and receipt of cash processed at the same time. This avoids having to enter a sales order, confirm the dispatch to invoice, the also entering the receipt as separate process and effectively enables a kind of point of sale system for each inventory location. + +6. A significant push has been made to try to reduce the number of bugs, with a great deal of testing from all quarters. + +The change log shows descriptions and dates of all changes made. + 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. Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/includes/ConnectDB.inc 2011-03-26 22:11:47 UTC (rev 4518) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.4'; //must update manually every time there is a DB change +$Version='4.03.5'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/includes/ConnectDB_mysqli.inc 2011-03-26 22:11:47 UTC (rev 4518) @@ -14,19 +14,13 @@ } global $db; // Make sure it IS global, regardless of our context $db = mysqli_connect($host , $dbuser, $dbpassword,$_SESSION['DatabaseName'], $mysqlport); +$result=DB_query('SET sql_mode = ANSI', $db); -//printf("tried making mysql-i Connection.\n"); -//$varabc = mysqli_client_encoding($db); -//printf("client encoding is %s\n", $varabc); //this statement sets the charset to be used for sending data to and from the db server //if not set, both mysqli server and mysqli client/library may assume otherwise mysqli_set_charset($db, "utf8"); -//$varabc = mysqli_client_encoding($db); -//printf("client encoding is %s\n", $varabc); - - /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); @@ -78,7 +72,6 @@ $result=mysql_query($SQL,$Conn); */ - $result=mysqli_query($Conn, $SQL); $_SESSION['LastInsertId'] = mysqli_insert_id($Conn); Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-26 22:11:47 UTC (rev 4518) @@ -834,5 +834,5 @@ ALTER TABLE locations ADD cashsalebranch varchar(10) DEFAULT ''; ALTER TABLE `locations` CHANGE `cashsalecustomer` `cashsalecustomer` VARCHAR( 10 ) DEFAULT ''; UPDATE config SET confvalue='4.03.3' WHERE confname='VersionNumber'; -INSERT INTO `weberpdemo`.`scripts` (`script`, `pagesecurity`, `description`) VALUES ('Z_ChangeSupplierCode.php', '15', 'Script to change a supplier code accross all tables necessary'); -UPDATE config SET confvalue='4.03.4' WHERE confname='VersionNumber'; \ No newline at end of file +INSERT INTO `scripts` (`script`, `pagesecurity`, `description`) VALUES ('Z_ChangeSupplierCode.php', '15', 'Script to change a supplier code accross all tables necessary'); +UPDATE config SET confvalue='4.03.5' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-26 22:11:54
|
Revision: 4518 http://web-erp.svn.sourceforge.net/web-erp/?rev=4518&view=rev Author: daintree Date: 2011-03-26 22:11:47 +0000 (Sat, 26 Mar 2011) Log Message: ----------- SQL ansi fixes - remove typo resulting in visible <td> in WorkOrderIssue.php Modified Paths: -------------- trunk/MRP.php trunk/WorkOrderIssue.php trunk/doc/Change.log.html trunk/doc/README.txt trunk/includes/ConnectDB.inc trunk/includes/ConnectDB_mysqli.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Modified: trunk/MRP.php =================================================================== --- trunk/MRP.php 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/MRP.php 2011-03-26 22:11:47 UTC (rev 4518) @@ -25,14 +25,14 @@ $result = DB_query('DROP TABLE IF EXISTS levels',$db); $sql = 'CREATE TEMPORARY TABLE passbom (part char(20), - sortpart text) DEFAULT CHARSET=utf8'; + sortpart text) DEFAULT CHARSET=utf8'; $ErrMsg = _('The SQL to to create passbom failed with the message'); $result = DB_query($sql,$db,$ErrMsg); $sql = 'CREATE TEMPORARY TABLE tempbom (parent char(20), - component char(20), - sortpart text, - level int) DEFAULT CHARSET=utf8'; + component char(20), + sortpart text, + level int) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of tempbom failed because')); // To create levels, first, find parts in bom that are top level assemblies. // Do this by doing a LEFT JOIN from bom to bom (as bom2), linking @@ -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; @@ -132,32 +132,32 @@ flush(); // Create levels from bomlevels using the highest level number found for a part - $sql = 'CREATE TABLE levels ( + $sql = "CREATE TABLE levels ( part char(20), level int, - leadtime smallint(6) NOT NULL default "0", - pansize double NOT NULL default "0", - shrinkfactor double NOT NULL default "0", - eoq double NOT NULL default "0") DEFAULT CHARSET=utf8'; + leadtime smallint(6) NOT NULL default '0', + pansize double NOT NULL default '0', + shrinkfactor double NOT NULL default '0', + eoq double NOT NULL default '0') DEFAULT CHARSET=utf8"; $result = DB_query($sql,$db); $sql = 'INSERT INTO levels (part, - level, - leadtime, - pansize, - shrinkfactor, - eoq) - SELECT bomlevels.part, - MAX(bomlevels.level), - 0, - pansize, - shrinkfactor, - stockmaster.eoq - FROM bomlevels - INNER JOIN stockmaster ON bomlevels.part = stockmaster.stockid - GROUP BY bomlevels.part, - pansize, - shrinkfactor, - stockmaster.eoq'; + level, + leadtime, + pansize, + shrinkfactor, + eoq) + SELECT bomlevels.part, + MAX(bomlevels.level), + 0, + pansize, + shrinkfactor, + stockmaster.eoq + FROM bomlevels + INNER JOIN stockmaster ON bomlevels.part = stockmaster.stockid + GROUP BY bomlevels.part, + pansize, + shrinkfactor, + stockmaster.eoq'; $result = DB_query($sql,$db); $sql = 'ALTER TABLE levels ADD INDEX part(part)'; $result = DB_query($sql,$db); @@ -166,26 +166,26 @@ // are not in bom $sql = 'INSERT INTO levels (part, - level, - leadtime, - pansize, - shrinkfactor, - eoq) - SELECT stockmaster.stockid AS part, - 0, - 0, - stockmaster.pansize, - stockmaster.shrinkfactor, - stockmaster.eoq - FROM stockmaster - LEFT JOIN levels ON stockmaster.stockid = levels.part - WHERE levels.part IS NULL'; + level, + leadtime, + pansize, + shrinkfactor, + eoq) + SELECT stockmaster.stockid AS part, + 0, + 0, + stockmaster.pansize, + stockmaster.shrinkfactor, + stockmaster.eoq + FROM stockmaster + LEFT JOIN levels ON stockmaster.stockid = levels.part + WHERE levels.part IS NULL'; $result = DB_query($sql,$db); // Update leadtime in levels from purchdata. Do it twice so can make sure leadtime from preferred // vendor is used $sql = 'UPDATE levels,purchdata - SET levels.leadtime = purchdata.leadtime + SET levels.leadtime = purchdata.leadtime WHERE levels.part = purchdata.stockid AND purchdata.leadtime > 0'; $result = DB_query($sql,$db); @@ -220,99 +220,98 @@ // CreateLowerLevelRequirement() function. Mostly do this so can distinguish the type // of requirements for the MRPShortageReport so don't show double requirements. $sql = 'CREATE TABLE mrprequirements ( part char(20), - daterequired date, - quantity double, - mrpdemandtype varchar(6), - orderno int(11), - directdemand smallint, - whererequired char(20)) DEFAULT CHARSET=utf8'; + daterequired date, + quantity double, + mrpdemandtype varchar(6), + orderno int(11), + directdemand smallint, + whererequired char(20)) DEFAULT CHARSET=utf8'; $result = DB_query($sql,$db,_('Create of mrprequirements failed because')); prnMsg(_('Loading requirements from sales orders'),'info'); flush(); - $sql = 'INSERT INTO mrprequirements (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT stkcode, - deliverydate, - (quantity - qtyinvoiced) AS netqty, - "SO", - salesorderdetails.orderno, - "1", - stkcode - FROM salesorders, salesorderdetails - WHERE salesorders.orderno = salesorderdetails.orderno - AND (quantity - qtyinvoiced) > 0 - AND salesorderdetails.completed = 0 - AND salesorders.quotation = 0'; + $sql = "INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT stkcode, + deliverydate, + (quantity - qtyinvoiced) AS netqty, + 'SO', + salesorderdetails.orderno, + '1', + stkcode + FROM salesorders, salesorderdetails + WHERE salesorders.orderno = salesorderdetails.orderno + AND (quantity - qtyinvoiced) > 0 + AND salesorderdetails.completed = 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, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT worequirements.stockid, - workorders.requiredby, - qtypu*(woitems.qtyreqd - woitems.qtyrecd) AS netqty, - "WO", - woitems.wo, - "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'; + $sql = "INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT worequirements.stockid, + workorders.requiredby, + qtypu*(woitems.qtyreqd - woitems.qtyrecd) AS netqty, + 'WO', + woitems.wo, + '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"; $result = DB_query($sql,$db); - $sql = 'INSERT INTO mrprequirements (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT stockid, - duedate, - quantity, - mrpdemandtype, - demandid, - "1", - stockid - FROM mrpdemands'; + $sql = "INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT stockid, + duedate, + quantity, + mrpdemandtype, + demandid, + '1', + stockid + FROM mrpdemands"; if ($_POST['usemrpdemands'] == 'y') { $result = DB_query($sql,$db); prnMsg(_('Loading requirements based on mrpdemands'),'info'); flush(); } - $sql = 'INSERT INTO mrprequirements (part, - daterequired, - quantity, - mrpdemandtype, - orderno, - directdemand, - whererequired) - SELECT stockid, - NOW(), - (reorderlevel - quantity) AS reordqty, - "REORD", - "1", - "1", - stockid - FROM locstock - WHERE reorderlevel > quantity'; + $sql = "INSERT INTO mrprequirements (part, + daterequired, + quantity, + mrpdemandtype, + orderno, + directdemand, + whererequired) + SELECT stockid, + NOW(), + (reorderlevel - quantity) AS reordqty, + 'REORD', + '1', + '1', + stockid + FROM locstock + WHERE reorderlevel > quantity"; $result = DB_query($sql,$db); prnMsg(_('Loading requirements based on reorder level'),'info'); flush(); @@ -327,40 +326,40 @@ // updateflag is set to 1 in UpdateSupplies if change date when matching requirements to // supplies. Actually only change update flag in the array created from mrpsupplies $sql = 'CREATE TABLE mrpsupplies ( 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'; + 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 mrpsupplies failed because')); prnMsg(_('Loading supplies from purchase orders'),'info'); flush(); - $sql = 'INSERT INTO mrpsupplies (id, - part, - duedate, - supplyquantity, - ordertype, - orderno, - mrpdate, - updateflag) - SELECT Null, - purchorderdetails.itemcode, - purchorderdetails.deliverydate, - (quantityord - quantityrecd) AS netqty, - "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'; + $sql = "INSERT INTO mrpsupplies (id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag) + SELECT Null, + purchorderdetails.itemcode, + purchorderdetails.deliverydate, + (quantityord - quantityrecd) AS netqty, + '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"; $result = DB_query($sql,$db); prnMsg(_('Loading supplies from inventory on hand'),'info'); @@ -382,49 +381,49 @@ } // End of foreach $WhereLocation .= ')'; } - $sql = 'INSERT INTO mrpsupplies (id, - part, - duedate, - supplyquantity, - ordertype, - orderno, - mrpdate, - updateflag) - SELECT Null, - stockid, - "0000-00-00", - SUM(quantity), - "QOH", - 1, - "0000-00-00", - 0 - FROM locstock - WHERE quantity > 0 ' . - $WhereLocation . - 'GROUP BY stockid'; + $sql = "INSERT INTO mrpsupplies (id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag) + SELECT Null, + stockid, + '0000-00-00', + SUM(quantity), + 'QOH', + 1, + '0000-00-00', + 0 + FROM locstock + WHERE quantity > 0 " . + $WhereLocation . + 'GROUP BY stockid'; $result = DB_query($sql,$db); prnMsg(_('Loading supplies from work orders'),'info'); flush(); - $sql = 'INSERT INTO mrpsupplies (id, - part, - duedate, - supplyquantity, - ordertype, - orderno, - mrpdate, - updateflag) - SELECT Null, - stockid, - workorders.requiredby, - (woitems.qtyreqd-woitems.qtyrecd) AS netqty, - "WO", - woitems.wo, - workorders.requiredby, - 0 - FROM woitems INNER JOIN workorders - ON woitems.wo=workorders.wo - WHERE workorders.closed=0'; + $sql = "INSERT INTO mrpsupplies (id, + part, + duedate, + supplyquantity, + ordertype, + orderno, + mrpdate, + updateflag) + SELECT Null, + stockid, + workorders.requiredby, + (woitems.qtyreqd-woitems.qtyrecd) AS netqty, + 'WO', + woitems.wo, + workorders.requiredby, + 0 + FROM woitems INNER JOIN workorders + ON woitems.wo=workorders.wo + WHERE workorders.closed=0"; $result = DB_query($sql,$db); $sql = 'ALTER TABLE mrpsupplies ADD INDEX part(part)'; @@ -462,7 +461,7 @@ // part, that serves as a gross requirement for a lower level part, so will read down through // the Bill of Materials to generate those requirements in function LevelNetting(). for ($level = $maxlevel; $level >= $minlevel; $level--) { - $sql = 'SELECT * FROM levels WHERE level = "' . $level .'" LIMIT 50000'; //should cover most eventualities!! ... yes indeed :-) + $sql = "SELECT * FROM levels WHERE level = '" . $level ."' LIMIT 50000"; //should cover most eventualities!! ... yes indeed :-) prnMsg('</br>------ ' . _('Processing level') .' ' . $level . ' ------','info'); flush(); @@ -497,19 +496,19 @@ } // End of if } // End of foreach $sql = "INSERT INTO mrpparameters (runtime, - location, - pansizeflag, - shrinkageflag, - eoqflag, - usemrpdemands, - leeway) - VALUES (NOW(), - '" . $locparm . "', - '" . $_POST['pansizeflag'] . "', - '" . $_POST['shrinkageflag'] . "', - '" . $_POST['eoqflag'] . "', - '" . $_POST['usemrpdemands'] . "', - '" . $_POST['Leeway'] . "')"; + location, + pansizeflag, + shrinkageflag, + eoqflag, + usemrpdemands, + leeway) + VALUES (NOW(), + '" . $locparm . "', + '" . $_POST['pansizeflag'] . "', + '" . $_POST['shrinkageflag'] . "', + '" . $_POST['eoqflag'] . "', + '" . $_POST['usemrpdemands'] . "', + '" . $_POST['Leeway'] . "')"; $result = DB_query($sql,$db); } else { // End of if submit isset @@ -556,7 +555,7 @@ } echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<td><table class=selection>'; + echo '<table class=selection>'; // Generate selections for Location echo '<tr><th colspan=3><font color=blue size=3>'._('This Run Details').'</font></th></tr>'; echo '<tr> @@ -804,7 +803,7 @@ $newdate = FormatDateForSQL($dateadd); } - $component = $myrow['component']; + $component = $myrow['component']; $extendedquantity = $myrow['quantity'] * $topquantity; // Commented out the following lines 8/15/09 because the eoq should be considered in the // LevelNetting() function where $excessqty is calculated Modified: trunk/WorkOrderIssue.php =================================================================== --- trunk/WorkOrderIssue.php 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/WorkOrderIssue.php 2011-03-26 22:11:47 UTC (rev 4518) @@ -556,8 +556,8 @@ echo '</select>'; } else { $LocResult = DB_query("SELECT loccode, locationname - FROM locations - WHERE loccode='" . $_POST['FromLocation'] . "'", + FROM locations + WHERE loccode='" . $_POST['FromLocation'] . "'", $db); $LocRow = DB_fetch_array($LocResult); echo '<input type="hidden" name="FromLocation" value="' . $_POST['FromLocation'] . '">'; @@ -615,10 +615,10 @@ echo '<table class=selection><tr><td>' . _('Select a stock category') . ':<select name="StockCat">'; if (!isset($_POST['StockCat'])){ - echo "<option selected VALUE='All'>" . _('All'); + echo "<option selected VALUE='All'>" . _('All') . '</option>'; $_POST['StockCat'] ='All'; } else { - echo "<option VALUE='All'>" . _('All'); + echo "<option VALUE='All'>" . _('All') . '</option>'; } while ($myrow1 = DB_fetch_array($result1)) { @@ -636,7 +636,7 @@ <td><input type="Text" name="Keywords" size=20 maxlength=25 VALUE="<?php if (isset($_POST['Keywords'])) echo $_POST['Keywords']; ?>"></td></tr> <tr><td></td> <td><font SIZE 3><b><?php echo _('OR'); ?> </b></font><?php echo _('Enter extract of the'); ?> <b><?php echo _('Stock Code'); ?></b>:</td> - <td><input type="Text" name="StockCode" size=15 maxlength=18 VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> + <td><input type="Text" name="StockCode" size="15" maxlength="18" VALUE="<?php if (isset($_POST['StockCode'])) echo $_POST['StockCode']; ?>"></td> </tr> </table> <br /><div class="centre"><input type=submit name="Search" VALUE="<?php echo _('Search Now'); ?>"> @@ -767,13 +767,13 @@ <td><input type="textbox" name="Qty' . $i .'"></td></tr>'; } echo '<input type="hidden" name="IssueItem" value="' . $_POST['IssueItem'] . '">'; - echo '<tr><td colspan=2><div class=centre><input type=submit name="Process" value="' . _('Process Items Issued') . '"><</div>/td></tr>'; + echo '<tr><td colspan=2><div class=centre><input type=submit name="Process" value="' . _('Process Items Issued') . '"></div></td></tr>'; } //end of lot/batch control } else { //not controlled - an easy one! echo '<input type="hidden" name="IssueItem" value="' . $_POST['IssueItem'] . '">'; echo '<tr><td>' . _('Quantity Issued') . ':</td> <td><input class=number type="textbox" name="Qty"></tr>'; - echo '<tr><td colspan=2><div class=centre><input type=submit name="Process" value="' . _('Process Items Issued') . '"></div></td></tr>'; + echo '<tr><td colspan=2><input type=submit name="Process" value="' . _('Process Items Issued') . '"></div></td></tr>'; } } //end if selecting new item to issue or entering the issued item quantities echo '</table>'; Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/doc/Change.log.html 2011-03-26 22:11:47 UTC (rev 4518) @@ -20,7 +20,7 @@ <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>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-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> Modified: trunk/doc/README.txt =================================================================== --- trunk/doc/README.txt 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/doc/README.txt 2011-03-26 22:11:47 UTC (rev 4518) @@ -2,8 +2,28 @@ /* $Id$*/ -Thankyou for using webERP. +Version 4.03 of webERP +Now fully utf-8 compatible. Now reports can be created in any language using the utf-8 character set, the resultant pdf reports use Adobe CID fonts and the fonts that come with the Adobe Acrobat reader on client computers. This avoids the problem of large pdf downloads on the creation of reports as the alternative is to bundle the enormous utf-8 fonts with the reports. + +Also, this release comes with an automated database upgrade system, so that database changes in later versions will be applied automatically on upgrade of the scripts. + +Other than the re-engineering of pdf reporting using the TCPDF pdf report creation class, that has enabled the utf-8 pdf reporting, the other new areas of functionality since the 3 series include: + +1. Fixed assets module, this allows the recording of fixed asset additions, depreciation calculations on a monthly basis and disposals all integrated with the sale/debtors system with appropriate general ledger journals also created. + +2. Contract Costing functionality that allows contracts to be defined and the costs recorded against the contract. Contracts can be created using items from stock and also other items that might be required to be purchased that are not currently stock items. Contracts can be converted to quotations and from a quotation to a sales order/sale. The final variances on contracts are recorded and a final costing comparison report available. + +3. Significant work has also been done in conjunction with Secunia, the software security testing people, who have scruitinised webERP for security vulnerabilities. Their findings were useful in identifying scripts that needed to be changed. All identified weaknesses have now been removed. + +4. Prices can now be set for a period - with start and end date, to allow for promotional periods where the price should revert back and can be set ahead of time. + +5. Counter Sales functionality to allow sales to be processed to a default cash sales account and receipt of cash processed at the same time. This avoids having to enter a sales order, confirm the dispatch to invoice, the also entering the receipt as separate process and effectively enables a kind of point of sale system for each inventory location. + +6. A significant push has been made to try to reduce the number of bugs, with a great deal of testing from all quarters. + +The change log shows descriptions and dates of all changes made. + 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. Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/includes/ConnectDB.inc 2011-03-26 22:11:47 UTC (rev 4518) @@ -4,7 +4,7 @@ * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run * if VersionNumber is < $Version then the DB update script is run */ -$Version='4.03.4'; //must update manually every time there is a DB change +$Version='4.03.5'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/includes/ConnectDB_mysqli.inc 2011-03-26 22:11:47 UTC (rev 4518) @@ -14,19 +14,13 @@ } global $db; // Make sure it IS global, regardless of our context $db = mysqli_connect($host , $dbuser, $dbpassword,$_SESSION['DatabaseName'], $mysqlport); +$result=DB_query('SET sql_mode = ANSI', $db); -//printf("tried making mysql-i Connection.\n"); -//$varabc = mysqli_client_encoding($db); -//printf("client encoding is %s\n", $varabc); //this statement sets the charset to be used for sending data to and from the db server //if not set, both mysqli server and mysqli client/library may assume otherwise mysqli_set_charset($db, "utf8"); -//$varabc = mysqli_client_encoding($db); -//printf("client encoding is %s\n", $varabc); - - /* check connection */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); @@ -78,7 +72,6 @@ $result=mysql_query($SQL,$Conn); */ - $result=mysqli_query($Conn, $SQL); $_SESSION['LastInsertId'] = mysqli_insert_id($Conn); Modified: trunk/sql/mysql/upgrade3.11.1-4.00.sql =================================================================== --- trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-26 03:33:53 UTC (rev 4517) +++ trunk/sql/mysql/upgrade3.11.1-4.00.sql 2011-03-26 22:11:47 UTC (rev 4518) @@ -834,5 +834,5 @@ ALTER TABLE locations ADD cashsalebranch varchar(10) DEFAULT ''; ALTER TABLE `locations` CHANGE `cashsalecustomer` `cashsalecustomer` VARCHAR( 10 ) DEFAULT ''; UPDATE config SET confvalue='4.03.3' WHERE confname='VersionNumber'; -INSERT INTO `weberpdemo`.`scripts` (`script`, `pagesecurity`, `description`) VALUES ('Z_ChangeSupplierCode.php', '15', 'Script to change a supplier code accross all tables necessary'); -UPDATE config SET confvalue='4.03.4' WHERE confname='VersionNumber'; \ No newline at end of file +INSERT INTO `scripts` (`script`, `pagesecurity`, `description`) VALUES ('Z_ChangeSupplierCode.php', '15', 'Script to change a supplier code accross all tables necessary'); +UPDATE config SET confvalue='4.03.5' WHERE confname='VersionNumber'; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-03-27 01:50:41
|
Revision: 4519 http://web-erp.svn.sourceforge.net/web-erp/?rev=4519&view=rev Author: daintree Date: 2011-03-27 01:50:33 +0000 (Sun, 27 Mar 2011) Log Message: ----------- purchasing mods Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/doc/Change.log.html trunk/includes/DefinePOClass.php Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-03-26 22:11:47 UTC (rev 4518) +++ trunk/PO_Header.php 2011-03-27 01:50:33 UTC (rev 4519) @@ -66,9 +66,9 @@ } elseif ($_SESSION['PO'.$identifier]->Status !=$_POST['Status']) { //the old status != new status $OKToUpdateStatus = 1; $AuthSQL ="SELECT authlevel - FROM purchorderauth - WHERE userid='".$_SESSION['UserID']."' - AND currabrev='".$_SESSION['PO'.$identifier]->CurrCode."'"; + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$_SESSION['PO'.$identifier]->CurrCode."'"; $AuthResult=DB_query($AuthSQL,$db); $myrow=DB_fetch_array($AuthResult); @@ -148,10 +148,10 @@ $AllowPrint=0; } $SQL = "UPDATE purchorders SET status='" . $_POST['Status']. "', - stat_comment='" . $_SESSION['PO'.$identifier]->StatusComments ."', - allowprint='".$AllowPrint."' - WHERE purchorders.orderno ='" . $_SESSION['ExistingOrder'] ."'"; - + stat_comment='" . $_SESSION['PO'.$identifier]->StatusComments ."', + allowprint='".$AllowPrint."' + WHERE purchorders.orderno ='" . $_SESSION['ExistingOrder'] ."'"; + $ErrMsg = _('The order status could not be updated because'); $UpdateResult=DB_query($SQL,$db,$ErrMsg); } @@ -230,16 +230,16 @@ $_POST['RePrint'] = 0; } - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?' . SID . 'identifier='.$identifier. "'>"; + echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; echo '<p>'; prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - "<a href='$rootpath/PO_Items.php?" . SID. 'identifier='.$identifier . "'>" . _('click here') . '</a> ' . _('to continue'),'info'); + '<a href="' . $rootpath . '/PO_Items.php?identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'),'info'); include('includes/footer.inc'); exit; } /* end of if isset _POST'EnterLines' */ -echo '<span style="float:left"><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . "identifier=".$identifier.'">'. _('Back to Purchase Orders'). '</a></span>'; +echo '<span style="float:left"><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?identifier='.$identifier.'">'. _('Back to Purchase Orders'). '</a></span>'; /*The page can be called with ModifyOrderNumber=x where x is a purchase * order number. The page then looks up the details of order x and allows @@ -303,31 +303,31 @@ $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT suppliers.supplierid, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.currcode - FROM suppliers - WHERE suppliers.suppname LIKE '". $SearchString ."' - ORDER BY suppliers.suppname"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.currcode + FROM suppliers + WHERE suppliers.suppname LIKE '". $SearchString ."' + ORDER BY suppliers.suppname"; } elseif (strlen($_POST['SuppCode'])>0){ $SQL = "SELECT suppliers.supplierid, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.currcode - FROM suppliers - WHERE suppliers.supplierid LIKE '%" . $_POST['SuppCode'] . "%' - ORDER BY suppliers.supplierid"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.currcode + FROM suppliers + WHERE suppliers.supplierid LIKE '%" . $_POST['SuppCode'] . "%' + ORDER BY suppliers.supplierid"; } $ErrMsg = _('The searched supplier records requested cannot be retrieved because'); @@ -376,20 +376,20 @@ */ $sql = "SELECT suppliers.suppname, - suppliers.currcode, - currencies.rate, - suppliers.paymentterms, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.telephone, - suppliers.port - FROM suppliers INNER JOIN currencies - ON suppliers.currcode=currencies.currabrev - WHERE supplierid='" . $_POST['Select'] . "'"; + suppliers.currcode, + currencies.rate, + suppliers.paymentterms, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.telephone, + suppliers.port + FROM suppliers INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE supplierid='" . $_POST['Select'] . "'"; $ErrMsg = _('The supplier record of the supplier selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); @@ -399,9 +399,9 @@ // added for suppliers lookup fields $AuthSql="SELECT cancreate - FROM purchorderauth - WHERE userid='". $_SESSION['UserID'] . "' - AND currabrev='". $myrow['currcode'] . "'"; + FROM purchorderauth + WHERE userid='". $_SESSION['UserID'] . "' + AND currabrev='". $myrow['currcode'] . "'"; $AuthResult=DB_query($AuthSql,$db); @@ -444,20 +444,20 @@ } else { $_POST['Select'] = $_SESSION['PO'.$identifier]->SupplierID; $sql = "SELECT suppliers.suppname, - suppliers.currcode, - suppliers.paymentterms, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.telephone, - suppliers.port - FROM suppliers INNER JOIN currencies - ON suppliers.currcode=currencies.currabrev - WHERE supplierid='" . $_POST['Select'] . "'"; - + suppliers.currcode, + suppliers.paymentterms, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.telephone, + suppliers.port + FROM suppliers INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE supplierid='" . $_POST['Select'] . "'"; + $ErrMsg = _('The supplier record of the supplier selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the supplier details and failed was'); @@ -528,11 +528,11 @@ echo '<br><table cellpadding=3 colspan=7 class=selection>'; $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Supplier Name') . '</th> - <th>' . _('Address') . '</th> - <th>' . _('Currency') . '</th> - </tr>'; + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Address') . '</th> + <th>' . _('Currency') . '</th> + </tr>'; echo $tableheader; @@ -576,9 +576,9 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt=""> - ' . $_SESSION['PO'.$identifier]->SupplierName . ' - ' . _('All amounts stated in') . ' - ' . $_SESSION['PO'.$identifier]->CurrCode . '<br />'; + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt=""> + ' . $_SESSION['PO'.$identifier]->SupplierName . ' - ' . _('All amounts stated in') . ' + ' . $_SESSION['PO'.$identifier]->CurrCode . '<br />'; if ($_SESSION['ExistingOrder']) { echo _(' Modify Purchase Order Number') . ' ' . $_SESSION['PO'.$identifier]->OrderNo; @@ -603,15 +603,15 @@ } $sql="SELECT stockmaster.controlled, - stockmaster.serialised, - stockmaster.description, - stockmaster.units , - stockmaster.decimalplaces, - purchdata.price, - purchdata.suppliersuom, - purchdata.suppliers_partno, - purchdata.conversionfactor, - stockcategory.stockact + stockmaster.serialised, + stockmaster.description, + stockmaster.units , + stockmaster.decimalplaces, + purchdata.price, + purchdata.suppliersuom, + purchdata.suppliers_partno, + purchdata.conversionfactor, + stockcategory.stockact FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid LEFT JOIN purchdata @@ -626,36 +626,36 @@ } $_SESSION['PO'.$identifier]->add_to_order( 1, - $Purch_Item, - $PurchItemRow['serialised'], - $PurchItemRow['controlled'], - $Qty, - $PurchItemRow['description'], - $PurchItemRow['price'], - $PurchItemRow['units'], - $PurchItemRow['stockact'], - date($_SESSION['DefaultDateFormat']), - 0, - 0, - '', - 0, - 0, - '', - $PurchItemRow['decimalplaces'], - $Purch_Item, - $PurchItemRow['suppliersuom'], - $PurchItemRow['conversionfactor'], - $PurchItemRow['suppliers_partno'], - $Qty*$PurchItemRow['price'], - '', - 0, - 0, - 0, - 0, - $Qty, - $Qty*$PurchItemRow['price']); + $Purch_Item, + $PurchItemRow['serialised'], + $PurchItemRow['controlled'], + $Qty, + $PurchItemRow['description'], + $PurchItemRow['price'], + $PurchItemRow['units'], + $PurchItemRow['stockact'], + date($_SESSION['DefaultDateFormat']), + 0, + 0, + '', + 0, + 0, + '', + $PurchItemRow['decimalplaces'], + $Purch_Item, + $PurchItemRow['suppliersuom'], + $PurchItemRow['conversionfactor'], + $PurchItemRow['suppliers_partno'], + $Qty*$PurchItemRow['price'], + '', + 0, + 0, + 0, + 0, + $Qty, + $Qty*$PurchItemRow['price']); - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?' . SID . 'identifier='.$identifier. "'>"; + echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; } /*Set up form for entry of order header stuff */ @@ -733,10 +733,6 @@ echo '<tr><td>' . _('Requisition Ref') . ':</td> <td><input type="text" name="Requisition" size="16" maxlength="15" value="' . $_POST['Requisition'] . '" /></td></tr>'; -// echo '<tr><td>' . _('Exchange Rate') . ":</td> -// <td><input type=TEXT name='ExRate' size=16 maxlength=15 VALUE=" . $_POST['ExRate'] . '></td> -// echo "<input type='hidden' name='ExRate' size=16 maxlength=15 value=" . $_POST['ExRate'] . "></td>"; -// </tr>'; echo '<tr><td>' . _('Date Printed') . ':</td><td>'; if (isset($_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted) AND strlen($_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted)>6){ echo ConvertSQLDate($_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted); @@ -780,29 +776,31 @@ switch ($_SESSION['PO'.$identifier]->Status) { case 'Pending': echo '<option selected value="Pending">' . _('Pending') . '</option> - <option value="Authorised">' . _('Authorised') . '</option> - <option value="Rejected">' . _('Rejected') . '</option>'; + <option value="Authorised">' . _('Authorised') . '</option> + <option value="Rejected">' . _('Rejected') . '</option>'; break; case 'Authorised': echo '<option value="Pending">' . _('Pending') . '</option> - <option selected value="Authorised">' . _('Authorised') . '</option>'; + <option selected value="Authorised">' . _('Authorised') . '</option> + <option value="Cancelled">' . _('Cancelled') . '</option>'; break; case 'Printed': echo '<option value="Pending">' . _('Pending') . '</option> - <option selected value="Printed">' . _('Printed') . '</option>'; + <option selected value="Printed">' . _('Printed') . '</option> + <option value="Cancelled">' . _('Cancelled') . '</option>'; break; case 'Completed': echo '<option selected value="Completed">' . _('Completed') . '</option>'; break; case 'Rejected': echo '<option selected value="Rejected">' . _('Rejected') . '</option> - <option value="Pending">' . _('Pending') . '</option> - <option value="Authorised">' . _('Authorised') . '</option>'; + <option value="Pending">' . _('Pending') . '</option> + <option value="Authorised">' . _('Authorised') . '</option>'; break; case 'Cancelled': echo '<option selected value="Cancelled">' . _('Cancelled') . '</option> - <option value="Authorised">' . _('Authorised') . '</option> - <option value="Pending">' . _('Pending') . '</option>'; + <option value="Authorised">' . _('Authorised') . '</option> + <option value="Pending">' . _('Pending') . '</option>'; break; } @@ -856,15 +854,15 @@ $_POST['StkLocation'] = $_SESSION['UserStockLocation']; $sql = "SELECT deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - contact - FROM locations - WHERE loccode='" . $_POST['StkLocation'] . "'"; + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; $LocnAddrResult = DB_query($sql,$db); if (DB_num_rows($LocnAddrResult)==1){ @@ -899,15 +897,15 @@ } elseif (isset($_POST['LookupDeliveryAddress'])){ $sql = "SELECT deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - contact - FROM locations - WHERE loccode='" . $_POST['StkLocation'] . "'"; + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; $LocnAddrResult = DB_query($sql,$db); if (DB_num_rows($LocnAddrResult)==1){ @@ -992,9 +990,9 @@ echo '<input type="submit" name="SearchSuppliers" value=' . _('Select Now') . '"></td></tr>'; echo '</td></tr><tr><td>' . _('Supplier Contact') . ':</td><td> - <select name=SupplierContact>'; + <select name="SupplierContact">'; - $sql = 'SELECT contact FROM suppliercontacts WHERE supplierid="' . $_POST['Select'] .'"'; + $sql = "SELECT contact FROM suppliercontacts WHERE supplierid='" . $_POST['Select'] ."'"; $SuppCoResult = DB_query($sql,$db); while ( $SuppCoRow=DB_fetch_array($SuppCoResult)){ @@ -1043,7 +1041,9 @@ DB_data_seek($result, 0); echo '</select></td></tr>'; - $result=DB_query('SELECT loccode, locationname FROM locations WHERE loccode="' . $_SESSION['PO'.$identifier]->Port.'"', $db); + $result=DB_query("SELECT loccode, + locationname + FROM locations WHERE loccode='" . $_SESSION['PO'.$identifier]->Port."'", $db); $myrow = DB_fetch_array($result); $_POST['Port'] = $myrow['locationname']; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-03-26 22:11:47 UTC (rev 4518) +++ trunk/PO_Items.php 2011-03-27 01:50:33 UTC (rev 4519) @@ -2,8 +2,6 @@ /* $Id PO_Items.php 4183 2010-12-14 09:30:20Z daintree $ */ -//$PageSecurity = 4; Now retrieved from database - include('includes/DefinePOClass.php'); include('includes/SQL_CommonFunctions.inc'); @@ -73,7 +71,7 @@ prnMsg( _('The purchase order can not be committed to the database because there are no lines entered on this order'),'error'); $InputError=1; } - + /*If all clear then proceed to update the database */ if ($InputError!=1){ @@ -103,7 +101,7 @@ 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 />'; + $AuthMessage = _('You can only authorise up to').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthRow['authlevel'] .'.<br />'; } prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. @@ -131,71 +129,71 @@ /*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 . "' - )"; - + 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); @@ -204,50 +202,50 @@ 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 . "')"; + 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'); @@ -262,35 +260,35 @@ /*Update the purchase order header with any changes */ $sql = "UPDATE purchorders SET supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' , - comments='" . $_SESSION['PO'.$identifier]->Comments . "', - rate='" . $_SESSION['PO'.$identifier]->ExRate . "', - initiator='" . $_SESSION['PO'.$identifier]->Initiator . "', - requisitionno= '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', - version= '" . $_SESSION['PO'.$identifier]->Version . "', - deliveryby='" . $_SESSION['PO'.$identifier]->DeliveryBy . "', - deliverydate='" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', - revised= '" . Date('Y-m-d') . "', - intostocklocation='" . $_SESSION['PO'.$identifier]->Location . "', - deladd1='" . $_SESSION['PO'.$identifier]->DelAdd1 . "', - deladd2='" . $_SESSION['PO'.$identifier]->DelAdd2 . "', - deladd3='" . $_SESSION['PO'.$identifier]->DelAdd3 . "', - deladd4='" . $_SESSION['PO'.$identifier]->DelAdd4 . "', - deladd5='" . $_SESSION['PO'.$identifier]->DelAdd5 . "', - deladd6='" . $_SESSION['PO'.$identifier]->DelAdd6 . "', - deladd6='" . $_SESSION['PO'.$identifier]->Tel . "', - suppdeladdress1='" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', - suppdeladdress2='" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', - suppdeladdress3='" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', - suppdeladdress4='" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', - suppdeladdress5='" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', - suppdeladdress6='" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', - suppliercontact='" . $_SESSION['PO'.$identifier]->SupplierContact . "', - supptel='" . $_SESSION['PO'.$identifier]->SuppTel . "', - contact='" . $_SESSION['PO'.$identifier]->Contact . "', - paymentterms='" . $_SESSION['PO'.$identifier]->PaymentTerms . "', - allowprint='" . $_SESSION['PO'.$identifier]->AllowPrintPO . "', - status = '" . $_SESSION['PO'.$identifier]->Status . "' - WHERE orderno = '" . $_SESSION['PO'.$identifier]->OrderNo ."'"; + comments='" . $_SESSION['PO'.$identifier]->Comments . "', + rate='" . $_SESSION['PO'.$identifier]->ExRate . "', + initiator='" . $_SESSION['PO'.$identifier]->Initiator . "', + requisitionno= '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', + version= '" . $_SESSION['PO'.$identifier]->Version . "', + deliveryby='" . $_SESSION['PO'.$identifier]->DeliveryBy . "', + deliverydate='" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', + revised= '" . Date('Y-m-d') . "', + intostocklocation='" . $_SESSION['PO'.$identifier]->Location . "', + deladd1='" . $_SESSION['PO'.$identifier]->DelAdd1 . "', + deladd2='" . $_SESSION['PO'.$identifier]->DelAdd2 . "', + deladd3='" . $_SESSION['PO'.$identifier]->DelAdd3 . "', + deladd4='" . $_SESSION['PO'.$identifier]->DelAdd4 . "', + deladd5='" . $_SESSION['PO'.$identifier]->DelAdd5 . "', + deladd6='" . $_SESSION['PO'.$identifier]->DelAdd6 . "', + deladd6='" . $_SESSION['PO'.$identifier]->Tel . "', + suppdeladdress1='" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', + suppdeladdress2='" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', + suppdeladdress3='" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', + suppdeladdress4='" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', + suppdeladdress5='" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', + suppdeladdress6='" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', + suppliercontact='" . $_SESSION['PO'.$identifier]->SupplierContact . "', + supptel='" . $_SESSION['PO'.$identifier]->SuppTel . "', + contact='" . $_SESSION['PO'.$identifier]->Contact . "', + paymentterms='" . $_SESSION['PO'.$identifier]->PaymentTerms . "', + allowprint='" . $_SESSION['PO'.$identifier]->AllowPrintPO . "', + status = '" . $_SESSION['PO'.$identifier]->Status . "' + WHERE orderno = '" . $_SESSION['PO'.$identifier]->OrderNo ."'"; $ErrMsg = _('The purchase order could not be updated because'); $DbgMsg = _('The SQL statement used to update the purchase order header record, that failed was'); @@ -309,99 +307,99 @@ } else if ($POLine->PODetailRec=='') { $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 . "')"; + 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 . "')"; } else { if ($POLine->Quantity==$POLine->QtyReceived){ $sql = "UPDATE purchorderdetails SET itemcode='" . $POLine->StockID . "', - deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', - itemdescription='" . $POLine->ItemDescription . "', - glcode='" . $POLine->GLCode . "', - unitprice='" . $POLine->Price . "', - quantityord='" . $POLine->Quantity . "', - shiptref='" . $POLine->ShiptRef . "', - jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', - suppliersunit='" . $POLine->SuppliersUnit . "', - suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', - completed=1, - assetid='" . $POLine->AssetID . "', - conversionfactor = '" . $POLine->ConversionFactor . "' - WHERE podetailitem='" . $POLine->PODetailRec . "'"; + deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', + itemdescription='" . $POLine->ItemDescription . "', + glcode='" . $POLine->GLCode . "', + unitprice='" . $POLine->Price . "', + quantityord='" . $POLine->Quantity . "', + shiptref='" . $POLine->ShiptRef . "', + jobref='" . $POLine->JobRef . "', + itemno='" . $POLine->ItemNo . "', + suppliersunit='" . $POLine->SuppliersUnit . "', + suppliers_partno='" . $POLine->Suppliers_PartNo . "', + subtotal_amount='" . $POLine->SubTotal_Amount . "', + package='" . $POLine->Package . "', + pcunit='" . $POLine->PcUnit . "', + netweight='" . $POLine->NetWeight . "', + kgs='" . $POLine->KGs . "', + cuft='" . $POLine->CuFt . "', + total_quantity='" . $POLine->Total_Quantity . "', + total_amount='" . $POLine->Total_Amount . "', + completed=1, + assetid='" . $POLine->AssetID . "', + conversionfactor = '" . $POLine->ConversionFactor . "' + WHERE podetailitem='" . $POLine->PODetailRec . "'"; } else { $sql = "UPDATE purchorderdetails SET itemcode='" . $POLine->StockID . "', - deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', - itemdescription='" . $POLine->ItemDescription . "', - glcode='" . $POLine->GLCode . "', - unitprice='" . $POLine->Price . "', - quantityord='" . $POLine->Quantity . "', - shiptref='" . $POLine->ShiptRef . "', - jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', - suppliersunit='" . $POLine->SuppliersUnit . "', - suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', - assetid='" . $POLine->AssetID . "', - conversionfactor = '" . $POLine->ConversionFactor . "' - WHERE podetailitem='" . $POLine->PODetailRec . "'"; + deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', + itemdescription='" . $POLine->ItemDescription . "', + glcode='" . $POLine->GLCode . "', + unitprice='" . $POLine->Price . "', + quantityord='" . $POLine->Quantity . "', + shiptref='" . $POLine->ShiptRef . "', + jobref='" . $POLine->JobRef . "', + itemno='" . $POLine->ItemNo . "', + suppliersunit='" . $POLine->SuppliersUnit . "', + suppliers_partno='" . $POLine->Suppliers_PartNo . "', + subtotal_amount='" . $POLine->SubTotal_Amount . "', + package='" . $POLine->Package . "', + pcunit='" . $POLine->PcUnit . "', + netweight='" . $POLine->NetWeight . "', + kgs='" . $POLine->KGs . "', + cuft='" . $POLine->CuFt . "', + total_quantity='" . $POLine->Total_Quantity . "', + total_amount='" . $POLine->Total_Amount . "', + assetid='" . $POLine->AssetID . "', + conversionfactor = '" . $POLine->ConversionFactor . "' + WHERE podetailitem='" . $POLine->PODetailRec . "'"; } } @@ -433,6 +431,7 @@ if(isset($_GET['Delete'])){ if($_SESSION['PO'.$identifier]->Some_Already_Received($_GET['Delete'])==0){ $_SESSION['PO'.$identifier]->LineItems[$_GET['Delete']]->Deleted=True; + $_SESSION['PO'.$identifier]->LinesOnOrder --; include ('includes/PO_UnsetFormVbls.php'); } else { prnMsg( _('This item cannot be deleted because some of it has already been received'),'warn'); @@ -442,8 +441,7 @@ if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ - - if (!is_numeric($_POST['Qty'])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])))){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the order item must be numeric'),'error'); } @@ -495,12 +493,12 @@ } if ($_POST['AssetID'] !='Not an Asset'){ $ValidAssetResult = DB_query("SELECT assetid, - description, - costact - FROM fixedassets - INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - WHERE assetid='" . $_POST['AssetID'] . "'",$db); + description, + costact + FROM fixedassets + INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + WHERE assetid='" . $_POST['AssetID'] . "'",$db); if (DB_num_rows($ValidAssetResult)==0){ // then the asset id entered doesn't exist $AllowUpdate = false; prnMsg(_('An asset code was entered but it does not yet exist. Only pre-existing asset ids can be entered when ordering a fixed asset'),'error'); @@ -526,36 +524,36 @@ $_POST['Qty'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])); $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, - '', - 0, /*Serialised */ - 0, /*Controlled */ - $_POST['Qty'], - $_POST['ItemDescription'], - $_POST['Price'], - $_POST['SuppliersUnit'], - $_POST['GLCode'], - $_POST['ReqDelDate'], - '', - 0, - '', - 0, - 0, - $GLAccountName, - 2, - '', - $_POST['SuppliersUnit'], - 1, - '', - '', - ($_POST['Qty']*$_POST['Price']), - '', - '', - '', - '', - '', - $_POST['Qty'], - ($_POST['Qty']*$_POST['Price']), - $_POST['AssetID']); + '', + 0, /*Serialised */ + 0, /*Controlled */ + $_POST['Qty'], + $_POST['ItemDescription'], + $_POST['Price'], + $_POST['SuppliersUnit'], + $_POST['GLCode'], + $_POST['ReqDelDate'], + '', + 0, + '', + 0, + 0, + $GLAccountName, + 2, + '', + $_POST['SuppliersUnit'], + 1, + '', + '', + ($_POST['Qty']*$_POST['Price']), + '', + '', + '', + '', + '', + $_POST['Qty'], + ($_POST['Qty']*$_POST['Price']), + $_POST['AssetID']); include ('includes/PO_UnsetFormVbls.php'); } } @@ -591,18 +589,18 @@ } if ($AlreadyOnThisOrder!=1 AND $Quantity > 0){ $sql = "SELECT description, - stockid, - units, - decimalplaces, - kgs, - netweight, - stockact, - accountname - FROM stockmaster INNER JOIN stockcategory - ON stockcategory.categoryid = stockmaster.categoryid - INNER JOIN chartmaster - ON chartmaster.accountcode = stockcategory.stockact - WHERE stockmaster.stockid = '". $ItemCode . "'"; + stockid, + units, + decimalplaces, + kgs, + netweight, + stockact, + accountname + FROM stockmaster INNER JOIN stockcategory + ON stockcategory.categoryid = stockmaster.categoryid + INNER JOIN chartmaster + ON chartmaster.accountcode = stockcategory.stockact + WHERE stockmaster.stockid = '". $ItemCode . "'"; $ErrMsg = _('The item details for') . ' ' . $ItemCode . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the item details but failed was'); @@ -611,26 +609,26 @@ $ItemRow = DB_fetch_array($ItemResult); $sql = "SELECT price, - conversionfactor, - supplierdescription, - suppliersuom, - unitname, - suppliers_partno, - leadtime, - MAX(purchdata.effectivefrom) AS latesteffectivefrom - FROM purchdata LEFT JOIN unitsofmeasure - ON purchdata.suppliersuom=unitsofmeasure.unitid - WHERE purchdata.supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' - AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' - AND purchdata.stockid = '". $ItemCode . "' - GROUP BY purchdata.price, - purchdata.conversionfactor, - purchdata.supplierdescription, - purchdata.suppliersuom, - unitsofmeasure.unitname, - purchdata.suppliers_partno, - purchdata.leadtime"; - + conversionfactor, + supplierdescription, + suppliersuom, + unitname, + suppliers_partno, + leadtime, + MAX(purchdata.effectivefrom) AS latesteffectivefrom + FROM purchdata LEFT JOIN unitsofmeasure + ON purchdata.suppliersuom=unitsofmeasure.unitid + WHERE purchdata.supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' + AND purchdata.stockid = '". $ItemCode . "' + GROUP BY purchdata.price, + purchdata.conversionfactor, + purchdata.supplierdescription, + purchdata.suppliersuom, + unitsofmeasure.unitname, + purchdata.suppliers_partno, + purchdata.leadtime"; + $ErrMsg = _('The purchasing data for') . ' ' . $ItemCode . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the purchasing data but failed was'); $PurchDataResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -652,35 +650,35 @@ } $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, - $ItemCode, - 0, /*Serialised */ - 0, /*Controlled */ - $Quantity*$ConversionFactor, /* Qty */ - $SupplierDescription, - $PurchPrice, - $ItemRow['units'], - $ItemRow['stockact'], - $_SESSION['PO'.$identifier]->DeliveryDate, - 0, - 0, - 0, - 0, - 0, - $Itemrow['accountname'], - $ItemRow['decimalplaces'], - $ItemCode, - $SuppliersUnitOfMeasure, - $ConversionFactor, - $LeadTime, - $SuppliersPartNo, - $Quantity*$PurchPrice, - '', - 0, - $ItemRow['netweight'], - $ItemRow['kgs'], - '', - $Quantity, - $Quantity*$PurchPrice ); + $ItemCode, + 0, /*Serialised */ + 0, /*Controlled */ + $Quantity*$ConversionFactor, /* Qty */ + $SupplierDescription, + $PurchPrice, + $ItemRow['units'], + $ItemRow['stockact'], + $_SESSION['PO'.$identifier]->DeliveryDate, + 0, + 0, + 0, + 0, + 0, + $Itemrow['accountname'], + $ItemRow['decimalplaces'], + $ItemCode, + $SuppliersUnitOfMeasure, + $ConversionFactor, + $LeadTime, + $SuppliersPartNo, + $Quantity*$PurchPrice, + '', + 0, + $ItemRow['netweight'], + $ItemRow['kgs'], + '', + $Quantity, + $Quantity*$PurchPrice ); } else { //no rows returned by the SQL to get the item prnMsg (_('The item code') . ' ' . $ItemCode . ' ' . _('does not exist in the database and therefore cannot be added to the order'),'error'); if ($debug==1){ @@ -832,45 +830,47 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - unitsofmeasure.unitname - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '" . $SearchString ."' - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + stockmaster.description, + stockmaster.units, + purchdata.conversionfactor, + unitsofmeasure.unitname + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + LEFT JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + LEFT JOIN unitsofmeasure + ON unitsofmeasure.unitid=purchdata.suppliersuom + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '" . $SearchString ."' + AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' + OR purchdata.supplierno IS NULL) + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - unitsofmeasure.unitname - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) - AND stockmaster.description " . LIKE . " '". $SearchString ."' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + stockmaster.description, + stockmaster.units, + purchdata.conversionfactor, + unitsofmeasure.unitname + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + LEFT JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + LEFT JOIN unitsofmeasure + ON unitsofmeasure.unitid=purchdata.suppliersuom + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' + OR purchdata.supplierno IS NULL) + AND stockmaster.description " . LIKE . " '". $SearchString ."' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } elseif ($_POST['StockCode']){ @@ -879,87 +879,91 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - unitsofmeasure.unitname - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + stockmaster.description, + stockmaster.units, + purchdata.conversionfactor, + unitsofmeasure.unitname + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + LEFT JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + LEFT JOIN unitsofmeasure + ON unitsofmeasure.unitid=purchdata.suppliersuom + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' + OR purchdata.supplierno IS NULL) + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - unitsofmeasure.unitname - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - and stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + stockmaster.description, + stockmaster.units, + purchdata.conversionfactor, + unitsofmeasure.unitname + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + LEFT JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + LEFT JOIN unitsofmeasure + ON unitsofmeasure.unitid=purchdata.suppliersuom + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + and stockmaster.discontinued<>1 + AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' + OR purchdata.supplierno IS NULL) + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } else { if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - unitsofmeasure.unitname - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) - ORDER BY stockmaster.stockid - LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + stockmaster.description, + stockmaster.units, + purchdata.conversionfactor, + unitsofmeasure.unitname + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + LEFT JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + LEFT JOIN unitsofmeasure + ON unitsofmeasure.unitid=purchdata.suppliersuom + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' + OR purchdata.supplierno IS NULL) + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRec... [truncated message content] |
From: <dai...@us...> - 2011-03-27 01:50:41
|
Revision: 4519 http://web-erp.svn.sourceforge.net/web-erp/?rev=4519&view=rev Author: daintree Date: 2011-03-27 01:50:33 +0000 (Sun, 27 Mar 2011) Log Message: ----------- purchasing mods Modified Paths: -------------- trunk/PO_Header.php trunk/PO_Items.php trunk/doc/Change.log.html trunk/includes/DefinePOClass.php Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2011-03-26 22:11:47 UTC (rev 4518) +++ trunk/PO_Header.php 2011-03-27 01:50:33 UTC (rev 4519) @@ -66,9 +66,9 @@ } elseif ($_SESSION['PO'.$identifier]->Status !=$_POST['Status']) { //the old status != new status $OKToUpdateStatus = 1; $AuthSQL ="SELECT authlevel - FROM purchorderauth - WHERE userid='".$_SESSION['UserID']."' - AND currabrev='".$_SESSION['PO'.$identifier]->CurrCode."'"; + FROM purchorderauth + WHERE userid='".$_SESSION['UserID']."' + AND currabrev='".$_SESSION['PO'.$identifier]->CurrCode."'"; $AuthResult=DB_query($AuthSQL,$db); $myrow=DB_fetch_array($AuthResult); @@ -148,10 +148,10 @@ $AllowPrint=0; } $SQL = "UPDATE purchorders SET status='" . $_POST['Status']. "', - stat_comment='" . $_SESSION['PO'.$identifier]->StatusComments ."', - allowprint='".$AllowPrint."' - WHERE purchorders.orderno ='" . $_SESSION['ExistingOrder'] ."'"; - + stat_comment='" . $_SESSION['PO'.$identifier]->StatusComments ."', + allowprint='".$AllowPrint."' + WHERE purchorders.orderno ='" . $_SESSION['ExistingOrder'] ."'"; + $ErrMsg = _('The order status could not be updated because'); $UpdateResult=DB_query($SQL,$db,$ErrMsg); } @@ -230,16 +230,16 @@ $_POST['RePrint'] = 0; } - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?' . SID . 'identifier='.$identifier. "'>"; + echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; echo '<p>'; prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' . - "<a href='$rootpath/PO_Items.php?" . SID. 'identifier='.$identifier . "'>" . _('click here') . '</a> ' . _('to continue'),'info'); + '<a href="' . $rootpath . '/PO_Items.php?identifier='.$identifier . '">' . _('click here') . '</a> ' . _('to continue'),'info'); include('includes/footer.inc'); exit; } /* end of if isset _POST'EnterLines' */ -echo '<span style="float:left"><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . "identifier=".$identifier.'">'. _('Back to Purchase Orders'). '</a></span>'; +echo '<span style="float:left"><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?identifier='.$identifier.'">'. _('Back to Purchase Orders'). '</a></span>'; /*The page can be called with ModifyOrderNumber=x where x is a purchase * order number. The page then looks up the details of order x and allows @@ -303,31 +303,31 @@ $SearchString = '%' . str_replace(' ', '%', $_POST['Keywords']) . '%'; $SQL = "SELECT suppliers.supplierid, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.currcode - FROM suppliers - WHERE suppliers.suppname LIKE '". $SearchString ."' - ORDER BY suppliers.suppname"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.currcode + FROM suppliers + WHERE suppliers.suppname LIKE '". $SearchString ."' + ORDER BY suppliers.suppname"; } elseif (strlen($_POST['SuppCode'])>0){ $SQL = "SELECT suppliers.supplierid, - suppliers.suppname, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.currcode - FROM suppliers - WHERE suppliers.supplierid LIKE '%" . $_POST['SuppCode'] . "%' - ORDER BY suppliers.supplierid"; + suppliers.suppname, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.currcode + FROM suppliers + WHERE suppliers.supplierid LIKE '%" . $_POST['SuppCode'] . "%' + ORDER BY suppliers.supplierid"; } $ErrMsg = _('The searched supplier records requested cannot be retrieved because'); @@ -376,20 +376,20 @@ */ $sql = "SELECT suppliers.suppname, - suppliers.currcode, - currencies.rate, - suppliers.paymentterms, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.telephone, - suppliers.port - FROM suppliers INNER JOIN currencies - ON suppliers.currcode=currencies.currabrev - WHERE supplierid='" . $_POST['Select'] . "'"; + suppliers.currcode, + currencies.rate, + suppliers.paymentterms, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.telephone, + suppliers.port + FROM suppliers INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE supplierid='" . $_POST['Select'] . "'"; $ErrMsg = _('The supplier record of the supplier selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); @@ -399,9 +399,9 @@ // added for suppliers lookup fields $AuthSql="SELECT cancreate - FROM purchorderauth - WHERE userid='". $_SESSION['UserID'] . "' - AND currabrev='". $myrow['currcode'] . "'"; + FROM purchorderauth + WHERE userid='". $_SESSION['UserID'] . "' + AND currabrev='". $myrow['currcode'] . "'"; $AuthResult=DB_query($AuthSql,$db); @@ -444,20 +444,20 @@ } else { $_POST['Select'] = $_SESSION['PO'.$identifier]->SupplierID; $sql = "SELECT suppliers.suppname, - suppliers.currcode, - suppliers.paymentterms, - suppliers.address1, - suppliers.address2, - suppliers.address3, - suppliers.address4, - suppliers.address5, - suppliers.address6, - suppliers.telephone, - suppliers.port - FROM suppliers INNER JOIN currencies - ON suppliers.currcode=currencies.currabrev - WHERE supplierid='" . $_POST['Select'] . "'"; - + suppliers.currcode, + suppliers.paymentterms, + suppliers.address1, + suppliers.address2, + suppliers.address3, + suppliers.address4, + suppliers.address5, + suppliers.address6, + suppliers.telephone, + suppliers.port + FROM suppliers INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE supplierid='" . $_POST['Select'] . "'"; + $ErrMsg = _('The supplier record of the supplier selected') . ': ' . $_POST['Select'] . ' ' . _('cannot be retrieved because'); $DbgMsg = _('The SQL used to retrieve the supplier details and failed was'); @@ -528,11 +528,11 @@ echo '<br><table cellpadding=3 colspan=7 class=selection>'; $tableheader = '<tr> - <th>' . _('Code') . '</th> - <th>' . _('Supplier Name') . '</th> - <th>' . _('Address') . '</th> - <th>' . _('Currency') . '</th> - </tr>'; + <th>' . _('Code') . '</th> + <th>' . _('Supplier Name') . '</th> + <th>' . _('Address') . '</th> + <th>' . _('Currency') . '</th> + </tr>'; echo $tableheader; @@ -576,9 +576,9 @@ echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<p class="page_title_text"> - <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt=""> - ' . $_SESSION['PO'.$identifier]->SupplierName . ' - ' . _('All amounts stated in') . ' - ' . $_SESSION['PO'.$identifier]->CurrCode . '<br />'; + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt=""> + ' . $_SESSION['PO'.$identifier]->SupplierName . ' - ' . _('All amounts stated in') . ' + ' . $_SESSION['PO'.$identifier]->CurrCode . '<br />'; if ($_SESSION['ExistingOrder']) { echo _(' Modify Purchase Order Number') . ' ' . $_SESSION['PO'.$identifier]->OrderNo; @@ -603,15 +603,15 @@ } $sql="SELECT stockmaster.controlled, - stockmaster.serialised, - stockmaster.description, - stockmaster.units , - stockmaster.decimalplaces, - purchdata.price, - purchdata.suppliersuom, - purchdata.suppliers_partno, - purchdata.conversionfactor, - stockcategory.stockact + stockmaster.serialised, + stockmaster.description, + stockmaster.units , + stockmaster.decimalplaces, + purchdata.price, + purchdata.suppliersuom, + purchdata.suppliers_partno, + purchdata.conversionfactor, + stockcategory.stockact FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid LEFT JOIN purchdata @@ -626,36 +626,36 @@ } $_SESSION['PO'.$identifier]->add_to_order( 1, - $Purch_Item, - $PurchItemRow['serialised'], - $PurchItemRow['controlled'], - $Qty, - $PurchItemRow['description'], - $PurchItemRow['price'], - $PurchItemRow['units'], - $PurchItemRow['stockact'], - date($_SESSION['DefaultDateFormat']), - 0, - 0, - '', - 0, - 0, - '', - $PurchItemRow['decimalplaces'], - $Purch_Item, - $PurchItemRow['suppliersuom'], - $PurchItemRow['conversionfactor'], - $PurchItemRow['suppliers_partno'], - $Qty*$PurchItemRow['price'], - '', - 0, - 0, - 0, - 0, - $Qty, - $Qty*$PurchItemRow['price']); + $Purch_Item, + $PurchItemRow['serialised'], + $PurchItemRow['controlled'], + $Qty, + $PurchItemRow['description'], + $PurchItemRow['price'], + $PurchItemRow['units'], + $PurchItemRow['stockact'], + date($_SESSION['DefaultDateFormat']), + 0, + 0, + '', + 0, + 0, + '', + $PurchItemRow['decimalplaces'], + $Purch_Item, + $PurchItemRow['suppliersuom'], + $PurchItemRow['conversionfactor'], + $PurchItemRow['suppliers_partno'], + $Qty*$PurchItemRow['price'], + '', + 0, + 0, + 0, + 0, + $Qty, + $Qty*$PurchItemRow['price']); - echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?' . SID . 'identifier='.$identifier. "'>"; + echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>"; } /*Set up form for entry of order header stuff */ @@ -733,10 +733,6 @@ echo '<tr><td>' . _('Requisition Ref') . ':</td> <td><input type="text" name="Requisition" size="16" maxlength="15" value="' . $_POST['Requisition'] . '" /></td></tr>'; -// echo '<tr><td>' . _('Exchange Rate') . ":</td> -// <td><input type=TEXT name='ExRate' size=16 maxlength=15 VALUE=" . $_POST['ExRate'] . '></td> -// echo "<input type='hidden' name='ExRate' size=16 maxlength=15 value=" . $_POST['ExRate'] . "></td>"; -// </tr>'; echo '<tr><td>' . _('Date Printed') . ':</td><td>'; if (isset($_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted) AND strlen($_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted)>6){ echo ConvertSQLDate($_SESSION['PO'.$identifier]->DatePurchaseOrderPrinted); @@ -780,29 +776,31 @@ switch ($_SESSION['PO'.$identifier]->Status) { case 'Pending': echo '<option selected value="Pending">' . _('Pending') . '</option> - <option value="Authorised">' . _('Authorised') . '</option> - <option value="Rejected">' . _('Rejected') . '</option>'; + <option value="Authorised">' . _('Authorised') . '</option> + <option value="Rejected">' . _('Rejected') . '</option>'; break; case 'Authorised': echo '<option value="Pending">' . _('Pending') . '</option> - <option selected value="Authorised">' . _('Authorised') . '</option>'; + <option selected value="Authorised">' . _('Authorised') . '</option> + <option value="Cancelled">' . _('Cancelled') . '</option>'; break; case 'Printed': echo '<option value="Pending">' . _('Pending') . '</option> - <option selected value="Printed">' . _('Printed') . '</option>'; + <option selected value="Printed">' . _('Printed') . '</option> + <option value="Cancelled">' . _('Cancelled') . '</option>'; break; case 'Completed': echo '<option selected value="Completed">' . _('Completed') . '</option>'; break; case 'Rejected': echo '<option selected value="Rejected">' . _('Rejected') . '</option> - <option value="Pending">' . _('Pending') . '</option> - <option value="Authorised">' . _('Authorised') . '</option>'; + <option value="Pending">' . _('Pending') . '</option> + <option value="Authorised">' . _('Authorised') . '</option>'; break; case 'Cancelled': echo '<option selected value="Cancelled">' . _('Cancelled') . '</option> - <option value="Authorised">' . _('Authorised') . '</option> - <option value="Pending">' . _('Pending') . '</option>'; + <option value="Authorised">' . _('Authorised') . '</option> + <option value="Pending">' . _('Pending') . '</option>'; break; } @@ -856,15 +854,15 @@ $_POST['StkLocation'] = $_SESSION['UserStockLocation']; $sql = "SELECT deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - contact - FROM locations - WHERE loccode='" . $_POST['StkLocation'] . "'"; + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; $LocnAddrResult = DB_query($sql,$db); if (DB_num_rows($LocnAddrResult)==1){ @@ -899,15 +897,15 @@ } elseif (isset($_POST['LookupDeliveryAddress'])){ $sql = "SELECT deladd1, - deladd2, - deladd3, - deladd4, - deladd5, - deladd6, - tel, - contact - FROM locations - WHERE loccode='" . $_POST['StkLocation'] . "'"; + deladd2, + deladd3, + deladd4, + deladd5, + deladd6, + tel, + contact + FROM locations + WHERE loccode='" . $_POST['StkLocation'] . "'"; $LocnAddrResult = DB_query($sql,$db); if (DB_num_rows($LocnAddrResult)==1){ @@ -992,9 +990,9 @@ echo '<input type="submit" name="SearchSuppliers" value=' . _('Select Now') . '"></td></tr>'; echo '</td></tr><tr><td>' . _('Supplier Contact') . ':</td><td> - <select name=SupplierContact>'; + <select name="SupplierContact">'; - $sql = 'SELECT contact FROM suppliercontacts WHERE supplierid="' . $_POST['Select'] .'"'; + $sql = "SELECT contact FROM suppliercontacts WHERE supplierid='" . $_POST['Select'] ."'"; $SuppCoResult = DB_query($sql,$db); while ( $SuppCoRow=DB_fetch_array($SuppCoResult)){ @@ -1043,7 +1041,9 @@ DB_data_seek($result, 0); echo '</select></td></tr>'; - $result=DB_query('SELECT loccode, locationname FROM locations WHERE loccode="' . $_SESSION['PO'.$identifier]->Port.'"', $db); + $result=DB_query("SELECT loccode, + locationname + FROM locations WHERE loccode='" . $_SESSION['PO'.$identifier]->Port."'", $db); $myrow = DB_fetch_array($result); $_POST['Port'] = $myrow['locationname']; Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2011-03-26 22:11:47 UTC (rev 4518) +++ trunk/PO_Items.php 2011-03-27 01:50:33 UTC (rev 4519) @@ -2,8 +2,6 @@ /* $Id PO_Items.php 4183 2010-12-14 09:30:20Z daintree $ */ -//$PageSecurity = 4; Now retrieved from database - include('includes/DefinePOClass.php'); include('includes/SQL_CommonFunctions.inc'); @@ -73,7 +71,7 @@ prnMsg( _('The purchase order can not be committed to the database because there are no lines entered on this order'),'error'); $InputError=1; } - + /*If all clear then proceed to update the database */ if ($InputError!=1){ @@ -103,7 +101,7 @@ 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 />'; + $AuthMessage = _('You can only authorise up to').' '.$_SESSION['PO'.$identifier]->CurrCode.' '.$AuthRow['authlevel'] .'.<br />'; } prnMsg( _('You do not have permission to authorise this purchase order').'.<br />'. _('This order is for').' '. @@ -131,71 +129,71 @@ /*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 . "' - )"; - + 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); @@ -204,50 +202,50 @@ 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 . "')"; + 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'); @@ -262,35 +260,35 @@ /*Update the purchase order header with any changes */ $sql = "UPDATE purchorders SET supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' , - comments='" . $_SESSION['PO'.$identifier]->Comments . "', - rate='" . $_SESSION['PO'.$identifier]->ExRate . "', - initiator='" . $_SESSION['PO'.$identifier]->Initiator . "', - requisitionno= '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', - version= '" . $_SESSION['PO'.$identifier]->Version . "', - deliveryby='" . $_SESSION['PO'.$identifier]->DeliveryBy . "', - deliverydate='" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', - revised= '" . Date('Y-m-d') . "', - intostocklocation='" . $_SESSION['PO'.$identifier]->Location . "', - deladd1='" . $_SESSION['PO'.$identifier]->DelAdd1 . "', - deladd2='" . $_SESSION['PO'.$identifier]->DelAdd2 . "', - deladd3='" . $_SESSION['PO'.$identifier]->DelAdd3 . "', - deladd4='" . $_SESSION['PO'.$identifier]->DelAdd4 . "', - deladd5='" . $_SESSION['PO'.$identifier]->DelAdd5 . "', - deladd6='" . $_SESSION['PO'.$identifier]->DelAdd6 . "', - deladd6='" . $_SESSION['PO'.$identifier]->Tel . "', - suppdeladdress1='" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', - suppdeladdress2='" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', - suppdeladdress3='" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', - suppdeladdress4='" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', - suppdeladdress5='" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', - suppdeladdress6='" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', - suppliercontact='" . $_SESSION['PO'.$identifier]->SupplierContact . "', - supptel='" . $_SESSION['PO'.$identifier]->SuppTel . "', - contact='" . $_SESSION['PO'.$identifier]->Contact . "', - paymentterms='" . $_SESSION['PO'.$identifier]->PaymentTerms . "', - allowprint='" . $_SESSION['PO'.$identifier]->AllowPrintPO . "', - status = '" . $_SESSION['PO'.$identifier]->Status . "' - WHERE orderno = '" . $_SESSION['PO'.$identifier]->OrderNo ."'"; + comments='" . $_SESSION['PO'.$identifier]->Comments . "', + rate='" . $_SESSION['PO'.$identifier]->ExRate . "', + initiator='" . $_SESSION['PO'.$identifier]->Initiator . "', + requisitionno= '" . $_SESSION['PO'.$identifier]->RequisitionNo . "', + version= '" . $_SESSION['PO'.$identifier]->Version . "', + deliveryby='" . $_SESSION['PO'.$identifier]->DeliveryBy . "', + deliverydate='" . FormatDateForSQL($_SESSION['PO'.$identifier]->DeliveryDate) . "', + revised= '" . Date('Y-m-d') . "', + intostocklocation='" . $_SESSION['PO'.$identifier]->Location . "', + deladd1='" . $_SESSION['PO'.$identifier]->DelAdd1 . "', + deladd2='" . $_SESSION['PO'.$identifier]->DelAdd2 . "', + deladd3='" . $_SESSION['PO'.$identifier]->DelAdd3 . "', + deladd4='" . $_SESSION['PO'.$identifier]->DelAdd4 . "', + deladd5='" . $_SESSION['PO'.$identifier]->DelAdd5 . "', + deladd6='" . $_SESSION['PO'.$identifier]->DelAdd6 . "', + deladd6='" . $_SESSION['PO'.$identifier]->Tel . "', + suppdeladdress1='" . $_SESSION['PO'.$identifier]->SuppDelAdd1 . "', + suppdeladdress2='" . $_SESSION['PO'.$identifier]->SuppDelAdd2 . "', + suppdeladdress3='" . $_SESSION['PO'.$identifier]->SuppDelAdd3 . "', + suppdeladdress4='" . $_SESSION['PO'.$identifier]->SuppDelAdd4 . "', + suppdeladdress5='" . $_SESSION['PO'.$identifier]->SuppDelAdd5 . "', + suppdeladdress6='" . $_SESSION['PO'.$identifier]->SuppDelAdd6 . "', + suppliercontact='" . $_SESSION['PO'.$identifier]->SupplierContact . "', + supptel='" . $_SESSION['PO'.$identifier]->SuppTel . "', + contact='" . $_SESSION['PO'.$identifier]->Contact . "', + paymentterms='" . $_SESSION['PO'.$identifier]->PaymentTerms . "', + allowprint='" . $_SESSION['PO'.$identifier]->AllowPrintPO . "', + status = '" . $_SESSION['PO'.$identifier]->Status . "' + WHERE orderno = '" . $_SESSION['PO'.$identifier]->OrderNo ."'"; $ErrMsg = _('The purchase order could not be updated because'); $DbgMsg = _('The SQL statement used to update the purchase order header record, that failed was'); @@ -309,99 +307,99 @@ } else if ($POLine->PODetailRec=='') { $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 . "')"; + 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 . "')"; } else { if ($POLine->Quantity==$POLine->QtyReceived){ $sql = "UPDATE purchorderdetails SET itemcode='" . $POLine->StockID . "', - deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', - itemdescription='" . $POLine->ItemDescription . "', - glcode='" . $POLine->GLCode . "', - unitprice='" . $POLine->Price . "', - quantityord='" . $POLine->Quantity . "', - shiptref='" . $POLine->ShiptRef . "', - jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', - suppliersunit='" . $POLine->SuppliersUnit . "', - suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', - completed=1, - assetid='" . $POLine->AssetID . "', - conversionfactor = '" . $POLine->ConversionFactor . "' - WHERE podetailitem='" . $POLine->PODetailRec . "'"; + deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', + itemdescription='" . $POLine->ItemDescription . "', + glcode='" . $POLine->GLCode . "', + unitprice='" . $POLine->Price . "', + quantityord='" . $POLine->Quantity . "', + shiptref='" . $POLine->ShiptRef . "', + jobref='" . $POLine->JobRef . "', + itemno='" . $POLine->ItemNo . "', + suppliersunit='" . $POLine->SuppliersUnit . "', + suppliers_partno='" . $POLine->Suppliers_PartNo . "', + subtotal_amount='" . $POLine->SubTotal_Amount . "', + package='" . $POLine->Package . "', + pcunit='" . $POLine->PcUnit . "', + netweight='" . $POLine->NetWeight . "', + kgs='" . $POLine->KGs . "', + cuft='" . $POLine->CuFt . "', + total_quantity='" . $POLine->Total_Quantity . "', + total_amount='" . $POLine->Total_Amount . "', + completed=1, + assetid='" . $POLine->AssetID . "', + conversionfactor = '" . $POLine->ConversionFactor . "' + WHERE podetailitem='" . $POLine->PODetailRec . "'"; } else { $sql = "UPDATE purchorderdetails SET itemcode='" . $POLine->StockID . "', - deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', - itemdescription='" . $POLine->ItemDescription . "', - glcode='" . $POLine->GLCode . "', - unitprice='" . $POLine->Price . "', - quantityord='" . $POLine->Quantity . "', - shiptref='" . $POLine->ShiptRef . "', - jobref='" . $POLine->JobRef . "', - itemno='" . $POLine->ItemNo . "', - suppliersunit='" . $POLine->SuppliersUnit . "', - suppliers_partno='" . $POLine->Suppliers_PartNo . "', - subtotal_amount='" . $POLine->SubTotal_Amount . "', - package='" . $POLine->Package . "', - pcunit='" . $POLine->PcUnit . "', - netweight='" . $POLine->NetWeight . "', - kgs='" . $POLine->KGs . "', - cuft='" . $POLine->CuFt . "', - total_quantity='" . $POLine->Total_Quantity . "', - total_amount='" . $POLine->Total_Amount . "', - assetid='" . $POLine->AssetID . "', - conversionfactor = '" . $POLine->ConversionFactor . "' - WHERE podetailitem='" . $POLine->PODetailRec . "'"; + deliverydate ='" . FormatDateForSQL($POLine->ReqDelDate) . "', + itemdescription='" . $POLine->ItemDescription . "', + glcode='" . $POLine->GLCode . "', + unitprice='" . $POLine->Price . "', + quantityord='" . $POLine->Quantity . "', + shiptref='" . $POLine->ShiptRef . "', + jobref='" . $POLine->JobRef . "', + itemno='" . $POLine->ItemNo . "', + suppliersunit='" . $POLine->SuppliersUnit . "', + suppliers_partno='" . $POLine->Suppliers_PartNo . "', + subtotal_amount='" . $POLine->SubTotal_Amount . "', + package='" . $POLine->Package . "', + pcunit='" . $POLine->PcUnit . "', + netweight='" . $POLine->NetWeight . "', + kgs='" . $POLine->KGs . "', + cuft='" . $POLine->CuFt . "', + total_quantity='" . $POLine->Total_Quantity . "', + total_amount='" . $POLine->Total_Amount . "', + assetid='" . $POLine->AssetID . "', + conversionfactor = '" . $POLine->ConversionFactor . "' + WHERE podetailitem='" . $POLine->PODetailRec . "'"; } } @@ -433,6 +431,7 @@ if(isset($_GET['Delete'])){ if($_SESSION['PO'.$identifier]->Some_Already_Received($_GET['Delete'])==0){ $_SESSION['PO'.$identifier]->LineItems[$_GET['Delete']]->Deleted=True; + $_SESSION['PO'.$identifier]->LinesOnOrder --; include ('includes/PO_UnsetFormVbls.php'); } else { prnMsg( _('This item cannot be deleted because some of it has already been received'),'warn'); @@ -442,8 +441,7 @@ if (isset($_POST['EnterLine'])){ /*Inputs from the form directly without selecting a stock item from the search */ $AllowUpdate = true; /*always assume the best */ - - if (!is_numeric($_POST['Qty'])){ + if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])))){ $AllowUpdate = false; prnMsg( _('Cannot Enter this order line') . '<br />' . _('The quantity of the order item must be numeric'),'error'); } @@ -495,12 +493,12 @@ } if ($_POST['AssetID'] !='Not an Asset'){ $ValidAssetResult = DB_query("SELECT assetid, - description, - costact - FROM fixedassets - INNER JOIN fixedassetcategories - ON fixedassets.assetcategoryid=fixedassetcategories.categoryid - WHERE assetid='" . $_POST['AssetID'] . "'",$db); + description, + costact + FROM fixedassets + INNER JOIN fixedassetcategories + ON fixedassets.assetcategoryid=fixedassetcategories.categoryid + WHERE assetid='" . $_POST['AssetID'] . "'",$db); if (DB_num_rows($ValidAssetResult)==0){ // then the asset id entered doesn't exist $AllowUpdate = false; prnMsg(_('An asset code was entered but it does not yet exist. Only pre-existing asset ids can be entered when ordering a fixed asset'),'error'); @@ -526,36 +524,36 @@ $_POST['Qty'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Qty'])); $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, - '', - 0, /*Serialised */ - 0, /*Controlled */ - $_POST['Qty'], - $_POST['ItemDescription'], - $_POST['Price'], - $_POST['SuppliersUnit'], - $_POST['GLCode'], - $_POST['ReqDelDate'], - '', - 0, - '', - 0, - 0, - $GLAccountName, - 2, - '', - $_POST['SuppliersUnit'], - 1, - '', - '', - ($_POST['Qty']*$_POST['Price']), - '', - '', - '', - '', - '', - $_POST['Qty'], - ($_POST['Qty']*$_POST['Price']), - $_POST['AssetID']); + '', + 0, /*Serialised */ + 0, /*Controlled */ + $_POST['Qty'], + $_POST['ItemDescription'], + $_POST['Price'], + $_POST['SuppliersUnit'], + $_POST['GLCode'], + $_POST['ReqDelDate'], + '', + 0, + '', + 0, + 0, + $GLAccountName, + 2, + '', + $_POST['SuppliersUnit'], + 1, + '', + '', + ($_POST['Qty']*$_POST['Price']), + '', + '', + '', + '', + '', + $_POST['Qty'], + ($_POST['Qty']*$_POST['Price']), + $_POST['AssetID']); include ('includes/PO_UnsetFormVbls.php'); } } @@ -591,18 +589,18 @@ } if ($AlreadyOnThisOrder!=1 AND $Quantity > 0){ $sql = "SELECT description, - stockid, - units, - decimalplaces, - kgs, - netweight, - stockact, - accountname - FROM stockmaster INNER JOIN stockcategory - ON stockcategory.categoryid = stockmaster.categoryid - INNER JOIN chartmaster - ON chartmaster.accountcode = stockcategory.stockact - WHERE stockmaster.stockid = '". $ItemCode . "'"; + stockid, + units, + decimalplaces, + kgs, + netweight, + stockact, + accountname + FROM stockmaster INNER JOIN stockcategory + ON stockcategory.categoryid = stockmaster.categoryid + INNER JOIN chartmaster + ON chartmaster.accountcode = stockcategory.stockact + WHERE stockmaster.stockid = '". $ItemCode . "'"; $ErrMsg = _('The item details for') . ' ' . $ItemCode . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the item details but failed was'); @@ -611,26 +609,26 @@ $ItemRow = DB_fetch_array($ItemResult); $sql = "SELECT price, - conversionfactor, - supplierdescription, - suppliersuom, - unitname, - suppliers_partno, - leadtime, - MAX(purchdata.effectivefrom) AS latesteffectivefrom - FROM purchdata LEFT JOIN unitsofmeasure - ON purchdata.suppliersuom=unitsofmeasure.unitid - WHERE purchdata.supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' - AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' - AND purchdata.stockid = '". $ItemCode . "' - GROUP BY purchdata.price, - purchdata.conversionfactor, - purchdata.supplierdescription, - purchdata.suppliersuom, - unitsofmeasure.unitname, - purchdata.suppliers_partno, - purchdata.leadtime"; - + conversionfactor, + supplierdescription, + suppliersuom, + unitname, + suppliers_partno, + leadtime, + MAX(purchdata.effectivefrom) AS latesteffectivefrom + FROM purchdata LEFT JOIN unitsofmeasure + ON purchdata.suppliersuom=unitsofmeasure.unitid + WHERE purchdata.supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "' + AND purchdata.effectivefrom <='" . Date('Y-m-d') . "' + AND purchdata.stockid = '". $ItemCode . "' + GROUP BY purchdata.price, + purchdata.conversionfactor, + purchdata.supplierdescription, + purchdata.suppliersuom, + unitsofmeasure.unitname, + purchdata.suppliers_partno, + purchdata.leadtime"; + $ErrMsg = _('The purchasing data for') . ' ' . $ItemCode . ' ' . _('could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the purchasing data but failed was'); $PurchDataResult = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -652,35 +650,35 @@ } $_SESSION['PO'.$identifier]->add_to_order ($_SESSION['PO'.$identifier]->LinesOnOrder+1, - $ItemCode, - 0, /*Serialised */ - 0, /*Controlled */ - $Quantity*$ConversionFactor, /* Qty */ - $SupplierDescription, - $PurchPrice, - $ItemRow['units'], - $ItemRow['stockact'], - $_SESSION['PO'.$identifier]->DeliveryDate, - 0, - 0, - 0, - 0, - 0, - $Itemrow['accountname'], - $ItemRow['decimalplaces'], - $ItemCode, - $SuppliersUnitOfMeasure, - $ConversionFactor, - $LeadTime, - $SuppliersPartNo, - $Quantity*$PurchPrice, - '', - 0, - $ItemRow['netweight'], - $ItemRow['kgs'], - '', - $Quantity, - $Quantity*$PurchPrice ); + $ItemCode, + 0, /*Serialised */ + 0, /*Controlled */ + $Quantity*$ConversionFactor, /* Qty */ + $SupplierDescription, + $PurchPrice, + $ItemRow['units'], + $ItemRow['stockact'], + $_SESSION['PO'.$identifier]->DeliveryDate, + 0, + 0, + 0, + 0, + 0, + $Itemrow['accountname'], + $ItemRow['decimalplaces'], + $ItemCode, + $SuppliersUnitOfMeasure, + $ConversionFactor, + $LeadTime, + $SuppliersPartNo, + $Quantity*$PurchPrice, + '', + 0, + $ItemRow['netweight'], + $ItemRow['kgs'], + '', + $Quantity, + $Quantity*$PurchPrice ); } else { //no rows returned by the SQL to get the item prnMsg (_('The item code') . ' ' . $ItemCode . ' ' . _('does not exist in the database and therefore cannot be added to the order'),'error'); if ($debug==1){ @@ -832,45 +830,47 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - unitsofmeasure.unitname - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND stockmaster.description " . LIKE . " '" . $SearchString ."' - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + stockmaster.description, + stockmaster.units, + purchdata.conversionfactor, + unitsofmeasure.unitname + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + LEFT JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + LEFT JOIN unitsofmeasure + ON unitsofmeasure.unitid=purchdata.suppliersuom + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND stockmaster.description " . LIKE . " '" . $SearchString ."' + AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' + OR purchdata.supplierno IS NULL) + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - unitsofmeasure.unitname - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) - AND stockmaster.description " . LIKE . " '". $SearchString ."' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + stockmaster.description, + stockmaster.units, + purchdata.conversionfactor, + unitsofmeasure.unitname + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + LEFT JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + LEFT JOIN unitsofmeasure + ON unitsofmeasure.unitid=purchdata.suppliersuom + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' + OR purchdata.supplierno IS NULL) + AND stockmaster.description " . LIKE . " '". $SearchString ."' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } elseif ($_POST['StockCode']){ @@ -879,87 +879,91 @@ if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - unitsofmeasure.unitname - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + stockmaster.description, + stockmaster.units, + purchdata.conversionfactor, + unitsofmeasure.unitname + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + LEFT JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + LEFT JOIN unitsofmeasure + ON unitsofmeasure.unitid=purchdata.suppliersuom + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' + OR purchdata.supplierno IS NULL) + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } else { $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - unitsofmeasure.unitname - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - and stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) - AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; + stockmaster.description, + stockmaster.units, + purchdata.conversionfactor, + unitsofmeasure.unitname + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + LEFT JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + LEFT JOIN unitsofmeasure + ON unitsofmeasure.unitid=purchdata.suppliersuom + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + and stockmaster.discontinued<>1 + AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' + OR purchdata.supplierno IS NULL) + AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' + AND stockmaster.categoryid='" . $_POST['StockCat'] . "' + ORDER BY stockmaster.stockid + LIMIT ".$_SESSION['DefaultDisplayRecordsMax']; } } else { if ($_POST['StockCat']=='All'){ $sql = "SELECT stockmaster.stockid, - stockmaster.description, - stockmaster.units, - unitsofmeasure.unitname - FROM stockmaster INNER JOIN stockcategory - ON stockmaster.categoryid=stockcategory.categoryid - LEFT JOIN purchdata - ON stockmaster.stockid=purchdata.stockid - LEFT JOIN unitsofmeasure - ON unitsofmeasure.unitid=purchdata.suppliersuom - WHERE stockmaster.mbflag<>'D' - AND stockmaster.mbflag<>'K' - AND stockmaster.mbflag<>'G' - AND stockmaster.discontinued<>1 - AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' - OR purchdata.supplierno IS NULL) - ORDER BY stockmaster.stockid - LIMIT " . $_SESSION['DefaultDisplayRecordsMax']; + stockmaster.description, + stockmaster.units, + purchdata.conversionfactor, + unitsofmeasure.unitname + FROM stockmaster INNER JOIN stockcategory + ON stockmaster.categoryid=stockcategory.categoryid + LEFT JOIN purchdata + ON stockmaster.stockid=purchdata.stockid + LEFT JOIN unitsofmeasure + ON unitsofmeasure.unitid=purchdata.suppliersuom + WHERE stockmaster.mbflag<>'D' + AND stockmaster.mbflag<>'K' + AND stockmaster.mbflag<>'G' + AND stockmaster.discontinued<>1 + AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."' + OR purchdata.supplierno IS NULL) + ORDER BY stockmaster.stockid + LIMIT " . $_SESSION['DefaultDisplayRec... [truncated message content] |
From: <dai...@us...> - 2011-03-28 09:49:35
|
Revision: 4520 http://web-erp.svn.sourceforge.net/web-erp/?rev=4520&view=rev Author: daintree Date: 2011-03-28 09:49:25 +0000 (Mon, 28 Mar 2011) Log Message: ----------- zh_HK and zh_CN fix up Modified Paths: -------------- trunk/AddCustomerContacts.php trunk/GoodsReceived.php trunk/UnitsOfMeasure.php trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo trunk/locale/en_US.utf8/LC_MESSAGES/messages.po trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po trunk/sql/mysql/weberp-demo.sql trunk/sql/mysql/weberp-new.sql Modified: trunk/AddCustomerContacts.php =================================================================== --- trunk/AddCustomerContacts.php 2011-03-27 01:50:33 UTC (rev 4519) +++ trunk/AddCustomerContacts.php 2011-03-28 09:49:25 UTC (rev 4520) @@ -1,7 +1,7 @@ <?php /* $Revision: 1.6 $ */ /* $Id$*/ -//$PageSecurity = 3; + include('includes/session.inc'); $title = _('Customer Contacts'); include('includes/header.inc'); @@ -18,7 +18,7 @@ $DebtorNo = $_GET['DebtorNo']; } echo "<a href='" . $rootpath . '/Customers.php?' . SID .'&DebtorNo='.$DebtorNo."'>" . _('Back to Customers') . '</a><br>'; -$SQLname='SELECT * from debtorsmaster where debtorno="'.$DebtorNo.'"'; +$SQLname="SELECT * from debtorsmaster where debtorno='" .$DebtorNo."'"; $Result = DB_query($SQLname,$db); $row = DB_fetch_array($Result); if (!isset($_GET['Id'])) { Modified: trunk/GoodsReceived.php =================================================================== --- trunk/GoodsReceived.php 2011-03-27 01:50:33 UTC (rev 4519) +++ trunk/GoodsReceived.php 2011-03-28 09:49:25 UTC (rev 4520) @@ -28,7 +28,7 @@ if (isset($_GET['PONumber']) and $_GET['PONumber']<=0 and !isset($_SESSION['PO'.$identifier])) { /* This page can only be called with a purchase order number for invoicing*/ - echo '<div class="centre"><a href= "' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">'. + echo '<div class="centre"><a href= "' . $rootpath . '/PO_SelectOSPurchOrder.php">'. _('Select a purchase order to receive').'</a></div>'; echo '<br />'. _('This page can only be opened if a purchase order has been selected. Please select a purchase order first'); include ('includes/footer.inc'); @@ -65,7 +65,7 @@ _('Receive') . '" alt="" />' . ' ' . _('Receive Purchase Order') . ''; echo ' : '. $_SESSION['PO'.$identifier]->OrderNo .' '. _('from'). ' ' . $_SESSION['PO'.$identifier]->SupplierName . '</p>'; -echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier=' . $identifier . '" method=post>'; +echo '<form action="' . $_SERVER['PHP_SELF'] . '?identifier=' . $identifier . '" method=post>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['ProcessGoodsReceived'])) { @@ -83,7 +83,7 @@ <tr><th colspan="2"></th> <th align="centre" colspan="3"><b>' . _('Supplier Units') . '</b></th> <th></th> - <th align="centre" colspan="5"><b>' . _('Our Units') . '</b></th> + <th align="centre" colspan="5"><b>' . _('Our Receiving Units') . '</b></th> </tr> <tr><th>' . _('Item Code') . '</th> <th>' . _('Description') . '</th> @@ -209,9 +209,11 @@ } if ($OrderLine->ReceiveQty < 0 AND $_SESSION['ProhibitNegativeStock']==1){ - $SQL = "SELECT locstock.quantity FROM - locstock WHERE locstock.stockid='" . $OrderLine->StockID . "' - AND loccode= '" . $_SESSION['PO'.$identifier]->Location . "'"; + $SQL = "SELECT locstock.quantity + FROM locstock + WHERE locstock.stockid='" . $OrderLine->StockID . "' + AND loccode= '" . $_SESSION['PO'.$identifier]->Location . "'"; + $CheckNegResult = DB_query($SQL,$db); $CheckNegRow = DB_fetch_row($CheckNegResult); if ($CheckNegRow[0]+$OrderLine->ReceiveQty<0){ @@ -256,16 +258,16 @@ /*Now need to check that the order details are the same as they were when they were read into the Items array. If they've changed then someone else must have altered them */ // Otherwise if you try to fullfill item quantities separately will give error. $SQL = "SELECT itemcode, - glcode, - quantityord, - quantityrecd, - qtyinvoiced, - shiptref, - jobref - FROM purchorderdetails - WHERE orderno='" . (int) $_SESSION['PO'.$identifier]->OrderNo . "' - AND completed=0 - ORDER BY podetailitem"; + glcode, + quantityord, + quantityrecd, + qtyinvoiced, + shiptref, + jobref + FROM purchorderdetails + WHERE orderno='" . (int) $_SESSION['PO'.$identifier]->OrderNo . "' + AND completed=0 + ORDER BY podetailitem"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not check that the details of the purchase order had not been changed by another user because'). ':'; $DbgMsg = _('The following SQL to retrieve the purchase order details was used'); @@ -404,21 +406,21 @@ /*Need to insert a GRN item */ $SQL = "INSERT INTO grns (grnbatch, - podetailitem, - itemcode, - itemdescription, - deliverydate, - qtyrecd, - supplierid, - stdcostunit) - VALUES ('" . $GRN . "', - '" . $OrderLine->PODetailRec . "', - '" . $OrderLine->StockID . "', - '" . $OrderLine->ItemDescription . "', - '" . $_POST['DefaultReceivedDate'] . "', - '" . $OrderLine->ReceiveQty . "', - '" . $_SESSION['PO'.$identifier]->SupplierID . "', - '" . $CurrentStandardCost . "')"; + podetailitem, + itemcode, + itemdescription, + deliverydate, + qtyrecd, + supplierid, + stdcostunit) + VALUES ('" . $GRN . "', + '" . $OrderLine->PODetailRec . "', + '" . $OrderLine->StockID . "', + '" . $OrderLine->ItemDescription . "', + '" . $_POST['DefaultReceivedDate'] . "', + '" . $OrderLine->ReceiveQty . "', + '" . $_SESSION['PO'.$identifier]->SupplierID . "', + '" . $CurrentStandardCost . "')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('A GRN record could not be inserted') . '. ' . _('This receipt of goods has not been processed because'); $DbgMsg = _('The following SQL to insert the GRN record was used'); @@ -455,29 +457,29 @@ /* Insert stock movements - with unit cost */ $SQL = "INSERT INTO stockmoves (stockid, - type, - transno, - loccode, - trandate, - price, - prd, - reference, - qty, - standardcost, - newqoh) - VALUES ( - '" . $OrderLine->StockID . "', - 25, - '" . $GRN . "', - '" . $_SESSION['PO'.$identifier]->Location . "', - '" . $_POST['DefaultReceivedDate'] . "', - '" . $LocalCurrencyPrice . "', - '" . $PeriodNo . "', - '" . $_SESSION['PO'.$identifier]->SupplierID . " (" . $_SESSION['PO'.$identifier]->SupplierName . ") - " .$_SESSION['PO'.$identifier]->OrderNo . "', - '" . $OrderLine->ReceiveQty . "', - '" . $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost . "', - '" . ($QtyOnHandPrior + $OrderLine->ReceiveQty) . "' - )"; + type, + transno, + loccode, + trandate, + price, + prd, + reference, + qty, + standardcost, + newqoh) + VALUES ( + '" . $OrderLine->StockID . "', + 25, + '" . $GRN . "', + '" . $_SESSION['PO'.$identifier]->Location . "', + '" . $_POST['DefaultReceivedDate'] . "', + '" . $LocalCurrencyPrice . "', + '" . $PeriodNo . "', + '" . $_SESSION['PO'.$identifier]->SupplierID . " (" . $_SESSION['PO'.$identifier]->SupplierName . ") - " .$_SESSION['PO'.$identifier]->OrderNo . "', + '" . $OrderLine->ReceiveQty . "', + '" . $_SESSION['PO'.$identifier]->LineItems[$OrderLine->LineNo]->StandardCost . "', + '" . ($QtyOnHandPrior + $OrderLine->ReceiveQty) . "' + )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('stock movement records could not be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement records was used'); @@ -684,7 +686,7 @@ echo '<br /><div class=centre>'. _('GRN number'). ' '. $GRN .' '. _('has been processed').'<br />'; echo '<br /><a href=PDFGrn.php?GRNNo='.$GRN .'&PONo='.$PONo.'>'. _('Print this Goods Received Note (GRN)').'</a><br /><br />'; - echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php?' . SID . '">' . + echo '<a href="' . $rootpath . '/PO_SelectOSPurchOrder.php">' . _('Select a different purchase order for receiving goods against'). '</a></div>'; /*end of process goods received entry */ include('includes/footer.inc'); @@ -692,7 +694,7 @@ } else { /*Process Goods received not set so show a link to allow mod of line items on order and allow input of date goods received*/ - echo '<br /><div class="centre"><a href="' . $rootpath . '/PO_Items.php">' . _('Modify Order Items'). '</a></div>'; + echo '<br /><div class="centre"><a href="' . $rootpath . '/PO_Header.php?ModifyOrderNumber=' .$_SESSION['PO'.$identifier]->OrderNo . '">' . _('Modify Order Items'). '</a></div>'; echo '<br /><div class="centre"><input type=submit name=Update Value=' . _('Update') . '><p>'; echo '<input type=submit name="ProcessGoodsReceived" Value="' . _('Process Goods Received') . '"></div>'; Modified: trunk/UnitsOfMeasure.php =================================================================== --- trunk/UnitsOfMeasure.php 2011-03-27 01:50:33 UTC (rev 4519) +++ trunk/UnitsOfMeasure.php 2011-03-28 09:49:25 UTC (rev 4520) @@ -64,9 +64,6 @@ $sql[] = "UPDATE stockmaster SET units='" . $_POST['MeasureName'] . "' WHERE units ".LIKE." '" . $OldMeasureName . "'"; - $sql[] = "UPDATE contracts - SET units='" . $_POST['MeasureName'] . "' - WHERE units ".LIKE." '" . $OldMeasureName . "'"; } else { $InputError = 1; prnMsg( _('The unit of measure no longer exist.'),'error'); Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-03-27 01:50:33 UTC (rev 4519) +++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-03-28 09:49:25 UTC (rev 4520) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: webERP 3.08\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-26 16:22+1200\n" +"POT-Creation-Date: 2011-03-27 19:34+1200\n" "PO-Revision-Date: 2010-07-25 17:04+0000\n" "Last-Translator: Tim Schofield <ti...@we...>\n" "Language-Team: Czech <cs...@li...>\n" @@ -266,12 +266,12 @@ #: CustomerBranches.php:420 Customers.php:600 Customers.php:857 #: Customers.php:864 Customers.php:867 DeliveryDetails.php:1034 #: DeliveryDetails.php:1074 DeliveryDetails.php:1077 GLTransInquiry.php:73 -#: MRPCalendar.php:222 MRP.php:530 MRP.php:534 MRP.php:538 MRP.php:542 +#: MRPCalendar.php:222 MRP.php:529 MRP.php:533 MRP.php:537 MRP.php:541 #: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:264 #: PaymentMethods.php:270 PDFChequeListing.php:63 #: PDFDeliveryDifferences.php:64 PDFDIFOT.php:67 #: PO_AuthorisationLevels.php:132 PO_AuthorisationLevels.php:137 -#: PO_Header.php:758 PO_PDFPurchOrder.php:344 PO_PDFPurchOrder.php:347 +#: PO_Header.php:754 PO_PDFPurchOrder.php:344 PO_PDFPurchOrder.php:347 #: PurchData.php:192 PurchData.php:494 PurchData.php:497 #: RecurringSalesOrders.php:483 RecurringSalesOrders.php:486 #: SalesAnalReptCols.php:279 SalesAnalReptCols.php:401 @@ -301,12 +301,12 @@ #: CustomerBranches.php:420 Customers.php:599 Customers.php:855 #: Customers.php:863 Customers.php:866 DeliveryDetails.php:1035 #: DeliveryDetails.php:1075 DeliveryDetails.php:1078 GLTransInquiry.php:127 -#: MRPCalendar.php:224 MRP.php:528 MRP.php:532 MRP.php:536 MRP.php:540 +#: MRPCalendar.php:224 MRP.php:527 MRP.php:531 MRP.php:535 MRP.php:539 #: PaymentMethods.php:203 PaymentMethods.php:204 PaymentMethods.php:265 #: PaymentMethods.php:271 PDFChequeListing.php:62 #: PDFDeliveryDifferences.php:63 PDFDIFOT.php:66 #: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 -#: PO_Header.php:757 PO_PDFPurchOrder.php:345 PO_PDFPurchOrder.php:348 +#: PO_Header.php:753 PO_PDFPurchOrder.php:345 PO_PDFPurchOrder.php:348 #: PurchData.php:195 PurchData.php:495 PurchData.php:498 #: RecurringSalesOrders.php:482 RecurringSalesOrders.php:485 #: SalesAnalReptCols.php:277 SalesAnalReptCols.php:402 @@ -367,7 +367,7 @@ #: Payments.php:958 PaymentTerms.php:204 PcAssignCashToTab.php:255 #: PcClaimExpensesFromTab.php:230 PcExpenses.php:187 PcExpensesTypeTab.php:164 #: PcTabs.php:189 PcTypeTabs.php:175 PO_AuthorisationLevels.php:150 -#: PO_Items.php:764 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 +#: PO_Items.php:762 Prices_Customer.php:284 Prices.php:228 PurchData.php:208 #: SalesAnalReptCols.php:294 SalesAnalRepts.php:305 SalesCategories.php:264 #: SalesGLPostings.php:136 SalesGLPostings.php:248 SalesPeople.php:211 #: SalesTypes.php:207 SelectCreditItems.php:745 SelectCustomer.php:611 @@ -535,7 +535,7 @@ #: AddCustomerTypeNotes.php:49 Areas.php:74 CustomerTypes.php:71 #: DeliveryDetails.php:748 Factors.php:117 FixedAssetItems.php:236 #: PcAssignCashToTab.php:73 PcClaimExpensesFromTab.php:61 PcExpenses.php:70 -#: PcTabs.php:60 PcTypeTabs.php:62 PO_Items.php:413 SalesAnalReptCols.php:129 +#: PcTabs.php:60 PcTypeTabs.php:62 PO_Items.php:411 SalesAnalReptCols.php:129 #: SalesPeople.php:94 SalesTypes.php:63 Stocks.php:353 Suppliers.php:514 #: SupplierTypes.php:69 msgid "has been updated" @@ -591,7 +591,7 @@ msgstr "Jméno kontaktní osoby" #: AddCustomerContacts.php:196 Contracts.php:777 PDFRemittanceAdvice.php:247 -#: PO_Header.php:958 PO_Header.php:1028 SelectCreditItems.php:223 +#: PO_Header.php:956 PO_Header.php:1026 SelectCreditItems.php:223 #: SelectCustomer.php:464 SelectOrderItems.php:639 #: includes/PDFStatementPageHeader.inc:63 includes/PDFTransPageHeader.inc:117 #: includes/PDFTransPageHeaderPortrait.inc:105 @@ -824,8 +824,8 @@ msgstr "Podrobnosti o nesplacených transakcí pro zákazníka" #: AgedDebtors.php:367 AgedSuppliers.php:189 GLAccountCSV.php:169 -#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:473 -#: PO_Items.php:607 PO_Items.php:634 SalesAnalReptCols.php:356 +#: GLAccountInquiry.php:145 GLAccountReport.php:93 PO_Items.php:471 +#: PO_Items.php:605 PO_Items.php:632 SalesAnalReptCols.php:356 #: SpecialOrder.php:369 StockLocTransferReceive.php:373 #: StockQuantityByDate.php:114 includes/SelectOrderItems_IntoCart.inc:53 msgid "could not be retrieved because" @@ -854,7 +854,7 @@ #: includes/PDFPaymentRun_PymtFooter.php:89 #: includes/PDFPaymentRun_PymtFooter.php:118 #: includes/PDFPaymentRun_PymtFooter.php:154 -#: includes/PDFPaymentRun_PymtFooter.php:185 includes/ConnectDB_mysqli.inc:86 +#: includes/PDFPaymentRun_PymtFooter.php:185 includes/ConnectDB_mysqli.inc:79 #: includes/ConnectDB_mysql.inc:68 msgid "The SQL that failed was" msgstr "SQL příkaz, který selhal, byl" @@ -1824,7 +1824,7 @@ #: InventoryQuantities.php:210 MRPPlannedPurchaseOrders.php:305 #: MRPPlannedWorkOrders.php:367 MRPReport.php:826 MRPReschedules.php:190 #: MRPShortages.php:283 PDFOrderStatus.php:299 PDFPriceList.php:331 -#: PDFReceipt.php:32 PO_Header.php:792 PO_PDFPurchOrder.php:59 +#: PDFReceipt.php:32 PO_Header.php:789 PO_PDFPurchOrder.php:59 #: PO_SelectOSPurchOrder.php:476 ReorderLevel.php:251 StockDispatch.php:337 #: SuppPriceList.php:254 Tax.php:252 includes/PDFAgedDebtorsPageHeader.inc:34 #: includes/PDFAgedSuppliersPageHeader.inc:21 @@ -2006,7 +2006,7 @@ #: MRPShortages.php:299 PaymentTerms.php:180 PcExpenses.php:159 #: PcExpenses.php:248 PcExpensesTypeTab.php:148 PcReportTab.php:174 #: PcTypeTabs.php:158 PDFOrdersInvoiced.php:345 PDFOrderStatus.php:313 -#: PDFPrintLabel.php:239 PO_Items.php:715 PO_Items.php:1042 +#: PDFPrintLabel.php:239 PO_Items.php:713 PO_Items.php:1046 #: PO_SelectOSPurchOrder.php:213 PO_SelectPurchOrder.php:178 #: PricesByCost.php:119 ReorderLevelLocation.php:55 ReorderLevel.php:266 #: ReverseGRN.php:377 SalesCategories.php:427 SelectAsset.php:225 @@ -2112,7 +2112,7 @@ #: CustomerReceipt.php:1029 CustomerReceipt.php:1032 #: DiscountCategories.php:103 DiscountCategories.php:106 #: FixedAssetTransfer.php:61 MRPDemands.php:330 MRPDemands.php:333 -#: MRPReport.php:563 PO_Header.php:516 PO_Items.php:1021 PO_Items.php:1026 +#: MRPReport.php:563 PO_Header.php:516 PO_Items.php:1025 PO_Items.php:1030 #: PO_SelectOSPurchOrder.php:202 PO_SelectPurchOrder.php:170 PurchData.php:264 #: SelectAsset.php:93 SelectCompletedOrder.php:518 SelectCreditItems.php:208 #: SelectCreditItems.php:942 SelectCustomer.php:331 SelectCustomer.php:337 @@ -2145,7 +2145,7 @@ #: BOMInquiry.php:26 BOMs.php:803 ContractBOM.php:331 Contracts.php:766 #: CounterSales.php:2142 CustomerReceipt.php:1037 FixedAssetTransfer.php:72 -#: MRPDemands.php:335 MRPReport.php:571 PO_Header.php:521 PO_Items.php:1029 +#: MRPDemands.php:335 MRPReport.php:571 PO_Header.php:521 PO_Items.php:1033 #: SelectAsset.php:101 SelectCreditItems.php:213 SelectCreditItems.php:947 #: SelectCustomer.php:419 SelectGLAccount.php:98 SelectOrderItems.php:627 #: SelectOrderItems.php:1596 SelectProduct.php:508 SelectSupplier.php:212 @@ -2155,7 +2155,7 @@ msgstr "Vyhledat" #: BOMInquiry.php:36 BOMs.php:738 ContractBOM.php:51 MRPDemands.php:57 -#: MRPReport.php:589 PO_Items.php:826 PO_SelectOSPurchOrder.php:64 +#: MRPReport.php:589 PO_Items.php:824 PO_SelectOSPurchOrder.php:64 #: PO_SelectPurchOrder.php:43 SelectCompletedOrder.php:95 #: SelectCreditItems.php:276 SelectProduct.php:521 SelectSalesOrder.php:348 #: SelectWorkOrder.php:35 Shipt_Select.php:62 SupplierTenders.php:378 @@ -2185,7 +2185,7 @@ #: CustomerReceipt.php:1043 GLCodesInquiry.php:28 MRPDemands.php:91 #: MRPPlannedWorkOrders.php:257 MRPReport.php:759 PDFOrdersInvoiced.php:344 #: PDFOrderStatus.php:312 PDFPrintLabel.php:239 PO_Header.php:531 -#: PO_Items.php:1041 PO_SelectOSPurchOrder.php:212 PO_SelectPurchOrder.php:177 +#: PO_Items.php:1045 PO_SelectOSPurchOrder.php:212 PO_SelectPurchOrder.php:177 #: PricesByCost.php:118 PurchData.php:338 ReorderLevelLocation.php:54 #: ReorderLevelLocation.php:203 SalesPeople.php:184 #: SelectCompletedOrder.php:534 SelectCreditItems.php:220 @@ -2202,7 +2202,7 @@ #: BOMInquiry.php:95 BOMs.php:812 ConfirmDispatch_Invoice.php:271 #: ContractBOM.php:345 CounterSales.php:1989 CounterSales.php:2169 #: Credit_Invoice.php:273 GoodsReceived.php:91 GoodsReceived.php:95 -#: MRPReport.php:762 OffersReceived.php:95 PO_Items.php:1044 +#: MRPReport.php:762 OffersReceived.php:95 PO_Items.php:1049 #: PO_SelectOSPurchOrder.php:216 PO_SelectPurchOrder.php:181 #: SelectCompletedOrder.php:539 SelectCreditItems.php:957 #: SelectOrderItems.php:1437 SelectOrderItems.php:1621 SelectProduct.php:108 @@ -2528,7 +2528,7 @@ msgstr "Úroveň" #: BOMs.php:519 BOMs.php:636 Contracts.php:868 FixedAssetRegister.php:83 -#: InventoryQuantities.php:223 Locations.php:328 MRP.php:549 MRP.php:563 +#: InventoryQuantities.php:223 Locations.php:328 MRP.php:548 MRP.php:562 #: PDFOrdersInvoiced.php:306 PDFOrderStatus.php:272 #: ReorderLevelLocation.php:173 ReorderLevel.php:258 ReorderLevel.php:267 #: StockCounts.php:133 StockReorderLevel.php:49 StockSerialItemResearch.php:78 @@ -2871,8 +2871,8 @@ #: CompanyPreferences.php:472 ConfirmDispatch_Invoice.php:626 #: ConfirmDispatch_Invoice.php:1658 Credit_Invoice.php:1529 #: FixedAssetItems.php:123 FixedAssetItems.php:570 GLBudgets.php:219 -#: GLTags.php:44 GoodsReceived.php:228 GoodsReceived.php:234 -#: GoodsReceived.php:241 GoodsReceived.php:697 Labels.php:262 +#: GLTags.php:44 GoodsReceived.php:230 GoodsReceived.php:236 +#: GoodsReceived.php:243 GoodsReceived.php:699 Labels.php:262 #: MRPCalendar.php:309 Payments.php:852 PcAuthorizeExpenses.php:262 #: PO_AuthoriseMyOrders.php:125 PricesByCost.php:188 PurchData.php:502 #: ReorderLevelLocation.php:156 SelectCreditItems.php:898 SMTPServer.php:63 @@ -3050,7 +3050,7 @@ #: ConfirmDispatch_Invoice.php:268 ContractBOM.php:241 ContractCosting.php:72 #: ContractCosting.php:78 Contracts.php:930 CounterSales.php:699 #: CounterSales.php:2301 Credit_Invoice.php:270 DeliveryDetails.php:783 -#: GoodsReceived.php:88 OrderDetails.php:153 PO_Items.php:714 +#: GoodsReceived.php:88 OrderDetails.php:153 PO_Items.php:712 #: PO_OrderDetails.php:142 PrintCustTrans.php:648 PrintCustTrans.php:711 #: PrintCustTrans.php:749 PrintCustTransPortrait.php:827 #: PrintCustTransPortrait.php:910 PrintCustTransPortrait.php:954 @@ -3075,7 +3075,7 @@ #: ConfirmDispatch_Invoice.php:269 ContractCosting.php:73 #: ContractCosting.php:79 Contracts.php:931 CounterSales.php:700 #: Credit_Invoice.php:271 DeliveryDetails.php:784 DeliveryDetails.php:849 -#: OrderDetails.php:154 PO_Items.php:782 PO_OrderDetails.php:143 +#: OrderDetails.php:154 PO_Items.php:780 PO_OrderDetails.php:143 #: PrintCustTrans.php:649 PrintCustTrans.php:712 PrintCustTrans.php:750 #: PrintCustTransPortrait.php:828 PrintCustTransPortrait.php:911 #: PrintCustTransPortrait.php:955 RecurringSalesOrders.php:321 @@ -3321,12 +3321,12 @@ msgstr "Prosím nápravě tohoto" #: ConfirmDispatch_Invoice.php:653 Credit_Invoice.php:484 -#: GoodsReceived.php:251 +#: GoodsReceived.php:253 msgid "The company information and preferences could not be retrieved" msgstr "Informace o společnosti a preference se nepodařilo získat" #: ConfirmDispatch_Invoice.php:653 Credit_Invoice.php:484 -#: GoodsReceived.php:251 +#: GoodsReceived.php:253 msgid "see your system administrator" msgstr "kontaktujte administrátora" @@ -3346,7 +3346,7 @@ "Tento příkaz byl změněn nebo fakturovány, protože tato dodávka byla zahájena " "bude potvrzeno" -#: ConfirmDispatch_Invoice.php:681 GoodsReceived.php:288 +#: ConfirmDispatch_Invoice.php:681 GoodsReceived.php:290 msgid "Processing halted" msgstr "Zpracování zastaveno" @@ -3437,10 +3437,10 @@ #: Credit_Invoice.php:1070 Credit_Invoice.php:1093 Credit_Invoice.php:1264 #: Credit_Invoice.php:1304 Credit_Invoice.php:1331 Credit_Invoice.php:1352 #: Credit_Invoice.php:1381 Credit_Invoice.php:1407 Credit_Invoice.php:1433 -#: GoodsReceived.php:270 GoodsReceived.php:351 GoodsReceived.php:393 -#: GoodsReceived.php:423 GoodsReceived.php:451 GoodsReceived.php:482 -#: GoodsReceived.php:500 GoodsReceived.php:529 GoodsReceived.php:546 -#: GoodsReceived.php:634 GoodsReceived.php:659 PDFStockCheckComparison.php:122 +#: GoodsReceived.php:272 GoodsReceived.php:353 GoodsReceived.php:395 +#: GoodsReceived.php:425 GoodsReceived.php:453 GoodsReceived.php:484 +#: GoodsReceived.php:502 GoodsReceived.php:531 GoodsReceived.php:548 +#: GoodsReceived.php:636 GoodsReceived.php:661 PDFStockCheckComparison.php:122 #: PDFStockCheckComparison.php:130 PDFStockCheckComparison.php:137 #: PDFStockCheckComparison.php:156 PDFStockCheckComparison.php:175 #: RecurringSalesOrdersProcess.php:321 RecurringSalesOrdersProcess.php:361 @@ -3546,11 +3546,11 @@ #: Credit_Invoice.php:990 Credit_Invoice.php:1029 Credit_Invoice.php:1070 #: Credit_Invoice.php:1093 Credit_Invoice.php:1264 Credit_Invoice.php:1304 #: Credit_Invoice.php:1331 Credit_Invoice.php:1352 Credit_Invoice.php:1381 -#: Credit_Invoice.php:1407 Credit_Invoice.php:1433 GoodsReceived.php:270 -#: GoodsReceived.php:351 GoodsReceived.php:393 GoodsReceived.php:423 -#: GoodsReceived.php:451 GoodsReceived.php:482 GoodsReceived.php:500 -#: GoodsReceived.php:529 GoodsReceived.php:546 GoodsReceived.php:634 -#: GoodsReceived.php:659 PDFStockCheckComparison.php:122 +#: Credit_Invoice.php:1407 Credit_Invoice.php:1433 GoodsReceived.php:272 +#: GoodsReceived.php:353 GoodsReceived.php:395 GoodsReceived.php:425 +#: GoodsReceived.php:453 GoodsReceived.php:484 GoodsReceived.php:502 +#: GoodsReceived.php:531 GoodsReceived.php:548 GoodsReceived.php:636 +#: GoodsReceived.php:661 PDFStockCheckComparison.php:122 #: PDFStockCheckComparison.php:130 PDFStockCheckComparison.php:137 #: PDFStockCheckComparison.php:156 PDFStockCheckComparison.php:175 #: RecurringSalesOrdersProcess.php:321 RecurringSalesOrdersProcess.php:361 @@ -3701,7 +3701,7 @@ msgstr "Umístění skladové evidenci nelze aktualizovat, protože" #: ConfirmDispatch_Invoice.php:950 ContractCosting.php:306 -#: CounterSales.php:1304 Credit_Invoice.php:684 GoodsReceived.php:452 +#: CounterSales.php:1304 Credit_Invoice.php:684 GoodsReceived.php:454 #: ReverseGRN.php:220 SelectCreditItems.php:1360 StockTransfers.php:382 #: StockTransfers.php:392 WorkOrderIssue.php:163 WorkOrderReceive.php:320 #: WorkOrderReceive.php:426 @@ -3789,7 +3789,7 @@ #: ConfirmDispatch_Invoice.php:1119 ContractCosting.php:335 #: CounterSales.php:1474 Credit_Invoice.php:892 Credit_Invoice.php:991 -#: Credit_Invoice.php:1030 GoodsReceived.php:483 +#: Credit_Invoice.php:1030 GoodsReceived.php:485 #: RecurringSalesOrdersProcess.php:362 ReverseGRN.php:249 #: SelectCreditItems.php:1254 WorkOrderIssue.php:194 WorkOrderReceive.php:349 #: WorkOrderReceive.php:456 @@ -3828,7 +3828,7 @@ msgstr "Následující SQL aktualizovat sériové skladě záznam byl použit" #: ConfirmDispatch_Invoice.php:1172 Credit_Invoice.php:946 -#: GoodsReceived.php:546 SelectCreditItems.php:1338 StockAdjustments.php:226 +#: GoodsReceived.php:548 SelectCreditItems.php:1338 StockAdjustments.php:226 #: StockLocTransferReceive.php:172 StockLocTransferReceive.php:285 #: StockTransfers.php:260 StockTransfers.php:368 WorkOrderIssue.php:230 #: WorkOrderIssue.php:285 WorkOrderReceive.php:507 WorkOrderReceive.php:578 @@ -3836,7 +3836,7 @@ msgstr "Sériové fotografie hnutí záznam nemůže být vložen, protože" #: ConfirmDispatch_Invoice.php:1173 Credit_Invoice.php:947 -#: GoodsReceived.php:547 StockAdjustments.php:227 +#: GoodsReceived.php:549 StockAdjustments.php:227 #: StockLocTransferReceive.php:173 StockLocTransferReceive.php:286 #: StockTransfers.php:261 StockTransfers.php:369 WorkOrderIssue.php:231 #: WorkOrderIssue.php:286 WorkOrderReceive.php:508 WorkOrderReceive.php:579 @@ -3949,7 +3949,7 @@ msgid "The fixed asset transaction could not be inserted because" msgstr "Dlouhodobého majetku transakce nemůže být vložen, protože" -#: ConfirmDispatch_Invoice.php:1509 GoodsReceived.php:584 ReverseGRN.php:176 +#: ConfirmDispatch_Invoice.php:1509 GoodsReceived.php:586 ReverseGRN.php:176 #: SupplierCredit.php:1195 SupplierCredit.php:1283 SupplierInvoice.php:1182 #: SupplierInvoice.php:1267 msgid "The following SQL to insert the fixed asset transaction record was used" @@ -4096,18 +4096,18 @@ msgid "to continue" msgstr "pro pokračování" -#: ContractBOM.php:143 CounterSales.php:327 PO_Items.php:966 +#: ContractBOM.php:143 CounterSales.php:327 PO_Items.php:970 #: SelectCreditItems.php:368 SelectOrderItems.php:856 SupplierTenders.php:469 #: WorkOrderEntry.php:151 WorkOrderIssue.php:469 msgid "There is a problem selecting the part records to display because" msgstr "To je problém výběru část záznamy k zobrazení, protože" -#: ContractBOM.php:144 PO_Items.php:967 SupplierTenders.php:470 +#: ContractBOM.php:144 PO_Items.php:971 SupplierTenders.php:470 #: Z_ChangeStockCategory.php:63 Z_ChangeStockCode.php:95 msgid "The SQL statement that failed was" msgstr "Příkazu SQL, který byl neúspěšný" -#: ContractBOM.php:148 PO_Items.php:971 SupplierTenders.php:474 +#: ContractBOM.php:148 PO_Items.php:975 SupplierTenders.php:474 msgid "There are no products to display matching the criteria provided" msgstr "Nejsou žádné výrobky k zobrazení odpovídající kritériím stanoveným" @@ -4118,7 +4118,7 @@ msgstr "" "Smlouvu kusovníku nelze alterned, protože zákazník má již umístěn objednávky" -#: ContractBOM.php:185 PO_Items.php:587 +#: ContractBOM.php:185 PO_Items.php:585 #: includes/SelectOrderItems_IntoCart.inc:26 #: includes/SelectOrderItems_IntoCart.inc:63 msgid "The item" @@ -4138,11 +4138,11 @@ msgid "The item details could not be retrieved" msgstr "Položku Podrobnosti se nepodařilo získat" -#: ContractBOM.php:201 PO_Items.php:608 SelectCreditItems.php:600 +#: ContractBOM.php:201 PO_Items.php:606 SelectCreditItems.php:600 msgid "The SQL used to retrieve the item details but failed was" msgstr "SQL používá k načtení položky detaily, ale nepodařilo se" -#: ContractBOM.php:213 CounterSales.php:422 PO_Items.php:685 +#: ContractBOM.php:213 CounterSales.php:422 PO_Items.php:683 #: SelectOrderItems.php:950 includes/SelectOrderItems_IntoCart.inc:58 #: includes/SelectOrderItems_IntoCart.inc:162 msgid "The item code" @@ -4180,24 +4180,24 @@ msgid "Back To Contract Header" msgstr "Zpět na záhlaví smlouvy" -#: ContractBOM.php:290 PO_Items.php:989 +#: ContractBOM.php:290 PO_Items.php:993 msgid "The supplier category details could not be retrieved because" msgstr "Podrobnosti dodavatel kategorie se nepodařilo získat, protože" -#: ContractBOM.php:291 PO_Items.php:990 +#: ContractBOM.php:291 PO_Items.php:994 msgid "The SQL used to retrieve the category details but failed was" msgstr "SQL používá k načtení kategorii detaily, ale nepodařilo se" -#: ContractBOM.php:294 PO_Items.php:993 +#: ContractBOM.php:294 PO_Items.php:997 msgid "Search For Stock Items" msgstr "Hledat na sklade" #: ContractBOM.php:299 CounterSales.php:2113 CounterSales.php:2116 #: DailySalesInquiry.php:44 DailySalesInquiry.php:46 FixedAssetRegister.php:56 #: FixedAssetRegister.php:65 InventoryQuantities.php:155 -#: InventoryQuantities.php:176 InventoryQuantities.php:178 MRP.php:565 +#: InventoryQuantities.php:176 InventoryQuantities.php:178 MRP.php:564 #: MRPReport.php:544 MRPReport.php:546 MRPReschedules.php:161 -#: PDFPriceList.php:194 PDFPrintLabel.php:240 PO_Items.php:997 +#: PDFPriceList.php:194 PDFPrintLabel.php:240 PO_Items.php:1001 #: POReport.php:1486 ReorderLevel.php:187 ReorderLevel.php:189 #: ReorderLevel.php:217 ReorderLevel.php:219 SalesGraph.php:91 #: SalesGraph.php:93 SalesGraph.php:111 SalesGraph.php:113 SalesGraph.php:134 @@ -4214,18 +4214,18 @@ msgid "All" msgstr "Všechny" -#: ContractBOM.php:320 PO_Items.php:1018 SelectCompletedOrder.php:515 +#: ContractBOM.php:320 PO_Items.php:1022 SelectCompletedOrder.php:515 #: SelectCreditItems.php:939 msgid "Enter text extracts in the description" msgstr "Zadejte text extrakty v popisu" -#: ContractBOM.php:323 CounterSales.php:2138 PO_Items.php:1021 +#: ContractBOM.php:323 CounterSales.php:2138 PO_Items.php:1025 #: SelectCompletedOrder.php:518 SelectCreditItems.php:942 #: SelectOrderItems.php:1589 SelectSalesOrder.php:485 SelectWorkOrder.php:173 msgid "Enter extract of the Stock Code" msgstr "Zadejte extrakt skladem zákoníku" -#: ContractBOM.php:329 PO_Items.php:1027 +#: ContractBOM.php:329 PO_Items.php:1031 msgid "Create a New Stock Item" msgstr "Vytvoření nové položky skladem" @@ -4235,22 +4235,22 @@ msgstr "Obrázek" #: ContractBOM.php:368 CounterSales.php:2001 FixedAssetItems.php:465 -#: FixedAssetItems.php:469 PO_Items.php:1068 SelectCreditItems.php:969 +#: FixedAssetItems.php:469 PO_Items.php:1073 SelectCreditItems.php:969 #: SelectOrderItems.php:1449 SelectOrderItems.php:1628 SelectProduct.php:408 #: Stocks.php:709 Stocks.php:713 SupplierTenders.php:517 #: WorkOrderEntry.php:616 WorkOrderIssue.php:676 msgid "No Image" msgstr "Obrázek není k dispozici" -#: ContractBOM.php:390 PO_Items.php:1094 SupplierTenders.php:561 +#: ContractBOM.php:390 PO_Items.php:1102 SupplierTenders.php:561 msgid "Only the first" msgstr "Pouze první" -#: ContractBOM.php:390 PO_Items.php:1094 SupplierTenders.php:561 +#: ContractBOM.php:390 PO_Items.php:1102 SupplierTenders.php:561 msgid "can be displayed" msgstr "mohou být zobrazeny" -#: ContractBOM.php:391 PO_Items.php:1095 SupplierTenders.php:562 +#: ContractBOM.php:391 PO_Items.php:1103 SupplierTenders.php:562 msgid "Please restrict your search to only the parts required" msgstr "Prosím, omezit vyhledávání pouze na požadované části" @@ -4305,7 +4305,7 @@ #: ContractCosting.php:75 ContractCosting.php:81 Contracts.php:933 #: CounterSales.php:703 DeliveryDetails.php:786 DeliveryDetails.php:851 -#: OrderDetails.php:156 PO_Items.php:814 PrintCustTrans.php:651 +#: OrderDetails.php:156 PO_Items.php:812 PrintCustTrans.php:651 #: PrintCustTrans.php:714 PrintCustTrans.php:752 #: PrintCustTransPortrait.php:830 PrintCustTransPortrait.php:913 #: PrintCustTransPortrait.php:957 RecurringSalesOrders.php:323 @@ -4399,7 +4399,7 @@ msgid "The SQL used to close the work order was:" msgstr "SQL použitý k uzavření pracovního příkazu byl:" -#: ContractCosting.php:305 GoodsReceived.php:451 +#: ContractCosting.php:305 GoodsReceived.php:453 #: PDFStockCheckComparison.php:130 ReverseGRN.php:219 StockAdjustments.php:239 #: StockLocTransferReceive.php:297 StockLocTransferReceive.php:306 #: StockTransfers.php:381 StockTransfers.php:391 WorkOrderIssue.php:162 @@ -5068,7 +5068,7 @@ msgid "Quote" msgstr "Citovat" -#: Contracts.php:908 PO_Header.php:795 POReport.php:1487 +#: Contracts.php:908 PO_Header.php:793 POReport.php:1487 #: PO_SelectPurchOrder.php:140 PO_SelectPurchOrder.php:142 #: SalesInquiry.php:1104 SelectContract.php:52 SelectContract.php:58 #: SelectContract.php:64 SelectContract.php:70 SelectContract.php:76 @@ -5991,7 +5991,7 @@ msgid "Credit Note number" msgstr "Dobropis číslo" -#: Credit_Invoice.php:1447 GoodsReceived.php:685 SupplierCredit.php:1297 +#: Credit_Invoice.php:1447 GoodsReceived.php:687 SupplierCredit.php:1297 #: SupplierInvoice.php:1288 WorkOrderIssue.php:354 WorkOrderReceive.php:674 #: Z_BottomUpCosts.php:33 msgid "has been processed" @@ -6419,7 +6419,7 @@ #: CustLoginSetup.php:16 index.php:17 InventoryQuantities.php:147 #: InventoryValuation.php:202 Locations.php:353 Locations.php:412 #: MRPCalendar.php:22 MRPCreateDemands.php:187 MRPDemands.php:28 -#: MRPDemandTypes.php:19 MRP.php:518 MRPPlannedPurchaseOrders.php:267 +#: MRPDemandTypes.php:19 MRP.php:517 MRPPlannedPurchaseOrders.php:267 #: MRPPlannedWorkOrders.php:249 MRPPlannedWorkOrders.php:330 #: PricesByCost.php:9 ReorderLevelLocation.php:13 ReorderLevel.php:173 #: SelectProduct.php:71 StockDispatch.php:220 StockMovements.php:26 @@ -7648,7 +7648,7 @@ msgid "Banked into the" msgstr "Naklonila do" -#: CustomerReceipt.php:841 Payments.php:719 PO_Items.php:258 +#: CustomerReceipt.php:841 Payments.php:719 PO_Items.php:256 #: SelectSalesOrder.php:135 SelectSalesOrder.php:300 SpecialOrder.php:400 msgid "on" msgstr "na" @@ -7870,14 +7870,14 @@ "S cílem vytvořit nový zákazník, musíte se nejprve nastavit alespoň jedno " "prodejní typ / ceník" -#: Customers.php:436 Customers.php:445 includes/ConnectDB_mysqli.inc:35 +#: Customers.php:436 Customers.php:445 includes/ConnectDB_mysqli.inc:29 #: includes/ConnectDB_mysql.inc:29 msgid "Click" msgstr "Klepněte na tlačítko" #: Customers.php:436 Customers.php:445 MRPPlannedPurchaseOrders.php:18 #: MRPPlannedWorkOrders.php:15 MRPReschedules.php:18 MRPShortages.php:17 -#: OffersReceived.php:229 PO_Header.php:437 includes/ConnectDB_mysqli.inc:35 +#: OffersReceived.php:229 PO_Header.php:437 includes/ConnectDB_mysqli.inc:29 #: includes/ConnectDB_mysql.inc:29 msgid "here" msgstr "zde" @@ -7976,7 +7976,7 @@ "kartu Nastavení v hlavním menu a nastavit alespoň jeden jako první" #: Customers.php:550 Customers.php:799 Customers.php:802 index.php:1059 -#: PaymentTerms.php:13 PO_Header.php:1034 PrintCustTrans.php:324 +#: PaymentTerms.php:13 PO_Header.php:1032 PrintCustTrans.php:324 #: PrintCustTransPortrait.php:437 Suppliers.php:680 Suppliers.php:833 #: includes/PO_PDFOrderPageHeader.inc:62 includes/PO_PDFOrderPageHeader.inc:64 msgid "Payment Terms" @@ -8147,7 +8147,7 @@ #: CustomerTypes.php:95 PcAssignCashToTab.php:97 PcClaimExpensesFromTab.php:88 #: PcExpenses.php:96 PcExpensesTypeTab.php:61 PcTabs.php:97 PcTypeTabs.php:87 -#: PO_Items.php:259 SalesTypes.php:88 SelectSalesOrder.php:135 +#: PO_Items.php:257 SalesTypes.php:88 SelectSalesOrder.php:135 #: SelectSalesOrder.php:300 SpecialOrder.php:400 SupplierTypes.php:93 msgid "has been created" msgstr "byl vytvořen" @@ -8839,7 +8839,7 @@ msgid "Discount Category Code" msgstr "Kód slevové skupiny" -#: DiscountCategories.php:90 DiscountCategories.php:231 PO_Header.php:848 +#: DiscountCategories.php:90 DiscountCategories.php:231 PO_Header.php:846 #: SalesCategories.php:262 SuppInvGRNs.php:276 SupplierTenders.php:57 #, php-format msgid "Select" @@ -10426,7 +10426,7 @@ msgstr "Hodnota k dispozici" #: FixedAssetRegister.php:199 FixedAssetRegister.php:223 -#: PDFBankingSummary.php:169 PDFChequeListing.php:176 PO_Items.php:770 +#: PDFBankingSummary.php:169 PDFChequeListing.php:176 PO_Items.php:768 #: includes/PDFSalesAnalysis.inc:71 includes/PDFSalesAnalysis.inc:125 #: includes/PDFSalesAnalysis.inc:178 includes/PDFSalesAnalysis.inc:312 #: includes/PDFSalesAnalysis.inc:364 includes/PDFSalesAnalysis.inc:414 @@ -10790,7 +10790,7 @@ msgid "Req Del Date" msgstr "Req Del Datum" -#: FTP_RadioBeacon.php:57 PO_Header.php:824 PO_Header.php:1050 +#: FTP_RadioBeacon.php:57 PO_Header.php:822 PO_Header.php:1050 #: SelectCompletedOrder.php:590 SelectSalesOrder.php:752 #: SelectSalesOrder.php:768 includes/PDFQuotationPageHeader.inc:31 #: includes/PDFQuotationPortraitPageHeader.inc:30 @@ -12108,17 +12108,17 @@ msgid "Supplier Units" msgstr "Jednotka dodavatele" -#: GoodsReceived.php:86 PO_Items.php:1043 +#: GoodsReceived.php:86 #, fuzzy -msgid "Our Units" +msgid "Our Receiving Units" msgstr "Jednotky" -#: GoodsReceived.php:93 +#: GoodsReceived.php:93 PO_Items.php:1048 #, fuzzy msgid "Conversion" msgstr "Konverzní faktor (na náš UOM)" -#: GoodsReceived.php:93 +#: GoodsReceived.php:93 PO_Items.php:1048 #, fuzzy msgid "Factor" msgstr "Pro" @@ -12143,7 +12143,7 @@ msgid "Total value of goods received" msgstr "Celková hodnota zboží přijatého" -#: GoodsReceived.php:219 +#: GoodsReceived.php:221 msgid "" "Receiving a negative quantity that results in negative stock is prohibited " "by the parameter settings. This delivery of stock cannot be processed until " @@ -12153,15 +12153,15 @@ "nastavení parametrů. Tato dodávka zásob nelze zpracovat, dokud se zásoby " "této položky je opravena." -#: GoodsReceived.php:227 +#: GoodsReceived.php:229 msgid "There is nothing to process" msgstr "Neexistuje nic, co proces" -#: GoodsReceived.php:227 +#: GoodsReceived.php:229 msgid "Please enter valid quantities greater than zero" msgstr "Zadejte prosím platný množství větší než nula" -#: GoodsReceived.php:232 +#: GoodsReceived.php:234 msgid "" "Negative stocks would result by processing a negative delivery - quantities " "must be changed or the stock quantity of the item going negative corrected " @@ -12171,7 +12171,7 @@ "změnit, nebo populaci množství položek bude opraven před tímto negativním " "dodávky budou zpracovány." -#: GoodsReceived.php:238 +#: GoodsReceived.php:240 msgid "" "Entered quantities cannot be greater than the quantity entered on the " "purchase invoice including the allowed over-receive percentage" @@ -12179,14 +12179,14 @@ "Zadané množství nemůže být větší než množství uvedené na faktuře včetně " "povolené přes-přijímat procento" -#: GoodsReceived.php:240 +#: GoodsReceived.php:242 msgid "" "Modify the ordered items on the purchase invoice if you wish to increase the " "quantities" msgstr "" "Změnit objednaného zboží na nákupní faktuře, pokud chcete zvýšit množství" -#: GoodsReceived.php:270 +#: GoodsReceived.php:272 msgid "" "Could not check that the details of the purchase order had not been changed " "by another user because" @@ -12194,11 +12194,11 @@ "Nepodařilo se zkontrolovat, zda údaje v objednávce nebyl změněn jiným " "uživatelem, protože" -#: GoodsReceived.php:271 +#: GoodsReceived.php:273 msgid "The following SQL to retrieve the purchase order details was used" msgstr "Následující SQL získat podrobnosti objednávky bylo použito" -#: GoodsReceived.php:288 +#: GoodsReceived.php:290 msgid "" "This order has been changed or invoiced since this delivery was started to " "be actioned" @@ -12206,11 +12206,11 @@ "Tento příkaz byl změněn nebo fakturované protože to dodávka byla začaly být " "actioned" -#: GoodsReceived.php:288 +#: GoodsReceived.php:290 msgid "To enter a delivery against this purchase order" msgstr "Chcete-li zadat dodání proti této objednávce" -#: GoodsReceived.php:288 +#: GoodsReceived.php:290 msgid "" "it must be re-selected and re-read again to update the changes made by the " "other user" @@ -12218,83 +12218,83 @@ "to musí být re-vybraný a re-číst a aktualizovat změny provedené ostatními " "uživateli" -#: GoodsReceived.php:292 +#: GoodsReceived.php:294 msgid "GL Code of the Line Item" msgstr "GL Kód Line bod" -#: GoodsReceived.php:295 +#: GoodsReceived.php:297 msgid "ShiptRef of the Line Item" msgstr "ShiptRef linie bod" -#: GoodsReceived.php:298 +#: GoodsReceived.php:300 msgid "Contract Reference of the Line Item" msgstr "Smlouva Odkaz na řádkové položky" -#: GoodsReceived.php:302 +#: GoodsReceived.php:304 msgid "Quantity Invoiced of the Line Item" msgstr "Množství fakturovaná linie bod" -#: GoodsReceived.php:305 +#: GoodsReceived.php:307 msgid "Stock Code of the Line Item" msgstr "Skladem Kód Line bod" -#: GoodsReceived.php:308 +#: GoodsReceived.php:310 msgid "Order Quantity of the Line Item" msgstr "Aby Množství Line bod" -#: GoodsReceived.php:311 +#: GoodsReceived.php:313 msgid "Quantity of the Line Item Already Received" msgstr "Množství řádkové položky již obdržela" -#: GoodsReceived.php:317 GoodsReceived.php:688 +#: GoodsReceived.php:319 GoodsReceived.php:690 msgid "Select a different purchase order for receiving goods against" msgstr "Vyberte jinou objednávku pro příjem zboží proti" -#: GoodsReceived.php:319 +#: GoodsReceived.php:321 msgid "Re-read the updated purchase order for receiving goods against" msgstr "Re-read aktualizovaný objednávky pro příjem zboží proti" -#: GoodsReceived.php:351 +#: GoodsReceived.php:353 msgid "" "The standard cost of the item being received cannot be retrieved because" msgstr "Standardní pořizovací cena položky je obdržela, nemůže získat, protože" -#: GoodsReceived.php:352 +#: GoodsReceived.php:354 msgid "The following SQL to retrieve the standard cost was used" msgstr "Následující SQL získat standardní náklady byly použity" -#: GoodsReceived.php:393 +#: GoodsReceived.php:395 msgid "" "The purchase order detail record could not be updated with the quantity " "received because" msgstr "" "Objednávce detail záznamu nelze aktualizovat s množstvím přijaté protože" -#: GoodsReceived.php:394 ReverseGRN.php:128 +#: GoodsReceived.php:396 ReverseGRN.php:128 msgid "The following SQL to update the purchase order detail record was used" msgstr "Následující SQL aktualizovat objednávky detail záznamu byla použita" -#: GoodsReceived.php:423 +#: GoodsReceived.php:425 msgid "A GRN record could not be inserted" msgstr "ZEL záznam nemůže být vložen" -#: GoodsReceived.php:423 +#: GoodsReceived.php:425 msgid "This receipt of goods has not been processed because" msgstr "Toto přijetí zboží nebylo zpracováno, protože" -#: GoodsReceived.php:424 ReverseGRN.php:156 +#: GoodsReceived.php:426 ReverseGRN.php:156 msgid "The following SQL to insert the GRN record was used" msgstr "Následující SQL vložit záznam GRN byla použita" -#: GoodsReceived.php:482 +#: GoodsReceived.php:484 msgid "stock movement records could not be inserted because" msgstr "Záznamy zásob pohybu nemůže být vložen, protože" -#: GoodsReceived.php:500 +#: GoodsReceived.php:502 msgid "Could not check if a batch or lot stock item already exists because" msgstr "Nemohl zkontrolovat, zda šarže na skladě již existuje, protože" -#: GoodsReceived.php:501 +#: GoodsReceived.php:503 msgid "" "The following SQL to test for an already existing controlled but not " "serialised stock item was used" @@ -12302,17 +12302,17 @@ "Následující SQL k testu na již existující kontrolované, ale ne serializoval " "na skladě byla použita" -#: GoodsReceived.php:529 WorkOrderIssue.php:215 WorkOrderReceive.php:492 +#: GoodsReceived.php:531 WorkOrderIssue.php:215 WorkOrderReceive.php:492 #: WorkOrderReceive.php:563 msgid "The serial stock item record could not be inserted because" msgstr "Pořadové skladová položka záznam nemůže být vložen, protože" -#: GoodsReceived.php:530 WorkOrderIssue.php:216 WorkOrderReceive.php:493 +#: GoodsReceived.php:532 WorkOrderIssue.php:216 WorkOrderReceive.php:493 #: WorkOrderReceive.php:564 msgid "The following SQL to insert the serial stock item records was used" msgstr "Následující SQL vložit sériové záznamy na skladě byla použita" -#: GoodsReceived.php:583 ReverseGRN.php:175 SupplierCredit.php:1194 +#: GoodsReceived.php:585 ReverseGRN.php:175 SupplierCredit.php:1194 #: SupplierCredit.php:1282 SupplierInvoice.php:1181 SupplierInvoice.php:1266 msgid "" "CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE The fixed asset " @@ -12321,7 +12321,7 @@ "Critical Error! POZNÁMKA DOWN tuto chybu a požádat o pomoc hmotného majetku " "transakce nemůže být vložen, protože" -#: GoodsReceived.php:603 SupplierInvoice.php:1281 +#: GoodsReceived.php:605 SupplierInvoice.php:1281 msgid "" "CRITICAL ERROR! NOTE DOWN THIS ERROR AND SEEK ASSISTANCE. The fixed asset " "cost and date purchased was not able to be updated because:" @@ -12329,7 +12329,7 @@ "Critical Error! POZNÁMKA DOWN této chyby a hledat pomoc. Investičního " "majetku náklady a datum koupě nemohl být aktualizován, protože:" -#: GoodsReceived.php:604 SupplierInvoice.php:1282 +#: GoodsReceived.php:606 SupplierInvoice.php:1282 msgid "" "The following SQL was used to attempt the update of the cost and the date " "the asset was purchased" @@ -12337,44 +12337,44 @@ "Následující SQL byl použit k pokusu aktualizace nákladů a datum majetku byl " "zakoupen" -#: GoodsReceived.php:634 +#: GoodsReceived.php:636 msgid "The purchase GL posting could not be inserted because" msgstr "Nákup GL vysílání nemohly být zařazeny, protože" -#: GoodsReceived.php:635 ReverseGRN.php:303 +#: GoodsReceived.php:637 ReverseGRN.php:303 msgid "The following SQL to insert the purchase GLTrans record was used" msgstr "Následující SQL vložit na nákup GLTrans záznam byl použit" -#: GoodsReceived.php:653 SelectSalesOrder.php:896 +#: GoodsReceived.php:655 SelectSalesOrder.php:896 msgid "PO" msgstr "PO" -#: GoodsReceived.php:659 ReverseGRN.php:324 +#: GoodsReceived.php:661 ReverseGRN.php:324 msgid "The GRN suspense side of the GL posting could not be inserted because" msgstr "Napětí ZEL straně GL vyslání nemůže být vložen, protože" -#: GoodsReceived.php:660 ReverseGRN.php:325 +#: GoodsReceived.php:662 ReverseGRN.php:325 msgid "The following SQL to insert the GRN Suspense GLTrans record was used" msgstr "Následující SQL vložit GRN napětí GLTrans záznam byl použit" -#: GoodsReceived.php:670 +#: GoodsReceived.php:672 #, fuzzy msgid "Order Completed" msgstr "Dokončeno" -#: GoodsReceived.php:685 ReverseGRN.php:332 +#: GoodsReceived.php:687 ReverseGRN.php:332 msgid "GRN number" msgstr "GRN číslo" -#: GoodsReceived.php:686 +#: GoodsReceived.php:688 msgid "Print this Goods Received Note (GRN)" msgstr "Vytisknout tuto Zboží Přijaté Poznámka (GRN)" -#: GoodsReceived.php:695 +#: GoodsReceived.php:697 msgid "Modify Order Items" msgstr "Změnit pořadí položek" -#: GoodsReceived.php:698 +#: GoodsReceived.php:700 msgid "Process Goods Received" msgstr "Proces přijetí zboží" @@ -14146,103 +14146,103 @@ msgid "Loading requirements from sales orders" msgstr "Načítání požadavků z prodejních objednávek" -#: MRP.php:255 +#: MRP.php:254 msgid "Loading requirements from work orders" msgstr "Načítání požadavků z pracovních příkazů" -#: MRP.php:297 +#: MRP.php:296 msgid "Loading requirements based on mrpdemands" msgstr "Načítání požadavky založené na mrpdemands" -#: MRP.php:317 +#: MRP.php:316 msgid "Loading requirements based on reorder level" msgstr "Načítání požadavky založené na pořadí úrovni" -#: MRP.php:324 +#: MRP.php:323 msgid "Creating supplies table" msgstr "Vytváření zásob tabulka" -#: MRP.php:338 +#: MRP.php:337 msgid "Create of mrpsupplies failed because" msgstr "Vytvořit z mrpsupplies se nezdařila, protože" -#: MRP.php:340 +#: MRP.php:339 msgid "Loading supplies from purchase orders" msgstr "Načítání dodávky z objednávek" -#: MRP.php:366 +#: MRP.php:365 msgid "Loading supplies from inventory on hand" msgstr "Načítání dodávky z inventáře na ruce" -#: MRP.php:407 +#: MRP.php:406 msgid "Loading supplies from work orders" msgstr "Načítání dodávky z pracovních příkazů" -#: MRP.php:436 +#: MRP.php:435 msgid "Creating planned orders table" msgstr "Vytvoření tabulky plánované zakázky" -#: MRP.php:448 +#: MRP.php:447 msgid "Create of mrpplannedorders failed because" msgstr "Vytvořit z mrpplannedorders se nezdařila, protože" -#: MRP.php:467 +#: MRP.php:466 msgid "Processing level" msgstr "Úrovně zpracování" -#: MRP.php:474 +#: MRP.php:473 msgid "End time" msgstr "Čas konce" -#: MRP.php:546 +#: MRP.php:545 msgid "Last Run Details" msgstr "Poslední Spustit Podrobnosti" -#: MRP.php:548 +#: MRP.php:547 msgid "Last Run Time" msgstr "Čas posledního spuštění" -#: MRP.php:550 MRP.php:579 +#: MRP.php:549 MRP.php:578 msgid "Days Leeway" msgstr "Dny volnost" -#: MRP.php:551 +#: MRP.php:550 msgid "Use MRP Demands" msgstr "Použití MRP požaduje" -#: MRP.php:552 +#: MRP.php:551 msgid "Use EOQ" msgstr "Použijte EOQ" -#: MRP.php:553 +#: MRP.php:552 msgid "Use Pan Size" msgstr "Použijte Pan Velikost" -#: MRP.php:554 +#: MRP.php:553 msgid "Use Shrinkage" msgstr "Použijte smrštění" -#: MRP.php:561 +#: MRP.php:560 msgid "This Run Details" msgstr "Tento běh Podrobnosti" -#: MRP.php:580 +#: MRP.php:579 msgid "Use MRP Demands?" msgstr "Použijte MRP požaduje?" -#: MRP.php:582 +#: MRP.php:581 msgid "Use EOQ?" msgstr "Použijte EOQ?" -#: MRP.php:584 +#: MRP.php:583 msgid "Use Pan Size?" msgstr "Použijte Pan velikost?" -#: MRP.php:586 +#: MRP.php:585 msgid "Use Shrinkage?" msgstr "Smrštění použití?" -#: MRP.php:588 +#: MRP.php:587 msgid "Run MRP" msgstr "Běhu MRP" @@ -14718,8 +14718,8 @@ msgid "An official order will be sent to you in due course" msgstr "Oficiální objednávka bude zaslána v pravý čas" -#: OffersReceived.php:180 PO_AuthoriseMyOrders.php:89 PO_Header.php:782 -#: PO_Header.php:787 PO_Header.php:791 PO_Header.php:799 PO_Header.php:805 +#: OffersReceived.php:180 PO_AuthoriseMyOrders.php:89 PO_Header.php:778 +#: PO_Header.php:783 PO_Header.php:788 PO_Header.php:797 PO_Header.php:803 #: PO_SelectOSPurchOrder.php:161 PO_SelectOSPurchOrder.php:163 #: PO_SelectPurchOrder.php:130 PO_SelectPurchOrder.php:132 msgid "Pending" @@ -15445,8 +15445,8 @@ msgid "Expense Code" msgstr "Náklady kód" -#: PcAssignCashToTab.php:215 PO_AuthoriseMyOrders.php:90 PO_Header.php:783 -#: PO_Header.php:788 PO_Header.php:800 PO_Header.php:804 +#: PcAssignCashToTab.php:215 PO_AuthoriseMyOrders.php:90 PO_Header.php:779 +#: PO_Header.php:784 PO_Header.php:798 PO_Header.php:802 #: PO_SelectOSPurchOrder.php:166 PO_SelectOSPurchOrder.php:168 #: PO_SelectPurchOrder.php:135 PO_SelectPurchOrder.php:137 msgid "Authorised" @@ -15713,7 +15713,7 @@ #: PcReportTab.php:97 PcReportTab.php:99 PcReportTab.php:107 #: PDFOrdersInvoiced.php:263 PDFOrdersInvoiced.php:265 -#: PDFOrdersInvoiced.php:273 includes/ConnectDB_mysqli.inc:93 +#: PDFOrdersInvoiced.php:273 includes/ConnectDB_mysqli.inc:86 #: includes/ConnectDB_mysql.inc:75 msgid "Database Error" msgstr "Chyba databáze" @@ -16471,7 +16471,7 @@ msgid "Order Status Report - No Data" msgstr "Aby Status Report - žádná data" -#: PDFOrderStatus.php:273 PO_AuthoriseMyOrders.php:60 PO_Header.php:778 +#: PDFOrderStatus.php:273 PO_AuthoriseMyOrders.php:60 PO_Header.php:774 #: PO_OrderDetails.php:123 PO_SelectOSPurchOrder.php:449 #: PO_SelectPurchOrder.php:370 SelectWorkOrder.php:298 SelectWorkOrder.php:333 #: WorkOrderCosting.php:88 WorkOrderCosting.php:100 @@ -16480,7 +16480,7 @@ msgid "Status" msgstr "Stav" -#: PDFOrderStatus.php:301 PO_Header.php:746 PO_OrderDetails.php:115 +#: PDFOrderStatus.php:301 PO_Header.php:742 PO_OrderDetails.php:115 msgid "Not yet printed" msgstr "Ještě netisknuto" @@ -17262,18 +17262,19 @@ msgid "Initiator" msgstr "Iniciátor" -#: PO_AuthoriseMyOrders.php:59 PO_Header.php:722 PO_Items.php:816 +#: PO_AuthoriseMyOrders.php:59 PO_Header.php:722 PO_Items.php:814 #: POReport.php:1429 includes/PDFPickingListHeader.inc:46 msgid "Delivery Date" msgstr "Datum dodání" -#: PO_AuthoriseMyOrders.php:91 PO_Header.php:784 PO_Header.php:798 +#: PO_AuthoriseMyOrders.php:91 PO_Header.php:780 PO_Header.php:796 #: PO_SelectOSPurchOrder.php:176 PO_SelectOSPurchOrder.php:178 #: PO_SelectPurchOrder.php:150 PO_SelectPurchOrder.php:152 msgid "Rejected" msgstr "Odmítnuto" -#: PO_AuthoriseMyOrders.php:92 PO_Header.php:803 PO_SelectOSPurchOrder.php:171 +#: PO_AuthoriseMyOrders.php:92 PO_Header.php:785 PO_Header.php:790 +#: PO_Header.php:801 PO_SelectOSPurchOrder.php:171 #: PO_SelectOSPurchOrder.php:173 PO_SelectPurchOrder.php:145 #: PO_SelectPurchOrder.php:147 msgid "Cancelled" @@ -17334,22 +17335,22 @@ "This is a new order. It must be created before you can change the status" msgstr "" -#: PO_Header.php:93 PO_Items.php:109 SelectSalesOrder.php:126 +#: PO_Header.php:93 PO_Items.php:107 SelectSalesOrder.php:126 #: SelectSalesOrder.php:294 msgid "You do not have permission to authorise this purchase order" msgstr "Nemáte oprávnění k autorizaci této objednávce" -#: PO_Header.php:93 PO_Header.php:117 PO_Header.php:138 PO_Items.php:109 +#: PO_Header.php:93 PO_Header.php:117 PO_Header.php:138 PO_Items.php:107 #: SelectSalesOrder.php:126 SelectSalesOrder.php:294 msgid "This order is for" msgstr "Tato zakázka je pro" -#: PO_Header.php:95 PO_Items.php:106 SelectSalesOrder.php:123 +#: PO_Header.php:95 PO_Items.php:104 SelectSalesOrder.php:123 #: SelectSalesOrder.php:291 msgid "You can only authorise up to" msgstr "Můžete povolit pouze až" -#: PO_Header.php:96 PO_Header.php:120 PO_Header.php:138 PO_Items.php:112 +#: PO_Header.php:96 PO_Header.php:120 PO_Header.php:138 PO_Items.php:110 #: SelectSalesOrder.php:128 SelectSalesOrder.php:294 msgid "If you think this is a mistake please contact the systems administrator" msgstr "" @@ -17482,8 +17483,8 @@ msgid "You can setup authorisations" msgstr "Můžete nastavit oprávnění" -#: PO_Header.php:508 PO_Header.php:579 PO_Items.php:258 PO_Items.php:413 -#: PO_Items.php:706 PO_Items.php:709 PO_OrderDetails.php:86 +#: PO_Header.php:508 PO_Header.php:579 PO_Items.php:256 PO_Items.php:411 +#: PO_Items.php:704 PO_Items.php:707 PO_OrderDetails.php:86 #: PO_PDFPurchOrder.php:185 PO_PDFPurchOrder.php:299 SelectSalesOrder.php:135 #: SelectSalesOrder.php:300 SpecialOrder.php:400 msgid "Purchase Order" @@ -17510,9 +17511,9 @@ msgid "Supplier Name" msgstr "Název dodavatele" -#: PO_Header.php:533 PO_Header.php:940 PO_Header.php:943 PO_Header.php:946 -#: PO_Header.php:949 PO_Header.php:952 PO_Header.php:955 PO_Header.php:1013 -#: PO_Header.php:1016 PO_Header.php:1019 PO_Header.php:1022 PO_Header.php:1025 +#: PO_Header.php:533 PO_Header.php:938 PO_Header.php:941 PO_Header.php:944 +#: PO_Header.php:947 PO_Header.php:950 PO_Header.php:953 PO_Header.php:1011 +#: PO_Header.php:1014 PO_Header.php:1017 PO_Header.php:1020 PO_Header.php:1023 msgid "Address" msgstr "Adresa" @@ -17552,48 +17553,48 @@ msgid "Requisition Ref" msgstr "Žádanka Ref" -#: PO_Header.php:740 +#: PO_Header.php:736 msgid "Date Printed" msgstr "Vytištěno" -#: PO_Header.php:755 +#: PO_Header.php:751 msgid "Allow Reprint" msgstr "Povolit Dotisk" -#: PO_Header.php:762 +#: PO_Header.php:758 msgid "Reprint Now" msgstr "Dotisk teď" -#: PO_Header.php:772 +#: PO_Header.php:768 msgid "Receive this order" msgstr "Přijmout tuto objednávku" -#: PO_Header.php:776 +#: PO_Header.php:772 #, fuzzy msgid "New Purchase Order" msgstr "Nákupní objednávka" -#: PO_Header.php:811 +#: PO_Header.php:809 msgid "Status Comment" msgstr "Stav komentář" -#: PO_Header.php:816 +#: PO_Header.php:814 msgid "Status Update" msgstr "Status Update" -#: PO_Header.php:823 +#: PO_Header.php:821 msgid "Warehouse Info" msgstr "Sklad Info" -#: PO_Header.php:825 +#: PO_Header.php:823 msgid "Supplier Info" msgstr "Dodavatel Info" -#: PO_Header.php:830 includes/PDFPickingListHeader.inc:13 +#: PO_Header.php:828 includes/PDFPickingListHeader.inc:13 msgid "Warehouse" msgstr "Sklad" -#: PO_Header.php:894 +#: PO_Header.php:892 msgid "" "The default stock location set up for this user is not a currently defined " "stock location" @@ -17601,27 +17602,27 @@ "Výchozí umístění skladu nastavit pro tohoto uživatele není v současnosti " "definován Umístění skladu" -#: PO_Header.php:895 +#: PO_Header.php:893 msgid "Your system administrator needs to amend your user record" msgstr "Správce systému musí změnit své uživatelské záznam" -#: PO_Header.php:937 +#: PO_Header.php:935 msgid "Delivery Contact" msgstr "Dodací Kontakt" -#: PO_Header.php:962 +#: PO_Header.php:960 msgid "De... [truncated message content] |