[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6370] trunk



Revision: 6370
          http://sourceforge.net/p/ledger-smb/code/6370
Author:   ehuelsmann
Date:     2014-01-03 23:38:30 +0000 (Fri, 03 Jan 2014)
Log Message:
-----------
SL 2.8 upgrade checks and script fixes (still work in progress).

Modified Paths:
--------------
    trunk/LedgerSMB/Upgrade_Tests.pm
    trunk/sql/upgrade/sl2.8-1.3.sql

Modified: trunk/LedgerSMB/Upgrade_Tests.pm
===================================================================
--- trunk/LedgerSMB/Upgrade_Tests.pm	2014-01-03 23:37:04 UTC (rev 6369)
+++ trunk/LedgerSMB/Upgrade_Tests.pm	2014-01-03 23:38:30 UTC (rev 6370)
@@ -237,7 +237,128 @@
   max_version => '1.4'
 );
 
+=item
 
+push @tests, __PACKAGE__->new(
+    test_query => "select * from customer where arap_accno_id is null",
+    display_name => $LedgerSMB::App_State::Locale->text('Empty AR account'),
+    name => 'no_null_ar_accounts',
+    display_cols => [ 'id', 'name', 'contact' ],
+    appname => 'sql-ledger',
+    min_version => '2.7',
+    max_version => '2.8'
+    );
+
+push @tests, __PACKAGE__->new(
+    test_query => "select * from vendor where arap_accno_id is null",
+    display_name => $LedgerSMB::App_State::Locale->text('Empty AP account'),
+    name => 'no_null_ap_accounts',
+    display_cols => [ 'id', 'name', 'contact' ],
+    appname => 'sql-ledger',
+    min_version => '2.7',
+    max_version => '2.8'
+    );
+*/
+
+=cut
+
+push @tests,__PACKAGE__->new(
+    test_query => "select *
+                    from customer
+                   where customernumber in (select customernumber
+                                              from customer
+                                             group by customernumber
+                                             having count(*) > 1)",
+    display_name => $LedgerSMB::App_State::Locale->text('Double customernumbers'), 
+    name => 'no_double_customernumbers',
+    display_cols => ['id', 'customernumber', 'name'],
+    column => 'customernumber',
+    table => 'customer',
+    appname => 'sql-ledger',
+    min_version => '2.7',
+    max_version => '2.8'
+    );
+
+push @tests,__PACKAGE__->new(
+    test_query => "select *
+                    from vendor
+                   where vendornumber in (select vendornumber
+                                              from vendor
+                                             group by vendornumber
+                                             having count(*) > 1)",
+    display_name => $LedgerSMB::App_State::Locale->text('Double vendornumbers'), 
+    name => 'no_double_vendornumbers',
+    display_cols => ['id', 'vendornumber', 'name'],
+    column => 'vendornumber',
+    table => 'vendor',
+    appname => 'sql-ledger',
+    min_version => '2.7',
+    max_version => '2.8'
+    );
+
+push @tests, __PACKAGE__->new(
+    test_query => "select *
+                     from employee
+                    where employeenumber is null",
+    display_name => $LedgerSMB::App_State::Locale->text('Null employee numbers'),
+    name => 'no_null_employeenumbers',
+    display_cols => ['id', 'login', 'name', 'employeenumber'],
+    column => 'employeenumber',
+    table => 'employee',
+    appname => 'sql-ledger',
+    min_version => '2.7',
+    max_version => '2.8'
+    );
+
+push @tests, __PACKAGE__->new(
+    test_query => "select *
+                     from employee
+                    where employeenumber in (select employeenumber
+                                               from employee
+                                              group by employeenumber
+                                              having count(*) > 1",
+    display_name => $LedgerSMB::App_State::Locale->text('Null employee numbers'),
+    name => 'no_duplicate_employeenumbers',
+    display_cols => ['id', 'login', 'name', 'employeenumber'],
+    column => 'employeenumber',
+    table => 'employee',
+    appname => 'sql-ledger',
+    min_version => '2.7',
+    max_version => '2.8'
+    );
+
+
+push @tests, __PACKAGE__->new(
+    test_query => "select *
+                     from makemodel
+                    where model is null",
+    display_name => $LedgerSMB::App_State::Locale->text('Null model numbers'),
+    name => 'no_null_employeenumbers',
+    display_cols => ['parts_id', 'make', 'model'],
+    column => 'model',
+    table => 'makemodel',
+    appname => 'sql-ledger',
+    min_version => '2.7',
+    max_version => '2.8'
+    );
+
+
+push @tests, __PACKAGE__->new(
+    test_query => "select *
+                     from makemodel
+                    where make is null",
+    display_name => $LedgerSMB::App_State::Locale->text('Null make numbers'),
+    name => 'no_null_employeenumbers',
+    display_cols => ['parts_id', 'make', 'model'],
+    column => 'make',
+    table => 'makemodel',
+    appname => 'sql-ledger',
+    min_version => '2.7',
+    max_version => '2.8'
+    );
+
+
+
 __PACKAGE__->meta->make_immutable;
 
 1;

Modified: trunk/sql/upgrade/sl2.8-1.3.sql
===================================================================
--- trunk/sql/upgrade/sl2.8-1.3.sql	2014-01-03 23:37:04 UTC (rev 6369)
+++ trunk/sql/upgrade/sl2.8-1.3.sql	2014-01-03 23:38:30 UTC (rev 6370)
@@ -218,10 +218,10 @@
 OR
 
     lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.country))
+JOIN (select credit_id, id from sl28.vendor
+          union
+           select credit_id, id from sl28.customer) v ON oa.trans_id = v.id
 JOIN entity_credit_account eca ON (v.credit_id = eca.id)
-JOIN (select credit_id, id from vendor
-          union
-           select credit_id, id from customer) v ON oa.trans_id = v.id
 GROUP BY eca.id;
 
 -- Shipto
@@ -262,10 +262,10 @@
 OR
 
     lower(trim(both ' ' from c.short_name)) = lower( trim(both ' ' from oa.shiptocountry))
-JOIN (select credit_id, id from vendor
+JOIN (select credit_id, id from sl28.vendor
           union
-           select credit_id, id from customer) ov ON oa.trans_id = v.id
-JOIN entity_credit_account eca ON (ov.credit_id = eca.id)
+           select credit_id, id from sl28.customer) v ON oa.trans_id = v.id
+JOIN entity_credit_account eca ON (v.credit_id = eca.id)
 GROUP BY eca.id;
 
 INSERT INTO eca_note(note_class, ref_key, note, vector)
@@ -323,9 +323,11 @@
 
 -- must rebuild this table due to changes since 1.2
 
-INSERT INTO makemodel
-SELECT * FROM sl28.makemodel;
+INSERT INTO parts SELECT * FROM sl28.parts;
 
+INSERT INTO makemodel (parts_id, make, model) 
+SELECT parts_id, make, model FROM sl28.makemodel;
+
 INSERT INTO gifi
 SELECT * FROM sl28.gifi;
 
@@ -335,8 +337,6 @@
  WHERE setting_key IN (select setting_key FROM sl28.defaults);
 
 
-INSERT INTO parts SELECT * FROM sl28.parts;
-
 INSERT INTO assembly SELECT * FROM sl28.assembly;
 
 ALTER TABLE gl DISABLE TRIGGER gl_audit_trail;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits