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'], + ... [truncated message content] |
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'], + ... [truncated message content] |
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']... [truncated message content] |
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']... [truncated message content] |
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> + ... [truncated message content] |
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> + ... [truncated message content] |
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') . "', - ... [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') . "', - ... [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'].' ... [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'].' ... [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'... [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'... [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 . "', - suppdeladdres... [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 . "', - suppdeladdres... [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" msgs... [truncated message content] |