Wiki Change:

omfgppc
2009-03-10
2013-03-08
  • omfgppc
    omfgppc
    2009-03-10

    You have subscribed to a wiki page or wiki category on "xTuple" for change =
    notification.

    The "EnhancedTaxInternationalization" page has been changed by jrogelstad:

      Now that we have defined ''what'' we have to do and how we think it shoul=
    d look to the user, we can describe the ''internal'' structure of the appli=
    cation. If possible, outline the architecture of the feature implementation=
    here. Then in the sections below describe the changes and additions to the=
    application to create this architecture.
      =

      =3D=3D Basic Algorithms =3D=3D
    - A new table function will be created that takes the an input of tax zone,=
    tax type and currency amount to produce a set of detail records describing =
    tax detail:
    + A new table function will be created that takes the an input of tax zone,=
    tax type,date,currency id, and amount to produce a set of output records de=
    scribing tax detail.  This function will be multilevel similar to the inden=
    tedBOM(int,int,int,int) function. It will return records using the taxdetai=
    l composite type listed below.
      =

      {{{
    - create table f
    + CREATE OR REPLACE FUNCTION taxDetail(INTEGER, INTEGER, DATE, INTEGER, NUM=
    ERIC) RETURNS SETOF taxdetail AS '
    + DECLARE
    +   tax zone id
    +   tax type id
    +   date basis
    +   currency id
    +   amount
    +   record
    + =

    + BEGIN
    + =

    +   FOR record LOOP
    +     SELECT the data required by taxdetail type
    +     FROM taxass, taxcode, tax class
    +     WHERE tax zone is null or matches input
    +     AND   tax auth is null or matches input
    + =

    + =

    + END
    + =

      =

      }}}
      =3D=3D Custom Widget Changes =3D=3D
    @@ -443, +462 @@

      ALTER TABLE tax ADD COLUMN tax_taxauth_id integer REFERENCES taxauth (tax=
    auth_id);
      ALTER TABLE tax ADD COLUMN tax_basis_tax_id integer REFERENCES tax (tax_i=
    d) ON DELETE CASCADE;
      }}}
    - =3D=3D=3D New Types =3D=3D=3D
    + =3D=3D=3D New Type =3D=3D=3D
    - =

    -   '''taxassign''' - A composite type to return indented tax assignment re=
    cords from the taxassign function which is in turn used by the Tax Assignme=
    nts window
    - =

    - {{{
    - CREATE TYPE taxassign AS
    - (
    -   taxassign_taxzone_id integer,
    -   taxassign_taxzone_code text,
    -   taxassign_taxtype_id integer,
    -   taxassign_taxtype_code text,
    -   taxassign_level integer,
    -   taxassign_taxcode_id integer,
    -   taxassign_taxcode_code text,
    -   taxassign_taxcode_descrip text,
    -   taxassign_taxclass_id integer,
    -   taxassign_taxclass_code text,
    -   taxassign_taxclass_sequence integer
    - );
    - }}}
    - =

    -   '''taxdetail''' - A composite type to return a calculated tax detail re=
    cord set used by the taxdetail function which is in turn used by the Tax De=
    tail window.
    +  . '''taxdetail''' - A composite type to return a calculated tax detail r=
    ecord set used by the taxdetail function which is in turn used by the Tax D=
    etail window.
      =

      {{{
      CREATE TYPE taxdetail AS
    @@ -483, +482 @@

        taxdetail_tax numeric (16,2)
      );
      }}}
    - =

      What privileges do we need?
      ||||<style=3D"text-align: center;">'''Privileges for feature''' ||
      =