From: <dai...@us...> - 2010-12-29 23:18:58
|
Revision: 4455 http://web-erp.svn.sourceforge.net/web-erp/?rev=4455&view=rev Author: daintree Date: 2010-12-29 23:18:49 +0000 (Wed, 29 Dec 2010) Log Message: ----------- Database upgrade Modified Paths: -------------- trunk/UpgradeDatabase.php trunk/includes/ConnectDB.inc trunk/includes/GetConfig.php trunk/includes/footer.inc trunk/includes/session.inc trunk/sql/mysql/upgrade3.11.1-4.00.sql Added Paths: ----------- trunk/sql/mysql/upgrade2.7-2.8.sql trunk/sql/mysql/upgrade2.8-2.9.sql trunk/sql/mysql/upgrade2.9-2.9a.sql trunk/sql/mysql/upgrade2.9a-2.9b.sql trunk/sql/mysql/upgrade3.00-3.01.sql trunk/sql/mysql/upgrade3.01-3.02.sql trunk/sql/mysql/upgrade3.02-3.03.sql trunk/sql/mysql/upgrade3.03-3.04.sql trunk/sql/mysql/upgrade3.04-3.05.sql trunk/sql/mysql/upgrade3.05-3.06.sql trunk/sql/mysql/upgrade3.06-3.07.sql trunk/sql/mysql/upgrade3.07-3.08.sql trunk/sql/mysql/upgrade3.09-3.10.sql trunk/sql/mysql/upgrade3.10-3.11.sql Modified: trunk/UpgradeDatabase.php =================================================================== --- trunk/UpgradeDatabase.php 2010-12-29 09:53:54 UTC (rev 4454) +++ trunk/UpgradeDatabase.php 2010-12-29 23:18:49 UTC (rev 4455) @@ -7,7 +7,8 @@ if (empty($_POST['DoUpgrade'])){ - + if (!isset($_SESSION['VersionNumber')){ + prnMsg(_('The webERP code is version') . ' ' . $Version . ' ' . _('the database is a prior version and upgrade scripts are required to be run. Upgrades to the database prior to ') prnMsg(_('This script will run perform any modifications to the database since v 3.11 required to allow the additional functionality in later scripts'),'info'); echo "<p><form method='post' action='" . $_SERVER['PHP_SELF'] . '?' . SID . "'>"; @@ -22,7 +23,7 @@ prnMsg(_('If there are any failures then please check with your system administrator'). '. '._('Please read all notes carefully to ensure they are expected'),'info'); - if($_SESSION['DBUpdateNumber']< 1) { /* DBUpdateNumber set to 1 when upgrade3.11.1-4.00.sql is run */ + if($_SESSION['VersionNumber']< '4.00') { /* VersionNumber is set to '4.00' when upgrade3.11.1-4.00.sql is run */ if ($dbType=='mysql' OR $dbType =='mysqli'){ $SQLScripts[0] = './sql/mysql/upgrade3.11.1-4.00.sql'; } @@ -99,12 +100,11 @@ } //end if its a valid sql line not a comment } //end of for loop around the lines of the sql script echo '</table>'; - } //end of loop around SQLScripts to apply + } //end of loop around SQLScripts apply $result =DB_ReinstateForeignKeys($db); - /*Now get the modified DBUpgradeNumber */ - $result = DB_query('SELECT confvalue FROM config WHERE confname="DBUpdateNumber"',$db); - $myrow = DB_fetch_array($result); - $_SESSION['DBUpdateNumber'] = $myrow['confvalue']; + /*Now get the modified VersionNumber and script pagesecurities */ + $ForceConfigReload=true; + include('includes/GetConfig.php'); } /*Dont do upgrade */ Modified: trunk/includes/ConnectDB.inc =================================================================== --- trunk/includes/ConnectDB.inc 2010-12-29 09:53:54 UTC (rev 4454) +++ trunk/includes/ConnectDB.inc 2010-12-29 23:18:49 UTC (rev 4455) @@ -1,10 +1,10 @@ <?php /* $Id$*/ -/*DBVersion is compared against the value for config.confvalue WHERE confname=DBUpdateNumber in the database - * this value is saved in the $_SESSION['DBUpdateNumber'] when includes/GetConfig.php is run - * if DBUpdateNumber is < DBVersion then */ +/*Version is compared against the value for config.confvalue WHERE confname=VersionNumber in the database + * this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run + * if VersionNumber is < $Version then the DB update script is run */ -$DBVersion=1; //must update manually every time there is a DB change +$Version='4.00'; //must update manually every time there is a DB change require_once ($PathPrefix .'includes/MiscFunctions.php'); if (!isset($_SESSION['DatabaseName'])){ Modified: trunk/includes/GetConfig.php =================================================================== --- trunk/includes/GetConfig.php 2010-12-29 09:53:54 UTC (rev 4454) +++ trunk/includes/GetConfig.php 2010-12-29 23:18:49 UTC (rev 4455) @@ -31,9 +31,9 @@ $_SESSION['PageSecurity'][$myrow['script']]=$myrow['pagesecurity']; } - if (!isset($_SESSION['DBUpdateNumber'])){ // the config record for DBUpdateNumber is not yet added - $_SESSION['DBUpdateNumber']=-1; - header('Location: UpgradeDatabase.php'); //divert to the db upgrade if the DBUpdateNumber is not in the config table + if (!isset($_SESSION['VersionNumber'])){ // the config record for VersionNumber is not yet added + $_SESSION['VersionNumber']=-1; + header('Location: UpgradeDatabase.php'); //divert to the db upgrade if the VersionNumber is not in the config table } /* Also reads all the company data set up in the company record and returns an array */ Modified: trunk/includes/footer.inc =================================================================== --- trunk/includes/footer.inc 2010-12-29 09:53:54 UTC (rev 4454) +++ trunk/includes/footer.inc 2010-12-29 23:18:49 UTC (rev 4455) @@ -12,7 +12,6 @@ setlocale(LC_ALL,$_SESSION['Language']); if (!isset($DefaultClock)) { include('config.php'); - $Version=$_SESSION['VersionNumber']; } echo '<p style="text-align:right">'.(strftime('%A')).', '.(date($_SESSION['DefaultDateFormat']).' | '.(strftime(($DefaultClock==12) ? '%I:%M %p' : '%H:%M'))).'</p>'; @@ -26,7 +25,7 @@ echo '</td></tr>'; - echo '<tr><td class="footer">webERP v' . $Version . ' ' . _('Copyright') . ' © weberp.org - '.date('Y').'</td></tr>'; + echo '<tr><td class="footer">webERP v' . $_SESSION['VersionNumber'] . ' ' . _('Copyright') . ' © weberp.org - '.date('Y').'</td></tr>'; if(http_file_exists('http://sflogo.sourceforge.net/sflogo.php')) { echo '<tr><td class="footer"><a href="https://sourceforge.net/projects/web-erp"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=70949&type=12" width="120" height="30" border="0" alt="Get webERP web-based ERP Accounting at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a></td></tr>'; @@ -36,5 +35,4 @@ echo '</body>'; echo '</html>'; - ?> \ No newline at end of file Modified: trunk/includes/session.inc =================================================================== --- trunk/includes/session.inc 2010-12-29 09:53:54 UTC (rev 4454) +++ trunk/includes/session.inc 2010-12-29 23:18:49 UTC (rev 4455) @@ -121,8 +121,8 @@ */ $PageSecurity = $_SESSION['PageSecurity'][basename($_SERVER['SCRIPT_NAME'])]; } - -if (($DBVersion>$_SESSION['DBUpdateNumber']) and (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { +/*If the Code $Version - held in ConnectDB.inc is > than the Database VersionNumber held in config table then do upgrades */ +if (($Version>$_SESSION['VersionNumber']) and (basename($_SERVER['SCRIPT_NAME'])!='UpgradeDatabase.php')) { header('Location: UpgradeDatabase.php'); } Added: trunk/sql/mysql/upgrade2.7-2.8.sql =================================================================== --- trunk/sql/mysql/upgrade2.7-2.8.sql (rev 0) +++ trunk/sql/mysql/upgrade2.7-2.8.sql 2010-12-29 23:18:49 UTC (rev 4455) @@ -0,0 +1,310 @@ +begin; + +ALTER TABLE Locations ADD TaxAuthority tinyint(4) NOT NULL default 1; + +ALTER TABLE StockMaster ADD TaxLevel tinyint(4) NOT NULL default 1; + +CREATE TABLE TaxAuthLevels ( + TaxAuthority tinyint NOT NULL default '1', + DispatchTaxAuthority tinyint NOT NULL default '1', + Level tinyint NOT NULL default '0', + TaxRate double NOT NULL default '0', + PRIMARY KEY (TaxAuthority,DispatchTaxAuthority,Level), + KEY (TaxAuthority), + KEY (DispatchTaxAuthority) +) TYPE=Innodb; + +INSERT INTO TaxAuthLevels VALUES (1, 1, 1, 0.1); +INSERT INTO TaxAuthLevels VALUES (1, 1, 2, 0); + +ALTER TABLE TaxAuthorities DROP COLUMN Rate; +ALTER TABLE TaxAuthorities CHANGE TaxID TaxID tinyint(4) NOT NULL default '0'; + + +ALTER TABLE StockMoves ADD COLUMN TaxRate float NOT NULL default 0; +ALTER TABLE DebtorTrans ADD COLUMN EDISent tinyint(4) NOT NULL default 0; +ALTER TABLE DebtorTrans ADD INDEX(`EDISent`); + +ALTER TABLE CustBranch ADD CustBranchCode VARCHAR(30) NOT NULL default ''; + +ALTER TABLE WWW_Users ADD COLUMN Blocked tinyint(4) NOT NULL default 0; + +ALTER TABLE DebtorsMaster ADD EDIInvoices tinyint(4) NOT NULL default '0'; +ALTER TABLE DebtorsMaster ADD EDIOrders tinyint(4) NOT NULL default '0'; +ALTER TABLE DebtorsMaster ADD EDIReference varchar(20) NOT NULL default ''; +ALTER TABLE DebtorsMaster ADD EDITransport varchar(5) NOT NULL default 'email'; +ALTER TABLE DebtorsMaster ADD EDIAddress varchar(50) NOT NULL default ''; +ALTER TABLE DebtorsMaster ADD EDIServerUser varchar(20) NOT NULL default ''; +ALTER TABLE DebtorsMaster ADD EDIServerPwd varchar(20) NOT NULL default ''; +ALTER TABLE DebtorsMaster ADD INDEX (EDIInvoices); +ALTER TABLE DebtorsMaster ADD INDEX (EDIOrders); + +CREATE TABLE EDIItemMapping ( + SuppOrCust varchar(4) NOT NULL default '', + PartnerCode varchar(10) NOT NULL default '', + StockID varchar(20) NOT NULL default '', + PartnerStockID varchar(50) NOT NULL default '', + PRIMARY KEY (SuppOrCust,PartnerCode,StockID), + KEY PartnerCode (PartnerCode), + KEY StockID (StockID), + KEY PartnerStockID (PartnerStockID), + KEY SuppOrCust (SuppOrCust) +) TYPE=Innodb; + +CREATE TABLE EDIMessageFormat ( + PartnerCode varchar(10) NOT NULL default '', + MessageType varchar(6) NOT NULL default '', + Section varchar(7) NOT NULL default '', + SequenceNo int(11) NOT NULL default '0', + LineText varchar(70) NOT NULL default '', + PRIMARY KEY (PartnerCode,MessageType,SequenceNo), + KEY Section (Section) +) TYPE=Innodb; + + +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 10, 'UNH+[EDITransNo]+INVOIC:D:96A:UN:EAN008\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 20, 'BGM+[InvOrCrd]+[TransNo]+[OrigOrDup]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 30, 'DTM+137:[TranDate]:102\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 60, 'RFF+ON:[OrderNo]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 70, 'NAD+BY+[CustBranchCode]::92\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 80, 'NAD+SU+[CompanyEDIReference]::91\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 90, 'NAD+UD++[BranchName]+[BranchStreet]+[BranchCity]+[BranchState]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 100, 'RFF+AMT:[TaxAuthorityRef]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 110, 'PAT+1++5:3:D:30\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 120, 'DTM+13:[DatePaymentDue]:102\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 130, 'TAX+7+GST+++:::10\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 150, 'MOA+124:[TaxTotal]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 160, 'LIN+[LineNumber]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 170, 'PIA+5+[StockID]:SA+[CustStockID]:IN\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 180, 'IMD+F++:::[ItemDescription]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Heading', 85, 'NAD+IV+[CustEDIReference]::9\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 200, 'QTY+47:[QtyInvoiced]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 220, 'MOA+128:[LineTotalExclTax]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 230, 'PRI+AAA:[UnitPrice]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 240, 'TAX+7+GST+++:::10\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Detail', 250, 'MOA+124:[LineTaxAmount]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 260, 'UNS+S\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 270, 'CNT+2:[NoLines]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 280, 'MOA+128:[TotalAmountExclTax]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 290, 'TAX+7+GST+++:::10\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 300, 'MOA+128:[TaxTotal]\''); +INSERT INTO EDIMessageFormat VALUES ('DEFAULT', 'INVOIC', 'Summary', 310, 'UNT+[NoSegments]+[EDITransNo]\''); + +ALTER TABLE AccountGroups Type=Innodb; +ALTER TABLE Areas Type=Innodb; +ALTER TABLE BOM Type=Innodb; +ALTER TABLE BankAccounts Type=Innodb; +ALTER TABLE BankTrans Type=Innodb; +ALTER TABLE Buckets Type=Innodb; +ALTER TABLE COGSGLPostings Type=Innodb; +ALTER TABLE ChartMaster Type=Innodb; +ALTER TABLE Companies Type=Innodb; +ALTER TABLE ContractBOM Type=Innodb; +ALTER TABLE ContractReqts Type=Innodb; +ALTER TABLE Contracts Type=Innodb; +ALTER TABLE Currencies Type=Innodb; +ALTER TABLE CustBranch Type=Innodb; +ALTER TABLE DebtorsMaster Type=Innodb; +ALTER TABLE DiscountMatrix Type=Innodb; +ALTER TABLE FreightCosts Type=Innodb; +ALTER TABLE HoldReasons Type=Innodb; +ALTER TABLE LastCostRollUp Type=Innodb; +ALTER TABLE PaymentTerms Type=Innodb; +ALTER TABLE Prices Type=Innodb; +ALTER TABLE PurchData Type=Innodb; +ALTER TABLE ReportColumns Type=Innodb; +ALTER TABLE ReportHeaders Type=Innodb; +ALTER TABLE SalesGLPostings Type=Innodb; +ALTER TABLE SalesTypes Type=Innodb; +ALTER TABLE Salesman Type=Innodb; +ALTER TABLE ShipmentCharges Type=Innodb; +ALTER TABLE Shippers Type=Innodb; +ALTER TABLE StockCategory Type=Innodb; +ALTER TABLE StockCheckFreeze Type=Innodb; +ALTER TABLE StockCounts Type=Innodb; +ALTER TABLE SupplierContacts Type=Innodb; +ALTER TABLE Suppliers Type=Innodb; +ALTER TABLE TaxAuthorities Type=Innodb; +ALTER TABLE WORequirements Type=Innodb; +ALTER TABLE WWW_Users Type=Innodb; +ALTER TABLE WorkCentres Type=Innodb; +ALTER TABLE Locations Type=Innodb; + + +ALTER TABLE TaxAuthLevels ADD FOREIGN KEY (TaxAuthority) REFERENCES TaxAuthorities (TaxID); +ALTER TABLE TaxAuthLevels ADD FOREIGN KEY (DispatchTaxAuthority) REFERENCES TaxAuthorities (TaxID); + +ALTER TABLE BOM ADD FOREIGN KEY (Parent) REFERENCES StockMaster (StockID); +ALTER TABLE BOM ADD FOREIGN KEY (Component) REFERENCES StockMaster (StockID); +ALTER TABLE BOM ADD FOREIGN KEY (WorkCentreAdded) REFERENCES WorkCentres (Code); +ALTER TABLE BOM ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); + +ALTER TABLE BankAccounts ADD FOREIGN KEY (AccountCode) REFERENCES ChartMaster (AccountCode); + + +ALTER TABLE BankTrans ADD FOREIGN KEY (Type) REFERENCES SysTypes (TypeID); +ALTER TABLE BankTrans ADD FOREIGN KEY (BankAct) REFERENCES BankAccounts (AccountCode); + + +ALTER TABLE Buckets ADD FOREIGN KEY (WorkCentre) REFERENCES WorkCentres (Code); + +ALTER TABLE ChartDetails ADD FOREIGN KEY (AccountCode) REFERENCES ChartMaster (AccountCode); +ALTER TABLE ChartDetails ADD FOREIGN KEY (Period) REFERENCES Periods (PeriodNo); + + +ALTER TABLE ChartMaster ADD FOREIGN KEY (Group_) REFERENCES AccountGroups (GroupName); + + +ALTER TABLE ContractBOM ADD INDEX (WorkCentreAdded); + +ALTER TABLE ContractBOM ADD FOREIGN KEY (WorkCentreAdded) REFERENCES WorkCentres (Code); + +ALTER TABLE ContractBOM ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); +ALTER TABLE ContractBOM ADD FOREIGN KEY (Component) REFERENCES StockMaster (StockID); + + +ALTER TABLE ContractReqts ADD FOREIGN KEY (Contract) REFERENCES Contracts (ContractRef); + + +ALTER TABLE `Contracts` DROP INDEX `DebtorNo` , DROP INDEX `BranchCode`, ADD INDEX `DebtorNo` ( `DebtorNo` , `BranchCode` ); + +ALTER TABLE Contracts ADD FOREIGN KEY (DebtorNo, BranchCode) REFERENCES CustBranch (DebtorNo, BranchCode); +ALTER TABLE Contracts ADD FOREIGN KEY (CategoryID) REFERENCES StockCategory (CategoryID); + +ALTER TABLE Contracts ADD FOREIGN KEY (TypeAbbrev) REFERENCES SalesTypes (TypeAbbrev); + + +ALTER TABLE CustAllocns ADD FOREIGN KEY (TransID_AllocFrom) REFERENCES DebtorTrans (ID); +ALTER TABLE CustAllocns ADD FOREIGN KEY (TransID_AllocTo) REFERENCES DebtorTrans (ID); + +ALTER TABLE CustBranch ADD FOREIGN KEY (DebtorNo) REFERENCES DebtorsMaster (DebtorNo); + +ALTER TABLE CustBranch ADD INDEX (Area); +ALTER TABLE CustBranch ADD FOREIGN KEY (Area) REFERENCES Areas (AreaCode); +ALTER TABLE CustBranch ADD FOREIGN KEY (Salesman) REFERENCES Salesman (SalesmanCode); + +ALTER TABLE `CustBranch` ADD INDEX ( `DefaultLocation` ); +ALTER TABLE `CustBranch` ADD INDEX ( `TaxAuthority` ); +ALTER TABLE `CustBranch` ADD INDEX ( `DefaultShipVia` ); + +ALTER TABLE CustBranch ADD FOREIGN KEY (DefaultLocation) REFERENCES Locations (LocCode); + +ALTER TABLE `CustBranch` CHANGE `TaxAuthority` `TaxAuthority` TINYINT DEFAULT '1' NOT NULL; + +ALTER TABLE CustBranch ADD FOREIGN KEY (TaxAuthority) REFERENCES TaxAuthorities (TaxID); +ALTER TABLE CustBranch ADD FOREIGN KEY (DefaultShipVia) REFERENCES Shippers (Shipper_ID); + +ALTER TABLE DebtorTrans ADD FOREIGN KEY (DebtorNo) REFERENCES CustBranch (DebtorNo); +ALTER TABLE DebtorTrans ADD FOREIGN KEY (Type) REFERENCES SysTypes (TypeID); +ALTER TABLE DebtorTrans ADD FOREIGN KEY (Prd) REFERENCES Periods (PeriodNo); + +ALTER TABLE DebtorsMaster ADD FOREIGN KEY (HoldReason) REFERENCES HoldReasons (ReasonCode); +ALTER TABLE `DebtorsMaster` CHANGE `CurrCode` `CurrCode` VARCHAR( 3 ) NOT NULL; + +ALTER TABLE DebtorsMaster ADD FOREIGN KEY (CurrCode) REFERENCES Currencies (CurrAbrev); +ALTER TABLE DebtorsMaster ADD FOREIGN KEY (PaymentTerms) REFERENCES PaymentTerms (TermsIndicator); +ALTER TABLE DebtorsMaster ADD FOREIGN KEY (SalesType) REFERENCES SalesTypes (TypeAbbrev); +ALTER TABLE DiscountMatrix ADD FOREIGN KEY (SalesType) REFERENCES SalesTypes (TypeAbbrev); +ALTER TABLE EDIItemMapping ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE FreightCosts ADD FOREIGN KEY (LocationFrom) REFERENCES Locations (LocCode); + +ALTER TABLE FreightCosts ADD FOREIGN KEY (ShipperID) REFERENCES Shippers (Shipper_ID); +ALTER TABLE GLTrans ADD FOREIGN KEY (Account) REFERENCES ChartMaster (AccountCode); +ALTER TABLE GLTrans ADD FOREIGN KEY (Type) REFERENCES SysTypes (TypeID); +ALTER TABLE GLTrans ADD FOREIGN KEY (PeriodNo) REFERENCES Periods (PeriodNo); +ALTER TABLE GRNs ADD FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID); +ALTER TABLE GRNs ADD FOREIGN KEY (PODetailItem) REFERENCES PurchOrderDetails (PODetailItem); + +ALTER TABLE LocStock ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); +ALTER TABLE LocStock ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); + +ALTER TABLE OrderDeliveryDifferencesLog ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); + +ALTER TABLE OrderDeliveryDifferencesLog ADD FOREIGN KEY (DebtorNo,Branch) REFERENCES CustBranch (DebtorNo,BranchCode); +ALTER TABLE `OrderDeliveryDifferencesLog` ADD INDEX ( `OrderNo` ); +ALTER TABLE OrderDeliveryDifferencesLog ADD FOREIGN KEY (OrderNo) REFERENCES SalesOrders (OrderNo); + +ALTER TABLE Prices ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE Prices ADD FOREIGN KEY (CurrAbrev) REFERENCES Currencies (CurrAbrev); +ALTER TABLE Prices ADD FOREIGN KEY (TypeAbbrev) REFERENCES SalesTypes (TypeAbbrev); + +ALTER TABLE PurchData ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE PurchData ADD FOREIGN KEY (SupplierNo) REFERENCES Suppliers (SupplierID); + +ALTER TABLE PurchOrderDetails ADD FOREIGN KEY (OrderNo) REFERENCES PurchOrders (OrderNo); + +ALTER TABLE PurchOrders ADD FOREIGN KEY (SupplierNo) REFERENCES Suppliers (SupplierID); +ALTER TABLE PurchOrders ADD FOREIGN KEY (IntoStockLocation) REFERENCES Locations (LocCode); + +ALTER TABLE ReportColumns ADD FOREIGN KEY (ReportID) REFERENCES ReportHeaders (ReportID); + +ALTER TABLE `SalesAnalysis` CHANGE `PeriodNo` `PeriodNo` SMALLINT( 6 ) DEFAULT '0' NOT NULL ; +ALTER TABLE SalesAnalysis ADD FOREIGN KEY (PeriodNo) REFERENCES Periods (PeriodNo); + +ALTER TABLE SalesOrderDetails ADD FOREIGN KEY (OrderNo) REFERENCES SalesOrders (OrderNo); +ALTER TABLE SalesOrderDetails ADD FOREIGN KEY (StkCode) REFERENCES StockMaster (StockID); + +ALTER TABLE `SalesOrders` DROP INDEX `BranchCode`; +ALTER TABLE `SalesOrders` ADD INDEX ( `BranchCode`,`DebtorNo` ); + +ALTER TABLE SalesOrders ADD FOREIGN KEY (BranchCode, DebtorNo) REFERENCES CustBranch (BranchCode, DebtorNo); +ALTER TABLE `SalesOrders` ADD INDEX ( `ShipVia` ); +ALTER TABLE SalesOrders ADD FOREIGN KEY (ShipVia) REFERENCES Shippers (Shipper_ID); +ALTER TABLE SalesOrders ADD FOREIGN KEY (FromStkLoc) REFERENCES Locations (LocCode); + +ALTER TABLE Shipments CHANGE ShiptRef ShiptRef INT(11) NOT NULL; +ALTER TABLE `ShipmentCharges` CHANGE `ShiptRef` `ShiptRef` INT( 11 ) NOT NULL; +ALTER TABLE ShipmentCharges ADD FOREIGN KEY (ShiptRef) REFERENCES Shipments (ShiptRef); +ALTER TABLE `ShipmentCharges` ADD INDEX ( `TransType` ); +ALTER TABLE ShipmentCharges ADD FOREIGN KEY (TransType) REFERENCES SysTypes (TypeID); +ALTER TABLE ShipmentCharges ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); + +ALTER TABLE `Shipments` ADD FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID); + +ALTER TABLE `StockCheckFreeze` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE `StockCheckFreeze` ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); + +ALTER TABLE `StockCounts` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE `StockCounts` ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); + +ALTER TABLE `StockMaster` ADD FOREIGN KEY (CategoryID) REFERENCES StockCategory (CategoryID); + +ALTER TABLE `StockMoves` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE `StockMoves` ADD FOREIGN KEY (Type) REFERENCES SysTypes (TypeID); +ALTER TABLE `StockMoves` ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); +ALTER TABLE `StockMoves` ADD FOREIGN KEY (Prd) REFERENCES Periods (PeriodNo); + +DELETE FROM SuppAllocs WHERE ID=4; + +ALTER TABLE SuppAllocs ADD FOREIGN KEY (TransID_AllocFrom) REFERENCES SuppTrans (ID); +ALTER TABLE `SuppAllocs` ADD FOREIGN KEY (TransID_AllocTo) REFERENCES SuppTrans (ID); + +ALTER TABLE `SuppTrans` ADD FOREIGN KEY (Type) REFERENCES SysTypes (TypeID); +ALTER TABLE `SuppTrans` ADD FOREIGN KEY (SupplierNo) REFERENCES Suppliers (SupplierID); +ALTER TABLE `SupplierContacts` ADD FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID); +ALTER TABLE `Suppliers` ADD FOREIGN KEY (CurrCode) REFERENCES Currencies (CurrAbrev); +ALTER TABLE `Suppliers` ADD FOREIGN KEY (PaymentTerms) REFERENCES PaymentTerms (TermsIndicator); + +ALTER TABLE `Suppliers` CHANGE `TaxAuthority` `TaxAuthority` TINYINT DEFAULT '1' NOT NULL; + +ALTER TABLE `Suppliers` ADD FOREIGN KEY (TaxAuthority) REFERENCES TaxAuthorities (TaxID); +ALTER TABLE `WOIssues` ADD FOREIGN KEY (WORef) REFERENCES WorksOrders (WORef); +ALTER TABLE `WOIssues` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE `WOIssues` ADD FOREIGN KEY (WorkCentre) REFERENCES WorkCentres (Code); + +ALTER TABLE `WORequirements` ADD FOREIGN KEY (WORef) REFERENCES WorksOrders (WORef); +ALTER TABLE `WORequirements` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE `WORequirements` ADD FOREIGN KEY (WrkCentre) REFERENCES WorkCentres (Code); + +ALTER TABLE `WWW_Users` ADD INDEX ( `DefaultLocation` ); + +ALTER TABLE `WWW_Users` ADD FOREIGN KEY (DefaultLocation) REFERENCES Locations (LocCode); + +ALTER TABLE `WorkCentres` ADD FOREIGN KEY (Location) REFERENCES Locations (LocCode); + +ALTER TABLE `WorksOrders` ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); +ALTER TABLE `WorksOrders` ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); + +ALTER TABLE DebtorsMaster ADD DiscountCode char(2) NOT NULL default ''; + +commit; \ No newline at end of file Added: trunk/sql/mysql/upgrade2.8-2.9.sql =================================================================== --- trunk/sql/mysql/upgrade2.8-2.9.sql (rev 0) +++ trunk/sql/mysql/upgrade2.8-2.9.sql 2010-12-29 23:18:49 UTC (rev 4455) @@ -0,0 +1,397 @@ +BEGIN; + +ALTER TABLE `BankAccounts` CHANGE `AccountCode` `AccountCode` INT( 11 ) NOT NULL; + +ALTER TABLE TaxAuthorities ADD INDEX (TaxGLCode); +ALTER TABLE TaxAuthorities ADD INDEX (PurchTaxGLAccount); + +ALTER TABLE TaxAuthorities ADD FOREIGN KEY ( TaxGLCode ) REFERENCES ChartMaster( AccountCode ); +ALTER TABLE TaxAuthorities ADD FOREIGN KEY ( PurchTaxGLAccount ) REFERENCES ChartMaster( AccountCode ); + +CREATE TABLE `EDI_ORDERS_Segs` ( + `ID` int(11) NOT NULL auto_increment, + `SegTag` char(3) NOT NULL default '', + `SegGroup` tinyint(4) NOT NULL default '0', + `MaxOccurr` tinyint(4) NOT NULL default '0', + PRIMARY KEY (`ID`), + KEY `SegTag` (`SegTag`), + KEY `SegNo` (`SegGroup`) +) TYPE=InnoDB; + +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('UNB', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('UNH', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('BGM', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '0', '35'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PAI', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALI', '0', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('FTX', '0', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RFF', '1', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '1', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('NAD', '2', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('LOC', '2', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('FII', '2', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RFF', '3', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('CTA', '5', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('COM', '5', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TAX', '6', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '6', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('CUX', '7', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '7', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PAT', '8', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '8', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PCD', '8', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '9', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TDT', '10', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('LOC', '11', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '11', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TOD', '12', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('LOC', '12', '2'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PAC', '13', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PCI', '14', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RFF', '14', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '14', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('GIN', '14', '10'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('EQD', '15', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALC', '19', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALI', '19', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '19', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QTY', '20', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '20', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PCD', '21', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '21', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '22', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '22', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RTE', '23', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '23', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TAX', '24', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '24', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('LIN', '28', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PIA', '28', '25'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('IMD', '28', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MEA', '28', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QTY', '28', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALI', '28', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '28', '35'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '28', '10'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('GIN', '28', '1000'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QVR', '28', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('FTX', '28', '99'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PRI', '32', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('CUX', '32', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '32', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RFF', '33', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '33', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PAC', '34', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QTY', '34', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PCI', '36', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RFF', '36', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '36', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('GIN', '36', '10'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('LOC', '37', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QTY', '37', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '37', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TAX', '38', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '38', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('NAD', '39', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('CTA', '42', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('COM', '42', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALC', '43', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('ALI', '43', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('DTM', '43', '5'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('QTY', '44', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '44', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('PCD', '45', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '45', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '46', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '46', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RTE', '47', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('RNG', '47', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TAX', '48', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '48', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('TDT', '49', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('UNS', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('MOA', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('CNT', '0', '1'); +INSERT INTO `EDI_ORDERS_Segs` (`SegTag` , `SegGroup` , `MaxOccurr` ) VALUES ('UNT', '0', '1'); + +CREATE TABLE `EDI_ORDERS_Seg_Groups` ( + `SegGroupNo` tinyint(4) NOT NULL default '0', + `MaxOccurr` int(4) NOT NULL default '0', + `ParentSegGroup` tinyint(4) NOT NULL default '0', + PRIMARY KEY (`SegGroupNo`) +) TYPE=InnoDB; + + +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (0, 1, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (1, 9999, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (2, 99, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (3, 99, 2); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (5, 5, 2); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (6, 5, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (7, 5, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (8, 10, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (9, 9999, 8); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (10, 10, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (11, 10, 10); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (12, 5, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (13, 99, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (14, 5, 13); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (15, 10, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (19, 99, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (20, 1, 19); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (21, 1, 19); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (22, 2, 19); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (23, 1, 19); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (24, 5, 19); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (28, 200000, 0); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (32, 25, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (33, 9999, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (34, 99, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (36, 5, 34); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (37, 9999, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (38, 10, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (39, 999, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (42, 5, 39); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (43, 99, 28); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (44, 1, 43); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (45, 1, 43); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (46, 2, 43); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (47, 1, 43); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (48, 5, 43); +INSERT INTO `EDI_ORDERS_Seg_Groups` VALUES (49, 10, 28); + + +CREATE TABLE `LocTransfers` ( + `Reference` int(11) NOT NULL default '0', + `StockID` varchar(20) NOT NULL default '', + `ShipQty` int(11) NOT NULL default '0', + `RecQty` int(11) NOT NULL default '0', + `ShipDate` date NOT NULL default '0000-00-00', + `RecDate` date NOT NULL default '0000-00-00', + `ShipLoc` varchar(7) NOT NULL default '', + `RecLoc` varchar(7) NOT NULL default '', + KEY `Reference` (`Reference`,`StockID`), + KEY `ShipLoc` (`ShipLoc`), + KEY `RecLoc` (`RecLoc`), + KEY `StockID` (`StockID`) +) TYPE=InnoDB COMMENT='Stores Transfers To Other Locations'; + +ALTER TABLE `LocTransfers` + ADD CONSTRAINT `LocTransfers_ibfk_3` FOREIGN KEY (`StockID`) REFERENCES `StockMaster` (`StockID`), + ADD CONSTRAINT `LocTransfers_ibfk_1` FOREIGN KEY (`ShipLoc`) REFERENCES `Locations` (`LocCode`), + ADD CONSTRAINT `LocTransfers_ibfk_2` FOREIGN KEY (`RecLoc`) REFERENCES `Locations` (`LocCode`); + +CREATE TABLE StockSerialItems ( + LocCode varchar(5) NOT NULL default '', + StockID varchar(20) NOT NULL default '', + SerialNo varchar(30) NOT NULL default '', + Quantity float NOT NULL default 0, + PRIMARY KEY (StockID, SerialNo, LocCode), + KEY (StockID), + KEY (LocCode) +) TYPE=InnoDB; + +CREATE TABLE StockSerialMoves ( + StkItmMoveNo int(11) NOT NULL auto_increment, + StockMoveNo int(11) NOT NULL default '0', + StockID varchar(20) NOT NULL default '', + SerialNo varchar(30) NOT NULL default '', + MoveQty float NOT NULL default '0', + PRIMARY KEY (StkItmMoveNo), + KEY StockMoveNo (StockMoveNo), + KEY StockID_SN (StockID, SerialNo) +) TYPE=InnoDB; + +ALTER TABLE StockSerialMoves ADD FOREIGN KEY (StockMoveNo) REFERENCES StockMoves (StkMoveNo); +ALTER TABLE StockSerialItems ADD FOREIGN KEY (StockID) REFERENCES StockMaster (StockID); +ALTER TABLE StockSerialItems ADD FOREIGN KEY (LocCode) REFERENCES Locations (LocCode); +ALTER TABLE StockSerialMoves ADD FOREIGN KEY (StockID, SerialNo) REFERENCES StockSerialItems (StockID, SerialNo); + +ALTER TABLE `StockMaster` ADD `Serialised` TINYINT DEFAULT '0' NOT NULL ; +ALTER TABLE `StockMaster` ADD `DecimalPlaces` TINYINT DEFAULT '0' NOT NULL ; +ALTER TABLE `StockMoves` DROP `Bundle`; + +CREATE TABLE `Help` ( + ID INT NOT NULL AUTO_INCREMENT, + PageID SMALLINT NOT NULL, + Narrative TEXT NOT NULL, + HelpType CHAR NOT NULL DEFAULT 'U', + PRIMARY KEY (`ID`), + INDEX (`PageID`), + INDEX (`HelpType`) +)TYPE=InnoDB COMMENT='Context Sensitive Help Narrative'; + +CREATE TABLE Scripts ( + PageID smallint(4) NOT NULL default '0', + FileName varchar(50) NOT NULL default '', + PageDescription text NOT NULL, + PRIMARY KEY (PageID), + KEY FileName (FileName) +) TYPE=InnoDB COMMENT='Index of all scripts'; + + +ALTER TABLE Help ADD FOREIGN KEY (PageID) REFERENCES Scripts (PageID); + +INSERT INTO Scripts VALUES (1, 'AccountGroups.php', 'Defines the groupings of general ledger accounts'); +INSERT INTO Scripts VALUES (2, 'AgedDebtors.php', 'Lists customer account balances in detail or summary in selected currency'); +INSERT INTO Scripts VALUES (3, 'AgedSuppliers.php', 'Lists supplier account balances in detail or summary in selected currency'); +INSERT INTO Scripts VALUES (4, 'Areas.php', 'Defines the sales areas - all customers must belong to a sales area for the purposes of sales analysis'); +INSERT INTO Scripts VALUES (5, 'BOMInquiry.php', 'Displays the bill of material with cost information'); +INSERT INTO Scripts VALUES (6, 'BOMListing.php', 'Lists the bills of material for a selected range of items'); +INSERT INTO Scripts VALUES (7, 'BOMs.php', 'Administers the bills of material for a selected item'); +INSERT INTO Scripts VALUES (8, 'BankAccounts.php', 'Defines the general ledger code for bank accounts and specifies that bank transactions be created for these accounts for the purposes of reconciliation'); +INSERT INTO Scripts VALUES (9, 'BankMatching.php', 'Allows payments and receipts to be matched off against bank statements'); +INSERT INTO Scripts VALUES (10, 'BankReconciliation.php', 'Displays the bank reconciliation for a selected bank account'); +INSERT INTO Scripts VALUES (11, 'COGSGLPostings.php', 'Defines the general ledger account to be used for cost of sales entries'); +INSERT INTO Scripts VALUES (12, 'CompanyPreferences.php', 'Defines the settings applicable for the company, including name, address, tax authority reference, whether GL integration used etc.'); +INSERT INTO Scripts VALUES (13, 'ConfirmDispatchControlled_Invoice.php', 'Specifies the batch references/serial numbers of items dispatched that are being invoiced'); +INSERT INTO Scripts VALUES (14, 'ConfirmDispatch_Invoice.php', 'Creates sales invoices from entered sales orders based on the quantities dispatched that can be modified'); +INSERT INTO Scripts VALUES (15, 'CreditItemsControlled.php', 'Specifies the batch references/serial numbers of items being credited back into stock'); +INSERT INTO Scripts VALUES (16, 'CreditStatus.php', 'Defines the credit status records. Each customer account is given a credit status from this table. Some credit status records can prohibit invoicing and new orders being entered.'); +INSERT INTO Scripts VALUES (17, 'Credit_Invoice.php', 'Creates a credit note based on the details of an existing invoice'); +INSERT INTO Scripts VALUES (18, 'Currencies.php', 'Defines the currencies available. Each customer and supplier must be defined as transacting in one of the currencies defined here.'); +INSERT INTO Scripts VALUES (19, 'CustEDISetup.php', 'Allows the set up the customer specified EDI parameters for server, email or ftp.'); +INSERT INTO Scripts VALUES (20, 'CustWhereAlloc.php', 'Shows to which invoices a receipt was allocated to'); +INSERT INTO Scripts VALUES (21, 'CustomerAllocations.php', 'Allows customer receipts and credit notes to be allocated to sales invoices'); +INSERT INTO Scripts VALUES (22, 'CustomerBranches.php', 'Defines the details of customer branches such as delivery address and contact details - also sales area, representative etc'); +INSERT INTO Scripts VALUES (23, 'CustomerInquiry.php', 'Shows the customers account transactions with balances outstanding, links available to drill down to invoice/credit note or email invoices/credit notes'); +INSERT INTO Scripts VALUES (24, 'CustomerReceipt.php', 'Entry of both customer receipts against accounts receivable and also general ledger or nominal receipts'); +INSERT INTO Scripts VALUES (25, 'CustomerTransInquiry.php', 'Lists in html the sequence of customer transactions, invoices, credit notes or receipts by a user entered date range'); +INSERT INTO Scripts VALUES (26, 'Customers.php', 'Defines the setup of a customer account, including payment terms, billing address, credit status, currency etc'); +INSERT INTO Scripts VALUES (27, 'DeliveryDetails.php', 'Used during order entry to allow the entry of delivery addresses other than the defaulted branch delivery address and information about carrier/shipping method etc'); +INSERT INTO Scripts VALUES (28, 'DiscountCategories.php', 'Defines the items belonging to a discount category. Discount Categories are used to allow discounts based on quantities across a range of producs'); +INSERT INTO Scripts VALUES (29, 'DiscountMatrix.php', 'Defines the rates of discount applicable to discount categories and the customer groupings to which the rates are to apply'); +INSERT INTO Scripts VALUES (30, 'EDIMessageFormat.php', 'Specifies the EDI message format used by a customer - administrator use only.'); +INSERT INTO Scripts VALUES (31, 'EDIProcessOrders.php', 'Processes incoming EDI orders into sales orders'); +INSERT INTO Scripts VALUES (32, 'EDISendInvoices.php', 'Processes invoiced EDI customer invoices into EDI messages and sends using the customers preferred method either ftp or email attachments.'); +INSERT INTO Scripts VALUES (33, 'EmailCustTrans.php', 'Emails selected invoice or credit to the customer'); +INSERT INTO Scripts VALUES (34, 'FTP_RadioBeacon.php', 'FTPs sales orders for dispatch to a radio beacon software enabled warehouse dispatching facility'); +INSERT INTO Scripts VALUES (35, 'FreightCosts.php', 'Defines the setup of the freight cost using different shipping methods to different destinations. The system can use this information to calculate applicable freight if the items are defined with the correct kgs and cubic volume'); +INSERT INTO Scripts VALUES (36, 'GLAccountInquiry.php', 'Shows the general ledger transactions for a specified account over a specified range of periods'); +INSERT INTO Scripts VALUES (37, 'GLAccounts.php', 'Defines the general ledger accounts'); +INSERT INTO Scripts VALUES (38, 'GLBalanceSheet.php', 'Shows the balance sheet for the company as at a specified date'); +INSERT INTO Scripts VALUES (39, 'GLCodesInquiry.php', 'Shows the list of general ledger codes defined with account names and groupings'); +INSERT INTO Scripts VALUES (40, 'GLJournal.php', 'Entry of general ledger journals, periods are calculated based on the date entered here'); +INSERT INTO Scripts VALUES (41, 'GLProfit_Loss.php', 'Shows the profit and loss of the company for the range of periods entered'); +INSERT INTO Scripts VALUES (42, 'GLTransInquiry.php', 'Shows the general ledger journal created for the sub ledger transaction specified'); +INSERT INTO Scripts VALUES (43, 'GLTrialBalance.php', 'Shows the trial balance for the month and the for the period selected together with the budgeted trial balances'); +INSERT INTO Scripts VALUES (44, 'GoodsReceived.php', 'Entry of items received against purchase orders'); +INSERT INTO Scripts VALUES (45, 'GoodsReceivedControlled.php', 'Entry of the serial numbers or batch references for controlled items received against purchase orders'); +INSERT INTO Scripts VALUES (46, 'InventoryPlanning.php', 'Creates a pdf report showing the last 4 months use of items including as a component of assemblies together with stock quantity on hand, current demand for the item and current quantity on sales order.'); +INSERT INTO Scripts VALUES (47, 'InventoryValuation.php', 'Creates a pdf report showing the value of stock at standard cost for a range of product categories selected'); +INSERT INTO Scripts VALUES (48, 'Locations.php', 'Defines the inventory stocking locations or warehouses'); +INSERT INTO Scripts VALUES (49, 'Logout.php', 'Shows when the user logs out of webERP'); +INSERT INTO Scripts VALUES (50, 'MailInventoryValuation.php', 'Meant to be run as a scheduled process to email the stock valuation off to a specified person. Creates the same stock valuation report as InventoryValuation.php'); +INSERT INTO Scripts VALUES (51, 'MailSalesReport.php', 'Creates a sales analysis pdf report and emails it to the defined receipients. This script is meant to be run as a scheduled process for daily or weekly sales reporting'); +INSERT INTO Scripts VALUES (52, 'MailSalesReport_csv.php', 'Creates a sales analysis report as a comma separated values (csv) file and emails it to the defined receipients. This script is meant to be run as a scheduled process for daily or weekly sales reporting'); +INSERT INTO Scripts VALUES (53, 'OrderDetails.php', 'Shows the detail of a sales order'); +INSERT INTO Scripts VALUES (54, 'OutstandingGRNs.php', 'Creates a pdf showing all GRNs for which there has been no purchase invoice matched off against.'); +INSERT INTO Scripts VALUES (55, 'PDFBankingSummary.php', 'Creates a pdf showing the amounts entered as receipts on a specified date together with references for the purposes of banking'); +INSERT INTO Scripts VALUES (56, 'PDFChequeListing.php', 'Creates a pdf showing all payments that have been made from a specified bank account over a specified period. This can be emailed to an email account defined in config.php - ie a financial controller'); +INSERT INTO Scripts VALUES (57, 'PDFDeliveryDifferences.php', 'Creates a pdf report listing the delivery differences from what the customer requested as recorded in the order entry. The report calculates a percentage of order fill based on the number of orders filled in full on time'); +INSERT INTO Scripts VALUES (58, 'PDFLowGP.php', 'Creates a pdf report showing the low gross profit sales made in the selected date range. The percentage of gp deemed acceptable can also be entered'); +INSERT INTO Scripts VALUES (59, 'PDFPriceList.php', 'Creates a pdf of the price list applicable to a given sales type and customer. Also allows the listing of prices specific to a customer'); +INSERT INTO Scripts VALUES (60, 'PDFStockCheckComparison.php', 'Creates a pdf comparing the quantites entered as counted at a given range of locations against the quantity stored as on hand as at the time a stock check was initiated.'); +INSERT INTO Scripts VALUES (61, 'PDFStockLocTransfer.php', 'Creates a stock location transfer docket for the selected location transfer reference number'); +INSERT INTO Scripts VALUES (62, 'PO_Chk_ShiptRef_JobRef.php', 'Checks the Shipment of JobReference number is correct during AP invoice entry'); +INSERT INTO Scripts VALUES (63, 'PO_Header.php', 'Entry of a purchase order header record - date, references buyer etc'); +INSERT INTO Scripts VALUES (64, 'PO_Items.php', 'Entry of a purchase order items - allows entry of items with lookup of currency cost from Purchasing Data previously entered also allows entry of nominal items against a general ledger code if the AP is integrated to the GL'); +INSERT INTO Scripts VALUES (65, 'PO_OrderDetails.php', 'Purchase order inquiry shows the quantity received and invoiced of purchase order items as well as the header information'); +INSERT INTO Scripts VALUES (66, 'PO_PDFPurchOrder.php', 'Creates a pdf of the selected purchase order for printing or email to one of the supplier contacts entered'); +INSERT INTO Scripts VALUES (67, 'PO_SelectOSPurchOrder.php', 'Shows the outstanding purchase orders for selecting with links to receive or modify the purchase order header and items'); +INSERT INTO Scripts VALUES (68, 'PO_SelectPurchOrder.php', 'Allows selection of any purchase order with links to the inquiry'); +INSERT INTO Scripts VALUES (69, 'PaymentTerms.php', 'Defines the payment terms records, these can be expressed as either a number of days credit or a day in the following month. All customers and suppliers must have a corresponding payment term recorded against their account'); +INSERT INTO Scripts VALUES (70, 'Payments.php', 'Entry of bank account payments either against an AP account or a general ledger payment - if the AP-GL link in company preferences is set'); +INSERT INTO Scripts VALUES (71, 'PeriodsInquiry.php', 'Shows a list of all the system defined periods'); +INSERT INTO Scripts VALUES (72, 'Prices.php', 'Entry of prices for a selected item also allows selection of sales type and currency for the price'); +INSERT INTO Scripts VALUES (73, 'Prices_Customer.php', 'Entry of prices for a selected item and selected customer/branch. The currency and sales type is defaulted from the customer\'s record'); +INSERT INTO Scripts VALUES (74, 'PrintCustOrder.php', 'Creates a pdf of the dispatch note - by default this is expected to be on two part pre-printed stationery to allow pickers to note discrepancies for the confirmer to update the dispatch at the time of invoicing'); +INSERT INTO Scripts VALUES (75, 'PrintCustOrder_generic.php', 'Creates two copies of a laser printed dispatch note - both copies need to be written on by the pickers with any discrepancies to advise customer of any shortfall and on the office copy to ensure the correct quantites are invoiced'); +INSERT INTO Scripts VALUES (76, 'PrintCustStatements.php', 'Creates a pdf for the customer statements in the selected range'); +INSERT INTO Scripts VALUES (77, 'PrintCustTrans.php', 'Creates either a html invoice or credit note or a pdf. A range of invoices or credit notes can be selected also.'); +INSERT INTO Scripts VALUES (78, 'PurchData.php', 'Entry of supplier purchasing data, the suppliers part reference and the suppliers currency cost of the item'); +INSERT INTO Scripts VALUES (79, 'ReverseGRN.php', 'Reverses the entry of goods received - creating stock movements back out and necessary general ledger journals to effect the reversal'); +INSERT INTO Scripts VALUES (80, 'SalesAnalReptCols.php', 'Entry of the definition of a sales analysis report\'s columns.'); +INSERT INTO Scripts VALUES (81, 'SalesAnalRepts.php', 'Entry of the definition of a sales analysis report headers'); +INSERT INTO Scripts VALUES (82, 'SalesAnalysis_UserDefined.php', 'Creates a pdf of a selected user defined sales analysis report'); +INSERT INTO Scripts VALUES (83, 'SalesGLPostings.php', 'Defines the general ledger accounts used to post sales to based on product categories and sales areas'); +INSERT INTO Scripts VALUES (84, 'SalesPeople.php', 'Defines the sales people of the business'); +INSERT INTO Scripts VALUES (85, 'SalesTypes.php', 'Defines the sales types - prices are held against sales types they can be considered price lists. Sales analysis records are held by sales type too.'); +INSERT INTO Scripts VALUES (86, 'SelectCompletedOrder.php', 'Allows the selection of completed sales orders for inquiries - choices to select by item code or customer'); +INSERT INTO Scripts VALUES (87, 'SelectCreditItems.php', 'Entry of credit notes from scratch, selecting the items in either quick entry mode or searching for them manually'); +INSERT INTO Scripts VALUES (88, 'SelectCustomer.php', 'Selection of customer - from where all customer related maintenance, transactions and inquiries start'); +INSERT INTO Scripts VALUES (89, 'SelectGLAccount.php', 'Selection of general ledger account from where all general ledger account maintenance, or inquiries are initiated'); +INSERT INTO Scripts VALUES (90, 'SelectOrderItems.php', 'Entry of sales order items with both quick entry and part search functions'); +INSERT INTO Scripts VALUES (91, 'SelectProduct.php', 'Selection of items. All item maintenance, transactions and inquiries start with this script'); +INSERT INTO Scripts VALUES (92, 'SelectSalesOrder.php', 'Selects a sales order irrespective of completed or not for inquiries'); +INSERT INTO Scripts VALUES (93, 'SelectSupplier.php', 'Selects a supplier. A supplier is required to be selected before any AP transactions and before any maintenance or inquiry of the supplier'); +INSERT INTO Scripts VALUES (94, 'ShipmentCosting.php', 'Shows the costing of a shipment with all the items invoice values and any shipment costs apportioned. Updating the shipment has an option to update standard costs of all items on the shipment and create any general ledger variance journals'); +INSERT INTO Scripts VALUES (95, 'Shipments.php', 'Entry of shipments from outstanding purchase orders for a selected supplier - changes in the delivery date will cascade into the different purchase orders on the shipment'); +INSERT INTO Scripts VALUES (96, 'Shippers.php', 'Defines the shipping methods available. Each customer branch has a default shipping method associated with it which must match a record from this table'); +INSERT INTO Scripts VALUES (97, 'Shipt_Select.php', 'Selection of a shipment for displaying and modification or updating'); +INSERT INTO Scripts VALUES (98, 'ShiptsList.php', 'Shows a list of all the open shipments for a selected supplier. Linked from POItems.php'); +INSERT INTO Scripts VALUES (99, 'SpecialOrder.php', 'Allows for a sales order to be created and an indent order to be created on a supplier for a one off item that may never be purchased again. A dummy part is created based on the description and cost details given.'); +INSERT INTO Scripts VALUES (100, 'StockAdjustments.php', 'Entry of quantity corrections to stocks in a selected location.'); +INSERT INTO Scripts VALUES (101, 'StockAdjustmentsControlled.php', 'Entry of batch references or serial numbers on controlled stock items being adjusted'); +INSERT INTO Scripts VALUES (102, 'StockCategories.php', 'Defines the stock categories. All items must refer to one of these categories. The category record also allows the specification of the general ledger codes where stock items are to be posted - the balance sheet account and the profit and loss effect of any adjustments and the profit and loss effect of any price variances'); +INSERT INTO Scripts VALUES (103, 'StockCheck.php', 'Allows creation of a stock check file - copying the current quantites in stock for later comparison to the entered counts. Also produces a pdf for the count sheets.'); +INSERT INTO Scripts VALUES (104, 'StockCostUpdate.php', 'Allows update of the standard cost of items producing general ledger journals if the company preferences stock GL interface is active'); +INSERT INTO Scripts VALUES (105, 'StockCounts.php', 'Allows entry of stock counts'); +INSERT INTO Scripts VALUES (106, 'StockLocMovements.php', 'Inquiry shows the Movements of all stock items for a specified location'); +INSERT INTO Scripts VALUES (107, 'StockLocQties_csv.php', 'Makes a comma separated values (CSV)file of the stock item codes and quantities'); +INSERT INTO Scripts VALUES (108, 'StockLocStatus.php', 'Shows the stock on hand together with outstanding sales orders and outstanding purchase orders by stock location for all items in the selected stock category'); +INSERT INTO Scripts VALUES (109, 'StockLocTransfer.php', 'Entry of a bulk stock location transfer for many parts from one location to another.'); +INSERT INTO Scripts VALUES (110, 'StockLocTransferReceive.php', 'Effects the transfer and creates the stock movements for a bulk stock location transfer initiated from StockLocTransfer.php'); +INSERT INTO Scripts VALUES (111, 'StockMovements.php', 'Shows a list of all the stock movements for a selected item and stock location including the price at which they were sold in local currency and the price at which they were purchased for in local currency'); +INSERT INTO Scripts VALUES (112, 'StockQties_csv.php', 'Makes a comma separated values (CSV)file of the stock item codes and quantities'); +INSERT INTO Scripts VALUES (113, 'StockReorderLevel.php', 'Entry and review of the re-order level of items by stocking location'); +INSERT INTO Scripts VALUES (114, 'StockSerialItems.php', 'Shows a list of the serial numbers or the batch references and quantities of controlled items. This inquiry is linked from the stock status inquiry'); +INSERT INTO Scripts VALUES (115, 'StockStatus.php', 'Shows the stock on hand together with outstanding sales orders and outstanding purchase orders by stock location for a selected part. Has a link to show the serial numbers in stock at the location selected if the item is controlled'); +INSERT INTO Scripts VALUES (116, 'StockTransferControlled.php', 'Entry of serial numbers/batch references for controlled items being received on a stock transfer. The script is used by both bulk transfers and point to point transfers'); +INSERT INTO Scripts VALUES (117, 'StockTransfers.php', 'Entry of point to point stock location transfers of a single part'); +INSERT INTO Scripts VALUES (118, 'StockUsage.php', 'Inquiry showing the quantity of stock used by period calculated from the sum of the stock movements over that period - by item and stock location. Also available over all locations'); +INSERT INTO Scripts VALUES (119, 'Stocks.php', 'Defines an item - maintenance and addition of new parts'); +INSERT INTO Scripts VALUES (120, 'SuppCreditGRNs.php', 'Entry of a supplier credit notes (debit notes) against existing GRN which have already been matched in full or in part'); +INSERT INTO Scripts VALUES (121, 'SuppInvGRNs.php', 'Entry of supplier invoices against goods received'); +INSERT INTO Scripts VALUES (122, 'SuppPaymentRun.php', 'Automatic creation of payment records based on calculated amounts due from AP invoices entered'); +INSERT INTO Scripts VALUES (123, 'SuppShiptChgs.php', 'Entry of supplier invoices against shipments as charges against a shipment'); +INSERT INTO Scripts VALUES (124, 'SuppTransGLAnalysis.php', 'Entry of supplier invoices against general ledger codes'); +INSERT INTO Script... [truncated message content] |