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

SF.net SVN: ledger-smb:[4143] branches/1.3



Revision: 4143
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4143&view=rev
Author:   einhverfr
Date:     2011-12-05 06:46:59 +0000 (Mon, 05 Dec 2011)
Log Message:
-----------
Fixing part account mapping broken after upgrade from 1.2

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/sql/modules/Fixes.sql

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2011-12-04 23:33:20 UTC (rev 4142)
+++ branches/1.3/Changelog	2011-12-05 06:46:59 UTC (rev 4143)
@@ -15,6 +15,7 @@
 * Fixed company fax being printed under shipto (Herman V)
 * Fixed "File does not exist... [object HTMLButtonElement]" js error (Herman V)
 * Fixed timecard template headers not showing company name, etc (Chris T)
+* Fixed part account mappings broken after upgrade from 1.2 (Chris T)
 
 Changelog for LedgerSMB 1.3.7 (Categorized due to length)
 Database

Modified: branches/1.3/sql/modules/Fixes.sql
===================================================================
--- branches/1.3/sql/modules/Fixes.sql	2011-12-04 23:33:20 UTC (rev 4142)
+++ branches/1.3/sql/modules/Fixes.sql	2011-12-05 06:46:59 UTC (rev 4143)
@@ -61,3 +61,21 @@
 ALTER TABLE entity_bank_account ADD UNIQUE(bic,iban);
 CREATE UNIQUE INDEX eba_iban_null_bic_u ON entity_bank_account(iban) WHERE bic IS NULL;
 COMMIT;
+
+BEGIN; -- Data fixes for 1.2-1.3 upgrade.  Will fail otherwise --Chris T
+UPDATE parts 
+   SET income_accno_id = (SELECT account.id 
+                            FROM account JOIN lsmb12.chart USING (accno)
+                           WHERE chart.id = income_accno_id),
+       expense_accno_id = (SELECT account.id 
+                            FROM account JOIN lsmb12.chart USING (accno)
+                           WHERE chart.id = expense_accno_id),
+       inventory_accno_id = (SELECT account.id
+                            FROM account JOIN lsmb12.chart USING (accno)
+                           WHERE chart.id = inventory_accno_id)
+ WHERE id IN (SELECT id FROM lsmb12.parts op 
+               WHERE op.id = parts.id 
+                     AND (op.income_accno_id = parts.income_accno_id
+                          OR op.inventory_accno_id = parts.inventory_accno_id 
+                          or op.expense_accno_id = parts.expense_accno_id));
+COMMIT; 

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