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

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



Revision: 3290
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3290&view=rev
Author:   ehuelsmann
Date:     2011-06-19 18:42:17 +0000 (Sun, 19 Jun 2011)

Log Message:
-----------
First step at resolving 3321964: Add a 'tax' boolean to the 'account' table,
which serves to tell the application the account is tax related.


 * sql/Pg-database.sql
   (account [TABLE]): Add 'tax' bool-typed field.
   (chart [VIEW]): Add 'tax' field.

 * sql/modules/Account.sql
   (account_save [FUNCTION]): Add a 'in_tax' parameter,
     to be stored in the 'account.tax' field.
   (chart_i [RULE]): Give 'tax' field same treatment as 'contra'.

 * UI/accounts/edit.html: Add checkbox for 'tax' field, copied from 'contra'.

 * LedgerSMB/DBObject/Account.pm
   (save): Set the value for the 'tax' field to 0 (false) if
     the form doesn't specify a value  -- same as 'contra'.

 * scripts/account.pl
   (_display_account_screen): Set the value of the Tax checkbox, like 'contra'.

 * sql/coa/*/chart/*.sql:
   Change account_save() invocations to include the 'tax' parameter (always
    false).  At the end, insert a query to set the 'tax' field to true
    for those accounts which have tax related links.

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Account.pm
    trunk/UI/accounts/edit.html
    trunk/scripts/account.pl
    trunk/sql/Pg-database.sql
    trunk/sql/coa/at/chart/General.sql
    trunk/sql/coa/au/chart/General-0000.sql
    trunk/sql/coa/au/chart/General-00000.sql
    trunk/sql/coa/be/chart/General.sql
    trunk/sql/coa/br/chart/General.sql
    trunk/sql/coa/ca/chart/English_General.sql
    trunk/sql/coa/ca/chart/French-Quebec_General.sql
    trunk/sql/coa/ch/chart/German.sql
    trunk/sql/coa/cn/chart/General.sql
    trunk/sql/coa/co/chart/PUC.sql
    trunk/sql/coa/cz/chart/General.sql
    trunk/sql/coa/de/chart/DATEV-SKR03.sql
    trunk/sql/coa/de/chart/General.sql
    trunk/sql/coa/de/chart/SKR03.sql
    trunk/sql/coa/dk/chart/General.sql
    trunk/sql/coa/eg/chart/General.sql
    trunk/sql/coa/es/chart/General.sql
    trunk/sql/coa/es/chart/ISO.sql
    trunk/sql/coa/fr/chart/General.sql
    trunk/sql/coa/hu/chart/Complete.sql
    trunk/sql/coa/hu/chart/Minimal.sql
    trunk/sql/coa/hu/chart/Old-general.sql
    trunk/sql/coa/id/chart/General.sql
    trunk/sql/coa/it/chart/General.sql
    trunk/sql/coa/it/chart/cc2424.sql
    trunk/sql/coa/lv/chart/General.sql
    trunk/sql/coa/nl/chart/General.sql
    trunk/sql/coa/nl/chart/Simple.sql
    trunk/sql/coa/no/chart/General.sql
    trunk/sql/coa/pl/chart/General.sql
    trunk/sql/coa/py/chart/General.sql
    trunk/sql/coa/se/chart/Agriculture.sql
    trunk/sql/coa/se/chart/Church_Society.sql
    trunk/sql/coa/se/chart/General.sql
    trunk/sql/coa/tw/chart/General.sql
    trunk/sql/coa/uk/chart/General.sql
    trunk/sql/coa/us/chart/General.sql
    trunk/sql/coa/us/chart/Manufacturing.sql
    trunk/sql/coa/us/chart/Service.sql
    trunk/sql/coa/us/chart/UCOA-Form990.sql
    trunk/sql/coa/us/chart/UCOA-Form990EZ.sql
    trunk/sql/coa/ve/chart/General.sql
    trunk/sql/modules/Account.sql

Modified: trunk/LedgerSMB/DBObject/Account.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Account.pm	2011-06-19 13:35:14 UTC (rev 3289)
+++ trunk/LedgerSMB/DBObject/Account.pm	2011-06-19 18:42:17 UTC (rev 3290)
@@ -28,6 +28,9 @@
     if (!defined $self->{contra}){
         $self->{contra} = '0';
     }
+    if (!defined $self->{tax}) {
+	$self->{tax} = '0';
+    }
     $self->generate_links;
     my $func = 'account_save';
     if ($self->{charttype} and $self->{charttype} eq 'H') {

Modified: trunk/UI/accounts/edit.html
===================================================================
--- trunk/UI/accounts/edit.html	2011-06-19 13:35:14 UTC (rev 3289)
+++ trunk/UI/accounts/edit.html	2011-06-19 18:42:17 UTC (rev 3290)
@@ -72,6 +72,12 @@
                           type => 'checkbox',
                           label => text('Recon'),
                           ${checked.recon} => checked.recon,
+                          value => '1'} ?><br />
+                  <?lsmb INCLUDE input element_data={
+                          name => 'tax',
+                          type => 'checkbox',
+                          label => text('Tax'),
+                          ${checked.tax} => checked.tax,
                           value => '1'} ?>
                 </td>
                 <td align="right">

Modified: trunk/scripts/account.pl
===================================================================
--- trunk/scripts/account.pl	2011-06-19 13:35:14 UTC (rev 3289)
+++ trunk/scripts/account.pl	2011-06-19 18:42:17 UTC (rev 3290)
@@ -60,7 +60,7 @@
         $checked->{"${ct}_"} = "checked" if $form->{category} eq $ct;
     } 
 
-    for my $cb (qw(contra)){
+    for my $cb (qw(contra tax)){
         $checked->{$cb} = "checked" if $form->{$cb};
     }
     my %button = ();

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2011-06-19 13:35:14 UTC (rev 3289)
+++ trunk/sql/Pg-database.sql	2011-06-19 18:42:17 UTC (rev 3290)
@@ -29,7 +29,8 @@
   category CHAR(1) NOT NULL,
   gifi_accno text,
   heading int not null references account_heading(id),
-  contra bool not null default false
+  contra bool not null default false,
+  tax bool not null default false
 );
 
 CREATE TABLE account_checkpoint (
@@ -81,8 +82,8 @@
 );
 
 CREATE VIEW chart AS
-SELECT id, accno, description, 'H' as charttype, NULL as category, NULL as link, NULL as account_heading, null as gifi_accno, false as contra from account_heading UNION
-select c.id, c.accno, c.description, 'A' as charttype, c.category, concat_colon(l.description) as link, heading, gifi_accno, contra from account c left join account_link l ON (c.id = l.account_id) group by c.id, c.accno, c.description, c.category, c.heading, c.gifi_accno, c.contra;
+SELECT id, accno, description, 'H' as charttype, NULL as category, NULL as link, NULL as account_heading, null as gifi_accno, false as contra, false as tax from account_heading UNION
+select c.id, c.accno, c.description, 'A' as charttype, c.category, concat_colon(l.description) as link, heading, gifi_accno, contra, tax from account c left join account_link l ON (c.id = l.account_id) group by c.id, c.accno, c.description, c.category, c.heading, c.gifi_accno, c.contra, c.tax;
 
 -- pricegroup added here due to references
 CREATE TABLE pricegroup (

Modified: trunk/sql/coa/at/chart/General.sql
===================================================================
--- trunk/sql/coa/at/chart/General.sql	2011-06-19 13:35:14 UTC (rev 3289)
+++ trunk/sql/coa/at/chart/General.sql	2011-06-19 18:42:17 UTC (rev 3290)
@@ -4,137 +4,137 @@
 -- checked and completed, Thu, 7 Feb 2002, Dieter Simader
 --
 SELECT account_heading_save(NULL, '0000', 'AUFWENDUNGEN FÃR INGANGSETZEN UND ERWEITERN DES BETRIEBES', NULL);
-SELECT account_save(NULL,'0010','Firmenwert','A','015', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'0010','Firmenwert','A','015', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '0100', 'IMMATERIELLE VERMÃGENSGEGENSTÃNDE', NULL);
-SELECT account_save(NULL,'0110','Rechte','A','011', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'0110','Rechte','A','011', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '0200', 'GRUNDSTÃCKE', NULL);
-SELECT account_save(NULL,'0210','unbebaute GrundstÃcke','A','020', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'0220','bebaute GrundstÃcke','A','021', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'0229','kum. Abschreibung bebaute GrundstÃcke','A','039', NULL, true,string_to_array('', ':'));
+SELECT account_save(NULL,'0210','unbebaute GrundstÃcke','A','020', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'0220','bebaute GrundstÃcke','A','021', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'0229','kum. Abschreibung bebaute GrundstÃcke','A','039', NULL, true, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '0400', 'MASCHINEN', NULL);
-SELECT account_save(NULL,'0410','Maschinen','A','041', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'0419','kum. Abschreibung Maschinen','A','069', NULL, true,string_to_array('', ':'));
+SELECT account_save(NULL,'0410','Maschinen','A','041', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'0419','kum. Abschreibung Maschinen','A','069', NULL, true, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '0500', 'FAHRZEUGE', NULL);
-SELECT account_save(NULL,'0510','Fahrzeuge','A','063', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'0519','kum. Abschreibung Fahrzeuge','A','069', NULL, true,string_to_array('', ':'));
+SELECT account_save(NULL,'0510','Fahrzeuge','A','063', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'0519','kum. Abschreibung Fahrzeuge','A','069', NULL, true, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '0600', 'BETRIEBS- UND GESCHÃFTSAUSSTATTUNG', NULL);
-SELECT account_save(NULL,'0620','BÃroeinrichtungen','A','066', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'0625','kum. Abschreibung Betriebs- und GeschÃftsausstattung','A','069', NULL, true,string_to_array('', ':'));
+SELECT account_save(NULL,'0620','BÃroeinrichtungen','A','066', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'0625','kum. Abschreibung Betriebs- und GeschÃftsausstattung','A','069', NULL, true, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '0700', 'GELEISTETE ANZAHLUNGEN', NULL);
 SELECT account_heading_save(NULL, '0800', 'FINANZANLAGEN', NULL);
-SELECT account_save(NULL,'0810','Beteiligungen','A','081', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'0820','Wertpapiere','A','080', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'0810','Beteiligungen','A','081', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'0820','Wertpapiere','A','080', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '1100', 'ROHSTOFFE', NULL);
-SELECT account_save(NULL,'1120','VorrÃte - Rohstoffe','A','110-119', NULL, false,string_to_array('IC', ':'));
+SELECT account_save(NULL,'1120','VorrÃte - Rohstoffe','A','110-119', NULL, false, false, string_to_array('IC', ':'));
 SELECT account_heading_save(NULL, '1200', 'BEZOGENE TEILE', NULL);
-SELECT account_save(NULL,'1220','VorrÃte - bezogene Teile','A','120-129', NULL, false,string_to_array('IC', ':'));
+SELECT account_save(NULL,'1220','VorrÃte - bezogene Teile','A','120-129', NULL, false, false, string_to_array('IC', ':'));
 SELECT account_heading_save(NULL, '1300', 'HILFS- UND BETRIEBSSTOFFE', NULL);
-SELECT account_save(NULL,'1320','Hilfsstoffe','A','130-134', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1350','Betriebssstoffe','A','135-139', NULL, false,string_to_array('IC', ':'));
+SELECT account_save(NULL,'1320','Hilfsstoffe','A','130-134', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1350','Betriebssstoffe','A','135-139', NULL, false, false, string_to_array('IC', ':'));
 SELECT account_heading_save(NULL, '1400', 'UNFERTIGE ERZEUGNISSE', NULL);
-SELECT account_save(NULL,'1420','VorrÃte - unfertige Erzeugnisse','A','140-149', NULL, false,string_to_array('IC', ':'));
+SELECT account_save(NULL,'1420','VorrÃte - unfertige Erzeugnisse','A','140-149', NULL, false, false, string_to_array('IC', ':'));
 SELECT account_heading_save(NULL, '1500', 'FERTIGE ERZEUGNISSE', NULL);
-SELECT account_save(NULL,'1520','VorrÃte - Hardware','A','150-159', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1530','VorrÃte - Software','A','150-159', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1540','VorrÃte - Ersatzteile','A','150-159', NULL, false,string_to_array('IC', ':'));
+SELECT account_save(NULL,'1520','VorrÃte - Hardware','A','150-159', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1530','VorrÃte - Software','A','150-159', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1540','VorrÃte - Ersatzteile','A','150-159', NULL, false, false, string_to_array('IC', ':'));
 SELECT account_heading_save(NULL, '1600', 'WAREN', NULL);
 SELECT account_heading_save(NULL, '1700', 'NOCH NICHT ABGERECHNETE LEISTUNGEN', NULL);
 SELECT account_heading_save(NULL, '1800', 'GELEISTETE ANZAHLUNGEN', NULL);
 SELECT account_heading_save(NULL, '1900', 'WERTBERICHTIGUNGEN', NULL);
 SELECT account_heading_save(NULL, '2000', 'FORDEUNGEN AUS LIEFERUNGEN UND LEISTUNGEN', NULL);
-SELECT account_save(NULL,'2010','Forderungen Lieferung & Leistung','A','200-207', NULL, false,string_to_array('AR', ':'));
-SELECT account_save(NULL,'2019','Wertberichtigung uneinbringliche Forderungen','A','20-21', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'2010','Forderungen Lieferung & Leistung','A','200-207', NULL, false, false, string_to_array('AR', ':'));
+SELECT account_save(NULL,'2019','Wertberichtigung uneinbringliche Forderungen','A','20-21', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '2300', 'SONSTIGE FORDERUNGEN', NULL);
-SELECT account_save(NULL,'2320','sonstige Forderungen','A','23-24', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'2320','sonstige Forderungen','A','23-24', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '2500', 'FORDERUNGEN AUS ABGABENVERRECHNUNG', NULL);
-SELECT account_save(NULL,'2520','sonstige Forderungen aus Abgebenverrechnung','A','25', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'2520','sonstige Forderungen aus Abgebenverrechnung','A','25', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '2600', 'WERTPAPIERE UND ANTEILE', NULL);
-SELECT account_save(NULL,'2620','Wertpapiere UmlaufvermÃgen','A','26', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'2620','Wertpapiere UmlaufvermÃgen','A','26', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '2700', 'KASSABESTAND', NULL);
-SELECT account_save(NULL,'2701','Kassa','A','27-28', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'2701','Kassa','A','27-28', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
 SELECT account_heading_save(NULL, '2800', 'SCHECKS, GUTHABEN BEI KREDITINSTITUTEN', NULL);
-SELECT account_save(NULL,'2810','Schecks','A','27-28', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
-SELECT account_save(NULL,'2820','Bankguthaben','A','280-288', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'2810','Schecks','A','27-28', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'2820','Bankguthaben','A','280-288', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
 SELECT account_heading_save(NULL, '3100', 'LANGFRISTIGE VERBINDLICHKEITEN', NULL);
-SELECT account_save(NULL,'3110','Bank Verbindlichkeiten','L','31', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'3120','Kredite von EigentÃmern','L','310', NULL, false,string_to_array('AP_paid', ':'));
+SELECT account_save(NULL,'3110','Bank Verbindlichkeiten','L','31', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'3120','Kredite von EigentÃmern','L','310', NULL, false, false, string_to_array('AP_paid', ':'));
 SELECT account_heading_save(NULL, '3300', 'VERBINDLICHKEITEN AUS LIEFERUNGEN UND LEISTUNGEN', NULL);
-SELECT account_save(NULL,'3310','Verbindlichkeiten aus Lieferungen und Leistungen','L','330-335', NULL, false,string_to_array('AP', ':'));
+SELECT account_save(NULL,'3310','Verbindlichkeiten aus Lieferungen und Leistungen','L','330-335', NULL, false, false, string_to_array('AP', ':'));
 SELECT account_heading_save(NULL, '3500', 'VERBINDLICHKEITEN FINANZAMT', NULL);
-SELECT account_save(NULL,'3510','Finanzamt Verrechnung KÃrperschaftssteuer','L','350-359', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'3520','Finanzamt Verrechnung Umsatzsteuer','L','350-359', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'3530','Mehrwertsteuer 0%','L','350-359', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'3531','Mehrwertsteuer 10%','L','350-359', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'3532','Mehrwertsteuer 20%','L','350-359', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'3540','Vorsteuer 0%','L','350-359', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'3541','Vorsteuer 10%','L','350-359', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'3542','Vorsteuer 20%','L','350-359', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'3510','Finanzamt Verrechnung KÃrperschaftssteuer','L','350-359', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'3520','Finanzamt Verrechnung Umsatzsteuer','L','350-359', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'3530','Mehrwertsteuer 0%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'3531','Mehrwertsteuer 10%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'3532','Mehrwertsteuer 20%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'3540','Vorsteuer 0%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'3541','Vorsteuer 10%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'3542','Vorsteuer 20%','L','350-359', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
 SELECT account_heading_save(NULL, '4000', 'UMSATZ', NULL);
-SELECT account_save(NULL,'4020','Verkauf - Hardware','I','40-44', NULL, false,string_to_array('AR_amount:IC_sale', ':'));
-SELECT account_save(NULL,'4030','Verkauf - Software ','I','40-44', NULL, false,string_to_array('AR_amount:IC_sale', ':'));
-SELECT account_save(NULL,'4040','Verkauf - Ersatzteile','I','40-44', NULL, false,string_to_array('AR_amount:IC_sale', ':'));
+SELECT account_save(NULL,'4020','Verkauf - Hardware','I','40-44', NULL, false, false, string_to_array('AR_amount:IC_sale', ':'));
+SELECT account_save(NULL,'4030','Verkauf - Software ','I','40-44', NULL, false, false, string_to_array('AR_amount:IC_sale', ':'));
+SELECT account_save(NULL,'4040','Verkauf - Ersatzteile','I','40-44', NULL, false, false, string_to_array('AR_amount:IC_sale', ':'));
 SELECT account_heading_save(NULL, '4300', 'UMSATZ BERATUNG', NULL);
-SELECT account_save(NULL,'4320','ErlÃse Beratung','I','40-44', NULL, false,string_to_array('AR_amount:IC_income', ':'));
-SELECT account_save(NULL,'4330','ErlÃse Programmierung','I','40-44', NULL, false,string_to_array('AR_amount:IC_income', ':'));
+SELECT account_save(NULL,'4320','ErlÃse Beratung','I','40-44', NULL, false, false, string_to_array('AR_amount:IC_income', ':'));
+SELECT account_save(NULL,'4330','ErlÃse Programmierung','I','40-44', NULL, false, false, string_to_array('AR_amount:IC_income', ':'));
 SELECT account_heading_save(NULL, '4600', 'SONSTIGE ERLÃSE', NULL);
-SELECT account_save(NULL,'4630','FrachterlÃse','I','46-49', NULL, false,string_to_array('IC_income', ':'));
+SELECT account_save(NULL,'4630','FrachterlÃse','I','46-49', NULL, false, false, string_to_array('IC_income', ':'));
 SELECT account_heading_save(NULL, '5000', 'WARENEINSATZ', NULL);
-SELECT account_save(NULL,'5020','Wareneinsatz / Hardware','E','500-509', NULL, false,string_to_array('AP_amount:IC_cogs', ':'));
-SELECT account_save(NULL,'5030','Wareneinsatz / Software','E','500-509', NULL, false,string_to_array('AP_amount:IC_cogs', ':'));
-SELECT account_save(NULL,'5040','Wareneinsatz / Ersatzteile','E','520-529', NULL, false,string_to_array('AP_amount:IC_cogs', ':'));
+SELECT account_save(NULL,'5020','Wareneinsatz / Hardware','E','500-509', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':'));
+SELECT account_save(NULL,'5030','Wareneinsatz / Software','E','500-509', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':'));
+SELECT account_save(NULL,'5040','Wareneinsatz / Ersatzteile','E','520-529', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':'));
 SELECT account_heading_save(NULL, '5600', 'VERBRAUCH BRENN- UND TREIBSTOFFEN, ENERGIE UND WASSER', NULL);
-SELECT account_save(NULL,'5610','Energie, Wasser','E','560-569', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5610','Energie, Wasser','E','560-569', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '6000', 'LOHNAUFWAND', NULL);
-SELECT account_save(NULL,'6010','Lohn ','E','600-619', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'6010','Lohn ','E','600-619', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '6200', 'GEAHLTSAUFWAND', NULL);
-SELECT account_save(NULL,'6210','Gehalt ','E','620-639', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'6210','Gehalt ','E','620-639', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '6500', 'GESETZLICHER SOZIALAUFWAND', NULL);
-SELECT account_save(NULL,'6510','Dienstgeberanteile','E','645-649', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'6510','Dienstgeberanteile','E','645-649', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '6700', 'FREIWILLIGER SOZIALAUFWAND', NULL);
-SELECT account_save(NULL,'6710','freiwilliger Sozialaufwand','E','660-665', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'6710','freiwilliger Sozialaufwand','E','660-665', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '7000', 'ABSCHREIBUNGEN', NULL);
-SELECT account_save(NULL,'7010','Abschreibungen','E','700', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'7020','geringwertige WirtschaftsgÃter','E','701-708', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'7010','Abschreibungen','E','700', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'7020','geringwertige WirtschaftsgÃter','E','701-708', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '7100', 'SONSTIGE STEUERN', NULL);
-SELECT account_save(NULL,'7110','Ertragssteuern','E','710-719', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'7120','Grundsteuern','E','710-719', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'7110','Ertragssteuern','E','710-719', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'7120','Grundsteuern','E','710-719', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '7200', 'INSTANDHALTUNGSAUFWAND', NULL);
-SELECT account_save(NULL,'7210','Reparatur und Instandhaltung','E','720-729', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'7210','Reparatur und Instandhaltung','E','720-729', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '7300', 'TRANSPORTKOSTEN', NULL);
-SELECT account_save(NULL,'7310','Frachtaufwand','E','730-731', NULL, false,string_to_array('AP_amount:IC_expense', ':'));
+SELECT account_save(NULL,'7310','Frachtaufwand','E','730-731', NULL, false, false, string_to_array('AP_amount:IC_expense', ':'));
 SELECT account_heading_save(NULL, '7400', 'MIET-,PACHT-,LEASING-, LIZENZAUFWAND', NULL);
-SELECT account_save(NULL,'7410','Miete','E','740-743', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'7411','Lizenzen','E','748-749', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'7410','Miete','E','740-743', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'7411','Lizenzen','E','748-749', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '7600', 'VERWALTUNGSKOSTEN', NULL);
-SELECT account_save(NULL,'7610','Beratungsaufwand','E','775-776', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'7611','BÃromaterialien','E','760', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'7615','Werbung und Marketing','E','765-768', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'7620','uneinbringliche Forderungen','E','799', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'7630','Telephonkosten','E','738-739', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'7631','Internetkosten','E','738-739', NULL, false,string_to_array('AP_amount:IC_expense', ':'));
-SELECT account_save(NULL,'7632','Reise- und ReprÃsentationsaufwand','E','734-735', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'7634','RegistrierungsgebÃhren','E','748-749', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'7610','Beratungsaufwand','E','775-776', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'7611','BÃromaterialien','E','760', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'7615','Werbung und Marketing','E','765-768', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'7620','uneinbringliche Forderungen','E','799', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'7630','Telephonkosten','E','738-739', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'7631','Internetkosten','E','738-739', NULL, false, false, string_to_array('AP_amount:IC_expense', ':'));
+SELECT account_save(NULL,'7632','Reise- und ReprÃsentationsaufwand','E','734-735', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'7634','RegistrierungsgebÃhren','E','748-749', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '7700', 'VERSICHERUNGEN', NULL);
-SELECT account_save(NULL,'7710','Versicherung','E','770-774', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'7710','Versicherung','E','770-774', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '8000', 'FINANZERTRÃGE UND FINANZAUFWENDUNGEN', NULL);
-SELECT account_save(NULL,'8020','Bankzinsen und GebÃhren','E','80-83', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'8020','Bankzinsen und GebÃhren','E','80-83', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '8100', 'BETEILIGUNGSERTRÃGE', NULL);
-SELECT account_save(NULL,'8110','ErtrÃge aus Beteiligungen','I','800-804', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'8110','ErtrÃge aus Beteiligungen','I','800-804', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '9000', 'KAPITAL', NULL);
-SELECT account_save(NULL,'9010','Aktien, GeschÃftsanteile','Q','900-918', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'9020','nicht einbezahltes Kapital','Q','919', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'9010','Aktien, GeschÃftsanteile','Q','900-918', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'9020','nicht einbezahltes Kapital','Q','919', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '9200', 'KAPITALRÃCKLAGEN', NULL);
-SELECT account_save(NULL,'9210','freie RÃcklage','Q','920-929', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'9210','freie RÃcklage','Q','920-929', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '9300', 'GEWINN', NULL);
-SELECT account_save(NULL,'9310','Gewinnvortrag Vorjahr','Q','980', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'9320','Jahresgewinn','Q','985', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'9310','Gewinnvortrag Vorjahr','Q','980', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'9320','Jahresgewinn','Q','985', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '9400', 'RÃCKSTELLUNGEN', NULL);
-SELECT account_save(NULL,'9420','AbfertigungsrÃckstellung','L','300', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'9430','UrlaubsrÃckstellung','L','304-309', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'9420','AbfertigungsrÃckstellung','L','300', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'9430','UrlaubsrÃckstellung','L','304-309', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '9700', 'EINLAGEN STILLER GESELLSCHAFTER', NULL);
 SELECT account_heading_save(NULL, '9800', 'EB,SB,G+V KONTEN', NULL);
-SELECT account_save(NULL,'4640','Devisengewinne','I','80-83', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'8050','Devisenverluste','E','80-83', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'4640','Devisengewinne','I','80-83', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'8050','Devisenverluste','E','80-83', NULL, false, false, string_to_array('', ':'));
 --
 insert into tax (chart_id,rate) values ((select id from chart where accno = '3530'),0.00);
 insert into tax (chart_id,rate) values ((select id from chart where accno = '3531'),0.10);
@@ -154,3 +154,10 @@
  INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg');
 --
 commit;
+UPDATE account
+   SET tax = true
+WHERE id
+   IN (SELECT account_id
+       FROM account_link
+       WHERE description LIKE '%_tax');
+

Modified: trunk/sql/coa/au/chart/General-0000.sql
===================================================================
--- trunk/sql/coa/au/chart/General-0000.sql	2011-06-19 13:35:14 UTC (rev 3289)
+++ trunk/sql/coa/au/chart/General-0000.sql	2011-06-19 18:42:17 UTC (rev 3290)
@@ -7,105 +7,105 @@
 SELECT account_heading_save(NULL, '5600', 'GENERAL & ADMINISTRATIVE EXPENSES', NULL);
 SELECT account_heading_save(NULL, '6000', 'CAR EXPENSES', NULL);
 SELECT account_heading_save(NULL, '4300', 'OTHER REVENUE', NULL);
-SELECT account_save(NULL,'5470','Staff Amenities','E','', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'5470','Staff Amenities','E','', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '1500', 'STOCK ON HAND', NULL);
 SELECT account_heading_save(NULL, '3300', 'EQUITY', NULL);
-SELECT account_save(NULL,'1520','SOH / Leather','A','1500', NULL, false,string_to_array('IC', ':'));
+SELECT account_save(NULL,'1520','SOH / Leather','A','1500', NULL, false, false, string_to_array('IC', ':'));
 SELECT account_heading_save(NULL, '1000', 'CURRENT ASSETS', NULL);
-SELECT account_save(NULL,'1820','Plant & Equipment - at Cost','A','1800', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'1820','Plant & Equipment - at Cost','A','1800', NULL, false, false, string_to_array('AP_amount', ':'));
 INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, contra) VALUES ('1825', 'Less: Accumulated Depreciation', 'A', 'A', '', '1800', '1');
-SELECT account_save(NULL,'1840','Motor Vehicles - at Cost','A','1800', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'1840','Motor Vehicles - at Cost','A','1800', NULL, false, false, string_to_array('AP_amount', ':'));
 INSERT INTO chart (accno, description, charttype, category, link, gifi_accno, contra) VALUES ('1845', 'Less: Accumulated Depreciation', 'A', 'A', '', '1800', '1');
 SELECT account_heading_save(NULL, '1800', 'CAPITAL ASSETS', NULL);
-SELECT account_save(NULL,'1060','Cheque Account','A','1000', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
-SELECT account_save(NULL,'1205','Less: Provision Doubtful Debts','A','1000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'1210','Trade Debtors / Australia - with GST','A','1000', NULL, false,string_to_array('AR', ':'));
-SELECT account_save(NULL,'1220','Trade Debtors / Exports - GST free','A','1000', NULL, false,string_to_array('AR', ':'));
-SELECT account_save(NULL,'1230','GST / Refund','A','1000', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'1530','SOH / PVC','A','1500', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1540','SOH / Fabrics','A','1500', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1550','SOH / Metal Hardware / Fasteners / Accessories','A','1500', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1560','SOH / Paint / Glue / Dye','A','1500', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1570','SOH / Threads / Tapes / Cords / Laces','A','1500', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1580','SOH / Other Goods','A','1500', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'2100','Trade Creditors','L','2000', NULL, false,string_to_array('AP', ':'));
-SELECT account_save(NULL,'2160','Taxation - Payable','L','2000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2210','Workers Compensation - Payable','L','2000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2250','Superannuation - Payable','L','2000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2260','Insurance - Payable','L','2000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2290','GST / Payable','L','2000', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'2300','GST Payments / Refunds','L','2000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2310','GST Adjustments','L','2000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'3350','Issued & Paid up Capital','Q','3300', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'3370','Opening Account Balance','Q','3300', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'3380','Credit Payments / Holding Account','Q','', NULL, false,string_to_array('AR_paid', ':'));
-SELECT account_save(NULL,'4020','Sales / Manufactured Products','I','4000', NULL, false,string_to_array('AR_amount:IC_sale', ':'));
-SELECT account_save(NULL,'4030','Sales / General','I','4000', NULL, false,string_to_array('AR_amount:IC_sale:IC_income', ':'));
-SELECT account_save(NULL,'4410','Shop Labour','I','4000', NULL, false,string_to_array('IC_income', ':'));
-SELECT account_save(NULL,'4420','Design / Patternmaking','I','4000', NULL, false,string_to_array('IC_income', ':'));
-SELECT account_save(NULL,'4430','Shipping & Handling','I','4000', NULL, false,string_to_array('IC_income', ':'));
-SELECT account_save(NULL,'4440','Interest Received','I','4000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'4450','Foreign Exchange Profit','I','4000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'4460','Mark-Up / Price Adjustment','I','4000', NULL, false,string_to_array('IC_income', ':'));
-SELECT account_save(NULL,'4470','Computer Consultancy / Training','I','4000', NULL, false,string_to_array('IC_income', ':'));
-SELECT account_save(NULL,'2620','Bank Loans','L','2000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2640','Hire Purchase','L','2000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'2650','Other Loans','L','2000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5020','COGS / Leather','E','5000', NULL, false,string_to_array('IC_cogs', ':'));
-SELECT account_save(NULL,'5030','COGS / PVC','E','5000', NULL, false,string_to_array('IC_cogs', ':'));
-SELECT account_save(NULL,'5040','COGS / Fabrics','E','5000', NULL, false,string_to_array('IC_cogs', ':'));
-SELECT account_save(NULL,'5050','COGS / Metal Hardware / Fasteners / Accessories','E','5000', NULL, false,string_to_array('IC_cogs', ':'));
-SELECT account_save(NULL,'5060','COGS / Paint / Glue / Dye','E','5000', NULL, false,string_to_array('IC_cogs', ':'));
-SELECT account_save(NULL,'5070','COGS / Threads / Tapes / Cords / Laces','E','5000', NULL, false,string_to_array('IC_cogs', ':'));
-SELECT account_save(NULL,'5080','COGS / Other Goods','E','5000', NULL, false,string_to_array('IC_cogs', ':'));
-SELECT account_save(NULL,'5410','Wages','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5430','Superannuation','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5440','Workers Compensation','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5605','External labour costs','E','5000', NULL, false,string_to_array('AP_amount:IC_expense', ':'));
-SELECT account_save(NULL,'5610','Accountancy','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5611','Legal Fees','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5613','Postage / Printing / Stationery','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5614','Freight and Cartage','E','5000', NULL, false,string_to_array('AP_amount:IC_expense', ':'));
-SELECT account_save(NULL,'5615','Advertising & Promotions','E','5000', NULL, false,string_to_array('AP_amount:IC_expense', ':'));
-SELECT account_save(NULL,'5620','Bad Debts','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5650','Capital Cost Allowance Expense','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5660','Interest Expenses','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5670','Depreciation Expenses','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5680','Taxation','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5685','Insurance','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5686','Security','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5690','Bank Fees And Charges','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5695','Other Fees And Charges','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5700','Office Supplies','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5760','Rent on Land & Buildings','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5765','Repairs & Maintenance','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5766','Fixtures & Fittings','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5770','Replacements (tools, etc)','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5780','Telephone','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5782','Computer Expenses','E','5000', NULL, false,string_to_array('AP_amount:IC_expense', ':'));
-SELECT account_save(NULL,'5783','Research & Development','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5785','Travel, Accommodation & Conference','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5790','Hire / Rent of Plant & Equipment ','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5795','Registration & Insurance','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5800','Licenses','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5810','Foreign Exchange Loss','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5811','Electricity','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5812','Gas','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5813','Sundry Expenses','E','5000', NULL, false,string_to_array('AP_amount:IC_expense', ':'));
-SELECT account_save(NULL,'5820','Goods & Services for own Use','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'6010','M/V Commercial - Fuels / Oils / Parts','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'6020','M/V Commercial - Repairs','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'6040','M/V Commercial - Reg / Insurance','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'6080','M/V Private Use - Interest Expenses','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'6090','M/V Private Use - Other Expenses','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'6070','M/V Private Use - Depreciation Expenses','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'6050','M/V Commercial - Depreciation Expenses','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'6060','M/V Commercial - Interest Expenses','E','5000', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'1065','Cash / Paid From Private Accounts','Q','1000', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
-SELECT account_save(NULL,'3360','Payments for G & S for own Use','Q','3300', NULL, false,string_to_array('AP_paid', ':'));
-SELECT account_save(NULL,'5830','Discounts / Refunds / Rounding','E','5000', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'3390','Retained Profits','Q','3300', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5840','Fines - NON DEDUCTIBLE EXPENSES','E','', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'1060','Cheque Account','A','1000', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'1205','Less: Provision Doubtful Debts','A','1000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'1210','Trade Debtors / Australia - with GST','A','1000', NULL, false, false, string_to_array('AR', ':'));
+SELECT account_save(NULL,'1220','Trade Debtors / Exports - GST free','A','1000', NULL, false, false, string_to_array('AR', ':'));
+SELECT account_save(NULL,'1230','GST / Refund','A','1000', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'1530','SOH / PVC','A','1500', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1540','SOH / Fabrics','A','1500', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1550','SOH / Metal Hardware / Fasteners / Accessories','A','1500', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1560','SOH / Paint / Glue / Dye','A','1500', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1570','SOH / Threads / Tapes / Cords / Laces','A','1500', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1580','SOH / Other Goods','A','1500', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'2100','Trade Creditors','L','2000', NULL, false, false, string_to_array('AP', ':'));
+SELECT account_save(NULL,'2160','Taxation - Payable','L','2000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2210','Workers Compensation - Payable','L','2000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2250','Superannuation - Payable','L','2000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2260','Insurance - Payable','L','2000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2290','GST / Payable','L','2000', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'2300','GST Payments / Refunds','L','2000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2310','GST Adjustments','L','2000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'3350','Issued & Paid up Capital','Q','3300', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'3370','Opening Account Balance','Q','3300', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'3380','Credit Payments / Holding Account','Q','', NULL, false, false, string_to_array('AR_paid', ':'));
+SELECT account_save(NULL,'4020','Sales / Manufactured Products','I','4000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':'));
+SELECT account_save(NULL,'4030','Sales / General','I','4000', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':'));
+SELECT account_save(NULL,'4410','Shop Labour','I','4000', NULL, false, false, string_to_array('IC_income', ':'));
+SELECT account_save(NULL,'4420','Design / Patternmaking','I','4000', NULL, false, false, string_to_array('IC_income', ':'));
+SELECT account_save(NULL,'4430','Shipping & Handling','I','4000', NULL, false, false, string_to_array('IC_income', ':'));
+SELECT account_save(NULL,'4440','Interest Received','I','4000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'4450','Foreign Exchange Profit','I','4000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'4460','Mark-Up / Price Adjustment','I','4000', NULL, false, false, string_to_array('IC_income', ':'));
+SELECT account_save(NULL,'4470','Computer Consultancy / Training','I','4000', NULL, false, false, string_to_array('IC_income', ':'));
+SELECT account_save(NULL,'2620','Bank Loans','L','2000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2640','Hire Purchase','L','2000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'2650','Other Loans','L','2000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5020','COGS / Leather','E','5000', NULL, false, false, string_to_array('IC_cogs', ':'));
+SELECT account_save(NULL,'5030','COGS / PVC','E','5000', NULL, false, false, string_to_array('IC_cogs', ':'));
+SELECT account_save(NULL,'5040','COGS / Fabrics','E','5000', NULL, false, false, string_to_array('IC_cogs', ':'));
+SELECT account_save(NULL,'5050','COGS / Metal Hardware / Fasteners / Accessories','E','5000', NULL, false, false, string_to_array('IC_cogs', ':'));
+SELECT account_save(NULL,'5060','COGS / Paint / Glue / Dye','E','5000', NULL, false, false, string_to_array('IC_cogs', ':'));
+SELECT account_save(NULL,'5070','COGS / Threads / Tapes / Cords / Laces','E','5000', NULL, false, false, string_to_array('IC_cogs', ':'));
+SELECT account_save(NULL,'5080','COGS / Other Goods','E','5000', NULL, false, false, string_to_array('IC_cogs', ':'));
+SELECT account_save(NULL,'5410','Wages','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5430','Superannuation','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5440','Workers Compensation','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5605','External labour costs','E','5000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':'));
+SELECT account_save(NULL,'5610','Accountancy','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5611','Legal Fees','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5613','Postage / Printing / Stationery','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5614','Freight and Cartage','E','5000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':'));
+SELECT account_save(NULL,'5615','Advertising & Promotions','E','5000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':'));
+SELECT account_save(NULL,'5620','Bad Debts','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5650','Capital Cost Allowance Expense','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5660','Interest Expenses','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5670','Depreciation Expenses','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5680','Taxation','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5685','Insurance','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5686','Security','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5690','Bank Fees And Charges','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5695','Other Fees And Charges','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5700','Office Supplies','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5760','Rent on Land & Buildings','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5765','Repairs & Maintenance','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5766','Fixtures & Fittings','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5770','Replacements (tools, etc)','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5780','Telephone','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5782','Computer Expenses','E','5000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':'));
+SELECT account_save(NULL,'5783','Research & Development','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5785','Travel, Accommodation & Conference','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5790','Hire / Rent of Plant & Equipment ','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5795','Registration & Insurance','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5800','Licenses','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5810','Foreign Exchange Loss','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5811','Electricity','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5812','Gas','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5813','Sundry Expenses','E','5000', NULL, false, false, string_to_array('AP_amount:IC_expense', ':'));
+SELECT account_save(NULL,'5820','Goods & Services for own Use','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'6010','M/V Commercial - Fuels / Oils / Parts','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'6020','M/V Commercial - Repairs','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'6040','M/V Commercial - Reg / Insurance','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'6080','M/V Private Use - Interest Expenses','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'6090','M/V Private Use - Other Expenses','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'6070','M/V Private Use - Depreciation Expenses','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'6050','M/V Commercial - Depreciation Expenses','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'6060','M/V Commercial - Interest Expenses','E','5000', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'1065','Cash / Paid From Private Accounts','Q','1000', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'3360','Payments for G & S for own Use','Q','3300', NULL, false, false, string_to_array('AP_paid', ':'));
+SELECT account_save(NULL,'5830','Discounts / Refunds / Rounding','E','5000', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'3390','Retained Profits','Q','3300', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5840','Fines - NON DEDUCTIBLE EXPENSES','E','', NULL, false, false, string_to_array('', ':'));
 --
 INSERT INTO tax (chart_id, rate, taxnumber) VALUES ((SELECT id FROM chart WHERE accno = '1230'), 0.1, '');
 INSERT INTO tax (chart_id, rate, taxnumber) VALUES ((SELECT id FROM chart WHERE accno = '2290'), 0.1, '');
@@ -125,3 +125,10 @@
  INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg');
 --
 commit;
+UPDATE account
+   SET tax = true
+WHERE id
+   IN (SELECT account_id
+       FROM account_link
+       WHERE description LIKE '%_tax');
+

Modified: trunk/sql/coa/au/chart/General-00000.sql
===================================================================
--- trunk/sql/coa/au/chart/General-00000.sql	2011-06-19 13:35:14 UTC (rev 3289)
+++ trunk/sql/coa/au/chart/General-00000.sql	2011-06-19 18:42:17 UTC (rev 3290)
@@ -3,74 +3,74 @@
 -- sample only
 --
 SELECT account_heading_save(NULL, '10000', 'BANK AND CASH ACCOUNTS', NULL);
-SELECT account_save(NULL,'10001','Bank Account','A','100', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
-SELECT account_save(NULL,'10010','Petty Cash','A','100', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'10001','Bank Account','A','100', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'10010','Petty Cash','A','100', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
 SELECT account_heading_save(NULL, '11000', 'CUSTOMERS AND SETTLEMENT ACCOUNTS', NULL);
-SELECT account_save(NULL,'11001','Accounts Receivables','A','110', NULL, false,string_to_array('AR', ':'));
+SELECT account_save(NULL,'11001','Accounts Receivables','A','110', NULL, false, false, string_to_array('AR', ':'));
 SELECT account_heading_save(NULL, '12000', 'OTHER CURRENT ASSETS', NULL);
-SELECT account_save(NULL,'12001','Allowance for doubtful accounts','A','120', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'12001','Allowance for doubtful accounts','A','120', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '15000', 'INVENTORY ASSETS', NULL);
-SELECT account_save(NULL,'15001','Inventory / General','A','150', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'15002','Inventory / Aftermarket Parts','A','150', NULL, false,string_to_array('IC', ':'));
+SELECT account_save(NULL,'15001','Inventory / General','A','150', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'15002','Inventory / Aftermarket Parts','A','150', NULL, false, false, string_to_array('IC', ':'));
 SELECT account_heading_save(NULL, '16000', 'STATUTORY DEBTORS', NULL);
-SELECT account_save(NULL,'16001','INPUT GST','L','160', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'16001','INPUT GST','L','160', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
 SELECT account_heading_save(NULL, '18000', 'CAPITAL ASSETS', NULL);
-SELECT account_save(NULL,'18001','Land and Buildings','A','180', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'18002','Accumulated Amortization -Land & Buildings','A','180', NULL, true,string_to_array('', ':'));
-SELECT account_save(NULL,'18003','Office Furniture & Equipment','A','180', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'18004','Accumulated Amortization -Furniture & Equipment','A','180', NULL, true,string_to_array('', ':'));
-SELECT account_save(NULL,'18005','Vehicle','A','180', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'18006','Accumulated Amortization -Vehicle','A','180', NULL, true,string_to_array('', ':'));
+SELECT account_save(NULL,'18001','Land and Buildings','A','180', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'18002','Accumulated Amortization -Land & Buildings','A','180', NULL, true, false, string_to_array('', ':'));
+SELECT account_save(NULL,'18003','Office Furniture & Equipment','A','180', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'18004','Accumulated Amortization -Furniture & Equipment','A','180', NULL, true, false, string_to_array('', ':'));
+SELECT account_save(NULL,'18005','Vehicle','A','180', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'18006','Accumulated Amortization -Vehicle','A','180', NULL, true, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '20000', 'CURRENT LIABILITIES', NULL);
-SELECT account_save(NULL,'20001','Accounts Payable','L','200', NULL, false,string_to_array('AP', ':'));
+SELECT account_save(NULL,'20001','Accounts Payable','L','200', NULL, false, false, string_to_array('AP', ':'));
 SELECT account_heading_save(NULL, '21000', 'STATUTORY CREDITORS', NULL);
-SELECT account_save(NULL,'21001','Corporate Taxes Payable','L','210', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'21002','OUTPUT GST','L','210', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'21003','GST Settlement Account','L','210', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'21001','Corporate Taxes Payable','L','210', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'21002','OUTPUT GST','L','210', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'21003','GST Settlement Account','L','210', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '22000', 'PAYROLL ACCOUNTS', NULL);
-SELECT account_save(NULL,'22001','Workers Net Salary Payable','L','220', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'22002','PAYG Witholding Payable','L','220', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'22003','Superannuation Plan Payable','L','220', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'22001','Workers Net Salary Payable','L','220', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'22002','PAYG Witholding Payable','L','220', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'22003','Superannuation Plan Payable','L','220', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '26000', 'LONG TERM LIABILITIES', NULL);
-SELECT account_save(NULL,'26001','Bank Loans','L','260', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'26002','Loans from Shareholders','L','260', NULL, false,string_to_array('AP_paid', ':'));
+SELECT account_save(NULL,'26001','Bank Loans','L','260', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'26002','Loans from Shareholders','L','260', NULL, false, false, string_to_array('AP_paid', ':'));
 SELECT account_heading_save(NULL, '33000', 'SHARE CAPITAL', NULL);
-SELECT account_save(NULL,'33001','Common Shares','Q','330', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'33001','Common Shares','Q','330', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '40000', 'SALES REVENUE', NULL);
-SELECT account_save(NULL,'40001','Sales / General','I','400', NULL, false,string_to_array('AR_amount:IC_sale', ':'));
-SELECT account_save(NULL,'40002','Sales / Aftermarket Parts','I','400', NULL, false,string_to_array('AR_amount:IC_sale', ':'));
+SELECT account_save(NULL,'40001','Sales / General','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':'));
+SELECT account_save(NULL,'40002','Sales / Aftermarket Parts','I','400', NULL, false, false, string_to_array('AR_amount:IC_sale', ':'));
 SELECT account_heading_save(NULL, '41000', 'CONSULTING REVENUE', NULL);
-SELECT account_save(NULL,'41001','Consulting','I','410', NULL, false,string_to_array('AR_amount:IC_income', ':'));
+SELECT account_save(NULL,'41001','Consulting','I','410', NULL, false, false, string_to_array('AR_amount:IC_income', ':'));
 SELECT account_heading_save(NULL, '42000', 'OTHER REVENUE', NULL);
-SELECT account_save(NULL,'42001','Interest and Financial Income','I','420', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'42002','Foreign Exchange Gain','I','420', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'42001','Interest and Financial Income','I','420', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'42002','Foreign Exchange Gain','I','420', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '50000', 'COST OF GOODS SOLD', NULL);
-SELECT account_save(NULL,'50001','Purchases','E','500', NULL, false,string_to_array('AP_amount:IC_cogs:IC_expense', ':'));
-SELECT account_save(NULL,'50002','COGS / General','E','500', NULL, false,string_to_array('AP_amount:IC_cogs', ':'));
-SELECT account_save(NULL,'50003','COGS / Aftermarket Parts','E','500', NULL, false,string_to_array('AP_amount:IC_cogs', ':'));
-SELECT account_save(NULL,'50004','Freight','E','500', NULL, false,string_to_array('AP_amount:IC_expense', ':'));
+SELECT account_save(NULL,'50001','Purchases','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':'));
+SELECT account_save(NULL,'50002','COGS / General','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':'));
+SELECT account_save(NULL,'50003','COGS / Aftermarket Parts','E','500', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':'));
+SELECT account_save(NULL,'50004','Freight','E','500', NULL, false, false, string_to_array('AP_amount:IC_expense', ':'));
 SELECT account_heading_save(NULL, '54000', 'PAYROLL EXPENSES', NULL);
-SELECT account_save(NULL,'54001','Wages & Salaries','E','540', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'54002','PAYG Tax Expense','E','540', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'54003','Superannuation Plan Expense','E','540', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'54001','Wages & Salaries','E','540', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'54002','PAYG Tax Expense','E','540', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'54003','Superannuation Plan Expense','E','540', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '56000', 'GENERAL & ADMINISTRATIVE EXPENSES', NULL);
-SELECT account_save(NULL,'56001','Accounting & Legal','E','560', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'56002','Advertising & Promotions','E','560', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'56003','Amortization Expense','E','560', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'56004','Income Taxes','E','560', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'56005','Insurance','E','560', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'56006','Office Supplies','E','560', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'56007','Rent and Rates','E','560', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'56008','Repair & Maintenance','E','560', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'56009','Telephone, Fax and Internet','E','560', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'56010','Travel & Entertainment','E','560', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'56011','Utilities','E','560', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'56012','Registrations','E','560', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'56013','Licenses','E','560', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'56001','Accounting & Legal','E','560', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'56002','Advertising & Promotions','E','560', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'56003','Amortization Expense','E','560', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'56004','Income Taxes','E','560', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'56005','Insurance','E','560', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'56006','Office Supplies','E','560', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'56007','Rent and Rates','E','560', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'56008','Repair & Maintenance','E','560', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'56009','Telephone, Fax and Internet','E','560', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'56010','Travel & Entertainment','E','560', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'56011','Utilities','E','560', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'56012','Registrations','E','560', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'56013','Licenses','E','560', NULL, false, false, string_to_array('AP_amount', ':'));
 SELECT account_heading_save(NULL, '58000', 'OTHER EXPENSES', NULL);
-SELECT account_save(NULL,'58001','Interest & Bank Charges','E','580', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'58002','Foreign Exchange Loss','E','580', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'58003','Bad Debts','E','580', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'58001','Interest & Bank Charges','E','580', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'58002','Foreign Exchange Loss','E','580', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'58003','Bad Debts','E','580', NULL, false, false, string_to_array('', ':'));
 --
 insert into tax (chart_id,rate) values ((select id from chart where accno = '16001'),0.1);
 insert into tax (chart_id,rate) values ((select id from chart where accno = '21002'),0.1);
@@ -90,3 +90,10 @@
  INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg');
 
 commit;
+UPDATE account
+   SET tax = true
+WHERE id
+   IN (SELECT account_id
+       FROM account_link
+       WHERE description LIKE '%_tax');
+

Modified: trunk/sql/coa/be/chart/General.sql
===================================================================
--- trunk/sql/coa/be/chart/General.sql	2011-06-19 13:35:14 UTC (rev 3289)
+++ trunk/sql/coa/be/chart/General.sql	2011-06-19 18:42:17 UTC (rev 3290)
@@ -447,3 +447,10 @@
  INSERT INTO defaults (setting_key, value) VALUES ('curr', 'EUR:USD');
 
 commit;
+UPDATE account
+   SET tax = true
+WHERE id
+   IN (SELECT account_id
+       FROM account_link
+       WHERE description LIKE '%_tax');
+

Modified: trunk/sql/coa/br/chart/General.sql
===================================================================
--- trunk/sql/coa/br/chart/General.sql	2011-06-19 13:35:14 UTC (rev 3289)
+++ trunk/sql/coa/br/chart/General.sql	2011-06-19 18:42:17 UTC (rev 3290)
@@ -2,67 +2,67 @@
 -- General Brazilien Portuguese COA
 -- sample only
 SELECT account_heading_save(NULL, '1000', 'RECURSOS ATUAIS', NULL);
-SELECT account_save(NULL,'1060','Checando Cliente','A','', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
-SELECT account_save(NULL,'1065','Caixa Baixo','A','', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
-SELECT account_save(NULL,'1200','Contas a Receber','A','', NULL, false,string_to_array('AR', ':'));
-SELECT account_save(NULL,'1205','ProvisÃo para devedors duvidosos','A','', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'1060','Checando Cliente','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'1065','Caixa Baixo','A','', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'1200','Contas a Receber','A','', NULL, false, false, string_to_array('AR', ':'));
+SELECT account_save(NULL,'1205','ProvisÃo para devedors duvidosos','A','', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '1500', 'INVENTÃRIO DE CLIENTES', NULL);
-SELECT account_save(NULL,'1520','InventÃrio / Geral','A','', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1530','InventÃrio / Mercado SecundÃrio','A','', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1540','InventÃrio / Computer Parts','A','', NULL, false,string_to_array('IC', ':'));
+SELECT account_save(NULL,'1520','InventÃrio / Geral','A','', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1530','InventÃrio / Mercado SecundÃrio','A','', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1540','InventÃrio / Computer Parts','A','', NULL, false, false, string_to_array('IC', ':'));
 SELECT account_heading_save(NULL, '1800', 'CAPITAL ASSETS', NULL);
-SELECT account_save(NULL,'1820','EscritÃrio MÃvel & Equipamentos','A','', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'1825','Accum. Amort. -MÃvel. & Equip.','A','', NULL, true,string_to_array('', ':'));
-SELECT account_save(NULL,'1840','VeÃculo','A','', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'1845','Accum. Amort. -VeÃculo','A','', NULL, true,string_to_array('', ':'));
+SELECT account_save(NULL,'1820','EscritÃrio MÃvel & Equipamentos','A','', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'1825','Accum. Amort. -MÃvel. & Equip.','A','', NULL, true, false, string_to_array('', ':'));
+SELECT account_save(NULL,'1840','VeÃculo','A','', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'1845','Accum. Amort. -VeÃculo','A','', NULL, true, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '2000', 'BALANÃO ATUAL', NULL);
-SELECT account_save(NULL,'2100','Contas a Pagar','L','', NULL, false,string_to_array('AP', ':'));
-SELECT account_save(NULL,'2170','Taxas federais','L','', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2310','VAT (7%)','L','', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'2320','VAT (8%)','L','', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'2380','Contas a pagar de fÃrias','L','', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'2100','Contas a Pagar','L','', NULL, false, false, string_to_array('AP', ':'));
+SELECT account_save(NULL,'2170','Taxas federais','L','', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2310','VAT (7%)','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'2320','VAT (8%)','L','', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'2380','Contas a pagar de fÃrias','L','', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '2400', 'DEDUÃÃES DE FOLHA DE PAGAMENTO', NULL);
-SELECT account_save(NULL,'2450','Imposto de Renda Devido','L','', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'2450','Imposto de Renda Devido','L','', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '2600', 'Passivi exigÃvel a longo prazo', NULL);
-SELECT account_save(NULL,'2620','EmprÃstimo bancÃrio','L','', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2680','EmprÃstimo de Acionistas','L','', NULL, false,string_to_array('AP_paid', ':'));
+SELECT account_save(NULL,'2620','EmprÃstimo bancÃrio','L','', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2680','EmprÃstimo de Acionistas','L','', NULL, false, false, string_to_array('AP_paid', ':'));
 SELECT account_heading_save(NULL, '3300', 'DIVISÃO DE CAPITAL', NULL);
-SELECT account_save(NULL,'3350','DivisÃo comum','Q','', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'3350','DivisÃo comum','Q','', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '4000', 'VENDAS RECEITAS', NULL);
-SELECT account_save(NULL,'4020','Vendas Gerais','I','', NULL, false,string_to_array('AR_amount:IC_sale', ':'));
-SELECT account_save(NULL,'4030','Partes para mercado secundÃrio','I','', NULL, false,string_to_array('AR_amount:IC_sale', ':'));
-SELECT account_save(NULL,'4040','Parte Computacional','I','', NULL, false,string_to_array('AR_amount:IC_sale', ':'));
+SELECT account_save(NULL,'4020','Vendas Gerais','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':'));
+SELECT account_save(NULL,'4030','Partes para mercado secundÃrio','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':'));
+SELECT account_save(NULL,'4040','Parte Computacional','I','', NULL, false, false, string_to_array('AR_amount:IC_sale', ':'));
 SELECT account_heading_save(NULL, '4300', 'CONSULTANDO FONTES DE RENDA', NULL);
-SELECT account_save(NULL,'4320','Consultando','I','', NULL, false,string_to_array('AR_amount:IC_income', ':'));
-SELECT account_save(NULL,'4330','Programando','I','', NULL, false,string_to_array('AR_amount:IC_income', ':'));
-SELECT account_save(NULL,'4340','Loja','I','', NULL, false,string_to_array('AR_amount:IC_income', ':'));
+SELECT account_save(NULL,'4320','Consultando','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':'));
+SELECT account_save(NULL,'4330','Programando','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':'));
+SELECT account_save(NULL,'4340','Loja','I','', NULL, false, false, string_to_array('AR_amount:IC_income', ':'));
 SELECT account_heading_save(NULL, '4400', 'OUTRAS RENDAS', NULL);
-SELECT account_save(NULL,'4430','Transporte & Taxa','I','', NULL, false,string_to_array('IC_income', ':'));
-SELECT account_save(NULL,'4440','Juros Acumulados','I','', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'4450','Ganho de cÃmbio estrangeiro','I','', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'4430','Transporte & Taxa','I','', NULL, false, false, string_to_array('IC_income', ':'));
+SELECT account_save(NULL,'4440','Juros Acumulados','I','', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'4450','Ganho de cÃmbio estrangeiro','I','', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '5000', 'CUSTO DE VENDAS DE PRODUTOS', NULL);
-SELECT account_save(NULL,'5010','Compras','E','', NULL, false,string_to_array('AP_amount:IC_cogs:IC_expense', ':'));
-SELECT account_save(NULL,'5050','Mercado SecundÃrio','E','', NULL, false,string_to_array('AP_amount:IC_cogs', ':'));
-SELECT account_save(NULL,'5060','Parte Computacional','E','', NULL, false,string_to_array('AP_amount:IC_cogs', ':'));
-SELECT account_save(NULL,'5100','Frete','E','', NULL, false,string_to_array('AP_amount:IC_expense', ':'));
+SELECT account_save(NULL,'5010','Compras','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':'));
+SELECT account_save(NULL,'5050','Mercado SecundÃrio','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':'));
+SELECT account_save(NULL,'5060','Parte Computacional','E','', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':'));
+SELECT account_save(NULL,'5100','Frete','E','', NULL, false, false, string_to_array('AP_amount:IC_expense', ':'));
 SELECT account_heading_save(NULL, '5400', 'DESPESAS E FOLHA DE PAGAMENTO', NULL);
-SELECT account_save(NULL,'5410','SalÃrios','E','', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'5410','SalÃrios','E','', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '5600', 'GERAL E DESPESAS ADMINISTRATIVAS', NULL);
-SELECT account_save(NULL,'5610','Contabilidade & Leis','E','', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5615','Publicidade & PromoÃÃes','E','', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5620','BalanÃo','E','', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5660','AmortizaÃÃo','E','', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5680','Imposto de Renda','E','', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5685','Seguro','E','', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5690','Interesses & Encargos BancÃrios','E','', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5700','Materiais de EscritÃrio','E','', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5760','Aluguel','E','', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5765','ManutenÃÃo & Reparos','E','', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5780','Telefone','E','', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5785','Cursos & Entretenimentos','E','', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5790','ServiÃos PÃblicos','E','', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5800','Licenciamento para exportaÃÃes','E','', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5810','Troca com Estrangeiro','E','', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'5610','Contabilidade & Leis','E','', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5615','Publicidade & PromoÃÃes','E','', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5620','BalanÃo','E','', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5660','AmortizaÃÃo','E','', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5680','Imposto de Renda','E','', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5685','Seguro','E','', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5690','Interesses & Encargos BancÃrios','E','', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5700','Materiais de EscritÃrio','E','', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5760','Aluguel','E','', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5765','ManutenÃÃo & Reparos','E','', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5780','Telefone','E','', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5785','Cursos & Entretenimentos','E','', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5790','ServiÃos PÃblicos','E','', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5800','Licenciamento para exportaÃÃes','E','', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5810','Troca com Estrangeiro','E','', NULL, false, false, string_to_array('', ':'));
 --
 insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.07);
 insert into tax (chart_id,rate) values ((select id from chart where accno = '2320'),0.08);
@@ -82,3 +82,10 @@
  INSERT INTO defaults (setting_key, value) VALUES ('weightunit', 'kg');
 --
 commit;
+UPDATE account
+   SET tax = true
+WHERE id
+   IN (SELECT account_id
+       FROM account_link
+       WHERE description LIKE '%_tax');
+

Modified: trunk/sql/coa/ca/chart/English_General.sql
===================================================================
--- trunk/sql/coa/ca/chart/English_General.sql	2011-06-19 13:35:14 UTC (rev 3289)
+++ trunk/sql/coa/ca/chart/English_General.sql	2011-06-19 18:42:17 UTC (rev 3290)
@@ -2,67 +2,67 @@
 -- General Canadian COA
 -- sample only
 SELECT account_heading_save(NULL, '1000', 'CURRENT ASSETS', NULL);
-SELECT account_save(NULL,'1060','Chequing Account','A','1002', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
-SELECT account_save(NULL,'1065','Petty Cash','A','1001', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
-SELECT account_save(NULL,'1200','Accounts Receivables','A','1060', NULL, false,string_to_array('AR', ':'));
-SELECT account_save(NULL,'1205','Allowance for doubtful accounts','A','1063', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'1060','Chequing Account','A','1002', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'1065','Petty Cash','A','1001', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'1200','Accounts Receivables','A','1060', NULL, false, false, string_to_array('AR', ':'));
+SELECT account_save(NULL,'1205','Allowance for doubtful accounts','A','1063', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '1500', 'INVENTORY ASSETS', NULL);
-SELECT account_save(NULL,'1520','Inventory / General','A','1122', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1530','Inventory / Aftermarket Parts','A','1122', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1540','Inventory / Raw Materials','A','1122', NULL, false,string_to_array('IC', ':'));
+SELECT account_save(NULL,'1520','Inventory / General','A','1122', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1530','Inventory / Aftermarket Parts','A','1122', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1540','Inventory / Raw Materials','A','1122', NULL, false, false, string_to_array('IC', ':'));
 SELECT account_heading_save(NULL, '1800', 'CAPITAL ASSETS', NULL);
-SELECT account_save(NULL,'1820','Office Furniture & Equipment','A','1787', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'1825','Accum. Amort. -Furn. & Equip.','A','1788', NULL, true,string_to_array('', ':'));
-SELECT account_save(NULL,'1840','Vehicle','A','1742', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'1845','Accum. Amort. -Vehicle','A','1743', NULL, true,string_to_array('', ':'));
+SELECT account_save(NULL,'1820','Office Furniture & Equipment','A','1787', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'1825','Accum. Amort. -Furn. & Equip.','A','1788', NULL, true, false, string_to_array('', ':'));
+SELECT account_save(NULL,'1840','Vehicle','A','1742', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'1845','Accum. Amort. -Vehicle','A','1743', NULL, true, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '2000', 'CURRENT LIABILITIES', NULL);
-SELECT account_save(NULL,'2100','Accounts Payable','L','2621', NULL, false,string_to_array('AP', ':'));
-SELECT account_save(NULL,'2160','Federal Taxes Payable','L','2683', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2170','Provincial Taxes Payable','L','2684', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2310','GST','L','2685', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'2320','PST','L','2686', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'2380','Vacation Pay Payable','L','2624', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2390','WCB Payable','L','2627', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'2100','Accounts Payable','L','2621', NULL, false, false, string_to_array('AP', ':'));
+SELECT account_save(NULL,'2160','Federal Taxes Payable','L','2683', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2170','Provincial Taxes Payable','L','2684', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2310','GST','L','2685', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'2320','PST','L','2686', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'2380','Vacation Pay Payable','L','2624', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2390','WCB Payable','L','2627', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '2400', 'PAYROLL DEDUCTIONS', NULL);
-SELECT account_save(NULL,'2410','EI Payable','L','2627', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2420','CPP Payable','L','2627', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2450','Income Tax Payable','L','2628', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'2410','EI Payable','L','2627', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2420','CPP Payable','L','2627', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2450','Income Tax Payable','L','2628', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '2600', 'LONG TERM LIABILITIES', NULL);
-SELECT account_save(NULL,'2620','Bank Loans','L','2701', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2680','Loans from Shareholders','L','2780', NULL, false,string_to_array('AP_paid', ':'));
+SELECT account_save(NULL,'2620','Bank Loans','L','2701', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2680','Loans from Shareholders','L','2780', NULL, false, false, string_to_array('AP_paid', ':'));
 SELECT account_heading_save(NULL, '3300', 'SHARE CAPITAL', NULL);
-SELECT account_save(NULL,'3350','Common Shares','Q','3500', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'3350','Common Shares','Q','3500', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '4000', 'SALES REVENUE', NULL);
-SELECT account_save(NULL,'4020','General Sales','I','8000', NULL, false,string_to_array('AR_amount:IC_sale:IC_income', ':'));
-SELECT account_save(NULL,'4030','Aftermarket Parts','I','8000', NULL, false,string_to_array('AR_amount:IC_sale', ':'));
+SELECT account_save(NULL,'4020','General Sales','I','8000', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':'));
+SELECT account_save(NULL,'4030','Aftermarket Parts','I','8000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':'));
 SELECT account_heading_save(NULL, '4400', 'OTHER REVENUE', NULL);
-SELECT account_save(NULL,'4430','Shipping & Handling','I','8457', NULL, false,string_to_array('IC_income', ':'));
-SELECT account_save(NULL,'4440','Interest','I','8090', NULL, false,string_to_array('IC_income', ':'));
-SELECT account_save(NULL,'4450','Foreign Exchange Gain / (Loss)','I','8231', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'4430','Shipping & Handling','I','8457', NULL, false, false, string_to_array('IC_income', ':'));
+SELECT account_save(NULL,'4440','Interest','I','8090', NULL, false, false, string_to_array('IC_income', ':'));
+SELECT account_save(NULL,'4450','Foreign Exchange Gain / (Loss)','I','8231', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '5000', 'COST OF GOODS SOLD', NULL);
-SELECT account_save(NULL,'5010','Purchases','E','8320', NULL, false,string_to_array('AP_amount:IC_cogs:IC_expense', ':'));
-SELECT account_save(NULL,'5050','Aftermarket Parts','E','8320', NULL, false,string_to_array('AP_amount:IC_cogs', ':'));
-SELECT account_save(NULL,'5100','Freight','E','8457', NULL, false,string_to_array('AP_amount:IC_expense', ':'));
+SELECT account_save(NULL,'5010','Purchases','E','8320', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':'));
+SELECT account_save(NULL,'5050','Aftermarket Parts','E','8320', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':'));
+SELECT account_save(NULL,'5100','Freight','E','8457', NULL, false, false, string_to_array('AP_amount:IC_expense', ':'));
 SELECT account_heading_save(NULL, '5400', 'PAYROLL EXPENSES', NULL);
-SELECT account_save(NULL,'5410','Wages & Salaries','E','9060', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5420','EI Expense','E','8622', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5430','CPP Expense','E','8622', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5440','WCB Expense','E','8622', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'5410','Wages & Salaries','E','9060', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5420','EI Expense','E','8622', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5430','CPP Expense','E','8622', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5440','WCB Expense','E','8622', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '5600', 'GENERAL & ADMINISTRATIVE EXPENSES', NULL);
-SELECT account_save(NULL,'5610','Accounting & Legal','E','8862', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5615','Advertising & Promotions','E','8520', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5620','Bad Debts','E','8590', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5660','Amortization Expense','E','8670', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5680','Income Taxes','E','9990', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5685','Insurance','E','9804', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5690','Interest & Bank Charges','E','9805', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5700','Office Supplies','E','8811', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5760','Rent','E','9811', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5765','Repair & Maintenance','E','8964', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5780','Telephone','E','9225', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5785','Travel & Entertainment','E','8523', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5790','Utilities','E','8812', NULL, false,string_to_array('AP_amount', ':'));
-SELECT account_save(NULL,'5800','Licenses','E','8760', NULL, false,string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5610','Accounting & Legal','E','8862', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5615','Advertising & Promotions','E','8520', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5620','Bad Debts','E','8590', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5660','Amortization Expense','E','8670', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5680','Income Taxes','E','9990', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5685','Insurance','E','9804', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5690','Interest & Bank Charges','E','9805', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5700','Office Supplies','E','8811', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5760','Rent','E','9811', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5765','Repair & Maintenance','E','8964', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5780','Telephone','E','9225', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5785','Travel & Entertainment','E','8523', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'5790','Utilities','E','8812', NULL, false, false, string_to_array('AP_amount', ':'));
+SELECT account_save(NULL,'5800','Licenses','E','8760', NULL, false, false, string_to_array('AP_amount', ':'));
 --
 insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.05);
 insert into tax (chart_id,rate) values ((select id from chart where accno = '2320'),0.08);
@@ -82,3 +82,10 @@
 INSERT INTO defaults (setting_key, value) values ('weightunit', 'kg');
 --
 commit;
+UPDATE account
+   SET tax = true
+WHERE id
+   IN (SELECT account_id
+       FROM account_link
+       WHERE description LIKE '%_tax');
+

Modified: trunk/sql/coa/ca/chart/French-Quebec_General.sql
===================================================================
--- trunk/sql/coa/ca/chart/French-Quebec_General.sql	2011-06-19 13:35:14 UTC (rev 3289)
+++ trunk/sql/coa/ca/chart/French-Quebec_General.sql	2011-06-19 18:42:17 UTC (rev 3290)
@@ -10,71 +10,71 @@
 -- TVQ/TPS terminology, CSST, Assurance-emploi, RRQ, TVQ rate
 
 SELECT account_heading_save(NULL, '1000', 'ACTIF COURANT', NULL);
-SELECT account_save(NULL,'1060','Compte chÃque','A','1002', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
-SELECT account_save(NULL,'1065','Petite caisse','A','1001', NULL, false,string_to_array('AR_paid:AP_paid', ':'));
-SELECT account_save(NULL,'1200','Comptes clients','A','1060', NULL, false,string_to_array('AR', ':'));
-SELECT account_save(NULL,'1205','Provisions pour crÃances douteuses','A','1063', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'1060','Compte chÃque','A','1002', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'1065','Petite caisse','A','1001', NULL, false, false, string_to_array('AR_paid:AP_paid', ':'));
+SELECT account_save(NULL,'1200','Comptes clients','A','1060', NULL, false, false, string_to_array('AR', ':'));
+SELECT account_save(NULL,'1205','Provisions pour crÃances douteuses','A','1063', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '1500', 'INVENTAIRE', NULL);
-SELECT account_save(NULL,'1520','Inventaire / GÃnÃral','A','1122', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1530','Inventaire / PiÃces de rechange','A','1122', NULL, false,string_to_array('IC', ':'));
-SELECT account_save(NULL,'1540','Inventaire / MatiÃres premiÃres','A','1122', NULL, false,string_to_array('IC', ':'));
+SELECT account_save(NULL,'1520','Inventaire / GÃnÃral','A','1122', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1530','Inventaire / PiÃces de rechange','A','1122', NULL, false, false, string_to_array('IC', ':'));
+SELECT account_save(NULL,'1540','Inventaire / MatiÃres premiÃres','A','1122', NULL, false, false, string_to_array('IC', ':'));
 SELECT account_heading_save(NULL, '1800', 'AUTRES IMMOBILISATIONS', NULL);
-SELECT account_save(NULL,'1820','Meubles et accessoires','A','1787', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'1820','Meubles et accessoires','A','1787', NULL, false, false, string_to_array('', ':'));
 SELECT account_save(NULL,'1825','Amortissement cumulà des meubles et des accessoires','A','1788', NULL, '1',string_to_array('', ':'));
-SELECT account_save(NULL,'1840','VÃhicules automobiles','A','1742', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'1840','VÃhicules automobiles','A','1742', NULL, false, false, string_to_array('', ':'));
 SELECT account_save(NULL,'1845','Amortissement cumulà des vÃhicules automobiles','A','1743', NULL, '1',string_to_array('', ':'));
 SELECT account_heading_save(NULL, '2000', 'PASSIF COURANT', NULL);
-SELECT account_save(NULL,'2100','Comptes fournisseurs','L','2621', NULL, false,string_to_array('AP', ':'));
-SELECT account_save(NULL,'2160','Taxes fÃdÃrales à payer','L','2683', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2170','Taxes provinciales à payer','L','2684', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2310','TPS','L','2685', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'2320','TVQ','L','2686', NULL, false,string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
-SELECT account_save(NULL,'2380','IndemnitÃs de vacances à payer','L','2624', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2390','CSST Ã payer','L','2627', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'2100','Comptes fournisseurs','L','2621', NULL, false, false, string_to_array('AP', ':'));
+SELECT account_save(NULL,'2160','Taxes fÃdÃrales à payer','L','2683', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2170','Taxes provinciales à payer','L','2684', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2310','TPS','L','2685', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'2320','TVQ','L','2686', NULL, false, false, string_to_array('AR_tax:AP_tax:IC_taxpart:IC_taxservice', ':'));
+SELECT account_save(NULL,'2380','IndemnitÃs de vacances à payer','L','2624', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2390','CSST Ã payer','L','2627', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '2400', 'RETENUES SUR SALAIRE', NULL);
-SELECT account_save(NULL,'2410','Assurance-emploi à payer','L','2627', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2420','RRQ Ã payer','L','2627', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2450','ImpÃt sur le revenu à payer','L','2628', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'2410','Assurance-emploi à payer','L','2627', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2420','RRQ Ã payer','L','2627', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2450','ImpÃt sur le revenu à payer','L','2628', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '2600', 'PASSIF Ã LONG TERME', NULL);
-SELECT account_save(NULL,'2620','Emprunts bancaires','L','2701', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'2680','Emprunt auprÃs des actionnaires','L','2780', NULL, false,string_to_array('AP_paid', ':'));
+SELECT account_save(NULL,'2620','Emprunts bancaires','L','2701', NULL, false, false, string_to_array('', ':'));
+SELECT account_save(NULL,'2680','Emprunt auprÃs des actionnaires','L','2780', NULL, false, false, string_to_array('AP_paid', ':'));
 SELECT account_heading_save(NULL, '3300', 'CAPITAL SOCIAL', NULL);
-SELECT account_save(NULL,'3350','Actions ordinaires','Q','3500', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'3350','Actions ordinaires','Q','3500', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '4000', 'REVENUS DE VENTE', NULL);
-SELECT account_save(NULL,'4020','Ventes gÃnÃrales','I','8000', NULL, false,string_to_array('AR_amount:IC_sale:IC_income', ':'));
-SELECT account_save(NULL,'4030','PiÃces de rechange','I','8000', NULL, false,string_to_array('AR_amount:IC_sale', ':'));
+SELECT account_save(NULL,'4020','Ventes gÃnÃrales','I','8000', NULL, false, false, string_to_array('AR_amount:IC_sale:IC_income', ':'));
+SELECT account_save(NULL,'4030','PiÃces de rechange','I','8000', NULL, false, false, string_to_array('AR_amount:IC_sale', ':'));
 SELECT account_heading_save(NULL, '4400', 'AUTRES REVENUS', NULL);
-SELECT account_save(NULL,'4430','Transport et manutention','I','8457', NULL, false,string_to_array('IC_income', ':'));
-SELECT account_save(NULL,'4440','IntÃrÃts','I','8090', NULL, false,string_to_array('IC_income', ':'));
-SELECT account_save(NULL,'4450','Gain sur change','I','8231', NULL, false,string_to_array('', ':'));
+SELECT account_save(NULL,'4430','Transport et manutention','I','8457', NULL, false, false, string_to_array('IC_income', ':'));
+SELECT account_save(NULL,'4440','IntÃrÃts','I','8090', NULL, false, false, string_to_array('IC_income', ':'));
+SELECT account_save(NULL,'4450','Gain sur change','I','8231', NULL, false, false, string_to_array('', ':'));
 SELECT account_heading_save(NULL, '5000', 'COÃT DES PRODUITS VENDUS', NULL);
-SELECT account_save(NULL,'5010','Achats','E','8320', NULL, false,string_to_array('AP_amount:IC_cogs:IC_expense', ':'));
-SELECT account_save(NULL,'5050','PiÃces de rechange','E','8320', NULL, false,string_to_array('AP_amount:IC_cogs', ':'));
-SELECT account_save(NULL,'5100','Frais de transport','E','8457', NULL, false,string_to_array('AP_amount:IC_expense', ':'));
+SELECT account_save(NULL,'5010','Achats','E','8320', NULL, false, false, string_to_array('AP_amount:IC_cogs:IC_expense', ':'));
+SELECT account_save(NULL,'5050','PiÃces de rechange','E','8320', NULL, false, false, string_to_array('AP_amount:IC_cogs', ':'));
+SELECT account_save(NULL,'5100','Frais de transport','E','8457', NULL, false, false, string_to_array('AP_amount:IC_expense', ':'));
 SELECT account_heading_save(NULL, '5400', 'FRAIS DE PERSONNEL', NULL);
-SELECT account_save(NULL,'5410','Salaires','E','9060', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5420','DÃpenses d''assurance-emploi','E','8622', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5430','DÃpenses RRQ','E','8622', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5440','DÃpenses CSST','E','8622', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5450','DÃpenses FSS','E','8622', NULL, false,string_to_array('', ':'));
-SELECT account_save(NULL,'5460','DÃpenses RQAP','E','8622', NULL, false,string_to_array('', ':'));

@@ Diff output truncated at 100000 characters. @@

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