From: <rc...@us...> - 2014-06-12 18:46:47
|
Revision: 6750 http://sourceforge.net/p/web-erp/reponame/6750 Author: rchacon Date: 2014-06-12 18:46:41 +0000 (Thu, 12 Jun 2014) Log Message: ----------- Minor improvements. Modified Paths: -------------- trunk/SupplierInvoice.php trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2014-06-12 16:15:57 UTC (rev 6749) +++ trunk/SupplierInvoice.php 2014-06-12 18:46:41 UTC (rev 6750) @@ -35,10 +35,9 @@ } else { $SupplierName=$_SESSION['SuppTrans']->SupplierName; } - -echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/transactions.png" title="' . _('Supplier Invoice') . '" alt="" /> - ' . ' ' . _('Enter Supplier Invoice:') . ' ' . $SupplierName; -echo '</p>'; +echo '<p class="page_title_text"><img alt="" src="'.$RootPath . '/css/' . $Theme . + '/images/transactions.png" title="' . _('Supplier Invoice') . '" />' . ' ' . + _('Enter Supplier Invoice') . ': ' . $SupplierName . '</p>'; if (isset($_GET['SupplierID']) AND $_GET['SupplierID']!=''){ /*It must be a new invoice entry - clear any existing invoice details from the SuppTrans object and initiate a newy*/ Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-06-12 16:15:57 UTC (rev 6749) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-06-12 18:46:41 UTC (rev 6750) @@ -8,7 +8,7 @@ "Project-Id-Version: WebERP 4.081\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-02-08 17:33+1300\n" -"PO-Revision-Date: 2014-06-12 10:12-0600\n" +"PO-Revision-Date: 2014-06-12 11:56-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -12738,7 +12738,7 @@ #: FreightCosts.php:354 msgid "Destination Zone" -msgstr "" +msgstr "Zona de destino" #: FreightCosts.php:356 msgid "Rate per Cubic Metre" @@ -12943,7 +12943,7 @@ #: geocode.php:54 msgid "Customer Code: " -msgstr "" +msgstr "Código de cliente: " #: geocode.php:89 msgid "failed to geocode." @@ -21691,7 +21691,7 @@ #: PO_SelectOSPurchOrder.php:9 SelectProduct.php:408 StockStatus.php:403 #: StockUsage.php:199 msgid "Search Outstanding Purchase Orders" -msgstr "Buscar Órdenes de Compra Pendientes" +msgstr "Buscar órdenes de compra pendientes" #: PO_SelectOSPurchOrder.php:46 PO_SelectPurchOrder.php:35 msgid "The Order Number entered" @@ -23507,26 +23507,26 @@ #: StockQuantityByDate.php:71 StockStatus.php:64 StockTransfers.php:575 #: StockUsage.php:191 msgid "Show Stock Status" -msgstr "Mostrar Estado de Existencias" +msgstr "Mostrar estado del inventario" #: PurchData.php:771 SelectProduct.php:400 StockCostUpdate.php:195 #: StockLocMovements.php:53 StockMovements.php:61 StockReorderLevel.php:109 #: StockUsage.php:193 msgid "Show Stock Movements" -msgstr "Mostrar Movimiento de Existencias" +msgstr "Mostrar movimientos del inventario" #: PurchData.php:772 SelectProduct.php:405 SelectSalesOrder.php:6 #: StockAdjustments.php:522 StockCostUpdate.php:197 StockMovements.php:207 #: StockReorderLevel.php:111 StockStatus.php:400 StockTransfers.php:581 #: StockUsage.php:195 msgid "Search Outstanding Sales Orders" -msgstr "Buscar Órdenes de Compra Pendientes" +msgstr "Buscar órdenes de venta pendientes" #: PurchData.php:773 SelectProduct.php:406 StockAdjustments.php:524 #: StockCostUpdate.php:198 StockMovements.php:208 StockReorderLevel.php:112 #: StockStatus.php:401 StockTransfers.php:583 StockUsage.php:197 msgid "Search Completed Sales Orders" -msgstr "Buscar Pedidos de Venta Completadas" +msgstr "Buscar ordenes de venta completadas" #: RecurringSalesOrders.php:13 msgid "Recurring Orders" @@ -26766,15 +26766,15 @@ #: StockMovements.php:206 StockReorderLevel.php:110 StockTransfers.php:579 #: StockUsage.php:93 msgid "Show Stock Usage" -msgstr "Mostrar Uso de Existencias" +msgstr "Mostrar uso del inventario" #: SelectProduct.php:409 msgid "Search All Purchase Orders" -msgstr "Buscar Todas las Órdenes de Compra" +msgstr "Buscar todas las órdenes de compra" #: SelectProduct.php:410 msgid "Show Part Picture (if available)" -msgstr "Ver Imágen del código (si existe)" +msgstr "Mostrar imagen del artículo (si está disponible)" #: SelectProduct.php:413 msgid "View Costed Bill Of Material" @@ -26782,7 +26782,7 @@ #: SelectProduct.php:414 msgid "Where This Item Is Used" -msgstr "Donde este Artículo es Usado" +msgstr "Dónde se usa este artículo" #: SelectProduct.php:417 msgid "Where This Labour Item Is Used" @@ -26790,7 +26790,7 @@ #: SelectProduct.php:423 msgid "Quantity Adjustments" -msgstr "Ajustes de Cantidad" +msgstr "Ajustes de cantidad" #: SelectProduct.php:474 msgid "Purchase this Item from" @@ -32345,7 +32345,7 @@ #: SupplierInvoice.php:16 msgid "Enter Supplier Invoice" -msgstr "Crear Factura de Proveedor" +msgstr "Introduzca factura del proveedor" #: SupplierInvoice.php:39 msgid "Supplier Invoice" @@ -32353,7 +32353,7 @@ #: SupplierInvoice.php:40 msgid "Enter Supplier Invoice:" -msgstr "Introduzca Factura de Proveedor:" +msgstr "Introduzca factura del proveedor:" #: SupplierInvoice.php:128 msgid "" @@ -32423,7 +32423,7 @@ #: SupplierInvoice.php:627 msgid "Supplier Invoice Reference" -msgstr "Referencia Fatura proveedor" +msgstr "Referencia factura del proveedor" #: SupplierInvoice.php:628 msgid "The input should not be blank and should be less than 20 characters" |
From: <te...@us...> - 2014-06-16 06:01:16
|
Revision: 6754 http://sourceforge.net/p/web-erp/reponame/6754 Author: tehonu Date: 2014-06-16 06:01:12 +0000 (Mon, 16 Jun 2014) Log Message: ----------- New function Related Items. Useful for online shops and other internal business needs Modified Paths: -------------- trunk/SelectProduct.php trunk/sql/mysql/upgrade4.11-4.12.sql Added Paths: ----------- trunk/RelatedItemsUpdate.php Added: trunk/RelatedItemsUpdate.php =================================================================== --- trunk/RelatedItemsUpdate.php (rev 0) +++ trunk/RelatedItemsUpdate.php 2014-06-16 06:01:12 UTC (rev 6754) @@ -0,0 +1,208 @@ +<?php + +include('includes/session.inc'); + +$Title = _('Update Related Items'); + +include('includes/header.inc'); +include('includes/SQL_CommonFunctions.inc'); + +//initialise no input errors assumed initially before we test +$InputError = 0; + + +if (isset($_GET['Item'])){ + $Item = trim(mb_strtoupper($_GET['Item'])); +}elseif (isset($_POST['Item'])){ + $Item = trim(mb_strtoupper($_POST['Item'])); +} +if (isset($_GET['Related'])){ + $Related = trim(mb_strtoupper($_GET['Related'])); +}elseif (isset($_POST['Related'])){ + $Related = trim(mb_strtoupper($_POST['Related'])); +} +echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/inventory.png" title="' . _('Search') . '" alt="" />' . $Title . '</p>'; + +echo '<a href="' . $RootPath . '/SelectProduct.php">' . _('Back to Items') . '</a><br />'; + + +$result = DB_query("SELECT stockmaster.description + FROM stockmaster + WHERE stockmaster.stockid='".$Item."'",$db); +$myrow = DB_fetch_row($result); + +if (DB_num_rows($result)==0){ + prnMsg( _('The part code entered does not exist in the database') . ': ' . $Item . _('Only valid parts can have related items entered against them'),'error'); + $InputError=1; +} + + +if (!isset($Item)){ + echo '<p>'; + prnMsg (_('An item must first be selected before this page is called') . '. ' . _('The product selection page should call this page with a valid product code'),'error'); + include('includes/footer.inc'); + exit; +} + +$PartDescription = $myrow[0]; + +if (isset($_POST['submit'])) { + + /* actions to take once the user has clicked the submit button + ie the page has called itself with some user input */ + + //first off validate inputs sensible + // This gives some date in 1999?? $ZeroDate = Date($_SESSION['DefaultDateFormat'],Mktime(0,0,0,0,0,0)); + + $result_related = DB_query("SELECT stockmaster.description, + stockmaster.mbflag + FROM stockmaster + WHERE stockmaster.stockid='".$_POST['Related']."'",$db); + $myrow_related = DB_fetch_row($result_related); + + if (DB_num_rows($result_related)==0){ + prnMsg( _('The part code entered as related item does not exist in the database') . ': ' . $_POST['Related'] . _('Only valid parts can be related items'),'error'); + $InputError=1; + } + + $sql = "SELECT related + FROM relateditems + WHERE stockid='".$Item."' + AND related = '" . $_POST['Related'] . "'"; + $result = DB_query($sql, $db); + $myrow = DB_fetch_row($result); + + if (DB_num_rows($result)!=0){ + prnMsg( _('This related item has already been entered.') , 'warn'); + $InputError =1; + } + + if ($InputError !=1) { + $sql = "INSERT INTO relateditems (stockid, + related) + VALUES ('" . $Item . "', + '" . $_POST['Related'] . "')"; + $ErrMsg = _('The new related item could not be added'); + $result = DB_query($sql,$db,$ErrMsg); + + prnMsg($_POST['Related'] . ' ' . _('is now related to') . ' ' . $Item,'success'); + + /* It is safe to assume that, if A is related to B, B is related to A */ + $sql_reverse = "SELECT related + FROM relateditems + WHERE stockid='".$_POST['Related']."' + AND related = '" . $Item . "'"; + $result_reverse = DB_query($sql_reverse, $db); + $myrow_reverse = DB_fetch_row($result_reverse); + + if (DB_num_rows($myrow_reverse)==0){ + $sql = "INSERT INTO relateditems (stockid, + related) + VALUES ('" . $_POST['Related'] . "', + '" . $Item . "')"; + $ErrMsg = _('The new related item could not be added'); + $result = DB_query($sql,$db,$ErrMsg); + prnMsg($Item . ' ' . _('is now related to') . ' ' . $_POST['Related'],'success'); + } + } + + unset($_POST['Related']); + +} elseif (isset($_GET['delete'])) { +//the link to delete a selected record was clicked instead of the submit button + + /* Again it is safe to assume that we have to delete both relations A to B and B to A */ + + $sql="DELETE FROM relateditems + WHERE (stockid = '". $Item ."' AND related ='". $_GET['Related'] ."') + OR (stockid = '". $_GET['Related'] ."' AND related ='". $Item ."')"; + $ErrMsg = _('Could not delete this relationshop'); + $result = DB_query($sql,$db,$ErrMsg); + prnMsg( _('This relationship has been deleted'),'success'); + +} + +//Always do this stuff + +$sql = "SELECT stockmaster.stockid, + stockmaster.description + FROM stockmaster, relateditems + WHERE stockmaster.stockid = relateditems.related + AND relateditems.stockid='".$Item."'"; + +$result = DB_query($sql,$db); + +if (DB_num_rows($result) > 0) { + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; + echo '<div>'; + echo '<table class="selection"> + <tr> + <th colspan="3"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />' . + _('Related Items To') . ': + <input type="text" required="required" autofocus="autofocus" name="Item" size="22" value="' . $Item . '" maxlength="20" /> + <input type="submit" name="NewPart" value="' . _('List Related Items') . '" /></th> + </tr>'; + + echo '<tbody> + <tr> + <th class="ascending">' . _('Code') . '</th> + <th class="ascending">' . _('Description') . '</th> + <th>' . _('Delete') . '</th> + </tr>'; + + $k=0; //row colour counter + while ($myrow = DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + + echo '<td>' . $myrow['stockid'] . '</td> + <td>' . $myrow['description'] . '</td>'; + echo '<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Item=' . $Item . '&Related=' . $myrow['stockid'] . '&delete=yes" onclick="return confirm(\'' . _('Are you sure you wish to delete this relationship?') . '\');">' . _('Delete') . '</a></td>'; + echo '</tr>'; + + } + //END WHILE LIST LOOP + echo '</tbody></table><br />'; + echo '</div> + </form>'; +} else { + prnMsg(_('There are no items related set up for this part'),'warn'); +} + +echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Item=' . $Item . '">'; +echo '<div>'; +echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; +if (isset($_GET['Edit'])){ + /*the price sent with the get is sql format price so no need to filter */ + $_POST['Related'] = $_GET['Related']; +} + +echo '<br /><table class="selection">'; + +echo '<tr><th colspan="5"><h3>' . $Item . ' - ' . $PartDescription . '</h3></th></tr>'; + +echo '<tr><td>' . _('Related Item Code') . ':</td> + <td> + <input type="text" class="text" required="required" name="Related" size="21" maxlength="20" value="'; + if (isset($_POST['Related'])) { + echo $_POST['Related']; + } + echo '" /> + </td></tr> +</table> +<br /><div class="centre"> +<input type="submit" name="submit" value="' . _('Enter') . '/' . _('Amend Relation') . '" /> +</div>'; + + +echo '</div> + </form>'; +include('includes/footer.inc'); + +?> \ No newline at end of file Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2014-06-14 16:08:55 UTC (rev 6753) +++ trunk/SelectProduct.php 2014-06-16 06:01:12 UTC (rev 6754) @@ -501,6 +501,7 @@ } echo '<a href="' . $RootPath . '/DiscountCategories.php?StockID=' . $StockID . '">' . _('Maintain Discount Category') . '</a><br />'; echo '<a href="' . $RootPath . '/StockClone.php?OldStockID=' . $StockID . '">' . _('Clone This Item') . '</a><br />'; + echo '<a href="' . $RootPath . '/RelatedItemsUpdate.php?Item=' . $StockID . '">' . _('Maintain Related Items') . '</a><br />'; echo '<a href="' . $RootPath . '/PriceMatrix.php?StockID=' . $StockID . '">' . _('Maintain Price Matrix') . '</a><br />'; } echo '</td></tr></table>'; Modified: trunk/sql/mysql/upgrade4.11-4.12.sql =================================================================== --- trunk/sql/mysql/upgrade4.11-4.12.sql 2014-06-14 16:08:55 UTC (rev 6753) +++ trunk/sql/mysql/upgrade4.11-4.12.sql 2014-06-16 06:01:12 UTC (rev 6754) @@ -32,6 +32,16 @@ ALTER TABLE `debtortrans` CHANGE `consignment` `consignment` VARCHAR( 20 ) NOT NULL DEFAULT ''; ALTER TABLE `workorders` ADD `closecomments` LONGBLOB NULL DEFAULT NULL ; +CREATE TABLE IF NOT EXISTS `relateditems` ( + `stockid` varchar(20) CHARACTER SET utf8 NOT NULL, + `related` varchar(20) CHARACTER SET utf8 NOT NULL, + PRIMARY KEY (`stockid`,`related`), + UNIQUE KEY `Related` (`related`,`stockid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('RelatedItemsUpdate.php', '2', 'Maintains Related Items'); + UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber'; + |
From: <ex...@us...> - 2014-06-17 01:47:30
|
Revision: 6756 http://sourceforge.net/p/web-erp/reponame/6756 Author: exsonqu Date: 2014-06-17 01:47:25 +0000 (Tue, 17 Jun 2014) Log Message: ----------- 17/06/14 Exson: Add Z_ImportDebtors.php into Utilities menu and scripts table. Modified Paths: -------------- trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.11-4.12.sql Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2014-06-17 01:44:22 UTC (rev 6755) +++ trunk/includes/MainMenuLinksArray.php 2014-06-17 01:47:25 UTC (rev 6756) @@ -559,14 +559,15 @@ $MenuItems['Utilities']['Maintenance']['Caption'] = array( _('Maintain Language Files'), _('Make New Company'), _('Data Export Options'), - _('Import Stock Items from .csv'), - _('Import Price List from CSV file'), + _('Import Stock Items from .csv file'), + _('Import Price List from .csv file'), _('Import Fixed Assets from .csv file'), - _('Import GL Payments Receipts Or Journals From CSV'), + _('Import GL Payments Receipts Or Journals From .csv file'), _('Create new company template SQL file and submit to webERP'), _('Re-calculate brought forward amounts in GL'), _('Re-Post all GL transactions from a specified period'), - _('Purge all old prices')); + _('Purge all old prices'), + _('Import Customers from .csv file')); $MenuItems['Utilities']['Maintenance']['URL'] = array( '/Z_poAdmin.php', '/Z_MakeNewCompany.php', @@ -578,5 +579,6 @@ '/Z_CreateCompanyTemplateFile.php', '/Z_UpdateChartDetailsBFwd.php', '/Z_RePostGLFromPeriod.php', - '/Z_DeleteOldPrices.php'); -?> \ No newline at end of file + '/Z_DeleteOldPrices.php', + '/Z_ImportDebtors.php'); +?> Modified: trunk/sql/mysql/upgrade4.11-4.12.sql =================================================================== --- trunk/sql/mysql/upgrade4.11-4.12.sql 2014-06-17 01:44:22 UTC (rev 6755) +++ trunk/sql/mysql/upgrade4.11-4.12.sql 2014-06-17 01:47:25 UTC (rev 6756) @@ -40,7 +40,7 @@ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('RelatedItemsUpdate.php', '2', 'Maintains Related Items'); - +INSERT INTO scripts VALUES('Z_ImportDebtors.php',15,'Import debtors by csv file'); UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber'; |
From: <dai...@us...> - 2014-06-17 09:50:37
|
Revision: 6758 http://sourceforge.net/p/web-erp/reponame/6758 Author: daintree Date: 2014-06-17 09:50:35 +0000 (Tue, 17 Jun 2014) Log Message: ----------- Show supplier item code in PO without duplicating in the description Modified Paths: -------------- trunk/CustomerReceipt.php trunk/PO_Items.php trunk/PO_PDFPurchOrder.php trunk/includes/PO_PDFOrderPageHeader.inc Modified: trunk/CustomerReceipt.php =================================================================== --- trunk/CustomerReceipt.php 2014-06-17 01:48:53 UTC (rev 6757) +++ trunk/CustomerReceipt.php 2014-06-17 09:50:35 UTC (rev 6758) @@ -132,9 +132,9 @@ $myrow = DB_fetch_array($result); $SuggestedFunctionalExRate = $myrow['rate']; $_SESSION['ReceiptBatch']->CurrDecimalPlaces = $myrow['decimalplaces']; - + } //end else account currency != functional currency - + if ($_POST['Currency']==$_SESSION['ReceiptBatch']->AccountCurrency){ $_SESSION['ReceiptBatch']->ExRate = 1; //ex rate between receipt currency and account currency $SuggestedExRate=1; @@ -146,7 +146,7 @@ /*Calculate cross rate to suggest appropriate exchange rate between receipt currency and account currency */ $SuggestedExRate = $TableExRate/$SuggestedFunctionalExRate; } - + $_SESSION['ReceiptBatch']->BankTransRef = $_POST['BankTransRef']; $_SESSION['ReceiptBatch']->Narrative = $_POST['BatchNarrative']; @@ -267,9 +267,8 @@ <p class="page_title_text"> <img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="" />' . ' ' . _('Summary of Receipt Batch').' </p> - <br />'; - - echo '<table class="selection"> + <br /> + <table class="selection"> <tr> <th>' . _('Batch Number') . '</th> <th>' . _('Date Banked') . '</th> @@ -412,7 +411,7 @@ $BatchDebtorTotal += (($ReceiptItem->Discount + $ReceiptItem->Amount)/$_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate); /*Create a DebtorTrans entry for each customer deposit */ - /*The rate of exchange required here is the rate between the functional (home) currency and the customer receipt currency + /*The rate of exchange required here is the rate between the functional (home) currency and the customer receipt currency * We have the exchange rate between the bank account and the functional home currency $_SESSION['ReceiptBatch']->ExRate * and the exchange rate betwen the currency being paid and the bank account */ @@ -624,7 +623,7 @@ WHERE debtortrans.transno " . LIKE . " '%" . $_POST['CustInvNo'] . "%' AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'"; } - + if ($_SESSION['SalesmanLogin'] != '') { $SQL .= " AND EXISTS ( SELECT * @@ -779,7 +778,7 @@ $SQL = "SELECT bankaccountname, bankaccounts.accountcode, bankaccounts.currcode - FROM bankaccounts + FROM bankaccounts INNER JOIN chartmaster ON bankaccounts.accountcode=chartmaster.accountcode INNER JOIN bankaccountusers @@ -908,7 +907,7 @@ <td><select tabindex="6" name="ReceiptType">'; include('includes/GetPaymentMethods.php'); -/* The array ReceiptTypes is defined from the setup tab of the main menu under +/* The array ReceiptTypes is defined from the setup tab of the main menu under payment methods - the array is populated from the include file GetPaymentMethods.php */ foreach ($ReceiptTypes as $RcptType) { Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2014-06-17 01:48:53 UTC (rev 6757) +++ trunk/PO_Items.php 2014-06-17 09:50:35 UTC (rev 6758) @@ -51,8 +51,8 @@ } else { //ok to update the PO object variables $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price = filter_number_format($_POST['SuppPrice'.$POLine->LineNo])/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor; } - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo]; - $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ItemDescription =$_POST['ItemDescription'.$POLine->LineNo]; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate = $_POST['ReqDelDate'.$POLine->LineNo]; + $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ItemDescription = $_POST['ItemDescription'.$POLine->LineNo]; } } } @@ -634,15 +634,10 @@ } $PurchPrice = ($PurchRow['price']*(1-$ItemDiscountPercent) - $ItemDiscountAmount)/$PurchRow['conversionfactor']; $ConversionFactor = $PurchRow['conversionfactor']; - if ($PurchRow['suppliers_partno']!= $ItemCode){ //only show supplier's part code if not the same as our item code - $SupplierDescription = $PurchRow['suppliers_partno'] .' - '; - } else { - $SupplierDescription = ''; - } if (mb_strlen($PurchRow['supplierdescription'])>2){ - $SupplierDescription .= $PurchRow['supplierdescription']; + $SupplierDescription = $PurchRow['supplierdescription']; } else { - $SupplierDescription .= $ItemRow['description']; + $SupplierDescription = $ItemRow['description']; } $SuppliersUnitOfMeasure = $PurchRow['suppliersuom']; $SuppliersPartNo = $PurchRow['suppliers_partno']; @@ -1073,7 +1068,7 @@ } } } - + $SQLCount = substr($sql,strpos($sql, "FROM")); $SQLCount = substr($SQLCount,0, strpos($SQLCount, "ORDER")); $SQLCount = 'SELECT COUNT(*) '.$SQLCount; @@ -1101,7 +1096,7 @@ if($Offset > $ListPageMax) { $Offset = $ListPageMax; } - + $sql = $sql . "LIMIT " . $_SESSION['DisplayRecordsMax']." OFFSET " . strval($_SESSION['DisplayRecordsMax']*$Offset); @@ -1196,9 +1191,9 @@ else $PageBar .= '<input type="submit" name="Next" value="'._('Next').'" disabled="disabled"/>'; $PageBar .= '</td></tr>'; - + echo '<table cellpadding="1" class="selection">'; echo $PageBar; $TableHeader = '<tr> @@ -1261,7 +1256,7 @@ $PartsDisplayed++; #end of page full new headings if } - + echo $PageBar; #end of while loop echo '</table>'; Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2014-06-17 01:48:53 UTC (rev 6757) +++ trunk/PO_PDFPurchOrder.php 2014-06-17 09:50:35 UTC (rev 6758) @@ -258,12 +258,16 @@ } else { $DisplayLineTotal = '----'; } - $Desc = /*- DELETED: $POLine['suppliers_partno'] . " " . -*/ $POLine['itemdescription']; /*- suppliers_partno is duplicated inside itemdescription -*/ - + /* If the supplier item code is set then use this to display on the PO rather than the businesses item code */ + if (mb_strlen($POLine['suppliers_partno'])>0){ + $ItemCode = $POLine['suppliers_partno']; + } else { + $ItemCode = $POLine['itemcode']; + } $OrderTotal += ($POLine['unitprice'] * $POLine['quantityord']); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x, $YPos, $FormDesign->Data->Column1->Length, $FormDesign->Data->Column1->FontSize, $POLine['itemcode'], 'left'); - $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x, $YPos, $FormDesign->Data->Column2->Length, $FormDesign->Data->Column2->FontSize, $Desc, 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x, $YPos, $FormDesign->Data->Column1->Length, $FormDesign->Data->Column1->FontSize, $ItemCode, 'left'); + $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x, $YPos, $FormDesign->Data->Column2->Length, $FormDesign->Data->Column2->FontSize, $POLine['itemdescription'], 'left'); while (mb_strlen($LeftOvers) > 1) { $YPos -= $line_height; if ($YPos - $line_height <= $Bottom_Margin) { Modified: trunk/includes/PO_PDFOrderPageHeader.inc =================================================================== --- trunk/includes/PO_PDFOrderPageHeader.inc 2014-06-17 01:48:53 UTC (rev 6757) +++ trunk/includes/PO_PDFOrderPageHeader.inc 2014-06-17 09:50:35 UTC (rev 6758) @@ -12,7 +12,7 @@ $pdf->addText($FormDesign->OrderNumber->x,$Page_Height- $FormDesign->OrderNumber->y,$FormDesign->OrderNumber->FontSize, _('Purchase Order Number'). ' ' . $OrderNo); if ($ViewingOnly!=0) { $pdf->addText($FormDesign->ViewingOnly->x,$Page_Height - $FormDesign->ViewingOnly->y,$FormDesign->ViewingOnly->FontSize, _('FOR VIEWING ONLY') . ', ' . _('DO NOT SEND TO SUPPLIER') ); - $pdf->addText($FormDesign->ViewingOnly->x,$Page_Height - $FormDesign->ViewingOnly->y-$line_height,$FormDesign->ViewingOnly->FontSize, _('SUPPLIERS') . ' - ' . _('THIS IS NOT AN ORDER') ); + $pdf->addText($FormDesign->ViewingOnly->x,$Page_Height - $FormDesign->ViewingOnly->y-$line_height,$FormDesign->ViewingOnly->FontSize, _('SUPPLIERS') . ' - ' . _('THIS IS NOT AN ORDER')); } $pdf->addText($FormDesign->PageNumber->x,$Page_Height - $FormDesign->PageNumber->y, $FormDesign->PageNumber->FontSize, _('Page') . ': ' .$PageNumber); /*Now print out the company Tax authority reference */ @@ -81,4 +81,4 @@ $pdf->addText($FormDesign->Headings->Column7->x,$Page_Height - $FormDesign->Headings->Column7->y, $FormDesign->Headings->Column7->FontSize, _('Total') ); /*draw a rectangle to hold the data lines */ $pdf->Rectangle($FormDesign->DataRectangle->x, $Page_Height - $FormDesign->DataRectangle->y, $FormDesign->DataRectangle->width,$FormDesign->DataRectangle->height); -?> +?> \ No newline at end of file |
From: <rc...@us...> - 2014-06-19 14:56:24
|
Revision: 6761 http://sourceforge.net/p/web-erp/reponame/6761 Author: rchacon Date: 2014-06-19 14:56:16 +0000 (Thu, 19 Jun 2014) Log Message: ----------- Resequence transfer options on MainMenuLinksArray.php. Add comments, $BookMark and $ViewTopic on stock-transfer scripts. Spanish and French translation improvements. Modified Paths: -------------- trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockTransfers.php trunk/includes/MainMenuLinksArray.php 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/fr_FR.utf8/LC_MESSAGES/messages.mo trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po Modified: trunk/StockLocTransfer.php =================================================================== --- trunk/StockLocTransfer.php 2014-06-18 03:12:16 UTC (rev 6760) +++ trunk/StockLocTransfer.php 2014-06-19 14:56:16 UTC (rev 6761) @@ -1,8 +1,11 @@ <?php /* $Id$*/ +/* Inventory Transfer - Bulk Dispatch */ include('includes/session.inc'); $Title = _('Inventory Location Transfer Shipment'); +$BookMark = "LocationTransfers"; +$ViewTopic = "Inventory"; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2014-06-18 03:12:16 UTC (rev 6760) +++ trunk/StockLocTransferReceive.php 2014-06-19 14:56:16 UTC (rev 6761) @@ -1,11 +1,14 @@ <?php /* $Id$*/ +/* Inventory Transfer - Receive */ include('includes/DefineSerialItems.php'); include('includes/DefineStockTransfers.php'); include('includes/session.inc'); $Title = _('Inventory Transfer') . ' - ' . _('Receiving'); +$BookMark = "LocationTransfers"; +$ViewTopic = "Inventory"; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); Modified: trunk/StockTransfers.php =================================================================== --- trunk/StockTransfers.php 2014-06-18 03:12:16 UTC (rev 6760) +++ trunk/StockTransfers.php 2014-06-19 14:56:16 UTC (rev 6761) @@ -1,15 +1,14 @@ <?php - /* $Id$*/ +/* Inventory Transfer - Item Dispatch */ include('includes/DefineSerialItems.php'); include('includes/DefineStockTransfers.php'); include('includes/session.inc'); $Title = _('Stock Transfers'); -/* webERP manual links before header.inc */ -$ViewTopic= "Inventory"; $BookMark = "LocationTransfers"; +$ViewTopic = "Inventory"; include('includes/header.inc'); include('includes/SQL_CommonFunctions.inc'); Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2014-06-18 03:12:16 UTC (rev 6760) +++ trunk/includes/MainMenuLinksArray.php 2014-06-19 14:56:16 UTC (rev 6761) @@ -195,9 +195,9 @@ $MenuItems['PO']['Maintenance']['URL'] = array('/SupplierPriceList.php'); $MenuItems['stock']['Transactions']['Caption'] = array( _('Receive Purchase Orders'), - _('Bulk Inventory Transfer') . ' - ' . _('Dispatch'), - _('Bulk Inventory Transfer') . ' - ' . _('Receive'), - _('Inventory Location Transfers'), + _('Inventory Location Transfers'), //"Inventory Transfer - Item Dispatch" + _('Bulk Inventory Transfer') . ' - ' . _('Dispatch'), //"Inventory Transfer - Bulk Dispatch" + _('Bulk Inventory Transfer') . ' - ' . _('Receive'), //"Inventory Transfer - Receive" _('Inventory Adjustments'), _('Reverse Goods Received'), _('Enter Stock Counts'), @@ -206,9 +206,9 @@ _('Fulfill Internal Stock Requests')); $MenuItems['stock']['Transactions']['URL'] = array( '/PO_SelectOSPurchOrder.php', + '/StockTransfers.php?New=Yes', '/StockLocTransfer.php', '/StockLocTransferReceive.php', - '/StockTransfers.php?New=Yes', '/StockAdjustments.php?NewAdjustment=Yes', '/ReverseGRN.php', '/StockCounts.php', Modified: trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/en_US.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/en_US.utf8/LC_MESSAGES/messages.po 2014-06-18 03:12:16 UTC (rev 6760) +++ trunk/locale/en_US.utf8/LC_MESSAGES/messages.po 2014-06-19 14:56:16 UTC (rev 6761) @@ -9,7 +9,7 @@ "Project-Id-Version: WebERP 4.10.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-02-08 17:33+1300\n" -"PO-Revision-Date: 2013-12-14 07:34-0600\n" +"PO-Revision-Date: 2014-06-19 07:44-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: WebERP Translation Team <web-erp-translation@lists." "sourceforge.net>\n" @@ -19731,8 +19731,9 @@ "The quantity in the supplier units is expected to be numeric. Please re-" "enter as a number" msgstr "" -"The quantity in the vendor units is expected to be numeric. Please re-" -"enter as a number" +"The quantity in the vendor units is expected to be numeric. Please re-enter " +"as a number" + #: PO_Items.php:49 msgid "" "The supplier price is expected to be numeric. Please re-enter as a number" @@ -21780,7 +21781,8 @@ #: PurchaseByPrefSupplier.php:401 msgid "" "The supplier inventory quantities could not be retrieved by the SQL because" -msgstr "The vendor inventory quantities could not be retrieved by the SQL because" +msgstr "" +"The vendor inventory quantities could not be retrieved by the SQL because" #: PurchaseByPrefSupplier.php:414 msgid "Bin" @@ -21957,8 +21959,8 @@ "Supplier discount percent must be greater than zero but less than 100 " "percent. This discount record cannot be added." msgstr "" -"Vendor discount percent must be greater than zero but less than 100 " -"percent. This discount record cannot be added." +"Vendor discount percent must be greater than zero but less than 100 percent. " +"This discount record cannot be added." #: PurchData.php:170 msgid "" @@ -40230,7 +40232,7 @@ #: includes/MainMenuLinksArray.php:200 msgid "Inventory Location Transfers" -msgstr "" +msgstr "Inventory Transfer - Item Dispatch" #: includes/MainMenuLinksArray.php:201 msgid "Inventory Adjustments" Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-06-18 03:12:16 UTC (rev 6760) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-06-19 14:56:16 UTC (rev 6761) @@ -8,7 +8,7 @@ "Project-Id-Version: WebERP 4.081\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-02-08 17:33+1300\n" -"PO-Revision-Date: 2014-06-17 16:42-0600\n" +"PO-Revision-Date: 2014-06-19 07:31-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -43037,7 +43037,7 @@ #: includes/MainMenuLinksArray.php:200 msgid "Inventory Location Transfers" -msgstr "Transferencias de ubicación de inventario" +msgstr "Traslado de inventario - Envío de artículo" #: includes/MainMenuLinksArray.php:201 msgid "Inventory Adjustments" Modified: trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po 2014-06-18 03:12:16 UTC (rev 6760) +++ trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po 2014-06-19 14:56:16 UTC (rev 6761) @@ -9,7 +9,7 @@ "Project-Id-Version: weberp 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-02-08 17:33+1300\n" -"PO-Revision-Date: 2014-06-17 18:04-0600\n" +"PO-Revision-Date: 2014-06-19 08:35-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: French <none>\n" "Language: fr_FR\n" @@ -43448,11 +43448,11 @@ #: includes/MainMenuLinksArray.php:198 includes/MainMenuLinksArray.php:199 msgid "Bulk Inventory Transfer" -msgstr "Transfert de stock" +msgstr "Transfert en vrac de stock" #: includes/MainMenuLinksArray.php:200 msgid "Inventory Location Transfers" -msgstr "Transferts de stock inter-sites" +msgstr "Transfert de stock - Expédition d'article " #: includes/MainMenuLinksArray.php:201 msgid "Inventory Adjustments" |
From: <rc...@us...> - 2014-06-22 21:30:31
|
Revision: 6772 http://sourceforge.net/p/web-erp/reponame/6772 Author: rchacon Date: 2014-06-22 21:30:22 +0000 (Sun, 22 Jun 2014) Log Message: ----------- Add $ViewTopic, $BookMark and page_title_text to language files maintenance scripts. Add anchor's id for the languages maintenance scripts bookmarks. Modified Paths: -------------- trunk/Z_poAddLanguage.php trunk/Z_poAdmin.php trunk/Z_poEditLangHeader.php trunk/Z_poEditLangModule.php trunk/Z_poEditLangRemaining.php trunk/Z_poRebuildDefault.php trunk/doc/Manual/ManualSpecialUtilities.html Modified: trunk/Z_poAddLanguage.php =================================================================== --- trunk/Z_poAddLanguage.php 2014-06-22 14:45:35 UTC (rev 6771) +++ trunk/Z_poAddLanguage.php 2014-06-22 21:30:22 UTC (rev 6772) @@ -16,21 +16,24 @@ } -$Title = _('New Language'); - +$Title = _('New Language');// _('Add a New Language to the System') +$ViewTopic = "SpecialUtilities"; +$BookMark = "Z_poAddLanguage";// Anchor's id in the manual's html document. include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/maintenance.png" title="' . + _('Add a New Language to the System') . '" />' . ' ' . + _('Add a New Language to the System') . '</p>'; -$DefaultLanguage = 'en_GB'; // the default language IS English ... +/* Your webserver user MUST have read/write access to here, otherwise you'll be wasting your time */ -/* Your webserver user MUST have read/write access to here, - otherwise you'll be wasting your time */ - -$PathToDefault = './locale/' . $DefaultLanguage . '/LC_MESSAGES/messages.po'; - -echo "<br /> <a href='" . $RootPath . "/Z_poAdmin.php'>" . _('Back to the translation menu') . "</a>"; +echo '<br /> <a href="' . $RootPath . '/Z_poAdmin.php">' . _('Back to the translation menu') . '</a>'; echo '<br /><br /> ' . _('Utility to create a new language file'); echo '<br /> ' . _('Current language is') . ' ' . $_SESSION['Language']; +$DefaultLanguage = 'en_GB';// The default language is English-United Kingdom (British English). +$PathToDefault = './locale/' . $DefaultLanguage . '/LC_MESSAGES/messages.po'; + if (isset($_POST['submit']) AND isset($_POST['NewLanguage'])) { if(mb_strlen($_POST['NewLanguage'])<5 @@ -96,4 +99,4 @@ include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/Z_poAdmin.php =================================================================== --- trunk/Z_poAdmin.php 2014-06-22 14:45:35 UTC (rev 6771) +++ trunk/Z_poAdmin.php 2014-06-22 21:30:22 UTC (rev 6772) @@ -6,12 +6,16 @@ //$PageSecurity = 15; include ('includes/session.inc'); - -$Title = _('UTILITY PAGE') . ' ' . _('that helps maintain language files'); - +$Title = _('UTILITY PAGE') . ' ' . _('that helps maintain language files');// _('Maintain Language Files') +$ViewTopic = "SpecialUtilities"; +$BookMark = "Z_poAdmin";// Anchor's id in the manual's html document. include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/maintenance.png" title="' . + _('Maintain Language Files') . '" />' . ' ' . + _('Maintain Language Files') . '</p>'; -/* check if we have gettext - we're useless without it ... */ +/* Check if we have gettext - we're useless without it... */ if (!function_exists('gettext')){ prnMsg (_('gettext is not installed on this system') . '. ' . _('You cannot use the language files without it'),'error'); @@ -20,9 +24,7 @@ if (!is_writable('./locale/' . $_SESSION['Language'])) { prnMsg(_('You do not have write access to the required files please contact your system administrator'),'error'); -} -else -{ +} else { echo '<p><a href="' . $RootPath . '/Z_poRebuildDefault.php?' . SID . '">' . _('Rebuild the System Default Language File') . '</a>'; echo '<p><a href="' . $RootPath . '/Z_poAddLanguage.php?' . SID . '">' . _('Add a New Language to the System') . '</a>'; echo '<p><a href="' . $RootPath . '/Z_poEditLangHeader.php?' . SID . '">' . _('Edit a Language File Header') . '</a>'; @@ -33,5 +35,4 @@ } include('includes/footer.inc'); - ?> Modified: trunk/Z_poEditLangHeader.php =================================================================== --- trunk/Z_poEditLangHeader.php 2014-06-22 14:45:35 UTC (rev 6771) +++ trunk/Z_poEditLangHeader.php 2014-06-22 21:30:22 UTC (rev 6772) @@ -1,5 +1,4 @@ <?php - /* $Id$ */ /* Steve Kitchen */ @@ -7,15 +6,18 @@ //$PageSecurity = 15; include ('includes/session.inc'); - -$Title = _('Edit Header'); - +$Title = _('Edit Header');// _('Edit a Language File Header') +$ViewTopic = "SpecialUtilities"; +$BookMark = "Z_poEditLangHeader";// Anchor's id in the manual's html document. include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/maintenance.png" title="' . + _('Edit a Language File Header') . '" />' . ' ' . + _('Edit a Language File Header') . '</p>'; -/* Your webserver user MUST have read/write access to here, - otherwise you'll be wasting your time */ +/* Your webserver user MUST have read/write access to here, otherwise you'll be wasting your time */ -echo "<br /> <a href='" . $RootPath . "/Z_poAdmin.php'>" . _('Back to the translation menu') . "</a>"; +echo '<br /> <a href="' . $RootPath . '/Z_poAdmin.php">' . _('Back to the translation menu') . '</a>'; echo '<br /><br /> ' . _('Utility to edit a language file header'); echo '<br /> ' . _('Current language is') . ' ' . $_SESSION['Language']; Modified: trunk/Z_poEditLangModule.php =================================================================== --- trunk/Z_poEditLangModule.php 2014-06-22 14:45:35 UTC (rev 6771) +++ trunk/Z_poEditLangModule.php 2014-06-22 21:30:22 UTC (rev 6772) @@ -1,5 +1,4 @@ <?php - /* $Id$ */ /* Steve Kitchen */ @@ -9,23 +8,26 @@ //$PageSecurity = 15; include ('includes/session.inc'); - -$Title = _('Edit Module'); - +$Title = _('Edit Module');// _('Edit a Language File Module') +$ViewTopic = "SpecialUtilities"; +$BookMark = "Z_poEditLangModule";// Anchor's id in the manual's html document. include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/maintenance.png" title="' . + _('Edit a Language File Module') . '" />' . ' ' . + _('Edit a Language File Module') . '</p>'; -/* Your webserver user MUST have read/write access to here, - otherwise you'll be wasting your time */ +/* Your webserver user MUST have read/write access to here, otherwise you'll be wasting your time */ -$PathToLanguage = './locale/' . $_SESSION['Language'] . '/LC_MESSAGES/messages.po'; -$PathToNewLanguage = './locale/' . $_SESSION['Language'] . '/LC_MESSAGES/messages.po.new'; - echo '<br /> <a href="' . $RootPath . '/Z_poAdmin.php">' . _('Back to the translation menu') . '</a>'; echo '<br /><br /> ' . _('Utility to edit a language file module'); echo '<br /> ' . _('Current language is') . ' ' . $_SESSION['Language']; echo '<br /><br /> ' . _('To change language click on the user name at the top left, change to language desired and click Modify'); echo '<br /> ' . _('Make sure you have selected the correct language to translate!'); +$PathToLanguage = './locale/' . $_SESSION['Language'] . '/LC_MESSAGES/messages.po'; +$PathToNewLanguage = './locale/' . $_SESSION['Language'] . '/LC_MESSAGES/messages.po.new'; + if (isset($_POST['ReMergePO'])){ /*update the messages.po file with any new strings */ Modified: trunk/Z_poEditLangRemaining.php =================================================================== --- trunk/Z_poEditLangRemaining.php 2014-06-22 14:45:35 UTC (rev 6771) +++ trunk/Z_poEditLangRemaining.php 2014-06-22 21:30:22 UTC (rev 6772) @@ -1,5 +1,4 @@ <?php - /* $Id$ */ /* Steve Kitchen */ @@ -10,22 +9,25 @@ include ('includes/session.inc'); -$Title = _('Edit Remaining Items'); - +$Title = _('Edit Remaining Items');// _('Edit Remaining Strings For This Language') +$ViewTopic = "SpecialUtilities"; +$BookMark = "Z_poEditLangRemaining";// Anchor's id in the manual's html document. include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/maintenance.png" title="' . + _('Edit Remaining Strings For This Language') . '" />' . ' ' . + _('Edit Remaining Strings For This Language') . '</p>'; -/* Your webserver user MUST have read/write access to here, - otherwise you'll be wasting your time */ +/* Your webserver user MUST have read/write access to here, otherwise you'll be wasting your time */ -$PathToLanguage = './locale/' . $_SESSION['Language'] . '/LC_MESSAGES/messages.po'; -$PathToNewLanguage = './locale/' . $_SESSION['Language'] . '/LC_MESSAGES/messages.po.new'; - -echo "<br /> <a href='" . $RootPath . "/Z_poAdmin.php'>" . _('Back to the translation menu') . "</a>"; +echo '<br /> <a href="' . $RootPath . '/Z_poAdmin.php">' . _('Back to the translation menu') . '</a>'; echo '<br /><br /> ' . _('Utility to edit a language file module'); echo '<br /> ' . _('Current language is') . ' ' . $_SESSION['Language']; +$PathToLanguage = './locale/' . $_SESSION['Language'] . '/LC_MESSAGES/messages.po'; +$PathToNewLanguage = './locale/' . $_SESSION['Language'] . '/LC_MESSAGES/messages.po.new'; - $PathToLanguage_mo = mb_substr($PathToLanguage,0,strrpos($PathToLanguage,'.')) . '.mo'; +$PathToLanguage_mo = mb_substr($PathToLanguage,0,strrpos($PathToLanguage,'.')) . '.mo'; /* now read in the language file */ Modified: trunk/Z_poRebuildDefault.php =================================================================== --- trunk/Z_poRebuildDefault.php 2014-06-22 14:45:35 UTC (rev 6771) +++ trunk/Z_poRebuildDefault.php 2014-06-22 21:30:22 UTC (rev 6772) @@ -1,33 +1,42 @@ <?php -/* $Id$*/ +/* $Id$*/ +/* This script runs xgettext on the sources to produce a .pot (Portable Object + Template) file, which contains a list of all the translatable strings + extracted from the sources. The resultant system default language file + (.pot file) is saved in the .../locale/en_GB.utf8/LC_MESSAGES/messages.po + path. Note: Comments (starting with ///) placed directly before strings + thus marked are made available as hints to translators by helper programs. */ /* Steve Kitchen */ //$PageSecurity = 15; include ('includes/session.inc'); +$Title = _('Rebuild');//_('Rebuild the System Default Language File') +$ViewTopic = "SpecialUtilities"; +$BookMark = "Z_poRebuildDefault";// Anchor's id in the manual's html document. +include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/maintenance.png" title="' . + _('Rebuild the System Default Language File') . '" />' . ' ' . + _('Rebuild the System Default Language File') . '</p>'; -$Title = _('Rebuild'); +/* Your webserver user MUST have read/write access to here, otherwise you'll be wasting your time */ -include('includes/header.inc'); +echo '<br /> <a href="' . $RootPath . '/Z_poAdmin.php">' . _('Back to the translation menu') . '</a>'; +echo '<br /><br /> ' . _('Utility page to rebuild the system default language file'); -/* Your webserver user MUST have read/write access to here, - otherwise you'll be wasting your time */ - -$PathToDefault = './locale/en_GB.utf8/LC_MESSAGES/messages.po'; +$PathToDefault = './locale/en_GB.utf8/LC_MESSAGES/messages.po'; $FilesToInclude = '*.php includes/*.inc includes/*.php api/*.php reportwriter/languages/en_US/reports.php'; -$xgettextCmd = 'xgettext --no-wrap --from-code=utf-8 -L php -o ' . $PathToDefault . ' ' . $FilesToInclude; +$xgettextCmd = 'xgettext --no-wrap --from-code=utf-8 -L php -o ' . $PathToDefault . ' ' . $FilesToInclude; -echo "<br /> <a href='" . $RootPath . "/Z_poAdmin.php'>" . _('Back to the translation menu') . "</a>"; -echo '<br /><br /> ' . _('Utility page to rebuild the system default language file'); - if (isset($_POST['submit'])) { echo '<br /><table><tr><td>'; echo '<form method="post" action=' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?' . SID . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; -/* Run xgettext to recreate the default message.po language file */ + /// Run xgettext to recreate the default message.po language file. prnMsg (_('Rebuilding the default language file ') . '.....<br />', 'info', ' '); @@ -39,8 +48,10 @@ echo '</form>'; echo '</td></tr></table>'; -} else { /* set up the page for editing */ +} else { + /* set up the page for editing */ + echo '<div class="centre">'; echo '<br />'; prnMsg (_('Every new language creates a new translation file from the system default one') . '.<br />' . @@ -58,5 +69,4 @@ } include('includes/footer.inc'); - ?> Modified: trunk/doc/Manual/ManualSpecialUtilities.html =================================================================== --- trunk/doc/Manual/ManualSpecialUtilities.html 2014-06-22 14:45:35 UTC (rev 6771) +++ trunk/doc/Manual/ManualSpecialUtilities.html 2014-06-22 21:30:22 UTC (rev 6772) @@ -29,3 +29,55 @@ <h2>Repost General Ledger from Period</h2> <p>This script Z_RePostGLFromPeriod.php clears the actual data in the table ChartDetails - that contains the movements in each GL account, the movements are then re-calculated by setting all GLTrans to unposted and re-running the posting of all these transactions. This is a desperate measure that should only be undertaken in an extreme situation. Maybe a corrupt database or system crash etc that caused an out of balance trial balance.</p> + +<h2><a id="Z_poAdmin">Maintain Language Files</a></h2> + +<p>We use <b>gettext</b> as the internationalization and localization (i18n) system to write a multilingual program. The most commonly used implementation of gettext is GNU gettext, released by the GNU Project in 1995 as a free software implementation of the system.</p> + +<p>Source code is first modified to use the GNU gettext calls. This is done by wrapping strings that the user will see in the gettext function. To save typing time, and to reduce code clutter, this function is commonly aliased to _, so that the PHP code:</p> + +<div class="centre"> + <pre>echo <b>gettext</b>('<i>Maintain Language Files</i>');</pre> +</div> + +<p>would become:</p> + +<div class="centre"> + <pre>echo <b>_</b>('<i>Maintain Language Files</i>');</pre> +</div> + +<p>Comments (starting with <b>///</b>) placed directly before strings thus marked are made available as hints to translators by helper programs.</p> + +<!-- +To do: Add more information about the translation workflow. e.g. "This script should be run by developers when there are changes in the strings that the user will see." +--> + +<h3><a id="Z_poRebuildDefault">Rebuild the System Default Language File</a></h3> + +<p>This script <b>Z_poRebuildDefault.php</b> runs <b>xgettext</b> on the sources to produce a .pot (<i><b>P</b>ortable <b>O</b>bject <b>T</b>emplate</i>) file, which contains a list of all the translatable strings extracted from the sources. The resultant system default language file (.pot file) is saved in the <b>.../locale/en_GB.utf8/LC_MESSAGES/messages.po</b> path.</p> + +<h3><a id="Z_poAddLanguage">Add a New Language to the System</a></h3> + +<p>This script <b>Z_poAddLanguage.php</b> adds a new language to the system, by creating a new language file (.po file) from the system default language file (.pot file).</p> + +<p>.</p><!-- To do: Add more information about this script. e.g. "This script should be run by developers when..."--> + +<h3><a id="Z_poEditLangHeader">Edit a Language File Header</a></h3> + +<p>.</p><!-- To do: Add more information about this script. e.g. "This script should be run by developers when..."--> + +<h3><a id="Z_poEditLangModule">Edit a Language File Module</a></h3> + +<p>.</p><!-- To do: Add more information about this script. e.g. "This script should be run by developers when..."--> + +<h3><a id="Z_poEditLangRemaining">Edit Remaining Strings For This Language</a></h3> + +<p>.</p><!-- To do: Add more information about this script. e.g. "This script should be run by developers when..."--> + +<h3><a id="Z_poDownloadPoFile">Download messages.po file</a></h3> + +<p>.</p><!-- To do: Add more information about this script. e.g. "This script should be run by developers when..."--> + +<h3><a id="Z_poDownloadMoFile">Download messages.mo file</a></h3> + +<p>.</p><!-- To do: Add more information about this script. e.g. "This script should be run by developers when..."--> |
From: <rc...@us...> - 2014-06-24 20:33:34
|
Revision: 6778 http://sourceforge.net/p/web-erp/reponame/6778 Author: rchacon Date: 2014-06-24 20:33:25 +0000 (Tue, 24 Jun 2014) Log Message: ----------- Add $ViewTopic, $BookMark to Prices.php and minor improvements. Modified Paths: -------------- trunk/Prices.php trunk/doc/Change.log Modified: trunk/Prices.php =================================================================== --- trunk/Prices.php 2014-06-23 16:16:05 UTC (rev 6777) +++ trunk/Prices.php 2014-06-24 20:33:25 UTC (rev 6778) @@ -1,50 +1,49 @@ <?php - /* $Id$*/ include('includes/session.inc'); - $Title = _('Item Prices'); +$ViewTopic = 'Prices'; +/*$BookMark = '';// Anchor's id in the manual's html document.*/ +include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/money_add.png" title="' . + _('Search') . '" />' . ' ' . + $Title . '</p>'; -include('includes/header.inc'); +echo '<a href="' . $RootPath . '/SelectProduct.php">' . _('Back to Items') . '</a><br />'; + include('includes/SQL_CommonFunctions.inc'); //initialise no input errors assumed initially before we test $InputError = 0; - -if (isset($_GET['Item'])){ +if (isset($_GET['Item'])) { $Item = trim(mb_strtoupper($_GET['Item'])); -}elseif (isset($_POST['Item'])){ +} elseif (isset($_POST['Item'])) { $Item = trim(mb_strtoupper($_POST['Item'])); } -if (!isset($_POST['TypeAbbrev']) OR $_POST['TypeAbbrev']==''){ +if (!isset($_POST['TypeAbbrev']) OR $_POST['TypeAbbrev']=='') { $_POST['TypeAbbrev'] = $_SESSION['DefaultPriceList']; } -if (!isset($_POST['CurrAbrev'])){ +if (!isset($_POST['CurrAbrev'])) { $_POST['CurrAbrev'] = $_SESSION['CompanyRecord']['currencydefault']; } -echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . _('Search') . '" alt="" />' . $Title . '</p>'; - -echo '<a href="' . $RootPath . '/SelectProduct.php">' . _('Back to Items') . '</a><br />'; - - $result = DB_query("SELECT stockmaster.description, stockmaster.mbflag FROM stockmaster WHERE stockmaster.stockid='".$Item."'",$db); $myrow = DB_fetch_row($result); -if (DB_num_rows($result)==0){ +if (DB_num_rows($result)==0) { prnMsg( _('The part code entered does not exist in the database') . '. ' . _('Only valid parts can have prices entered against them'),'error'); $InputError=1; } - -if (!isset($Item)){ +if (!isset($Item)) { echo '<p>'; prnMsg (_('An item must first be selected before this page is called') . '. ' . _('The product selection page should call this page with a valid product code'),'error'); include('includes/footer.inc'); @@ -53,7 +52,7 @@ $PartDescription = $myrow[0]; -if ($myrow[1]=='K'){ +if ($myrow[1]=='K') { prnMsg(_('The part selected is a kit set item') .', ' . _('these items explode into their components when selected on an order') . ', ' . _('prices must be set up for the components and no price can be set for the whole kit'),'error'); exit; } @@ -293,18 +292,17 @@ echo '<tr><td>' . _('Currency') . ':</td> <td><select name="CurrAbrev">'; while ($myrow = DB_fetch_array($result)) { - echo '<option'; + echo '<option '; if ($myrow['currabrev']==$_POST['CurrAbrev']) { - echo ' selected="selected"'; + echo 'selected="selected" '; } - echo ' value="' . $myrow['currabrev'] . '">' . $CurrencyName[$myrow['currabrev']] . '</option>'; -} // End while loop + echo 'value="' . $myrow['currabrev'] . '">' . $CurrencyName[$myrow['currabrev']] . '</option>'; +}// End while loop +echo '</select></td></tr>'; DB_free_result($result); -echo '</select></td> - </tr> - <tr> +echo '<tr> <td>' . _('Sales Type Price List') . ':</td> <td><select name="TypeAbbrev">'; @@ -312,16 +310,14 @@ $result = DB_query($SQL,$db); while ($myrow = DB_fetch_array($result)) { + echo '<option '; if ($myrow['typeabbrev']==$_POST['TypeAbbrev']) { - echo '<option selected="selected" value="'; - } else { - echo '<option value="'; + echo 'selected="selected" '; } - echo $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; + echo 'value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; +}// End while loop +echo '</select></td></tr>'; -} //end while loop -echo '</select></td></tr>'; - DB_free_result($result); if (!isset($_POST['StartDate'])){ @@ -431,4 +427,4 @@ } // end function ReSequenceEffectiveDates -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-06-23 16:16:05 UTC (rev 6777) +++ trunk/doc/Change.log 2014-06-24 20:33:25 UTC (rev 6778) @@ -1,4 +1,5 @@ webERP Change Log +24/06/14 RChacon: Add $ViewTopic, $BookMark to Prices.php and minor improvements. 23/06/14 Tim: Fixed the GL account validation pop up error in MiscFunctions.js. 23/06/14 Exson: Fixed the bug that the sales order line's quantity will be update to zero but it show no change in appearance in SelectOrderItems.php. 22/06/14 Tim: Replace now() with CURRENT_TIMESTAMP in MRP.php to get time stamp to meet ANSI standard. |
From: <rc...@us...> - 2014-06-27 17:32:18
|
Revision: 6784 http://sourceforge.net/p/web-erp/reponame/6784 Author: rchacon Date: 2014-06-27 17:32:13 +0000 (Fri, 27 Jun 2014) Log Message: ----------- Add code-comments, $ViewTopic, $BookMark, page_title_text and code to update NewStockID if OldStockID and SelectedStockItem are the same in Z_ChangeStockCode.php. Add id to the "Change An Inventory Item Code" topic anchor in ManualSpecialUtilities.html. Modified Paths: -------------- trunk/Z_ChangeStockCode.php trunk/doc/Change.log trunk/doc/Manual/ManualSpecialUtilities.html Modified: trunk/Z_ChangeStockCode.php =================================================================== --- trunk/Z_ChangeStockCode.php 2014-06-27 15:40:41 UTC (rev 6783) +++ trunk/Z_ChangeStockCode.php 2014-06-27 17:32:13 UTC (rev 6784) @@ -1,10 +1,19 @@ <?php +/* $Id$*/ +/* This script is an utility to change an inventory item code. */ +/* It uses function ChangeFieldInTable($TableName, $FieldName, $OldValue, + $NewValue, $db) from .../includes/MiscFunctions.php.*/ -/* $Id$*/ - include ('includes/session.inc'); -$Title = _('UTILITY PAGE Change A Stock Code'); +$Title = _('UTILITY PAGE Change A Stock Code');// _('Change An Inventory Item Code') +$ViewTopic = 'SpecialUtilities'; +$BookMark = 'Z_ChangeStockCode';// Anchor's id in the manual's html document. include('includes/header.inc'); +echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . + '/images/maintenance.png" title="' . + _('Change An Inventory Item Code') . '" />' . ' ' . + _('Change An Inventory Item Code') . '</p>'; + include('includes/SQL_CommonFunctions.inc'); if (isset($_POST['ProcessStockChange'])){ @@ -143,7 +152,8 @@ ChangeFieldInTable("bom", "component", $_POST['OldStockID'], $_POST['NewStockID'], $db); ChangeFieldInTable("bom", "parent", $_POST['OldStockID'], $_POST['NewStockID'], $db); ChangeFieldInTable("stockrequestitems", "stockid", $_POST['OldStockID'], $_POST['NewStockID'], $db); - ChangeFieldInTable("stockdescriptiontranslations", "stockid", $_POST['OldStockID'], $_POST['NewStockID'], $db); + ChangeFieldInTable("stockdescriptiontranslations", "stockid", $_POST['OldStockID'], $_POST['NewStockID'], $db);// Updates the translated item titles (StockTitles) +/* ChangeFieldInTable("Stockdescriptions", "stockid", $_POST['OldStockID'], $_POST['NewStockID'], $db);// Updates the translated item descriptions (StockDescriptions)*/ echo '<br />' . _('Changing any image files'); if (file_exists($_SESSION['part_pics_dir'] . '/' .$_POST['OldStockID'].'.jpg')){ @@ -176,8 +186,13 @@ $ErrMsg = _('The SQL to delete the old stock master record failed'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg,true); echo ' ... ' . _('completed'); + echo '<p>' . _('Stock Code') . ': ' . $_POST['OldStockID'] . ' ' . _('was successfully changed to') . ' : ' . $_POST['NewStockID']; - echo '<p>' . _('Stock Code') . ': ' . $_POST['OldStockID'] . ' ' . _('was successfully changed to') . ' : ' . $_POST['NewStockID']; + // If the current SelectedStockItem is the same as the OldStockID, it updates to the NewStockID: + if ($_SESSION['SelectedStockItem'] == $_POST['OldStockID']) { + $_SESSION['SelectedStockItem'] = $_POST['NewStockID']; + } + } //only do the stuff above if $InputError==0 } @@ -203,4 +218,4 @@ include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-06-27 15:40:41 UTC (rev 6783) +++ trunk/doc/Change.log 2014-06-27 17:32:13 UTC (rev 6784) @@ -1,5 +1,6 @@ webERP Change Log +27/06/14 RChacon: Add code-comments, $ViewTopic, $BookMark, page_title_text and code to update NewStockID if OldStockID and SelectedStockItem are the same in Z_ChangeStockCode.php. Add id to the "Change An Inventory Item Code" topic anchor in ManualSpecialUtilities.html. 27/06/14 Exson: Make tel length in PO_Header.php is as same as field definition in sql. 26/06/14 Exson: Fixed the bug that Select Customers search result inconsistence with Customer receipt search result in SelectCustomer.php. 24/06/14 RChacon: Add $ViewTopic, $BookMark to Prices.php and minor improvements. Modified: trunk/doc/Manual/ManualSpecialUtilities.html =================================================================== --- trunk/doc/Manual/ManualSpecialUtilities.html 2014-06-27 15:40:41 UTC (rev 6783) +++ trunk/doc/Manual/ManualSpecialUtilities.html 2014-06-27 17:32:13 UTC (rev 6784) @@ -16,7 +16,7 @@ <p>This page requires the entry of an existing customer code and the new customer code. The system checks to see the new code entered doesn't already exist and that the code entered for the existing customer does exist. If all is well then the customer code data is changed in all tables through-out the system that refer to the customer code. Due to the extensive changes taking place throughout the database this utility should not be run during normal operating hours.</p> -<h2>Change An Inventory Code</h2> +<h2><a id="Z_ChangeStockCode">Change An Inventory Item Code</a></h2> <p>This page requires the entry of an existing stock code and the new stock code. The system checks to see the new code entered doesn't already exist and that the code entered for the existing item does exist. If all is well then the stock code data is changed in all tables through-out the system. Sales analysis, stock movements, stock locations, Bills of Material, parent and component items, sales order details and purchase order details as well as the Stock Master, pricing and shipment charges. Due to the extensive changes taking place throughout the database this utility should not be run during normal operating hours.</p> |
From: <dai...@us...> - 2014-07-16 10:42:42
|
Revision: 6789 http://sourceforge.net/p/web-erp/reponame/6789 Author: daintree Date: 2014-07-16 10:42:39 +0000 (Wed, 16 Jul 2014) Log Message: ----------- agaluski: add standard cost to stock movement record for adjustments Modified Paths: -------------- trunk/GLJournal.php trunk/StockAdjustments.php trunk/SupplierTypes.php trunk/doc/Change.log trunk/doc/Manual/ManualRequirements.html trunk/doc/Manual/ManualSpecialUtilities.html Modified: trunk/GLJournal.php =================================================================== --- trunk/GLJournal.php 2014-07-07 06:09:40 UTC (rev 6788) +++ trunk/GLJournal.php 2014-07-16 10:42:39 UTC (rev 6789) @@ -310,7 +310,7 @@ $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']){ + if (isset($_POST['tag']) AND $_POST['tag']==$myrow['tagref']){ echo '<option selected="selected" value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; } else { echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'] . '</option>'; @@ -330,10 +330,11 @@ 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>'; +echo '<td> + <select name="GLCode" onchange="return assignComboToInput(this,'.'GLManualCode'.')"> + <option value="">' . _('Select a general ledger account code') . '</option>'; while ($myrow=DB_fetch_array($result)){ - if (isset($_POST['tag']) and $_POST['tag']==$myrow['accountcode']){ + if (isset($_POST['GLCode']) AND $_POST['GLCode']==$myrow['accountcode']){ echo '<option selected="selected" value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlspecialchars($myrow['accountname'], ENT_QUOTES,'UTF-8', false) . '</option>'; } else { echo '<option value="' . $myrow['accountcode'] . '">' . $myrow['accountcode'].' - ' .htmlspecialchars($myrow['accountname'], ENT_QUOTES,'UTF-8', false) . '</option>'; Modified: trunk/StockAdjustments.php =================================================================== --- trunk/StockAdjustments.php 2014-07-07 06:09:40 UTC (rev 6788) +++ trunk/StockAdjustments.php 2014-07-16 10:42:39 UTC (rev 6789) @@ -108,7 +108,7 @@ } if($_POST['Quantity'] != 0){//To prevent from serilised quantity changing to zero $_SESSION['Adjustment' . $identifier]->Quantity = filter_number_format($_POST['Quantity']); - if(count($_SESSION['Adjustment' . $identifier]->SerialItems) == 0 AND $_SESSION['Adjustment' . $identifier]->Controlled == 1 ){/* There is no quantity available for controlled items */ + if(count($_SESSION['Adjustment' . $identifier]->SerialItems) == 0 AND $_SESSION['Adjustment' . $identifier]->Controlled == 1 ){/* There is no quantity available for controlled items */ $_SESSION['Adjustment' . $identifier]->Quantity = 0; } } @@ -210,29 +210,27 @@ // There must actually be some error this should never happen $QtyOnHandPrior = 0; } - $SQL = "INSERT INTO stockmoves (stockid, - type, - transno, - loccode, - trandate, - prd, - reference, - qty, - newqoh) - VALUES ( - '" . $_SESSION['Adjustment' . $identifier]->StockID . "', - 17, - '" . $AdjustmentNumber . "', - '" . $_SESSION['Adjustment' . $identifier]->StockLocation . "', - '" . $SQLAdjustmentDate . "', - '" . $PeriodNo . "', - '" . $_SESSION['Adjustment' . $identifier]->Narrative ."', - '" . $_SESSION['Adjustment' . $identifier]->Quantity . "', - '" . ($QtyOnHandPrior + $_SESSION['Adjustment' . $identifier]->Quantity) . "' - )"; + type, + transno, + loccode, + trandate, + prd, + reference, + qty, + newqoh, + standardcost) + VALUES ('" . $_SESSION['Adjustment' . $identifier]->StockID . "', + 17, + '" . $AdjustmentNumber . "', + '" . $_SESSION['Adjustment' . $identifier]->StockLocation . "', + '" . $SQLAdjustmentDate . "', + '" . $PeriodNo . "', + '" . $_SESSION['Adjustment' . $identifier]->Narrative ."', + '" . $_SESSION['Adjustment' . $identifier]->Quantity . "', + '" . ($QtyOnHandPrior + $_SESSION['Adjustment' . $identifier]->Quantity) . "', + '" . $_SESSION['Adjustment' . $identifier]->StandardCost . "')"; - $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The stock movement record cannot be inserted because'); $DbgMsg = _('The following SQL to insert the stock movement record was used'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true); @@ -383,7 +381,7 @@ $mail->setText($ConfirmationText); $result = SendmailBySmtp($mail,array($_SESSION['InventoryManagerEmail'])); } - + } $StockID = $_SESSION['Adjustment' . $identifier]->StockID; unset ($_SESSION['Adjustment' . $identifier]); Modified: trunk/SupplierTypes.php =================================================================== --- trunk/SupplierTypes.php 2014-07-07 06:09:40 UTC (rev 6788) +++ trunk/SupplierTypes.php 2014-07-16 10:42:39 UTC (rev 6789) @@ -19,8 +19,9 @@ $Errors = array(); echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/maintenance.png" title="' . _('Supplier Types') - . '" alt="" />' . _('Supplier Type Setup') . '</p>'; -echo '<div class="page_help_text">' . _('Add/edit/delete Supplier Types') . '</div><br />'; + . '" alt="" />' . _('Supplier Type Setup') . '</p> + <div class="page_help_text">' . _('Add/edit/delete Supplier Types') . '</div> + <br />'; if (isset($_POST['submit'])) { @@ -46,12 +47,12 @@ $i++; } - $checksql = "SELECT count(*) + $CheckSQL = "SELECT count(*) FROM suppliertype WHERE typename = '" . $_POST['TypeName'] . "'"; - $checkresult=DB_query($checksql, $db); - $checkrow=DB_fetch_row($checkresult); - if ($checkrow[0]>0) { + $CheckResult=DB_query($CheckSQL, $db); + $CheckRow=DB_fetch_row($CheckResult); + if ($CheckRow[0]>0) { $InputError = 1; echo prnMsg(_('You already have a supplier type called').' '.$_POST['TypeName'],'error'); $Errors[$i] = 'SupplierName'; @@ -64,37 +65,19 @@ SET typename = '" . $_POST['TypeName'] . "' WHERE typeid = '" . $SelectedType . "'"; - $msg = _('The supplier type') . ' ' . $SelectedType . ' ' . _('has been updated'); - } elseif ( $InputError !=1 ) { + prnMsg(_('The supplier type') . ' ' . $SelectedType . ' ' . _('has been updated'),'success'); + } elseif ($InputError !=1){ + // Add new record on submit - // First check the type is not being duplicated + $sql = "INSERT INTO suppliertype + (typename) + VALUES ('" . $_POST['TypeName'] . "')"; - $checkSql = "SELECT count(*) - FROM suppliertype - WHERE typeid = '" . $_POST['TypeID'] . "'"; - $checkresult = DB_query($checkSql,$db); - $checkrow = DB_fetch_row($checkresult); - - if ( $checkrow[0] > 0 ) { - $InputError = 1; - prnMsg( _('The supplier type ') . $_POST['TypeID'] . _(' already exist.'),'error'); - } else { - - // Add new record on submit - - $sql = "INSERT INTO suppliertype - (typename) - VALUES ('" . $_POST['TypeName'] . "')"; - - - $msg = _('Supplier type') . ' ' . $_POST['TypeName'] . ' ' . _('has been created'); - $checkSql = "SELECT count(typeid) - FROM suppliertype"; - $result = DB_query($checkSql, $db); - $row = DB_fetch_row($result); - - } + $msg = _('Supplier type') . ' ' . $_POST['TypeName'] . ' ' . _('has been created'); + $CheckSQL = "SELECT count(typeid) FROM suppliertype"; + $result = DB_query($CheckSQL, $db); + $row = DB_fetch_row($result); } if ( $InputError !=1) { @@ -102,7 +85,7 @@ $result = DB_query($sql,$db); - // Fetch the default price list. + // Fetch the default supplier type $sql = "SELECT confvalue FROM config WHERE confname='DefaultSupplierType'"; @@ -111,14 +94,14 @@ $DefaultSupplierType = $SupplierTypeRow[0]; // Does it exist - $checkSql = "SELECT count(*) + $CheckSQL = "SELECT count(*) FROM suppliertype WHERE typeid = '" . $DefaultSupplierType . "'"; - $checkresult = DB_query($checkSql,$db); - $checkrow = DB_fetch_row($checkresult); + $CheckResult = DB_query($CheckSQL,$db); + $CheckRow = DB_fetch_row($CheckResult); // If it doesnt then update config with newly created one. - if ($checkrow[0] == 0) { + if ($CheckRow[0] == 0) { $sql = "UPDATE config SET confvalue='" . $_POST['TypeID'] . "' WHERE confname='DefaultSupplierType'"; @@ -126,8 +109,6 @@ $_SESSION['DefaultSupplierType'] = $_POST['TypeID']; } - prnMsg($msg,'success'); - unset($SelectedType); unset($_POST['TypeID']); unset($_POST['TypeName']); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-07-07 06:09:40 UTC (rev 6788) +++ trunk/doc/Change.log 2014-07-16 10:42:39 UTC (rev 6789) @@ -1,5 +1,7 @@ webERP Change Log -03/07/14 Exson: Make status comments available in PO_OrderDetails.php to ensure that some important data such as grn reversing can be viewed. And add a return previous page link. + +16/7/14 Andrew Galuski: Add standard cost to stock movement record for stock adjustments +03/07/14 Exson: Make status comments available in PO_OrderDetails.php to ensure that some important data such as grn reversing can be viewed. And add a return previous page link. 27/06/14 RChacon: Add code-comments, $ViewTopic, $BookMark, page_title_text and code to update NewStockID if OldStockID and SelectedStockItem are the same in Z_ChangeStockCode.php. Add id to the "Change An Inventory Item Code" topic anchor in ManualSpecialUtilities.html. 27/06/14 Exson: Make tel length in PO_Header.php is as same as field definition in sql. 26/06/14 Exson: Fixed the bug that Select Customers search result inconsistence with Customer receipt search result in SelectCustomer.php. @@ -9,11 +11,11 @@ 22/06/14 Tim: Replace now() with CURRENT_TIMESTAMP in MRP.php to get time stamp to meet ANSI standard. 22/06/14 Exson: Fixed the mrp parameters runtime to datetime instead of date format since MRP running records need more precision. 22/06/14 Benjamin (bpiltz2302) from web-ERP-users mail list report and provide the solution for MRP LevelNetting unusual exit bug. The details can be found here: http://weberp-accounting.1478800.n4.nabble.com/MRP-Error-LevelNetting-td4657425.html -21/06/14 Exson: Add location check in StockAdjustments.php to prevent from users selecting controlled items based on one location but changed the location before submit it to server which make serial not exist check absolutely failed. +21/06/14 Exson: Add location check in StockAdjustments.php to prevent from users selecting controlled items based on one location but changed the location before submit it to server which make serial not exist check absolutely failed. 17/06/14 Exson: Add Z_ImportDebtors.php into Utilities menu and scripts table. -15/06/14 Akits from minghao.hk/bbs/ fixed the bugs that www_Users.php allowed modules does not matched the one displayed in index.php. +15/06/14 Akits from minghao.hk/bbs/ fixed the bugs that www_Users.php allowed modules does not matched the one displayed in index.php. 11/06/2014 Exson: Fixed the exported csv files with wrong aligned fields due to comma as part of fields content. -09/06/2014 Exson: Fixed the Delivery Date lossing bugs when change Warehouse. Reported by akits from minghao.hk(weberp) bbs. +09/06/2014 Exson: Fixed the Delivery Date lossing bugs when change Warehouse. Reported by akits from minghao.hk(weberp) bbs. 2/6/14 Phil: Added bom effectivity dates into work order creation cost calculations - as spotted by Andrew Galuski 1/6/14 Phil: Fixed bug in POItems.php that resulted in an SQL error when the number of items from the search was zero after previous searches had returned records 27/05/14 RChacon: Add page title text and icon to import scripts. Page title text = menu option. @@ -21,7 +23,7 @@ 27/05/14 Exson: Add Sales man login control for PDFOrderStatus.php 26/05/14 Thumb: Fixed discount modifier missing bug in SelectOrderItems.php. 26/05/14 rchacon: Fixes other problems related to updating translations of the items description.. -22/05/14 newuser990(from webERP forum): fixed bugs in MRP.php that quantity which stated in PO with lines not completed but PO status marked Completed are calculated as supplies. Exson add PO order lines checked to avoid same problem. +22/05/14 newuser990(from webERP forum): fixed bugs in MRP.php that quantity which stated in PO with lines not completed but PO status marked Completed are calculated as supplies. Exson add PO order lines checked to avoid same problem. 22/5/14 Tim: Currencies.php now allows FunctionalCurrency to be modified 22/5/14 Phil: Prevent use of enter key - experimental - in number fields - prevents users from losing data in big forms where they are entering large amounts of data e.g. purchase ordering - maybe we should consider for integer fields too? 22/5/14 Ricard/Phil: Tidy up SQL in StockClone.php @@ -30,7 +32,7 @@ 18/5/14 Exson: Tidy up SelectSalesOrder.php SQL code and add Thumb's salesman login control and fixed bugs caused by no group by statements for customer and items selected. 17/05/14 Phil: sales invoice and credit scripts all check for 0 exchange rate before updating sales anlaysis now 17/05/14 Phil: Fixed Z_ChangeStockCode.php which was orphaning stockdescriptiontranslations without changing them to the new code -14/05/14 Exson: Fixed typo in MRPReport.php which make some supplies not to be shown on the report and use itemdue instead of deliverydate in MRP to ensure that requirements are calculated correctly for items due on different date. +14/05/14 Exson: Fixed typo in MRPReport.php which make some supplies not to be shown on the report and use itemdue instead of deliverydate in MRP to ensure that requirements are calculated correctly for items due on different date. 3/5/14 Khwunchai J.: New Xenos theme 3/5/14 Phil: StockCostUpdate.php now allows updates to manufactured items. 29/4/14 Exson: Make price matrix workable including GetPrice.inc, MainMenuLinksArray.php,SelectOrderItems_IntoCart.inc,PriceMatrix.php, SelectProduct.php,StockDispatch.php. @@ -49,13 +51,13 @@ 28/03/14 Exson: Fixed the Expiry Date not handled right during stocks adjustments by manual key in or bar code scan in Add_SerialItems.php, DefineSerialItems.php,InputSerialItems.php and InputSerialItemsKeyed.php. 26/3/14 Serakfalcon: fixed findLogoFile function in includes/session.inc 24/3/14 Phil: Removed DefaultTheme configuration parameter - unecessary as noted by Serafalcon -23/03/14 Exson: Fixed the no defined variable bugs in WorkOrderIssue.php. Reported by Tim. -23/03/14 Exson: Fixed the bug that the search results shows only limited to DisplayRecordsMax which does not make sense due to pagination in WorkOrderIssue.php. +23/03/14 Exson: Fixed the no defined variable bugs in WorkOrderIssue.php. Reported by Tim. +23/03/14 Exson: Fixed the bug that the search results shows only limited to DisplayRecordsMax which does not make sense due to pagination in WorkOrderIssue.php. 23/03/14 Exson: Fixed that currency name not available in Prices.php. -22/03/14 Exson: Fixed the stock searching function failure when items setup in system less than DisplayedRecordsMax in WorkOrderEntry.php. -21/03/14 Exson: Fixed that bugs in WorkOrderIssue.php that the issued non BOM materials not shown. And fixed bugs in WorkOrderStatus.php failed to retrieve item description. +22/03/14 Exson: Fixed the stock searching function failure when items setup in system less than DisplayedRecordsMax in WorkOrderEntry.php. +21/03/14 Exson: Fixed that bugs in WorkOrderIssue.php that the issued non BOM materials not shown. And fixed bugs in WorkOrderStatus.php failed to retrieve item description. 20/3/14 Exson: Fixed the bugs in StockCounts that Location set does not work and link typo. -19/3/14 Tim: Fixed the bug Items Other than those in BOM are not listed in Status of Work Order even if issued. Exson made a little revision to keep SQL query only once for those additional issued materials. Reported by newuesr990 from weberp forum. +19/3/14 Tim: Fixed the bug Items Other than those in BOM are not listed in Status of Work Order even if issued. Exson made a little revision to keep SQL query only once for those additional issued materials. Reported by newuesr990 from weberp forum. 18/03/14 Exson: Fixed the bugs in GoodsReceived.php which will leads to duplicated goods receiving. 17/3/14 rchacon: Allow translations of tax category Freight 15/3/14 Phil: Z_ChangeStockCategory.php was not updating sales analysis records correctly - fixed Modified: trunk/doc/Manual/ManualRequirements.html =================================================================== --- trunk/doc/Manual/ManualRequirements.html 2014-07-07 06:09:40 UTC (rev 6788) +++ trunk/doc/Manual/ManualRequirements.html 2014-07-16 10:42:39 UTC (rev 6789) @@ -6,7 +6,7 @@ <p>Each client connection to the web server and database engine will also consume RAM so the more connections the larger the RAM requirement. Similarly disk space required is a function of the volume of customers, suppliers and transactions. Suffice it to say that due to the efficiency of the components of the system the demands on the hardware are exceptionally light by client server application standards.</p> -<p>As a guide, an installation for up to 50 simultaneous users could consist of the following: a Linux operating system, an Apache web server, an entry level server with 2Gig RAM and a 100 Megabit network card. This would provide more than adequate performance. A small NAS or SAN with disk redundancy would be preferred in larger installations. With multiple servers with with SMP, load balancing, a separate database server, and large amounts of RAM the limit on database size and the number can be scaled to the most demanding businesses.</p> +<p>As a guide, an installation for up to 50 simultaneous users could consist of the following: a Linux operating system, using nginx, lighthttpd, hiawatha or apache with even an entry level hardware server. This would provide more than adequate performance. A NAS or SAN with disk redundancy would be preferred in larger installations. With multiple servers with with SMP, load balancing, a separate database server, and large amounts of RAM the limit on database size and the number can be scaled to the most demanding enterprises.</p> <p>In practise most businesses will elect to outsource the hardware to a web-hosting company where dedicated servers can be rented for minimal cost. When using the hosting facilities of a 3rd party it is important to consider the infrastructure that the host has in place:</p> @@ -15,7 +15,7 @@ <li>Hardware redundancy - ie failover spare servers, disks etc</li> - <li>The safety and protection of the hosts hardware</li> + <li>The security and physical protection of the hosts hardware</li> <li>Backup power generation</li> @@ -47,12 +47,12 @@ <li><a href="http://www.mysql.com/">MySQL</a>-Max with Innodb transactional tables support. Innodb was introduced in 2001 to MySQL and has Oracle like functionality – with similar speed. MySQL later than version 4 has Innodb tables in by default. Since MySQL represents such good value for money it has been used. An example configuration file my.cnf normally under /usr/local/mysql/var is available in the mysql documentation to show typical settings for the Innodb configuration. The expected size of the data is useful although additional data files can be created retrospectively as necessary. Note that only the tables that require transaction support are defined as Innodb tables.</li> - <li>A web server. <a href="http://www.apache.org/">Apache</a> makes the most sense – but most web servers are supported by PHP in various forms.</li> + <li>A web server. webERP is tested with nginx, lighthttpd, hiawatha and <a href="http://www.apache.org/">Apache</a>, but most web servers are supported by PHP in various forms. PHP running in Fast CGI mode ensures that throughput and performance is optomised.</li> - <li>If the web server is accessible over the Internet and not just over a LAN then encrypted communications are required. The openssl and mod-ssl modules for apache can be easily used to ensure all data is transmitted in encrypted form.</li> + <li>If the web server is accessible over the Internet and not just over a LAN then encrypted communications are required. The openssl and mod-ssl modules for apache can be easily used to ensure all data is transmitted in encrypted form. Using https is strongly recommended.</li> </ul> -<p>The system could be used with many other database servers but it is tested and developed on MySQL. Independent benchmarks show that MySQL is one of the fastest for most common database tasks, particularly at establishing connections – since this is required for every page, MySQL is therefore ideally suited to the web environment. Using Apache with <a href="http://www.modssl.org/">mod_ssl</a> and <a href="http://www.openssl.org/">openssl</a> secure sockets makes sense where there is any data transmitted over the Internet and not just over a LAN.</p> +<p>The system could be used with many other database servers but it is tested and developed on MySQL. Independent benchmarks show that MySQL is one of the fastest for most common database tasks, particularly at establishing connections – since this is required for every page, MySQL is therefore ideally suited to the web environment.</p> <div class="floatright"> <a class="minitext" href="#top">⬆ Top</a> Modified: trunk/doc/Manual/ManualSpecialUtilities.html =================================================================== --- trunk/doc/Manual/ManualSpecialUtilities.html 2014-07-07 06:09:40 UTC (rev 6788) +++ trunk/doc/Manual/ManualSpecialUtilities.html 2014-07-16 10:42:39 UTC (rev 6789) @@ -2,7 +2,7 @@ <p>Any of these programs should only be run by the individual in the business who is allocated the task of administering the system, who has a thorough understanding of the system. If in doubt seek advice. Many of these utilities perform major changes to the database and it is always advisable to have a backup before attempting to run one. All these utilities have a page security setting of 15 by default (see security schema).</p> -<p>There are no links to the Utility menu so casual browsers cannot stumble upon this page even if they had the security privileges. The URL must be entered manually to Z_index.php. All utlity pages are prefixed with a Z_.</p> +<p>The Utility menu is a separate module so access can be turned off to hide these utility script links by turning off the Utilities module in user settings. All utlity pages are prefixed with a Z_.</p> <h2>Re-Apply Standard Costs to Sales Analysis</h2> @@ -14,15 +14,15 @@ <h2>Change A Customer Code</h2> -<p>This page requires the entry of an existing customer code and the new customer code. The system checks to see the new code entered doesn't already exist and that the code entered for the existing customer does exist. If all is well then the customer code data is changed in all tables through-out the system that refer to the customer code. Due to the extensive changes taking place throughout the database this utility should not be run during normal operating hours.</p> +<p>This page requires the entry of an existing customer code and the new customer code. The system checks to see the new code entered doesn't already exist and that the code entered for the existing customer does exist. If all is well then the customer code data is changed in all tables throughout the system that refer to the customer code. Due to the extensive changes taking place throughout the database this utility should not be run during normal operating hours when others are using the system.</p> <h2><a id="Z_ChangeStockCode">Change An Inventory Item Code</a></h2> -<p>This page requires the entry of an existing stock code and the new stock code. The system checks to see the new code entered doesn't already exist and that the code entered for the existing item does exist. If all is well then the stock code data is changed in all tables through-out the system. Sales analysis, stock movements, stock locations, Bills of Material, parent and component items, sales order details and purchase order details as well as the Stock Master, pricing and shipment charges. Due to the extensive changes taking place throughout the database this utility should not be run during normal operating hours.</p> +<p>This page requires the entry of an existing stock code and the new stock code. The system checks to see the new code entered doesn't already exist and that the code entered for the existing item does exist. If all is well then the stock code data is changed in all tables through-out the system. Sales analysis, stock movements, stock locations, Bills of Material, parent and component items, sales order details and purchase order details as well as the Stock Master, pricing and shipment charges. Due to the extensive changes taking place throughout the database this utility should not be run during normal operating hours, when others are using the system.</p> <h2>Make Stock Locations</h2> -<p>If the inventory database is imported from some other system, the stock location records can be created for all locations currently defined by running the script Z_MakeStockLocns.php.</p> +<p>If the inventory database is imported from some other system, the stock location records can be created for all locations currently defined by running the script Z_MakeStockLocns.php. Inventory items will not appear on searches during entry of sales orders until their corresponding inventory locations records exist.</p> <p></p> |
From: <dai...@us...> - 2014-07-19 05:22:45
|
Revision: 6792 http://sourceforge.net/p/web-erp/reponame/6792 Author: daintree Date: 2014-07-19 05:22:40 +0000 (Sat, 19 Jul 2014) Log Message: ----------- Gilberto key duplication removed Modified Paths: -------------- trunk/StockCategories.php trunk/includes/class.pdf.php trunk/sql/mysql/upgrade4.11-4.12.sql Modified: trunk/StockCategories.php =================================================================== --- trunk/StockCategories.php 2014-07-17 17:15:33 UTC (rev 6791) +++ trunk/StockCategories.php 2014-07-19 05:22:40 UTC (rev 6792) @@ -168,7 +168,7 @@ purchpricevaract, materialuseagevarac, wipact) - VALUES ('" . + VALUES ('" . $_POST['CategoryID'] . "','" . $_POST['StockType'] . "','" . $_POST['CategoryDescription'] . "','" . @@ -253,16 +253,16 @@ echo '<br /> <table class="selection"> <tr> - <th>' . _('Code') . '</th> - <th>' . _('Category Description') . '</th>' . ' - <th>' . _('Stock Type') . '</th>' . ' - <th>' . _('Default Tax Category') . '</th>' . ' - <th>' . _('Stock GL') . '</th>' . ' - <th>' . _('Adjts GL') . '</th> - <th>' . _('Issues GL') . '</th> - <th>' . _('Price Var GL') . '</th> - <th>' . _('Usage Var GL') . '</th> - <th>' . _('WIP GL') . '</th> + <th class="ascending">' . _('Code') . '</th> + <th class="ascending">' . _('Category Description') . '</th>' . ' + <th class="ascending">' . _('Stock Type') . '</th>' . ' + <th class="ascending">' . _('Default Tax Category') . '</th>' . ' + <th class="ascending">' . _('Stock GL') . '</th>' . ' + <th class="ascending">' . _('Adjts GL') . '</th> + <th class="ascending">' . _('Issues GL') . '</th> + <th class="ascending">' . _('Price Var GL') . '</th> + <th class="ascending">' . _('Usage Var GL') . '</th> + <th class="ascending">' . _('WIP GL') . '</th> <th colspan="2">' . _('Maintenance') . '</th> </tr>'; @@ -463,7 +463,7 @@ } echo ' value="' . $myrow['accountcode'] . '">' . htmlspecialchars($myrow['accountname'], ENT_QUOTES, 'UTF-8', false) . - ' ('.$myrow['accountcode'].')' . '</option>'; + ' ('.$myrow['accountcode'].')' . '</option>'; } echo '</select></td></tr>'; DB_data_seek($BSAccountsResult,0); Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2014-07-17 17:15:33 UTC (rev 6791) +++ trunk/includes/class.pdf.php 2014-07-19 05:22:40 UTC (rev 6792) @@ -221,7 +221,7 @@ function RoundRectangle($XPos, $YPos, $Width, $Height, $RadiusX, $RadiusY) { $this->line($XPos, $YPos-$RadiusY, $XPos, $YPos-$Height+$RadiusY);// Left side $this->line($XPos+$RadiusX, $YPos, $XPos+$Width-$RadiusX, $YPos);// Top side - $this->line($XPos+$RadiusX, $YPos-$Height-$Radius, $XPos+$Width-$RadiusX, $YPos-$Height-$Radius);// Bottom side + $this->line($XPos+$RadiusX, $YPos-$Height-$RadiusX, $XPos+$Width-$RadiusX, $YPos-$Height-$RadiusX);// Bottom side $this->line($XPos+$Width, $YPos-$RadiusY, $XPos+$Width, $YPos-$Height+$RadiusY);// Right side $this->partEllipse($XPos+$RadiusX, $YPos-$RadiusY, 90, 180, $RadiusX, $RadiusY);// Top left corner $this->partEllipse($XPos+$RadiusX, $YPos-$Height+$RadiusY, 180, 270, $RadiusX, $RadiusY);// Bottom left corner @@ -296,7 +296,9 @@ $ls=$l; $ns++; } - $l += $cw[$i]; + if (isset($cw[$i])) { + $l += $cw[$i]; + } if($l>$wmax){ break; } else { Modified: trunk/sql/mysql/upgrade4.11-4.12.sql =================================================================== --- trunk/sql/mysql/upgrade4.11-4.12.sql 2014-07-17 17:15:33 UTC (rev 6791) +++ trunk/sql/mysql/upgrade4.11-4.12.sql 2014-07-19 05:22:40 UTC (rev 6792) @@ -42,6 +42,17 @@ INSERT INTO `scripts` (`script` ,`pagesecurity` ,`description`) VALUES ('RelatedItemsUpdate.php', '2', 'Maintains Related Items'); INSERT INTO scripts VALUES('Z_ImportDebtors.php',15,'Import debtors by csv file'); ALTER table purchorders MODIFY tel varchar(30) NOT NULL DEFAULT ''; + +ALTER TABLE banktrans DROP KEY ref_10, DROP KEY ref_9, DROP KEY ref_8, DROP KEY ref_7; +ALTER TABLE banktrans DROP KEY ref_6, DROP KEY ref_5, DROP KEY ref_4, DROP KEY ref_3, DROP KEY ref_2; +ALTER TABLE gltrans DROP KEY tag_2, DROP KEY tag_3, DROP KEY tag_4; +ALTER TABLE mrpdemandtypes DROP KEY mrpdemandtype; +ALTER TABLE salescatprod DROP KEY manufacturers_id_2; +ALTER TABLE salescatprod DROP KEY manufacturers_id; +ALTER TABLE stockrequest DROP KEY departmentid_2; +ALTER TABLE stockrequest DROP KEY loccode_2; +ALTER TABLE stockrequestitems DROP KEY stockid_2, DROP KEY dispatchid_2; + UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber'; |
From: <rc...@us...> - 2014-07-23 20:05:29
|
Revision: 6793 http://sourceforge.net/p/web-erp/reponame/6793 Author: rchacon Date: 2014-07-23 20:05:25 +0000 (Wed, 23 Jul 2014) Log Message: ----------- Adds ViewTopic and BookMark to PDFPriceList.php. Adds help info about Print a price list by inventory category. Modified Paths: -------------- trunk/PDFPriceList.php trunk/doc/Manual/ManualSalesTypes.html Modified: trunk/PDFPriceList.php =================================================================== --- trunk/PDFPriceList.php 2014-07-19 05:22:40 UTC (rev 6792) +++ trunk/PDFPriceList.php 2014-07-23 20:05:25 UTC (rev 6793) @@ -243,11 +243,13 @@ } else { /*The option to print PDF was not hit */ - $Title= _('Price Listing'); + $Title = _('Price Listing'); + $ViewTopic = 'SalesTypes';// Filename in ManualContents.php's TOC. + $BookMark = 'PDFPriceList';// Anchor's id in the manual's html document. include('includes/header.inc'); echo '<p class="page_title_text"><img src="' . $RootPath . '/css/' . $Theme . '/images/customer.png" title="' . _('Price List') . '" alt="" /> - ' . ' ' . _('Print a price list') . '</p>'; + ' . ' ' . _('Print a price list by inventory category') . '</p>'; if (!isset($_POST['FromCriteria']) or !isset($_POST['ToCriteria'])) { Modified: trunk/doc/Manual/ManualSalesTypes.html =================================================================== --- trunk/doc/Manual/ManualSalesTypes.html 2014-07-19 05:22:40 UTC (rev 6792) +++ trunk/doc/Manual/ManualSalesTypes.html 2014-07-23 20:05:25 UTC (rev 6793) @@ -1,26 +1,36 @@ -<a id="SalesTypes"><h1>Sales Types / Price Lists</h1></a> -<p> -Sales types are the broad categories which sales fall under, they should not be confused with stock categories. They are arbitrary headings for the different pricing arrangements applicable to each type of customer. For example the fashion house might have sales types for: -</p> +<h1><a id="SalesTypes">Sales Types / Price Lists</a></h1> +<p>Sales types are the broad categories which sales fall under, they should not be confused with stock categories. They are arbitrary headings for the different pricing arrangements applicable to each type of customer. For example the fashion house might have sales types for:</p> <ul> - <li>Indented sales - ordered in advance.</li> + <li>Indented sales - ordered in advance.</li> + <li>Stock sales - sold from stock.</li> + <li>Made to Measure - sales made up especially for a customer.</li> +</ul> - <li>Stock sales - sold from stock.</li> - - <li>Made to Measure - sales made up especially for a customer.</li> -</ul> <p>Inventory categories by contrast refer to the type of garment sold. Each customer is defined as belonging to a specific sales type. A sales type could also be used for groupings of customers. Price lists are held against sales types so all customers defined as belonging to the sales type will be on the same pricing.</p> -<p> -Pricing can be set up for each stock item by sales type (and currency), e.g. stock sales would attract a premium for the cost of the increased working capital required or perhaps a discount reflecting the scale of purchasing allowed on volume lines. Sales types for retail, wholesale, trade, special may also be appropriate in other types of business.</p> -<p> -New sales types/price lists can be added and existing ones amended from setup tab, "Sales Type Maintenance"</p> +<p>Pricing can be set up for each stock item by sales type (and currency), e.g. stock sales would attract a premium for the cost of the increased working capital required or perhaps a discount reflecting the scale of purchasing allowed on volume lines. Sales types for retail, wholesale, trade, special may also be appropriate in other types of business.</p> + +<p>New sales types/price lists can be added and existing ones amended from setup tab, "Sales Type Maintenance"</p> + <h2>Sales Type Code</h2> -<p> -This is a 2 character code which is stored against the customer to define the sales type applicable to the customer. It must be unique across all sales types. When entering orders the customer sales type is the key, together with the customer's currency that determines the price list to use.<br> +<p>This is a 2 character code which is stored against the customer to define the sales type applicable to the customer. It must be unique across all sales types. When entering orders the customer sales type is the key, together with the customer's currency that determines the price list to use.</p> + <h2>Sales Type Description</h2> -<p> -20 characters of text are allowed to describe the sales type. This field is used to describe the sales type / price list applicable to the customer. -</p> \ No newline at end of file + +<p>20 characters of text are allowed to describe the sales type. This field is used to describe the sales type / price list applicable to the customer.</p> + +<h2><a id="PDFPriceList">Print a price list by inventory category</a></h2> + +<p>This script helps you by printing prices of inventory items.</p> + +<p>Prices of selected items are sorted by:</p> +<ul> + <li>Currency code (ISO 4217 Codes for the representation of currencies and funds, was set up by developers),</li> + <li>Inventory category code (set up in <i>Inventory Categories Maintenance</i>),</li> + <li>Item code (set up in each <i>Item Maintenance</i>), and</li> + <li>Price start date (set up in each <i>Item Prices</i>).</li> +</ul> + +<p> </p> |
From: <dai...@us...> - 2014-07-26 01:01:25
|
Revision: 6794 http://sourceforge.net/p/web-erp/reponame/6794 Author: daintree Date: 2014-07-26 01:01:16 +0000 (Sat, 26 Jul 2014) Log Message: ----------- allow labour stocktype items to be added to purchase orders for subcontract services Modified Paths: -------------- trunk/ImportBankTrans.php trunk/PO_Items.php trunk/doc/Change.log Modified: trunk/ImportBankTrans.php =================================================================== --- trunk/ImportBankTrans.php 2014-07-23 20:05:25 UTC (rev 6793) +++ trunk/ImportBankTrans.php 2014-07-26 01:01:16 UTC (rev 6794) @@ -16,15 +16,15 @@ if (!isset($_FILES['ImportFile']) AND !isset($_SESSION['Statement'])) { echo '<form name="ImportForm" enctype="multipart/form-data" method="post" action="' . $_SERVER['PHP_SELF'] . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table> + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <table> <tr> <td>' . _('MT940 format Bank Statement File to import') . '</td> <td><input type="file" id="ImportFile" autofocus="autofocus" required="required" title="' . _('Select the file that contains the bank transactions in MT940 format') . '" name="ImportFile"></td> </tr> - </table>'; - echo '<div class="centre"><input type="submit" name="Import" value="Process"></div>'; - echo '</form>'; + </table> + <div class="centre"><input type="submit" name="Import" value="Process"></div> + </form>'; } elseif (isset($_POST['Import'])){ @@ -35,8 +35,8 @@ if ($_FILES['ImportFile']['size'] > (1024*1024)) { //File Size Check prnMsg(_('The file size is over the maximum allowed. The maximum size allowed is 1 megabyte'),'warn'); $ReadTheFile ='No'; - } - + } + /*elseif ( $_FILES['ImportFile']['type'] != 'text/plain' ) { //File Type Check prnMsg( _('A plain text file is expected, this file is a') . ' ' . $_FILES['ImportFile']['type'],'warn'); $ReadTheFile ='No'; @@ -48,19 +48,19 @@ exit; } $fp = fopen($_FILES['ImportFile']['tmp_name'], 'r'); - + $TransactionLine = false; $i=0; $_SESSION['Statement'] = new BankStatement; $_SESSION['Trans'] = array(); - + $_SESSION['Statement']->FileName = $_FILES['ImportFile']['tmp_name']; - + while ($LineText = fgets($fp)){ /* get each line of the order file */ /* - * This block of code could be in an include and different includes included depending on which type of transaction file is being imported + * This block of code could be in an include and different includes included depending on which type of transaction file is being imported * */ - + if (substr($LineText,0,4)==':20:'){ //Timestamp of report MT940 generation $_SESSION['Statement']->ReportCreated = substr($LineText,4); //in format DDDHHMM where DDD is the number of day in year and HHMM is the time $TransactionLine = false; @@ -123,12 +123,12 @@ $_SESSION['Trans'][$i]->Description = substr($LineText,7); } } - - if (substr($LineText,0,1)!=':' AND $TransactionLine){ + + if (substr($LineText,0,1)!=':' AND $TransactionLine){ //then it is the continuation of an :86: line $_SESSION['Trans'][$i]->Description .= $LineText; } - + if (substr($LineText,0,5)==':62F:'){ $DebitOrCredit = substr($LineText,5,1); //D or C $_SESSION['Statement']->ClosingDate = ConvertSQLDate('20' . substr($LineText,6,2) . '-' . substr($LineText,8,2) . '-' . substr($LineText,10,2)); @@ -143,7 +143,7 @@ /* end of MT940 specific import code - that could be in an include if we get other file formats * */ } /*end while get next line of message */ - + /* Look to match up the account for which transactions are being imported with a bank account in webERP */ $sql = "SELECT accountcode, bankaccountname, @@ -151,11 +151,11 @@ rate FROM bankaccounts INNER JOIN currencies ON bankaccounts.currcode=currencies.currabrev - WHERE bankaccountnumber " . LIKE . " '" . $_SESSION['Statement']->AccountNumber ."' + WHERE bankaccountnumber " . LIKE . " '" . $_SESSION['Statement']->AccountNumber ."' AND currcode = '" . $_SESSION['Statement']->CurrCode . "'"; - + $ErrMsg = _('Could not retrieve bank accounts that match with the statement being imported'); - + $result = DB_query($sql,$db,$ErrMsg); if (DB_num_rows($result)==0){ //but check for the worst! //there is no bank account set up for the bank account being imported @@ -166,13 +166,13 @@ $_SESSION['Statement']->BankAccountName = $BankAccountRow['bankaccountname']; $_SESSION['Statement']->CurrDecimalPlaces = $BankAccountRow['decimalplaces']; $_SESSION['Statement']->ExchangeRate = $BankAccountRow['rate']; - + /* Now check to see if each transaction has already been entered */ for($i=1;$i<=count($_SESSION['Trans']);$i++){ - + $SQL = "SELECT banktransid FROM banktrans WHERE transdate='" . FormatDateForSQL($_SESSION['Trans'][$i]->ValueDate) . "' - AND amount='" . $_SESSION['Trans'][$i]->Amount . "' + AND amount='" . $_SESSION['Trans'][$i]->Amount . "' AND bankact='" . $_SESSION['Statement']->BankGLAccount . "'"; $result = DB_query($SQL,$db,_('There was a problem identifying a matching bank transaction')); if (DB_num_rows($result)>0){ @@ -195,7 +195,7 @@ $InputError = true; } if ($InputError == false){ - /*This is it - process the data into the DB + /*This is it - process the data into the DB * First check to see if the item is flagged as matching an existing bank transaction - if it does and there is no analysis of the transaction then we need to flag the existing bank transaction as matched off the bank statement for reconciliation purposes. * Then, if the transaction is analysed: * 1. create the bank transaction @@ -203,7 +203,7 @@ * 3. if it is a supplier payment create a supptrans systype 22 against the selected supplier * 4. create the gltrans for either the gl analysis or the debtor/supplier receipt/payment created */ - + for($i=1;$i<=count($_SESSION['Trans']);$i++){ DB_Txn_Begin($db); if ($_SESSION['Trans'][$i]->DebtorNo!='' OR @@ -215,7 +215,7 @@ $InsertBankTrans = true; } elseif ($_SESSION['Trans'][$i]->BankTransID!=0) { //Update the banktrans to show it has cleared the bank - $result = DB_query("UPDATE banktrans SET amountcleared=amount + $result = DB_query("UPDATE banktrans SET amountcleared=amount WHERE banktransid = '" . $_SESSION['Trans'][$i]->BankTransID . "'", $db, _('Could not update the bank transaction as cleared'), @@ -225,9 +225,9 @@ } else { $InsertBankTrans = false; } - + if ($_SESSION['Trans'][$i]->Amount >0){ //its a receipt - + if ($_SESSION['Trans'][$i]->DebtorNo!='') { $TransType = 12; $TransNo = GetNextTransNo(12,$db); //debtors receipt @@ -265,7 +265,7 @@ _('Could not update the last payment date and amount paid'), _('The SQL that failed to update the debtorsmaster was'), true); - + /* Now insert the gl trans to credit debtors control and debit bank account */ /*First credit debtors control from CompanyRecord */ $result = DB_query("INSERT INTO gltrans (type, @@ -305,10 +305,10 @@ _('Cannot insert a GL entry for the receipt because'), _('The SQL that failed to insert the receipt GL entry was'), true); - + } elseif ($_SESSION['Trans'][$i]->GLTotal == $_SESSION['Trans'][$i]->Amount){ $TransType=2; //gl receipt - $TransNo = GetNextTransNo(2,$db); + $TransNo = GetNextTransNo(2,$db); foreach ($_SESSION['Trans'][$i]->GLEntries as $GLAnalysis){ /*Credit each analysis account */ $result = DB_query("INSERT INTO gltrans (type, @@ -350,11 +350,11 @@ _('Cannot insert a GL entry for the receipt because'), _('The SQL that failed to insert the receipt GL entry was'), true); - } + } } else { //its a payment if ($_SESSION['Trans'][$i]->SupplierID!='') { //its a supplier payment $TransType = 22; - $TransNo = GetNextTransNo(22,$db); + $TransNo = GetNextTransNo(22,$db); $result = DB_query("INSERT INTO supptrans (transno, type, supplierno, @@ -408,7 +408,7 @@ _('Cannot insert a GL entry for the supplier payment to creditors control because'), _('The SQL that failed to insert the creditors control GL entry was'), true); - /*Now credit the bank account from $_SESSION['Statement']->BankGLAccount + /*Now credit the bank account from $_SESSION['Statement']->BankGLAccount * note payments are recorded as negatives in the import */ $result = DB_query("INSERT INTO gltrans (type, typeno, @@ -428,11 +428,11 @@ _('Cannot insert a GL entry for the supplier payment because'), _('The SQL that failed to insert the supplier payment GL entry to the bank account was'), true); - + } elseif($_SESSION['Trans'][$i]->GLTotal == $_SESSION['Trans'][$i]->Amount){ //its a GL payment $TransType = 1; //gl payment - $TransNo = GetNextTransNo(1,$db); + $TransNo = GetNextTransNo(1,$db); foreach ($_SESSION['Trans'][$i]->GLEntries as $GLAnalysis){ /*Debit each analysis account note payments are recorded as negative so need negative negative to make a debit (positive)*/ $result = DB_query("INSERT INTO gltrans (type, @@ -455,7 +455,7 @@ true); } //end loop around GLAnalysis - /*Now credit the gl account from $_SESSION['Statement']->BankGLAccount + /*Now credit the gl account from $_SESSION['Statement']->BankGLAccount * Note payments are negatives*/ $result = DB_query("INSERT INTO gltrans (type, typeno, @@ -476,12 +476,12 @@ _('The SQL that failed to insert the payment GL entry was'), true); } - + } //end if its a payment if ($InsertBankTrans==true){ /* Now insert the bank transaction if necessary */ /* it is not possible to import transaction that were originally in another currency converted to the currency of the bank account by the bank - these entries would need to be done through the usual method */ - + $result=DB_query("INSERT INTO banktrans (transno, type, bankact, @@ -545,7 +545,7 @@ echo '<th></th><th class="number">' . number_format($_SESSION['Statement']->OpeningBalance,$_SESSION['Statement']->CurrDecimalPlaces) . '</th></tr>'; } for ($i=1; $i<=count($_SESSION['Trans']); $i++){ - + if ($_SESSION['Trans'][$i]->Amount >0){ if ($_SESSION['Trans'][$i]->DebtorNo!='' OR $_SESSION['Trans'][$i]->GLTotal == $_SESSION['Trans'][$i]->Amount){ @@ -564,11 +564,11 @@ } else { echo '<tr>'; } - } + } echo '<td>' . $_SESSION['Trans'][$i]->Code . '</td> <td>' . $_SESSION['Trans'][$i]->ValueDate . '</td> <td>' . $_SESSION['Trans'][$i]->Description . '</td>'; - + if ($_SESSION['Trans'][$i]->Amount>=0){ echo '<td class="number">' . number_format($_SESSION['Trans'][$i]->Amount,$_SESSION['Statement']->CurrDecimalPlaces) . '</td><td></td>'; } else { @@ -592,7 +592,7 @@ echo '<br /> <table class="selection">'; if ($_SESSION['Statement']->CurrCode!=$_SESSION['CompanyRecord']['currencydefault']){ - + echo '<tr> <td>' . _('Exchange Rate to Use When Processing Transactions') . '</td> <td><input type="text" class="number" required="required" name="ExchangeRate" value="' . $_SESSION['Statement']->ExchangeRate . '" /></td> @@ -606,6 +606,5 @@ </table>'; } - include ('includes/footer.inc'); ?> \ No newline at end of file Modified: trunk/PO_Items.php =================================================================== --- trunk/PO_Items.php 2014-07-23 20:05:25 UTC (rev 6793) +++ trunk/PO_Items.php 2014-07-26 01:01:16 UTC (rev 6794) @@ -847,7 +847,7 @@ } /* Now show the stock item selection search stuff below */ -if (isset($_POST['Search'])||isset($_POST['Prev'])||isset($_POST['Next'])){ /*ie seach for stock items */ +if (isset($_POST['Search']) OR isset($_POST['Prev']) OR isset($_POST['Next'])){ /*ie seach for stock items */ if ($_POST['Keywords'] AND $_POST['StockCode']) { prnMsg( _('Stock description keywords have been used in preference to the Stock code extract entered'), 'info' ); @@ -865,15 +865,14 @@ ON stockmaster.categoryid=stockcategory.categoryid INNER JOIN purchdata ON stockmaster.stockid=purchdata.stockid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' AND stockmaster.description " . LIKE . " '" . $SearchString ."' - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } else { // not just supplier purchdata items $sql = "SELECT stockmaster.stockid, @@ -881,14 +880,13 @@ stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 AND stockmaster.description " . LIKE . " '" . $SearchString ."' - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } } else { //for a specific stock category if ($_POST['SupplierItemsOnly']=='on'){ @@ -899,7 +897,7 @@ ON stockmaster.categoryid=stockcategory.categoryid INNER JOIN purchdata ON stockmaster.stockid=purchdata.stockid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' @@ -907,23 +905,21 @@ AND stockmaster.discontinued<>1 AND stockmaster.description " . LIKE . " '". $SearchString ."' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 AND stockmaster.description " . LIKE . " '". $SearchString ."' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } } @@ -940,29 +936,27 @@ ON stockmaster.categoryid=stockcategory.categoryid INNER JOIN purchdata ON stockmaster.stockid=purchdata.stockid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'G' AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' AND stockmaster.discontinued<>1 AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } } else { //for a specific stock category and LIKE stock code if ($_POST['SupplierItemsOnly']=='on'){ @@ -973,7 +967,7 @@ ON stockmaster.categoryid=stockcategory.categoryid INNER JOIN purchdata ON stockmaster.stockid=purchdata.stockid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' @@ -981,23 +975,21 @@ and stockmaster.discontinued<>1 AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' and stockmaster.discontinued<>1 AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } } @@ -1011,27 +1003,25 @@ ON stockmaster.categoryid=stockcategory.categoryid INNER JOIN purchdata ON stockmaster.stockid=purchdata.stockid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' AND stockmaster.discontinued<>1 - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } } else { // for a specific stock category if ($_POST['SupplierItemsOnly']=='on'){ @@ -1042,29 +1032,27 @@ ON stockmaster.categoryid=stockcategory.categoryid INNER JOIN purchdata ON stockmaster.stockid=purchdata.stockid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "' AND stockmaster.discontinued<>1 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } else { $sql = "SELECT stockmaster.stockid, stockmaster.description, stockmaster.units FROM stockmaster INNER JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid - WHERE stockmaster.mbflag<>'D' + WHERE (stockmaster.mbflag<>'D' OR stockcategory.stocktype='L') AND stockmaster.mbflag<>'A' AND stockmaster.mbflag<>'K' AND stockmaster.mbflag<>'G' AND stockmaster.discontinued<>1 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' - ORDER BY stockmaster.stockid - "; + ORDER BY stockmaster.stockid "; } } } @@ -1121,8 +1109,7 @@ $sql="SELECT categoryid, categorydescription FROM stockcategory - WHERE stocktype<>'L' - AND stocktype<>'D' + WHERE stocktype<>'D' ORDER BY categorydescription"; $ErrMsg = _('The supplier category details could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve the category details but failed was'); @@ -1133,9 +1120,9 @@ <th colspan="3"><h3>' . _('Search For Stock Items') . ':</h3></th>'; echo '</tr> - <tr><td>' . _('Item Category') . ': <select name="StockCat">'; + <tr><td>' . _('Item Category') . ': <select name="StockCat"> - echo '<option selected="selected" value="All">' . _('All') . '</option>'; + <option selected="selected" value="All">' . _('All') . '</option>'; while ($myrow1 = DB_fetch_array($result1)) { if (isset($_POST['StockCat']) and $_POST['StockCat']==$myrow1['categoryid']){ Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-07-23 20:05:25 UTC (rev 6793) +++ trunk/doc/Change.log 2014-07-26 01:01:16 UTC (rev 6794) @@ -1,6 +1,7 @@ webERP Change Log -2014-07-17 RChacon: Adds ViewTopic and BookMark, adds bullet for class ascending columns, repositions columns Type and Trans, add class number to Trans, completes printf. +25/7/14 Phil: Allow dummy - labour stock type items to be added to purchase orders. +17/7/14 RChacon: Adds ViewTopic and BookMark, adds bullet for class ascending columns, repositions columns Type and Trans, add class number to Trans, completes printf. 16/7/14 Andrew Galuski: Add standard cost to stock movement record for stock adjustments 03/07/14 Exson: Make status comments available in PO_OrderDetails.php to ensure that some important data such as grn reversing can be viewed. And add a return previous page link. 27/06/14 RChacon: Add code-comments, $ViewTopic, $BookMark, page_title_text and code to update NewStockID if OldStockID and SelectedStockItem are the same in Z_ChangeStockCode.php. Add id to the "Change An Inventory Item Code" topic anchor in ManualSpecialUtilities.html. |
From: <rc...@us...> - 2014-07-29 18:37:27
|
Revision: 6797 http://sourceforge.net/p/web-erp/reponame/6797 Author: rchacon Date: 2014-07-29 18:37:18 +0000 (Tue, 29 Jul 2014) Log Message: ----------- In PDFPriceList.php: Adds comments (info for developers), ViewTopic and BookMark, and currency name in locale language; deletes unused lines; reformats for legibility; adjusts column sizes to field sizes; improves printing of stockmaster.longdescription; improves code to reduce execution time (calculation out of loops); links right column positions to right margin; corrects IF for CustomerSpecials (deletes translation). In ManualSalesTypes.html: Adds help info about Print a price list by inventory category. Modified Paths: -------------- trunk/PDFPriceList.php trunk/doc/Change.log trunk/doc/Manual/ManualSalesTypes.html trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po Modified: trunk/PDFPriceList.php =================================================================== --- trunk/PDFPriceList.php 2014-07-27 00:47:57 UTC (rev 6796) +++ trunk/PDFPriceList.php 2014-07-29 18:37:18 UTC (rev 6797) @@ -1,5 +1,14 @@ <?php /* $Id$*/ +/* Script to print a price list by inventory category */ +/* Output column sizes: + * stockmaster.stockid, varchar(20), len = 20chr + * stockmaster.description, varchar(50), len = 50chr + * prices.startdate, date, len = 10chr + * prices.enddate, date/'No End Date', len = 12chr + * custbranch.brname, varchar(40), len = 40chr + * Gross Profit, calculated, len = 8chr + * prices.price, decimal(20,4), len = 20chr + 4spaces */ include('includes/session.inc'); @@ -7,22 +16,26 @@ AND isset($_POST['FromCriteria']) AND mb_strlen($_POST['FromCriteria'])>=1 AND isset($_POST['ToCriteria']) - AND mb_strlen($_POST['ToCriteria'])>=1){ + AND mb_strlen($_POST['ToCriteria'])>=1) { - include('includes/PDFStarter.php'); +/* if ($_POST['CustomerSpecials']=='Customer Special Prices Only') { + // To do: For special prices, change from portrait to landscape orientation. + }*/ + include('includes/PDFStarter.php');// Sets $PageNumber, page width, page height, top margin, bottom margin, left margin and right margin. - $FontSize=10; - $pdf->addInfo('Title', _('Price Listing Report') ); + $pdf->addInfo('Title', _('Price list by inventory category') ); $pdf->addInfo('Subject', _('Price List') ); - $PageNumber=1; + $FontSize=10; $line_height=12; /*Now figure out the inventory data to report for the category range under review */ - if ($_POST['CustomerSpecials']==_('Customer Special Prices Only')){ + if ($_POST['CustomerSpecials']==_('Customer Special Prices Only')) { - if ($_SESSION['CustomerID']==''){ + if ($_SESSION['CustomerID']=='') { $Title = _('Special price List - No Customer Selected'); + $ViewTopic = 'SalesTypes';// Filename in ManualContents.php's TOC. + $BookMark = 'PDFPriceList';// Anchor's id in the manual's html document. include('includes/header.inc'); echo '<br />'; prnMsg( _('The customer must first be selected from the select customer link') . '. ' . _('Re-run the price list once the customer has been selected') ); @@ -30,8 +43,10 @@ include('includes/footer.inc'); exit; } - if (!Is_Date($_POST['EffectiveDate'])){ + if (!Is_Date($_POST['EffectiveDate'])) { $Title = _('Special price List - No Customer Selected'); + $ViewTopic = 'SalesTypes';// Filename in ManualContents.php's TOC. + $BookMark = 'PDFPriceList';// Anchor's id in the manual's html document. include('includes/header.inc'); prnMsg(_('The effective date must be entered in the format') . ' ' . $_SESSION['DefaultDateFormat'],'error'); echo '<br /><br /><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Back') . '</a>'; @@ -90,7 +105,7 @@ $SalesTypeRow = DB_fetch_row($SalesTypeResult); $SalesTypeName = $SalesTypeRow[0]; - $SQL = "SELECT prices.typeabbrev, + $SQL = "SELECT prices.typeabbrev, prices.stockid, prices.startdate, prices.enddate, @@ -126,13 +141,13 @@ include('includes/header.inc'); prnMsg( _('The Price List could not be retrieved by the SQL because'). ' - ' . DB_error_msg($db), 'error'); echo '<br /><a href="' .$RootPath .'/index.php">' . _('Back to the menu'). '</a>'; - if ($debug==1){ + if ($debug==1) { prnMsg(_('For debugging purposes the SQL used was:') . $SQL,'error'); } include('includes/footer.inc'); exit; } - if (DB_num_rows($PricesResult)==0){ + if (DB_num_rows($PricesResult)==0) { $Title = _('Print Price List Error'); include('includes/header.inc'); prnMsg(_('There were no price details to print out for the customer or category specified'),'warn'); @@ -146,147 +161,144 @@ $CurrCode =''; $Category = ''; $CatTot_Val=0; - $Pos=$Page_Height-$Top_Margin-$YPos+20; - While ($PriceList = DB_fetch_array($PricesResult,$db)){ + While ($PriceList = DB_fetch_array($PricesResult,$db)) { - if ($CurrCode != $PriceList['currabrev']){ - $FontSize=10; - $YPos -= 2*$line_height; - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,300-$Left_Margin,$FontSize, $PriceList['currabrev'] . ' ' . _('Prices')); + if ($CurrCode != $PriceList['currabrev']) { + $FontSize = 10; + $YPos -= 2*$line_height; + require_once('includes/CurrenciesArray.php');// To get the currency name from the currency code. + $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 300-$Left_Margin, $FontSize, + $PriceList['currabrev'] . ' - ' . _($CurrencyName[$PriceList['currabrev']])); $CurrCode = $PriceList['currabrev']; - $FontSize = 8; } - if ($Category!=$PriceList['categoryid']){ - $FontSize=10; + if ($Category != $PriceList['categoryid']) { + $FontSize = 10; $YPos -= 2*$line_height; - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,300-$Left_Margin,$FontSize,$PriceList['categoryid'] . ' - ' . $PriceList['categorydescription']); + $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 300-$Left_Margin, $FontSize, + $PriceList['categoryid'] . ' - ' . $PriceList['categorydescription']); $Category = $PriceList['categoryid']; - $CategoryName = $PriceList['categorydescription']; - $FontSize=8; } - $YPos -=$line_height; - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,80,$FontSize,$PriceList['stockid']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+100,$YPos,47,$FontSize,ConvertSQLDate($PriceList['startdate'])); - if ($PriceList['enddate']!='0000-00-00'){ + $FontSize = 8; + $YPos -= $line_height; + $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 80, $FontSize, + $PriceList['stockid']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+80, $YPos, 200, $FontSize, + $PriceList['description']); + $LeftOvers = $pdf->addTextWrap($Left_Margin+280, $YPos, 40, $FontSize, + ConvertSQLDate($PriceList['startdate'])); + if ($PriceList['enddate']!='0000-00-00') { $DisplayEndDate = ConvertSQLDate($PriceList['enddate']); } else { $DisplayEndDate = _('No End Date'); } - $LeftOvers = $pdf->addTextWrap($Left_Margin+100+47,$YPos,47,$FontSize,$DisplayEndDate); - $LeftOvers = $pdf->addTextWrap($Left_Margin+130+47+47,$YPos,130,$FontSize,$PriceList['description']); - $DisplayUnitPrice = locale_number_format($PriceList['price'],$PriceList['decimalplaces']); - $LeftOvers = $pdf->addTextWrap($Left_Margin+110+47+47+130,$YPos,180,$FontSize,$DisplayUnitPrice, 'right'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+320, $YPos, 48, $FontSize, + $DisplayEndDate); - if ($PriceList['price']!=0){ - $DisplayGPPercent = locale_number_format((($PriceList['price']-$PriceList['standardcost'])*100/$PriceList['price']),1) . '%'; - } else { - $DisplayGPPercent = 0; + // Shows gross profit percentage: + if ($_POST['ShowGPPercentages']=='Yes') { + $DisplayGPPercent = '-'; + if ($PriceList['price']!=0) { + $DisplayGPPercent = locale_number_format((($PriceList['price']-$PriceList['standardcost'])*100/$PriceList['price']), 2) . '%'; + } + $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-128, $YPos, 32, $FontSize, + $DisplayGPPercent, 'right'); } + // Displays unit price: + $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-96, $YPos, 96, $FontSize, + locale_number_format($PriceList['price'],$PriceList['decimalplaces']), 'right'); - if ($_POST['ShowGPPercentages']=='Yes'){ - $LeftOvers = $pdf->addTextWrap($Left_Margin+135+47+47+130+65,$YPos,20,$FontSize,$DisplayGPPercent, 'right'); - } - - if ($_POST['CustomerSpecials']=='Customer Special Prices Only'){ + if ($_POST['CustomerSpecials']=='Customer Special Prices Only') { /*Need to show to which branch the price relates */ - if ($PriceList['branchcode']!=''){ - $LeftOvers = $pdf->addTextWrap($Left_Margin+80+47+47+130+65+25,$YPos,60,$FontSize,$PriceList['brname'],'left'); + if ($PriceList['branchcode']!='') { + $LeftOvers = $pdf->addTextWrap($Left_Margin+376, $YPos, 160, $FontSize, $PriceList['brname']); } else { - $LeftOvers = $pdf->addTextWrap($Left_Margin+80+47+47+130+65+25,$YPos,60,$FontSize,_('All'),'left'); + $LeftOvers = $pdf->addTextWrap($Left_Margin+376, $YPos, 160, $FontSize, _('All')); } - } else If ($_POST['CustomerSpecials']=='Full Description'){ - + } else If ($_POST['CustomerSpecials']=='Full Description') { + // Prints item image: + $YPosImage = $YPos;// Initializes the image bottom $YPos. if(file_exists($_SESSION['part_pics_dir'] . '/' .$PriceList['stockid'].'.jpg') ) { - $img = imagecreatefromjpeg($_SESSION['part_pics_dir'] . '/' .$PriceList['stockid'].'.jpg'); - $width = imagesx( $img ); - $height = imagesy( $img ); - if($width>$height){ - $LeftOvers = $pdf->Image($_SESSION['part_pics_dir'] . '/'.$PriceList['stockid'].'.jpg',265,$Page_Height-$Top_Margin-$YPos+33,33,33); - }else{ - $LeftOvers = $pdf->Image($_SESSION['part_pics_dir'] . '/'.$PriceList['stockid'].'.jpg',265,$Page_Height-$Top_Margin-$YPos+33,33,33); + $img = imagecreatefromjpeg($_SESSION['part_pics_dir'] . '/' . $PriceList['stockid'] . '.jpg'); + if($YPos-36 < $Bottom_Margin) {// If the image bottom reaches the bottom margin, do PageHeader(). + PageHeader(); + } + $LeftOvers = $pdf->Image($_SESSION['part_pics_dir'] . '/'.$PriceList['stockid'].'.jpg', + $Left_Margin+3, $Page_Height-$YPos, 36, 36); + $YPosImage = $YPos-36;// Stores the $YPos of the image bottom (see bottom). + } + // Prints stockmaster.longdescription: + $XPos = $Left_Margin+80;// Takes out this calculation from the loop. + $Width = $Page_Width-$Right_Margin-$XPos;// Takes out this calculation from the loop. + $FontSize2 = $FontSize*0.80;// Font size and line height of Full Description section. + $Split = explode("\r\n", $PriceList['longdescription']); + foreach ($Split as $LeftOvers) { + $LeftOvers = stripslashes($LeftOvers); + while(mb_strlen($LeftOvers)>1) { + $YPos -= $FontSize2; + if ($YPos < $Bottom_Margin) {// If the description line reaches the bottom margin, do PageHeader(). + PageHeader(); + $YPosImage = $YPos;// Resets the image bottom $YPos. + } + $LeftOvers = $pdf->addTextWrap($XPos, $YPos, $Width, $FontSize2, $LeftOvers); } - }/*end checked file exist*/ - - $Split = explode("\r\n", wordwrap($PriceList['longdescription'],130,"\r\n")); - - $FontSize2=6; - if ($YPos < ($Bottom_Margin + (count($Split)*$line_height))){ - PageHeader(); } - foreach ($Split as $TextLine) { - $YPos -= $line_height; - $LeftOvers = $pdf->addTextWrap(300,$YPos,300,$FontSize2,$TextLine); - } - $YPos -= $line_height; - $LeftOvers = $pdf->addTextWrap(300,$YPos,300,$FontSize2,''); + // Assigns to $YPos the lowest $YPos value between the image and the description: + $YPos = min($YPosImage, $YPos); + }/* Endif full descriptions*/ - }/*end if full descriptions*/ - - if ($YPos < $Bottom_Margin + $line_height){ + if ($YPos < $Bottom_Margin + $line_height) { PageHeader(); } - } /*end inventory valn while loop */ - $FontSize =10; -/*Print out the category totals */ - + $FontSize = 10; $FileName=$_SESSION['DatabaseName']. '_' . _('Price_List') . '_' . date('Y-m-d').'.pdf'; ob_clean(); $pdf->OutputD($FileName); $pdf->__destruct(); } else { /*The option to print PDF was not hit */ - $Title = _('Price Listing'); $ViewTopic = 'SalesTypes';// Filename in ManualContents.php's TOC. $BookMark = 'PDFPriceList';// Anchor's id in the manual's html document. include('includes/header.inc'); - echo '<p class="page_title_text"><img src="' . $RootPath . '/css/' . $Theme . '/images/customer.png" title="' . _('Price List') . '" alt="" /> ' . ' ' . _('Print a price list by inventory category') . '</p>'; if (!isset($_POST['FromCriteria']) or !isset($_POST['ToCriteria'])) { + /*if $FromCriteria is not set then show a form to allow input */ - /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<table class="selection">'; - echo '<tr><td>' . _('From Inventory Category Code') .':</td> - <td><select name="FromCriteria">'; $sql='SELECT categoryid, categorydescription FROM stockcategory ORDER BY categoryid'; $CatResult= DB_query($sql,$db); - While ($myrow = DB_fetch_array($CatResult)){ - echo "<option value='" . $myrow['categoryid'] . "'>" . $myrow['categoryid'] . ' - ' . $myrow['categorydescription'] . '</option>'; + $SelectCat=''; + While ($myrow = DB_fetch_array($CatResult)) { + $SelectCat .= "<option value='" . $myrow['categoryid'] . "'>" . $myrow['categoryid'] . ' - ' . $myrow['categorydescription'] . '</option>'; } - echo '</select></td></tr>'; - - echo '<tr><td>' . _('To Inventory Category Code'). ':</td> + $SelectCat .= '</select></td></tr>'; + echo '<tr><td>' . _('From Inventory Category Code') . ':</td> + <td><select name="FromCriteria">'; + echo $SelectCat; + echo '<tr><td>' . _('To Inventory Category Code') . ':</td> <td><select name="ToCriteria">'; + echo $SelectCat; - /*Set the index for the categories result set back to 0 */ - DB_data_seek($CatResult,0); - - While ($myrow = DB_fetch_array($CatResult)){ - echo '<option value="' . $myrow['categoryid'] . '">' . $myrow['categoryid'] . ' - ' . $myrow['categorydescription'] . '</option>'; - } - echo '</select></td></tr>'; - echo '<tr><td>' . _('For Sales Type/Price List').':</td> <td><select name="SalesType">'; $sql = "SELECT sales_type, typeabbrev FROM salestypes"; $SalesTypesResult=DB_query($sql,$db); - while ($myrow=DB_fetch_array($SalesTypesResult)){ - echo '<option value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; + while ($myrow=DB_fetch_array($SalesTypesResult)) { + echo '<option value="' . $myrow['typeabbrev'] . '">' . $myrow['sales_type'] . '</option>'; } echo '</select></td></tr>'; @@ -317,71 +329,75 @@ </form>'; } include('includes/footer.inc'); - } /*end of else not PrintPDF */ function PageHeader () { global $pdf; - global $PageNumber; - global $YPos; - global $Xpos; - global $line_height; + global $Page_Width; global $Page_Height; global $Top_Margin; - global $Page_Width; + global $Bottom_Margin; + global $Left_Margin; global $Right_Margin; - global $Left_Margin; - global $Bottom_Margin; + global $PageNumber; + global $YPos; global $FontSize; + global $line_height; global $SalesTypeName; global $CustomerName; - if ($PageNumber>1){ + $PageNumber++; + if ($PageNumber>1) { $pdf->newPage(); } + $YPos = $Page_Height-$Top_Margin; $FontSize=10; - $YPos= $Page_Height-$Top_Margin; - $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,300,$FontSize,$_SESSION['CompanyRecord']['coyname']); $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-140,$YPos,140,$FontSize, _('Printed').': ' . Date($_SESSION['DefaultDateFormat']) . ' '. _('Page'). ' ' . $PageNumber); + $YPos -= $line_height; - $YPos -=$line_height; //Note, this is ok for multilang as this is the value of a Select, text in option is different - if ($_POST['CustomerSpecials']==_('Customer Special Prices Only')){ + if ($_POST['CustomerSpecials']==_('Customer Special Prices Only')) { $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,550,$FontSize, $CustomerName . ' ' . _('Prices for Categories').' ' . $_POST['FromCriteria'] . ' - ' . $_POST['ToCriteria'] . ' ' . _('Effective As At') . ' ' . $_POST['EffectiveDate']); } else { $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos,550,$FontSize, $SalesTypeName . ' ' ._('Prices For Categories') . ' ' . $_POST['FromCriteria'] . ' - ' . $_POST['ToCriteria'] . ' ' . _('Effective As At') . ' ' . $_POST['EffectiveDate'] ); } $YPos -=(2*$line_height); - /*Draw a rectangle to put the headings in */ + /*Draw a rectangle to put the headings in */ - $pdf->line($Left_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos+$line_height); - $pdf->line($Left_Margin, $YPos+$line_height,$Left_Margin, $YPos- $line_height); - $pdf->line($Left_Margin, $YPos- $line_height,$Page_Width-$Right_Margin, $YPos- $line_height); - $pdf->line($Page_Width-$Right_Margin, $YPos+$line_height,$Page_Width-$Right_Margin, $YPos- $line_height); + $pdf->line($Left_Margin, $YPos+$line_height, $Page_Width-$Right_Margin, $YPos+$line_height); + $pdf->line($Left_Margin, $YPos+$line_height, $Left_Margin, $YPos- $line_height); + $pdf->line($Left_Margin, $YPos-$line_height, $Page_Width-$Right_Margin, $YPos- $line_height); + $pdf->line($Page_Width-$Right_Margin, $YPos+$line_height, $Page_Width-$Right_Margin, $YPos- $line_height); /*set up the headings */ - $Xpos = $Left_Margin+1; - - $LeftOvers = $pdf->addTextWrap($Xpos,$YPos,60,$FontSize, _('Category') . '/' . _('Item'), 'left'); - $LeftOvers = $pdf->addTextWrap($Xpos+100,$YPos,160,$FontSize, _('Effective Date Range'), 'left'); - $LeftOvers = $pdf->addTextWrap($Xpos+220,$YPos,160,$FontSize, _('Product Image / Description'), 'left'); - if ($_POST['CustomerSpecials']==_('Customer Special Prices Only')){ - $LeftOvers = $pdf->addTextWrap($Left_Margin+s80+47+47+130+65+25,$YPos,60,$FontSize, _('Branch'), 'centre'); + $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos, 80, $FontSize, _('Item Code'));// 20chr @ 8dpi. + if($LeftOvers != '') {// If translated text is greater than column width, prints remainder. + $LeftOvers = $pdf->addTextWrap($Left_Margin, $YPos-$FontSize, 80, $FontSize, $LeftOvers); } + $LeftOvers = $pdf->addTextWrap($Left_Margin+80, $YPos, 200,$FontSize, _('Item Description'));// 50chr @ 8dpi. + if($LeftOvers != '') {// If translated text is greater than column width, prints remainder. + $LeftOvers = $pdf->addTextWrap($Left_Margin+80, $YPos-$FontSize, 200, $FontSize, $LeftOvers); + } + $LeftOvers = $pdf->addTextWrap($Left_Margin+280, $YPos, 96, $FontSize, _('Effective Date Range'), 'center');// (10+2+12)chr @ 8dpi. + if($LeftOvers != '') {// If translated text is greater than column width, prints remainder. + $LeftOvers = $pdf->addTextWrap($Left_Margin+280, $YPos-$FontSize, 96, $FontSize, $LeftOvers, 'center'); + } + + if ($_POST['CustomerSpecials']=='Customer Special Prices Only') { + $LeftOvers = $pdf->addTextWrap($Left_Margin+376, $YPos, 160, $FontSize, _('Branch'));// 40chr @ 8dpd. + } - $LeftOvers = $pdf->addTextWrap($Left_Margin+80+47+47+130+20,$YPos,180,$FontSize, _('Price') , 'right'); - - if ($_POST['ShowGPPercentages']=='Yes'){ - $LeftOvers = $pdf->addTextWrap($Left_Margin+140+47+47+130+65,$YPos,20,$FontSize, _('GP') .'%', 'centre'); + if ($_POST['ShowGPPercentages']=='Yes') { + $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-128, $YPos, 32, $FontSize, _('Gross Profit'), 'right');// 8chr @ 8dpi. + if($LeftOvers != '') {// If translated text is greater than column width, prints remainder. + $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-128, $YPos-$FontSize, 32, $FontSize, $LeftOvers, 'right'); + } } + $LeftOvers = $pdf->addTextWrap($Page_Width-$Right_Margin-96, $YPos, 96, $FontSize, _('Price') , 'right');// 24chr @ 8dpd. - $FontSize=8; $YPos -= (1.5 * $line_height); - - $PageNumber++; } - -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-07-27 00:47:57 UTC (rev 6796) +++ trunk/doc/Change.log 2014-07-29 18:37:18 UTC (rev 6797) @@ -1,4 +1,5 @@ webERP Change Log +29/07/14 RChacon: In PDFPriceList.php: Adds comments (info for developers), ViewTopic and BookMark, and currency name in locale language; deletes unused lines; reformats for legibility; adjusts column sizes to field sizes; improves printing of stockmaster.longdescription; improves code to reduce execution time (calculation out of loops); links right column positions to right margin; corrects IF for CustomerSpecials (deletes translation). In ManualSalesTypes.html: Adds help info about Print a price list by inventory category. 27/7/14 Exson: Fixed the PO header lost initiator bugs when locations changed. Report by Akits from www.minghao.hk/bbs/. 25/7/14 Phil: Allow dummy - labour stock type items to be added to purchase orders. 17/7/14 RChacon: Adds ViewTopic and BookMark, adds bullet for class ascending columns, repositions columns Type and Trans, add class number to Trans, completes printf. Modified: trunk/doc/Manual/ManualSalesTypes.html =================================================================== --- trunk/doc/Manual/ManualSalesTypes.html 2014-07-27 00:47:57 UTC (rev 6796) +++ trunk/doc/Manual/ManualSalesTypes.html 2014-07-29 18:37:18 UTC (rev 6797) @@ -33,4 +33,8 @@ <li>Price start date (set up in each <i>Item Prices</i>).</li> </ul> +<p>The paper size of the report is taken from user's default settings (set up in <i>User Settings</i>). If you want to change this set up, after saving, logout and login for the changes to take place.</p> + +<p>For "<i>Customer Special Prices Only</i>" (<i>Price Listing Type</i> option), the portrait orientation has an insufficient width. You should use the landscape orientation.</p> + <p> </p> Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-07-27 00:47:57 UTC (rev 6796) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-07-29 18:37:18 UTC (rev 6797) @@ -8,7 +8,7 @@ "Project-Id-Version: WebERP 4.081\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2014-02-08 17:33+1300\n" -"PO-Revision-Date: 2014-06-27 08:32-0600\n" +"PO-Revision-Date: 2014-07-29 12:33-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -6017,7 +6017,7 @@ #: SelectProduct.php:170 #, php-format msgid "Gross Profit" -msgstr "Ganancia Bruta" +msgstr "Margen bruto" #: Contracts.php:943 Currencies.php:300 Currencies.php:482 PO_Header.php:1134 #: PO_OrderDetails.php:113 SupplierCredit.php:291 SupplierInvoice.php:635 @@ -15461,12 +15461,12 @@ #: InventoryPlanning.php:391 InventoryValuation.php:236 PDFPriceList.php:260 #: PDFPrintLabel.php:292 StockCheck.php:272 msgid "From Inventory Category Code" -msgstr "Desde el Código de Categoría de Inventario" +msgstr "Desde el código de categoría de inventario" #: InventoryPlanning.php:403 InventoryValuation.php:252 PDFPriceList.php:270 #: PDFPrintLabel.php:301 StockCheck.php:283 msgid "To Inventory Category Code" -msgstr "Hasta el Código de Categoría de Inventario" +msgstr "Hasta el código de categoría de inventario" #: InventoryPlanning.php:415 InventoryPlanningPrefSupplier.php:476 #: InventoryValuation.php:265 StockCheck.php:295 @@ -19870,7 +19870,7 @@ msgstr "Listado de precios" #: PDFPriceList.php:250 -msgid "Print a price list" +msgid "Print a price list by inventory category" msgstr "Imprimir una lista de precios" #: PDFPriceList.php:281 PDFPrintLabel.php:312 Z_DataExport.php:542 |
From: <dai...@us...> - 2014-07-31 10:24:28
|
Revision: 6799 http://sourceforge.net/p/web-erp/reponame/6799 Author: daintree Date: 2014-07-31 10:24:19 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Andrew Galuski: new dashboard script Modified Paths: -------------- trunk/includes/session.inc trunk/sql/mysql/upgrade4.11-4.12.sql Added Paths: ----------- trunk/Dashboard.php Added: trunk/Dashboard.php =================================================================== --- trunk/Dashboard.php (rev 0) +++ trunk/Dashboard.php 2014-07-31 10:24:19 UTC (rev 6799) @@ -0,0 +1,805 @@ +<?php + +/* $Id: Dashboard.php 6338 2013-09-28 05:10:46Z daintree $*/ + +include('includes/session.inc'); + +$Title = _('Dashboard'); + +include('includes/header.inc'); + +echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/gl.png" title="' . _('Dashboard') . '" alt="" />' . _('Dashboard') . '</p>'; + +$sql = "SELECT pagesecurity + FROM scripts + WHERE scripts.script = 'AgedDebtors.php'"; +$ErrMsg = _('The security for Aging Debtors cannot be retrieved because'); +$DbgMsg = _('The SQL that was used and failed was'); +$Security1Result = DB_query($sql, $db, $ErrMsg, $DbgMsg); +$MyUserRow = DB_fetch_array($Security1Result); +$DebtorSecurity = $MyUserRow['pagesecurity']; + +$sql = "SELECT pagesecurity + FROM scripts + WHERE scripts.script = 'SuppPaymentRun.php'"; +$ErrMsg = _('The security for upcoming payments cannot be retrieved because'); +$DbgMsg = _('The SQL that was used and failed was'); +$Security2Result = DB_query($sql, $db, $ErrMsg, $DbgMsg); +$MyUserRow = DB_fetch_array($Security2Result); +$PayeeSecurity = $MyUserRow['pagesecurity']; + +$sql = "SELECT pagesecurity + FROM scripts + WHERE scripts.script = 'GLAccountInquiry.php'"; +$ErrMsg = _('The security for G/L Accounts cannot be retrieved because'); +$DbgMsg = _('The SQL that was used and failed was'); +$Security2Result = DB_query($sql, $db, $ErrMsg, $DbgMsg); +$MyUserRow = DB_fetch_array($Security2Result); +$CashSecurity = $MyUserRow['pagesecurity']; + +$sql = "SELECT pagesecurity + FROM scripts + WHERE scripts.script = 'SelectSalesOrder.php'"; +$ErrMsg = _('The security for Aging Debtors cannot be retrieved because'); +$DbgMsg = _('The SQL that was used and failed was'); +$Security1Result = DB_query($sql, $db, $ErrMsg, $DbgMsg); +$MyUserRow = DB_fetch_array($Security1Result); +$OrderSecurity = $MyUserRow['pagesecurity']; + +if (in_array($DebtorSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($DebtorSecurity)) { + echo '<br /><b>' . _('Overdue Customer Balances') . '</b> + <table class="selection"><tbody>'; + + $TableHeader = '<tr> + <th>' . _('Customer') . '</th> + <th>' . _('Reference') . '</th> + <th>' . _('Trans Date') . '</th> + <th>' . _('Due Date') . '</th> + <th>' . _('Balance') . '</th> + <th>' . _('Current') . '</th> + <th>' . _('Due Now') . '</th> + <th>' . '> ' . $_SESSION['PastDueDays1'] . ' ' . _('Days Over') . '</th> + <th>' . '> ' . $_SESSION['PastDueDays2'] . ' ' . _('Days Over') . '</th> + </tr>'; + echo $TableHeader; + $j = 1; + $k=0; //row colour counter + if ($_SESSION['SalesmanLogin'] != '') { + $_POST['Salesman'] = $_SESSION['SalesmanLogin']; + } + if (trim($_POST['Salesman'])!=''){ + $SalesLimit = " AND debtorsmaster.debtorno IN (SELECT DISTINCT debtorno FROM custbranch WHERE salesman = '".$_POST['Salesman']."') "; + } else { + $SalesLimit = ""; + } + $SQL = "SELECT debtorsmaster.debtorno, + debtorsmaster.name, + currencies.currency, + currencies.decimalplaces, + paymentterms.terms, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription, + SUM( + debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ) AS balance, + SUM( + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) >= paymentterms.daysbeforedue + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + ELSE + CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') .")) >= 0 + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END + END + ) AS due, + SUM( + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END + ELSE + CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL ('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . " + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END + ) AS overdue1, + SUM( + CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END + ELSE + CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL ('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays2'] . " + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END + END + ) AS overdue2 + FROM debtorsmaster, + paymentterms, + holdreasons, + currencies, + debtortrans + WHERE debtorsmaster.paymentterms = paymentterms.termsindicator + AND debtorsmaster.currcode = currencies.currabrev + AND debtorsmaster.holdreason = holdreasons.reasoncode + AND debtorsmaster.debtorno = debtortrans.debtorno + " . $SalesLimit . " + GROUP BY debtorsmaster.debtorno, + debtorsmaster.name, + currencies.currency, + paymentterms.terms, + paymentterms.daysbeforedue, + paymentterms.dayinfollowingmonth, + debtorsmaster.creditlimit, + holdreasons.dissallowinvoices, + holdreasons.reasondescription + HAVING + ROUND(ABS(SUM(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)),currencies.decimalplaces) > 0"; + $CustomerResult = DB_query($SQL,$db,'','',False,False); /*dont trap errors handled below*/ + + if (DB_error_no($db) !=0) { + prnMsg(_('The customer details could not be retrieved by the SQL because') . ' ' . DB_error_msg($db),'error'); + echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; + if ($debug==1){ + echo '<br />' . $SQL; + } + include('includes/footer.inc'); + exit; + } + + + $TotBal=0; + $TotCurr=0; + $TotDue=0; + $TotOD1=0; + $TotOD2=0; + + $ListCount = DB_num_rows($CustomerResult); + $CurrDecimalPlaces =2; //by default + + while ($AgedAnalysis = DB_fetch_array($CustomerResult,$db)){ + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + $CurrDecimalPlaces = $AgedAnalysis['decimalplaces']; + $DisplayDue = locale_number_format($AgedAnalysis['due']-$AgedAnalysis['overdue1'],$CurrDecimalPlaces); + $DisplayCurrent = locale_number_format($AgedAnalysis['balance']-$AgedAnalysis['due'],$CurrDecimalPlaces); + $DisplayBalance = locale_number_format($AgedAnalysis['balance'],$CurrDecimalPlaces); + $DisplayOverdue1 = locale_number_format($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2'],$CurrDecimalPlaces); + $DisplayOverdue2 = locale_number_format($AgedAnalysis['overdue2'],$CurrDecimalPlaces); + if ($DisplayDue <> 0 OR $DisplayOverdue1 <> 0 OR $DisplayOverdue2 <> 0) { + $TotBal += $AgedAnalysis['balance']; + $TotDue += ($AgedAnalysis['due']-$AgedAnalysis['overdue1']); + $TotCurr += ($AgedAnalysis['balance']-$AgedAnalysis['due']); + $TotOD1 += ($AgedAnalysis['overdue1']-$AgedAnalysis['overdue2']); + $TotOD2 += $AgedAnalysis['overdue2']; + + + printf('<td><b>%s</b></td> + <td><b>%s</b></td> + <td><b>%s</b></td> + <td><b>%s</b></td> + <td class="number"><b>%s</b></td> + <td class="number"><b>%s</b></td> + <td class="number" style="color:orange;"><b>%s</b></td> + <td class="number" style="color:red;"><b>%s</b></td> + <td class="number" style="color:red;"><b>%s</b></td>', + $AgedAnalysis['debtorno'] . ' - ' . $AgedAnalysis['name'], + '', + '', + '', + $DisplayBalance, + $DisplayCurrent, + $DisplayDue, + $DisplayOverdue1, + $DisplayOverdue2 + ); + echo '</tr>'; + $sql = "SELECT systypes.typename, + debtortrans.transno, + debtortrans.trandate, + daysbeforedue, + dayinfollowingmonth, + (debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc) as balance, + (CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + (CASE WHEN (TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate)) >= paymentterms.daysbeforedue + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) + ELSE + (CASE WHEN TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= 0 + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) + END) AS due, + (CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + (CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays1'] . ") THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc ELSE 0 END) + ELSE + (CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))', 'DAY') . ")) >= " . $_SESSION['PastDueDays1'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) + END) AS overdue1, + (CASE WHEN (paymentterms.daysbeforedue > 0) + THEN + (CASE WHEN TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) > paymentterms.daysbeforedue AND TO_DAYS(Now()) - TO_DAYS(debtortrans.trandate) >= (paymentterms.daysbeforedue + " . $_SESSION['PastDueDays2'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) + ELSE + (CASE WHEN (TO_DAYS(Now()) - TO_DAYS(DATE_ADD(DATE_ADD(debtortrans.trandate, " . INTERVAL('1', 'MONTH') . "), " . INTERVAL('(paymentterms.dayinfollowingmonth - DAYOFMONTH(debtortrans.trandate))','DAY') . ")) >= " . $_SESSION['PastDueDays2'] . ") + THEN debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc + ELSE 0 END) + END) AS overdue2 + FROM debtorsmaster, + paymentterms, + debtortrans, + systypes + WHERE systypes.typeid = debtortrans.type + AND debtorsmaster.paymentterms = paymentterms.termsindicator + AND debtorsmaster.debtorno = debtortrans.debtorno + AND debtortrans.debtorno = '" . $AgedAnalysis['debtorno'] . "' + AND ABS(debtortrans.ovamount + debtortrans.ovgst + debtortrans.ovfreight + debtortrans.ovdiscount - debtortrans.alloc)>0.004"; + + if ($_SESSION['SalesmanLogin'] != '') { + $sql .= " AND debtortrans.salesperson='" . $_SESSION['SalesmanLogin'] . "'"; + } + + $DetailResult = DB_query($sql,$db,'','',False,False); + if (DB_error_no($db) !=0) { + prnMsg(_('The details of outstanding transactions for customer') . ' - ' . $AgedAnalysis['debtorno'] . ' ' . _('could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); + echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; + if ($debug==1){ + echo '<br />' . _('The SQL that failed was') . '<br />' . $sql; + } + include('includes/footer.inc'); + exit; + } + + while ($DetailTrans = DB_fetch_array($DetailResult)){ + + $DisplayTranDate = ConvertSQLDate($DetailTrans['trandate']); + $DisplayDue = locale_number_format($DetailTrans['due']-$DetailTrans['overdue1'],$CurrDecimalPlaces); + $DisplayCurrent = locale_number_format($DetailTrans['balance']-$DetailTrans['due'],$CurrDecimalPlaces); + $DisplayBalance = locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces); + $DisplayOverdue1 = locale_number_format($DetailTrans['overdue1']-$DetailTrans['overdue2'],$CurrDecimalPlaces); + $DisplayOverdue2 = locale_number_format($DetailTrans['overdue2'],$CurrDecimalPlaces); + + if ($DetailTrans['daysbeforedue'] > 0) { + $AddDays=$DetailTrans['daysbeforedue'] . ' days'; + $DisplayDueDate = date_add(date_create($DetailTrans['trandate']), date_interval_create_from_date_string($AddDays)); + } else { + $AddDays=(intval($DetailTrans['dayinfollowingmonth']) - 1) . ' days'; + $DisplayDueDate= date_create($DetailTrans['trandate']); + $DisplayDueDate->modify('first day of next month'); + $DisplayDueDate=date_add($DisplayDueDate, date_interval_create_from_date_string($AddDays)); + + } + $DisplayDueDate=date_format($DisplayDueDate,$_SESSION['DefaultDateFormat']); + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + printf('<td style="text-align:center">%s</td> + <td style="text-align:right">%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td class="number" style="color:orange;">%s</td> + <td class="number" style="color:red;">%s</td> + <td class="number" style="color:red;">%s</td>', + $DetailTrans['typename'], + $DetailTrans['transno'], + $DisplayTranDate, + $DisplayDueDate, + $DisplayBalance, + $DisplayCurrent, + $DisplayDue, + $DisplayOverdue1, + $DisplayOverdue2); + echo '</tr>'; + } //end while there are detail transactions to show + } //has Due now or overdue + } //end customer aged analysis while loop + + $DisplayTotBalance = locale_number_format($TotBal,$CurrDecimalPlaces); + $DisplayTotDue = locale_number_format($TotDue,$CurrDecimalPlaces); + $DisplayTotCurrent = locale_number_format($TotCurr,$CurrDecimalPlaces); + $DisplayTotOverdue1 = locale_number_format($TotOD1,$CurrDecimalPlaces); + $DisplayTotOverdue2 = locale_number_format($TotOD2,$CurrDecimalPlaces); + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + printf('<td style="text-align:left"><b>%s</b></td> + <td><b>%s</b></td> + <td><b>%s</b></td> + <td><b>%s</b></td> + <td class="number"><b>%s</b></td> + <td class="number"><b>%s</b></td> + <td class="number"><b>%s</b></td> + <td class="number" style="color:red;"><b>%s</b></td> + <td class="number" style="color:red;"><b>%s</b></td>', + _('Totals'), + '', + '', + '', + $DisplayTotBalance, + $DisplayTotCurrent, + $DisplayTotDue, + $DisplayTotOverdue1, + $DisplayTotOverdue2); + + echo '</tr>'; + echo '</tbody> + </table>'; +} //DebtorSecurity + +if (in_array($PayeeSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PayeeSecurity)) { + //$UpcomingDate = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')+1,0 ,Date('y'))); + $UpcomingDate = Date(($_SESSION['DefaultDateFormat']), strtotime($UpcomingDate . ' + 30 days')); + + echo '<br /><b>' . _('Supplier Invoices Due within 1 Month') . '</b> + <table class="selection"> + <tbody>'; + + $TableHeader = '<tr> + <th>' . _('Supplier') . '</th> + <th>' . _('Invoice Date') . '</th> + <th>' . _('Invoice') . '</th> + <th>' . _('Amount Due') . '</th> + <th>' . _('Due Date') . '</th> + </tr>'; + echo $TableHeader; + $j = 1; + $k=0; //row colour counter + $sql = "SELECT suppliers.supplierid, + currencies.decimalplaces AS currdecimalplaces, + SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) AS balance + FROM suppliers INNER JOIN paymentterms + ON suppliers.paymentterms = paymentterms.termsindicator + INNER JOIN supptrans + ON suppliers.supplierid = supptrans.supplierno + INNER JOIN systypes + ON systypes.typeid = supptrans.type + INNER JOIN currencies + ON suppliers.currcode=currencies.currabrev + WHERE supptrans.ovamount + supptrans.ovgst - supptrans.alloc !=0 + AND supptrans.hold=0 + GROUP BY suppliers.supplierid, + currencies.decimalplaces + HAVING SUM(supptrans.ovamount + supptrans.ovgst - supptrans.alloc) <> 0 + ORDER BY suppliers.supplierid"; + + $SuppliersResult = DB_query($sql,$db); + + $SupplierID =''; + $TotalPayments = 0; + $TotalAccumDiffOnExch = 0; + + while ($SuppliersToPay = DB_fetch_array($SuppliersResult)){ + + $CurrDecimalPlaces = $SuppliersToPay['currdecimalplaces']; + + $sql = "SELECT suppliers.supplierid, + suppliers.suppname, + systypes.typename, + paymentterms.terms, + supptrans.suppreference, + supptrans.trandate, + supptrans.rate, + supptrans.transno, + supptrans.type, + supptrans.duedate, + (supptrans.ovamount + supptrans.ovgst - supptrans.alloc) AS balance, + (supptrans.ovamount + supptrans.ovgst ) AS trantotal, + supptrans.diffonexch, + supptrans.id + FROM suppliers INNER JOIN paymentterms + ON suppliers.paymentterms = paymentterms.termsindicator + INNER JOIN supptrans + ON suppliers.supplierid = supptrans.supplierno + INNER JOIN systypes + ON systypes.typeid = supptrans.type + WHERE supptrans.supplierno = '" . $SuppliersToPay['supplierid'] . "' + AND supptrans.ovamount + supptrans.ovgst - supptrans.alloc !=0 + AND supptrans.duedate <='" . FormatDateForSQL($UpcomingDate) . "' + AND supptrans.hold = 0 + ORDER BY supptrans.supplierno, + supptrans.type, + supptrans.transno"; + + $TransResult = DB_query($sql,$db,'','',false,false); + if (DB_error_no($db) !=0) { + prnMsg(_('The details of supplier invoices due could not be retrieved because') . ' - ' . DB_error_msg($db),'error'); + echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; + if ($debug==1){ + echo '<br />' . _('The SQL that failed was') . ' ' . $sql; + } + include('includes/footer.inc'); + exit; + } + + unset($Allocs); + $Allocs = array(); + $AllocCounter =0; + + while ($DetailTrans = DB_fetch_array($TransResult)){ + + if ($DetailTrans['supplierid'] != $SupplierID){ /*Need to head up for a new suppliers details */ + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + $SupplierID = $DetailTrans['supplierid']; + $SupplierName = $DetailTrans['suppname']; + + //$AccumBalance = 0; + $AccumDiffOnExch = 0; + + printf('<td style="text-align:left"><b>%s</b></td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td>%s</td>', + $DetailTrans['supplierid'] . ' - ' . $DetailTrans['suppname'] . ' - ' . $DetailTrans['terms'], + '', + '', + '', + ''); + echo '</tr>'; + } + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + $DisplayFormat = ''; + + if ((time()-(60*60*24)) > strtotime($DetailTrans['duedate'])) { + $DisplayFormat=' style="color:red;" '; + } + $DislayTranDate = ConvertSQLDate($DetailTrans['trandate']); + $AccumBalance += $DetailTrans['balance']; + $PayNow='<a href="' . $RootPath . '/Payments.php?&SupplierID=' . $SupplierID. '&Amount=' . $DetailTrans['balance'] . '&BankTransRef=' .$DetailTrans['suppreference'] . '">' .$DetailTrans['suppreference'] . '</a>'; + printf('<td style="text-align:center">%s</td> + <td>%s</td> + <td>%s</td> + <td class="number"' . $DisplayFormat . '>%s</td> + <td' . $DisplayFormat . '>%s</td>', + $DetailTrans['typename'], + $DislayTranDate, + $PayNow, + locale_number_format($DetailTrans['balance'],$CurrDecimalPlaces), + ConvertSQLDate($DetailTrans['duedate'])); + echo '</tr>'; + } /*end while there are detail transactions to show */ + } /* end while there are suppliers to retrieve transactions for */ + + /* if (DB_error_no($db) !=0) { + prnMsg(_('None of the payments will be processed. Unfortunately, there was a problem committing the changes to the database because') . ' - ' . DB_error_msg($db),'error'); + echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>'; + if ($debug==1){ + prnMsg(_('The SQL that failed was') . '<br />' . $SQL,'error'); + } + include('includes/footer.inc'); + exit; + } */ + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + printf('<td style="text-align:left"><b>%s</b></td> + <td>%s</td> + <td>%s</td> + <td class="number"><b>%s</b></td> + <td><b>%s</b></td>', + _('Grand Total Payments Due'), + '', + '', + locale_number_format($AccumBalance,$CurrDecimalPlaces), + ''); + echo '</tr>'; + echo '</tbody> + </table>'; +} //PayeeSecurity +if (in_array($CashSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($CashSecurity)) { + include('includes/GLPostings.inc'); + echo '<br /><b>Bank and Credit Card Balances</b> + <table class="selection"><tbody>'; + $FirstPeriodSelected = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); + $LastPeriodSelected = GetPeriod(date($_SESSION['DefaultDateFormat']), $db); + $SelectedPeriod=$LastPeriodSelected; + $TableHeader = '<tr> + <th class="ascending">' . _('GL Account') . '</th> + <th class="ascending">' . _('Account Name') . '</th> + <th class="ascending">' . _('Balance') . '</th> + </tr>'; + echo $TableHeader; + $j = 1; + $k=0; //row colour counter + $sql = "SELECT bankaccounts.accountcode, + bankaccounts.bankaccountcode, + chartmaster.accountname, + bankaccountname + FROM bankaccounts INNER JOIN chartmaster + ON bankaccounts.accountcode = chartmaster.accountcode"; + + $ErrMsg = _('The bank accounts set up could not be retrieved because'); + $DbgMsg = _('The SQL used to retrieve the bank account details was') . '<br />' . $sql; + $result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg); + + while ($myrow = DB_fetch_array($result1)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + /*Is the account a balance sheet or a profit and loss account */ + $result = DB_query("SELECT pandl + FROM accountgroups + INNER JOIN chartmaster ON accountgroups.groupname=chartmaster.group_ + WHERE chartmaster.accountcode='" . $myrow['accountcode'] ."'",$db); + $PandLRow = DB_fetch_row($result); + if ($PandLRow[0]==1){ + $PandLAccount = True; + }else{ + $PandLAccount = False; /*its a balance sheet account */ + } + + $sql= "SELECT counterindex, + type, + typename, + gltrans.typeno, + trandate, + narrative, + amount, + periodno, + gltrans.tag, + tagdescription + FROM gltrans INNER JOIN systypes + ON systypes.typeid=gltrans.type + LEFT JOIN tags + ON gltrans.tag = tags.tagref + WHERE gltrans.account = '" . $myrow['accountcode'] . "' + AND posted=1 + AND periodno>='" . $FirstPeriodSelected . "' + AND periodno<='" . $LastPeriodSelected . "' + ORDER BY periodno, gltrans.trandate, counterindex"; + $TransResult = DB_query($sql,$db,$ErrMsg); + if ($PandLAccount==True) { + $RunningTotal = 0; + } else { + // added to fix bug with Brought Forward Balance always being zero + $sql = "SELECT bfwd, + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode='" . $myrow['accountcode'] . "' + AND chartdetails.period='" . $FirstPeriodSelected . "'"; + + $ErrMsg = _('The chart details for account') . ' ' . $myrow['accountcode'] . ' ' . _('could not be retrieved'); + $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); + $ChartDetailRow = DB_fetch_array($ChartDetailsResult); + $RunningTotal =$ChartDetailRow['bfwd']; + } + $PeriodTotal = 0; + $PeriodNo = -9999; + while ($myrow2=DB_fetch_array($TransResult)) { + if ($myrow2['periodno']!=$PeriodNo){ + if ($PeriodNo!=-9999){ //ie its not the first time around + /*Get the ChartDetails balance b/fwd and the actual movement in the account for the period as recorded in the chart details - need to ensure integrity of transactions to the chart detail movements. Also, for a balance sheet account it is the balance carried forward that is important, not just the transactions*/ + + $sql = "SELECT bfwd, + actual, + period + FROM chartdetails + WHERE chartdetails.accountcode='" . $myrow['accountcode'] . "' + AND chartdetails.period='" . $PeriodNo . "'"; + + $ErrMsg = _('The chart details for account') . ' ' . $myrow['accountcode'] . ' ' . _('could not be retrieved'); + $ChartDetailsResult = DB_query($sql,$db,$ErrMsg); + $ChartDetailRow = DB_fetch_array($ChartDetailsResult); + if ($PeriodTotal < 0 ){ //its a credit balance b/fwd + if ($PandLAccount==True) { + $RunningTotal = 0; + } + } else { //its a debit balance b/fwd + if ($PandLAccount==True) { + $RunningTotal = 0; + } + } + } + $PeriodNo = $myrow2['periodno']; + $PeriodTotal = 0; + } + $RunningTotal += $myrow2['amount']; + $PeriodTotal += $myrow2['amount']; + } + $DisplayBalance=locale_number_format(($RunningTotal),$_SESSION['CompanyRecord']['decimalplaces']); + printf('<td>%s</td> + <td>%s</td> + <td class="number">%s</td>', + $myrow['accountcode'] . ' - ' . $myrow['accountname'], + $myrow['bankaccountname'], + $DisplayBalance); + echo '</tr>'; + } //each bank account + echo '</tbody> + </table>'; +} //CashSecurity + +if (in_array($OrderSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($OrderSecurity)) { + echo '<br /><b>Outstanding Orders</b>'; + + echo '<table cellpadding="2" width="95%" class="selection">'; + $RecentDate = Date(($_SESSION['DefaultDateFormat']), strtotime($RecentDate . ' - 1 days')); + $TableHeader = '<tr>' . + /* + <th>' . _('Modify') . '</th> + */ + '<th>' . _('View Order') . '</th>' . + /* + <th>' . _('Invoice') . '</th> + <th>' . _('Dispatch Note') . '</th> + <th>' . _('Labels') . '</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') . ' in ' . $_SESSION['CompanyRecord']['currencydefault'] . '</th>'; + echo $TableHeader; + + $SQL = "SELECT salesorders.orderno, + debtorsmaster.name, + custbranch.brname, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverto, + salesorders.deliverydate, + salesorders.printedpackingslip, + salesorders.poplaced, + 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 =0 + GROUP BY salesorders.orderno, + debtorsmaster.name, + custbranch.brname, + salesorders.customerref, + salesorders.orddate, + salesorders.deliverto, + salesorders.deliverydate, + salesorders.printedpackingslip + ORDER BY salesorders.orddate DESC, salesorders.orderno"; + $ErrMsg = _('No orders or quotations were returned by the SQL because'); + $SalesOrdersResult = DB_query($SQL,$db,$ErrMsg); + + /*show a table of the orders returned by the SQL */ + if (DB_num_rows($SalesOrdersResult)>0) { + + $i = 1; + $j = 1; + $k=0; //row colour counter + $OrdersTotal =0; + + while ($myrow=DB_fetch_array($SalesOrdersResult)) { + $FontColor=''; + $FormatedOrderDate = ConvertSQLDate($myrow['orddate']); + if ($FormatedOrderDate >= $RecentDate) { + $FontColor=' style="color:green; font-weight:bold"'; + } + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k++; + } + + + $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?TransNo=' . $myrow['orderno']; + } else { /*pre-printed stationery default */ + $PrintDispatchNote = $RootPath . '/PrintCustOrder.php?TransNo=' . $myrow['orderno']; + } + $PrintQuotation = $RootPath . '/PDFQuotation.php?QuotationNo=' . $myrow['orderno']; + $PrintQuotationPortrait = $RootPath . '/PDFQuotationPortrait.php?QuotationNo=' . $myrow['orderno']; + $FormatedDelDate = ConvertSQLDate($myrow['deliverydate']); + $FormatedOrderValue = locale_number_format($myrow['ordervalue'],$_SESSION['CompanyRecord']['decimalplaces']); + $PrintAck = $RootPath . '/PDFAck.php?AcknowledgementNo=' . $myrow['orderno']; + + if ($myrow['printedpackingslip']==0) { + $PrintText = _('Print'); + } else { + $PrintText = _('Reprint'); + } + + $PrintLabels = $RootPath . '/PDFShipLabel.php?Type=Sales&ORD=' . $myrow['orderno'] ; + + + printf( + /*<td><a href="%s">%s</a></td>*/ + '<td><a href="%s" target="_blank">' . $myrow['orderno'] . '</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') . '" alt="" /></a></td> + <td><a href="%s">' . _('Labels') . '</a></td> + */ + '<td' . $FontColor . '>%s</td> + <td' . $FontColor . '>%s</td> + <td' . $FontColor . '>%s</td> + <td' . $FontColor . '>%s</td> + <td' . $FontColor . '>%s</td> + <td' . $FontColor . '>%s</td> + <td' . $FontColor . ' class="number">%s</td> + </tr>', + /* + $ModifyPage, + $myrow['orderno'], + */ + $PrintAck, + /* + $Confirm_Invoice, + $PrintDispatchNote, + $PrintLabels, + */ + $myrow['name'], + $myrow['brname'], + $myrow['customerref'], + $FormatedOrderDate, + $FormatedDelDate, + html_entity_decode($myrow['deliverto'],ENT_QUOTES,'UTF-8'), + $FormatedOrderValue, + $i, + $i, + $myrow['orderno']); + $i++; + $OrdersTotal += $myrow['ordervalue']; + } //while + + echo '<tfoot><tr><td colspan="6" class="number">'; + echo '<b>' . _('Total Order(s) Value in'); + echo ' ' . $_SESSION['CompanyRecord']['currencydefault'] . ' :</b></td> + <td class="number"><b>' . locale_number_format($OrdersTotal,$_SESSION['CompanyRecord']['decimalplaces']) . '</b></td> + </tr></tfoot> + </table>'; + } //rows > 0 +} //OrderSecurity +include('includes/footer.inc'); +?> \ No newline at end of file Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2014-07-30 10:09:15 UTC (rev 6798) +++ trunk/includes/session.inc 2014-07-31 10:24:19 UTC (rev 6799) @@ -88,6 +88,8 @@ if (isset($_POST['UserNameEntryField']) AND isset($_POST['Password'])) { $rc = userLogin($_POST['UserNameEntryField'], $_POST['Password'], $SysAdminEmail, $db); + header('Location: ' . $PathPrefix .'Dashboard.php'); + exit; } elseif (empty($_SESSION['DatabaseName'])) { $rc = UL_SHOWLOGIN; } else { @@ -139,7 +141,7 @@ if (strcmp($Version,$_SESSION['VersionNumber'])>0 AND (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { header('Location: UpgradeDatabase.php'); } -if(isset($_SESSION['DB_Maintenance'])){ +if(isset($_SESSION['DB_Maintenance'])){ if ($_SESSION['DB_Maintenance']>0) { //run the DB maintenance script if (DateDiff(Date($_SESSION['DefaultDateFormat']), ConvertSQLDate($_SESSION['DB_Maintenance_LastRun']) @@ -152,7 +154,7 @@ } } //purge the audit trail if necessary -if (isset($_SESSION['MonthsAuditTrail'])){ +if (isset($_SESSION['MonthsAuditTrail'])){ $sql = "DELETE FROM audittrail WHERE transactiondate <= '" . Date('Y-m-d', mktime(0,0,0, Date('m')-$_SESSION['MonthsAuditTrail'])) . "'"; $ErrMsg = _('There was a problem deleting expired audit-trail history'); @@ -217,7 +219,7 @@ $result = 'companies/' . $CompanyDir . '/logo.png'; } elseif (file_exists($dir . '/logo.jpg')) { $result = 'companies/' . $CompanyDir . '/logo.jpg'; - } + } return $result; } Modified: trunk/sql/mysql/upgrade4.11-4.12.sql =================================================================== --- trunk/sql/mysql/upgrade4.11-4.12.sql 2014-07-30 10:09:15 UTC (rev 6798) +++ trunk/sql/mysql/upgrade4.11-4.12.sql 2014-07-31 10:24:19 UTC (rev 6799) @@ -52,6 +52,7 @@ ALTER TABLE stockrequest DROP KEY departmentid_2; ALTER TABLE stockrequest DROP KEY loccode_2; ALTER TABLE stockrequestitems DROP KEY stockid_2, DROP KEY dispatchid_2; +INSERT INTO scripts VALUES('Dashboard.php',1,'Display outstanding debtors, creditors etc'); UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber'; |
From: <rc...@us...> - 2014-07-31 19:58:24
|
Revision: 6800 http://sourceforge.net/p/web-erp/reponame/6800 Author: rchacon Date: 2014-07-31 19:58:21 +0000 (Thu, 31 Jul 2014) Log Message: ----------- Corrects the bottom line of the rectangle. Adds comments (info for developers). Modified Paths: -------------- trunk/doc/Change.log trunk/includes/class.pdf.php Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-07-31 10:24:19 UTC (rev 6799) +++ trunk/doc/Change.log 2014-07-31 19:58:21 UTC (rev 6800) @@ -1,4 +1,5 @@ webERP Change Log +31/07/14 RChacon: Corrects the bottom line of the rectangle. Adds comments (info for developers). 29/07/14 RChacon: In PDFPriceList.php: Adds comments (info for developers), ViewTopic and BookMark, and currency name in locale language; deletes unused lines; reformats for legibility; adjusts column sizes to field sizes; improves printing of stockmaster.longdescription; improves code to reduce execution time (calculation out of loops); links right column positions to right margin; corrects IF for CustomerSpecials (deletes translation). In ManualSalesTypes.html: Adds help info about Print a price list by inventory category. 27/7/14 Exson: Fixed the PO header lost initiator bugs when locations changed. Report by Akits from www.minghao.hk/bbs/. 25/7/14 Phil: Allow dummy - labour stock type items to be added to purchase orders. Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2014-07-31 10:24:19 UTC (rev 6799) +++ trunk/includes/class.pdf.php 2014-07-31 19:58:21 UTC (rev 6800) @@ -1,5 +1,4 @@ <?php - /* $Id$ */ /* ----------------------------------------------------------------------------------------------- @@ -218,26 +217,30 @@ $this->Output($DocumentFilename,'D'); } - function RoundRectangle($XPos, $YPos, $Width, $Height, $RadiusX, $RadiusY) { - $this->line($XPos, $YPos-$RadiusY, $XPos, $YPos-$Height+$RadiusY);// Left side - $this->line($XPos+$RadiusX, $YPos, $XPos+$Width-$RadiusX, $YPos);// Top side - $this->line($XPos+$RadiusX, $YPos-$Height-$RadiusX, $XPos+$Width-$RadiusX, $YPos-$Height-$RadiusX);// Bottom side - $this->line($XPos+$Width, $YPos-$RadiusY, $XPos+$Width, $YPos-$Height+$RadiusY);// Right side - $this->partEllipse($XPos+$RadiusX, $YPos-$RadiusY, 90, 180, $RadiusX, $RadiusY);// Top left corner - $this->partEllipse($XPos+$RadiusX, $YPos-$Height+$RadiusY, 180, 270, $RadiusX, $RadiusY);// Bottom left corner - $this->partEllipse($XPos+$Width-$RadiusX, $YPos-$RadiusY, 0, 90, $RadiusX, $RadiusY);// Top right corner - $this->partEllipse($XPos+$Width-$RadiusX, $YPos-$Height+$RadiusY, 270, 360, $RadiusX, $RadiusY);// Bottom right corner + function Rectangle($XPos, $YPos, $Width, $Height) { + // $XPos, $YPos = Left top position (left line, top line). + // $Width, $Height = Size (line-to-line). + $this->line($XPos, $YPos, $XPos+$Width, $YPos);// Top side. + $this->line($XPos, $YPos-$Height, $XPos+$Width, $YPos-$Height);// Bottom side. + $this->line($XPos, $YPos, $XPos, $YPos-$Height);// Left side. + $this->line($XPos+$Width, $YPos, $XPos+$Width, $YPos-$Height);// Right side } - function Rectangle($XPos, $YPos, $Width, $Height) { - $this->line($XPos, $YPos, $XPos+$Width, $YPos); - $this->line($XPos+$Width, $YPos, $XPos+$Width, $YPos-$Height); - $this->line($XPos+$Width, $YPos-$Height, $XPos, $YPos-$Height); - $this->line($XPos, $YPos-$Height, $XPos, $YPos); + function RoundRectangle($XPos, $YPos, $Width, $Height, $RadiusX, $RadiusY) { + // $XPos, $YPos = Left top position (left line, top line). + // $Width, $Height = Size (line-to-line). + // $RadiusX, $RadiusY = corner radii (horizontal, vertical). + $this->line($XPos+$RadiusX, $YPos, $XPos+$Width-$RadiusX, $YPos);// Top side. + $this->line($XPos+$RadiusX, $YPos-$Height, $XPos+$Width-$RadiusX, $YPos-$Height);// Bottom side. + $this->line($XPos, $YPos-$RadiusY, $XPos, $YPos-$Height+$RadiusY);// Left side. + $this->line($XPos+$Width, $YPos-$RadiusY, $XPos+$Width, $YPos-$Height+$RadiusY);// Right side. + $this->partEllipse($XPos+$RadiusX, $YPos-$RadiusY, 90, 180, $RadiusX, $RadiusY);// Top left corner. + $this->partEllipse($XPos+$Width-$RadiusX, $YPos-$RadiusY, 0, 90, $RadiusX, $RadiusY);// Top right corner. + $this->partEllipse($XPos+$RadiusX, $YPos-$Height+$RadiusY, 180, 270, $RadiusX, $RadiusY);// Bottom left corner. + $this->partEllipse($XPos+$Width-$RadiusX, $YPos-$Height+$RadiusY, 270, 360, $RadiusX, $RadiusY);// Bottom right corner. } function addTextWrap($XPos, $YPos, $Width, $Height, $Text, $Align='J', $border=0, $fill=0) { - /* Returns the balance of the string that could not fit in the width * XPos = pdf horizontal coordinate * YPos = pdf vertical coordiante |
From: <dai...@us...> - 2014-08-01 21:53:11
|
Revision: 6801 http://sourceforge.net/p/web-erp/reponame/6801 Author: daintree Date: 2014-08-01 21:53:04 +0000 (Fri, 01 Aug 2014) Log Message: ----------- Tim: change order of SelectWorkOrder links Modified Paths: -------------- trunk/SelectWorkOrder.php trunk/doc/Change.log Modified: trunk/SelectWorkOrder.php =================================================================== --- trunk/SelectWorkOrder.php 2014-07-31 19:58:21 UTC (rev 6800) +++ trunk/SelectWorkOrder.php 2014-08-01 21:53:04 UTC (rev 6801) @@ -318,8 +318,8 @@ <tr> <th>' . _('Modify') . '</th> <th class="ascending">' . _('Status') . '</th> + <th>' . _('Issue To') . '</th> <th>' . _('Receive') . '</th> - <th>' . _('Issue To') . '</th> <th>' . _('Costing') . '</th> <th>' . _('Paperwork') . '</th> <th class="ascending">' . _('Item') . '</th> @@ -328,7 +328,7 @@ <th class="ascending">' . _('Quantity Outstanding') . '</th> <th class="ascending">' . _('Start Date') . '</th> <th class="ascending">' . _('Required Date') . '</th> - </tr>'; + </tr>'; $k=0; //row colour counter while ($myrow=DB_fetch_array($WorkOrdersResult)) { @@ -346,7 +346,7 @@ $Receive_WO = $RootPath . '/WorkOrderReceive.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; $Issue_WO = $RootPath . '/WorkOrderIssue.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; $Costing_WO =$RootPath . '/WorkOrderCosting.php?WO=' .$myrow['wo']; - $Printing_WO =$RootPath . '/PDFWOPrint.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; + $Printing_WO =$RootPath . '/PDFWOPrint.php?WO=' .$myrow['wo'] . '&StockID=' . $myrow['stockid']; $FormatedRequiredByDate = ConvertSQLDate($myrow['requiredby']); $FormatedStartDate = ConvertSQLDate($myrow['startdate']); @@ -354,8 +354,8 @@ printf('<td><a href="%s">%s</a></td> <td><a href="%s">' . _('Status') . '</a></td> + <td><a href="%s">' . _('Issue To') . '</a></td> <td><a href="%s">' . _('Receive') . '</a></td> - <td><a href="%s">' . _('Issue To') . '</a></td> <td><a href="%s">' . _('Costing') . '</a></td> <td><a href="%s">' . _('Print W/O') . '</a></td> <td>%s - %s</td> @@ -368,8 +368,8 @@ $ModifyPage, $myrow['wo'], $Status_WO, + $Issue_WO, $Receive_WO, - $Issue_WO, $Costing_WO, $Printing_WO, $myrow['stockid'], @@ -378,7 +378,7 @@ locale_number_format($myrow['qtyrecd'],$myrow['decimalplaces']), locale_number_format($myrow['qtyreqd']-$myrow['qtyrecd'],$myrow['decimalplaces']), $FormatedStartDate, - $FormatedRequiredByDate); + $FormatedRequiredByDate); //end of page full new headings if } //end of while loop Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-07-31 19:58:21 UTC (rev 6800) +++ trunk/doc/Change.log 2014-08-01 21:53:04 UTC (rev 6801) @@ -1,4 +1,7 @@ webERP Change Log + + +2/1/14 Tim: Change columns around on SelectWorkOrder.php 31/07/14 RChacon: Corrects the bottom line of the rectangle. Adds comments (info for developers). 29/07/14 RChacon: In PDFPriceList.php: Adds comments (info for developers), ViewTopic and BookMark, and currency name in locale language; deletes unused lines; reformats for legibility; adjusts column sizes to field sizes; improves printing of stockmaster.longdescription; improves code to reduce execution time (calculation out of loops); links right column positions to right margin; corrects IF for CustomerSpecials (deletes translation). In ManualSalesTypes.html: Adds help info about Print a price list by inventory category. 27/7/14 Exson: Fixed the PO header lost initiator bugs when locations changed. Report by Akits from www.minghao.hk/bbs/. |
From: <dai...@us...> - 2014-08-02 05:07:58
|
Revision: 6802 http://sourceforge.net/p/web-erp/reponame/6802 Author: daintree Date: 2014-08-02 05:07:53 +0000 (Sat, 02 Aug 2014) Log Message: ----------- update tcpdf Modified Paths: -------------- trunk/Labels.php trunk/PDFPrintLabel.php trunk/includes/PDFStarter.php trunk/includes/class.pdf.php trunk/includes/tcpdf/README.TXT trunk/includes/tcpdf/tcpdf.php Added Paths: ----------- trunk/includes/tcpdf/include/ trunk/includes/tcpdf/include/sRGB.icc trunk/includes/tcpdf/include/tcpdf_colors.php trunk/includes/tcpdf/include/tcpdf_filters.php trunk/includes/tcpdf/include/tcpdf_font_data.php trunk/includes/tcpdf/include/tcpdf_fonts.php trunk/includes/tcpdf/include/tcpdf_images.php trunk/includes/tcpdf/include/tcpdf_static.php trunk/includes/tcpdf/tcpdf_autoconfig.php Removed Paths: ------------- trunk/includes/tcpdf/2dbarcodes.php trunk/includes/tcpdf/barcodes.php trunk/includes/tcpdf/config/lang/ trunk/includes/tcpdf/encodings_maps.php trunk/includes/tcpdf/htmlcolors.php trunk/includes/tcpdf/tcpdf.pem trunk/includes/tcpdf/unicode_data.php Modified: trunk/Labels.php =================================================================== --- trunk/Labels.php 2014-08-01 21:53:04 UTC (rev 6801) +++ trunk/Labels.php 2014-08-02 05:07:53 UTC (rev 6802) @@ -117,6 +117,10 @@ . '" alt="" />' . $Title . ' - ' . _('all measurements in PDF points') . '</p>'; +if (!function_exists('gd_info')) { + prnMsg(_('The GD module for PHP is required to print barcode labels. Your PHP installation is not capable currently. You will most likely experience problems with this script until the GD module is enabled.'),'error'); +} + if (isset($_POST['SelectedLabelID'])){ $SelectedLabelID =$_POST['SelectedLabelID']; if (ctype_digit($_POST['NoOfFieldsDefined'])){ //Now Process any field updates @@ -236,7 +240,7 @@ $result = DB_query($sql,$db,$ErrMsg); $Message = _('The new label template has been added to the database'); } - + if (isset($InputError) AND $InputError !=1) { unset( $_POST['PaperSize']); unset( $_POST['Description']); @@ -304,8 +308,16 @@ echo '<tr class="OddTableRows">'; $k++; } - $NoOfRows = floor(($myrow['pageheight']-$myrow['topmargin'])/$myrow['rowheight']); - $NoOfCols = floor(($myrow['pagewidth']-$myrow['leftmargin'])/$myrow['columnwidth']); + if ($myrow['rowheight']>0) { + $NoOfRows = floor(($myrow['pageheight']-$myrow['topmargin'])/$myrow['rowheight']); + } else { + $NoOfRows = 0; + } + if ($myrow['columnwidth']>0) { + $NoOfCols = floor(($myrow['pagewidth']-$myrow['leftmargin'])/$myrow['columnwidth']); + } else { + $NoOfCols = 0; + } foreach ($PaperSize as $PaperName=>$PaperType) { if ($PaperType['PageWidth'] == $myrow['pagewidth'] AND $PaperType['PageHeight'] == $myrow['pageheight']) { Modified: trunk/PDFPrintLabel.php =================================================================== --- trunk/PDFPrintLabel.php 2014-08-01 21:53:04 UTC (rev 6801) +++ trunk/PDFPrintLabel.php 2014-08-02 05:07:53 UTC (rev 6802) @@ -6,7 +6,6 @@ $PtsPerMM = 2.83465; //pdf points per mm - if ((isset($_POST['ShowLabels']) OR isset($_POST['SelectAll'])) AND isset($_POST['FromCriteria']) AND mb_strlen($_POST['FromCriteria'])>=1 @@ -117,10 +116,10 @@ include('includes/footer.inc'); exit; } -if (isset($_POST['PrintLabels']) - AND isset($_POST['NoOfLabels']) - AND $_POST['NoOfLabels']>0){ - $NoOfLabels = 0; + +$NoOfLabels = 0; +if (isset($_POST['PrintLabels']) AND isset($_POST['NoOfLabels']) AND $_POST['NoOfLabels']>0){ + for ($i=0;$i < $_POST['NoOfLabels'];$i++){ if (isset($_POST['PrintLabel'.$i])){ $NoOfLabels++; @@ -271,16 +270,21 @@ echo '<p class="page_title_text"><img src="' . $RootPath . '/css/' . $Theme . '/images/customer.png" title="' . _('Price Labels') . '" alt="" /> ' . ' ' . _('Print Price Labels') . '</p>'; + if (!function_exists('gd_info')) { + prnMsg(_('The GD module for PHP is required to print barcode labels. Your PHP installation is not capable currently. You will most likely experience problems with this script until the GD module is enabled.'),'error'); + } + + if (!isset($_POST['FromCriteria']) OR !isset($_POST['ToCriteria'])) { /*if $FromCriteria is not set then show a form to allow input */ - echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<table class="selection">'; - echo '<tr> - <td>' . _('Label to print') . ':</td> - <td><select required="required" autofocus="autofocus" name="LabelID">'; + echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <table class="selection"> + <tr> + <td>' . _('Label to print') . ':</td> + <td><select required="required" autofocus="autofocus" name="LabelID">'; $LabelResult = DB_query("SELECT labelid, description FROM labels",$db); while ($LabelRow = DB_fetch_array($LabelResult)){ Modified: trunk/includes/PDFStarter.php =================================================================== --- trunk/includes/PDFStarter.php 2014-08-01 21:53:04 UTC (rev 6801) +++ trunk/includes/PDFStarter.php 2014-08-02 05:07:53 UTC (rev 6802) @@ -181,18 +181,18 @@ // $PageSize = array(0,0,$Page_Width,$Page_Height); // $pdf = new Cpdf($PageSize); $pdf = new Cpdf($DocumentOrientation, 'pt', $DocumentPaper); -$pdf->addInfo('Creator', 'WebERP http://www.weberp.org'); +$pdf->addInfo('Creator', 'webERP http://www.weberp.org'); $pdf->addInfo('Author', 'WebERP ' . $Version); /* Javier: I have brought this piece from the pdf class constructor to get it closer to the admin/user, I corrected it to match TCPDF, but it still needs check, after which, I think it should be moved to each report to provide flexible Document Header and Margins in a per-report basis. */ - $pdf->SetPrintHeader(false); // Javier: I added this must be called before Add Page - $pdf->setAutoPageBreak(0); - $pdf->setPrintFooter(false); - $pdf->AddPage(); - $pdf->cMargin = 0; +$pdf->SetPrintHeader(false); // Javier: I added this must be called before Add Page +$pdf->setAutoPageBreak(0); +$pdf->setPrintFooter(false); +$pdf->AddPage(); +$pdf->cMargin = 0; /* END Brought from class.pdf.php constructor */ ?> Modified: trunk/includes/class.pdf.php =================================================================== --- trunk/includes/class.pdf.php 2014-08-01 21:53:04 UTC (rev 6801) +++ trunk/includes/class.pdf.php 2014-08-02 05:07:53 UTC (rev 6802) @@ -13,7 +13,6 @@ Work to move from FPDF to TCPDF by: Javier de Lorenzo-Cáceres <in...@ci...> ----------------------------------------------------------------------------------------------- */ -require_once(dirname(__FILE__).'/tcpdf/config/lang/eng.php'); require_once(dirname(__FILE__).'/tcpdf/tcpdf.php'); if (!class_exists('Cpdf', false)) { Deleted: trunk/includes/tcpdf/2dbarcodes.php =================================================================== --- trunk/includes/tcpdf/2dbarcodes.php 2014-08-01 21:53:04 UTC (rev 6801) +++ trunk/includes/tcpdf/2dbarcodes.php 2014-08-02 05:07:53 UTC (rev 6802) @@ -1,332 +0,0 @@ -<?php -//============================================================+ -// File name : 2dbarcodes.php -// Version : 1.0.014 -// Begin : 2009-04-07 -// Last Update : 2012-04-30 -// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - in...@te... -// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) -// ------------------------------------------------------------------- -// Copyright (C) 2009-2012 Nicola Asuni - Tecnick.com LTD -// -// This file is part of TCPDF software library. -// -// TCPDF is free software: you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// TCPDF is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description : PHP class to creates array representations for -// 2D barcodes to be used with TCPDF. -// -//============================================================+ - -/** - * @file - * PHP class to creates array representations for 2D barcodes to be used with TCPDF. - * @package com.tecnick.tcpdf - * @author Nicola Asuni - * @version 1.0.014 - */ - -/** - * @class TCPDF2DBarcode - * PHP class to creates array representations for 2D barcodes to be used with TCPDF (http://www.tcpdf.org). - * @package com.tecnick.tcpdf - * @version 1.0.014 - * @author Nicola Asuni - */ -class TCPDF2DBarcode { - - /** - * Array representation of barcode. - * @protected - */ - protected $barcode_array = false; - - /** - * This is the class constructor. - * Return an array representations for 2D barcodes:<ul> - * <li>$arrcode['code'] code to be printed on text label</li> - * <li>$arrcode['num_rows'] required number of rows</li> - * <li>$arrcode['num_cols'] required number of columns</li> - * <li>$arrcode['bcode'][$r][$c] value of the cell is $r row and $c column (0 = transparent, 1 = black)</li></ul> - * @param $code (string) code to print - * @param $type (string) type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul> - */ - public function __construct($code, $type) { - $this->setBarcode($code, $type); - } - - /** - * Return an array representations of barcode. - * @return array - */ - public function getBarcodeArray() { - return $this->barcode_array; - } - - /** - * Send barcode as SVG image object to the standard output. - * @param $w (int) Width of a single rectangle element in user units. - * @param $h (int) Height of a single rectangle element in user units. - * @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent). - * @public - */ - public function getBarcodeSVG($w=3, $h=3, $color='black') { - // send headers - $code = $this->getBarcodeSVGcode($w, $h, $color); - header('Content-Type: application/svg+xml'); - header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 - header('Pragma: public'); - header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past - header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - header('Content-Disposition: inline; filename="'.md5($code).'.svg";'); - //header('Content-Length: '.strlen($code)); - echo $code; - } - - /** - * Return a SVG string representation of barcode. - * @param $w (int) Width of a single rectangle element in user units. - * @param $h (int) Height of a single rectangle element in user units. - * @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent). - * @return string SVG code. - * @public - */ - public function getBarcodeSVGcode($w=3, $h=3, $color='black') { - // replace table for special characters - $repstr = array("\0" => '', '&' => '&', '<' => '<', '>' => '>'); - $svg = '<'.'?'.'xml version="1.0" standalone="no"'.'?'.'>'."\n"; - $svg .= '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'."\n"; - $svg .= '<svg width="'.round(($this->barcode_array['num_cols'] * $w), 3).'" height="'.round(($this->barcode_array['num_rows'] * $h), 3).'" version="1.1" xmlns="http://www.w3.org/2000/svg">'."\n"; - $svg .= "\t".'<desc>'.strtr($this->barcode_array['code'], $repstr).'</desc>'."\n"; - $svg .= "\t".'<g id="elements" fill="'.$color.'" stroke="none">'."\n"; - // print barcode elements - $y = 0; - // for each row - for ($r = 0; $r < $this->barcode_array['num_rows']; ++$r) { - $x = 0; - // for each column - for ($c = 0; $c < $this->barcode_array['num_cols']; ++$c) { - if ($this->barcode_array['bcode'][$r][$c] == 1) { - // draw a single barcode cell - $svg .= "\t\t".'<rect x="'.$x.'" y="'.$y.'" width="'.$w.'" height="'.$h.'" />'."\n"; - } - $x += $w; - } - $y += $h; - } - $svg .= "\t".'</g>'."\n"; - $svg .= '</svg>'."\n"; - return $svg; - } - - /** - * Return an HTML representation of barcode. - * @param $w (int) Width of a single rectangle element in pixels. - * @param $h (int) Height of a single rectangle element in pixels. - * @param $color (string) Foreground color for bar elements (background is transparent). - * @return string HTML code. - * @public - */ - public function getBarcodeHTML($w=10, $h=10, $color='black') { - $html = '<div style="font-size:0;position:relative;width:'.($w * $this->barcode_array['num_cols']).'px;height:'.($h * $this->barcode_array['num_rows']).'px;">'."\n"; - // print barcode elements - $y = 0; - // for each row - for ($r = 0; $r < $this->barcode_array['num_rows']; ++$r) { - $x = 0; - // for each column - for ($c = 0; $c < $this->barcode_array['num_cols']; ++$c) { - if ($this->barcode_array['bcode'][$r][$c] == 1) { - // draw a single barcode cell - $html .= '<div style="background-color:'.$color.';width:'.$w.'px;height:'.$h.'px;position:absolute;left:'.$x.'px;top:'.$y.'px;"> </div>'."\n"; - } - $x += $w; - } - $y += $h; - } - $html .= '</div>'."\n"; - return $html; - } - - /** - * Return a PNG image representation of barcode (requires GD or Imagick library). - * @param $w (int) Width of a single rectangle element in pixels. - * @param $h (int) Height of a single rectangle element in pixels. - * @param $color (array) RGB (0-255) foreground color for bar elements (background is transparent). - * @return image or false in case of error. - * @public - */ - public function getBarcodePNG($w=3, $h=3, $color=array(0,0,0)) { - // calculate image size - $width = ($this->barcode_array['num_cols'] * $w); - $height = ($this->barcode_array['num_rows'] * $h); - if (function_exists('imagecreate')) { - // GD library - $imagick = false; - $png = imagecreate($width, $height); - $bgcol = imagecolorallocate($png, 255, 255, 255); - imagecolortransparent($png, $bgcol); - $fgcol = imagecolorallocate($png, $color[0], $color[1], $color[2]); - } elseif (extension_loaded('imagick')) { - $imagick = true; - $bgcol = new imagickpixel('rgb(255,255,255'); - $fgcol = new imagickpixel('rgb('.$color[0].','.$color[1].','.$color[2].')'); - $png = new Imagick(); - $png->newImage($width, $height, 'none', 'png'); - $bar = new imagickdraw(); - $bar->setfillcolor($fgcol); - } else { - return false; - } - // print barcode elements - $y = 0; - // for each row - for ($r = 0; $r < $this->barcode_array['num_rows']; ++$r) { - $x = 0; - // for each column - for ($c = 0; $c < $this->barcode_array['num_cols']; ++$c) { - if ($this->barcode_array['bcode'][$r][$c] == 1) { - // draw a single barcode cell - if ($imagick) { - $bar->rectangle($x, $y, ($x + $w - 1), ($y + $h - 1)); - } else { - imagefilledrectangle($png, $x, $y, ($x + $w - 1), ($y + $h - 1), $fgcol); - } - } - $x += $w; - } - $y += $h; - } - // send headers - header('Content-Type: image/png'); - header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 - header('Pragma: public'); - header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past - header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - if ($imagick) { - $png->drawimage($bar); - echo $png; - } else { - imagepng($png); - imagedestroy($png); - } - } - - /** - * Set the barcode. - * @param $code (string) code to print - * @param $type (string) type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parametrs are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul> - * @return array - */ - public function setBarcode($code, $type) { - $mode = explode(',', $type); - $qrtype = strtoupper($mode[0]); - switch ($qrtype) { - case 'DATAMATRIX': { // DATAMATRIX (ISO/IEC 16022) - require_once(dirname(__FILE__).'/datamatrix.php'); - $qrcode = new Datamatrix($code); - $this->barcode_array = $qrcode->getBarcodeArray(); - $this->barcode_array['code'] = $code; - break; - } - case 'PDF417': { // PDF417 (ISO/IEC 15438:2006) - require_once(dirname(__FILE__).'/pdf417.php'); - if (!isset($mode[1]) OR ($mode[1] === '')) { - $aspectratio = 2; // default aspect ratio (width / height) - } else { - $aspectratio = floatval($mode[1]); - } - if (!isset($mode[2]) OR ($mode[2] === '')) { - $ecl = -1; // default error correction level (auto) - } else { - $ecl = intval($mode[2]); - } - // set macro block - $macro = array(); - if (isset($mode[3]) AND ($mode[3] !== '') AND isset($mode[4]) AND ($mode[4] !== '') AND isset($mode[5]) AND ($mode[5] !== '')) { - $macro['segment_total'] = intval($mode[3]); - $macro['segment_index'] = intval($mode[4]); - $macro['file_id'] = strtr($mode[5], "\xff", ','); - for ($i = 0; $i < 7; ++$i) { - $o = $i + 6; - if (isset($mode[$o]) AND ($mode[$o] !== '')) { - // add option - $macro['option_'.$i] = strtr($mode[$o], "\xff", ','); - } - } - } - $qrcode = new PDF417($code, $ecl, $aspectratio, $macro); - $this->barcode_array = $qrcode->getBarcodeArray(); - $this->barcode_array['code'] = $code; - break; - } - case 'QRCODE': { // QR-CODE - require_once(dirname(__FILE__).'/qrcode.php'); - if (!isset($mode[1]) OR (!in_array($mode[1],array('L','M','Q','H')))) { - $mode[1] = 'L'; // Ddefault: Low error correction - } - $qrcode = new QRcode($code, strtoupper($mode[1])); - $this->barcode_array = $qrcode->getBarcodeArray(); - $this->barcode_array['code'] = $code; - break; - } - case 'RAW': - case 'RAW2': { // RAW MODE - // remove spaces - $code = preg_replace('/[\s]*/si', '', $code); - if (strlen($code) < 3) { - break; - } - if ($qrtype == 'RAW') { - // comma-separated rows - $rows = explode(',', $code); - } else { // RAW2 - // rows enclosed in square parentheses - $code = substr($code, 1, -1); - $rows = explode('][', $code); - } - $this->barcode_array['num_rows'] = count($rows); - $this->barcode_array['num_cols'] = strlen($rows[0]); - $this->barcode_array['bcode'] = array(); - foreach ($rows as $r) { - $this->barcode_array['bcode'][] = str_split($r, 1); - } - $this->barcode_array['code'] = $code; - break; - } - case 'TEST': { // TEST MODE - $this->barcode_array['num_rows'] = 5; - $this->barcode_array['num_cols'] = 15; - $this->barcode_array['bcode'] = array( - array(1,1,1,0,1,1,1,0,1,1,1,0,1,1,1), - array(0,1,0,0,1,0,0,0,1,0,0,0,0,1,0), - array(0,1,0,0,1,1,0,0,1,1,1,0,0,1,0), - array(0,1,0,0,1,0,0,0,0,0,1,0,0,1,0), - array(0,1,0,0,1,1,1,0,1,1,1,0,0,1,0)); - $this->barcode_array['code'] = $code; - break; - } - default: { - $this->barcode_array = false; - } - } - } -} // end of class - -//============================================================+ -// END OF FILE -//============================================================+ Modified: trunk/includes/tcpdf/README.TXT =================================================================== --- trunk/includes/tcpdf/README.TXT 2014-08-01 21:53:04 UTC (rev 6801) +++ trunk/includes/tcpdf/README.TXT 2014-08-02 05:07:53 UTC (rev 6802) @@ -8,24 +8,23 @@ ------------------------------------------------------------ Name: TCPDF -Version: 5.9.161 -Release date: 2012-05-09 +Version: 6.0.089 +Release date: 2014-07-16 Author: Nicola Asuni -Copyright (c) 2002-2012: +Copyright (c) 2002-2014: Nicola Asuni Tecnick.com LTD - Manor Coach House, Church Hill - Aldershot, Hants, GU12 4RQ - UK www.tecnick.com URLs: - http: www.tcpdf.org - http: www.sourceforge.net/projects/tcpdf + http://www.tcpdf.org + http://www.sourceforge.net/projects/tcpdf Description: TCPDF is a PHP class for generating PDF files on-the-fly without requiring external extensions. + This library includes also a class to extract data from existing PDF documents and + classes to generate 1D and 2D barcodes in various formats. Main Features: * no external libraries are required for the basic functions; @@ -47,7 +46,7 @@ * no-write page regions; * bookmarks, named destinations and table of content; * text hyphenation; - * text stretching and spacing (tracking/kerning); + * text stretching and spacing (tracking); * automatic page break, line break and text alignments including justification; * automatic page numbering and page groups; * move and delete pages; @@ -67,8 +66,8 @@ Additional Documentation: http://www.tcpdf.org -License - Copyright (C) 2002-2012 Nicola Asuni - Tecnick.com LTD +License: + Copyright (C) 2002-2014 Nicola Asuni - Tecnick.com LTD TCPDF is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -86,12 +85,27 @@ See LICENSE.TXT file for more information. -Third party fonts - This library includes third party font files released with different licenses. - These fonts are not required by TCPDF but have been included as you convenience. - The original TTF font files have been renamed for compatibility with TCPDF and compressed using the gzcompress PHP function that uses the ZLIB data format (.z files). - To get the original distribution archives please check the information on fonts subfolders: - - DejaVu fonts 2.33 (Bitstream) - Copyright, License and other info: fonts/dejavu-fonts-ttf-2.33 - - GNU FreeFont (GNU-GPLv3) - Copyright, License and other info: fonts/freefont-20100919 +Third party fonts: + This library may include third party font files released with different licenses. + + All the PHP files on the fonts directory are subject to the general TCPDF license (GNU-LGPLv3), + they do not contain any binary data but just a description of the general properties of a particular font. + These files can be also generated on the fly using the font utilities and TCPDF methods. + + All the original binary TTF font files have been renamed for compatibility with TCPDF and compressed using the gzcompress PHP function that uses the ZLIB data format (.z files). + + The binary files (.z) that begins with the prefix "free" have been extracted from the GNU FreeFont collection (GNU-GPLv3). + The binary files (.z) that begins with the prefix "pdfa" have been derived from the GNU FreeFont, so they are subject to the same license. + For the details of Copyright, License and other information, please check the files inside the directory fonts/freefont-20120503 + Link : http://www.gnu.org/software/freefont/ + + The binary files (.z) that begins with the prefix "dejavu" have been extracted from the DejaVu fonts 2.33 (Bitstream) collection. + For the details of Copyright, License and other information, please check the files inside the directory fonts/dejavu-fonts-ttf-2.33 + Link : http://dejavu-fonts.org + + The binary files (.z) that begins with the prefix "ae" have been extracted from the Arabeyes.org collection (GNU-GPLv2). + Link : http://projects.arabeyes.org/ + + ============================================================ Deleted: trunk/includes/tcpdf/barcodes.php =================================================================== --- trunk/includes/tcpdf/barcodes.php 2014-08-01 21:53:04 UTC (rev 6801) +++ trunk/includes/tcpdf/barcodes.php 2014-08-02 05:07:53 UTC (rev 6802) @@ -1,2287 +0,0 @@ -<?php -//============================================================+ -// File name : barcodes.php -// Version : 1.0.024 -// Begin : 2008-06-09 -// Last Update : 2012-04-30 -// Author : Nicola Asuni - Tecnick.com LTD - Manor Coach House, Church Hill, Aldershot, Hants, GU12 4RQ, UK - www.tecnick.com - in...@te... -// License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html) -// ------------------------------------------------------------------- -// Copyright (C) 2008-2012 Nicola Asuni - Tecnick.com LTD -// -// This file is part of TCPDF software library. -// -// TCPDF is free software: you can redistribute it and/or modify it -// under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// TCPDF is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with TCPDF. If not, see <http://www.gnu.org/licenses/>. -// -// See LICENSE.TXT file for more information. -// ------------------------------------------------------------------- -// -// Description : PHP class to creates array representations for -// common 1D barcodes to be used with TCPDF. -// -//============================================================+ - -/** - * @file - * PHP class to creates array representations for common 1D barcodes to be used with TCPDF. - * @package com.tecnick.tcpdf - * @author Nicola Asuni - * @version 1.0.024 - */ - -/** - * @class TCPDFBarcode - * PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).<br> - * @package com.tecnick.tcpdf - * @version 1.0.024 - * @author Nicola Asuni - */ -class TCPDFBarcode { - - /** - * Array representation of barcode. - * @protected - */ - protected $barcode_array; - - /** - * This is the class constructor. - * Return an array representations for common 1D barcodes:<ul> - * <li>$arrcode['code'] code to be printed on text label</li> - * <li>$arrcode['maxh'] max barcode height</li> - * <li>$arrcode['maxw'] max barcode width</li> - * <li>$arrcode['bcode'][$k] single bar or space in $k position</li> - * <li>$arrcode['bcode'][$k]['t'] bar type: true = bar, false = space.</li> - * <li>$arrcode['bcode'][$k]['w'] bar width in units.</li> - * <li>$arrcode['bcode'][$k]['h'] bar height in units.</li> - * <li>$arrcode['bcode'][$k]['p'] bar top position (0 = top, 1 = middle)</li></ul> - * @param $code (string) code to print - * @param $type (string) type of barcode: <ul><li>C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.</li><li>C39+ : CODE 39 with checksum</li><li>C39E : CODE 39 EXTENDED</li><li>C39E+ : CODE 39 EXTENDED + CHECKSUM</li><li>C93 : CODE 93 - USS-93</li><li>S25 : Standard 2 of 5</li><li>S25+ : Standard 2 of 5 + CHECKSUM</li><li>I25 : Interleaved 2 of 5</li><li>I25+ : Interleaved 2 of 5 + CHECKSUM</li><li>C128 : CODE 128</li><li>C128A : CODE 128 A</li><li>C128B : CODE 128 B</li><li>C128C : CODE 128 C</li><li>EAN2 : 2-Digits UPC-Based Extention</li><li>EAN5 : 5-Digits UPC-Based Extention</li><li>EAN8 : EAN 8</li><li>EAN13 : EAN 13</li><li>UPCA : UPC-A</li><li>UPCE : UPC-E</li><li>MSI : MSI (Variation of Plessey code)</li><li>MSI+ : MSI + CHECKSUM (modulo 11)</li><li>POSTNET : POSTNET</li><li>PLANET : PLANET</li><li>RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)</li><li>KIX : KIX (Klant index - Customer index)</li><li>IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200</li><li>CODABAR : CODABAR</li><li>CODE11 : CODE 11</li><li>PHARMA : PHARMACODE</li><li>PHARMA2T : PHARMACODE TWO-TRACKS</li></ul> - * @public - */ - public function __construct($code, $type) { - $this->setBarcode($code, $type); - } - - /** - * Return an array representations of barcode. - * @return array - * @public - */ - public function getBarcodeArray() { - return $this->barcode_array; - } - - /** - * Send barcode as SVG image object to the standard output. - * @param $w (int) Minimum width of a single bar in user units. - * @param $h (int) Height of barcode in user units. - * @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent). - * @public - */ - public function getBarcodeSVG($w=2, $h=30, $color='black') { - // send headers - $code = $this->getBarcodeSVGcode($w, $h, $color); - header('Content-Type: application/svg+xml'); - header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 - header('Pragma: public'); - header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past - header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - header('Content-Disposition: inline; filename="'.md5($code).'.svg";'); - //header('Content-Length: '.strlen($code)); - echo $code; - } - - /** - * Return a SVG string representation of barcode. - * @param $w (int) Minimum width of a single bar in user units. - * @param $h (int) Height of barcode in user units. - * @param $color (string) Foreground color (in SVG format) for bar elements (background is transparent). - * @return string SVG code. - * @public - */ - public function getBarcodeSVGcode($w=2, $h=30, $color='black') { - // replace table for special characters - $repstr = array("\0" => '', '&' => '&', '<' => '<', '>' => '>'); - $svg = '<'.'?'.'xml version="1.0" standalone="no"'.'?'.'>'."\n"; - $svg .= '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'."\n"; - $svg .= '<svg width="'.round(($this->barcode_array['maxw'] * $w), 3).'" height="'.$h.'" version="1.1" xmlns="http://www.w3.org/2000/svg">'."\n"; - $svg .= "\t".'<desc>'.strtr($this->barcode_array['code'], $repstr).'</desc>'."\n"; - $svg .= "\t".'<g id="bars" fill="'.$color.'" stroke="none">'."\n"; - // print bars - $x = 0; - foreach ($this->barcode_array['bcode'] as $k => $v) { - $bw = round(($v['w'] * $w), 3); - $bh = round(($v['h'] * $h / $this->barcode_array['maxh']), 3); - if ($v['t']) { - $y = round(($v['p'] * $h / $this->barcode_array['maxh']), 3); - // draw a vertical bar - $svg .= "\t\t".'<rect x="'.$x.'" y="'.$y.'" width="'.$bw.'" height="'.$bh.'" />'."\n"; - } - $x += $bw; - } - $svg .= "\t".'</g>'."\n"; - $svg .= '</svg>'."\n"; - return $svg; - } - - /** - * Return an HTML representation of barcode. - * @param $w (int) Width of a single bar element in pixels. - * @param $h (int) Height of a single bar element in pixels. - * @param $color (string) Foreground color for bar elements (background is transparent). - * @return string HTML code. - * @public - */ - public function getBarcodeHTML($w=2, $h=30, $color='black') { - $html = '<div style="font-size:0;position:relative;width:'.($this->barcode_array['maxw'] * $w).'px;height:'.($h).'px;">'."\n"; - // print bars - $x = 0; - foreach ($this->barcode_array['bcode'] as $k => $v) { - $bw = round(($v['w'] * $w), 3); - $bh = round(($v['h'] * $h / $this->barcode_array['maxh']), 3); - if ($v['t']) { - $y = round(($v['p'] * $h / $this->barcode_array['maxh']), 3); - // draw a vertical bar - $html .= '<div style="background-color:'.$color.';width:'.$bw.'px;height:'.$bh.'px;position:absolute;left:'.$x.'px;top:'.$y.'px;"> </div>'."\n"; - } - $x += $bw; - } - $html .= '</div>'."\n"; - return $html; - } - - /** - * Return a PNG image representation of barcode (requires GD or Imagick library). - * @param $w (int) Width of a single bar element in pixels. - * @param $h (int) Height of a single bar element in pixels. - * @param $color (array) RGB (0-255) foreground color for bar elements (background is transparent). - * @return image or false in case of error. - * @public - */ - public function getBarcodePNG($w=2, $h=30, $color=array(0,0,0)) { - // calculate image size - $width = ($this->barcode_array['maxw'] * $w); - $height = $h; - if (function_exists('imagecreate')) { - // GD library - $imagick = false; - $png = imagecreate($width, $height); - $bgcol = imagecolorallocate($png, 255, 255, 255); - imagecolortransparent($png, $bgcol); - $fgcol = imagecolorallocate($png, $color[0], $color[1], $color[2]); - } elseif (extension_loaded('imagick')) { - $imagick = true; - $bgcol = new imagickpixel('rgb(255,255,255'); - $fgcol = new imagickpixel('rgb('.$color[0].','.$color[1].','.$color[2].')'); - $png = new Imagick(); - $png->newImage($width, $height, 'none', 'png'); - $bar = new imagickdraw(); - $bar->setfillcolor($fgcol); - } else { - return false; - } - // print bars - $x = 0; - foreach ($this->barcode_array['bcode'] as $k => $v) { - $bw = round(($v['w'] * $w), 3); - $bh = round(($v['h'] * $h / $this->barcode_array['maxh']), 3); - if ($v['t']) { - $y = round(($v['p'] * $h / $this->barcode_array['maxh']), 3); - // draw a vertical bar - if ($imagick) { - $bar->rectangle($x, $y, ($x + $bw - 1), ($y + $bh - 1)); - } else { - imagefilledrectangle($png, $x, $y, ($x + $bw - 1), ($y + $bh - 1), $fgcol); - } - } - $x += $bw; - } - // send headers - header('Content-Type: image/png'); - header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 - header('Pragma: public'); - header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past - header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - if ($imagick) { - $png->drawimage($bar); - echo $png; - } else { - imagepng($png); - imagedestroy($png); - } - } - - /** - * Set the barcode. - * @param $code (string) code to print - * @param $type (string) type of barcode: <ul><li>C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.</li><li>C39+ : CODE 39 with checksum</li><li>C39E : CODE 39 EXTENDED</li><li>C39E+ : CODE 39 EXTENDED + CHECKSUM</li><li>C93 : CODE 93 - USS-93</li><li>S25 : Standard 2 of 5</li><li>S25+ : Standard 2 of 5 + CHECKSUM</li><li>I25 : Interleaved 2 of 5</li><li>I25+ : Interleaved 2 of 5 + CHECKSUM</li><li>C128 : CODE 128</li><li>C128A : CODE 128 A</li><li>C128B : CODE 128 B</li><li>C128C : CODE 128 C</li><li>EAN2 : 2-Digits UPC-Based Extention</li><li>EAN5 : 5-Digits UPC-Based Extention</li><li>EAN8 : EAN 8</li><li>EAN13 : EAN 13</li><li>UPCA : UPC-A</li><li>UPCE : UPC-E</li><li>MSI : MSI (Variation of Plessey code)</li><li>MSI+ : MSI + CHECKSUM (modulo 11)</li><li>POSTNET : POSTNET</li><li>PLANET : PLANET</li><li>RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)</li><li>KIX : KIX (Klant index - Customer index)</li><li>IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200</li><li>CODABAR : CODABAR</li><li>CODE11 : CODE 11</li><li>PHARMA : PHARMACODE</li><li>PHARMA2T : PHARMACODE TWO-TRACKS</li></ul> - * @return array barcode array - * @public - */ - public function setBarcode($code, $type) { - switch (strtoupper($type)) { - case 'C39': { // CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9. - $arrcode = $this->barcode_code39($code, false, false); - break; - } - case 'C39+': { // CODE 39 with checksum - $arrcode = $this->barcode_code39($code, false, true); - break; - } - case 'C39E': { // CODE 39 EXTENDED - $arrcode = $this->barcode_code39($code, true, false); - break; - } - case 'C39E+': { // CODE 39 EXTENDED + CHECKSUM - $arrcode = $this->barcode_code39($code, true, true); - break; - } - case 'C93': { // CODE 93 - USS-93 - $arrcode = $this->barcode_code93($code); - break; - } - case 'S25': { // Standard 2 of 5 - $arrcode = $this->barcode_s25($code, false); - break; - } - case 'S25+': { // Standard 2 of 5 + CHECKSUM - $arrcode = $this->barcode_s25($code, true); - break; - } - case 'I25': { // Interleaved 2 of 5 - $arrcode = $this->barcode_i25($code, false); - break; - } - case 'I25+': { // Interleaved 2 of 5 + CHECKSUM - $arrcode = $this->barcode_i25($code, true); - break; - } - case 'C128': { // CODE 128 - $arrcode = $this->barcode_c128($code, ''); - break; - } - case 'C128A': { // CODE 128 A - $arrcode = $this->barcode_c128($code, 'A'); - break; - } - case 'C128B': { // CODE 128 B - $arrcode = $this->barcode_c128($code, 'B'); - break; - } - case 'C128C': { // CODE 128 C - $arrcode = $this->barcode_c128($code, 'C'); - break; - } - case 'EAN2': { // 2-Digits UPC-Based Extention - $arrcode = $this->barcode_eanext($code, 2); - break; - } - case 'EAN5': { // 5-Digits UPC-Based Extention - $arrcode = $this->barcode_eanext($code, 5); - break; - } - case 'EAN8': { // EAN 8 - $arrcode = $this->barcode_eanupc($code, 8); - break; - } - case 'EAN13': { // EAN 13 - $arrcode = $this->barcode_eanupc($code, 13); - break; - } - case 'UPCA': { // UPC-A - $arrcode = $this->barcode_eanupc($code, 12); - break; - } - case 'UPCE': { // UPC-E - $arrcode = $this->barcode_eanupc($code, 6); - break; - } - case 'MSI': { // MSI (Variation of Plessey code) - $arrcode = $this->barcode_msi($code, false); - break; - } - case 'MSI+': { // MSI + CHECKSUM (modulo 11) - $arrcode = $this->barcode_msi($code, true); - break; - } - case 'POSTNET': { // POSTNET - $arrcode = $this->barcode_postnet($code, false); - break; - } - case 'PLANET': { // PLANET - $arrcode = $this->barcode_postnet($code, true); - break; - } - case 'RMS4CC': { // RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) - $arrcode = $this->barcode_rms4cc($code, false); - break; - } - case 'KIX': { // KIX (Klant index - Customer index) - $arrcode = $this->barcode_rms4cc($code, true); - break; - } - case 'IMB': { // IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200 - $arrcode = $this->barcode_imb($code); - break; - } - case 'CODABAR': { // CODABAR - $arrcode = $this->barcode_codabar($code); - break; - } - case 'CODE11': { // CODE 11 - $arrcode = $this->barcode_code11($code); - break; - } - case 'PHARMA': { // PHARMACODE - $arrcode = $this->barcode_pharmacode($code); - break; - } - case 'PHARMA2T': { // PHARMACODE TWO-TRACKS - $arrcode = $this->barcode_pharmacode2t($code); - break; - } - default: { - $this->barcode_array = false; - $arrcode = false; - break; - } - } - $this->barcode_array = $arrcode; - } - - /** - * CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9. - * General-purpose code in very wide use world-wide - * @param $code (string) code to represent. - * @param $extended (boolean) if true uses the extended mode. - * @param $checksum (boolean) if true add a checksum to the code. - * @return array barcode representation. - * @protected - */ - protected function barcode_code39($code, $extended=false, $checksum=false) { - $chr['0'] = '111331311'; - $chr['1'] = '311311113'; - $chr['2'] = '113311113'; - $chr['3'] = '313311111'; - $chr['4'] = '111331113'; - $chr['5'] = '311331111'; - $chr['6'] = '113331111'; - $chr['7'] = '111311313'; - $chr['8'] = '311311311'; - $chr['9'] = '113311311'; - $chr['A'] = '311113113'; - $chr['B'] = '113113113'; - $chr['C'] = '313113111'; - $chr['D'] = '111133113'; - $chr['E'] = '311133111'; - $chr['F'] = '113133111'; - $chr['G'] = '111113313'; - $chr['H'] = '311113311'; - $chr['I'] = '113113311'; - $chr['J'] = '111133311'; - $chr['K'] = '311111133'; - $chr['L'] = '113111133'; - $chr['M'] = '313111131'; - $chr['N'] = '111131133'; - $chr['O'] = '311131131'; - $chr['P'] = '113131131'; - $chr['Q'] = '111111333'; - $chr['R'] = '311111331'; - $chr['S'] = '113111331'; - $chr['T'] = '111131331'; - $chr['U'] = '331111113'; - $chr['V'] = '133111113'; - $chr['W'] = '333111111'; - $chr['X'] = '131131113'; - $chr['Y'] = '331131111'; - $chr['Z'] = '133131111'; - $chr['-'] = '131111313'; - $chr['.'] = '331111311'; - $chr[' '] = '133111311'; - $chr['$'] = '131313111'; - $chr['/'] = '131311131'; - $chr['+'] = '131113131'; - $chr['%'] = '111313131'; - $chr['*'] = '131131311'; - $code = strtoupper($code); - if ($extended) { - // extended mode - $code = $this->encode_code39_ext($code); - } - if ($code === false) { - return false; - } - if ($checksum) { - // checksum - $code .= $this->checksum_code39($code); - } - // add start and stop codes - $code = '*'.$code.'*'; - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - $k = 0; - $clen = strlen($code); - for ($i = 0; $i < $clen; ++$i) { - $char = $code{$i}; - if(!isset($chr[$char])) { - // invalid character - return false; - } - for ($j = 0; $j < 9; ++$j) { - if (($j % 2) == 0) { - $t = true; // bar - } else { - $t = false; // space - } - $w = $chr[$char]{$j}; - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - } - // intercharacter gap - $bararray['bcode'][$k] = array('t' => false, 'w' => 1, 'h' => 1, 'p' => 0); - $bararray['maxw'] += 1; - ++$k; - } - return $bararray; - } - - /** - * Encode a string to be used for CODE 39 Extended mode. - * @param $code (string) code to represent. - * @return encoded string. - * @protected - */ - protected function encode_code39_ext($code) { - $encode = array( - chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C', - chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G', - chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '£K', - chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O', - chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S', - chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W', - chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A', - chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E', - chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C', - chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G', - chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K', - chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O', - chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3', - chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7', - chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F', - chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J', - chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C', - chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G', - chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K', - chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O', - chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S', - chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W', - chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K', - chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O', - chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C', - chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G', - chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K', - chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O', - chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S', - chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W', - chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P', - chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T'); - $code_ext = ''; - $clen = strlen($code); - for ($i = 0 ; $i < $clen; ++$i) { - if (ord($code{$i}) > 127) { - return false; - } - $code_ext .= $encode[$code{$i}]; - } - return $code_ext; - } - - /** - * Calculate CODE 39 checksum (modulo 43). - * @param $code (string) code to represent. - * @return char checksum. - * @protected - */ - protected function checksum_code39($code) { - $chars = array( - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', - 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', - 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%'); - $sum = 0; - $clen = strlen($code); - for ($i = 0 ; $i < $clen; ++$i) { - $k = array_keys($chars, $code{$i}); - $sum += $k[0]; - } - $j = ($sum % 43); - return $chars[$j]; - } - - /** - * CODE 93 - USS-93 - * Compact code similar to Code 39 - * @param $code (string) code to represent. - * @return array barcode representation. - * @protected - */ - protected function barcode_code93($code) { - $chr[48] = '131112'; // 0 - $chr[49] = '111213'; // 1 - $chr[50] = '111312'; // 2 - $chr[51] = '111411'; // 3 - $chr[52] = '121113'; // 4 - $chr[53] = '121212'; // 5 - $chr[54] = '121311'; // 6 - $chr[55] = '111114'; // 7 - $chr[56] = '131211'; // 8 - $chr[57] = '141111'; // 9 - $chr[65] = '211113'; // A - $chr[66] = '211212'; // B - $chr[67] = '211311'; // C - $chr[68] = '221112'; // D - $chr[69] = '221211'; // E - $chr[70] = '231111'; // F - $chr[71] = '112113'; // G - $chr[72] = '112212'; // H - $chr[73] = '112311'; // I - $chr[74] = '122112'; // J - $chr[75] = '132111'; // K - $chr[76] = '111123'; // L - $chr[77] = '111222'; // M - $chr[78] = '111321'; // N - $chr[79] = '121122'; // O - $chr[80] = '131121'; // P - $chr[81] = '212112'; // Q - $chr[82] = '212211'; // R - $chr[83] = '211122'; // S - $chr[84] = '211221'; // T - $chr[85] = '221121'; // U - $chr[86] = '222111'; // V - $chr[87] = '112122'; // W - $chr[88] = '112221'; // X - $chr[89] = '122121'; // Y - $chr[90] = '123111'; // Z - $chr[45] = '121131'; // - - $chr[46] = '311112'; // . - $chr[32] = '311211'; // - $chr[36] = '321111'; // $ - $chr[47] = '112131'; // / - $chr[43] = '113121'; // + - $chr[37] = '211131'; // % - $chr[128] = '121221'; // ($) - $chr[129] = '311121'; // (/) - $chr[130] = '122211'; // (+) - $chr[131] = '312111'; // (%) - $chr[42] = '111141'; // start-stop - $code = strtoupper($code); - $encode = array( - chr(0) => chr(131).'U', chr(1) => chr(128).'A', chr(2) => chr(128).'B', chr(3) => chr(128).'C', - chr(4) => chr(128).'D', chr(5) => chr(128).'E', chr(6) => chr(128).'F', chr(7) => chr(128).'G', - chr(8) => chr(128).'H', chr(9) => chr(128).'I', chr(10) => chr(128).'J', chr(11) => '£K', - chr(12) => chr(128).'L', chr(13) => chr(128).'M', chr(14) => chr(128).'N', chr(15) => chr(128).'O', - chr(16) => chr(128).'P', chr(17) => chr(128).'Q', chr(18) => chr(128).'R', chr(19) => chr(128).'S', - chr(20) => chr(128).'T', chr(21) => chr(128).'U', chr(22) => chr(128).'V', chr(23) => chr(128).'W', - chr(24) => chr(128).'X', chr(25) => chr(128).'Y', chr(26) => chr(128).'Z', chr(27) => chr(131).'A', - chr(28) => chr(131).'B', chr(29) => chr(131).'C', chr(30) => chr(131).'D', chr(31) => chr(131).'E', - chr(32) => ' ', chr(33) => chr(129).'A', chr(34) => chr(129).'B', chr(35) => chr(129).'C', - chr(36) => chr(129).'D', chr(37) => chr(129).'E', chr(38) => chr(129).'F', chr(39) => chr(129).'G', - chr(40) => chr(129).'H', chr(41) => chr(129).'I', chr(42) => chr(129).'J', chr(43) => chr(129).'K', - chr(44) => chr(129).'L', chr(45) => '-', chr(46) => '.', chr(47) => chr(129).'O', - chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3', - chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7', - chr(56) => '8', chr(57) => '9', chr(58) => chr(129).'Z', chr(59) => chr(131).'F', - chr(60) => chr(131).'G', chr(61) => chr(131).'H', chr(62) => chr(131).'I', chr(63) => chr(131).'J', - chr(64) => chr(131).'V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C', - chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G', - chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K', - chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O', - chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S', - chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W', - chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => chr(131).'K', - chr(92) => chr(131).'L', chr(93) => chr(131).'M', chr(94) => chr(131).'N', chr(95) => chr(131).'O', - chr(96) => chr(131).'W', chr(97) => chr(130).'A', chr(98) => chr(130).'B', chr(99) => chr(130).'C', - chr(100) => chr(130).'D', chr(101) => chr(130).'E', chr(102) => chr(130).'F', chr(103) => chr(130).'G', - chr(104) => chr(130).'H', chr(105) => chr(130).'I', chr(106) => chr(130).'J', chr(107) => chr(130).'K', - chr(108) => chr(130).'L', chr(109) => chr(130).'M', chr(110) => chr(130).'N', chr(111) => chr(130).'O', - chr(112) => chr(130).'P', chr(113) => chr(130).'Q', chr(114) => chr(130).'R', chr(115) => chr(130).'S', - chr(116) => chr(130).'T', chr(117) => chr(130).'U', chr(118) => chr(130).'V', chr(119) => chr(130).'W', - chr(120) => chr(130).'X', chr(121) => chr(130).'Y', chr(122) => chr(130).'Z', chr(123) => chr(131).'P', - chr(124) => chr(131).'Q', chr(125) => chr(131).'R', chr(126) => chr(131).'S', chr(127) => chr(131).'T'); - $code_ext = ''; - $clen = strlen($code); - for ($i = 0 ; $i < $clen; ++$i) { - if (ord($code{$i}) > 127) { - return false; - } - $code_ext .= $encode[$code{$i}]; - } - // checksum - $code_ext .= $this->checksum_code93($code_ext); - // add start and stop codes - $code = '*'.$code_ext.'*'; - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - $k = 0; - $clen = strlen($code); - for ($i = 0; $i < $clen; ++$i) { - $char = ord($code{$i}); - if(!isset($chr[$char])) { - // invalid character - return false; - } - for ($j = 0; $j < 6; ++$j) { - if (($j % 2) == 0) { - $t = true; // bar - } else { - $t = false; // space - } - $w = $chr[$char]{$j}; - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - } - } - $bararray['bcode'][$k] = array('t' => true, 'w' => 1, 'h' => 1, 'p' => 0); - $bararray['maxw'] += 1; - ++$k; - return $bararray; - } - - /** - * Calculate CODE 93 checksum (modulo 47). - * @param $code (string) code to represent. - * @return string checksum code. - * @protected - */ - protected function checksum_code93($code) { - $chars = array( - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', - 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', - 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%', - '<', '=', '>', '?'); - // translate special characters - $code = strtr($code, chr(128).chr(131).chr(129).chr(130), '<=>?'); - $len = strlen($code); - // calculate check digit C - $p = 1; - $check = 0; - for ($i = ($len - 1); $i >= 0; --$i) { - $k = array_keys($chars, $code{$i}); - $check += ($k[0] * $p); - ++$p; - if ($p > 20) { - $p = 1; - } - } - $check %= 47; - $c = $chars[$check]; - $code .= $c; - // calculate check digit K - $p = 1; - $check = 0; - for ($i = $len; $i >= 0; --$i) { - $k = array_keys($chars, $code{$i}); - $check += ($k[0] * $p); - ++$p; - if ($p > 15) { - $p = 1; - } - } - $check %= 47; - $k = $chars[$check]; - $checksum = $c.$k; - // resto respecial characters - $checksum = strtr($checksum, '<=>?', chr(128).chr(131).chr(129).chr(130)); - return $checksum; - } - - /** - * Checksum for standard 2 of 5 barcodes. - * @param $code (string) code to process. - * @return int checksum. - * @protected - */ - protected function checksum_s25($code) { - $len = strlen($code); - $sum = 0; - for ($i = 0; $i < $len; $i+=2) { - $sum += $code{$i}; - } - $sum *= 3; - for ($i = 1; $i < $len; $i+=2) { - $sum += ($code{$i}); - } - $r = $sum % 10; - if($r > 0) { - $r = (10 - $r); - } - return $r; - } - - /** - * MSI. - * Variation of Plessey code, with similar applications - * Contains digits (0 to 9) and encodes the data only in the width of bars. - * @param $code (string) code to represent. - * @param $checksum (boolean) if true add a checksum to the code (modulo 11) - * @return array barcode representation. - * @protected - */ - protected function barcode_msi($code, $checksum=false) { - $chr['0'] = '100100100100'; - $chr['1'] = '100100100110'; - $chr['2'] = '100100110100'; - $chr['3'] = '100100110110'; - $chr['4'] = '100110100100'; - $chr['5'] = '100110100110'; - $chr['6'] = '100110110100'; - $chr['7'] = '100110110110'; - $chr['8'] = '110100100100'; - $chr['9'] = '110100100110'; - $chr['A'] = '110100110100'; - $chr['B'] = '110100110110'; - $chr['C'] = '110110100100'; - $chr['D'] = '110110100110'; - $chr['E'] = '110110110100'; - $chr['F'] = '110110110110'; - if ($checksum) { - // add checksum - $clen = strlen($code); - $p = 2; - $check = 0; - for ($i = ($clen - 1); $i >= 0; --$i) { - $check += (hexdec($code{$i}) * $p); - ++$p; - if ($p > 7) { - $p = 2; - } - } - $check %= 11; - if ($check > 0) { - $check = 11 - $check; - } - $code .= $check; - } - $seq = '110'; // left guard - $clen = strlen($code); - for ($i = 0; $i < $clen; ++$i) { - $digit = $code{$i}; - if (!isset($chr[$digit])) { - // invalid character - return false; - } - $seq .= $chr[$digit]; - } - $seq .= '1001'; // right guard - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - return $this->binseq_to_array($seq, $bararray); - } - - /** - * Standard 2 of 5 barcodes. - * Used in airline ticket marking, photofinishing - * Contains digits (0 to 9) and encodes the data only in the width of bars. - * @param $code (string) code to represent. - * @param $checksum (boolean) if true add a checksum to the code - * @return array barcode representation. - * @protected - */ - protected function barcode_s25($code, $checksum=false) { - $chr['0'] = '10101110111010'; - $chr['1'] = '11101010101110'; - $chr['2'] = '10111010101110'; - $chr['3'] = '11101110101010'; - $chr['4'] = '10101110101110'; - $chr['5'] = '11101011101010'; - $chr['6'] = '10111011101010'; - $chr['7'] = '10101011101110'; - $chr['8'] = '10101110111010'; - $chr['9'] = '10111010111010'; - if ($checksum) { - // add checksum - $code .= $this->checksum_s25($code); - } - if((strlen($code) % 2) != 0) { - // add leading zero if code-length is odd - $code = '0'.$code; - } - $seq = '11011010'; - $clen = strlen($code); - for ($i = 0; $i < $clen; ++$i) { - $digit = $code{$i}; - if (!isset($chr[$digit])) { - // invalid character - return false; - } - $seq .= $chr[$digit]; - } - $seq .= '1101011'; - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - return $this->binseq_to_array($seq, $bararray); - } - - /** - * Convert binary barcode sequence to TCPDF barcode array. - * @param $seq (string) barcode as binary sequence. - * @param $bararray (array) barcode array. - * òparam array $bararray TCPDF barcode array to fill up - * @return array barcode representation. - * @protected - */ - protected function binseq_to_array($seq, $bararray) { - $len = strlen($seq); - $w = 0; - $k = 0; - for ($i = 0; $i < $len; ++$i) { - $w += 1; - if (($i == ($len - 1)) OR (($i < ($len - 1)) AND ($seq{$i} != $seq{($i+1)}))) { - if ($seq{$i} == '1') { - $t = true; // bar - } else { - $t = false; // space - } - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - $w = 0; - } - } - return $bararray; - } - - /** - * Interleaved 2 of 5 barcodes. - * Compact numeric code, widely used in industry, air cargo - * Contains digits (0 to 9) and encodes the data in the width of both bars and spaces. - * @param $code (string) code to represent. - * @param $checksum (boolean) if true add a checksum to the code - * @return array barcode representation. - * @protected - */ - protected function barcode_i25($code, $checksum=false) { - $chr['0'] = '11221'; - $chr['1'] = '21112'; - $chr['2'] = '12112'; - $chr['3'] = '22111'; - $chr['4'] = '11212'; - $chr['5'] = '21211'; - $chr['6'] = '12211'; - $chr['7'] = '11122'; - $chr['8'] = '21121'; - $chr['9'] = '12121'; - $chr['A'] = '11'; - $chr['Z'] = '21'; - if ($checksum) { - // add checksum - $code .= $this->checksum_s25($code); - } - if((strlen($code) % 2) != 0) { - // add leading zero if code-length is odd - $code = '0'.$code; - } - // add start and stop codes - $code = 'AA'.strtolower($code).'ZA'; - - $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); - $k = 0; - $clen = strlen($code); - for ($i = 0; $i < $clen; $i = ($i + 2)) { - $char_bar = $code{$i}; - $char_space = $code{$i+1}; - if((!isset($chr[$char_bar])) OR (!isset($chr[$char_space]))) { - // invalid character - return false; - } - // create a bar-space sequence - $seq = ''; - $chrlen = strlen($chr[$char_bar]); - for ($s = 0; $s < $chrlen; $s++){ - $seq .= $chr[$char_bar]{$s} . $chr[$char_space]{$s}; - } - $seqlen = strlen($seq); - for ($j = 0; $j < $seqlen; ++$j) { - if (($j % 2) == 0) { - $t = true; // bar - } else { - $t = false; // space - } - $w = $seq{$j}; - $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); - $bararray['maxw'] += $w; - ++$k; - } - } - return $bararray; - } - - /** - * C128 barcodes. - * Very capable code, excellent density, high reliability; in very wide use world-wide - * @param $code (string) code to represent. - * @param $type (string) barcode type: A, B, C or empty for automatic switch (AUTO mode) - * @return array barcode representation. - * @protected - */ - protected function barcode_c128($code, $type='') { - $chr = array( - '212222', /* 00 */ - '222122', /* 01 */ - '222221', /* 02 */ - '121223', /* 03 */ - '121322', /* 04 */ - '131222', /* 05 */ - '122213', /* 06 */ - '122312', /* 07 */ - '132212', /* 08 */ - '221213', /* 09 */ - '221312', /* 10 */ - '231212', /* 11 */ - '112232', /* 12 */ - '122132', /* 13 */ - '122231', /* 14 */ - '113222', /* 15 */ - ... [truncated message content] |
From: <aga...@us...> - 2014-08-08 13:44:53
|
Revision: 6804 http://sourceforge.net/p/web-erp/reponame/6804 Author: agaluski Date: 2014-08-08 13:44:43 +0000 (Fri, 08 Aug 2014) Log Message: ----------- Added database tables for location based security. Added new maintenance screen for Location based security Added new report AgedControlledInventory.php Updated change log Updated Location maintenance to update new locationusers table Update menu array links to include new maintenance screen and report Modified Paths: -------------- trunk/Locations.php trunk/doc/Change.log trunk/includes/MainMenuLinksArray.php trunk/sql/mysql/upgrade4.11-4.12.sql Added Paths: ----------- trunk/AgedControlledInventory.php trunk/LocationUsers.php trunk/Z_MakeLocUsers.php Added: trunk/AgedControlledInventory.php =================================================================== --- trunk/AgedControlledInventory.php (rev 0) +++ trunk/AgedControlledInventory.php 2014-08-08 13:44:43 UTC (rev 6804) @@ -0,0 +1,96 @@ +<?php + +/* $Id: AgedControlledInventory.php 1 2014-08-08 04:47:42Z agaluski $ */ + +include('includes/session.inc'); +$PricesSecurity = 12;//don't show pricing info unless security token 12 available to user +$Today = time(); +$Title = _('Aged Controlled Inventory') . ' as-of ' . Date(($_SESSION['DefaultDateFormat']), strtotime($UpcomingDate . ' + 0 days')); +include('includes/header.inc'); + +echo '<p class="page_title_text"> + <img src="'.$RootPath.'/css/'.$Theme.'/images/inventory.png" title="' . _('Inventory') . +'" alt="" /><b>' . $Title. '</b> + </p>'; + +$sql = "SELECT stockserialitems.stockid, + stockmaster.description, + stockserialitems.serialno, + stockserialitems.quantity, + stockmoves.trandate, + stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost, + decimalplaces + FROM stockserialitems + LEFT JOIN stockserialmoves ON stockserialitems.serialno=stockserialmoves.serialno + LEFT JOIN stockmoves ON stockserialmoves.stockmoveno=stockmoves.stkmoveno + INNER JOIN stockmaster ON stockmaster.stockid = stockserialitems.stockid + INNER JOIN locationusers ON locationusers.loccode=stockserialitems.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 + WHERE quantity > 0 + GROUP BY stockid, serialno + ORDER BY trandate + "; + +$ErrMsg = _('The stock held could not be retrieved because'); +$LocStockResult = DB_query($sql, $db, $ErrMsg); +$NumRows = DB_num_rows($LocStockResult, $db); + +$j = 1; +$TotalQty=0; +$TotalVal=0; +$k=0; //row colour counter +echo '<table> + <tr> + <th class="ascending">' . _('Stock') . '</th> + <th class="ascending">' . _('Description') . '</th> + <th class="ascending">' . _('Batch') . '</th> + <th class="ascending">' . _('Quantity Remaining') . '</th> + <th class="ascending">' . _('Inventory Value') . '</th> + <th class="ascending">' . _('Date') . '</th> + <th class="ascending">' . _('Days Old') . '</th> + </tr>'; +while ($LocQtyRow=DB_fetch_array($LocStockResult)) { + + if ($k==1){ + echo '<tr class="OddTableRows">'; + $k=0; + } else { + echo '<tr class="EvenTableRows">'; + $k=1; + } + $DaysOld=floor(($Today - strtotime($LocQtyRow['trandate']))/(60*60*24)); + $TotalQty +=$LocQtyRow['quantity']; + //$TotalVal +=($LocQtyRow['quantity'] *$LocQtyRow['cost']); + $DispVal = '-----------'; + if (in_array($PricesSecurity, $_SESSION['AllowedPageSecurityTokens']) OR !isset($PricesSecurity)) { + $DispVal =locale_number_format(($LocQtyRow['quantity']*$LocQtyRow['cost']),$LocQtyRow['decimalplaces']); + $TotalVal +=($LocQtyRow['quantity'] *$LocQtyRow['cost']); + } + printf('<td>%s</td> + <td>%s</td> + <td>%s</td> + <td class="number">%s</td> + <td class="number">%s</td> + <td>%s</td> + <td class="number">%s</td></tr>', + mb_strtoupper($LocQtyRow['stockid']), + $LocQtyRow['description'], + $LocQtyRow['serialno'], + locale_number_format($LocQtyRow['quantity'],$LocQtyRow['decimalplaces']), + $DispVal, + ConvertSQLDate($LocQtyRow['trandate']), + $DaysOld); + + +} //while +if ($k==1){ + echo '<tfoot><tr class="OddTableRows">'; + $k=0; +} else { + echo '<tfoot><tr class="EvenTableRows">'; + $k=1; +} +echo '<td colspan="3"><b>' . _('Total') . '</b></td><td class="number"><b>' . locale_number_format($TotalQty,2) . '</td><td class="number"><b>' . locale_number_format($TotalVal,2) . '</td><td colspan="2"></td>'; +echo '</table>'; + +include('includes/footer.inc'); +?> \ No newline at end of file Added: trunk/LocationUsers.php =================================================================== --- trunk/LocationUsers.php (rev 0) +++ trunk/LocationUsers.php 2014-08-08 13:44:43 UTC (rev 6804) @@ -0,0 +1,260 @@ +<?php +/* $Id: LocationUsers.php 1 agaluski $*/ + +include('includes/session.inc'); +$Title = _('Maintenance Of Location Authorised Users'); +include('includes/header.inc'); + +echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . _('Location Authorised Users') + . '" alt="" />' . ' ' . $Title . '</p>'; + +if (isset($_POST['SelectedUser'])){ + $SelectedUser = mb_strtoupper($_POST['SelectedUser']); +} elseif (isset($_GET['SelectedUser'])){ + $SelectedUser = mb_strtoupper($_GET['SelectedUser']); +} else { + $SelectedUser=''; +} + +if (isset($_POST['SelectedLocation'])){ + $SelectedLocation = mb_strtoupper($_POST['SelectedLocation']); +} elseif (isset($_GET['SelectedLocation'])){ + $SelectedLocation = mb_strtoupper($_GET['SelectedLocation']); +} + +if (isset($_POST['Cancel'])) { + unset($SelectedLocation); + unset($SelectedUser); +} + +if (isset($_POST['Process'])) { + if ($_POST['SelectedLocation'] == '') { + echo prnMsg(_('You have not selected any Location'),'error'); + echo '<br />'; + unset($SelectedLocation); + unset($_POST['SelectedLocation']); + } +} + +if (isset($_POST['submit'])) { + + $InputError=0; + + if ($_POST['SelectedUser']=='') { + $InputError=1; + echo prnMsg(_('You have not selected an user to be authorised to use this Location'),'error'); + echo '<br />'; + unset($SelectedLocation); + } + + if ( $InputError !=1 ) { + + // First check the user is not being duplicated + + $checkSql = "SELECT count(*) + FROM locationusers + WHERE loccode= '" . $_POST['SelectedLocation'] . "' + AND userid = '" . $_POST['SelectedUser'] . "'"; + + $checkresult = DB_query($checkSql,$db); + $checkrow = DB_fetch_row($checkresult); + + if ( $checkrow[0] >0) { + $InputError = 1; + prnMsg( _('The user') . ' ' . $_POST['SelectedUser'] . ' ' ._('already authorised to use this Location'),'error'); + } else { + // Add new record on submit + $sql = "INSERT INTO locationusers (loccode, + userid, + canview, + canupd) + VALUES ('" . $_POST['SelectedLocation'] . "', + '" . $_POST['SelectedUser'] . "', + '1', + '1')"; + + $msg = _('User') . ': ' . $_POST['SelectedUser'].' '._('has been authorised to use') .' '. $_POST['SelectedLocation'] . ' ' . _('Location'); + $result = DB_query($sql,$db); + prnMsg($msg,'success'); + unset($_POST['SelectedUser']); + } + } +} elseif ( isset($_GET['delete']) ) { + $sql="DELETE FROM locationusers + WHERE loccode='".$SelectedLocation."' + AND userid='".$SelectedUser."'"; + + $ErrMsg = _('The Location user record could not be deleted because'); + $result = DB_query($sql,$db,$ErrMsg); + prnMsg(_('User').' '. $SelectedUser .' '. _('has been un-authorised to use').' '. $SelectedLocation .' '. _('Location') ,'success'); + unset($_GET['delete']); +} elseif ( isset($_GET['toggleupd']) ) { + $sql="UPDATE locationusers + SET canupd='" . $_GET['toggleupd'] . "' + WHERE loccode='".$SelectedLocation."' + AND userid='".$SelectedUser."'"; + + $ErrMsg = _('The Location user record could not be deleted because'); + $result = DB_query($sql,$db,$ErrMsg); + prnMsg(_('User').' '. $SelectedUser .' '. _('has been un-authorised to update').' '. $SelectedLocation .' '. _('Location') ,'success'); + unset($_GET['removeupd']); +} + +if (!isset($SelectedLocation)){ + +/* It could still be the second time the page has been run and a record has been selected for modification - SelectedUser will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters +then none of the above are true. These will call the same page again and allow update/input or deletion of the records*/ + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; + echo '<div> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <table class="selection"> + <tr> + <td>' . _('Select Location') . ':</td> + <td><select name="SelectedLocation">'; + + $SQL = "SELECT loccode, + locationname + FROM locations"; + + $result = DB_query($SQL,$db); + echo '<option value="">' . _('Not Yet Selected') . '</option>'; + while ($myrow = DB_fetch_array($result)) { + if (isset($SelectedLocation) and $myrow['loccode']==$SelectedLocation) { + echo '<option selected="selected" value="'; + } else { + echo '<option value="'; + } + echo $myrow['loccode'] . '">' . $myrow['loccode'] . ' - ' . $myrow['locationname'] . '</option>'; + + } //end while loop + + echo '</select></td></tr>'; + + echo '</table>'; // close main table + DB_free_result($result); + + echo '<br /> + <div class="centre"> + <input type="submit" name="Process" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div>'; + + echo '</div> + </form>'; + +} + +//end of ifs and buts! +if (isset($_POST['process'])OR isset($SelectedLocation)) { + $SQLName = "SELECT locationname + FROM locations + WHERE loccode='" .$SelectedLocation."'"; + $result = DB_query($SQLName,$db); + $myrow = DB_fetch_array($result); + $SelectedBankName = $myrow['locationname']; + + echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Authorised users for') . ' ' .$SelectedBankName . ' ' . _('Location') .'</a></div>'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; + echo '<div>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + + echo '<input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '" />'; + + $sql = "SELECT locationusers.userid, + canview, + canupd, + www_users.realname + FROM locationusers INNER JOIN www_users + ON locationusers.userid=www_users.userid + WHERE locationusers.loccode='" . $SelectedLocation . "' + ORDER BY locationusers.userid ASC"; + + $result = DB_query($sql,$db); + + echo '<br /> + <table class="selection">'; + echo '<tr><th colspan="6"><h3>' . _('Authorised users for Location') . ' ' .$SelectedBankName. '</h3></th></tr>'; + echo '<tr> + <th>' . _('User Code') . '</th> + <th>' . _('User Name') . '</th> + <th>' . _('View') . '</th> + <th>' . _('Update') . '</th> + </tr>'; + +$k=0; //row colour counter + +while ($myrow = DB_fetch_array($result)) { + if ($k==1){ + echo '<tr class="EvenTableRows">'; + $k=0; + } else { + echo '<tr class="OddTableRows">'; + $k=1; + } + if ($myrow['canupd'] == 1) { + $ToggleText = '<td><a href="%s?SelectedUser=%s&toggleupd=0&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to remove Update for this user?') . '\');">' . _('Remove Update') . '</a></td>'; + } else { + $ToggleText = '<td><a href="%s?SelectedUser=%s&toggleupd=1&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to add Update for this user?') . '\');">' . _('Add Update') . '</a></td>'; + } + printf('<td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td>' . + $ToggleText . ' + <td><a href="%s?SelectedUser=%s&delete=yes&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to un-authorise this user?') . '\');">' . _('Un-authorise') . '</a></td> + </tr>', + $myrow['userid'], + $myrow['realname'], + $myrow['canview'], + $myrow['canupd'], + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8'), + $myrow['userid'], + htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8'), + $myrow['userid']); + } + //END WHILE LIST LOOP + echo '</table>'; + + if (! isset($_GET['delete'])) { + + + echo '<br /><table class="selection">'; //Main table + + echo '<tr> + <td>' . _('Select User') . ':</td> + <td><select name="SelectedUser">'; + + $SQL = "SELECT userid, + realname + FROM www_users"; + + $result = DB_query($SQL,$db); + if (!isset($_POST['SelectedUser'])){ + echo '<option selected="selected" value="">' . _('Not Yet Selected') . '</option>'; + } + while ($myrow = DB_fetch_array($result)) { + if (isset($_POST['SelectedUser']) AND $myrow['userid']==$_POST['SelectedUser']) { + echo '<option selected="selected" value="'; + } else { + echo '<option value="'; + } + echo $myrow['userid'] . '">' . $myrow['userid'] . ' - ' . $myrow['realname'] . '</option>'; + + } //end while loop + + echo '</select></td></tr>'; + + echo '</table>'; // close main table + DB_free_result($result); + + echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; + + echo '</div> + </form>'; + + } // end if user wish to delete +} + +include('includes/footer.inc'); +?> Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2014-08-04 20:16:08 UTC (rev 6803) +++ trunk/Locations.php 2014-08-08 13:44:43 UTC (rev 6804) @@ -175,8 +175,25 @@ $ErrMsg = _('An error occurred inserting the new location stock records for all pre-existing parts because'); $DbgMsg = _('The SQL used to insert the new stock location records was'); $result = DB_query($sql,$db,$ErrMsg, $DbgMsg); + prnMsg ('........ ' . _('and new stock locations inserted for all existing stock items for the new location'), 'success'); + + /* Also need to add locationuser records for all existing users*/ + $sql = "INSERT INTO locationusers (userid, loccode, canview, canupd) + SELECT www_users.userid, + locations.loccode, + 1, + 1 + FROM www_users CROSS JOIN locations + LEFT JOIN locationusers + ON www_users.userid = locationusers.userid + AND locations.loccode = locationusers.loccode + WHERE locationusers.userid IS NULL + AND locations.loccode='". $_POST['LocCode'] . "';"; - prnMsg ('........ ' . _('and new stock locations inserted for all existing stock items for the new location'), 'success'); + $ErrMsg = _('The users/locations that need user location records created cannot be retrieved because'); + $Result = DB_query($sql,$db,$ErrMsg); + prnMsg(_('Existing users have been authorized for this location'),'success'); + unset($_POST['LocCode']); unset($_POST['LocationName']); unset($_POST['DelAdd1']); @@ -346,6 +363,7 @@ $result= DB_query("DELETE FROM locstock WHERE loccode ='" . $SelectedLocation . "'",$db); $result = DB_query("DELETE FROM locations WHERE loccode='" . $SelectedLocation . "'",$db); + $result = DB_query("DELETE FROM locationusers WHERE loccode='" . $SelectedLocation . "'",$db); prnMsg( _('Location') . ' ' . $SelectedLocation . ' ' . _('has been deleted') . '!', 'success'); unset ($SelectedLocation); Added: trunk/Z_MakeLocUsers.php =================================================================== --- trunk/Z_MakeLocUsers.php (rev 0) +++ trunk/Z_MakeLocUsers.php 2014-08-08 13:44:43 UTC (rev 6804) @@ -0,0 +1,29 @@ +<?php +/* $Id: Z_MakeLocUsers.php 1 agaluski $*/ +/* Script to make user locations for all users that do not have user location records set up*/ + +include ('includes/session.inc'); +$Title = _('Make locationusers Records'); +include('includes/header.inc'); + +echo '<br /><br />' . _('This script makes stock location records for parts where they do not already exist'); + +$sql = "INSERT INTO locationusers (userid, loccode, canview, canupd) + SELECT www_users.userid, + locations.loccode, + 1, + 1 + FROM www_users CROSS JOIN locations + LEFT JOIN locationusers + ON www_users.userid = locationusers.userid + AND locations.loccode = locationusers.loccode + WHERE locationusers.userid IS NULL;"; + +$ErrMsg = _('The users/locations that need user location records created cannot be retrieved because'); +$Result = DB_query($sql,$db,$ErrMsg); + +echo '<p />'; +prnMsg(_('Any users that may not have had user location records have now been given new location user records'),'info'); + +include('includes/footer.inc'); +?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-08-04 20:16:08 UTC (rev 6803) +++ trunk/doc/Change.log 2014-08-08 13:44:43 UTC (rev 6804) @@ -1,6 +1,6 @@ webERP Change Log - +08/08/14 Andrew Galuski: Add SQL and maintenance screens for Location based security. added new report aged controlled stock. additional scripts to follow as time allows 2/1/14 Tim: Change columns around on SelectWorkOrder.php 31/07/14 RChacon: Corrects the bottom line of the rectangle. Adds comments (info for developers). 29/07/14 RChacon: In PDFPriceList.php: Adds comments (info for developers), ViewTopic and BookMark, and currency name in locale language; deletes unused lines; reformats for legibility; adjusts column sizes to field sizes; improves printing of stockmaster.longdescription; improves code to reduce execution time (calculation out of loops); links right column positions to right margin; corrects IF for CustomerSpecials (deletes translation). In ManualSalesTypes.html: Adds help info about Print a price list by inventory category. Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2014-08-04 20:16:08 UTC (rev 6803) +++ trunk/includes/MainMenuLinksArray.php 2014-08-08 13:44:43 UTC (rev 6804) @@ -237,7 +237,8 @@ _('Historical Stock Quantity By Location/Category'), _('List Negative Stocks'), _('Period Stock Transaction Listing'), - _('Stock Transfer Note')); + _('Stock Transfer Note'), + _('Aged Controlled Stock Report')); $MenuItems['stock']['Reports']['URL'] = array( '/StockSerialItemResearch.php', '/PDFPrintLabel.php', @@ -260,7 +261,8 @@ '/StockQuantityByDate.php', '/PDFStockNegatives.php', '/PDFPeriodStockTransListing.php', - '/PDFStockTransfer.php'); + '/PDFStockTransfer.php', + '/AgedControlledInventory.php'); $MenuItems['stock']['Maintenance']['Caption'] = array( _('Add A New Item'), _('Select An Item'), @@ -502,6 +504,7 @@ $MenuItems['system']['Maintenance']['Caption'] = array( _('Inventory Categories Maintenance'), _('Inventory Locations Maintenance'), + _('Inventory Location Authorized Users Maintenance'), _('Discount Category Maintenance'), _('Units of Measure'), _('MRP Available Production Days'), @@ -512,6 +515,7 @@ $MenuItems['system']['Maintenance']['URL'] = array( '/StockCategories.php', '/Locations.php', + '/LocationUsers.php', '/DiscountCategories.php', '/UnitsOfMeasure.php', '/MRPCalendar.php', Modified: trunk/sql/mysql/upgrade4.11-4.12.sql =================================================================== --- trunk/sql/mysql/upgrade4.11-4.12.sql 2014-08-04 20:16:08 UTC (rev 6803) +++ trunk/sql/mysql/upgrade4.11-4.12.sql 2014-08-08 13:44:43 UTC (rev 6804) @@ -54,6 +54,27 @@ ALTER TABLE stockrequestitems DROP KEY stockid_2, DROP KEY dispatchid_2; INSERT INTO scripts VALUES('Dashboard.php',1,'Display outstanding debtors, creditors etc'); +INSERT INTO `scripts` ( `script` , `pagesecurity` , `description` ) VALUES ('Z_MakeLocUsers.php', '15', 'Create User Location records'); +INSERT INTO `scripts` ( `script` , `pagesecurity` , `description` ) VALUES ('LocationUsers.php', '15', 'User Location Maintenance'); +INSERT INTO `scripts` ( `script` , `pagesecurity` , `description` ) VALUES ('AgedControlledInventory.php', '11', 'Report of Controlled Items and their age'); + +CREATE TABLE IF NOT EXISTS `locationusers` ( + `loccode` varchar(5) NOT NULL, + `userid` varchar(20) NOT NULL, + `canview` tinyint(4) NOT NULL DEFAULT '0', + `canupd` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`loccode`,`userid`), + KEY `UserId` (`userid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO locationusers (userid, loccode, canview, canupd) + SELECT www_users.userid, locations.loccode,1,1 + FROM www_users CROSS JOIN locations + LEFT JOIN locationusers + ON www_users.userid = locationusers.userid + AND locations.loccode = locationusers.loccode + WHERE locationusers.userid IS NULL; + UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber'; |
From: <aga...@us...> - 2014-08-08 16:12:50
|
Revision: 6805 http://sourceforge.net/p/web-erp/reponame/6805 Author: agaluski Date: 2014-08-08 16:12:36 +0000 (Fri, 08 Aug 2014) Log Message: ----------- Added Location based security logic to most inventory and manufacturing scripts. Many thanks to Tim for merging my changes with the Trunk. Modified Paths: -------------- trunk/BOMExtendedQty.php trunk/BOMIndented.php trunk/BOMIndentedReverse.php trunk/BOMListing.php trunk/LocationUsers.php trunk/Locations.php trunk/PDFGrn.php trunk/PDFPickingList.php trunk/PDFStockLocTransfer.php trunk/PDFStockNegatives.php trunk/PDFStockTransfer.php trunk/PDFWOPrint.php trunk/PO_PDFPurchOrder.php trunk/PO_SelectOSPurchOrder.php trunk/PrintCustOrder_generic.php trunk/ReprintGRN.php trunk/ReverseGRN.php trunk/SelectProduct.php trunk/SelectSalesOrder.php trunk/SelectWorkOrder.php trunk/StockAdjustments.php trunk/StockLocMovements.php trunk/StockLocStatus.php trunk/StockQties_csv.php trunk/StockQuantityByDate.php trunk/StockSerialItemResearch.php trunk/StockSerialItems.php trunk/StockStatus.php trunk/StockTransfers.php trunk/StockUsage.php trunk/StockUsageGraph.php trunk/WhereUsedInquiry.php trunk/WorkOrderEntry.php trunk/WorkOrderIssue.php trunk/WorkOrderReceive.php trunk/WorkOrderStatus.php trunk/includes/InputSerialItemsExisting.php trunk/includes/PO_ReadInOrder.inc Modified: trunk/BOMExtendedQty.php =================================================================== --- trunk/BOMExtendedQty.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/BOMExtendedQty.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -173,12 +173,14 @@ (SELECT SUM(locstock.quantity) as invqty FROM locstock + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE locstock.stockid = tempbom.component GROUP BY locstock.stockid) AS qoh, (SELECT SUM(purchorderdetails.quantityord - purchorderdetails.quantityrecd) as netqty FROM purchorderdetails INNER JOIN purchorders ON purchorderdetails.orderno=purchorders.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.itemcode = tempbom.component AND purchorderdetails.completed = 0 AND (purchorders.status = 'Authorised' OR purchorders.status='Printed') @@ -187,11 +189,13 @@ SUM(woitems.qtyreqd - woitems.qtyrecd) as netwoqty FROM woitems INNER JOIN workorders ON woitems.wo = workorders.wo + INNER JOIN locationusers ON locationusers.loccode=workorders.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE woitems.stockid = tempbom.component AND workorders.closed=0 GROUP BY woitems.stockid) AS woqty FROM tempbom INNER JOIN stockmaster ON tempbom.component = stockmaster.stockid + INNER JOIN locationusers ON locationusers.loccode=tempbom.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 GROUP BY tempbom.component, stockmaster.description, stockmaster.decimalplaces, Modified: trunk/BOMIndented.php =================================================================== --- trunk/BOMIndented.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/BOMIndented.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -75,6 +75,7 @@ bom.effectiveto, bom.quantity FROM bom + INNER JOIN locationusers ON locationusers.loccode=bom.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE bom.parent ='" . $_POST['Part'] . "' AND bom.effectiveto >= '" . date('Y-m-d') . "' AND bom.effectiveafter <= '" . date('Y-m-d') . "'"; @@ -108,6 +109,7 @@ bom.effectiveto, bom.quantity FROM bom, passbom + INNER JOIN locationusers ON locationusers.loccode=loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE bom.parent = passbom.part AND bom.effectiveto >= '" . date('Y-m-d') . "' AND bom.effectiveafter <= '" . date('Y-m-d') . "'"; $result = DB_query($sql,$db); @@ -332,4 +334,4 @@ } // End of PrintHeader function -?> +?> \ No newline at end of file Modified: trunk/BOMIndentedReverse.php =================================================================== --- trunk/BOMIndentedReverse.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/BOMIndentedReverse.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -169,6 +169,7 @@ stockmaster.mbflag FROM tempbom INNER JOIN stockmaster ON tempbom.parent = stockmaster.stockid + INNER JOIN locationusers ON locationusers.loccode=tempbom.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 ORDER BY sortpart"; $result = DB_query($sql,$db); Modified: trunk/BOMListing.php =================================================================== --- trunk/BOMListing.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/BOMListing.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -29,6 +29,7 @@ bom.effectiveafter AS eff_frm FROM stockmaster INNER JOIN bom ON stockmaster.stockid=bom.component + INNER JOIN locationusers ON locationusers.loccode=bom.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE bom.parent >= '" . $_POST['FromCriteria'] . "' AND bom.parent <= '" . $_POST['ToCriteria'] . "' AND bom.effectiveto >= '" . date('Y-m-d') . "' AND bom.effectiveafter <= '" . date('Y-m-d') . "' Modified: trunk/LocationUsers.php =================================================================== --- trunk/LocationUsers.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/LocationUsers.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -1,24 +1,22 @@ <?php -/* $Id: LocationUsers.php 1 agaluski $*/ include('includes/session.inc'); $Title = _('Maintenance Of Location Authorised Users'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . _('Location Authorised Users') - . '" alt="" />' . ' ' . $Title . '</p>'; +echo '<p class="page_title_text"><img src="' . $RootPath . '/css/' . $Theme . '/images/money_add.png" title="' . _('Location Authorised Users') . '" alt="" />' . ' ' . $Title . '</p>'; -if (isset($_POST['SelectedUser'])){ +if (isset($_POST['SelectedUser'])) { $SelectedUser = mb_strtoupper($_POST['SelectedUser']); -} elseif (isset($_GET['SelectedUser'])){ +} elseif (isset($_GET['SelectedUser'])) { $SelectedUser = mb_strtoupper($_GET['SelectedUser']); } else { - $SelectedUser=''; + $SelectedUser = ''; } -if (isset($_POST['SelectedLocation'])){ +if (isset($_POST['SelectedLocation'])) { $SelectedLocation = mb_strtoupper($_POST['SelectedLocation']); -} elseif (isset($_GET['SelectedLocation'])){ +} elseif (isset($_GET['SelectedLocation'])) { $SelectedLocation = mb_strtoupper($_GET['SelectedLocation']); } @@ -29,7 +27,7 @@ if (isset($_POST['Process'])) { if ($_POST['SelectedLocation'] == '') { - echo prnMsg(_('You have not selected any Location'),'error'); + echo prnMsg(_('You have not selected any Location'), 'error'); echo '<br />'; unset($SelectedLocation); unset($_POST['SelectedLocation']); @@ -38,33 +36,33 @@ if (isset($_POST['submit'])) { - $InputError=0; + $InputError = 0; - if ($_POST['SelectedUser']=='') { - $InputError=1; - echo prnMsg(_('You have not selected an user to be authorised to use this Location'),'error'); + if ($_POST['SelectedUser'] == '') { + $InputError = 1; + echo prnMsg(_('You have not selected an user to be authorised to use this Location'), 'error'); echo '<br />'; unset($SelectedLocation); } - if ( $InputError !=1 ) { + if ($InputError != 1) { // First check the user is not being duplicated - $checkSql = "SELECT count(*) + $CheckSql = "SELECT count(*) FROM locationusers - WHERE loccode= '" . $_POST['SelectedLocation'] . "' - AND userid = '" . $_POST['SelectedUser'] . "'"; + WHERE loccode= '" . $_POST['SelectedLocation'] . "' + AND userid = '" . $_POST['SelectedUser'] . "'"; - $checkresult = DB_query($checkSql,$db); - $checkrow = DB_fetch_row($checkresult); + $CheckResult = DB_query($CheckSql); + $CheckRow = DB_fetch_row($CheckResult); - if ( $checkrow[0] >0) { + if ($CheckRow[0] > 0) { $InputError = 1; - prnMsg( _('The user') . ' ' . $_POST['SelectedUser'] . ' ' ._('already authorised to use this Location'),'error'); + prnMsg(_('The user') . ' ' . $_POST['SelectedUser'] . ' ' . _('already authorised to use this Location'), 'error'); } else { // Add new record on submit - $sql = "INSERT INTO locationusers (loccode, + $SQL = "INSERT INTO locationusers (loccode, userid, canview, canupd) @@ -73,40 +71,39 @@ '1', '1')"; - $msg = _('User') . ': ' . $_POST['SelectedUser'].' '._('has been authorised to use') .' '. $_POST['SelectedLocation'] . ' ' . _('Location'); - $result = DB_query($sql,$db); - prnMsg($msg,'success'); + $msg = _('User') . ': ' . $_POST['SelectedUser'] . ' ' . _('authorisation to use') . ' ' . $_POST['SelectedLocation'] . ' ' . _('Location has been changed'); + $Result = DB_query($SQL); + prnMsg($msg, 'success'); unset($_POST['SelectedUser']); } } -} elseif ( isset($_GET['delete']) ) { - $sql="DELETE FROM locationusers - WHERE loccode='".$SelectedLocation."' - AND userid='".$SelectedUser."'"; +} elseif (isset($_GET['delete'])) { + $SQL = "DELETE FROM locationusers + WHERE loccode='" . $SelectedLocation . "' + AND userid='" . $SelectedUser . "'"; $ErrMsg = _('The Location user record could not be deleted because'); - $result = DB_query($sql,$db,$ErrMsg); - prnMsg(_('User').' '. $SelectedUser .' '. _('has been un-authorised to use').' '. $SelectedLocation .' '. _('Location') ,'success'); + $Result = DB_query($SQL, $ErrMsg); + prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has been un-authorised to use') . ' ' . $SelectedLocation . ' ' . _('Location'), 'success'); unset($_GET['delete']); -} elseif ( isset($_GET['toggleupd']) ) { - $sql="UPDATE locationusers +} elseif (isset($_GET['toggleupd'])) { + $SQL = "UPDATE locationusers SET canupd='" . $_GET['toggleupd'] . "' - WHERE loccode='".$SelectedLocation."' - AND userid='".$SelectedUser."'"; + WHERE loccode='" . $SelectedLocation . "' + AND userid='" . $SelectedUser . "'"; $ErrMsg = _('The Location user record could not be deleted because'); - $result = DB_query($sql,$db,$ErrMsg); - prnMsg(_('User').' '. $SelectedUser .' '. _('has been un-authorised to update').' '. $SelectedLocation .' '. _('Location') ,'success'); - unset($_GET['removeupd']); + $Result = DB_query($SQL, $ErrMsg); + prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has been un-authorised to update') . ' ' . $SelectedLocation . ' ' . _('Location'), 'success'); + unset($_GET['toggleupd']); } -if (!isset($SelectedLocation)){ +if (!isset($SelectedLocation)) { -/* It could still be the second time the page has been run and a record has been selected for modification - SelectedUser will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters -then none of the above are true. These will call the same page again and allow update/input or deletion of the records*/ - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div> - <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + /* It could still be the second time the page has been run and a record has been selected for modification - SelectedUser will exist because it was sent with the new call. If its the first time the page has been displayed with no parameters + then none of the above are true. These will call the same page again and allow update/input or deletion of the records*/ + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> <table class="selection"> <tr> <td>' . _('Select Location') . ':</td> @@ -116,51 +113,48 @@ locationname FROM locations"; - $result = DB_query($SQL,$db); + $Result = DB_query($SQL); echo '<option value="">' . _('Not Yet Selected') . '</option>'; - while ($myrow = DB_fetch_array($result)) { - if (isset($SelectedLocation) and $myrow['loccode']==$SelectedLocation) { + while ($MyRow = DB_fetch_array($Result)) { + if (isset($SelectedLocation) and $MyRow['loccode'] == $SelectedLocation) { echo '<option selected="selected" value="'; } else { echo '<option value="'; } - echo $myrow['loccode'] . '">' . $myrow['loccode'] . ' - ' . $myrow['locationname'] . '</option>'; + echo $MyRow['loccode'] . '">' . $MyRow['loccode'] . ' - ' . $MyRow['locationname'] . '</option>'; } //end while loop echo '</select></td></tr>'; - echo '</table>'; // close main table - DB_free_result($result); + echo '</table>'; // close main table + DB_free_result($Result); - echo '<br /> - <div class="centre"> + echo '<div class="centre"> <input type="submit" name="Process" value="' . _('Accept') . '" /> <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> </div>'; - echo '</div> - </form>'; + echo '</form>'; } //end of ifs and buts! -if (isset($_POST['process'])OR isset($SelectedLocation)) { +if (isset($_POST['process']) or isset($SelectedLocation)) { $SQLName = "SELECT locationname FROM locations - WHERE loccode='" .$SelectedLocation."'"; - $result = DB_query($SQLName,$db); - $myrow = DB_fetch_array($result); - $SelectedBankName = $myrow['locationname']; - - echo '<br /><div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">' . _('Authorised users for') . ' ' .$SelectedBankName . ' ' . _('Location') .'</a></div>'; - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '">'; - echo '<div>'; + WHERE loccode='" . $SelectedLocation . "'"; + $Result = DB_query($SQLName); + $MyRow = DB_fetch_array($Result); + $SelectedBankName = $MyRow['locationname']; + + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Authorised users for') . ' ' . $SelectedBankName . ' ' . _('Location') . '</a></div>'; + echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '" />'; - $sql = "SELECT locationusers.userid, + $SQL = "SELECT locationusers.userid, canview, canupd, www_users.realname @@ -169,56 +163,59 @@ WHERE locationusers.loccode='" . $SelectedLocation . "' ORDER BY locationusers.userid ASC"; - $result = DB_query($sql,$db); + $Result = DB_query($SQL); - echo '<br /> - <table class="selection">'; - echo '<tr><th colspan="6"><h3>' . _('Authorised users for Location') . ' ' .$SelectedBankName. '</h3></th></tr>'; + echo '<table class="selection">'; echo '<tr> + <th colspan="6"><h3>' . _('Authorised users for Location') . ' ' . $SelectedBankName . '</h3></th> + </tr>'; + echo '<tr> <th>' . _('User Code') . '</th> <th>' . _('User Name') . '</th> <th>' . _('View') . '</th> <th>' . _('Update') . '</th> </tr>'; -$k=0; //row colour counter + $k = 0; //row colour counter -while ($myrow = DB_fetch_array($result)) { - if ($k==1){ - echo '<tr class="EvenTableRows">'; - $k=0; - } else { - echo '<tr class="OddTableRows">'; - $k=1; + while ($MyRow = DB_fetch_array($Result)) { + if ($k == 1) { + echo '<tr class="EvenTableRows">'; + $k = 0; + } else { + echo '<tr class="OddTableRows">'; + $k = 1; + } + + if ($MyRow['canupd'] == 1) { + $ToggleText = '<td><a href="%s?SelectedUser=%s&toggleupd=0&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to remove Update for this user?') . '\');">' . _('Remove Update') . '</a></td>'; + } else { + $ToggleText = '<td><a href="%s?SelectedUser=%s&toggleupd=1&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to add Update for this user?') . '\');">' . _('Add Update') . '</a></td>'; + } + + printf('<td>%s</td> + <td>%s</td> + <td>%s</td> + <td>%s</td>' . + $ToggleText . ' + <td><a href="%s?SelectedUser=%s&delete=yes&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to un-authorise this user?') . '\');">' . _('Un-authorise') . '</a></td> + </tr>', + $MyRow['userid'], + $MyRow['realname'], + $MyRow['canview'], + $MyRow['canupd'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), + $MyRow['userid'], + htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8'), + $MyRow['userid']); } - if ($myrow['canupd'] == 1) { - $ToggleText = '<td><a href="%s?SelectedUser=%s&toggleupd=0&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to remove Update for this user?') . '\');">' . _('Remove Update') . '</a></td>'; - } else { - $ToggleText = '<td><a href="%s?SelectedUser=%s&toggleupd=1&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to add Update for this user?') . '\');">' . _('Add Update') . '</a></td>'; - } - printf('<td>%s</td> - <td>%s</td> - <td>%s</td> - <td>%s</td>' . - $ToggleText . ' - <td><a href="%s?SelectedUser=%s&delete=yes&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to un-authorise this user?') . '\');">' . _('Un-authorise') . '</a></td> - </tr>', - $myrow['userid'], - $myrow['realname'], - $myrow['canview'], - $myrow['canupd'], - htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8'), - $myrow['userid'], - htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8'), - $myrow['userid']); - } //END WHILE LIST LOOP echo '</table>'; - if (! isset($_GET['delete'])) { + if (!isset($_GET['delete'])) { - echo '<br /><table class="selection">'; //Main table + echo '<table class="selection">'; //Main table echo '<tr> <td>' . _('Select User') . ':</td> @@ -228,33 +225,36 @@ realname FROM www_users"; - $result = DB_query($SQL,$db); - if (!isset($_POST['SelectedUser'])){ + $Result = DB_query($SQL); + if (!isset($_POST['SelectedUser'])) { echo '<option selected="selected" value="">' . _('Not Yet Selected') . '</option>'; } - while ($myrow = DB_fetch_array($result)) { - if (isset($_POST['SelectedUser']) AND $myrow['userid']==$_POST['SelectedUser']) { + while ($MyRow = DB_fetch_array($Result)) { + if (isset($_POST['SelectedUser']) and $MyRow['userid'] == $_POST['SelectedUser']) { echo '<option selected="selected" value="'; } else { echo '<option value="'; } - echo $myrow['userid'] . '">' . $myrow['userid'] . ' - ' . $myrow['realname'] . '</option>'; + echo $MyRow['userid'] . '">' . $MyRow['userid'] . ' - ' . $MyRow['realname'] . '</option>'; } //end while loop - echo '</select></td></tr>'; + echo '</select> + </td> + </tr>'; - echo '</table>'; // close main table - DB_free_result($result); + echo '</table>'; // close main table + DB_free_result($Result); - echo '<br /><div class="centre"><input type="submit" name="submit" value="' . _('Accept') . '" /> - <input type="submit" name="Cancel" value="' . _('Cancel') . '" /></div>'; + echo '<div class="centre"> + <input type="submit" name="submit" value="' . _('Accept') . '" /> + <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> + </div>'; - echo '</div> - </form>'; + echo '</form>'; } // end if user wish to delete } include('includes/footer.inc'); -?> +?> \ No newline at end of file Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/Locations.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -175,8 +175,8 @@ $ErrMsg = _('An error occurred inserting the new location stock records for all pre-existing parts because'); $DbgMsg = _('The SQL used to insert the new stock location records was'); $result = DB_query($sql,$db,$ErrMsg, $DbgMsg); - prnMsg ('........ ' . _('and new stock locations inserted for all existing stock items for the new location'), 'success'); - + prnMsg ('........ ' . _('and new stock locations inserted for all existing stock items for the new location'), 'success'); + /* Also need to add locationuser records for all existing users*/ $sql = "INSERT INTO locationusers (userid, loccode, canview, canupd) SELECT www_users.userid, Modified: trunk/PDFGrn.php =================================================================== --- trunk/PDFGrn.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/PDFGrn.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -52,6 +52,8 @@ stockmaster.decimalplaces FROM grns INNER JOIN purchorderdetails ON grns.podetailitem=purchorderdetails.podetailitem + INNER JOIN purchorders on purchorders.orderno = purchorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 LEFT JOIN stockmaster ON grns.itemcode=stockmaster.stockid WHERE grnbatch='". $GRNNo ."'"; @@ -98,17 +100,14 @@ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x,$Page_Height-$YPos,$FormDesign->Data->Column1->Length,$FormDesign->Data->Column1->FontSize, $myrow['itemcode']); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$Page_Height-$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize, $myrow['itemdescription']); - /*resmart mods */ /*$LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x,$Page_Height-$YPos,$FormDesign->Data->Column3->Length,$FormDesign->Data->Column3->FontSize, $DeliveryDate);*/ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x,$Page_Height-$YPos,$FormDesign->Data->Column3->Length,$FormDesign->Data->Column3->FontSize, $DeliveryDate, 'right'); - /*resmart ends*/ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column4->x,$Page_Height-$YPos,$FormDesign->Data->Column4->Length,$FormDesign->Data->Column4->FontSize, $SuppliersQuantity, 'right'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column5->x,$Page_Height-$YPos,$FormDesign->Data->Column5->Length,$FormDesign->Data->Column5->FontSize, $myrow['suppliersunit'], 'left'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column6->x,$Page_Height-$YPos,$FormDesign->Data->Column6->Length,$FormDesign->Data->Column6->FontSize, $OurUnitsQuantity, 'right'); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column7->x,$Page_Height-$YPos,$FormDesign->Data->Column7->Length,$FormDesign->Data->Column7->FontSize, $myrow['units'], 'left'); $YPos += $line_height; - /*resmoart mods*/ /* move to after serial print if($FooterPrintedInPage == 0){ $LeftOvers = $pdf->addText($FormDesign->ReceiptDate->x,$Page_Height-$FormDesign->ReceiptDate->y,$FormDesign->ReceiptDate->FontSize, _('Date of Receipt: ') . $DeliveryDate); @@ -116,7 +115,6 @@ $FooterPrintedInPage= 1; } */ - /*resmart ends*/ if ($YPos >= $FormDesign->LineAboveFooter->starty){ /* We reached the end of the page so finsih off the page and start a newy */ @@ -125,13 +123,12 @@ $YPos=$FormDesign->Data->y; include ('includes/PDFGrnHeader.inc'); } //end if need a new page headed up - - /*resmart mods*/ + $SQL = "SELECT stockmaster.controlled FROM stockmaster WHERE stockid ='" . $myrow['itemcode'] . "'"; $CheckControlledResult = DB_query($SQL,$db,'<br />' . _('Could not determine if the item was controlled or not because') . ' '); $ControlledRow = DB_fetch_row($CheckControlledResult); - + if ($ControlledRow[0]==1) { /*Then its a controlled item */ $SQL = "SELECT stockserialmoves.serialno, stockserialmoves.moveqty @@ -146,9 +143,9 @@ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$Page_Height-$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize, $SerialStockMoves['serialno']); $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$Page_Height-$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize, $SerialStockMoves['moveqty'],'right'); $YPos += $line_height; - + if ($YPos >= $FormDesign->LineAboveFooter->starty){ - $FooterPrintedInPage= 0; + $FooterPrintedInPage= 0; $YPos=$FormDesign->Data->y; include ('includes/PDFGrnHeader.inc'); } //end if need a new page headed up @@ -156,12 +153,12 @@ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$Page_Height-$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize, ' '); $YPos += $line_height; if ($YPos >= $FormDesign->LineAboveFooter->starty){ - $FooterPrintedInPage= 0; + $FooterPrintedInPage= 0; $YPos=$FormDesign->Data->y; include ('includes/PDFGrnHeader.inc'); } //end if need a new page headed up } //controlled item*/ - /*resmart ends*/ + if($FooterPrintedInPage == 0){ $LeftOvers = $pdf->addText($FormDesign->ReceiptDate->x,$Page_Height-$FormDesign->ReceiptDate->y,$FormDesign->ReceiptDate->FontSize, _('Date of Receipt: ') . $DeliveryDate); $LeftOvers = $pdf->addText($FormDesign->SignedFor->x,$Page_Height-$FormDesign->SignedFor->y,$FormDesign->SignedFor->FontSize, _('Signed for ').'______________________'); @@ -179,4 +176,4 @@ echo '<br /><a href="'.$RootPath.'/index.php">' . _('Back to the menu') . '</a>'; include('includes/footer.inc'); } -?> \ No newline at end of file +?> Modified: trunk/PDFPickingList.php =================================================================== --- trunk/PDFPickingList.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/PDFPickingList.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -21,9 +21,10 @@ if ((!isset($_GET['TransNo']) or $_GET['TransNo']=='') and !isset($_POST['TransDate'])){ $Title = _('Select Picking Lists'); include('includes/header.inc'); - $sql="SELECT loccode, + $sql="SELECT locations.loccode, locationname - FROM locations"; + FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $result=DB_query($sql, $db); echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/sales.png" title="' . _('Search') . '" alt="" />' . ' ' . $Title . '</p><br />'; echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post" name="form"> @@ -268,7 +269,6 @@ } $LineResult=DB_query($sql,$db, $ErrMsg); } - if ((isset($_GET['TransNo']) AND $_GET['TransNo'] == 'Preview') OR (isset($LineResult) @@ -330,7 +330,7 @@ $LeftOvers = $pdf->addTextWrap($FormDesign->Headings->Column5->x,$Page_Height - $YPos,$FormDesign->Headings->Column5->Length,$FormDesign->Headings->Column5->FontSize,$DisplayPrevDel,'right'); if ($Page_Height-$YPos-$line_height <= 50){ - /* We reached the end of the page so finsih off the page and start a newy */ + /* We reached the end of the page so finish off the page and start a new */ $PageNumber++; include ('includes/PDFPickingListHeader.inc'); } //end if need a new page headed up @@ -353,4 +353,4 @@ $pdf->OutputD($_SESSION['DatabaseName'] . '_PickingLists_' . date('Y-m-d') . '.pdf'); $pdf->__destruct(); } -?> +?> \ No newline at end of file Modified: trunk/PDFStockLocTransfer.php =================================================================== --- trunk/PDFStockLocTransfer.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/PDFStockLocTransfer.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -30,6 +30,24 @@ </div>'; echo '</div> </form>'; + + echo '<form method="post" action="' . $RootPath . '/PDFShipLabel.php">'; + echo '<div>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<input type="hidden" name="Type" value="Transfer" />'; + echo '<table> + <tr> + <td>' . _('Transfer docket to reprint Shipping Labels') . '</td> + <td><input type="text" class="number" size="10" name="ORD" /></td> + </tr> + </table>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Print" value="' . _('Print Shipping Labels') .'" /> + </div>'; + echo '</div> + </form>'; + include ('includes/footer.inc'); exit; } Modified: trunk/PDFStockNegatives.php =================================================================== --- trunk/PDFStockNegatives.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/PDFStockNegatives.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -26,6 +26,7 @@ ON stockmaster.stockid=locstock.stockid INNER JOIN locations ON locstock.loccode = locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE locstock.quantity < 0 ORDER BY locstock.loccode, stockmaster.categoryid, Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/PDFStockTransfer.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -35,6 +35,24 @@ </div> </div> </form>'; + + echo '<form method="post" action="' . $RootPath . '/PDFShipLabel.php">'; + echo '<div>'; + echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<input type="hidden" name="Type" value="Transfer" />'; + echo '<table> + <tr> + <td>' . _('Transfer docket to reprint Shipping Labels') . '</td> + <td><input type="text" class="number" size="10" name="ORD" /></td> + </tr> + </table>'; + echo '<br /> + <div class="centre"> + <input type="submit" name="Print" value="' . _('Print Shipping Labels') .'" /> + </div>'; + echo '</div> + </form>'; + include('includes/footer.inc'); exit(); } @@ -86,10 +104,7 @@ $Description=$myrow['description']; $LeftOvers = $pdf->addTextWrap($Left_Margin+1,$YPos-10,300-$Left_Margin,$FontSize, $StockID); - /*resmoart mods*/ - /*$LeftOvers = $pdf->addTextWrap($Left_Margin+75,$YPos-10,300-$Left_Margin,$FontSize-2, $Description);*/ $LeftOvers = $pdf->addTextWrap($Left_Margin+75,$YPos-10,300-$Left_Margin,$FontSize, $Description); - /*resmart ends*/ $LeftOvers = $pdf->addTextWrap($Left_Margin+250,$YPos-10,300-$Left_Margin,$FontSize, $From); $LeftOvers = $pdf->addTextWrap($Left_Margin+350,$YPos-10,300-$Left_Margin,$FontSize, $To); $LeftOvers = $pdf->addTextWrap($Left_Margin+475,$YPos-10,300-$Left_Margin,$FontSize, $Quantity); @@ -99,7 +114,7 @@ if ($YPos < $Bottom_Margin + $line_height){ include('includes/PDFStockTransferHeader.inc'); } - /*resmart mods*/ + $SQL = "SELECT stockmaster.controlled FROM stockmaster WHERE stockid ='" . $StockID . "'"; $CheckControlledResult = DB_query($SQL,$db,'<br />' . _('Could not determine if the item was controlled or not because') . ' '); @@ -131,7 +146,7 @@ include('includes/PDFStockTransferHeader.inc'); } //controlled item*/ } - /*resmart ends*/ + } $LeftOvers = $pdf->addTextWrap($Left_Margin,$YPos-70,300-$Left_Margin,$FontSize, _('Date of transfer: ').$Date); Modified: trunk/PDFWOPrint.php =================================================================== --- trunk/PDFWOPrint.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/PDFWOPrint.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -1,7 +1,7 @@ <?php /* $Id: PDFWOPrint.php 6146 $*/ -/* Currently this file only support one finished items produced work orders. Multiple items not supported yet */ + include('includes/session.inc'); include('includes/SQL_CommonFunctions.inc'); if (isset($_GET['WO'])) { @@ -22,13 +22,70 @@ if (isset($_GET['PrintLabels'])) { $PrintLabels = $_GET['PrintLabels']; } elseif (isset($_POST['PrintLabels'])){ + $PrintLabels = $_POST['LabelItem']; +} else { + unset($LabelItem); +} + +if (isset($_GET['LabelItem'])) { + $LabelItem = $_GET['LabelItem']; +} elseif (isset($_POST['LabelItem'])){ + $LabelItem = $_POST['LabelItem']; +} else { + unset($LabelItem); +} +if (isset($_GET['LabelDesc'])) { + $LabelDesc = $_GET['LabelDesc']; +} elseif (isset($_POST['LabelDesc'])){ + $LabelDesc = $_POST['LabelDesc']; +} else { + unset($LabelDesc); +} +if (isset($_GET['LabelLot'])) { + $LabelLot = $_GET['LabelLot']; +} elseif (isset($_POST['LabelLot'])){ + $LabelLot = $_POST['LabelLot']; +} else { + unset($LabelLot); +} +if (isset($_GET['NoOfBoxes'])) { + $NoOfBoxes = $_GET['NoOfBoxes']; +} elseif (isset($_POST['NoOfBoxes'])){ + $NoOfBoxes = $_POST['NoOfBoxes']; +} else { + unset($NoOfBoxes); +} +if (isset($_GET['LabelsPerBox'])) { + $LabelsPerBox = $_GET['LabelsPerBox']; +} elseif (isset($_POST['LabelsPerBox'])){ + $LabelsPerBox = $_POST['LabelsPerBox']; +} else { + unset($LabelsPerBox); +} +if (isset($_GET['QtyPerBox'])) { + $QtyPerBox = $_GET['QtyPerBox']; +} elseif (isset($_POST['QtyPerBox'])){ + $QtyPerBox = $_POST['QtyPerBox']; +} else { + unset($QtyPerBox); +} +if (isset($_GET['LeftOverQty'])) { + $LeftOverQty = $_GET['LeftOverQty']; +} elseif (isset($_POST['LeftOverQty'])){ + $LeftOverQty = $_POST['LeftOverQty']; +} else { + unset($LeftOverQty); +} +if (isset($_GET['PrintLabels'])) { + $PrintLabels = $_GET['PrintLabels']; +} elseif (isset($_POST['PrintLabels'])){ $PrintLabels = $_POST['PrintLabels']; } else { $PrintLabels="Yes"; } - -if (!isset($SelectedWO)) { + +if (!isset($_GET['WO']) AND !isset($_POST['WO'])) { $Title = _('Select a Work Order'); include('includes/header.inc'); echo '<div class="centre"><br /><br /><br />'; @@ -52,7 +109,12 @@ echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a></div>'; exit; } - +if (isset($_GET['WO'])) { + $SelectedWO = $_GET['WO']; +} +elseif (isset($_POST['WO'])) { + $SelectedWO = $_POST['WO']; +} $Title = _('Print Work Order Number') . ' ' . $SelectedWO; if (isset($_POST['PrintOrEmail']) AND isset($_POST['EmailTo'])) { if ($_POST['PrintOrEmail'] == 'Email' AND !IsEmailAddress($_POST['EmailTo'])) { @@ -105,6 +167,7 @@ ON workorders.loccode=locations.loccode INNER JOIN woitems ON workorders.wo=woitems.wo + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 INNER JOIN stockmaster ON woitems.stockid=stockmaster.stockid WHERE woitems.stockid='" . $StockID . "' @@ -179,8 +242,6 @@ $WOHeader['deladd6'] = str_pad('', 15, 'x'); $WOHeader['stockid'] = str_pad('', 15, 'x'); $WOHeader['description'] = str_pad('', 50, 'x'); - $WOHeader['wo'] = '99999999'; - $WOHeader['loccode'] = str_pad('',5,'x'); } // end of If we are previewing the order @@ -266,7 +327,7 @@ } } - if ($SelectedWO == 'Preview' or $i > 0) { + if ($SelectedWO == 'Preview' or $i > -1) { /*Yes there are line items to start the ball rolling with a page header */ include('includes/PDFWOPageHeader.inc'); $YPos = $Page_Height - $FormDesign->Data->y; @@ -280,7 +341,7 @@ $WOLine[$i]['issued'] = 9999999.99; $WOLine[$i]['decimalplaces'] = 2; } - if ($WOLine[$i]['decimalplaces'] != NULL) { + if ($WOLine['decimalplaces'] != NULL) { $DecimalPlaces = $WOLine[$i]['decimalplaces']; } else { @@ -341,7 +402,7 @@ serialno, stockserialitems.quantity as qty FROM locstock LEFT OUTER JOIN stockserialitems - ON locstock.loccode=stockserialitems.loccode AND locstock.stockid = stockserialitems.stockid + ON locstock.loccode=stockserialitems.loccode AND locstock.stockid = stockserialitems.stockid WHERE locstock.loccode='".$WOHeader['loccode']."' AND locstock.stockid='".$WOLine[$i]['item']."'",$db); while ($ToIssue = DB_fetch_array($AvailQty)){ @@ -384,7 +445,6 @@ include('includes/PDFWOPageHeader.inc'); } //end if need a new page headed up } /*end if there are order details to show on the order - or its a preview*/ - $FooterPrintedInPage = 0; if($FooterPrintedInPage == 0){ $LeftOvers = $pdf->addText($FormDesign->SignedDate->x,$Page_Height-$FormDesign->SignedDate->y,$FormDesign->SignedDate->FontSize, _('Date : ') . '______________'); $LeftOvers = $pdf->addText($FormDesign->SignedBy->x,$Page_Height-$FormDesign->SignedBy->y,$FormDesign->SignedBy->FontSize, _('Signed for: ').'____________________________________'); @@ -509,7 +569,7 @@ echo '<form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - if (isset($ViewingOnly) and $ViewingOnly == 1) { + if ($ViewingOnly == 1) { echo '<input type="hidden" name="ViewingOnly" value="1" />'; } //$ViewingOnly == 1 echo '<br /><br />'; @@ -523,7 +583,7 @@ if (!isset($_POST['PrintOrEmail'])) { $_POST['PrintOrEmail'] = 'Print'; } - if (isset($ViewingOnly) and $ViewingOnly != 0) { + if ($ViewingOnly != 0) { echo '<option selected="selected" value="Print">' . _('Print') . '</option>'; } else { @@ -584,12 +644,9 @@ echo '<form action="PDFFGLabel.php" method="post">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - if (isset($ViewOnly) and $ViewingOnly == 1) { + if ($ViewingOnly == 1) { echo '<input type="hidden" name="ViewingOnly" value="1" />'; } //$ViewingOnly == 1 - if(!isset($EmailTo)){ - $EmailTo=''; - } echo '<br /><br />'; echo '<input type="hidden" name="WO" value="' . $SelectedWO . '" />'; echo '<input type="hidden" name="StockID" value="' . $StockID . '" />'; @@ -609,7 +666,7 @@ if (!isset($_POST['PrintOrEmail'])) { $_POST['PrintOrEmail'] = 'Print'; } - if (isset($ViewingOnly) and $ViewingOnly != 0) { + if ($ViewingOnly != 0) { echo '<option selected="selected" value="Print">' . _('Print') . '</option>'; } else { @@ -653,4 +710,4 @@ } include('includes/footer.inc'); } -?> \ No newline at end of file +?> Modified: trunk/PO_PDFPurchOrder.php =================================================================== --- trunk/PO_PDFPurchOrder.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/PO_PDFPurchOrder.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -108,6 +108,7 @@ ON suppliers.currcode=currencies.currabrev INNER JOIN www_users ON purchorders.initiator=www_users.userid + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorders.orderno='" . $OrderNo . "'"; $result = DB_query($sql, $db, $ErrMsg); if (DB_num_rows($result) == 0) { Modified: trunk/PO_SelectOSPurchOrder.php =================================================================== --- trunk/PO_SelectOSPurchOrder.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/PO_SelectOSPurchOrder.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -158,7 +158,8 @@ $DateTo = FormatDateForSQL($_POST['DateTo']); } - $sql = "SELECT loccode, locationname FROM locations"; + $sql = "SELECT locations.loccode, locationname FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $resultStkLocs = DB_query($sql, $db); while ($myrow = DB_fetch_array($resultStkLocs)) { if (isset($_POST['StockLocation'])) { @@ -258,7 +259,7 @@ <th class="ascending">' . _('Orders') . '<br />' . _('Outstanding') . '</th> <th class="ascending">' . _('Units') . '</th> </tr>'; - + $k = 0; //row colour counter while ($myrow = DB_fetch_array($StockItemsResult)) { @@ -357,6 +358,7 @@ ON purchorders.supplierno = suppliers.supplierid INNER JOIN currencies ON suppliers.currcode=currencies.currabrev + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.completed=0 AND orddate>='" . $DateFrom . "' AND orddate<='" . $DateTo . "' @@ -393,6 +395,7 @@ ON purchorders.supplierno = suppliers.supplierid INNER JOIN currencies ON suppliers.currcode=currencies.currabrev + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.completed=0 AND orddate>='" . $DateFrom . "' AND orddate<='" . $DateTo . "' @@ -434,6 +437,7 @@ ON purchorders.supplierno = suppliers.supplierid INNER JOIN currencies ON suppliers.currcode=currencies.currabrev + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.completed=0 AND orddate>='" . $DateFrom . "' AND orddate<='" . $DateTo . "' @@ -469,6 +473,7 @@ ON purchorders.supplierno = suppliers.supplierid INNER JOIN currencies ON suppliers.currcode=currencies.currabrev + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.completed=0 AND orddate>='" . $DateFrom . "' AND orddate<='" . $DateTo . "' Modified: trunk/PrintCustOrder_generic.php =================================================================== --- trunk/PrintCustOrder_generic.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/PrintCustOrder_generic.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -67,6 +67,7 @@ ON salesorders.shipvia=shippers.shipper_id INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.orderno='" . $_GET['TransNo'] . "'"; if ($_SESSION['SalesmanLogin'] != '') { @@ -262,4 +263,4 @@ $result = DB_query($sql,$db); } -?> +?> \ No newline at end of file Modified: trunk/ReprintGRN.php =================================================================== --- trunk/ReprintGRN.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/ReprintGRN.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -61,9 +61,11 @@ ON grns.supplierid=suppliers.supplierid INNER JOIN purchorderdetails ON grns.podetailitem=purchorderdetails.podetailitem + INNER JOIN purchorders on purchorders.orderno=purchorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 LEFT JOIN stockmaster ON grns.itemcode=stockmaster.stockid - WHERE orderno='" . $_POST['PONumber'] ."'"; + WHERE purchorderdetails.orderno='" . $_POST['PONumber'] ."'"; $result=DB_query($sql, $db); if (DB_num_rows($result)==0) { echo '<br />'; @@ -86,7 +88,7 @@ <th>' . _('Delivery Date') . '</th> <th>' . _('Quantity Received') . '</th> <th>' . _('Action') . '</th> - </tr>'; + </tr>'; while ($myrow=DB_fetch_array($result)) { if ($k==1){ @@ -104,8 +106,8 @@ <td>' . $myrow['deliverydate'] . '</td> <td class="number">' . locale_number_format($myrow['qtyrecd'], $myrow['decimalplaces']) . '</td> <td><a href="PDFGrn.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint GRN ') . '</a> - <a href="PDFQALabel.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint QA Label') . '</a></td> - </tr>'; + <a href="PDFQALabel.php?GRNNo=' . $myrow['grnbatch'] .'&PONo=' . $_POST['PONumber'] . '">' . _('Reprint Labels') . '</a></td> + </tr>'; } echo '</table>'; } Modified: trunk/ReverseGRN.php =================================================================== --- trunk/ReverseGRN.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/ReverseGRN.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -50,6 +50,7 @@ ON grns.podetailitem=purchorderdetails.podetailitem INNER JOIN purchorders ON purchorderdetails.orderno = purchorders.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE grnno='" . $_GET['GRNNo'] . "'"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('Could not get the details of the GRN selected for reversal because') . ' '; @@ -364,16 +365,19 @@ $sql = "SELECT grnno, grnbatch, - itemcode, - itemdescription, - deliverydate, + grns.itemcode, + grns.itemdescription, + grns.deliverydate, qtyrecd, quantityinv, qtyrecd-quantityinv AS qtytoreverse FROM grns + INNER JOIN purchorderdetails ON purchorderdetails.podetailitem=grns.podetailitem + INNER JOIN purchorders on purchorders.orderno = purchorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE grns.supplierid = '" . $_POST['SupplierID'] . "' AND (grns.qtyrecd-grns.quantityinv) >0 - AND deliverydate>='" . FormatDateForSQL($_POST['RecdAfterDate']) ."'"; + AND grns.deliverydate>='" . FormatDateForSQL($_POST['RecdAfterDate']) ."'"; $ErrMsg = _('An error occurred in the attempt to get the outstanding GRNs for') . ' ' . $_POST['SuppName'] . '. ' . _('The message was') . ':'; $DbgMsg = _('The SQL that failed was') . ':'; Modified: trunk/SelectProduct.php =================================================================== --- trunk/SelectProduct.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/SelectProduct.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -265,6 +265,7 @@ $QOOSQL="SELECT SUM(purchorderdetails.quantityord -purchorderdetails.quantityrecd) AS QtyOnOrder FROM purchorders INNER JOIN purchorderdetails ON purchorders.orderno=purchorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.itemcode='" . $StockID . "' AND purchorderdetails.completed =0 AND purchorders.status<>'Cancelled' @@ -281,6 +282,7 @@ $sql = "SELECT SUM(woitems.qtyreqd-woitems.qtyrecd) AS qtywo FROM woitems INNER JOIN workorders ON woitems.wo=workorders.wo + INNER JOIN locationusers ON locationusers.loccode=workorders.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE workorders.closed=0 AND woitems.stockid='" . $StockID . "'"; $ErrMsg = _('The quantity on work orders for this product cannot be retrieved because'); @@ -296,6 +298,7 @@ $DemResult = DB_query("SELECT SUM(salesorderdetails.quantity-salesorderdetails.qtyinvoiced) AS dem FROM salesorderdetails INNER JOIN salesorders ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorderdetails.completed=0 AND salesorders.quotation=0 AND salesorderdetails.stkcode='" . $StockID . "'", $db); @@ -306,6 +309,7 @@ ON salesorders.orderno = salesorderdetails.orderno INNER JOIN bom ON salesorderdetails.stkcode=bom.parent INNER JOIN stockmaster ON stockmaster.stockid=bom.parent + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 AND bom.component='" . $StockID . "' AND stockmaster.mbflag='A' @@ -319,6 +323,7 @@ INNER JOIN workorders ON woitems.wo=workorders.wo AND woitems.wo=worequirements.wo + INNER JOIN locationusers ON locationusers.loccode=workorders.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE worequirements.stockid='" . $StockID . "' AND workorders.closed=0"; $ErrMsg = _('The workorder component demand for this product cannot be retrieved because'); Modified: trunk/SelectSalesOrder.php =================================================================== --- trunk/SelectSalesOrder.php 2014-08-08 13:44:43 UTC (rev 6804) +++ trunk/SelectSalesOrder.php 2014-08-08 16:12:36 UTC (rev 6805) @@ -170,6 +170,7 @@ tel, contact FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 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); @@ -220,7 +221,7 @@ 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 />' . + $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 @@ -231,7 +232,7 @@ DB_Txn_Commit($db); } - /*Starting a new purchase order with a different supplier */ + /*Starting a new purchase order with a different supplier */ $result = DB_Txn_Begin($db); $PO_OrderNo = GetNextTransNo(18, $db); //get the next PO number @@ -240,16 +241,16 @@ $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 + address2, + address3, + address4, + address5, + address6, + telephone, + paymentterms, + currcode, + rate + FROM suppliers INNER JOIN currencies ON suppliers.currcode = currencies.currabrev WHERE supplierid='" . $SupplierID . "'"; @@ -260,61 +261,61 @@ $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['UserID'] . "', - '" . $_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)"; + 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['UserID'] . "', + '" . $_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'); @@ -324,25 +325,25 @@ /*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, - 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['conversionfactor'] . "')"; + itemcode, + deliverydate, + itemdescription, + glcode, + unitprice, + quantityord, + suppliersunit, + suppliers_partno, + 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['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'); @@ -363,7 +364,7 @@ $AuthResult=DB_query($AuthSQL,$db); $AuthRow=DB_fetch_array($AuthResult); if ($AuthRow['authlevel']=''){ - $AuthRow['authlevel'] = 0; + $AuthRow['authlevel'] = 0; } if (DB_num_rows($AuthResult) > 0 AND $AuthRow['authlevel'] > $Order_Value) { //user has authority to authrorise as well as create the order @@ -373,7 +374,7 @@ $result = DB_query("UPDATE purchorders SET allowprint=1, status='Authorised', stat_comment='" . $StatusComment . "' - WHERE orderno='" . $PO_OrderNo . "'", + WHERE orderno='" . $PO_OrderNo . "'", $db,$ErrMsg,$DbgMsg,true); } else { // no authority to authorise this order if (DB_num_rows($AuthResult) ==... [truncated message content] |
From: <dai...@us...> - 2014-08-09 04:37:06
|
Revision: 6806 http://sourceforge.net/p/web-erp/reponame/6806 Author: daintree Date: 2014-08-09 04:37:02 +0000 (Sat, 09 Aug 2014) Log Message: ----------- review Modified Paths: -------------- trunk/AgedControlledInventory.php trunk/LocationUsers.php trunk/Locations.php trunk/includes/ConnectDB_mysqli.inc trunk/includes/LanguageSetup.php trunk/includes/MainMenuLinksArray.php trunk/includes/PDFStarter.php trunk/includes/UserLogin.php trunk/includes/session.inc Modified: trunk/AgedControlledInventory.php =================================================================== --- trunk/AgedControlledInventory.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/AgedControlledInventory.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -5,7 +5,7 @@ include('includes/session.inc'); $PricesSecurity = 12;//don't show pricing info unless security token 12 available to user $Today = time(); -$Title = _('Aged Controlled Inventory') . ' as-of ' . Date(($_SESSION['DefaultDateFormat']), strtotime($UpcomingDate . ' + 0 days')); +$Title = _('Aged Controlled Inventory') . ' ' ._('as-of') .' ' . Date(($_SESSION['DefaultDateFormat']), strtotime($UpcomingDate . ' + 0 days')); include('includes/header.inc'); echo '<p class="page_title_text"> @@ -13,22 +13,21 @@ '" alt="" /><b>' . $Title. '</b> </p>'; -$sql = "SELECT stockserialitems.stockid, - stockmaster.description, - stockserialitems.serialno, +$sql = "SELECT stockserialitems.stockid, + stockmaster.description, + stockserialitems.serialno, stockserialitems.quantity, stockmoves.trandate, stockmaster.materialcost+stockmaster.labourcost+stockmaster.overheadcost AS cost, decimalplaces - FROM stockserialitems - LEFT JOIN stockserialmoves ON stockserialitems.serialno=stockserialmoves.serialno - LEFT JOIN stockmoves ON stockserialmoves.stockmoveno=stockmoves.stkmoveno - INNER JOIN stockmaster ON stockmaster.stockid = stockserialitems.stockid + FROM stockserialitems + LEFT JOIN stockserialmoves ON stockserialitems.serialno=stockserialmoves.serialno + LEFT JOIN stockmoves ON stockserialmoves.stockmoveno=stockmoves.stkmoveno + INNER JOIN stockmaster ON stockmaster.stockid = stockserialitems.stockid INNER JOIN locationusers ON locationusers.loccode=stockserialitems.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE quantity > 0 GROUP BY stockid, serialno - ORDER BY trandate - "; + ORDER BY trandate"; $ErrMsg = _('The stock held could not be retrieved because'); $LocStockResult = DB_query($sql, $db, $ErrMsg); Modified: trunk/LocationUsers.php =================================================================== --- trunk/LocationUsers.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/LocationUsers.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -27,7 +27,7 @@ if (isset($_POST['Process'])) { if ($_POST['SelectedLocation'] == '') { - echo prnMsg(_('You have not selected any Location'), 'error'); + prnMsg(_('You have not selected any Location'), 'error'); echo '<br />'; unset($SelectedLocation); unset($_POST['SelectedLocation']); @@ -40,7 +40,7 @@ if ($_POST['SelectedUser'] == '') { $InputError = 1; - echo prnMsg(_('You have not selected an user to be authorised to use this Location'), 'error'); + prnMsg(_('You have not selected an user to be authorised to use this Location'), 'error'); echo '<br />'; unset($SelectedLocation); } @@ -59,7 +59,7 @@ if ($CheckRow[0] > 0) { $InputError = 1; - prnMsg(_('The user') . ' ' . $_POST['SelectedUser'] . ' ' . _('already authorised to use this Location'), 'error'); + prnMsg(_('The user') . ' ' . $_POST['SelectedUser'] . ' ' . _('is already authorised to use this location'), 'error'); } else { // Add new record on submit $SQL = "INSERT INTO locationusers (loccode, @@ -71,7 +71,7 @@ '1', '1')"; - $msg = _('User') . ': ' . $_POST['SelectedUser'] . ' ' . _('authorisation to use') . ' ' . $_POST['SelectedLocation'] . ' ' . _('Location has been changed'); + $msg = _('User') . ': ' . $_POST['SelectedUser'] . ' ' . _('authority to use the') . ' ' . $_POST['SelectedLocation'] . ' ' . _('location has been changed'); $Result = DB_query($SQL); prnMsg($msg, 'success'); unset($_POST['SelectedUser']); @@ -84,18 +84,18 @@ $ErrMsg = _('The Location user record could not be deleted because'); $Result = DB_query($SQL, $ErrMsg); - prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has been un-authorised to use') . ' ' . $SelectedLocation . ' ' . _('Location'), 'success'); + prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has had their authority to use the') . ' ' . $SelectedLocation . ' ' . _('location removed'), 'success'); unset($_GET['delete']); -} elseif (isset($_GET['toggleupd'])) { +} elseif (isset($_GET['ToggleUpdate'])) { $SQL = "UPDATE locationusers - SET canupd='" . $_GET['toggleupd'] . "' - WHERE loccode='" . $SelectedLocation . "' - AND userid='" . $SelectedUser . "'"; + SET canupd='" . $_GET['ToggleUpdate'] . "' + WHERE loccode='" . $SelectedLocation . "' + AND userid='" . $SelectedUser . "'"; $ErrMsg = _('The Location user record could not be deleted because'); $Result = DB_query($SQL, $ErrMsg); - prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has been un-authorised to update') . ' ' . $SelectedLocation . ' ' . _('Location'), 'success'); - unset($_GET['toggleupd']); + prnMsg(_('User') . ' ' . $SelectedUser . ' ' . _('has had their authority to update') . ' ' . $SelectedLocation . ' ' . _('location removed'), 'success'); + unset($_GET['ToggleUpdate']); } if (!isset($SelectedLocation)) { @@ -109,11 +109,10 @@ <td>' . _('Select Location') . ':</td> <td><select name="SelectedLocation">'; - $SQL = "SELECT loccode, - locationname - FROM locations"; + $Result = DB_query("SELECT loccode, + locationname + FROM locations"); - $Result = DB_query($SQL); echo '<option value="">' . _('Not Yet Selected') . '</option>'; while ($MyRow = DB_fetch_array($Result)) { if (isset($SelectedLocation) and $MyRow['loccode'] == $SelectedLocation) { @@ -146,14 +145,13 @@ WHERE loccode='" . $SelectedLocation . "'"; $Result = DB_query($SQLName); $MyRow = DB_fetch_array($Result); - $SelectedBankName = $MyRow['locationname']; + $SelectedLocationName = $MyRow['locationname']; - echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Authorised users for') . ' ' . $SelectedBankName . ' ' . _('Location') . '</a></div>'; - echo '<form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">'; - echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; + echo '<div class="centre"><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '">' . _('Authorised users for') . ' ' . $SelectedLocationName . ' ' . _('Location') . '</a></div> + <form method="post" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '"> + <input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" /> + <input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '" />'; - echo '<input type="hidden" name="SelectedLocation" value="' . $SelectedLocation . '" />'; - $SQL = "SELECT locationusers.userid, canview, canupd, @@ -167,7 +165,7 @@ echo '<table class="selection">'; echo '<tr> - <th colspan="6"><h3>' . _('Authorised users for Location') . ' ' . $SelectedBankName . '</h3></th> + <th colspan="6"><h3>' . _('Authorised users for Location') . ': ' . $SelectedLocationName . '</h3></th> </tr>'; echo '<tr> <th>' . _('User Code') . '</th> @@ -188,9 +186,9 @@ } if ($MyRow['canupd'] == 1) { - $ToggleText = '<td><a href="%s?SelectedUser=%s&toggleupd=0&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to remove Update for this user?') . '\');">' . _('Remove Update') . '</a></td>'; + $ToggleText = '<td><a href="%s?SelectedUser=%s&ToggleUpdate=0&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to remove Update for this user?') . '\');">' . _('Remove Update') . '</a></td>'; } else { - $ToggleText = '<td><a href="%s?SelectedUser=%s&toggleupd=1&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to add Update for this user?') . '\');">' . _('Add Update') . '</a></td>'; + $ToggleText = '<td><a href="%s?SelectedUser=%s&ToggleUpdate=1&SelectedLocation=' . $SelectedLocation . '" onclick="return confirm(\'' . _('Are you sure you wish to add Update for this user?') . '\');">' . _('Add Update') . '</a></td>'; } printf('<td>%s</td> @@ -221,11 +219,10 @@ <td>' . _('Select User') . ':</td> <td><select name="SelectedUser">'; - $SQL = "SELECT userid, - realname - FROM www_users"; + $Result = DB_query("SELECT userid, + realname + FROM www_users"); - $Result = DB_query($SQL); if (!isset($_POST['SelectedUser'])) { echo '<option selected="selected" value="">' . _('Not Yet Selected') . '</option>'; } @@ -241,18 +238,16 @@ echo '</select> </td> - </tr>'; - - echo '</table>'; // close main table + </tr> + </table>'; // close main table DB_free_result($Result); echo '<div class="centre"> <input type="submit" name="submit" value="' . _('Accept') . '" /> <input type="submit" name="Cancel" value="' . _('Cancel') . '" /> - </div>'; + </div> + </form>'; - echo '</form>'; - } // end if user wish to delete } Modified: trunk/Locations.php =================================================================== --- trunk/Locations.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/Locations.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -362,8 +362,8 @@ } $result= DB_query("DELETE FROM locstock WHERE loccode ='" . $SelectedLocation . "'",$db); + $result = DB_query("DELETE FROM locationusers WHERE loccode='" . $SelectedLocation . "'",$db); $result = DB_query("DELETE FROM locations WHERE loccode='" . $SelectedLocation . "'",$db); - $result = DB_query("DELETE FROM locationusers WHERE loccode='" . $SelectedLocation . "'",$db); prnMsg( _('Location') . ' ' . $SelectedLocation . ' ' . _('has been deleted') . '!', 'success'); unset ($SelectedLocation); Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/ConnectDB_mysqli.inc 2014-08-09 04:37:02 UTC (rev 6806) @@ -54,8 +54,6 @@ } } -require_once ($PathPrefix .'includes/MiscFunctions.php'); - //DB wrapper functions to change only once for whole application function DB_query ($SQL, Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/LanguageSetup.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -102,4 +102,4 @@ $DecimalPoint = $LanguagesArray[$_SESSION['Language']]['DecimalPoint']; $ThousandsSeparator = $LanguagesArray[$_SESSION['Language']]['ThousandsSeparator']; -?> +?> \ No newline at end of file Modified: trunk/includes/MainMenuLinksArray.php =================================================================== --- trunk/includes/MainMenuLinksArray.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/MainMenuLinksArray.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -504,7 +504,7 @@ $MenuItems['system']['Maintenance']['Caption'] = array( _('Inventory Categories Maintenance'), _('Inventory Locations Maintenance'), - _('Inventory Location Authorized Users Maintenance'), + _('Inventory Location Authorised Users Maintenance'), _('Discount Category Maintenance'), _('Units of Measure'), _('MRP Available Production Days'), @@ -576,11 +576,11 @@ $MenuItems['Utilities']['Maintenance']['URL'] = array( '/Z_poAdmin.php', '/Z_MakeNewCompany.php', '/Z_DataExport.php', - '/Z_ImportDebtors.php', + '/Z_ImportDebtors.php', '/Z_ImportStocks.php', '/Z_ImportPriceList.php', '/Z_ImportFixedAssets.php', - '/Z_ImportGLTransactions.php', + '/Z_ImportGLTransactions.php', '/Z_CreateCompanyTemplateFile.php', '/Z_UpdateChartDetailsBFwd.php', '/Z_RePostGLFromPeriod.php', Modified: trunk/includes/PDFStarter.php =================================================================== --- trunk/includes/PDFStarter.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/PDFStarter.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -173,7 +173,15 @@ break; default: - $DocumentOrientation = 'L'; + $DocumentPaper = 'LETTER'; + $DocumentOrientation ='L'; + + $Page_Width = 792; // 72 * 11 inch + $Page_Height = 612; // 72 * 8.5 inch + $Top_Margin = 36; // Half inch = 72/2 + $Bottom_Margin = 36; // Half inch = 72/2 + $Left_Margin = 36; // Half inch = 72/2 + $Right_Margin = 36; // Half inch = 72/2 break; } Modified: trunk/includes/UserLogin.php =================================================================== --- trunk/includes/UserLogin.php 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/UserLogin.php 2014-08-09 04:37:02 UTC (rev 6806) @@ -137,7 +137,7 @@ if($_SESSION['SmtpSetting']==0){ mail($SysAdminEmail,$EmailSubject,$EmailText); - }else{ + } else{ include('includes/htmlMimeMail.php'); $mail = new htmlMimeMail(); $mail->setSubject($EmailSubject); Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2014-08-08 16:12:36 UTC (rev 6805) +++ trunk/includes/session.inc 2014-08-09 04:37:02 UTC (rev 6806) @@ -81,7 +81,6 @@ include($PathPrefix . 'includes/LanguageSetup.php'); - if (!isset($AllowAnyone)){ /* only do security checks if AllowAnyone is not true */ include $PathPrefix . 'includes/UserLogin.php'; /* Login checking and setup */ @@ -100,7 +99,7 @@ $Theme = (isset($_SESSION['Theme'])) ? $_SESSION['Theme'] : 'gel'; switch ($rc) { case UL_OK; //user logged in successfully - include($PathPrefix . 'includes/LanguageSetup.php'); //set up the language + include($PathPrefix . 'includes/LanguageSetup.php'); //set up the language of the user break; case UL_SHOWLOGIN: @@ -265,15 +264,15 @@ $Title = _('Security Permissions Problem'); include($PathPrefix . 'includes/header.inc'); echo '<tr> - <td class="menu_group_items"> - <table width="100%" class="table_index"> - <tr><td class="menu_group_item">'; - echo '<b><font style="size:+1; text-align:center;">' . _('The security settings on your account do not permit you to access this function') . '</font></b>'; - - echo '</td> - </tr> - </table> - </td> + <td class="menu_group_items"> + <table width="100%" class="table_index"> + <tr> + <td class="menu_group_item"> + <b><font style="size:+1; text-align:center;">' . _('The security settings on your account do not permit you to access this function') . '</font></b> + </td> + </tr> + </table> + </td> </tr>'; include($PathPrefix . 'includes/footer.inc'); |
From: <aga...@us...> - 2014-08-11 21:27:22
|
Revision: 6808 http://sourceforge.net/p/web-erp/reponame/6808 Author: agaluski Date: 2014-08-11 21:27:11 +0000 (Mon, 11 Aug 2014) Log Message: ----------- Added location Based Security to all of these files Modified Paths: -------------- trunk/PDFStockLocTransfer.php trunk/PDFTopItems.php trunk/SpecialOrder.php trunk/StockCheck.php trunk/StockCounts.php trunk/StockDispatch.php trunk/StockLocTransfer.php trunk/StockLocTransferReceive.php trunk/StockMovements.php trunk/StockReorderLevel.php trunk/SuppLoginSetup.php trunk/SupplierTenderCreate.php trunk/TopItems.php trunk/WorkCentres.php trunk/WorkOrderCosting.php Modified: trunk/PDFStockLocTransfer.php =================================================================== --- trunk/PDFStockLocTransfer.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/PDFStockLocTransfer.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -75,6 +75,8 @@ INNER JOIN stockmaster ON loctransfers.stockid=stockmaster.stockid INNER JOIN locations ON loctransfers.shiploc=locations.loccode INNER JOIN locations AS locationsrec ON loctransfers.recloc = locationsrec.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 + INNER JOIN locationusers as locationusersrec ON locationusersrec.loccode=locationsrec.loccode AND locationusersrec.userid='" . $_SESSION['UserID'] . "' AND locationusersrec.canview=1 WHERE loctransfers.reference='" . $_GET['TransferNo'] . "'"; $result = DB_query($sql,$db, $ErrMsg, $DbgMsg); Modified: trunk/PDFTopItems.php =================================================================== --- trunk/PDFTopItems.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/PDFTopItems.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -20,7 +20,8 @@ stockmaster.description, stockmaster.units, stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster + FROM salesorderdetails, salesorders INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1, + debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno @@ -35,7 +36,8 @@ SUM(salesorderdetails.qtyinvoiced * salesorderdetails.unitprice ) AS valuesales, stockmaster.description, stockmaster.units - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster + FROM salesorderdetails, salesorders INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1, + debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno @@ -53,7 +55,8 @@ stockmaster.description, stockmaster.units, stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster + FROM salesorderdetails, salesorders INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1, + debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno @@ -70,7 +73,8 @@ stockmaster.description, stockmaster.units, stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster + FROM salesorderdetails, salesorders INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1, + debtorsmaster,stockmaster WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno @@ -90,6 +94,7 @@ //find the quantity onhand item $sqloh = "SELECT sum(quantity)as qty FROM locstock + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockid='" . DB_escape_string($myrow['stkcode']) . "'"; $oh = DB_query($sqloh, $db); $ohRow = DB_fetch_row($oh); Modified: trunk/SpecialOrder.php =================================================================== --- trunk/SpecialOrder.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/SpecialOrder.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -590,7 +590,8 @@ echo '<table><tr><td>' . _('Receive Purchase Into and Sell From') . ': <select name="StkLocation">'; -$sql = "SELECT loccode, locationname FROM locations"; +$sql = "SELECT locations.loccode, locationname FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $LocnResult = DB_query($sql,$db); if (!isset($_SESSION['SPL'.$identifier]->StkLocation) or $_SESSION['SPL'.$identifier]->StkLocation==''){ /*If this is the first time the form loaded set up defaults */ $_SESSION['SPL'.$identifier]->StkLocation = $_SESSION['UserStockLocation']; Modified: trunk/StockCheck.php =================================================================== --- trunk/StockCheck.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/StockCheck.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -294,7 +294,9 @@ echo '<tr> <td>' . _('For Inventory in Location') . ':</td> <td><select name="Location">'; - $sql = "SELECT loccode, locationname FROM locations ORDER BY locationname"; + $sql = "SELECT locations.loccode, locationname FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 + ORDER BY locationname"; $LocnResult=DB_query($sql,$db); while ($myrow=DB_fetch_array($LocnResult)){ Modified: trunk/StockCounts.php =================================================================== --- trunk/StockCounts.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/StockCounts.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -104,7 +104,8 @@ echo '<table cellpadding="2" class="selection">'; echo '<tr> <th colspan="3">' ._('Stock Check Counts at Location') . ':<select name="Location">'; - $sql = 'SELECT loccode, locationname FROM locations'; + $sql = "SELECT locations.loccode, locationname FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ @@ -202,7 +203,9 @@ } //START OF action=VIEW - $SQL = "select * from stockcounts"; + $SQL = "select stockcounts.*, + canupd from stockcounts + INNER JOIN locationusers ON locationusers.loccode=stockcounts.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $result = DB_query($SQL, $db); echo '<input type="hidden" name="Action" value="View" />'; echo '<table cellpadding="2" class="selection">'; @@ -219,7 +222,11 @@ <td>'.$myrow['qtycounted'].'</td> <td>'.$myrow['reference'].'</td> <td>'; - echo '<input type="checkbox" name="DEL[' . $myrow['id'] . ']" maxlength="20" size="20" /></td></tr>'; + if ($myrow['canupd']==1) { + echo '<input type="checkbox" name="DEL[' . $myrow['id'] . ']" maxlength="20" size="20" />'; + + } + echo '</td></tr>'; } echo '</table><br /><div class="centre"><input type="submit" name="SubmitChanges" value="' . _('Save Changes') . '" /></div>'; Modified: trunk/StockDispatch.php =================================================================== --- trunk/StockDispatch.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/StockDispatch.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -330,9 +330,10 @@ echo '<div> <br />'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - $sql = "SELECT loccode, + $sql = "SELECT locations.loccode, locationname - FROM locations"; + FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $resultStkLocs = DB_query($sql,$db); if (!isset($_POST['FromLocation'])) { $_POST['FromLocation']=$DefaultLocation; Modified: trunk/StockLocTransfer.php =================================================================== --- trunk/StockLocTransfer.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/StockLocTransfer.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -255,7 +255,7 @@ <th colspan="4"><input type="hidden" name="Trf_ID" value="' . $Trf_ID . '" /><h3>' . _('Inventory Location Transfer Shipment Reference').' # '. $Trf_ID. '</h3></th> </tr>'; - $sql = "SELECT loccode, locationname FROM locations ORDER BY locationname"; + $sql = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 ORDER BY locationname"; $resultStkLocs = DB_query($sql,$db); echo '<tr> Modified: trunk/StockLocTransferReceive.php =================================================================== --- trunk/StockLocTransferReceive.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/StockLocTransferReceive.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -387,6 +387,7 @@ ON loctransfers.shiploc=locations.loccode INNER JOIN locations as reclocations ON loctransfers.recloc = reclocations.loccode + INNER JOIN locationusers ON locationusers.loccode=reclocations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 INNER JOIN stockmaster ON loctransfers.stockid=stockmaster.stockid WHERE reference ='" . $_GET['Trf_ID'] . "' ORDER BY loctransfers.stockid"; @@ -533,7 +534,7 @@ echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - $LocResult = DB_query("SELECT locationname, loccode FROM locations ORDER BY locationname",$db); + $LocResult = DB_query("SELECT locationname, locations.loccode FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 ORDER BY locationname",$db); echo '<table class="selection">'; echo '<tr> Modified: trunk/StockMovements.php =================================================================== --- trunk/StockMovements.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/StockMovements.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -37,7 +37,8 @@ echo ' ' . _('From Stock Location') . ':<select name="StockLocation"> '; -$sql = "SELECT loccode, locationname FROM locations"; +$sql = "SELECT locations.loccode, locationname FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $resultStkLocs = DB_query($sql,$db); while ($myrow=DB_fetch_array($resultStkLocs)){ Modified: trunk/StockReorderLevel.php =================================================================== --- trunk/StockReorderLevel.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/StockReorderLevel.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -31,9 +31,11 @@ locations.locationname, locstock.quantity, locstock.reorderlevel, - stockmaster.decimalplaces + stockmaster.decimalplaces, + canupd FROM locstock INNER JOIN locations ON locstock.loccode=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 INNER JOIN stockmaster ON locstock.stockid=stockmaster.stockid WHERE locstock.stockid = '" . $StockID . "' @@ -83,11 +85,15 @@ $UpdateReorderLevel = DB_query($sql, $db); } - + if ($myrow['canupd']==1) { + $UpdateCode='<input title="'._('Input safety stock quantity').'" type="text" class="number" name="%s" maxlength="10" size="10" value="%s" /> + <input type="hidden" name="Old_%s" value="%s" />'; + } else { + $UpdateCode='<input type="hidden" name="%s">%s<input type="hidden" name="Old_%s" value="%s" />'; + } printf('<td>%s</td> <td class="number">%s</td> - <td><input title="'._('Input safety stock quantity').'" type="text" class="number" name="%s" maxlength="10" size="10" value="%s" /> - <input type="hidden" name="Old_%s" value="%s" /></td></tr>', + <td class="number">' . $UpdateCode . '</td></tr>', $myrow['locationname'], locale_number_format($myrow['quantity'],$myrow['decimalplaces']), $myrow['loccode'], Modified: trunk/SuppLoginSetup.php =================================================================== --- trunk/SuppLoginSetup.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/SuppLoginSetup.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -187,7 +187,7 @@ echo '<tr><td>' . _('Default Location') . ':</td> <td><select name="DefaultLocation">'; -$sql = "SELECT loccode, locationname FROM locations"; +$sql = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $result = DB_query($sql,$db); while ($myrow=DB_fetch_array($result)){ Modified: trunk/SupplierTenderCreate.php =================================================================== --- trunk/SupplierTenderCreate.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/SupplierTenderCreate.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -57,6 +57,7 @@ telephone, requiredbydate FROM tenders + INNER JOIN locationusers ON locationusers.loccode=tenders.location AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE tenderid='" . $_GET['ID'] . "'"; $result=DB_query($sql, $db); $myrow=DB_fetch_array($result); @@ -126,6 +127,7 @@ address6, telephone FROM tenders + INNER JOIN locationusers ON locationusers.loccode=tenders.location AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE closed=0 AND requiredbydate > '" . Date('Y-m-d') . "'"; $result=DB_query($sql, $db); @@ -268,7 +270,8 @@ tel, contact FROM locations - WHERE loccode='" . $_POST['StkLocation'] . "'"; + INNER JOIN locationusers ON locationusers.loccode=.locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 + WHERE locations.loccode='" . $_POST['StkLocation'] . "'"; $LocnAddrResult = DB_query($sql,$db); if (DB_num_rows($LocnAddrResult)==1){ @@ -310,6 +313,7 @@ tel, contact FROM locations + INNER JOIN locationusers ON locationusers.loccode=.locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE loccode='" . $_POST['StkLocation'] . "'"; $LocnAddrResult = DB_query($sql,$db); @@ -339,9 +343,10 @@ <td>' . _('Warehouse') . ':</td> <td><select name="StkLocation" onchange="ReloadForm(form1.LookupDeliveryAddress)">'; - $sql = "SELECT loccode, + $sql = "SELECT locations.loccode, locationname - FROM locations"; + FROM locations + INNER JOIN locationusers ON locationusers.loccode=.locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $LocnResult = DB_query($sql,$db); while ($LocnRow=DB_fetch_array($LocnResult)){ Modified: trunk/TopItems.php =================================================================== --- trunk/TopItems.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/TopItems.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -22,9 +22,10 @@ <td style="width:150px">' . _('Select Location') . ' </td> <td>:</td> <td><select name="Location">'; - $sql = "SELECT loccode, + $sql = "SELECT locations.loccode, locationname - FROM locations"; + FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $result = DB_query($sql, $db); echo '<option value="All">' . _('All') . '</option>'; while ($myrow = DB_fetch_array($result)) { @@ -127,8 +128,10 @@ stockmaster.mbflag, currencies.rate, debtorsmaster.currcode, + fromstkloc, stockmaster.decimalplaces - FROM salesorderdetails, salesorders, debtorsmaster,stockmaster, currencies + FROM salesorderdetails, salesorders INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1, + debtorsmaster,stockmaster, currencies WHERE salesorderdetails.orderno = salesorders.orderno AND salesorderdetails.stkcode = stockmaster.stockid AND salesorders.debtorno = debtorsmaster.debtorno @@ -191,12 +194,14 @@ case 'B': $QOHResult = DB_query("SELECT sum(quantity) FROM locstock + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockid = '" . DB_escape_string($myrow['stkcode']) . "'", $db); $QOHRow = DB_fetch_row($QOHResult); $QOH = $QOHRow[0]; $QOOSQL="SELECT SUM(purchorderdetails.quantityord -purchorderdetails.quantityrecd) AS QtyOnOrder FROM purchorders INNER JOIN purchorderdetails ON purchorders.orderno=purchorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.itemcode='" . DB_escape_string($myrow['stkcode']) . "' AND purchorderdetails.completed =0 AND purchorders.status<>'Cancelled' @@ -213,6 +218,7 @@ $sql = "SELECT SUM(woitems.qtyreqd-woitems.qtyrecd) AS qtywo FROM woitems INNER JOIN workorders ON woitems.wo=workorders.wo + INNER JOIN locationusers ON locationusers.loccode=workorders.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE workorders.closed=0 AND woitems.stockid='" . DB_escape_string($myrow['stkcode']) . "'"; $ErrMsg = _('The quantity on work orders for this product cannot be retrieved because'); Modified: trunk/WorkCentres.php =================================================================== --- trunk/WorkCentres.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/WorkCentres.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -118,6 +118,7 @@ workcentres.overheadperhour FROM workcentres, locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE workcentres.location = locations.loccode"; $result = DB_query($sql,$db); @@ -177,6 +178,7 @@ overheadrecoveryact, overheadperhour FROM workcentres + INNER JOIN locationusers ON locationusers.loccode=workcentres.location AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE code='" . $SelectedWC . "'"; $result = DB_query($sql, $db); @@ -208,8 +210,9 @@ } $SQL = "SELECT locationname, - loccode - FROM locations"; + locations.loccode + FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $result = DB_query($SQL,$db); if (!isset($_POST['Description'])) { Modified: trunk/WorkOrderCosting.php =================================================================== --- trunk/WorkOrderCosting.php 2014-08-11 14:12:30 UTC (rev 6807) +++ trunk/WorkOrderCosting.php 2014-08-11 21:27:11 UTC (rev 6808) @@ -48,6 +48,7 @@ closecomments FROM workorders INNER JOIN locations ON workorders.loccode=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE workorders.wo='" . $_POST['WO'] . "'", $db, $ErrMsg); |
From: <aga...@us...> - 2014-08-12 19:16:03
|
Revision: 6809 http://sourceforge.net/p/web-erp/reponame/6809 Author: agaluski Date: 2014-08-12 19:16:00 +0000 (Tue, 12 Aug 2014) Log Message: ----------- Added Location based security to these files Modified Paths: -------------- trunk/BOMs.php trunk/PrintCustTrans.php trunk/PrintCustTransPortrait.php trunk/RecurringSalesOrdersProcess.php trunk/ReorderLevel.php trunk/ReorderLevelLocation.php trunk/SelectRecurringSalesOrder.php Modified: trunk/BOMs.php =================================================================== --- trunk/BOMs.php 2014-08-11 21:27:11 UTC (rev 6808) +++ trunk/BOMs.php 2014-08-12 19:16:00 UTC (rev 6809) @@ -93,6 +93,7 @@ INNER JOIN locstock ON bom.loccode=locstock.loccode AND bom.component = locstock.stockid + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE bom.component='".$Component."' AND bom.parent = '".$Parent."'"; @@ -448,7 +449,7 @@ $sql = "SELECT bom.parent, stockmaster.description, stockmaster.mbflag - FROM bom, stockmaster + FROM bom INNER JOIN locationusers ON locationusers.loccode=bom.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1, stockmaster WHERE bom.component='".$SelectedParent."' AND stockmaster.stockid=bom.parent AND stockmaster.mbflag='M'"; @@ -498,6 +499,7 @@ stockmaster.mbflag FROM bom INNER JOIN stockmaster ON bom.parent=stockmaster.stockid + INNER JOIN locationusers ON locationusers.loccode=bom.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE bom.component='".$SelectedParent."' AND stockmaster.mbflag='K'"; @@ -602,13 +604,14 @@ //editing a selected component from the link to the line item $sql = "SELECT sequence, - loccode, + bom.loccode, effectiveafter, effectiveto, workcentreadded, quantity, autoissue FROM bom + INNER JOIN locationusers ON locationusers.loccode=bom.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE parent='".$SelectedParent."' AND component='".$SelectedComponent."'"; @@ -699,7 +702,7 @@ <td><select tabindex="2" name="LocCode">'; DB_free_result($result); - $sql = "SELECT locationname, loccode FROM locations"; + $sql = "SELECT locationname, locations.loccode FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $result = DB_query($sql,$db); while ($myrow = DB_fetch_array($result)) { @@ -719,7 +722,7 @@ <tr> <td>' . _('Work Centre Added') . ': </td><td>'; - $sql = "SELECT code, description FROM workcentres"; + $sql = "SELECT code, description FROM workcentres INNER JOIN locationusers ON locationusers.loccode=workcentres.location AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ Modified: trunk/PrintCustTrans.php =================================================================== --- trunk/PrintCustTrans.php 2014-08-11 21:27:11 UTC (rev 6808) +++ trunk/PrintCustTrans.php 2014-08-12 19:16:00 UTC (rev 6809) @@ -149,6 +149,8 @@ ON custbranch.salesman=salesman.salesmancode INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers + ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator INNER JOIN currencies @@ -647,6 +649,8 @@ ON custbranch.salesman=salesman.salesmancode INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers + ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator INNER JOIN currencies Modified: trunk/PrintCustTransPortrait.php =================================================================== --- trunk/PrintCustTransPortrait.php 2014-08-11 21:27:11 UTC (rev 6808) +++ trunk/PrintCustTransPortrait.php 2014-08-12 19:16:00 UTC (rev 6809) @@ -169,6 +169,8 @@ ON custbranch.salesman=salesman.salesmancode INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers + ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator INNER JOIN currencies @@ -688,6 +690,8 @@ ON custbranch.salesman=salesman.salesmancode INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers + ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 INNER JOIN paymentterms ON debtorsmaster.paymentterms=paymentterms.termsindicator INNER JOIN currencies Modified: trunk/RecurringSalesOrdersProcess.php =================================================================== --- trunk/RecurringSalesOrdersProcess.php 2014-08-11 21:27:11 UTC (rev 6808) +++ trunk/RecurringSalesOrdersProcess.php 2014-08-12 19:16:00 UTC (rev 6809) @@ -60,7 +60,7 @@ custbranch.taxgroupid, locations.contact, locations.email - FROM recurringsalesorders, + FROM recurringsalesorders INNER JOIN locationusers ON locationusers.loccode=recurringsalesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1, debtorsmaster, custbranch, salestypes, Modified: trunk/ReorderLevel.php =================================================================== --- trunk/ReorderLevel.php 2014-08-11 21:27:11 UTC (rev 6808) +++ trunk/ReorderLevel.php 2014-08-12 19:16:00 UTC (rev 6809) @@ -42,7 +42,7 @@ stockmaster.decimalplaces, stockmaster.serialised, stockmaster.controlled - FROM locstock, + FROM locstock INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1, stockmaster LEFT JOIN stockcategory ON stockmaster.categoryid=stockcategory.categoryid, @@ -126,7 +126,7 @@ locstock.loccode, locstock.reorderlevel, stockmaster.decimalplaces - FROM locstock, stockmaster + FROM locstock INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1, stockmaster WHERE locstock.quantity > 0 AND locstock.quantity > reorderlevel AND locstock.stockid = stockmaster.stockid @@ -197,9 +197,9 @@ echo '<br /><form action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - $sql = "SELECT loccode, + $sql = "SELECT locations.loccode, locationname - FROM locations"; + FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $resultStkLocs = DB_query($sql,$db); echo '<table class="selection"> <tr> Modified: trunk/ReorderLevelLocation.php =================================================================== --- trunk/ReorderLevelLocation.php 2014-08-11 21:27:11 UTC (rev 6808) +++ trunk/ReorderLevelLocation.php 2014-08-12 19:16:00 UTC (rev 6809) @@ -42,9 +42,11 @@ reorderlevel, bin, quantity, - decimalplaces + decimalplaces, + canupd FROM locstock INNER JOIN stockmaster ON locstock.stockid = stockmaster.stockid + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmaster.categoryid = '" . $_POST['StockCat'] . "' AND locstock.loccode = '" . $_POST['StockLocation'] . "' AND stockmaster.discontinued = 0 @@ -110,6 +112,7 @@ //find the quantity onhand item $SqlOH="SELECT SUM(quantity) AS qty FROM locstock + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockid='" . $myrow['stockid'] . "'"; $TotQtyResult = DB_query($SqlOH,$db); $TotQtyRow = DB_fetch_array($TotQtyResult); @@ -119,9 +122,16 @@ <td class="number">' . locale_number_format($SalesRow['qtyinvoiced'],$myrow['decimalplaces']) . '</td> <td class="number">' . locale_number_format($TotQtyRow['qty'],$myrow['decimalplaces']) . '</td> <td class="number">' . locale_number_format($myrow['quantity'],$myrow['decimalplaces']) . '</td> - <td><input type="text" class="number" name="ReorderLevel' . $i .'" maxlength="10" size="10" value="'. locale_number_format($myrow['reorderlevel'],0) .'" /> + <td class="number">'; + if ($myrow['canupd']==1) { + echo '<input type="text" class="number" name="ReorderLevel' . $i .'" maxlength="10" size="10" value="'. locale_number_format($myrow['reorderlevel'],0) .'" /> <input type="hidden" name="StockID' . $i . '" value="' . $myrow['stockid'] . '" /></td> - <td><input type="text" name="BinLocation' . $i .'" maxlength="10" size="10" value="'. $myrow['bin'] .'" /></td> + <td><input type="text" name="BinLocation' . $i .'" maxlength="10" size="10" value="'. $myrow['bin'] .'" />'; + } else { + echo locale_number_format($myrow['reorderlevel'],0) . '</td><td>' . $myrow['bin'] . '</td>'; + } + + echo '</td> </tr> '; $i++; } //end of looping @@ -145,9 +155,9 @@ <form action="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '" method="post"> <div>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - $sql = "SELECT loccode, + $sql = "SELECT locations.loccode, locationname - FROM locations"; + FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $resultStkLocs = DB_query($sql,$db); echo '<table class="selection"> <tr> Modified: trunk/SelectRecurringSalesOrder.php =================================================================== --- trunk/SelectRecurringSalesOrder.php 2014-08-11 21:27:11 UTC (rev 6808) +++ trunk/SelectRecurringSalesOrder.php 2014-08-12 19:16:00 UTC (rev 6809) @@ -20,7 +20,7 @@ <td>' . _('Select recurring order templates for delivery from:') . ' </td> <td>' . '<select name="StockLocation">'; -$sql = "SELECT loccode, locationname FROM locations"; +$sql = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $resultStkLocs = DB_query($sql,$db); |
From: <rc...@us...> - 2014-08-13 02:55:17
|
Revision: 6810 http://sourceforge.net/p/web-erp/reponame/6810 Author: rchacon Date: 2014-08-13 02:55:08 +0000 (Wed, 13 Aug 2014) Log Message: ----------- In Z_poRebuildDefault.php: extends title, improves comments, sets file to pot, updates $FilesToInclude, renames old pot file to bak extension. Minor improvements. Modified Paths: -------------- trunk/PcAuthorizeExpenses.php trunk/Z_poAdmin.php trunk/Z_poRebuildDefault.php trunk/doc/Change.log Modified: trunk/PcAuthorizeExpenses.php =================================================================== --- trunk/PcAuthorizeExpenses.php 2014-08-12 19:16:00 UTC (rev 6809) +++ trunk/PcAuthorizeExpenses.php 2014-08-13 02:55:08 UTC (rev 6810) @@ -43,10 +43,10 @@ if (isset($SelectedTabs)) { echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/magnifier.png" title="' . _('Petty Cash') . - '" alt="" />' . _('Authorisation Of Petty Cash Expenses ') . ''.$SelectedTabs . '</p>'; + '" alt="" />' . _('Authorisation Of Petty Cash Expenses') . ' '.$SelectedTabs . '</p>'; } else { echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/magnifier.png" title="' . _('Petty Cash') . - '" alt="" />' . _('Authorisation Of Petty Cash Expenses ') . '</p>'; + '" alt="" />' . _('Authorisation Of Petty Cash Expenses') . '</p>'; } if (isset($_POST['Submit']) or isset($_POST['update']) OR isset($SelectedTabs) OR isset ($_POST['GO'])) { Modified: trunk/Z_poAdmin.php =================================================================== --- trunk/Z_poAdmin.php 2014-08-12 19:16:00 UTC (rev 6809) +++ trunk/Z_poAdmin.php 2014-08-13 02:55:08 UTC (rev 6810) @@ -7,8 +7,8 @@ include ('includes/session.inc'); $Title = _('UTILITY PAGE') . ' ' . _('that helps maintain language files');// _('Maintain Language Files') -$ViewTopic = "SpecialUtilities"; -$BookMark = "Z_poAdmin";// Anchor's id in the manual's html document. +$ViewTopic = 'SpecialUtilities';// Filename in ManualContents.php's TOC. +$BookMark = 'Z_poAdmin';// Anchor's id in the manual's html document. include('includes/header.inc'); echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . '/images/maintenance.png" title="' . Modified: trunk/Z_poRebuildDefault.php =================================================================== --- trunk/Z_poRebuildDefault.php 2014-08-12 19:16:00 UTC (rev 6809) +++ trunk/Z_poRebuildDefault.php 2014-08-13 02:55:08 UTC (rev 6810) @@ -5,16 +5,16 @@ extracted from the sources. The resultant system default language file (.pot file) is saved in the .../locale/en_GB.utf8/LC_MESSAGES/messages.po path. Note: Comments (starting with ///) placed directly before strings - thus marked are made available as hints to translators by helper programs. */ + thus marked are made available as hints to translators by helper programs.*/ /* Steve Kitchen */ //$PageSecurity = 15; include ('includes/session.inc'); -$Title = _('Rebuild');//_('Rebuild the System Default Language File') -$ViewTopic = "SpecialUtilities"; -$BookMark = "Z_poRebuildDefault";// Anchor's id in the manual's html document. +$Title = _('Rebuild the System Default Language File'); +$ViewTopic = 'SpecialUtilities';// Filename in ManualContents.php's TOC. +$BookMark = 'Z_poRebuildDefault';// Anchor's id in the manual's html document. include('includes/header.inc'); echo '<p class="page_title_text"><img alt="" src="' . $RootPath . '/css/' . $Theme . '/images/maintenance.png" title="' . @@ -26,32 +26,24 @@ echo '<br /> <a href="' . $RootPath . '/Z_poAdmin.php">' . _('Back to the translation menu') . '</a>'; echo '<br /><br /> ' . _('Utility page to rebuild the system default language file'); -$PathToDefault = './locale/en_GB.utf8/LC_MESSAGES/messages.po'; -$FilesToInclude = '*.php includes/*.inc includes/*.php api/*.php reportwriter/languages/en_US/reports.php'; +$PathToDefault = './locale/en_GB.utf8/LC_MESSAGES/messages.pot'; +$FilesToInclude = '*.php api/*.php includes/*.inc includes/*.php install/*.php reportwriter/languages/en_US/reports.php'; $xgettextCmd = 'xgettext --no-wrap --from-code=utf-8 -L php -o ' . $PathToDefault . ' ' . $FilesToInclude; if (isset($_POST['submit'])) { - echo '<br /><table><tr><td>'; echo '<form method="post" action=' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?' . SID . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - - /// Run xgettext to recreate the default message.po language file. - prnMsg (_('Rebuilding the default language file ') . '.....<br />', 'info', ' '); - - system($xgettextCmd); - + $Result = rename($PathToDefault, $PathToDefault . '.old');// Renames pot file to bak. + system($xgettextCmd);// Runs xgettext to recreate the default message.po language file. prnMsg (_('Done') . '. ' . _('You should now edit the default language file header') . '<br />', 'info', ' '); - echo "<div class='centre'><a href='" . $RootPath . "/Z_poAdmin.php'>" . _('Back to the menu') . "</a></div>"; echo '</form>'; echo '</td></tr></table>'; } else { - /* set up the page for editing */ - echo '<div class="centre">'; echo '<br />'; prnMsg (_('Every new language creates a new translation file from the system default one') . '.<br />' . @@ -61,11 +53,9 @@ echo '<br />'; echo '<form method="post" action=' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?' . SID . '>'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; - echo '<input type="submit" name="submit" value="' . _('Proceed') . '" /> '; echo '</form>'; echo '</div>'; - } include('includes/footer.inc'); Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-08-12 19:16:00 UTC (rev 6809) +++ trunk/doc/Change.log 2014-08-13 02:55:08 UTC (rev 6810) @@ -1,5 +1,6 @@ webERP Change Log +12/08/14 RChacon: In Z_poRebuildDefault.php: extends title, improves comments, sets file to pot, updates $FilesToInclude, renames old pot file to bak extension. Minor improvements. 08/08/14 Andrew Galuski: Add SQL and maintenance screens for Location based security. added new report aged controlled stock. additional scripts to follow as time allows 2/1/14 Tim: Change columns around on SelectWorkOrder.php 31/07/14 RChacon: Corrects the bottom line of the rectangle. Adds comments (info for developers). |
From: <rc...@us...> - 2014-08-13 17:54:08
|
Revision: 6811 http://sourceforge.net/p/web-erp/reponame/6811 Author: rchacon Date: 2014-08-13 17:53:49 +0000 (Wed, 13 Aug 2014) Log Message: ----------- In SupplierInquiry.php: makes the field systypes.typename be translatable. Modified Paths: -------------- trunk/SupplierInquiry.php trunk/doc/Change.log trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po Modified: trunk/SupplierInquiry.php =================================================================== --- trunk/SupplierInquiry.php 2014-08-13 02:55:08 UTC (rev 6810) +++ trunk/SupplierInquiry.php 2014-08-13 17:53:49 UTC (rev 6811) @@ -207,8 +207,8 @@ echo '<table width="90%" class="selection">'; $TableHeader = '<tr> <th class="ascending">• ' . _('Type') . '</th> - <th class="ascending">• ' . _('Trans') . '</th> - <th class="ascending">• ' . _('Supplier Ref') . '</th> + <th class="ascending">• ' . _('Number') . '</th> + <th class="ascending">• ' . _('Reference') . '</th> <th class="ascending">• ' . _('Date') . '</th> <th class="ascending">• ' . _('Total') . '</th> <th class="ascending">• ' . _('Allocated') . '</th> @@ -249,7 +249,7 @@ /*The trans is settled so don't show option to hold */ - echo '<td>' . $myrow['typename'] . '</td> + echo '<td>' . _($myrow['typename']) . '</td> <td class="number">' . $myrow['transno'] . '</td> <td>' . $myrow['suppreference'] . '</td> <td>' . ConvertSQLDate($myrow['trandate']) . '</td> @@ -261,7 +261,7 @@ <td><a target="_blank" href="' . $RootPath . '/GLTransInquiry.php?TypeID=' . $myrow['type'] . '&TransNo=' . $myrow['transno'] .'">' . _('View GL Postings') . '</a></td> </tr>'; } else { - echo '<td>' . $myrow['typename'] . '</td> + echo '<td>' . _($myrow['typename']) . '</td> <td class="number">' . $myrow['transno'] . '</td> <td>' . $myrow['suppreference'] . '</td> <td>' . ConvertSQLDate($myrow['trandate']) . '</td> @@ -308,7 +308,7 @@ <td> </td> <td> </td> </tr>', - $myrow['typename'], + _($myrow['typename']), $myrow['transno'], $myrow['suppreference'], ConvertSQLDate($myrow['trandate']), @@ -318,7 +318,7 @@ $myrow['transtext']); } else { - echo ' <td>' . $myrow['typename'] . '</td> + echo ' <td>' . _($myrow['typename']) . '</td> <td class="number">' . $myrow['transno'] . '</td> <td>' . $myrow['suppreference'] . '</td> <td>' . ConvertSQLDate($myrow['trandate']) . '</td> @@ -349,7 +349,7 @@ <td><a href="%s/SupplierAllocations.php?AllocTrans=%s">' . _('View Allocations') . '</a></td> <td><a target="_blank" href="%s/GLTransInquiry.php?TypeID=%s&TransNo=%s">' . _('View GL Postings') . '</a></td> </tr>', - $myrow['typename'], + _($myrow['typename']), $myrow['transno'], $myrow['suppreference'], ConvertSQLDate($myrow['trandate']), @@ -375,7 +375,7 @@ <td><a href="%s/SupplierAllocations.php?AllocTrans=%s">' . _('View Allocations') . '</a></td> <td> </td> </tr>', - $myrow['typename'], + _($myrow['typename']), $myrow['transno'], $myrow['suppreference'], ConvertSQLDate($myrow['trandate']), Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-08-13 02:55:08 UTC (rev 6810) +++ trunk/doc/Change.log 2014-08-13 17:53:49 UTC (rev 6811) @@ -1,5 +1,6 @@ webERP Change Log +12/08/14 RChacon: In SupplierInquiry.php: makes the field systypes.typename be translatable. 12/08/14 RChacon: In Z_poRebuildDefault.php: extends title, improves comments, sets file to pot, updates $FilesToInclude, renames old pot file to bak extension. Minor improvements. 08/08/14 Andrew Galuski: Add SQL and maintenance screens for Location based security. added new report aged controlled stock. additional scripts to follow as time allows 2/1/14 Tim: Change columns around on SelectWorkOrder.php Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo =================================================================== (Binary files differ) Modified: trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po =================================================================== --- trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-08-13 02:55:08 UTC (rev 6810) +++ trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po 2014-08-13 17:53:49 UTC (rev 6811) @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: WebERP 4.081\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-02-08 17:33+1300\n" -"PO-Revision-Date: 2014-07-29 12:33-0600\n" +"POT-Creation-Date: 2014-08-13 11:16-0600\n" +"PO-Revision-Date: 2014-08-13 11:41-0600\n" "Last-Translator: Rafael Chacon <raf...@gm...>\n" "Language-Team: TecnoSoluciones.com <web...@te...>\n" "Language: es_ES\n" @@ -19,7 +19,7 @@ "X-Launchpad-Export-Date: 2011-05-24 09:54+0000\n" "X-Poedit-SourceCharset: utf-8\n" -#: AccountGroups.php:7 includes/MainMenuLinksArray.php:370 +#: AccountGroups.php:7 includes/MainMenuLinksArray.php:372 msgid "Account Groups" msgstr "Grupos contables" @@ -173,25 +173,25 @@ #: AccountGroups.php:216 AccountGroups.php:251 AccountSections.php:133 #: Areas.php:115 Areas.php:124 BankAccounts.php:159 CreditStatus.php:125 -#: Currencies.php:245 Currencies.php:253 Currencies.php:261 +#: Currencies.php:244 Currencies.php:252 Currencies.php:260 #: CustomerBranches.php:301 CustomerBranches.php:311 CustomerBranches.php:321 -#: CustomerBranches.php:331 CustomerBranches.php:341 Customers.php:296 -#: Customers.php:305 Customers.php:313 Customers.php:324 Customers.php:334 -#: CustomerTypes.php:147 CustomerTypes.php:157 Departments.php:141 -#: Factors.php:134 FixedAssetCategories.php:137 GLAccounts.php:80 -#: GLAccounts.php:96 Locations.php:250 Locations.php:258 Locations.php:269 -#: Locations.php:278 Locations.php:287 Locations.php:296 Locations.php:305 -#: Locations.php:314 Locations.php:322 Manufacturers.php:154 -#: MRPDemandTypes.php:87 PaymentMethods.php:142 PaymentTerms.php:146 -#: PaymentTerms.php:153 PcExpenses.php:161 SalesCategories.php:128 -#: SalesCategories.php:135 SalesPeople.php:150 SalesPeople.php:157 -#: SalesPeople.php:163 SalesTypes.php:140 SalesTypes.php:150 Shippers.php:81 -#: Shippers.php:93 StockCategories.php:209 Stocks.php:726 Stocks.php:735 -#: Stocks.php:743 Stocks.php:751 Stocks.php:759 Stocks.php:767 Stocks.php:775 -#: Stocks.php:783 Suppliers.php:640 Suppliers.php:649 Suppliers.php:657 -#: SupplierTypes.php:145 TaxCategories.php:131 TaxGroups.php:132 -#: TaxGroups.php:140 TaxProvinces.php:129 UnitsOfMeasure.php:135 -#: WorkCentres.php:89 WorkCentres.php:95 WWW_Access.php:86 +#: CustomerBranches.php:331 CustomerBranches.php:341 CustomerTypes.php:147 +#: CustomerTypes.php:157 Customers.php:296 Customers.php:305 Customers.php:313 +#: Customers.php:324 Customers.php:334 Departments.php:141 Factors.php:134 +#: FixedAssetCategories.php:137 GLAccounts.php:80 GLAccounts.php:96 +#: Locations.php:267 Locations.php:275 Locations.php:286 Locations.php:295 +#: Locations.php:304 Locations.php:313 Locations.php:322 Locations.php:331 +#: Locations.php:339 MRPDemandTypes.php:87 Manufacturers.php:154 +#: PaymentMethods.php:142 PaymentTerms.php:146 PaymentTerms.php:153 +#: PcExpenses.php:161 SalesCategories.php:128 SalesCategories.php:135 +#: SalesPeople.php:150 SalesPeople.php:157 SalesPeople.php:163 +#: SalesTypes.php:140 SalesTypes.php:150 Shippers.php:81 Shippers.php:93 +#: StockCategories.php:209 Stocks.php:738 Stocks.php:747 Stocks.php:755 +#: Stocks.php:763 Stocks.php:771 Stocks.php:779 Stocks.php:787 Stocks.php:795 +#: SupplierTypes.php:126 Suppliers.php:647 Suppliers.php:656 Suppliers.php:664 +#: TaxCategories.php:131 TaxGroups.php:132 TaxGroups.php:140 +#: TaxProvinces.php:129 UnitsOfMeasure.php:135 WWW_Access.php:86 +#: WorkCentres.php:89 WorkCentres.php:95 msgid "There are" msgstr "Existen" @@ -246,49 +246,50 @@ #: AccountGroups.php:286 AccountSections.php:172 AddCustomerContacts.php:25 #: AddCustomerContacts.php:27 AddCustomerNotes.php:101 #: AddCustomerTypeNotes.php:94 AgedDebtors.php:454 AgedSuppliers.php:276 -#: Areas.php:144 AuditTrail.php:11 BankReconciliation.php:17 -#: BOMExtendedQty.php:252 BOMIndented.php:246 BOMIndentedReverse.php:235 -#: BOMInquiry.php:188 BOMListing.php:109 BOMs.php:233 BOMs.php:874 -#: COGSGLPostings.php:19 CompanyPreferences.php:102 CounterReturns.php:1619 -#: CounterSales.php:2105 CounterSales.php:2228 Credit_Invoice.php:275 -#: CreditStatus.php:21 Currencies.php:30 CustEDISetup.php:17 -#: DailyBankTransactions.php:15 DebtorsAtPeriodEnd.php:129 +#: Areas.php:144 AuditTrail.php:11 BOMExtendedQty.php:256 BOMIndented.php:248 +#: BOMIndentedReverse.php:236 BOMInquiry.php:188 BOMListing.php:110 +#: BOMs.php:234 BOMs.php:877 BankReconciliation.php:17 COGSGLPostings.php:19 +#: CompanyPreferences.php:102 CounterReturns.php:1623 CounterSales.php:2108 +#: CounterSales.php:2231 CreditStatus.php:21 Credit_Invoice.php:275 +#: Currencies.php:30 CustEDISetup.php:17 CustItem.php:120 CustItem.php:210 +#: CustItem.php:238 DailyBankTransactions.php:15 DebtorsAtPeriodEnd.php:129 #: DiscountCategories.php:12 DiscountCategories.php:149 DiscountMatrix.php:16 #: EDIMessageFormat.php:105 FixedAssetLocations.php:13 #: FixedAssetRegister.php:16 FixedAssetRegister.php:256 -#: FixedAssetTransfer.php:14 FormDesigner.php:173 GLBalanceSheet.php:387 -#: GLBudgets.php:32 GLJournalInquiry.php:11 GLJournal.php:250 -#: InternalStockRequest.php:310 InventoryPlanning.php:379 -#: InventoryPlanningPrefSupplier.php:469 MaintenanceTasks.php:14 -#: MaintenanceUserSchedule.php:16 MRPReport.php:516 NoSalesItems.php:89 -#: PcAssignCashToTab.php:59 PcAssignCashToTab.php:133 -#: PcAssignCashToTab.php:149 PcAssignCashToTab.php:193 PDFPickingList.php:28 -#: PDFStockLocTransfer.php:16 PO_AuthorisationLevels.php:10 POReport.php:60 -#: POReport.php:64 POReport.php:68 PO_SelectOSPurchOrder.php:142 -#: PriceMatrix.php:16 PricesBasedOnMarkUp.php:8 Prices_Customer.php:35 -#: Prices.php:30 PurchaseByPrefSupplier.php:305 PurchData.php:241 -#: PurchData.php:373 PurchData.php:401 RecurringSalesOrders.php:320 +#: FixedAssetTransfer.php:14 FormDesigner.php:185 GLBalanceSheet.php:387 +#: GLBudgets.php:32 GLJournal.php:250 GLJournalInquiry.php:11 +#: InternalStockRequest.php:310 InventoryPlanning.php:378 +#: InventoryPlanningPrefSupplier.php:469 MRPReport.php:516 +#: MaintenanceTasks.php:14 MaintenanceUserSchedule.php:16 NoSalesItems.php:89 +#: PDFPickingList.php:29 PDFStockLocTransfer.php:16 POReport.php:60 +#: POReport.php:64 POReport.php:68 PO_AuthorisationLevels.php:10 +#: PO_SelectOSPurchOrder.php:142 PcAssignCashToTab.php:59 +#: PcAssignCashToTab.php:133 PcAssignCashToTab.php:149 +#: PcAssignCashToTab.php:193 PriceMatrix.php:16 Prices.php:11 +#: PricesBasedOnMarkUp.php:8 Prices_Customer.php:35 PurchData.php:241 +#: PurchData.php:373 PurchData.php:401 PurchaseByPrefSupplier.php:305 +#: RecurringSalesOrders.php:320 RelatedItemsUpdate.php:24 #: SalesAnalReptCols.php:51 SalesAnalRepts.php:14 SalesCategories.php:11 #: SalesGLPostings.php:19 SalesGraph.php:39 SalesPeople.php:20 #: SalesTypes.php:20 SelectAsset.php:48 SelectCompletedOrder.php:11 #: SelectContract.php:69 SelectCreditItems.php:220 SelectCreditItems.php:291 -#: SelectCustomer.php:265 SelectGLAccount.php:65 SelectOrderItems.php:601 -#: SelectOrderItems.php:1525 SelectOrderItems.php:1653 SelectProduct.php:526 -#: SelectSalesOrder.php:563 SelectSupplier.php:14 SelectSupplier.php:220 -#: SelectWorkOrder.php:9 SelectWorkOrder.php:169 SellThroughSupport.php:229 +#: SelectCustomer.php:265 SelectGLAccount.php:65 SelectOrderItems.php:558 +#: SelectOrderItems.php:1443 SelectOrderItems.php:1571 SelectProduct.php:534 +#: SelectSalesOrder.php:508 SelectSupplier.php:14 SelectSupplier.php:220 +#: SelectWorkOrder.php:9 SelectWorkOrder.php:170 SellThroughSupport.php:229 #: ShipmentCosting.php:11 Shipments.php:17 Shippers.php:123 Shippers.php:160 -#: Shipt_Select.php:8 StockLocMovements.php:14 StockLocStatus.php:28 +#: Shipt_Select.php:8 StockLocMovements.php:14 StockLocStatus.php:29 #: StockSerialItemResearch.php:30 SupplierPriceList.php:14 #: SupplierPriceList.php:224 SupplierPriceList.php:394 #: SupplierPriceList.php:398 SupplierPriceList.php:449 -#: SupplierPriceList.php:499 Suppliers.php:305 SupplierTenderCreate.php:551 -#: SupplierTenderCreate.php:659 SupplierTenders.php:322 -#: SupplierTenders.php:388 SupplierTransInquiry.php:10 TaxGroups.php:15 -#: TaxProvinces.php:11 TopItems.php:114 UnitsOfMeasure.php:10 -#: WhereUsedInquiry.php:18 WorkCentres.php:111 WorkCentres.php:162 -#: WorkOrderCosting.php:22 WorkOrderEntry.php:11 WorkOrderIssue.php:22 -#: WorkOrderReceive.php:31 WorkOrderStatus.php:58 WWW_Access.php:11 -#: WWW_Users.php:36 Z_BottomUpCosts.php:57 ../webSHOP/includes/header.php:252 +#: SupplierPriceList.php:499 SupplierTenderCreate.php:556 +#: SupplierTenderCreate.php:664 SupplierTenders.php:322 +#: SupplierTenders.php:388 SupplierTransInquiry.php:10 Suppliers.php:305 +#: TaxGroups.php:15 TaxProvinces.php:11 TopItems.php:115 UnitsOfMeasure.php:10 +#: WWW_Access.php:11 WWW_Users.php:36 WhereUsedInquiry.php:18 +#: WorkCentres.php:111 WorkCentres.php:163 WorkOrderCosting.php:22 +#: WorkOrderEntry.php:11 WorkOrderIssue.php:22 WorkOrderReceive.php:31 +#: WorkOrderStatus.php:59 Z_BottomUpCosts.php:57 msgid "Search" msgstr "Buscar" @@ -311,24 +312,24 @@ msgstr "Ganancias y Pérdidas" #: AccountGroups.php:310 AccountGroups.php:313 AccountGroups.php:448 -#: AccountGroups.php:450 BOMs.php:124 BOMs.php:786 BOMs.php:788 +#: AccountGroups.php:450 BOMs.php:125 BOMs.php:789 BOMs.php:791 #: CompanyPreferences.php:427 CompanyPreferences.php:429 #: CompanyPreferences.php:442 CompanyPreferences.php:444 #: CompanyPreferences.php:457 CompanyPreferences.php:459 -#: ContractCosting.php:202 Currencies.php:331 Currencies.php:499 -#: Currencies.php:501 CustomerBranches.php:451 Customers.php:659 -#: Customers.php:1047 Customers.php:1053 Customers.php:1056 +#: ContractCosting.php:202 Currencies.php:330 Currencies.php:508 +#: Currencies.php:510 CustomerBranches.php:451 Customers.php:659 +#: Customers.php:1049 Customers.php:1055 Customers.php:1058 #: DailyBankTransactions.php:148 DeliveryDetails.php:1148 #: DeliveryDetails.php:1191 DeliveryDetails.php:1194 FormDesigner.php:101 -#: GLTransInquiry.php:69 Labels.php:591 Labels.php:593 Labels.php:618 -#: Locations.php:628 Locations.php:630 MRPCalendar.php:224 MRP.php:540 -#: MRP.php:544 MRP.php:548 MRP.php:552 PaymentMethods.php:204 -#: PaymentMethods.php:205 PaymentMethods.php:206 PaymentMethods.php:207 -#: PaymentMethods.php:273 PaymentMethods.php:280 PaymentMethods.php:287 -#: PaymentMethods.php:294 PcAuthorizeExpenses.php:248 PDFChequeListing.php:65 -#: PDFDeliveryDifferences.php:76 PDFDIFOT.php:80 +#: GLTransInquiry.php:69 Labels.php:603 Labels.php:605 Labels.php:630 +#: Locations.php:646 Locations.php:648 MRP.php:542 MRP.php:546 MRP.php:550 +#: MRP.php:554 MRPCalendar.php:224 PDFChequeListing.php:65 PDFDIFOT.php:80 +#: PDFDeliveryDifferences.php:76 PDFWOPrint.php:601 PDFWOPrint.php:605 #: PO_AuthorisationLevels.php:134 PO_AuthorisationLevels.php:139 -#: PO_Header.php:799 PO_PDFPurchOrder.php:408 PO_PDFPurchOrder.php:411 +#: PO_Header.php:804 PO_PDFPurchOrder.php:413 PO_PDFPurchOrder.php:416 +#: PaymentMethods.php:204 PaymentMethods.php:205 PaymentMethods.php:206 +#: PaymentMethods.php:207 PaymentMethods.php:273 PaymentMethods.php:280 +#: PaymentMethods.php:287 PaymentMethods.php:294 PcAuthorizeExpenses.php:248 #: PurchData.php:296 PurchData.php:667 PurchData.php:670 #: RecurringSalesOrders.php:493 RecurringSalesOrders.php:496 #: SalesAnalReptCols.php:284 SalesAnalReptCols.php:419 @@ -336,102 +337,107 @@ #: SalesAnalRepts.php:448 SalesAnalRepts.php:451 SalesAnalRepts.php:476 #: SalesAnalRepts.php:479 SalesCategories.php:264 SalesCategories.php:351 #: SalesCategories.php:355 SalesPeople.php:219 SalesPeople.php:359 -#: SalesPeople.php:361 SelectProduct.php:238 SelectProduct.php:381 +#: SalesPeople.php:361 SelectProduct.php:238 SelectProduct.php:386 #: ShipmentCosting.php:667 ShopParameters.php:289 ShopParameters.php:293 #: ShopParameters.php:337 ShopParameters.php:341 ShopParameters.php:391 #: ShopParameters.php:395 ShopParameters.php:413 ShopParameters.php:417 -#: ShopParameters.php:495 ShopParameters.php:499 StockClone.php:917 -#: StockClone.php:919 StockClone.php:942 StockClone.php:944 Stocks.php:1204 -#: Stocks.php:1206 Stocks.php:1229 Stocks.php:1231 SuppContractChgs.php:90 -#: SystemParameters.php:426 SystemParameters.php:449 SystemParameters.php:484 -#: SystemParameters.php:556 SystemParameters.php:564 SystemParameters.php:604 -#: SystemParameters.php:680 SystemParameters.php:689 SystemParameters.php:697 -#: SystemParameters.php:715 SystemParameters.php:722 SystemParameters.php:766 -#: SystemParameters.php:862 SystemParameters.php:1005 -#: SystemParameters.php:1007 SystemParameters.php:1017 -#: SystemParameters.php:1019 SystemParameters.php:1073 -#: SystemParameters.php:1085 SystemParameters.php:1087 -#: SystemParameters.php:1125 SystemParameters.php:1127 TaxGroups.php:311 -#: TaxGroups.php:314 TaxGroups.php:371 WWW_Users.php:491 WWW_Users.php:493 -#: WWW_Users.php:664 WWW_Users.php:666 +#: ShopParameters.php:495 ShopParameters.php:499 StockClone.php:907 +#: StockClone.php:909 StockClone.php:932 StockClone.php:934 Stocks.php:1216 +#: Stocks.php:1218 Stocks.php:1241 Stocks.php:1243 SuppContractChgs.php:90 +#: SystemParameters.php:410 SystemParameters.php:433 SystemParameters.php:468 +#: SystemParameters.php:540 SystemParameters.php:548 SystemParameters.php:588 +#: SystemParameters.php:679 SystemParameters.php:688 SystemParameters.php:696 +#: SystemParameters.php:714 SystemParameters.php:721 SystemParameters.php:765 +#: SystemParameters.php:861 SystemParameters.php:1004 +#: SystemParameters.php:1006 SystemParameters.php:1016 +#: SystemParameters.php:1018 SystemParameters.php:1072 +#: SystemParameters.php:1084 SystemParameters.php:1086 +#: SystemParameters.php:1124 SystemParameters.php:1126 TaxGroups.php:311 +#: TaxGroups.php:314 TaxGroups.php:371 WWW_Users.php:505 WWW_Users.php:507 +#: WWW_Users.php:678 WWW_Users.php:680 +#: reportwriter/languages/en_US/reports.php:114 msgid "Yes" msgstr "Sí" #: AccountGroups.php:316 AccountGroups.php:453 AccountGroups.php:455 -#: BankAccounts.php:210 BankAccounts.php:379 BankAccounts.php:381 -#: BankAccounts.php:385 BankAccounts.php:393 BOMs.php:126 BOMs.php:785 -#: BOMs.php:789 CompanyPreferences.php:426 CompanyPreferences.php:430 +#: BOMs.php:127 BOMs.php:788 BOMs.php:792 BankAccounts.php:210 +#: BankAccounts.php:379 BankAccounts.php:381 BankAccounts.php:385 +#: BankAccounts.php:393 CompanyPreferences.php:426 CompanyPreferences.php:430 #: CompanyPreferences.php:441 CompanyPreferences.php:445 #: CompanyPreferences.php:456 CompanyPreferences.php:460 -#: ContractCosting.php:200 Currencies.php:333 Currencies.php:504 -#: Currencies.php:506 CustomerBranches.php:451 Customers.php:658 -#: Customers.php:1045 Customers.php:1052 Customers.php:1055 +#: ContractCosting.php:200 Currencies.php:332 Currencies.php:513 +#: Currencies.php:515 CustomerBranches.php:451 Customers.php:658 +#: Customers.php:1047 Customers.php:1054 Customers.php:1057 #: DailyBankTransactions.php:150 DeliveryDetails.php:1149 #: DeliveryDetails.php:1192 DeliveryDetails.php:1195 FormDesigner.php:99 -#: GLTransInquiry.php:88 Labels.php:590 Labels.php:594 Labels.php:619 -#: Locations.php:633 Locations.php:635 MRPCalendar.php:226 MRP.php:538 -#: MRP.php:542 MRP.php:546 MRP.php:550 NoSalesItems.php:184 -#: PaymentMethods.php:204 PaymentMethods.php:205 PaymentMethods.php:206 -#: PaymentMethods.php:207 PaymentMethods.php:274 PaymentMethods.php:281 -#: PaymentMethods.php:288 PaymentMethods.php:295 PcAuthorizeExpenses.php:246 -#: PDFChequeListing.php:64 PDFDeliveryDifferences.php:75 PDFDIFOT.php:79 -#: PO_AuthorisationLevels.php:136 PO_AuthorisationLevels.php:141 -#: PO_Header.php:798 PO_PDFPurchOrder.php:409 PO_PDFPurchOrder.php:412 -#: PurchData.php:299 PurchData.php:668 PurchData.php:671 -#: RecurringSalesOrders.php:492 RecurringSalesOrders.php:495 +#: GLTransInquiry.php:88 Labels.php:602 Labels.php:606 Labels.php:631 +#: Locations.php:651 Locations.php:653 MRP.php:540 MRP.php:544 MRP.php:548 +#: MRP.php:552 MRPCalendar.php:226 NoSalesItems.php:184 +#: PDFChequeListing.php:64 PDFDIFOT.php:79 PDFDeliveryDifferences.php:75 +#: PDFWOPrint.php:602 PDFWOPrint.php:606 PO_AuthorisationLevels.php:136 +#: PO_AuthorisationLevels.php:141 PO_Header.php:803 PO_PDFPurchOrder.php:414 +#: PO_PDFPurchOrder.php:417 PaymentMethods.php:204 PaymentMethods.php:205 +#: PaymentMethods.php:206 PaymentMethods.php:207 PaymentMethods.php:274 +#: PaymentMethods.php:281 PaymentMethods.php:288 PaymentMethods.php:295 +#: PcAuthorizeExpenses.php:246 PurchData.php:299 PurchData.php:668 +#: PurchData.php:671 RecurringSalesOrders.php:492 RecurringSalesOrders.php:495 #: SalesAnalReptCols.php:282 SalesAnalReptCols.php:420 #: SalesAnalReptCols.php:423 SalesAnalRepts.php:419 SalesAnalRepts.php:422 #: SalesAnalRepts.php:447 SalesAnalRepts.php:450 SalesAnalRepts.php:475 #: SalesAnalRepts.php:478 SalesCategories.php:266 SalesCategories.php:352 #: SalesCategories.php:354 SalesPeople.php:221 SalesPeople.php:364 -#: SalesPeople.php:366 SelectProduct.php:240 SelectProduct.php:383 +#: SalesPeople.php:366 SelectProduct.php:240 SelectProduct.php:388 #: ShipmentCosting.php:668 ShopParameters.php:290 ShopParameters.php:292 #: ShopParameters.php:338 ShopParameters.php:340 ShopParameters.php:392 #: ShopParameters.php:394 ShopParameters.php:414 ShopParameters.php:416 -#: ShopParameters.php:496 ShopParameters.php:498 StockClone.php:912 -#: StockClone.php:914 StockClone.php:937 StockClone.php:939 Stocks.php:1199 -#: Stocks.php:1201 Stocks.php:1224 Stocks.php:1226 SuppContractChgs.php:92 -#: SystemParameters.php:427 SystemParameters.php:450 SystemParameters.php:485 -#: SystemParameters.php:557 SystemParameters.php:565 SystemParameters.php:605 -#: SystemParameters.php:681 SystemParameters.php:690 SystemParameters.php:698 -#: SystemParameters.php:716 SystemParameters.php:723 SystemParameters.php:767 -#: SystemParameters.php:863 SystemParameters.php:1004 -#: SystemParameters.php:1008 SystemParameters.php:1016 -#: SystemParameters.php:1020 SystemParameters.php:1074 -#: SystemParameters.php:1084 SystemParameters.php:1088 -#: SystemParameters.php:1124 SystemParameters.php:1128 TaxGroups.php:312 -#: TaxGroups.php:315 TaxGroups.php:373 WWW_Users.php:490 WWW_Users.php:494 -#: WWW_Users.php:663 WWW_Users.php:667 includes/PDFLowGPPageHeader.inc:44 +#: ShopParameters.php:496 ShopParameters.php:498 StockClone.php:902 +#: StockClone.php:904 StockClone.php:927 StockClone.php:929 Stocks.php:1211 +#: Stocks.php:1213 Stocks.php:1236 Stocks.php:1238 SuppContractChgs.php:92 +#: SystemParameters.php:411 SystemParameters.php:434 SystemParameters.php:469 +#: SystemParameters.php:541 SystemParameters.php:549 SystemParameters.php:589 +#: SystemParameters.php:680 SystemParameters.php:689 SystemParameters.php:697 +#: SystemParameters.php:715 SystemParameters.php:722 SystemParameters.php:766 +#: SystemParameters.php:862 SystemParameters.php:1003 +#: SystemParameters.php:1007 SystemParameters.php:1015 +#: SystemParameters.php:1019 SystemParameters.php:1073 +#: SystemParameters.php:1083 SystemParameters.php:1087 +#: SystemParameters.php:1123 SystemParameters.php:1127 TaxGroups.php:312 +#: TaxGroups.php:315 TaxGroups.php:373 WWW_Users.php:504 WWW_Users.php:508 +#: WWW_Users.php:677 WWW_Users.php:681 includes/PDFLowGPPageHeader.inc:44 #: includes/PDFTaxPageHeader.inc:35 +#: reportwriter/languages/en_US/reports.php:82 msgid "No" msgstr "No" -#: AccountGroups.php:325 AccountSections.php:192 AddCustomerContacts.php:148 +#: AccountGroups.php:325 AccountSections.php:193 AddCustomerContacts.php:148 #: AddCustomerNotes.php:137 AddCustomerTypeNotes.php:131 Areas.php:164 -#: BankAccounts.php:223 BOMs.php:152 COGSGLPostings.php:112 -#: COGSGLPostings.php:216 CreditStatus.php:175 Currencies.php:363 -#: CustomerBranches.php:455 Customers.php:1130 Customers.php:1164 -#: CustomerTypes.php:206 Departments.php:186 EDIMessageFormat.php:150 -#: Factors.php:334 FixedAssetCategories.php:190 FixedAssetLocations.php:111 -#: FreightCosts.php:253 GeocodeSetup.php:173 GLAccounts.php:317 GLTags.php:96 -#: ImportBankTransAnalysis.php:224 InternalStockRequest.php:292 Labels.php:323 -#: Labels.php:348 Locations.php:404 MailingGroupMaintenance.php:178 -#: MaintenanceTasks.php:118 Manufacturers.php:217 MRPDemands.php:309 -#: MRPDemandTypes.php:120 PaymentMethods.php:208 PaymentTerms.php:205 -#: PcAssignCashToTab.php:277 PcClaimExpensesFromTab.php:276 PcExpenses.php:226 -#: PcTabs.php:236 PcTypeTabs.php:180 PO_AuthorisationLevels.php:151 -#: Prices_Customer.php:280 Prices.php:255 PurchData.php:312 -#: SalesCategories.php:272 SalesGLPostings.php:137 SalesGLPostings.php:253 -#: SalesPeople.php:232 SalesTypes.php:206 SecurityTokens.php:130 -#: SelectCustomer.php:614 SelectCustomer.php:633 SelectCustomer.php:663 -#: SelectCustomer.php:681 SelectCustomer.php:705 SelectCustomer.php:722 -#: SelectGLAccount.php:117 SelectGLAccount.php:132 SellThroughSupport.php:298 -#: Shippers.php:144 StockCategories.php:289 SupplierContacts.php:165 -#: SupplierTenderCreate.php:155 SupplierTypes.php:189 -#: SuppTransGLAnalysis.php:125 TaxAuthorities.php:174 TaxCategories.php:182 -#: TaxGroups.php:188 TaxProvinces.php:180 UnitsOfMeasure.php:185 -#: WorkCentres.php:141 WWW_Access.php:126 WWW_Users.php:327 -#: includes/InputSerialItems.php:102 includes/OutputSerialItems.php:20 +#: BOMs.php:153 BankAccounts.php:223 COGSGLPostings.php:112 +#: COGSGLPostings.php:216 CreditStatus.php:175 Currencies.php:362 +#: Currencies.php:379 CustItem.php:166 CustomerBranches.php:455 +#: CustomerTypes.php:206 Customers.php:1132 Customers.php:1166 +#: Departments.php:186 EDIMessageFormat.php:150 Factors.php:334 +#: FixedAssetCategories.php:190 FixedAssetLocations.php:111 +#: FreightCosts.php:253 GLAccounts.php:317 GLTags.php:96 GeocodeSetup.php:173 +#: ImportBankTransAnalysis.php:224 InternalStockRequest.php:292 Labels.php:335 +#: Labels.php:360 Locations.php:422 MRPDemandTypes.php:120 MRPDemands.php:309 +#: MailingGroupMaintenance.php:178 MaintenanceTasks.php:118 +#: Manufacturers.php:217 PO_AuthorisationLevels.php:151 PaymentMethods.php:208 +#: PaymentTerms.php:205 PcAssignCashToTab.php:277 +#: PcClaimExpensesFromTab.php:276 PcExpenses.php:226 PcTabs.php:236 +#: PcTypeTabs.php:180 PriceMatrix.php:287 Prices.php:253 +#: Prices_Customer.php:286 PurchData.php:312 SalesCategories.php:272 +#: SalesGLPostings.php:137 SalesGLPostings.php:253 SalesPeople.php:232 +#: SalesTypes.php:206 SecurityTokens.php:130 SelectCustomer.php:614 +#: SelectCustomer.php:633 SelectCustomer.php:663 SelectCustomer.php:681 +#: SelectCustomer.php:705 SelectCustomer.php:722 SelectGLAccount.php:117 +#: SelectGLAccount.php:132 SellThroughSupport.php:298 Shippers.php:144 +#: StockCategories.php:289 SuppTransGLAnalysis.php:125 +#: SupplierContacts.php:165 SupplierTenderCreate.php:157 SupplierTypes.php:170 +#: TaxAuthorities.php:174 TaxCategories.php:182 TaxGroups.php:188 +#: TaxProvinces.php:180 UnitsOfMeasure.php:185 WWW_Access.php:126 +#: WWW_Users.php:341 WorkCentres.php:142 includes/InputSerialItems.php:110 +#: includes/OutputSerialItems.php:20 +#: reportwriter/languages/en_US/reports.php:143 #, php-format msgid "Edit" msgstr "Editar" @@ -440,41 +446,43 @@ msgid "Are you sure you wish to delete this account group?" msgstr "¿Confirma que desea eliminar este grupo de cuenta?" -#: AccountGroups.php:326 AccountSections.php:196 AddCustomerContacts.php:149 +#: AccountGroups.php:326 AccountSections.php:197 AddCustomerContacts.php:149 #: AddCustomerNotes.php:138 AddCustomerTypeNotes.php:132 Areas.php:165 -#: BankAccounts.php:224 BOMs.php:154 COGSGLPostings.php:113 +#: BOMs.php:155 BankAccounts.php:224 COGSGLPostings.php:113 #: COGSGLPostings.php:217 ContractBOM.php:272 ContractOtherReqts.php:124 -#: CounterReturns.php:740 CounterSales.php:836 Credit_Invoice.php:403 -#: CreditStatus.php:176 Currencies.php:366 CustomerReceipt.php:988 -#: Customers.php:1165 CustomerTypes.php:207 Departments.php:187 -#: DiscountCategories.php:238 DiscountMatrix.php:183 EDIMessageFormat.php:151 -#: FixedAssetCategories.php:191 FreightCosts.php:254 GeocodeSetup.php:174 -#: GLAccounts.php:318 GLJournal.php:429 GLTags.php:97 +#: CounterReturns.php:740 CounterSales.php:836 CreditStatus.php:176 +#: Credit_Invoice.php:403 Currencies.php:365 CustItem.php:167 +#: CustomerReceipt.php:987 CustomerTypes.php:207 Customers.php:1167 +#: Departments.php:187 DiscountCategories.php:238 DiscountMatrix.php:183 +#: EDIMessageFormat.php:151 FixedAssetCategories.php:191 FreightCosts.php:254 +#: GLAccounts.php:318 GLJournal.php:430 GLTags.php:97 GeocodeSetup.php:174 #: ImportBankTransAnalysis.php:225 InternalStockCategoriesByRole.php:184 -#: InternalStockRequest.php:293 Labels.php:324 Labels.php:349 Labels.php:597 -#: Locations.php:405 MailingGroupMaintenance.php:179 MaintenanceTasks.php:119 -#: Manufacturers.php:218 MRPDemands.php:310 MRPDemandTypes.php:121 -#: PaymentMethods.php:209 Payments.php:1104 PaymentTerms.php:206 +#: InternalStockRequest.php:293 Labels.php:336 Labels.php:361 Labels.php:609 +#: Locations.php:423 MRPDemandTypes.php:121 MRPDemands.php:310 +#: MailingGroupMaintenance.php:179 MaintenanceTasks.php:119 +#: Manufacturers.php:218 PO_AuthorisationLevels.php:153 PO_Items.php:768 +#: PaymentMethods.php:209 PaymentTerms.php:206 Payments.php:1104 #: PcAssignCashToTab.php:281 PcClaimExpensesFromTab.php:277 PcExpenses.php:227 #: PcExpensesTypeTab.php:187 PcTabs.php:237 PcTypeTabs.php:181 -#: PO_AuthorisationLevels.php:153 PO_Items.php:772 PriceMatrix.php:174 -#: Prices_Customer.php:281 Prices.php:256 PurchData.php:314 PurchData.php:721 -#: SalesAnalReptCols.php:299 SalesAnalRepts.php:307 SalesCategories.php:273 -#: SalesGLPostings.php:138 SalesGLPostings.php:254 SalesPeople.php:233 -#: SalesTypes.php:207 SecurityTokens.php:131 SelectCreditItems.php:779 -#: SelectCustomer.php:615 SelectCustomer.php:634 SelectCustomer.php:664 -#: SelectCustomer.php:682 SelectCustomer.php:706 SelectCustomer.php:723 -#: SelectOrderItems.php:1440 SellThroughSupport.php:299 Shipments.php:440 -#: Shippers.php:145 SpecialOrder.php:667 StockCategories.php:290 -#: StockCategories.php:619 StockLocTransfer.php:324 SuppContractChgs.php:99 -#: SuppCreditGRNs.php:117 SuppFixedAssetChgs.php:90 SuppInvGRNs.php:147 -#: SupplierContacts.php:166 SupplierTenderCreate.php:417 -#: SupplierTenderCreate.php:447 SupplierTypes.php:191 SuppShiptChgs.php:90 -#: SuppTransGLAnalysis.php:126 TaxAuthorities.php:175 TaxCategories.php:183 -#: TaxGroups.php:189 TaxProvinces.php:181 UnitsOfMeasure.php:186 -#: WorkCentres.php:142 WOSerialNos.php:327 WWW_Access.php:127 -#: WWW_Users.php:328 includes/InputSerialItemsKeyed.php:60 +#: PriceMatrix.php:286 Prices.php:254 Prices_Customer.php:287 +#: PurchData.php:314 PurchData.php:721 RelatedItemsUpdate.php:155 +#: RelatedItemsUpdate.php:170 SalesAnalReptCols.php:299 SalesAnalRepts.php:307 +#: SalesCategories.php:273 SalesGLPostings.php:138 SalesGLPostings.php:254 +#: SalesPeople.php:233 SalesTypes.php:207 SecurityTokens.php:131 +#: SelectCreditItems.php:778 SelectCustomer.php:615 SelectCustomer.php:634 +#: SelectCustomer.php:664 SelectCustomer.php:682 SelectCustomer.php:706 +#: SelectCustomer.php:723 SelectOrderItems.php:1358 SellThroughSupport.php:299 +#: Shipments.php:440 Shippers.php:145 SpecialOrder.php:668 +#: StockCategories.php:290 StockCategories.php:619 StockLocTransfer.php:327 +#: SuppContractChgs.php:99 SuppCreditGRNs.php:117 SuppFixedAssetChgs.php:90 +#: SuppInvGRNs.php:147 SuppShiptChgs.php:90 SuppTransGLAnalysis.php:126 +#: SupplierContacts.php:166 SupplierTenderCreate.php:422 +#: SupplierTenderCreate.php:452 SupplierTypes.php:172 TaxAuthorities.php:175 +#: TaxCategories.php:183 TaxGroups.php:189 TaxProvinces.php:181 +#: UnitsOfMeasure.php:186 WOSerialNos.php:327 WWW_Access.php:127 +#: WWW_Users.php:342 WorkCentres.php:143 includes/InputSerialItemsKeyed.php:60 #: includes/OutputSerialItems.php:99 +#: reportwriter/languages/en_US/reports.php:141 #, php-format msgid "Delete" msgstr "Eliminar" @@ -537,26 +545,26 @@ "ledger accounts should display in the trial balance" msgstr "" -#: AccountGroups.php:465 AccountSections.php:263 AddCustomerContacts.php:260 +#: AccountGroups.php:465 AccountSections.php:264 AddCustomerContacts.php:260 #: AddCustomerNotes.php:242 AddCustomerTypeNotes.php:221 Areas.php:229 -#: BankAccounts.php:399 BOMs.php:802 COGSGLPostings.php:365 -#: CreditStatus.php:259 Currencies.php:513 CustLoginSetup.php:273 +#: BOMs.php:805 BankAccounts.php:399 COGSGLPostings.php:365 +#: CreditStatus.php:259 Currencies.php:522 CustLoginSetup.php:273 #: Departments.php:258 DiscountMatrix.php:142 EDIMessageFormat.php:248 #: FixedAssetCategories.php:350 FixedAssetLocations.php:161 -#: FreightCosts.php:371 GeocodeSetup.php:271 GLAccounts.php:266 Labels.php:631 -#: Locations.php:646 Manufacturers.php:312 MRPDemands.php:424 -#: MRPDemandTypes.php:188 OffersReceived.php:57 OffersReceived.php:146 -#: PaymentMethods.php:300 PaymentTerms.php:310 PO_AuthorisationLevels.php:264 -#: PriceMatrix.php:133 Prices_Customer.php:363 SalesAnalReptCols.php:552 +#: FreightCosts.php:371 GLAccounts.php:266 GeocodeSetup.php:271 Labels.php:643 +#: Locations.php:664 MRPDemandTypes.php:188 MRPDemands.php:424 +#: Manufacturers.php:312 OffersReceived.php:57 OffersReceived.php:146 +#: PO_AuthorisationLevels.php:264 PaymentMethods.php:300 PaymentTerms.php:310 +#: PriceMatrix.php:230 Prices_Customer.php:369 SalesAnalReptCols.php:552 #: SalesAnalRepts.php:519 SalesGLPostings.php:425 SalesPeople.php:373 -#: Shippers.php:203 StockCategories.php:646 SupplierContacts.php:284 -#: SuppLoginSetup.php:292 TaxAuthorities.php:329 TaxCategories.php:241 -#: TaxProvinces.php:235 UnitsOfMeasure.php:241 WorkCentres.php:280 -#: WWW_Users.php:735 +#: Shippers.php:203 StockCategories.php:646 SuppLoginSetup.php:292 +#: SupplierContacts.php:284 TaxAuthorities.php:329 TaxCategories.php:241 +#: TaxProvinces.php:235 UnitsOfMeasure.php:241 WWW_Users.php:749 +#: WorkCentres.php:283 msgid "Enter Information" msgstr "Guardar la Información" -#: AccountSections.php:7 includes/MainMenuLinksArray.php:369 +#: AccountSections.php:7 includes/MainMenuLinksArray.php:371 msgid "Account Sections" msgstr "Secciones contables" @@ -597,23 +605,23 @@ msgid "Could not get account group sections because" msgstr "No se pudo obtener las secciones del subgrupo de cuentas porque" -#: AccountSections.php:176 AccountSections.php:235 AccountSections.php:253 +#: AccountSections.php:176 AccountSections.php:236 AccountSections.php:254 msgid "Section Number" msgstr "Número de sección" -#: AccountSections.php:177 AccountSections.php:258 +#: AccountSections.php:177 AccountSections.php:259 msgid "Section Description" msgstr "Descripción de sección" -#: AccountSections.php:194 +#: AccountSections.php:195 msgid "Restricted" msgstr "Restringida" -#: AccountSections.php:205 +#: AccountSections.php:206 msgid "Review Account Sections" msgstr "Revisar Grupos Principales" -#: AccountSections.php:224 +#: AccountSections.php:225 msgid "Could not retrieve the requested section please try again." msgstr "No se pudo obtener la Sección solicitada, por favor, pruebe de nuevo." @@ -654,11 +662,11 @@ #: AddCustomerContacts.php:59 AddCustomerNotes.php:51 #: AddCustomerTypeNotes.php:48 Areas.php:72 CustomerTypes.php:69 #: DeliveryDetails.php:801 DeliveryDetails.php:818 Factors.php:105 -#: FixedAssetItems.php:250 MRPCalendar.php:176 PcAssignCashToTab.php:91 -#: PcClaimExpensesFromTab.php:82 PcExpenses.php:98 PcTabs.php:104 -#: PcTypeTabs.php:63 PO_Items.php:379 SalesAnalReptCols.php:129 -#: SalesPeople.php:97 SalesTypes.php:66 Stocks.php:561 Suppliers.php:532 -#: SupplierTypes.php:67 +#: FixedAssetItems.php:250 MRPCalendar.php:176 PO_Items.php:380 +#: PcAssignCashToTab.php:91 PcClaimExpensesFromTab.php:82 PcExpenses.php:98 +#: PcTabs.php:104 PcTypeTabs.php:63 SalesAnalReptCols.php:129 +#: SalesPeople.php:97 SalesTypes.php:66 Stocks.php:572 SupplierTypes.php:68 +#: Suppliers.php:532 msgid "has been updated" msgstr "ha sido actualizado" @@ -671,17 +679,17 @@ msgstr "El registro del contacto ha sido eliminado" #: AddCustomerContacts.php:126 CompanyPreferences.php:173 -#: CustomerBranches.php:408 Customers.php:1117 Customers.php:1125 +#: CustomerBranches.php:408 Customers.php:1119 Customers.php:1127 #: ImportBankTransAnalysis.php:207 SalesPeople.php:200 SelectCustomer.php:609 #: StockDispatch.php:275 StockDispatch.php:286 StockDispatch.php:297 -#: SupplierContacts.php:152 SuppTransGLAnalysis.php:108 -#: includes/InputSerialItemsFile.php:92 includes/InputSerialItemsFile.php:144 -#: includes/PDFTaxPageHeader.inc:37 +#: SuppTransGLAnalysis.php:108 SupplierContacts.php:152 +#: includes/PDFTaxPageHeader.inc:37 includes/InputSerialItemsFile.php:92 +#: includes/InputSerialItemsFile.php:144 msgid "Name" msgstr "Nombre" -#: AddCustomerContacts.php:127 AddCustomerContacts.php:223 Customers.php:1118 -#: Customers.php:1126 SelectCustomer.php:610 WWW_Access.php:110 +#: AddCustomerContacts.php:127 AddCustomerContacts.php:223 Customers.php:1120 +#: Customers.php:1128 SelectCustomer.php:610 WWW_Access.php:110 #: WWW_Access.php:173 msgid "Role" msgstr "Perfil" @@ -692,28 +700,29 @@ #: AddCustomerContacts.php:129 AddCustomerContacts.php:241 #: CustomerBranches.php:414 CustomerBranches.php:849 CustomerInquiry.php:278 -#: Customers.php:1120 Customers.php:1128 EmailCustTrans.php:15 -#: EmailCustTrans.php:64 Factors.php:246 Factors.php:297 Locations.php:598 -#: OrderDetails.php:115 PDFRemittanceAdvice.php:251 PO_PDFPurchOrder.php:395 -#: PO_PDFPurchOrder.php:398 PrintCustTrans.php:746 PrintCustTrans.php:977 -#: PrintCustTrans.php:1026 PrintCustTransPortrait.php:789 -#: PrintCustTransPortrait.php:1035 PrintCustTransPortrait.php:1091 -#: SelectCustomer.php:427 SelectCustomer.php:612 SelectSupplier.php:288 -#: SupplierContacts.php:156 SupplierContacts.php:277 UserSettings.php:184 -#: WWW_Users.php:283 includes/PDFPickingListHeader.inc:25 -#: includes/PDFStatementPageHeader.inc:67 includes/PDFTransPageHeader.inc:82 -#: includes/PDFTransPageHeaderPortrait.inc:111 -#: includes/PO_PDFOrderPageHeader.inc:29 ../webSHOP/Checkout.php:420 -#: ../webSHOP/Register.php:607 +#: Customers.php:1122 Customers.php:1130 EmailCustTrans.php:15 +#: EmailCustTrans.php:64 Factors.php:246 Factors.php:297 Locations.php:616 +#: OrderDetails.php:115 PDFRemittanceAdvice.php:251 PDFWOPrint.php:592 +#: PDFWOPrint.php:595 PDFWOPrint.php:675 PDFWOPrint.php:678 +#: PO_PDFPurchOrder.php:400 PO_PDFPurchOrder.php:403 PrintCustTrans.php:750 +#: PrintCustTrans.php:981 PrintCustTrans.php:1030 +#: PrintCustTransPortrait.php:793 PrintCustTransPortrait.php:1039 +#: PrintCustTransPortrait.php:1095 SelectCustomer.php:427 +#: SelectCustomer.php:612 SelectSupplier.php:288 SupplierContacts.php:156 +#: SupplierContacts.php:277 UserSettings.php:184 WWW_Users.php:297 +#: includes/PDFPickingListHeader.inc:25 includes/PDFStatementPageHeader.inc:67 +#: includes/PDFTransPageHeader.inc:82 +#: includes/PDFTransPageHeaderPortrait.inc:111 includes/PDFWOPageHeader.inc:19 +#: includes/PO_PDFOrderPageHeader.inc:29 msgid "Email" msgstr "Correo-e" -#: AddCustomerContacts.php:130 AddCustomerContacts.php:250 Customers.php:1121 -#: Customers.php:1129 PcAssignCashToTab.php:242 PcAssignCashToTab.php:380 -#: PcAuthorizeExpenses.php:97 PcClaimExpensesFromTab.php:238 -#: PcClaimExpensesFromTab.php:405 PcReportTab.php:336 PDFQuotation.php:248 -#: SelectCustomer.php:613 ShopParameters.php:198 SystemParameters.php:363 -#: WOSerialNos.php:298 WOSerialNos.php:304 +#: AddCustomerContacts.php:130 AddCustomerContacts.php:250 Customers.php:1123 +#: Customers.php:1131 PDFQuotation.php:249 PcAssignCashToTab.php:242 +#: PcAssignCashToTab.php:380 PcAuthorizeExpenses.php:97 +#: PcClaimExpensesFromTab.php:238 PcClaimExpensesFromTab.php:405 +#: PcReportTab.php:336 SelectCustomer.php:613 ShopParameters.php:198 +#: SystemParameters.php:363 WOSerialNos.php:298 WOSerialNos.php:304 msgid "Notes" msgstr "Descripción" @@ -731,17 +740,15 @@ msgstr "Código del contacto" #: AddCustomerContacts.php:214 Factors.php:234 SupplierContacts.php:239 -#: ../webSHOP/Checkout.php:504 ../webSHOP/Register.php:622 msgid "Contact Name" msgstr "Nombre del contacto" #: AddCustomerContacts.php:232 Contracts.php:781 PDFRemittanceAdvice.php:247 -#: PO_Header.php:1017 PO_Header.php:1102 SelectCreditItems.php:245 -#: SelectCustomer.php:425 SelectOrderItems.php:639 -#: SupplierTenderCreate.php:390 includes/PDFStatementPageHeader.inc:63 +#: PO_Header.php:1022 PO_Header.php:1107 SelectCreditItems.php:245 +#: SelectCustomer.php:425 SelectOrderItems.php:596 +#: SupplierTenderCreate.php:395 includes/PDFStatementPageHeader.inc:63 #: includes/PDFTransPageHeader.inc:81 -#: includes/PDFTransPageHeaderPortrait.inc:107 ../webSHOP/Checkout.php:514 -#: ../webSHOP/Register.php:260 ../webSHOP/Register.php:735 +#: includes/PDFTransPageHeaderPortrait.inc:107 msgid "Phone" msgstr "Teléfono" @@ -780,31 +787,33 @@ #: AddCustomerNotes.php:117 AddCustomerNotes.php:222 #: AddCustomerTypeNotes.php:111 AddCustomerTypeNotes.php:211 -#: BankMatching.php:282 BankReconciliation.php:217 BankReconciliation.php:294 -#: ContractCosting.php:177 CustomerAllocations.php:350 -#: CustomerAllocations.php:380 CustomerInquiry.php:221 +#: AgedControlledInventory.php:47 BankMatching.php:282 +#: BankReconciliation.php:217 BankReconciliation.php:294 +#: ContractCosting.php:177 CustomerAllocations.php:348 +#: CustomerAllocations.php:378 CustomerInquiry.php:221 #: CustomerTransInquiry.php:106 GLAccountInquiry.php:174 #: GLAccountReport.php:343 GLTransInquiry.php:42 MRPCalendar.php:219 -#: PaymentAllocations.php:66 PcAssignCashToTab.php:238 -#: PcAuthorizeExpenses.php:93 PDFRemittanceAdvice.php:308 -#: PrintCustTrans.php:854 PrintCustTransPortrait.php:903 ReverseGRN.php:392 -#: SelectCustomer.php:659 SelectCustomer.php:701 ShipmentCosting.php:538 -#: ShipmentCosting.php:615 Shipments.php:491 StockDispatch.php:277 -#: StockDispatch.php:288 StockDispatch.php:299 StockLocMovements.php:91 -#: StockMovements.php:98 StockSerialItemResearch.php:81 -#: SupplierAllocations.php:456 SupplierAllocations.php:569 -#: SupplierAllocations.php:644 SupplierInquiry.php:212 -#: SupplierTransInquiry.php:105 includes/PDFQuotationPageHeader.inc:19 +#: PDFRemittanceAdvice.php:308 PaymentAllocations.php:66 +#: PcAssignCashToTab.php:238 PcAuthorizeExpenses.php:93 PrintCustTrans.php:858 +#: PrintCustTransPortrait.php:907 ReverseGRN.php:396 SelectCustomer.php:659 +#: SelectCustomer.php:701 ShipmentCosting.php:538 ShipmentCosting.php:615 +#: Shipments.php:491 StockDispatch.php:277 StockDispatch.php:288 +#: StockDispatch.php:299 StockLocMovements.php:92 StockMovements.php:99 +#: StockSerialItemResearch.php:82 SupplierAllocations.php:456 +#: SupplierAllocations.php:569 SupplierAllocations.php:644 +#: SupplierInquiry.php:212 SupplierTransInquiry.php:105 +#: includes/PDFQuotationPageHeader.inc:19 #: includes/PDFQuotationPortraitPageHeader.inc:88 #: includes/PDFStatementPageHeader.inc:169 includes/PDFTaxPageHeader.inc:36 #: includes/PDFTransPageHeader.inc:48 #: includes/PDFTransPageHeaderPortrait.inc:60 +#: reportwriter/languages/en_US/reports.php:64 msgid "Date" msgstr "Fecha" #: AddCustomerNotes.php:118 AddCustomerTypeNotes.php:112 PcReportTab.php:181 -#: SelectCustomer.php:660 SelectCustomer.php:702 StockClone.php:921 -#: Stocks.php:1208 UpgradeDatabase.php:233 UpgradeDatabase.php:236 +#: SelectCustomer.php:660 SelectCustomer.php:702 StockClone.php:911 +#: Stocks.php:1220 UpgradeDatabase.php:233 UpgradeDatabase.php:236 #: UpgradeDatabase.php:239 UpgradeDatabase.php:242 UpgradeDatabase.php:245 #: UpgradeDatabase.php:248 UpgradeDatabase.php:251 UpgradeDatabase.php:254 #: UpgradeDatabase.php:257 Z_Upgrade_3.10-3.11.php:62 @@ -891,6 +900,141 @@ msgid "Web site" msgstr "Sitio web" +#: AgedControlledInventory.php:8 +msgid "Aged Controlled Inventory" +msgstr "" + +#: AgedControlledInventory.php:8 +msgid "as-of" +msgstr "" + +#: AgedControlledInventory.php:12 InventoryQuantities.php:155 +#: InventoryValuation.php:228 Locations.php:394 Locations.php:455 MRP.php:530 +#: MRPCalendar.php:21 MRPCreateDemands.php:195 MRPDemandTypes.php:17 +#: MRPDemands.php:27 MRPPlannedPurchaseOrders.php:265 +#: MRPPlannedWorkOrders.php:247 MRPPlannedWorkOrders.php:321 +#: PricesByCost.php:8 ReorderLevel.php:194 ReorderLevelLocation.php:12 +#: SelectProduct.php:87 StockDispatch.php:319 StockMovements.php:22 +#: StockQties_csv.php:8 StockQuantityByDate.php:10 StockReorderLevel.php:20 +#: StockSerialItemResearch.php:9 StockSerialItems.php:9 StockStatus.php:45 +#: StockTransferControlled.php:14 SuppLoginSetup.php:24 WWW_Users.php:16 +#: includes/MainMenuLinksArray.php:26 +#: reportwriter/languages/en_US/reports.php:243 +msgid "Inventory" +msgstr "Inventario" + +#: AgedControlledInventory.php:32 +msgid "The stock held could not be retrieved because" +msgstr "" + +#: AgedControlledInventory.php:42 MRPReschedules.php:126 MRPShortages.php:261 +#: StockClone.php:53 Stocks.php:63 +#: reportwriter/languages/en_US/reports.php:103 +msgid "Stock" +msgstr "Existencia" + +#: AgedControlledInventory.php:43 BOMIndented.php:314 +#: BOMIndentedReverse.php:293 BOMInquiry.php:109 BOMInquiry.php:200 +#: BOMs.php:562 BOMs.php:901 ContractBOM.php:242 ContractBOM.php:354 +#: ContractOtherReqts.php:98 CounterReturns.php:1686 CounterSales.php:2113 +#: CounterSales.php:2294 CreditStatus.php:152 CreditStatus.php:243 +#: CustomerPurchases.php:75 EmailConfirmation.php:218 +#: EmailConfirmation.php:348 FixedAssetCategories.php:167 +#: FixedAssetDepreciation.php:91 FixedAssetRegister.php:87 +#: FixedAssetRegister.php:388 FixedAssetTransfer.php:60 +#: FixedAssetTransfer.php:162 GLTags.php:63 GLTags.php:82 +#: GLTransInquiry.php:47 GoodsReceived.php:101 +#: InternalStockCategoriesByRole.php:168 InternalStockRequest.php:344 +#: InternalStockRequest.php:558 InternalStockRequest.php:628 +#: InventoryQuantities.php:246 InventoryValuation.php:205 Labels.php:292 +#: MRPDemandTypes.php:113 MRPDemands.php:92 MRPDemands.php:295 +#: MRPPlannedWorkOrders.php:258 MRPReport.php:536 MRPReport.php:750 +#: MRPReschedules.php:192 MRPShortages.php:350 MaintenanceTasks.php:95 +#: MaintenanceUserSchedule.php:50 MaterialsNotUsed.php:35 NoSalesItems.php:187 +#: PDFOrderStatus.php:333 PDFOrdersInvoiced.php:332 PO_Items.php:716 +#: PO_Items.php:1188 PO_SelectOSPurchOrder.php:257 PO_SelectPurchOrder.php:214 +#: PaymentTerms.php:182 PcExpenses.php:190 PcExpenses.php:296 +#: PcExpensesTypeTab.php:171 PcReportTab.php:179 PcTypeTabs.php:164 +#: PricesByCost.php:153 RelatedItemsUpdate.php:154 ReorderLevel.php:298 +#: ReorderLevelLocation.php:73 ReverseGRN.php:395 SalesCategories.php:509 +#: SecurityTokens.php:94 SecurityTokens.php:103 SecurityTokens.php:120 +#: SelectAsset.php:264 SelectCompletedOrder.php:505 SelectContract.php:144 +#: SelectCreditItems.php:1021 SelectOrderItems.php:1453 +#: SelectOrderItems.php:1643 SelectProduct.php:554 SelectProduct.php:780 +#: SelectSalesOrder.php:556 SelectWorkOrder.php:215 Shipt_Select.php:191 +#: StockClone.php:665 StockCounts.php:142 StockDispatch.php:504 +#: StockLocStatus.php:173 StockQuantityByDate.php:109 Stocks.php:988 +#: SuppCreditGRNs.php:92 SuppCreditGRNs.php:192 SuppFixedAssetChgs.php:78 +#: SuppInvGRNs.php:120 SuppInvGRNs.php:257 SuppPriceList.php:309 +#: SupplierCredit.php:317 SupplierCredit.php:385 SupplierInvoice.php:664 +#: SupplierInvoice.php:744 SupplierPriceList.php:39 SupplierPriceList.php:271 +#: SupplierPriceList.php:533 SupplierTenderCreate.php:434 +#: SupplierTenderCreate.php:695 SupplierTenderCreate.php:853 +#: SupplierTenders.php:326 SupplierTenders.php:421 SupplierTenders.php:687 +#: TaxAuthorities.php:147 TopItems.php:167 WorkCentres.php:128 +#: WorkOrderCosting.php:100 WorkOrderCosting.php:132 WorkOrderEntry.php:733 +#: WorkOrderIssue.php:755 Z_ItemsWithoutPicture.php:33 +#: api/api_xml-rpc.php:3489 includes/PDFGrnHeader.inc:29 +#: includes/PDFInventoryPlanPageHeader.inc:51 +#: includes/PDFOstdgGRNsPageHeader.inc:38 +#: includes/PDFStockLocTransferHeader.inc:65 +#: includes/PDFStockTransferHeader.inc:36 includes/PDFTopItemsHeader.inc:50 +#: includes/PDFTransPageHeader.inc:208 +#: includes/PDFTransPageHeaderPortrait.inc:265 +#: includes/DefineLabelClass.php:12 includes/DefineLabelClass.php:45 +msgid "Description" +msgstr "Descripción" + +#: AgedControlledInventory.php:44 PDFBankingSummary.php:39 +msgid "Batch" +msgstr "Lote" + +#: AgedControlledInventory.php:45 +msgid "Quantity Remaining" +msgstr "" + +#: AgedControlledInventory.php:46 +msgid "Inventory Value" +msgstr "" + +#: AgedControlledInventory.php:48 +msgid "Days Old" +msgstr "" + +#: AgedControlledInventory.php:91 ConfirmDispatch_Invoice.php:304 +#: ConfirmDispatch_Invoice.php:308 CounterReturns.php:676 +#: CounterReturns.php:756 CounterSales.php:759 CounterSales.php:853 +#: CounterSales.php:855 Credit_Invoice.php:297 Credit_Invoice.php:301 +#: CustomerAllocations.php:349 CustomerAllocations.php:379 +#: CustomerInquiry.php:226 DeliveryDetails.php:876 DeliveryDetails.php:945 +#: GLBalanceSheet.php:191 GLBalanceSheet.php:203 GLBalanceSheet.php:293 +#: GLBalanceSheet.php:302 GLBudgets.php:213 GLJournal.php:435 +#: GLTransInquiry.php:189 GLTrialBalance.php:225 GLTrialBalance.php:245 +#: GLTrialBalance.php:266 GLTrialBalance.php:362 GLTrialBalance.php:495 +#: GLTrialBalance.php:515 GLTrialBalance.php:539 GLTrialBalance.php:651 +#: GLTrialBalance.php:671 GLTrialBalance.php:695 InventoryValuation.php:205 +#: MaterialsNotUsed.php:77 OffersReceived.php:111 OrderDetails.php:174 +#: OutstandingGRNs.php:243 PDFCustTransListing.php:137 +#: PDFOrdersInvoiced.php:376 PDFRemittanceAdvice.php:310 +#: PDFSuppTransListing.php:131 RecurringSalesOrders.php:335 +#: SalesByTypePeriodInquiry.php:395 SalesByTypePeriodInquiry.php:430 +#: SalesByTypePeriodInquiry.php:465 SalesByTypePeriodInquiry.php:500 +#: SalesByTypePeriodInquiry.php:561 SelectCreditItems.php:692 +#: SelectCreditItems.php:696 SelectOrderItems.php:1300 +#: SuppContractChgs.php:107 SuppFixedAssetChgs.php:97 SuppShiptChgs.php:97 +#: SuppTransGLAnalysis.php:139 SupplierAllocations.php:458 +#: SupplierAllocations.php:570 SupplierAllocations.php:645 +#: SupplierCredit.php:407 SupplierInquiry.php:213 +#: Z_CheckDebtorsControl.php:149 api/api_debtortransactions.php:1271 +#: api/api_debtortransactions.php:1284 api/api_debtortransactions.php:1581 +#: includes/PDFQuotationPageHeader.inc:89 +#: includes/PDFQuotationPortraitPageHeader.inc:104 +#: includes/PO_PDFOrderPageHeader.inc:81 +#: reportwriter/languages/en_US/reports.php:107 +#, php-format +msgid "Total" +msgstr "Total" + #: AgedDebtors.php:14 msgid "Aged Customer Balance Listing" msgstr "Consulta de saldos de cuentas por cobrar por vencimiento" @@ -904,142 +1048,144 @@ msgstr "Análisis de saldos de cuentas por cobrar por vencimiento" #: AgedDebtors.php:267 AgedDebtors.php:369 AgedDebtors.php:434 -#: AgedSuppliers.php:108 BOMExtendedQty.php:154 BOMIndented.php:150 -#: BOMIndentedReverse.php:140 BOMListing.php:41 BOMListing.php:52 +#: AgedSuppliers.php:108 BOMExtendedQty.php:154 BOMIndented.php:152 +#: BOMIndentedReverse.php:140 BOMListing.php:42 BOMListing.php:53 #: DebtorsAtPeriodEnd.php:57 DebtorsAtPeriodEnd.php:69 GLBalanceSheet.php:108 #: GLBalanceSheet.php:147 GLProfit_Loss.php:185 GLTagProfit_Loss.php:194 #: GLTrialBalance.php:163 InternalStockRequest.php:319 #: InventoryPlanning.php:101 InventoryPlanning.php:176 -#: InventoryPlanning.php:211 InventoryPlanning.php:259 -#: InventoryPlanning.php:299 InventoryPlanningPrefSupplier.php:201 +#: InventoryPlanning.php:211 InventoryPlanning.php:258 +#: InventoryPlanning.php:298 InventoryPlanningPrefSupplier.php:201 #: InventoryPlanningPrefSupplier.php:269 InventoryPlanningPrefSupplier.php:303 #: InventoryPlanningPrefSupplier.php:348 InventoryPlanningPrefSupplier.php:396 #: InventoryQuantities.php:84 InventoryValuation.php:68 -#: MailInventoryValuation.php:21 MailInventoryValuation.php:119 -#: MailSalesReport_csv.php:30 MailSalesReport.php:23 #: MRPPlannedPurchaseOrders.php:114 MRPPlannedWorkOrders.php:106 #: MRPReport.php:147 MRPReport.php:508 MRPReschedules.php:45 #: MRPReschedules.php:57 MRPShortages.php:155 MRPShortages.php:167 -#: OutstandingGRNs.php:46 OutstandingGRNs.php:59 PDFCustomerList.php:20 -#: PDFCustomerList.php:232 PDFCustomerList.php:244 PDFLowGP.php:20 -#: PDFSellThroughSupportClaim.php:17 PDFStockCheckComparison.php:33 -#: PDFStockCheckComparison.php:59 PDFStockCheckComparison.php:261 -#: PurchaseByPrefSupplier.php:399 PurchaseByPrefSupplier.php:447 -#: PurchaseByPrefSupplier.php:471 PurchaseByPrefSupplier.php:500 -#: PurchaseByPrefSupplier.php:531 ReorderLevel.php:60 SelectAsset.php:39 -#: SelectProduct.php:43 StockCheck.php:65 StockCheck.php:139 -#: SupplierTenderCreate.php:666 SupplierTenders.php:397 SuppPriceList.php:138 +#: MailInventoryValuation.php:21 MailInventoryValuation.php:119 +#: MailSalesReport.php:23 MailSalesReport_csv.php:30 OutstandingGRNs.php:46 +#: OutstandingGRNs.php:59 PDFCustomerList.php:20 PDFCustomerList.php:232 +#: PDFCustomerList.php:244 PDFLowGP.php:20 PDFSellThroughSupportClaim.php:17 +#: PDFStockCheckComparison.php:33 PDFStockCheckComparison.php:59 +#: PDFStockCheckComparison.php:265 PurchaseByPrefSupplier.php:399 +#: PurchaseByPrefSupplier.php:447 PurchaseByPrefSupplier.php:471 +#: PurchaseByPrefSupplier.php:500 PurchaseByPrefSupplier.php:531 +#: ReorderLevel.php:60 SelectAsset.php:39 SelectProduct.php:43 +#: StockCheck.php:65 StockCheck.php:139 SuppPriceList.php:138 +#: SupplierTenderCreate.php:671 SupplierTenders.php:397 #: includes/PDFPaymentRun_PymtFooter.php:152 msgid "Problem Report" msgstr "Informe de problemas" #: AgedDebtors.php:269 CustomerInquiry.php:94 CustomerInquiry.php:119 -#: CustomerPurchases.php:25 DebtorsAtPeriodEnd.php:59 +#: CustomerPurchases.php:25 Dashboard.php:143 DebtorsAtPeriodEnd.php:59 msgid "The customer details could not be retrieved by the SQL because" msgstr "No se pudo obtener mediante SQL el detalle del cliente porque" #: AgedDebtors.php:270 AgedDebtors.php:372 AgedDebtors.php:437 #: AgedSuppliers.php:111 AgedSuppliers.php:198 BOMExtendedQty.php:157 -#: BOMExtendedQty.php:240 BOMIndented.php:153 BOMIndented.php:234 -#: BOMIndentedReverse.php:144 BOMIndentedReverse.php:221 BOMListing.php:44 -#: Credit_Invoice.php:200 DebtorsAtPeriodEnd.php:60 DebtorsAtPeriodEnd.php:72 -#: FTP_RadioBeacon.php:187 GetStockImage.php:150 GLBalanceSheet.php:112 -#: GLBalanceSheet.php:150 GLBalanceSheet.php:329 GLProfit_Loss.php:188 -#: GLProfit_Loss.php:200 GLTagProfit_Loss.php:198 GLTagProfit_Loss.php:211 -#: GLTrialBalance.php:168 GLTrialBalance.php:182 InventoryPlanning.php:104 +#: BOMExtendedQty.php:244 BOMIndented.php:155 BOMIndented.php:236 +#: BOMIndentedReverse.php:144 BOMIndentedReverse.php:222 BOMListing.php:45 +#: Credit_Invoice.php:200 Dashboard.php:144 Dashboard.php:255 +#: Dashboard.php:426 DebtorsAtPeriodEnd.php:60 DebtorsAtPeriodEnd.php:72 +#: FTP_RadioBeacon.php:187 GLBalanceSheet.php:112 GLBalanceSheet.php:150 +#: GLBalanceSheet.php:329 GLProfit_Loss.php:188 GLProfit_Loss.php:200 +#: GLTagProfit_Loss.php:198 GLTagProfit_Loss.php:211 GLTrialBalance.php:168 +#: GLTrialBalance.php:182 GetStockImage.php:150 InventoryPlanning.php:104 #: InventoryPlanning.php:179 InventoryPlanning.php:214 -#: InventoryPlanning.php:262 InventoryPlanning.php:302 -#: InventoryPlanning.php:365 InventoryPlanningPrefSupplier.php:204 +#: InventoryPlanning.php:261 InventoryPlanning.php:301 +#: InventoryPlanning.php:364 InventoryPlanningPrefSupplier.php:204 #: InventoryPlanningPrefSupplier.php:272 InventoryPlanningPrefSupplier.php:306 #: InventoryPlanningPrefSupplier.php:351 InventoryPlanningPrefSupplier.php:399 #: InventoryPlanningPrefSupplier.php:455 InventoryQuantities.php:87 #: InventoryQuantities.php:98 InventoryValuation.php:71 -#: InventoryValuation.php:100 MailInventoryValuation.php:122 -#: MailInventoryValuation.php:218 MailInventoryValuation.php:242 -#: MailInventoryValuation.php:250 MRPPlannedPurchaseOrders.php:117 +#: InventoryValuation.php:100 MRPPlannedPurchaseOrders.php:117 #: MRPPlannedPurchaseOrders.php:128 MRPPlannedWorkOrders.php:109 #: MRPPlannedWorkOrders.php:120 MRPPlannedWorkOrders.php:311 MRPReport.php:39 #: MRPReport.php:50 MRPReport.php:150 MRPReschedules.php:48 #: MRPReschedules.php:60 MRPShortages.php:158 MRPShortages.php:170 +#: MailInventoryValuation.php:122 MailInventoryValuation.php:218 +#: MailInventoryValuation.php:242 MailInventoryValuation.php:250 #: OutstandingGRNs.php:49 OutstandingGRNs.php:62 PDFCustomerList.php:235 -#: PDFCustomerList.php:247 PDFGLJournal.php:100 PDFGrn.php:179 PDFLowGP.php:59 -#: PDFLowGP.php:71 PDFPriceList.php:128 PDFPrintLabel.php:46 -#: PDFQuotation.php:269 PDFQuotationPortrait.php:273 -#: PDFRemittanceAdvice.php:83 PDFSellThroughSupportClaim.php:74 -#: PDFSellThroughSupportClaim.php:86 PDFStockCheckComparison.php:37 -#: PDFStockCheckComparison.php:63 PDFStockCheckComparison.php:265 -#: PO_PDFPurchOrder.php:31 PO_PDFPurchOrder.php:155 -#: PrintCustOrder_generic.php:253 PrintCustOrder.php:237 -#: PurchaseByPrefSupplier.php:402 PurchaseByPrefSupplier.php:450 -#: PurchaseByPrefSupplier.php:474 PurchaseByPrefSupplier.php:503 -#: PurchaseByPrefSupplier.php:534 ReorderLevel.php:63 ReorderLevel.php:182 -#: SalesAnalysis_UserDefined.php:28 SelectCreditItems.php:32 StockCheck.php:46 -#: StockCheck.php:68 StockCheck.php:99 StockCheck.php:142 StockCheck.php:153 -#: StockCheck.php:195 StockDispatch.php:128 StockDispatch.php:141 -#: SupplierBalsAtPeriodEnd.php:54 SupplierBalsAtPeriodEnd.php:65 -#: SuppPaymentRun.php:112 SuppPaymentRun.php:122 SuppPaymentRun.php:186 -#: SuppPaymentRun.php:217 SuppPriceList.php:142 Tax.php:63 Tax.php:168 -#: Tax.php:277 Z_DataExport.php:72 Z_DataExport.php:168 Z_DataExport.php:259 +#: PDFCustomerList.php:247 PDFFGLabel.php:217 PDFGLJournal.php:100 +#: PDFGrn.php:176 PDFLowGP.php:59 PDFLowGP.php:71 PDFPriceList.php:143 +#: PDFPrintLabel.php:45 PDFQALabel.php:116 PDFQuotation.php:270 +#: PDFQuotationPortrait.php:274 PDFRemittanceAdvice.php:83 +#: PDFSellThroughSupportClaim.php:74 PDFSellThroughSupportClaim.php:86 +#: PDFStockCheckComparison.php:37 PDFStockCheckComparison.php:63 +#: PDFStockCheckComparison.php:269 PDFWOPrint.php:109 PO_PDFPurchOrder.php:31 +#: PO_PDFPurchOrder.php:156 PrintCustOrder.php:237 +#: PrintCustOrder_generic.php:254 PurchaseByPrefSupplier.php:402 +#: PurchaseByPrefSupplier.php:450 PurchaseByPrefSupplier.php:474 +#: PurchaseByPrefSupplier.php:503 PurchaseByPrefSupplier.php:534 +#: ReorderLevel.php:63 ReorderLevel.php:182 SalesAnalysis_UserDefined.php:28 +#: SelectCreditItems.php:32 StockCheck.php:46 StockCheck.php:68 +#: StockCheck.php:99 StockCheck.php:142 StockCheck.php:153 StockCheck.php:195 +#: StockDispatch.php:128 StockDispatch.php:141 SuppPaymentRun.php:112 +#: SuppPaymentRun.php:122 SuppPaymentRun.php:186 SuppPaymentRun.php:217 +#: SuppPriceList.php:142 SupplierBalsAtPeriodEnd.php:54 +#: SupplierBalsAtPeriodEnd.php:65 Tax.php:64 Tax.php:169 Tax.php:278 +#: Z_DataExport.php:72 Z_DataExport.php:168 Z_DataExport.php:259 #: Z_DataExport.php:308 Z_DataExport.php:347 Z_DataExport.php:383 -#: Z_DataExport.php:419 Z_DataExport.php:471 Z_poRebuildDefault.php:38 +#: Z_DataExport.php:419 Z_DataExport.php:471 Z_poRebuildDefault.php:41 +#: includes/ConstructSQLForUserDefinedSalesReport.inc:180 +#: includes/ConstructSQLForUserDefinedSalesReport.inc:188 +#: includes/ConstructSQLForUserDefinedSalesReport.inc:343 #: includes/PDFPaymentRun_PymtFooter.php:59 #: includes/PDFPaymentRun_PymtFooter.php:89 #: includes/PDFPaymentRun_PymtFooter.php:119 #: includes/PDFPaymentRun_PymtFooter.php:156 #: includes/PDFPaymentRun_PymtFooter.php:187 #: includes/PDFPaymentRun_PymtFooter.php:218 -#: includes/ConstructSQLForUserDefinedSalesReport.inc:180 -#: includes/ConstructSQLForUserDefinedSalesReport.inc:188 -#: includes/ConstructSQLForUserDefinedSalesReport.inc:343 msgid "Back to the menu" msgstr "Volver al menú" -#: AgedDebtors.php:371 +#: AgedDebtors.php:371 Dashboard.php:254 msgid "The details... [truncated message content] |
From: <aga...@us...> - 2014-08-13 18:15:00
|
Revision: 6812 http://sourceforge.net/p/web-erp/reponame/6812 Author: agaluski Date: 2014-08-13 18:14:57 +0000 (Wed, 13 Aug 2014) Log Message: ----------- Add Location Based security. Fix issues with PDFDIFOT.php where some queries said '<' and 1 used '>=' Changed all to '>=' so report would show the late deliveries Modified Paths: -------------- trunk/ConfirmDispatch_Invoice.php trunk/Contracts.php trunk/Credit_Invoice.php trunk/CustomerBranches.php trunk/CustomerPurchases.php trunk/DeliveryDetails.php trunk/EmailConfirmation.php trunk/FreightCosts.php trunk/InternalStockRequest.php trunk/InternalStockRequestAuthorisation.php trunk/InternalStockRequestFulfill.php trunk/InventoryPlanning.php trunk/InventoryPlanningPrefSupplier.php trunk/InventoryValuation.php trunk/MRPCreateDemands.php trunk/NoSalesItems.php trunk/PDFDIFOT.php trunk/PDFDeliveryDifferences.php trunk/PDFOrderStatus.php trunk/PDFOrdersInvoiced.php trunk/PDFPeriodStockTransListing.php trunk/PDFStockTransfer.php trunk/PO_Header.php trunk/PO_OrderDetails.php trunk/PO_SelectOSPurchOrder.php trunk/PO_SelectPurchOrder.php trunk/PrintCustOrder.php trunk/SelectContract.php trunk/SelectCreditItems.php trunk/SelectOrderItems.php trunk/includes/Contract_Readin.php Modified: trunk/ConfirmDispatch_Invoice.php =================================================================== --- trunk/ConfirmDispatch_Invoice.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/ConfirmDispatch_Invoice.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -83,6 +83,7 @@ ON debtorsmaster.currcode = currencies.currabrev INNER JOIN locations ON locations.loccode=salesorders.fromstkloc + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE salesorders.orderno = '" . $_GET['OrderNumber']."'"; if ($_SESSION['SalesmanLogin'] != '') { Modified: trunk/Contracts.php =================================================================== --- trunk/Contracts.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/Contracts.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -867,7 +867,7 @@ echo '</select><a target="_blank" href="'. $RootPath . '/StockCategories.php">' . _('Add or Modify Contract Categories') . '</a></td></tr>'; - $sql = "SELECT loccode, locationname FROM locations"; + $sql = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $ErrMsg = _('The stock locations could not be retrieved because'); $DbgMsg = _('The SQL used to retrieve stock locations and failed was'); $result = DB_query($sql,$db,$ErrMsg,$DbgMsg); @@ -884,7 +884,7 @@ } echo '</select></td></tr>'; - $sql = "SELECT code, description FROM workcentres"; + $sql = "SELECT code, description FROM workcentres INNER JOIN locationusers ON locationusers.loccode=workcentres.location AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $result = DB_query($sql,$db); if (DB_num_rows($result)==0){ Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/Credit_Invoice.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -71,6 +71,7 @@ AND stockmoves.type=debtortrans.type INNER JOIN locations ON stockmoves.loccode = locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE debtortrans.transno = '" . intval($_GET['InvoiceNumber']) . "' AND stockmoves.type=10"; @@ -1520,7 +1521,7 @@ <td>' . _('Goods returned to location') . '</td> <td><select tabindex="'.$j.'" name="Location">'; - $SQL="SELECT loccode, locationname FROM locations"; + $SQL="SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $Result = DB_query($SQL,$db); if (!isset($_POST['Location'])){ Modified: trunk/CustomerBranches.php =================================================================== --- trunk/CustomerBranches.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/CustomerBranches.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -799,7 +799,7 @@ </tr>'; DB_data_seek($result,0); - $SQL = "SELECT loccode, locationname FROM locations"; + $SQL = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $result = DB_query($SQL,$db); if (DB_num_rows($result)==0){ Modified: trunk/CustomerPurchases.php =================================================================== --- trunk/CustomerPurchases.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/CustomerPurchases.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -47,7 +47,8 @@ INNER JOIN systypes ON stockmoves.type=systypes.typeid INNER JOIN locations - ON stockmoves.loccode=locations.loccode"; + ON stockmoves.loccode=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $SQLWhere=" WHERE stockmoves.debtorno='" . $DebtorNo . "'"; Modified: trunk/DeliveryDetails.php =================================================================== --- trunk/DeliveryDetails.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/DeliveryDetails.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -1008,8 +1008,8 @@ $ErrMsg = _('The stock locations could not be retrieved'); $DbgMsg = _('SQL used to retrieve the stock locations was') . ':'; -$StkLocsResult = DB_query("SELECT locationname,loccode - FROM locations",$db, $ErrMsg, $DbgMsg); +$StkLocsResult = DB_query("SELECT locationname,locations.loccode + FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1",$db, $ErrMsg, $DbgMsg); while ($myrow=DB_fetch_array($StkLocsResult)){ if ($_SESSION['Items'.$identifier]->Location==$myrow['loccode']){ Modified: trunk/EmailConfirmation.php =================================================================== --- trunk/EmailConfirmation.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/EmailConfirmation.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -66,7 +66,8 @@ salesorders.datepackingslipprinted, locations.locationname, salesorders.deliverydate - FROM salesorders, + FROM salesorders + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1, debtorsmaster, shippers, locations Modified: trunk/FreightCosts.php =================================================================== --- trunk/FreightCosts.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/FreightCosts.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -46,9 +46,9 @@ <td>' . _('Select the warehouse') . ' (' . _('ship from location') . ')</td> <td><select name="LocationFrom">'; - $sql = "SELECT loccode, + $sql = "SELECT locations.loccode, locationname - FROM locations"; + FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $LocationResults = DB_query($sql,$db); while ($myrow = DB_fetch_array($LocationResults)){ Modified: trunk/InternalStockRequest.php =================================================================== --- trunk/InternalStockRequest.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/InternalStockRequest.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -215,9 +215,10 @@ </tr> <tr> <td>' . _('Location from which to request stock') . ':</td>'; -$sql="SELECT loccode, +$sql="SELECT locations.loccode, locationname FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE internalrequest = 1 ORDER BY locationname"; Modified: trunk/InternalStockRequestAuthorisation.php =================================================================== --- trunk/InternalStockRequestAuthorisation.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/InternalStockRequestAuthorisation.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -52,6 +52,7 @@ ON stockrequest.departmentid=departments.departmentid INNER JOIN locations ON stockrequest.loccode=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 INNER JOIN www_users ON www_users.userid=departments.authoriser WHERE stockrequest.authorised=0 Modified: trunk/InternalStockRequestFulfill.php =================================================================== --- trunk/InternalStockRequestFulfill.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/InternalStockRequestFulfill.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -217,8 +217,9 @@ <tr> <td>' . _('Choose a location to issue requests from') . '</td> <td><select name="Location">'; - $sql = "SELECT loccode, locationname + $sql = "SELECT locations.loccode, locationname FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE internalrequest = 1 ORDER BY locationname"; $resultStkLocs = DB_query($sql,$db); Modified: trunk/InventoryPlanning.php =================================================================== --- trunk/InventoryPlanning.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/InventoryPlanning.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -59,7 +59,8 @@ stockcategory.categorydescription, locstock.stockid, SUM(locstock.quantity) AS qoh - FROM locstock, + FROM locstock + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1, stockmaster, stockcategory WHERE locstock.stockid=stockmaster.stockid @@ -81,7 +82,8 @@ stockmaster.description, stockcategory.categorydescription, locstock.quantity AS qoh - FROM locstock, + FROM locstock + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1, stockmaster, stockcategory WHERE locstock.stockid=stockmaster.stockid @@ -153,6 +155,7 @@ SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4, SUM(CASE WHEN prd='" . $Period_5 . "' THEN -qty ELSE 0 END) AS prd5 FROM stockmoves + INNER JOIN locationusers ON locationusers.loccode=stockmoves.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockid='" . $InventoryPlan['stockid'] . "' AND (type=10 OR type=11) AND stockmoves.hidemovt=0"; @@ -164,6 +167,7 @@ SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4, SUM(CASE WHEN prd='" . $Period_5 . "' THEN -qty ELSE 0 END) AS prd5 FROM stockmoves + INNER JOIN locationusers ON locationusers.loccode=stockmoves.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockid='" . $InventoryPlan['stockid'] . "' AND stockmoves.loccode ='" . $_POST['Location'] . "' AND (stockmoves.type=10 OR stockmoves.type=11) @@ -191,6 +195,7 @@ $SQL = "SELECT SUM(salesorderdetails.quantity - salesorderdetails.qtyinvoiced) AS qtydemand FROM salesorderdetails INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorderdetails.stkcode = '" . $InventoryPlan['stockid'] . "' AND salesorderdetails.completed = 0 AND salesorders.quotation=0"; @@ -198,6 +203,7 @@ $SQL = "SELECT SUM(salesorderdetails.quantity - salesorderdetails.qtyinvoiced) AS qtydemand FROM salesorderdetails INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.fromstkloc ='" . $_POST['Location'] . "' AND salesorderdetails.stkcode = '" . $InventoryPlan['stockid'] . "' AND salesorderdetails.completed = 0 @@ -229,6 +235,7 @@ ON stockmaster.stockid=bom.parent INNER JOIN salesorders ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 AND bom.component='" . $InventoryPlan['stockid'] . "' AND stockmaster.mbflag='A' @@ -242,6 +249,7 @@ ON stockmaster.stockid=bom.parent INNER JOIN salesorders ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 AND salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 AND bom.component='" . $InventoryPlan['stockid'] . "' @@ -270,6 +278,7 @@ $SQL = "SELECT SUM(purchorderdetails.quantityord - purchorderdetails.quantityrecd) as qtyonorder FROM purchorderdetails INNER JOIN purchorders ON purchorderdetails.orderno = purchorders.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.itemcode = '" . $InventoryPlan['stockid'] . "' AND purchorderdetails.completed = 0 AND purchorders.status <> 'Cancelled' @@ -280,6 +289,7 @@ $SQL = "SELECT SUM(purchorderdetails.quantityord - purchorderdetails.quantityrecd) as qtyonorder FROM purchorderdetails INNER JOIN purchorders ON purchorderdetails.orderno = purchorders.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.itemcode = '" . $InventoryPlan['stockid'] . "' AND purchorderdetails.completed = 0 AND purchorders.intostocklocation= '" . $_POST['Location'] . "' @@ -414,7 +424,7 @@ <td>' . _('For Inventory in Location') . ':</td> <td><select name="Location">'; - $sql = "SELECT loccode, locationname FROM locations"; + $sql = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $LocnResult=DB_query($sql,$db); echo '<option value="All">' . _('All Locations') . '</option>'; Modified: trunk/InventoryPlanningPrefSupplier.php =================================================================== --- trunk/InventoryPlanningPrefSupplier.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/InventoryPlanningPrefSupplier.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -152,7 +152,8 @@ suppliers.suppname, purchdata.leadtime/30 AS monthsleadtime, SUM(locstock.quantity) AS qoh - FROM locstock, + FROM locstock + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1, stockmaster, purchdata, suppliers @@ -179,7 +180,8 @@ locstock.stockid, purchdata.leadtime/30 AS monthsleadtime, locstock.quantity AS qoh - FROM locstock, + FROM locstock + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1, stockmaster, purchdata, suppliers @@ -246,6 +248,7 @@ SUM(CASE WHEN prd='" . $Period_3 . "' THEN -qty ELSE 0 END) AS prd3, SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4 FROM stockmoves + INNER JOIN locationusers ON locationusers.loccode=stockmoves.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockid='" . $InventoryPlan['stockid'] . "' AND (type=10 OR type=11) AND stockmoves.hidemovt=0"; @@ -257,6 +260,7 @@ SUM(CASE WHEN prd='" . $Period_3 . "' THEN -qty ELSE 0 END) AS prd3, SUM(CASE WHEN prd='" . $Period_4 . "' THEN -qty ELSE 0 END) AS prd4 FROM stockmoves + INNER JOIN locationusers ON locationusers.loccode=stockmoves.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockid='" . $InventoryPlan['stockid'] . "' AND stockmoves.loccode ='" . $_POST['Location'] . "' AND (stockmoves.type=10 OR stockmoves.type=11) @@ -283,6 +287,7 @@ $SQL = "SELECT SUM(salesorderdetails.quantity - salesorderdetails.qtyinvoiced) AS qtydemand FROM salesorderdetails INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorderdetails.stkcode = '" . $InventoryPlan['stockid'] . "' AND salesorderdetails.completed = 0 AND salesorders.quotation=0"; @@ -290,6 +295,7 @@ $SQL = "SELECT SUM(salesorderdetails.quantity - salesorderdetails.qtyinvoiced) AS qtydemand FROM salesorderdetails INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.fromstkloc ='" . $_POST['Location'] . "' AND salesorderdetails.stkcode = '" . $InventoryPlan['stockid'] . "' AND salesorderdetails.completed = 0 @@ -321,6 +327,7 @@ ON stockmaster.stockid=bom.parent INNER JOIN salesorders ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 AND bom.component='" . $InventoryPlan['stockid'] . "' AND stockmaster.mbflag='A' @@ -334,6 +341,7 @@ ON stockmaster.stockid=bom.parent INNER JOIN salesorders ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorderdetails.quantity-salesorderdetails.qtyinvoiced > 0 AND bom.component='" . $InventoryPlan['stockid'] . "' AND salesorders.fromstkloc ='" . $_POST['Location'] . "' @@ -361,6 +369,7 @@ FROM purchorderdetails LEFT JOIN purchorders ON purchorderdetails.orderno = purchorders.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 LEFT JOIN purchdata ON purchorders.supplierno=purchdata.supplierno AND purchorderdetails.itemcode=purchdata.stockid @@ -375,6 +384,7 @@ FROM purchorderdetails LEFT JOIN purchorders ON purchorderdetails.orderno = purchorders.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 LEFT JOIN purchdata ON purchorders.supplierno=purchdata.supplierno AND purchorderdetails.itemcode=purchdata.stockid @@ -475,7 +485,8 @@ echo '<tr><td>' . _('For Inventory in Location') . ':</td> <td><select name="Location">'; - $sql = "SELECT loccode, locationname FROM locations"; + $sql = "SELECT locations.loccode, locationname FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $LocnResult=DB_query($sql,$db); echo '<option value="All">' . _('All Locations') . '</option>'; Modified: trunk/InventoryValuation.php =================================================================== --- trunk/InventoryValuation.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/InventoryValuation.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -23,6 +23,7 @@ FROM stockmaster, stockcategory, locstock + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmaster.stockid=locstock.stockid AND stockmaster.categoryid=stockcategory.categoryid GROUP BY stockmaster.categoryid, @@ -53,6 +54,7 @@ FROM stockmaster, stockcategory, locstock + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmaster.stockid=locstock.stockid AND stockmaster.categoryid=stockcategory.categoryid AND locstock.quantity!=0 @@ -265,9 +267,10 @@ <td>' . _('For Inventory in Location') . ':</td> <td><select name="Location">'; - $sql = "SELECT loccode, + $sql = "SELECT locations.loccode, locationname - FROM locations"; + FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $LocnResult=DB_query($sql,$db); Modified: trunk/MRPCreateDemands.php =================================================================== --- trunk/MRPCreateDemands.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/MRPCreateDemands.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -61,6 +61,7 @@ SUM(salesorderdetails.quantity * salesorderdetails.unitprice ) AS totextqty FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 INNER JOIN stockmaster ON salesorderdetails.stkcode = stockmaster.stockid WHERE orddate >='" . FormatDateForSQL($_POST['FromDate']) ."' @@ -224,9 +225,9 @@ <td><select name="Location">'; echo '<option selected="selected" value="All">' . _('All Locations') . '</option>'; -$result= DB_query("SELECT loccode, +$result= DB_query("SELECT locations.loccode, locationname - FROM locations",$db); + FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1",$db); while ($myrow=DB_fetch_array($result)){ echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } Modified: trunk/NoSalesItems.php =================================================================== --- trunk/NoSalesItems.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/NoSalesItems.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -20,8 +20,10 @@ <td>:</td> <td><select name="Location[]" multiple="multiple"> <option value="All" selected="selected">' . _('All') . '</option>';; - $sql = "SELECT loccode,locationname - FROM locations ORDER BY locationname"; + $sql = "SELECT locations.loccode,locationname + FROM locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 + ORDER BY locationname"; $locationresult = DB_query($sql, $db); $i=0; while ($myrow = DB_fetch_array($locationresult)) { @@ -104,23 +106,27 @@ stockmaster.description, stockmaster.units FROM stockmaster,locstock + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmaster.stockid = locstock.stockid ". $WhereStockCat . " AND (locstock.quantity > 0) AND NOT EXISTS ( SELECT * FROM salesorderdetails, salesorders + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmaster.stockid = salesorderdetails.stkcode AND (salesorderdetails.orderno = salesorders.orderno) AND salesorderdetails.actualdispatchdate > '" . $FromDate . "') AND NOT EXISTS ( SELECT * FROM stockmoves + INNER JOIN locationusers ON locationusers.loccode=stockmoves.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmoves.stockid = stockmaster.stockid AND stockmoves.trandate >= '" . $FromDate . "') AND EXISTS ( SELECT * FROM stockmoves + INNER JOIN locationusers ON locationusers.loccode=stockmoves.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmoves.stockid = stockmaster.stockid AND stockmoves.trandate < '" . $FromDate . "' AND stockmoves.qty >0) @@ -148,6 +154,7 @@ locstock.quantity, locations.locationname FROM stockmaster,locstock,locations + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmaster.stockid = locstock.stockid AND (locstock.loccode = locations.loccode)". $WhereLocation . @@ -205,7 +212,9 @@ } $QOHResult = DB_query("SELECT sum(quantity) FROM locstock - WHERE stockid = '" . $myrow['stockid'] . "'", $db); + INNER JOIN locationusers ON locationusers.loccode=locstock.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 + WHERE stockid = '" . $myrow['stockid'] . "'" . + $WhereLocation , $db); $QOHRow = DB_fetch_row($QOHResult); $QOH = $QOHRow[0]; Modified: trunk/PDFDIFOT.php =================================================================== --- trunk/PDFDIFOT.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/PDFDIFOT.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -67,7 +67,7 @@ <td><select name="Location"> <option selected="selected" value="All">' . _('All Locations') . '</option>'; - $result= DB_query("SELECT loccode, locationname FROM locations",$db); + $result= DB_query("SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1",$db); while ($myrow=DB_fetch_array($result)){ echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } @@ -111,9 +111,10 @@ FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' - AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) <'" . filter_number_format($_POST['DaysAcceptable']) ."'"; + AND (TO_DAYS(salesorderdetails.actualdispatchdate) - TO_DAYS(salesorders.deliverydate)) >='" . filter_number_format($_POST['DaysAcceptable']) . "'"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']=='All') { $sql= "SELECT salesorders.orderno, @@ -129,11 +130,12 @@ FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' AND (TO_DAYS(salesorderdetails.actualdispatchdate) - - TO_DAYS(salesorders.deliverydate)) <'" . filter_number_format($_POST['DaysAcceptable'])."'"; + - TO_DAYS(salesorders.deliverydate)) >='" . filter_number_format($_POST['DaysAcceptable']) . "'"; } elseif ($_POST['CategoryID']=='All' AND $_POST['Location']!='All') { @@ -150,11 +152,12 @@ FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND salesorders.fromstkloc='" . $_POST['Location'] . "' AND (TO_DAYS(salesorderdetails.actualdispatchdate) - - TO_DAYS(salesorders.deliverydate)) <'" . filter_number_format($_POST['DaysAcceptable']) . "'"; + - TO_DAYS(salesorders.deliverydate)) >='" . filter_number_format($_POST['DaysAcceptable']) . "'"; } elseif ($_POST['CategoryID']!='All' AND $_POST['Location']!='All'){ @@ -171,6 +174,7 @@ FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid INNER JOIN salesorders ON salesorderdetails.orderno=salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.deliverydate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND salesorders.deliverydate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND stockmaster.categoryid='" . $_POST['CategoryID'] ."' @@ -248,7 +252,9 @@ if ($_POST['CategoryID']=='All' AND $_POST['Location']=='All'){ $sql = "SELECT COUNT(salesorderdetails.orderno) FROM salesorderdetails INNER JOIN debtortrans - ON salesorderdetails.orderno=debtortrans.order_ + ON salesorderdetails.orderno=debtortrans.order_ INNER JOIN salesorders + ON salesorderdetails.orderno = salesorders.orderno INNER JOIN locationusers + ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE debtortrans.trandate>='" . FormatDateForSQL($_POST['FromDate']) . "' AND debtortrans.trandate <='" . FormatDateForSQL($_POST['ToDate']) . "'"; @@ -256,7 +262,9 @@ $sql = "SELECT COUNT(salesorderdetails.orderno) FROM salesorderdetails INNER JOIN debtortrans ON salesorderdetails.orderno=debtortrans.order_ INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid + ON salesorderdetails.stkcode=stockmaster.stockid INNER JOIN salesorders + ON salesorderdetails.orderno = salesorders.orderno INNER JOIN locationusers + ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE debtortrans.trandate>='" . FormatDateForSQL($_POST['FromDate']) . "' AND debtortrans.trandate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND stockmaster.categoryid='" . $_POST['CategoryID'] . "'"; @@ -266,7 +274,8 @@ $sql = "SELECT COUNT(salesorderdetails.orderno) FROM salesorderdetails INNER JOIN debtortrans ON salesorderdetails.orderno=debtortrans.order_ INNER JOIN salesorders - ON salesorderdetails.orderno = salesorders.orderno + ON salesorderdetails.orderno = salesorders.orderno INNER JOIN locationusers + ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE debtortrans.trandate>='". FormatDateForSQL($_POST['FromDate']) . "' AND debtortrans.trandate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND salesorders.fromstkloc='" . $_POST['Location'] . "'"; @@ -276,6 +285,7 @@ $sql = "SELECT COUNT(salesorderdetails.orderno) FROM salesorderdetails INNER JOIN debtortrans ON salesorderdetails.orderno=debtortrans.order_ INNER JOIN salesorders ON salesorderdetails.orderno = salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 INNER JOIN stockmaster ON salesorderdetails.stkcode = stockmaster.stockid WHERE salesorders.fromstkloc ='" . $_POST['Location'] . "' AND categoryid='" . $_POST['CategoryID'] . "' Modified: trunk/PDFDeliveryDifferences.php =================================================================== --- trunk/PDFDeliveryDifferences.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/PDFDeliveryDifferences.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -63,7 +63,7 @@ <td><select name="Location"> <option selected="selected" value="All">' . _('All Locations') . '</option>'; - $result= DB_query("SELECT loccode, locationname FROM locations",$db); + $result= DB_query("SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1",$db); while ($myrow=DB_fetch_array($result)){ echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } @@ -105,6 +105,8 @@ orderdeliverydifferenceslog.branch FROM orderdeliverydifferenceslog INNER JOIN stockmaster ON orderdeliverydifferenceslog.stockid=stockmaster.stockid + INNER JOIN salesorders ON orderdeliverydifferenceslog.orderno = salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 INNER JOIN debtortrans ON orderdeliverydifferenceslog.invoiceno=debtortrans.transno AND debtortrans.type=10 AND trandate >='" . FormatDateForSQL($_POST['FromDate']) . "' @@ -122,6 +124,8 @@ orderdeliverydifferenceslog.branch FROM orderdeliverydifferenceslog INNER JOIN stockmaster ON orderdeliverydifferenceslog.stockid=stockmaster.stockid + INNER JOIN salesorders ON orderdeliverydifferenceslog.orderno = salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 INNER JOIN debtortrans ON orderdeliverydifferenceslog.invoiceno=debtortrans.transno AND debtortrans.type=10 AND trandate >='" . FormatDateForSQL($_POST['FromDate']) . "' @@ -144,6 +148,8 @@ ON orderdeliverydifferenceslog.invoiceno=debtortrans.transno INNER JOIN salesorders ON orderdeliverydifferenceslog.orderno=salesorders.orderno + INNER JOIN locationusers + ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE debtortrans.type=10 AND salesorders.fromstkloc='". $_POST['Location'] . "' AND trandate >='" . FormatDateForSQL($_POST['FromDate']) . "' @@ -167,6 +173,8 @@ AND debtortrans.type=10 INNER JOIN salesorders ON orderdeliverydifferenceslog.orderno = salesorders.orderno + INNER JOIN locationusers + ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.fromstkloc='" . $_POST['Location'] . "' AND categoryid='" . $_POST['CategoryID'] . "' AND trandate >='" . FormatDateForSQL($_POST['FromDate']) . "' @@ -239,7 +247,9 @@ if ($_POST['CategoryID']=='All' AND $_POST['Location']=='All'){ $sql = "SELECT COUNT(salesorderdetails.orderno) FROM salesorderdetails INNER JOIN debtortrans - ON salesorderdetails.orderno=debtortrans.order_ + ON salesorderdetails.orderno=debtortrans.order_ INNER JOIN salesorders + ON salesorderdetails.orderno = salesorders.orderno INNER JOIN locationusers + ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE debtortrans.trandate>='" . FormatDateForSQL($_POST['FromDate']) . "' AND debtortrans.trandate <='" . FormatDateForSQL($_POST['ToDate']) . "'"; @@ -247,7 +257,9 @@ $sql = "SELECT COUNT(salesorderdetails.orderno) FROM salesorderdetails INNER JOIN debtortrans ON salesorderdetails.orderno=debtortrans.order_ INNER JOIN stockmaster - ON salesorderdetails.stkcode=stockmaster.stockid + ON salesorderdetails.stkcode=stockmaster.stockid INNER JOIN salesorders + ON salesorderdetails.orderno = salesorders.orderno INNER JOIN locationusers + ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE debtortrans.trandate>='" . FormatDateForSQL($_POST['FromDate']) . "' AND debtortrans.trandate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND stockmaster.categoryid='" . $_POST['CategoryID'] . "'"; @@ -257,7 +269,8 @@ $sql = "SELECT COUNT(salesorderdetails.orderno) FROM salesorderdetails INNER JOIN debtortrans ON salesorderdetails.orderno=debtortrans.order_ INNER JOIN salesorders - ON salesorderdetails.orderno = salesorders.orderno + ON salesorderdetails.orderno = salesorders.orderno INNER JOIN locationusers + ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE debtortrans.trandate>='". FormatDateForSQL($_POST['FromDate']) . "' AND debtortrans.trandate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND salesorders.fromstkloc='" . $_POST['Location'] . "'"; @@ -267,6 +280,7 @@ $sql = "SELECT COUNT(salesorderdetails.orderno) FROM salesorderdetails INNER JOIN debtortrans ON salesorderdetails.orderno=debtortrans.order_ INNER JOIN salesorders ON salesorderdetails.orderno = salesorders.orderno + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 INNER JOIN stockmaster ON salesorderdetails.stkcode = stockmaster.stockid WHERE salesorders.fromstkloc ='" . $_POST['Location'] . "' AND categoryid='" . $_POST['CategoryID'] . "' Modified: trunk/PDFOrderStatus.php =================================================================== --- trunk/PDFOrderStatus.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/PDFOrderStatus.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -62,7 +62,7 @@ <td><select name="Location"> <option selected="selected" value="All">' . _('All Locations') . '</option>'; - $result= DB_query("SELECT loccode, locationname FROM locations",$db); + $result= DB_query("SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1",$db); while ($myrow=DB_fetch_array($result)){ echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } @@ -127,6 +127,7 @@ AND custbranch.branchcode=salesorders.branchcode INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND salesorders.orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' AND salesorders.quotation=0"; @@ -162,6 +163,7 @@ AND custbranch.branchcode=salesorders.branchcode INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmaster.categoryid ='" . $_POST['CategoryID'] . "' AND orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' @@ -199,6 +201,7 @@ AND custbranch.branchcode=salesorders.branchcode INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.fromstkloc ='" . $_POST['Location'] . "' AND salesorders.orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND salesorders.orddate <='" . FormatDateForSQL($_POST['ToDate']) . "' @@ -237,6 +240,7 @@ AND custbranch.branchcode=salesorders.branchcode INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmaster.categoryid ='" . $_POST['CategoryID'] . "' AND salesorders.fromstkloc ='" . $_POST['Location'] . "' AND salesorders.orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' Modified: trunk/PDFOrdersInvoiced.php =================================================================== --- trunk/PDFOrdersInvoiced.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/PDFOrdersInvoiced.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -65,7 +65,7 @@ <td><select required="required" name="Location"> <option selected="selected" value="All">' . _('All Locations') . '</option>'; - $result= DB_query("SELECT loccode, locationname FROM locations",$db); + $result= DB_query("SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1",$db); while ($myrow=DB_fetch_array($result)){ echo '<option value="' . $myrow['loccode'] . '">' . $myrow['locationname'] . '</option>'; } @@ -120,6 +120,7 @@ AND custbranch.branchcode=salesorders.branchcode INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "'"; @@ -154,6 +155,7 @@ AND custbranch.branchcode=salesorders.branchcode INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmaster.categoryid ='" . $_POST['CategoryID'] . "' AND orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "'"; @@ -188,12 +190,12 @@ AND custbranch.branchcode=salesorders.branchcode INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.fromstkloc ='" . $_POST['Location'] . "' AND orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' AND orddate <='" . FormatDateForSQL($_POST['ToDate']) . "'"; } elseif ($_POST['CategoryID']!='All' AND $_POST['location']!='All'){ - $sql= "SELECT salesorders.orderno, salesorders.debtorno, salesorders.branchcode, @@ -209,8 +211,6 @@ locations.locationname, SUM(salesorderdetails.quantity) AS totqty, SUM(salesorderdetails.qtyinvoiced) AS totqtyinvoiced - INNER JOIN locations - ON salesorders.fromstkloc=locations.loccode FROM salesorders INNER JOIN salesorderdetails ON salesorders.orderno = salesorderdetails.orderno @@ -221,6 +221,9 @@ INNER JOIN custbranch ON custbranch.debtorno=salesorders.debtorno AND custbranch.branchcode=salesorders.branchcode + INNER JOIN locations + ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE stockmaster.categoryid ='" . $_POST['CategoryID'] . "' AND salesorders.fromstkloc ='" . $_POST['Location'] . "' AND orddate >='" . FormatDateForSQL($_POST['FromDate']) . "' Modified: trunk/PDFPeriodStockTransListing.php =================================================================== --- trunk/PDFPeriodStockTransListing.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/PDFPeriodStockTransListing.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -49,7 +49,7 @@ </select></td> </tr>'; - $sql = "SELECT loccode, locationname FROM locations"; + $sql = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $resultStkLocs = DB_query($sql, $db); echo '<tr> @@ -105,6 +105,7 @@ ON stockmoves.stockid=stockmaster.stockid LEFT JOIN locations ON stockmoves.loccode=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE type='" . $_POST['TransType'] . "' AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."'"; @@ -124,6 +125,7 @@ ON stockmoves.stockid=stockmaster.stockid LEFT JOIN locations ON stockmoves.loccode=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE type='" . $_POST['TransType'] . "' AND date_format(trandate, '%Y-%m-%d')>='".FormatDateForSQL($_POST['FromDate'])."' AND date_format(trandate, '%Y-%m-%d')<='".FormatDateForSQL($_POST['ToDate'])."' Modified: trunk/PDFStockTransfer.php =================================================================== --- trunk/PDFStockTransfer.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/PDFStockTransfer.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -81,6 +81,7 @@ ON stockmoves.stockid=stockmaster.stockid INNER JOIN locations ON stockmoves.loccode=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE transno='".$_GET['TransferNo']."' AND qty < 0 AND type=16"; Modified: trunk/PO_Header.php =================================================================== --- trunk/PO_Header.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/PO_Header.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -889,9 +889,9 @@ <td>' . _('Warehouse') . ':</td> <td><select required="required" name="StkLocation" onchange="ReloadForm(form1.LookupDeliveryAddress)">'; - $sql = "SELECT loccode, + $sql = "SELECT locations.loccode, locationname - FROM locations"; + FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $LocnResult = DB_query($sql, $db); while ($LocnRow = DB_fetch_array($LocnResult)) { @@ -1160,7 +1160,7 @@ echo ':</h3></th> </tr> <tr> - <td colspan="4"><textarea name="Comments" style="width:100%" rows="5" cols="200">' . $_POST['Comments'] . '</textarea></td> + <td colspan="4"><textarea name="Comments" style="width:100%" rows="5" cols="200">' . stripcslashes($_POST['Comments']) . '</textarea></td> </tr> </table> <br />'; Modified: trunk/PO_OrderDetails.php =================================================================== --- trunk/PO_OrderDetails.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/PO_OrderDetails.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -49,6 +49,7 @@ locations.locationname, currencies.decimalplaces AS currdecimalplaces FROM purchorders + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 INNER JOIN locations ON locations.loccode=purchorders.intostocklocation INNER JOIN suppliers @@ -71,7 +72,7 @@ echo '<table class="table_index"> <tr> <td class="menu_group_item"> - <li><a href="'. $RootPath . '/PO_SelectPurchOrder.php">' . _('Outstanding Sales Orders') . '</a></li> + <li><a href="'. $RootPath . '/PO_SelectPurchOrder.php">' . _('Outstanding Purchase Orders') . '</a></li> </td> </tr> </table>'; @@ -86,7 +87,7 @@ /* SHOW ALL THE ORDER INFO IN ONE PLACE */ echo '<p class="page_title_text"><img src="'.$RootPath.'/css/'.$Theme.'/images/supplier.png" title="' . _('Purchase Order') . '" alt="" />' . ' ' . $Title . '</p>'; -echo '<a href="' . $RootPath . '/PO_SelectPurchOrder.php">' . _('Outstanding Sales Orders') . '</a>'; +echo '<a href="' . $RootPath . '/PO_SelectPurchOrder.php">' . _('Outstanding Purchase Orders') . '</a>'; echo '<table class="selection" cellpadding="2"> <tr> <th colspan="8"><b>' . _('Order Header Details'). '</b></th> Modified: trunk/PO_SelectOSPurchOrder.php =================================================================== --- trunk/PO_SelectOSPurchOrder.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/PO_SelectOSPurchOrder.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -77,6 +77,8 @@ ON stockmaster.stockid = locstock.stockid INNER JOIN purchorderdetails ON stockmaster.stockid=purchorderdetails.itemcode + INNER JOIN purchorders on purchorders.orderno=purchorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.completed=0 AND stockmaster.description " . LIKE . " '" . $SearchString . "' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' @@ -97,6 +99,8 @@ ON stockmaster.stockid = locstock.stockid INNER JOIN purchorderdetails ON stockmaster.stockid=purchorderdetails.itemcode + INNER JOIN purchorders on purchorders.orderno=purchorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.completed=0 AND stockmaster.stockid " . LIKE . " '%" . $_POST['StockCode'] . "%' AND stockmaster.categoryid='" . $_POST['StockCat'] . "' @@ -115,6 +119,8 @@ ON stockmaster.stockid = locstock.stockid INNER JOIN purchorderdetails ON stockmaster.stockid=purchorderdetails.itemcode + INNER JOIN purchorders on purchorders.orderno=purchorderdetails.orderno + INNER JOIN locationusers ON locationusers.loccode=purchorders.intostocklocation AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE purchorderdetails.completed=0 AND stockmaster.categoryid='" . $_POST['StockCat'] . "' GROUP BY stockmaster.stockid, Modified: trunk/PO_SelectPurchOrder.php =================================================================== --- trunk/PO_SelectPurchOrder.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/PO_SelectPurchOrder.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -116,7 +116,7 @@ echo _('For the part') . ':<b>' . $SelectedStockItem . '</b> ' . _('and') . ' <input type="hidden" name="SelectedStockItem" value="' . $SelectedStockItem . '" />'; } echo _('Order Number') . ': <input class="integer" name="OrderNumber" autofocus="autofocus" maxlength="8" size="9" /> ' . _('Into Stock Location') . ':<select name="StockLocation"> '; - $sql = "SELECT loccode, locationname FROM locations"; + $sql = "SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; $resultStkLocs = DB_query($sql, $db); while ($myrow = DB_fetch_array($resultStkLocs)) { if (isset($_POST['StockLocation'])) { Modified: trunk/PrintCustOrder.php =================================================================== --- trunk/PrintCustOrder.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/PrintCustOrder.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -67,6 +67,7 @@ ON salesorders.shipvia=shippers.shipper_id INNER JOIN locations ON salesorders.fromstkloc=locations.loccode + INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE salesorders.orderno='" . $_GET['TransNo'] . "'"; if ($_SESSION['SalesmanLogin'] != '') { Modified: trunk/SelectContract.php =================================================================== --- trunk/SelectContract.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/SelectContract.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -86,6 +86,7 @@ requireddate FROM contracts INNER JOIN debtorsmaster ON contracts.debtorno = debtorsmaster.debtorno + INNER JOIN locationusers ON locationusers.loccode=contracts.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE contractref " . LIKE . " '%" . $_POST['ContractRef'] ."%'"; } else { //contractref not selected @@ -104,6 +105,7 @@ requireddate FROM contracts INNER JOIN debtorsmaster ON contracts.debtorno = debtorsmaster.debtorno + INNER JOIN locationusers ON locationusers.loccode=contracts.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1 WHERE debtorno='". $_POST['SelectedCustomer'] ."'"; if ($_POST['Status']!=4){ $SQL .= " AND status='" . $_POST['Status'] . "'"; @@ -121,7 +123,8 @@ customerref, requireddate FROM contracts INNER JOIN debtorsmaster - ON contracts.debtorno = debtorsmaster.debtorno"; + ON contracts.debtorno = debtorsmaster.debtorno + INNER JOIN locationusers ON locationusers.loccode=contracts.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canview=1"; if ($_POST['Status']!=4){ $SQL .= " AND status='" . $_POST['Status'] . "'"; } Modified: trunk/SelectCreditItems.php =================================================================== --- trunk/SelectCreditItems.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/SelectCreditItems.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -881,7 +881,7 @@ <td>' . _('Goods Returned to Location') . ' :</td> <td><select name="Location">'; - $SQL="SELECT loccode, locationname FROM locations"; + $SQL="SELECT locations.loccode, locationname FROM locations $SQL="SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $Result = DB_query($SQL,$db); if (!isset($_POST['Location'])){ Modified: trunk/SelectOrderItems.php =================================================================== --- trunk/SelectOrderItems.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/SelectOrderItems.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -133,6 +133,7 @@ ON locations.loccode=salesorders.fromstkloc INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev + INNER JOIN locationusers ON locationusers.loccode=salesorders.fromstkloc AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE salesorders.orderno = '" . $_GET['ModifyOrderNumber'] . "'"; $ErrMsg = _('The order cannot be retrieved because'); Modified: trunk/includes/Contract_Readin.php =================================================================== --- trunk/includes/Contract_Readin.php 2014-08-13 17:53:49 UTC (rev 6811) +++ trunk/includes/Contract_Readin.php 2014-08-13 18:14:57 UTC (rev 6812) @@ -24,6 +24,7 @@ INNER JOIN custbranch ON debtorsmaster.debtorno=custbranch.debtorno AND contracts.branchcode=custbranch.branchcode + INNER JOIN locationusers ON locationusers.loccode=contracts.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1 WHERE contractref= '" . $ContractRef . "'"; $ErrMsg = _('The contract cannot be retrieved because'); |