+
+porting from sql-ledger: OE.pm ar.pl cp.pl ct.pl oe.pl ps.pl
+
Index: openacs-4/packages/fabrik/fabrik.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/fabrik/fabrik.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/fabrik/fabrik.info 3 Jul 2006 19:27:18 -0000 1.1
@@ -0,0 +1,27 @@
+
+
+
+
+ Fabrication
+ Fabrications
+ f
+ f
+
+
+ Torben Brosten
+ OpenACS community
+ Fabrication package works with bills of materials etc from design to production specifications.
+ Dekka Corp of Oregon
+ Frabrication package is built around the common bills of materials, yet scopes to time, materials and specifications for handling of parts from design to pre-production. This package considers other practical aspects of manufacturing besides the standard bills of materials scenarios.
+ 0
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/fabrik/sql/postgresql/fabrik-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/fabrik/sql/postgresql/fabrik-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/fabrik/sql/postgresql/fabrik-create.sql 3 Jul 2006 19:27:18 -0000 1.1
@@ -0,0 +1,154 @@
+-- fabrik-create.sql
+--
+-- @author Dekka Corp.
+-- @ported from sql-ledger and combined with parts from OpenACS ecommerce package
+-- @license GNU GENERAL PUBLIC LICENSE, Version 2, June 1991
+-- @cvs-id
+
+CREATE TABLE qfab_parts (
+ id int DEFAULT nextval ( 'id' ),
+ partnumber text,
+ description text,
+ unit varchar(5),
+ listprice float,
+ sellprice float,
+ lastcost float,
+ priceupdate date DEFAULT current_date,
+ weight float4,
+ onhand float4 DEFAULT 0,
+ notes text,
+ makemodel bool DEFAULT 'f',
+ assembly bool DEFAULT 'f',
+ alternate bool DEFAULT 'f',
+ rop float4,
+ inventory_accno_id int,
+ income_accno_id int,
+ expense_accno_id int,
+ bin text,
+ obsolete bool DEFAULT 'f',
+ bom bool DEFAULT 'f',
+ image text,
+ drawing text,
+ microfiche text,
+ partsgroup_id int,
+ project_id int,
+ avgcost float
+);
+
+CREATE TABLE qfab_assembly (
+ id int,
+ parts_id int,
+ qty float,
+ bom bool,
+ adj bool
+);
+
+
+CREATE TABLE qfab_partsvendor (
+ vendor_id int,
+ parts_id int,
+ partnumber text,
+ leadtime int2,
+ lastcost float,
+ curr char(3)
+);
+
+
+CREATE SEQUENCE qfab_jcitemsid;
+
+CREATE TABLE qfab_jcitems (
+ id int default nextval('jcitemsid'),
+ project_id int,
+ parts_id int,
+ description text,
+ qty float4,
+ allocated float4,
+ sellprice float8,
+ fxsellprice float8,
+ serialnumber text,
+ checkedin timestamp with time zone,
+ checkedout timestamp with time zone,
+ employee_id int,
+ notes text
+);
+
+create index qfab_assembly_id_key on qfab_assembly (id);
+
+
+
+
+create index qfab_jcitems_id_key on qfab_jcitems (id);
+
+
+-- following needs to be integrated into above
+
+-- rules
+-- provisions for requests to change bom or order through an approval workflow --before the change is accepted (ECO)
+-- bom must be designed to handle the most demanding functions: planning
+-- superbom includes labor/routing with bom, and requirements (think baking recipe etc)
+-- multiple views of bom
+-- bom references are unique
+-- bom includes quantity (manufacturing might result in creation of more than 1 created per bom, for example 1 pipe cut in half creates 2 pipes...)
+-- have provisions for handling perishible goods
+-- bom refeerences are different than drawing references
+-- bom includes all materials to be scheduled
+-- bom editing UI is designed to minimize depth of dependencies
+-- template boms (used during design process) --optionally use specification parameters (called modularizing) to minimize the number of templates. (a kind of parts number system by specs) --also a revision number
+-- orders copy template to their own spec set. (handy for lot number controls, customization, substitutions etc), can create a serial number for each part.
+-- addition of a table to handle customized fields (in the same manner as ecommerce package does)
+--
+-- When to assign part numbers: every item represented in the system has at least an internal part number. Formal numbers are optional if not specified.
+-- parts_master table (links to data in other tables)
+-- part_number
+-- other_table_name other_table_reference (make these external keys?)
+-- (maybe this is an object folder with the CR)? No (or yes, but scary because) CR uses ad_conn for some code with causes problems with scheduled procs. Scheduled procs will be heavily relied on for forecasting and planning, as well as mainenance. CR is meant for more generalized uses, this is a specific datamodel with specific requirements.
+--
+--
+-- bom table
+-- internal_notes
+-- bom_internal_key
+-- part _number
+-- model_series_number (not unique, for grouping purposes)
+-- level (where 0 is lowest assembly level (ie. indivisible/raw material/aquired parts) value is 1 + max of the components in the bom
+-- bom_sku (upc etc.)
+-- sellable_p
+-- service_item_p
+-- assembly_p
+-- stockable_p
+-- phantom_item_p (exists on paper only)
+-- manufactured_part_p (1 =requires specialty tools/labor)
+-- perishible_item_p (uses quality date)
+-- create_serial_number_p
+-- last_issued_serial_number
+-- shipping_notes (contains flags for hazardous shipping, special instructions)
+-- lots_p (track production run, see lot_number)
+-- lot_number
+-- standards_met_p (track grade, standards compliance for part)
+--
+-- make a separate table for tracking each of the _p attributes.
+--
+--
+-- substitution_map
+-- original_part_number
+-- substitute_part_number
+-- notes
+--
+--
+-- part table
+-- length
+-- width
+-- height
+-- volume
+-- weight
+-- variable-dimension(s)
+-- variable-dimension-units
+-- manufactured_date
+-- quality_date (expires, best used by, date made etc)
+-- min_run varchar(5), /* min amount of parts to run to make a profit */
+-- serial_number
+--
+-- routing table
+-- partnumber
+-- labor-ref
+-- location
+--
Index: openacs-4/packages/fabrik/sql/postgresql/fabrik-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/fabrik/sql/postgresql/fabrik-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/fabrik/sql/postgresql/fabrik-drop.sql 3 Jul 2006 19:27:18 -0000 1.1
@@ -0,0 +1,31 @@
+-- fabrik-drop.sql
+--
+-- @author Dekka Corp.
+-- @ported from sql-ledger and combined with parts from OpenACS ecommerce package
+-- @license GNU GENERAL PUBLIC LICENSE, Version 2, June 1991
+-- @cvs-id
+
+
+drop index qfab_jcitems_id_key on qfab_jcitems ();
+
+drop index qfab_partsgroup_key on qfab_partsgroup ();
+drop index qfab_partsgroup_id_key on qfab_partsgroup ();
+
+
+drop index qfab_makemodel_model_key on qfab_makemodel ();
+drop index qfab_makemodel_make_key on qfab_makemodel ();
+drop index qfab_makemodel_parts_id_key on qfab_makemodel ();
+
+drop index qfab_assembly_id_key on qfab_assembly ();
+
+DROP TABLE qfab_jcitems;
+
+DROP SEQUENCE qfab_jcitemsid;
+
+
+DROP TABLE qfab_partsvendor;
+
+
+DROP TABLE qfab_assembly;
+
+DROP TABLE qfab_parts;
Index: openacs-4/packages/fabrik/www/doc/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/fabrik/www/doc/index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/fabrik/www/doc/index.adp 3 Jul 2006 19:27:18 -0000 1.1
@@ -0,0 +1,4 @@
+
+
+Porting from sql-ledger: JC.pm jc.pl pe.pl
+
Index: openacs-4/packages/inventory-control/inventory-control.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/inventory-control/inventory-control.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/inventory-control/inventory-control.info 3 Jul 2006 19:29:13 -0000 1.1
@@ -0,0 +1,27 @@
+
+
+
+
+ Inventory
+ Inventories
+ f
+ f
+
+
+ Torben Brosten
+ OpenACS community
+ Inventory package tracks inventory, parts locations and costs.
+ Dekka Corp of Oregon
+ Inventory package provides inventory control, includes tracking locations and costs, can report changes to general ledger etc.
+ 0
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/inventory-control/sql/postgresql/catalog-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/inventory-control/sql/postgresql/catalog-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/inventory-control/sql/postgresql/catalog-create.sql 3 Jul 2006 19:29:13 -0000 1.1
@@ -0,0 +1,86 @@
+-- catalog-create.sql
+--
+-- @author Dekka Corp.
+-- @ported from sql-ledger and combined with parts from OpenACS ecommerce package
+-- @license GNU GENERAL PUBLIC LICENSE, Version 2, June 1991
+-- @cvs-id
+--
+--
+
+CREATE TABLE qci_parts (
+ id int DEFAULT nextval ( 'id' ),
+ partnumber text,
+ description text,
+ unit varchar(5),
+ listprice float,
+ sellprice float,
+ lastcost float,
+ priceupdate date DEFAULT current_date,
+ weight float4,
+ onhand float4 DEFAULT 0,
+ notes text,
+ makemodel bool DEFAULT 'f',
+ assembly bool DEFAULT 'f',
+ alternate bool DEFAULT 'f',
+ rop float4,
+ inventory_accno_id int,
+ income_accno_id int,
+ expense_accno_id int,
+ bin text,
+ obsolete bool DEFAULT 'f',
+ bom bool DEFAULT 'f',
+ image text,
+ drawing text,
+ microfiche text,
+ partsgroup_id int,
+ project_id int,
+ avgcost float
+);
+
+--
+CREATE TABLE qci_partsgroup (
+ id int default nextval('id'),
+ partsgroup text
+);
+
+create index qci_partsgroup_id_key on qci_partsgroup (id);
+create unique index qci_partsgroup_key on qci_partsgroup (partsgroup);
+
+
+--
+CREATE TABLE qci_pricegroup (
+ id int default nextval('id'),
+ pricegroup text
+);
+--
+CREATE TABLE qci_partscustomer (
+ parts_id int,
+ customer_id int,
+ pricegroup_id int,
+ pricebreak float4,
+ sellprice float,
+ validfrom date,
+ validto date,
+ curr char(3)
+);
+
+--
+CREATE TABLE qci_partstax (
+ parts_id int,
+ chart_id int
+);
+--
+
+create index qci_parts_id_key on qci_parts (id);
+create index qci_parts_partnumber_key on qci_parts (lower(partnumber));
+create index qci_parts_description_key on qci_parts (lower(description));
+create index qci_partstax_parts_id_key on qci_partstax (parts_id);
+
+--
+create index qci_partsvendor_vendor_id_key on qci_partsvendor (vendor_id);
+create index qci_partsvendor_parts_id_key on qci_partsvendor (parts_id);
+--
+create index qci_pricegroup_pricegroup_key on qci_pricegroup (pricegroup);
+create index qci_pricegroup_id_key on qci_pricegroup (id);
+
+
Index: openacs-4/packages/inventory-control/sql/postgresql/inventory-control-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/inventory-control/sql/postgresql/inventory-control-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/inventory-control/sql/postgresql/inventory-control-create.sql 3 Jul 2006 19:29:14 -0000 1.1
@@ -0,0 +1,673 @@
+-- inventory-control-create.sql
+--
+-- @author Dekka Corp.
+-- @ported from sql-ledger and combined with parts from OpenACS ecommerce package
+-- @license GNU GENERAL PUBLIC LICENSE, Version 2, June 1991
+-- @cvs-id
+--
+
+-- following from SL
+
+CREATE TABLE qci_makemodel (
+ parts_id integer,
+ make text,
+ model text
+);
+
+create index qci_makemodel_parts_id_key on qci_makemodel (parts_id);
+create index qci_makemodel_make_key on qci_makemodel (lower(make));
+create index qci_makemodel_model_key on qci_makemodel (lower(model));
+
+
+CREATE TABLE qci_warehouse (
+ id int default nextval('id'),
+ description text
+);
+
+
+CREATE TABLE qci_inventory (
+ warehouse_id int,
+ parts_id int,
+ trans_id int,
+ orderitems_id int,
+ qty float4,
+ shippingdate date,
+ employee_id int
+);
+
+
+CREATE FUNCTION qci_check_inventory() RETURNS OPAQUE AS '
+
+declare
+ itemid int;
+ row_data inventory%rowtype;
+
+begin
+
+ if not old.quotation then
+ for row_data in select * from qci_inventory where trans_id = old.id loop
+ select into itemid id from orderitems where trans_id = old.id and id = row_data.orderitems_id;
+
+ if itemid is null then
+ delete from qci_inventory where trans_id = old.id and orderitems_id = row_data.orderitems_id;
+ end if;
+ end loop;
+ end if;
+return old;
+end;
+' language 'plpgsql';
+-- end function
+
+
+
+
+
+-- following from ecommerce package
+
+-- Helper stuff (ben@adida.net)
+-- gilbertw - I pulled this from OpenACS 3.2.5
+-- there are a few calls to the Oracle least function
+create function qci_least(numeric,numeric)
+returns numeric
+as '
+DECLARE
+ first alias for $1;
+ second alias for $2;
+BEGIN
+ if first < second
+ then return first;
+ else return second;
+ end if;
+END;
+' language 'plpgsql';
+
+-- gilbertw
+-- timespan_days taken from OpenACS 3.2.5
+-- can't cast numeric to varchar/text so I made the input varchar
+create function qci_timespan_days(float) returns interval as '
+DECLARE
+ n_days alias for $1;
+BEGIN
+ return (n_days::text || '' days'')::interval;
+END;
+' language 'plpgsql';
+
+
+-- this should be replaced by the object_id sequence
+-- grep for it in files...
+-- create sequence ec_product_id_sequence start 1;
+
+-- This table contains the products and also the product series.
+-- A product series has the same fields as a product (it actually
+-- *is* a product, since it's for sale, has its own price, etc.).
+-- The only difference is that it has other products associated
+-- with it (that are part of it). So information about the
+-- whole series is kept in this table and the product_series_map
+-- table below keeps track of which products are inside each
+-- series.
+
+-- wtem@olywa.net, 2001-03-24
+-- begin
+-- acs_object_type__create_type (
+-- supertype => 'acs_object',
+-- object_type => 'ec_product',
+-- pretty_name => 'Product',
+-- pretty_plural => 'Products',
+-- table_name => 'EC_PRODUCTS',
+-- id_column => 'PRODUCT_ID',
+-- package_name => 'ECOMMERCE'
+-- );
+-- end;
+-- /
+-- show errors;
+
+create function inline_0 ()
+returns integer as '
+begin
+
+ PERFORM acs_object_type__create_type (
+ ''ec_product'',
+ ''Product'',
+ ''Products'',
+ ''acs_object'',
+ ''ec_products'',
+ ''product_id'',
+ ''ecommerce'',
+ ''f'',
+ null,
+ null
+ );
+
+ return 0;
+
+end;' language 'plpgsql';
+
+select inline_0 ();
+drop function inline_0 ();
+
+-- wtem@olywa.net, 2001-03-24
+-- we aren't going to bother to define all the attributes of an ec_product type
+-- for now, because we are just using it for site-wide-search anyway
+-- we have a corresponding pl/sql package for the ec_product object_type
+-- it can be found at ecommerce/sql/ec-product-package-create.sql
+-- and is called at the end of this script
+create table qci_ec_products (
+ product_id integer constraint qci_ec_products_product_id_fk
+ references acs_objects(object_id)
+ on delete cascade
+ constraint qci_ec_products_product_id_pk
+ primary key,
+ -- above changed by wtem@olywa.net, 2001-03-24
+ -- integer not null primary key,
+ sku varchar(100),
+ product_name varchar(200),
+ creation_date timestamptz default current_timestamp not null,
+ one_line_description varchar(400),
+ detailed_description varchar(4000),
+ search_keywords varchar(4000),
+ -- this is the regular price for the product. If user
+ -- classes are charged a different price, it should be
+ -- specified in qci_ec_product_user_class_prices
+ price numeric,
+ -- for stuff that can't be shipped like services
+ no_shipping_avail_p boolean default 'f',
+ -- leave this blank if shipping is calculated using
+ -- one of the more complicated methods available
+ shipping numeric,
+ -- fill this in if shipping is calculated by: above price
+ -- for first item (with this product_id), and the below
+ -- price for additional items (with this product_id)
+ shipping_additional numeric,
+ -- fill this in if shipping is calculated using weight
+ -- use whatever units you want (lbs/kg), just be consistent
+ -- and make your shipping algorithm take the units into
+ -- account
+ weight numeric,
+ -- holds pictures, sample chapters, etc.
+ dirname varchar(200),
+ -- whether this item should show up in searches (e.g., if it's
+ -- a volume of a series, you might not want it to)
+ present_p boolean default 't',
+ -- whether the item should show up at all in the user pages
+ active_p boolean default 't',
+ -- the date the product becomes available for sale (it can be listed
+ -- before then, it's just not buyable)
+ available_date timestamptz default current_timestamp not null,
+ announcements varchar(4000),
+ announcements_expire timestamptz,
+ -- if there's a web site with more info about the product
+ url varchar(300),
+ template_id integer references ecca_ec_templates,
+ -- o = out of stock, q = ships quickly, m = ships
+ -- moderately quickly, s = ships slowly, i = in stock
+ -- with no message about the speed of the shipment (shipping
+ -- messages are in parameters .ini file)
+ stock_status char(1) check (stock_status in ('o','q','m','s','i')),
+ -- comma-separated lists of available colors, sizes, and styles for the user
+ -- to choose upon ordering
+ color_list varchar(4000),
+ size_list varchar(4000),
+ style_list varchar(4000),
+ -- email this list on purchase
+ email_on_purchase_list varchar(4000),
+ -- the user ID and IP address of the creator of the product
+ last_modified timestamptz not null,
+ last_modifying_user integer not null references users,
+ modified_ip_address varchar(20) not null
+);
+
+create view qci_ec_products_displayable
+as
+select * from qci_ec_products
+where active_p='t';
+
+create view qci_ec_products_searchable
+as
+select * from qci_ec_products
+where active_p='t' and present_p='t';
+
+create table qci_ec_products_audit (
+ product_id integer,
+ product_name varchar(200),
+ creation_date timestamptz,
+ one_line_description varchar(400),
+ detailed_description varchar(4000),
+ search_keywords varchar(4000),
+ price numeric,
+ shipping numeric,
+ shipping_additional numeric,
+ weight numeric,
+ dirname varchar(200),
+ present_p boolean default 't',
+ active_p boolean default 't',
+ available_date timestamptz,
+ announcements varchar(4000),
+ announcements_expire timestamptz,
+ url varchar(300),
+ template_id integer,
+ stock_status char(1) check (stock_status in ('o','q','m','s','i')),
+ last_modified timestamptz,
+ last_modifying_user integer,
+ modified_ip_address varchar(20),
+ delete_p boolean default 'f'
+);
+
+create function qci_ec_products_audit_tr ()
+returns opaque as '
+begin
+ insert into qci_ec_products_audit (
+ product_id, product_name, creation_date,
+ one_line_description, detailed_description,
+ search_keywords, shipping,
+ shipping_additional, weight,
+ dirname, present_p,
+ active_p, available_date,
+ announcements, announcements_expire,
+ url, template_id,
+ stock_status,
+ last_modified,
+ last_modifying_user, modified_ip_address
+ ) values (
+ old.product_id, old.product_name, old.creation_date,
+ old.one_line_description, old.detailed_description,
+ old.search_keywords, old.shipping,
+ old.shipping_additional, old.weight,
+ old.dirname, old.present_p,
+ old.active_p, old.available_date,
+ old.announcements, old.announcements_expire,
+ old.url, old.template_id,
+ old.stock_status,
+ old.last_modified,
+ old.last_modifying_user, old.modified_ip_address
+ );
+ return new;
+end;' language 'plpgsql';
+
+create trigger qci_ec_products_audit_tr
+after update or delete on qci_ec_products
+for each row execute procedure qci_ec_products_audit_tr ();
+
+
+-- people who bought product_id also bought products 0 through
+-- 4, where product_0 is the most frequently purchased, 1 is next,
+-- etc.
+create table qci_ec_product_purchase_comb (
+ product_id integer not null primary key references qci_ec_products,
+ product_0 integer references qci_ec_products,
+ product_1 integer references qci_ec_products,
+ product_2 integer references qci_ec_products,
+ product_3 integer references qci_ec_products,
+ product_4 integer references qci_ec_products
+);
+
+create index qci_ec_product_purchase_comb_idx0 on qci_ec_product_purchase_comb(product_0);
+create index qci_ec_product_purchase_comb_idx1 on qci_ec_product_purchase_comb(product_1);
+create index qci_ec_product_purchase_comb_idx2 on qci_ec_product_purchase_comb(product_2);
+create index qci_ec_product_purchase_comb_idx3 on qci_ec_product_purchase_comb(product_3);
+create index qci_ec_product_purchase_comb_idx4 on qci_ec_product_purchase_comb(product_4);
+
+create sequence qci_ec_sale_price_id_seq start 1;
+create view qci_ec_sale_price_id_sequence as select nextval('qci_ec_sale_price_id_seq') as nextval;
+
+create table qci_ec_sale_prices (
+ sale_price_id integer not null primary key,
+ product_id integer not null references qci_ec_products,
+ sale_price numeric,
+ sale_begins timestamptz not null,
+ sale_ends timestamptz not null,
+ -- like Introductory Price or Sale Price or Special Offer
+ sale_name varchar(30),
+ -- if non-null, the user has to know this code to get the sale price
+ offer_code varchar(20),
+ last_modified timestamptz not null,
+ last_modifying_user integer not null references users,
+ modified_ip_address varchar(20) not null
+);
+
+create index qci_ec_sale_prices_by_product_idx on qci_ec_sale_prices(product_id);
+
+create view qci_ec_sale_prices_current
+as
+select * from qci_ec_sale_prices
+where now() >= sale_begins
+and now() <= sale_ends;
+
+
+create table qci_ec_sale_prices_audit (
+ sale_price_id integer,
+ product_id integer,
+ sale_price numeric,
+ sale_begins timestamptz,
+ sale_ends timestamptz,
+ sale_name varchar(30),
+ offer_code varchar(20),
+ last_modified timestamptz,
+ last_modifying_user integer,
+ modified_ip_address varchar(20),
+ delete_p boolean default 'f'
+);
+
+
+create function qci_ec_sale_prices_audit_tr ()
+returns opaque as '
+begin
+ insert into qci_ec_sale_prices_audit (
+ sale_price_id, product_id, sale_price,
+ sale_begins, sale_ends, sale_name, offer_code,
+ last_modified,
+ last_modifying_user, modified_ip_address
+ ) values (
+ old.sale_price_id, old.product_id, old.sale_price,
+ old.sale_begins, old.sale_ends, old.sale_name, old.offer_code,
+ old.last_modified,
+ old.last_modifying_user, old.modified_ip_address
+ );
+ return new;
+end;' language 'plpgsql';
+
+create trigger qci_ec_sale_prices_audit_tr
+after update or delete on qci_ec_sale_prices
+for each row execute procedure qci_ec_sale_prices_audit_tr ();
+
+
+create table qci_ec_product_series_map (
+ -- this is the product_id of a product that happens to be
+ -- a series
+ series_id integer not null references qci_ec_products,
+ -- this is the product_id of a product that is one of the
+ -- components of the above series
+ component_id integer not null references qci_ec_products,
+ primary key (series_id, component_id),
+ last_modified timestamptz not null,
+ last_modifying_user integer not null references users,
+ modified_ip_address varchar(20) not null
+);
+
+create index qci_ec_product_series_map_idx2 on qci_ec_product_series_map(component_id);
+
+create table qci_ec_product_series_map_audit (
+ series_id integer,
+ component_id integer,
+ last_modified timestamptz,
+ last_modifying_user integer,
+ modified_ip_address varchar(20),
+ delete_p boolean default 'f'
+);
+
+
+create function qci_ec_product_series_map_audit_tr ()
+returns opaque as '
+begin
+ insert into qci_ec_product_series_map_audit (
+ series_id, component_id,
+ last_modified,
+ last_modifying_user, modified_ip_address
+ ) values (
+ old.series_id, old.component_id,
+ old.last_modified,
+ old.last_modifying_user, old.modified_ip_address
+ );
+ return new;
+end;' language 'plpgsql';
+
+create trigger qci_ec_product_series_map_audit_tr
+after update or delete on qci_ec_product_series_map
+for each row execute procedure qci_ec_product_series_map_audit_tr ();
+
+
+
+
+
+-- this specifies that product_a links to product_b on the display page for product_a
+create table qci_ec_product_links (
+ product_a integer not null references qci_ec_products,
+ product_b integer not null references qci_ec_products,
+ last_modified timestamptz not null,
+ last_modifying_user integer not null references users,
+ modified_ip_address varchar(20) not null,
+ primary key (product_a, product_b)
+);
+
+create index qci_ec_product_links_idx on qci_ec_product_links (product_b);
+
+create table qci_ec_product_links_audit (
+ product_a integer,
+ product_b integer,
+ last_modified timestamptz,
+ last_modifying_user integer,
+ modified_ip_address varchar(20),
+ delete_p boolean default 'f'
+);
+
+create function qci_ec_product_links_audit_tr ()
+returns opaque as '
+begin
+ insert into qci_ec_product_links_audit (
+ product_a, product_b,
+ last_modified,
+ last_modifying_user, modified_ip_address
+ ) values (
+ old.product_a, old.product_b,
+ old.last_modified,
+ old.last_modifying_user, old.modified_ip_address
+ );
+ return new;
+end;' language 'plpgsql';
+
+create trigger qci_ec_product_links_audit_tr
+after update or delete on qci_ec_product_links
+for each row execute procedure qci_ec_product_links_audit_tr ();
+
+
+-- comments made by users on the products
+create table qci_ec_product_comments (
+ comment_id integer not null primary key,
+ product_id integer not null references qci_ec_products,
+ user_id integer not null references users,
+ user_comment varchar(4000),
+ one_line_summary varchar(300),
+ rating numeric,
+ -- in some systems, the administrator will have to approve comments first
+ approved_p boolean,
+ comment_date timestamptz,
+ last_modified timestamptz not null,
+ last_modifying_user integer not null references users,
+ modified_ip_address varchar(20) not null
+);
+
+create index qci_ec_product_comments_idx on qci_ec_product_comments(product_id);
+create index qci_ec_product_comments_idx2 on qci_ec_product_comments(user_id);
+create index qci_ec_product_comments_idx3 on qci_ec_product_comments(approved_p);
+
+create table qci_ec_product_comments_audit (
+ comment_id integer,
+ product_id integer,
+ user_id integer,
+ user_comment varchar(4000),
+ one_line_summary varchar(300),
+ rating numeric,
+ approved_p boolean,
+ last_modified timestamptz,
+ last_modifying_user integer,
+ modified_ip_address varchar(20),
+ delete_p boolean default 'f'
+);
+
+create function qci_ec_product_comments_audit_tr ()
+returns opaque as '
+begin
+ insert into qci_ec_product_comments_audit (
+ comment_id, product_id, user_id,
+ user_comment, one_line_summary, rating, approved_p,
+ last_modified,
+ last_modifying_user, modified_ip_address
+ ) values (
+ old.comment_id, old.product_id, old.user_id,
+ old.user_comment, old.one_line_summary, old.rating, old.approved_p,
+ old.last_modified,
+ old.last_modifying_user, old.modified_ip_address
+ );
+ return new;
+end;' language 'plpgsql';
+
+create trigger qci_ec_product_comments_audit_tr
+after update or delete on qci_ec_product_comments
+for each row execute procedure qci_ec_product_comments_audit_tr ();
+
+
+create sequence qci_ec_product_review_id_seq start 1;
+create view qci_ec_product_review_id_sequence as select nextval('qci_ec_product_review_id_seq') as nextval;
+
+-- reviews made by professionals of the products
+create table qci_ec_product_reviews (
+ review_id integer not null primary key,
+ product_id integer not null references qci_ec_products,
+ author_name varchar(100),
+ publication varchar(100),
+ review_date timestamptz,
+ -- in HTML format
+ review text,
+ display_p boolean,
+ last_modified timestamptz not null,
+ last_modifying_user integer not null references users,
+ modified_ip_address varchar(20) not null
+);
+
+create index qci_ec_product_reviews_idx on qci_ec_product_reviews (product_id);
+create index qci_ec_product_reviews_idx2 on qci_ec_product_reviews (display_p);
+
+create table qci_ec_product_reviews_audit (
+ review_id integer,
+ product_id integer,
+ author_name varchar(100),
+ publication varchar(100),
+ review_date timestamptz,
+ -- in HTML format
+ review text,
+ display_p boolean,
+ last_modified timestamptz,
+ last_modifying_user integer,
+ modified_ip_address varchar(20),
+ delete_p boolean default 'f'
+);
+
+create function qci_ec_product_reviews_audit_tr ()
+returns opaque as '
+begin
+ insert into qci_ec_product_reviews_audit (
+ review_id, product_id,
+ author_name, publication, review_date,
+ review,
+ display_p,
+ last_modified,
+ last_modifying_user, modified_ip_address
+ ) values (
+ old.review_id, old.product_id,
+ old.author_name, old.publication, old.review_date,
+ old.review,
+ old.display_p,
+ old.last_modified,
+ old.last_modifying_user, old.modified_ip_address
+ );
+ return new;
+end;' language 'plpgsql';
+
+create trigger qci_ec_product_reviews_audit_tr
+after update or delete on qci_ec_product_reviews
+for each row execute procedure qci_ec_product_reviews_audit_tr ();
+
+-- I could in theory make some hairy system that lets them specify
+-- what kind of form element each field will have, does
+-- error checking, etc., but I don't think it's necessary since it's
+-- just the site administrator using it. So here's a very simple
+-- table to store the custom product fields:
+create table qci_ec_custom_product_fields (
+ field_identifier varchar(100) not null primary key,
+ field_name varchar(100),
+ default_value varchar(100),
+ -- column type for oracle (i.e. text, varchar(50), integer, ...)
+ column_type varchar(100),
+ creation_date timestamptz,
+ active_p boolean default 't',
+ last_modified timestamptz not null,
+ last_modifying_user integer not null references users,
+ modified_ip_address varchar(20) not null
+);
+
+create table qci_ec_custom_product_fields_audit (
+ field_identifier varchar(100),
+ field_name varchar(100),
+ default_value varchar(100),
+ column_type varchar(100),
+ creation_date timestamptz,
+ active_p boolean default 't',
+ last_modified timestamptz,
+ last_modifying_user integer,
+ modified_ip_address varchar(20),
+ delete_p boolean default 'f'
+);
+
+create function qci_ec_custom_prod_fields_audit_tr ()
+returns opaque as '
+begin
+ insert into qci_ec_custom_product_fields_audit (
+ field_identifier, field_name,
+ default_value, column_type,
+ creation_date, active_p,
+ last_modified,
+ last_modifying_user, modified_ip_address
+ ) values (
+ old.field_identifier, old.field_name,
+ old.default_value, old.column_type,
+ old.creation_date, old.active_p,
+ old.last_modified,
+ old.last_modifying_user, old.modified_ip_address
+ );
+ return new;
+end;' language 'plpgsql';
+
+create trigger qci_ec_custom_prod_fields_audit_tr
+after update or delete on qci_ec_custom_product_fields
+for each row execute procedure qci_ec_custom_prod_fields_audit_tr ();
+
+-- more columns are added to this table (by Tcl scripts) when the
+-- administrator adds custom product fields
+-- the columns in this table have the name of the field_identifiers
+-- in qci_ec_custom_product_fields
+-- this table stores the values
+create table qci_ec_custom_product_field_values (
+ product_id integer not null primary key references qci_ec_products,
+ last_modified timestamptz not null,
+ last_modifying_user integer not null references users,
+ modified_ip_address varchar(20) not null
+);
+
+create table qci_ec_custom_p_field_values_audit (
+ product_id integer,
+ last_modified timestamptz,
+ last_modifying_user integer,
+ modified_ip_address varchar(20),
+ delete_p boolean default 'f'
+);
+
+create function qci_ec_custom_p_f_values_audit_tr ()
+returns opaque as '
+begin
+ insert into qci_ec_custom_p_field_values_audit (
+ product_id,
+ last_modified,
+ last_modifying_user, modified_ip_address
+ ) values (
+ old.product_id,
+ old.last_modified,
+ old.last_modifying_user, old.modified_ip_address
+ );
+ return new;
+end;' language 'plpgsql';
+
+create trigger qci_ec_custom_p_f_values_audit_tr
+after update or delete on qci_ec_custom_product_field_values
+for each row execute procedure qci_ec_custom_p_f_values_audit_tr();
+
+
+
Index: openacs-4/packages/inventory-control/sql/postgresql/inventory-control-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/inventory-control/sql/postgresql/inventory-control-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/inventory-control/sql/postgresql/inventory-control-drop.sql 3 Jul 2006 19:29:14 -0000 1.1
@@ -0,0 +1,148 @@
+-- inventory-control-drop.sql
+--
+-- @author Dekka Corp.
+-- @ported from sql-ledger and combined with parts from OpenACS ecommerce package
+-- @license GNU GENERAL PUBLIC LICENSE, Version 2, June 1991
+-- @cvs-id
+--
+
+drop trigger qci_ec_custom_p_f_values_audit_tr on qci_ec_custom_product_field_values;
+
+drop function qci_ec_custom_p_f_values_audit_tr ();
+
+drop table qci_ec_custom_p_field_values_audit;
+
+drop table qci_ec_custom_product_field_values;
+
+drop trigger qci_ec_custom_prod_fields_audit_tr on qci_ec_custom_product_fields;
+
+drop function qci_ec_custom_prod_fields_audit_tr ();
+
+drop table qci_ec_custom_product_fields_audit;
+
+drop table qci_ec_custom_product_fields;
+
+drop trigger qci_ec_product_reviews_audit_tr on qci_ec_product_reviews;
+
+drop function qci_ec_product_reviews_audit_tr;
+
+drop table qci_ec_product_reviews_audit;
+
+drop index qci_ec_product_reviews_idx2 on qci_ec_product_reviews;
+drop index qci_ec_product_reviews_idx on qci_ec_product_reviews;
+
+drop table qci_ec_product_reviews;
+
+
+drop view qci_ec_product_review_id_sequence;
+drop sequence qci_ec_product_review_id_seq;
+
+
+drop trigger qci_ec_product_comments_audit_tr on qci_ec_product_comments;
+
+drop function qci_ec_product_comments_audit_tr ();
+
+drop table qci_ec_product_comments_audit ();
+
+drop index qci_ec_product_comments_idx3 on qci_ec_product_comments();
+drop index qci_ec_product_comments_idx2 on qci_ec_product_comments();
+drop index qci_ec_product_comments_idx on qci_ec_product_comments();
+
+drop table qci_ec_product_comments ();
+
+
+
+drop trigger qci_ec_product_links_audit_tr on qci_ec_product_links;
+
+drop function qci_ec_product_links_audit_tr ();
+
+drop table qci_ec_product_links_audit ();
+
+drop index qci_ec_product_links_idx on qci_ec_product_links ();
+
+drop table qci_ec_product_links ();
+
+
+
+drop trigger qci_ec_product_u_c_prices_audit_tr on qci_ec_product_user_class_prices;
+
+drop function qci_ec_product_u_c_prices_audit_tr ();
+
+drop table qci_ec_product_u_c_prices_audit ();
+
+drop index qci_ec_product_user_class_idx on qci_ec_product_user_class_prices();
+
+drop table qci_ec_product_user_class_prices ();
+
+
+drop trigger qci_ec_product_series_map_audit_tr on qci_ec_product_series_map;
+
+drop function qci_ec_product_series_map_audit_tr ();
+
+
+drop table qci_ec_product_series_map_audit ();
+
+drop index qci_ec_product_series_map_idx2 on qci_ec_product_series_map();
+
+drop table qci_ec_product_series_map ();
+
+
+drop trigger qci_ec_sale_prices_audit_tr on qci_ec_sale_prices;
+
+drop function qci_ec_sale_prices_audit_tr ();
+
+
+drop table qci_ec_sale_prices_audit;
+
+
+drop view qci_ec_sale_prices_current;
+
+drop index qci_ec_sale_prices_by_product_idx on qci_ec_sale_prices();
+
+drop table qci_ec_sale_prices;
+
+drop view qci_ec_sale_price_id_sequence;
+drop sequence qci_ec_sale_price_id_seq;
+
+drop index qci_ec_product_purchase_comb_idx4 on qci_ec_product_purchase_comb();
+drop index qci_ec_product_purchase_comb_idx3 on qci_ec_product_purchase_comb();
+drop index qci_ec_product_purchase_comb_idx2 on qci_ec_product_purchase_comb();
+drop index qci_ec_product_purchase_comb_idx1 on qci_ec_product_purchase_comb();
+drop index qci_ec_product_purchase_comb_idx0 on qci_ec_product_purchase_comb();
+
+drop table qci_ec_product_purchase_comb ();
+
+drop trigger qci_ec_products_audit_tr on qci_ec_products;
+
+drop function qci_ec_products_audit_tr ();
+
+drop table qci_ec_products_audit ();
+
+drop view qci_ec_products_searchable;
+
+drop view qci_ec_products_displayable;
+
+drop table qci_ec_products();
+
+
+
+drop function qci_timespan_days();
+
+drop function qci_least();
+
+DROP TRIGGER qci_check_inventory ON qar_oe;
+
+
+
+DROP FUNCTION qci_check_inventory();
+
+
+DROP TABLE qci_inventory;
+
+
+DROP TABLE qci_warehouse;
+
+
+DROP TABLE qci_makemodel;
+
+
Index: openacs-4/packages/inventory-control/sql/postgresql/pl-sql-utilities-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/inventory-control/sql/postgresql/pl-sql-utilities-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/inventory-control/sql/postgresql/pl-sql-utilities-drop.sql 3 Jul 2006 19:29:14 -0000 1.1
@@ -0,0 +1,4 @@
+-- defined in the acs-core
+-- drop function logical_negation(boolean);
+drop function one_if_within_n_days (timestamptz, integer);
+drop function pseudo_contains (varchar, varchar);
Index: openacs-4/packages/inventory-control/sql/postgresql/pl-sql-utilities.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/inventory-control/sql/postgresql/pl-sql-utilities.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/inventory-control/sql/postgresql/pl-sql-utilities.sql 3 Jul 2006 19:29:14 -0000 1.1
@@ -0,0 +1,59 @@
+--
+-- pl-sql.sql
+--
+-- created by philg on 11/18/98
+--
+-- useful pl/sql utility procedures
+--
+
+-- useful for ecommerce and other situations where you want to
+-- know whether something happened within last N days (assumes query_date
+-- is in the past)
+
+create function one_if_within_n_days (timestamptz, integer)
+returns integer as '
+declare
+ query_date alias for $1;
+ n_days alias for $2;
+begin
+ if current_timestamp - query_date <= timespan_days(n_days) then
+ return 1;
+ else
+ return 0;
+ end if;
+end;' language 'plpgsql';
+
+create function pseudo_contains (varchar, varchar)
+returns integer as '
+declare
+ indexed_stuff alias for $1;
+ space_sep_list_untrimmed alias for $2;
+ space_sep_list text;
+ upper_indexed_stuff text;
+ -- if you call this var start you get hosed royally
+ first_space integer;
+ score integer;
+begin
+ space_sep_list := upper(ltrim(rtrim(space_sep_list_untrimmed)));
+ upper_indexed_stuff := upper(indexed_stuff);
+ score := 0;
+ if space_sep_list is null or indexed_stuff is null then
+ return score;
+ end if;
+ loop
+ first_space := position('' '' in space_sep_list);
+ if first_space = 0 then
+ -- one token or maybe end of list
+ if position(space_sep_list in upper_indexed_stuff) <> 0 then
+ return score+10;
+ end if;
+ return score;
+ else
+ -- first_space <> 0
+ if position(substring(space_sep_list from 1 for first_space-1) in upper_indexed_stuff) <> 0 then
+ score := score + 10;
+ end if;
+ end if;
+ space_sep_list := substring(space_sep_list from first_space+1);
+ end loop;
+end;' language 'plpgsql';
Index: openacs-4/packages/inventory-control/www/doc/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/inventory-control/www/doc/index.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/inventory-control/www/doc/index.adp 3 Jul 2006 19:29:14 -0000 1.1
@@ -0,0 +1,4 @@
+
+
+Porting from sql-ledger: IC.pm IR.pm IS.pm ic.pl io.pl ir.pl is.pl
+
Index: openacs-4/packages/shipping-tracking/shipping-tracking.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/shipping-tracking/shipping-tracking.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/shipping-tracking/shipping-tracking.info 3 Jul 2006 19:30:26 -0000 1.1
@@ -0,0 +1,32 @@
+
+
+
+
+ Ship-Track
+ Ship-Tracks
+ f
+ f
+
+
+ OpenACS community
+ Ship-Track package provides pricing estimates and tracks shipped items
+ Dekka Corp of Oregon
+ Ship-Track package provides pricing estimates (include or integrate with value-based-shipping and tracks shipped items, includes handling shipping address. (may be similar to a shipping-gateway that handles multiple shipping services (3rd party as well as in-house estimating and delivery techniques)
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/shipping-tracking/sql/postgresql/shipping-tracking-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/shipping-tracking/sql/postgresql/shipping-tracking-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/shipping-tracking/sql/postgresql/shipping-tracking-create.sql 3 Jul 2006 19:30:26 -0000 1.1
@@ -0,0 +1,124 @@
+-- shipping-tracking-create.sql
+--
+-- @author Dekka Corp.
+-- @ported from sql-ledger and combined with parts from OpenACS ecommerce package
+-- @license GNU GENERAL PUBLIC LICENSE, Version 2, June 1991
+-- @cvs-id
+--
+
+-- this is from SL, but we're moving the address into contacts package
+
+create table ecst_shipto (
+ trans_id int,
+ shiptoname varchar(64),
+ shiptoaddress1 varchar(32),
+ shiptoaddress2 varchar(32),
+ shiptocity varchar(32),
+ shiptostate varchar(32),
+ shiptozipcode varchar(10),
+ shiptocountry varchar(32),
+ shiptocontact varchar(64),
+ shiptophone varchar(20),
+ shiptofax varchar(20),
+ shiptoemail text
+);
+
+--
+create index ecst_shipto_trans_id_key on ecst_shipto (trans_id);
+
+-- we need to import the ecommerce shipping-tracking model here
+
+-- this is needed because orders might be only partially shipped
+-- create sequence ecst_shipment_id_seq;
+ create view ecst_shipment_id_sequence as select nextval('ecst_shipment_id_seq') as nextval;
+
+ create table ecst_shipments (
+ shipment_id integer not null primary key,
+ order_id integer not null references qar_ec_orders,
+ -- usually, but not necessarily, the same as the shipping_address
+ -- in ecst_orders because a customer may change their address between
+ -- shipments.
+ -- a trigger fills address_id in automatically if it's null
+ address_id integer references qal_ec_addresses,
+ shipment_date timestamptz not null,
+ expected_arrival_date timestamptz,
+ carrier varchar(50), -- e.g., 'fedex'
+ tracking_number varchar(24),
+ -- only if we get confirmation from carrier that the goods
+ -- arrived on a specific date
+ actual_arrival_date timestamptz,
+ -- arbitrary info from carrier, e.g., 'Joe Smith signed for it'
+ actual_arrival_detail varchar(4000),
+ -- for things that aren't really shipped like services
+ shippable_p boolean default 't',
+ last_modified timestamptz,
+ last_modifying_user integer,
+ modified_ip_address varchar(20)
+ );
+
+ create index ecst_shipments_by_order_id on ecst_shipments(order_id);
+ create index ecst_shipments_by_shipment_date on ecst_shipments(shipment_date);
+
+ -- fills address_id into ecst_shipments if it's missing
+ -- (using the shipping_address associated with the order)
+
+ create function ecst_shipment_address_update_tr ()
+ returns opaque as '
+ declare
+ v_address_id qal_ec_addresses.address_id%TYPE;
+ begin
+ select into v_address_id shipping_address
+ from ecst_orders where order_id=new.order_id;
+ IF new.address_id is null THEN
+ new.address_id := v_address_id;
+ END IF;
+ return new;
+ end;' language 'plpgsql';
+
+ create trigger ecst_shipment_address_update_tr
+ before insert on ecst_shipments
+ for each row execute procedure ecst_shipment_address_update_tr ();
+
+ create table ecst_shipments_audit (
+ shipment_id integer,
+ order_id integer,
+ address_id integer,
+ shipment_date timestamptz,
+ expected_arrival_date timestamptz,
+ carrier varchar(50),
+ tracking_number varchar(24),
+ actual_arrival_date timestamptz,
+ actual_arrival_detail varchar(4000),
+ last_modified timestamptz,
+ last_modifying_user integer,
+ modified_ip_address varchar(20),
+ delete_p boolean default 'f'
+ );
+
+ create function ecst_shipments_audit_tr ()
+ returns opaque as '
+ begin
+ insert into ecst_shipments_audit (
+ shipment_id, order_id, address_id,
+ shipment_date,
+ expected_arrival_date,
+ carrier, tracking_number,
+ actual_arrival_date, actual_arrival_detail,
+ last_modified,
+ last_modifying_user, modified_ip_address
+ ) values (
+ old.shipment_id, old.order_id, old.address_id,
+ old.shipment_date,
+ old.expected_arrival_date,
+ old.carrier, old.tracking_number,
+ old.actual_arrival_date, old.actual_arrival_detail,
+ old.last_modified,
+ old.last_modifying_user, old.modified_ip_address
+ );
+ return new;
+ end;' language 'plpgsql';
+
+ create trigger ecst_shipments_audit_tr
+ after update or delete on ecst_shipments
+ for each row execute procedure ecst_shipments_audit_tr ();
+
Index: openacs-4/packages/shipping-tracking/sql/postgresql/shipping-tracking-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/shipping-tracking/sql/postgresql/shipping-tracking-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/shipping-tracking/sql/postgresql/shipping-tracking-drop.sql 3 Jul 2006 19:30:26 -0000 1.1
@@ -0,0 +1,33 @@
+-- shipping-tracking-drop.sql
+--
+-- @author Dekka Corp.
+-- @ported from sql-ledger and combined with parts from OpenACS ecommerce package
+-- @license GNU GENERAL PUBLIC LICENSE, Version 2, June 1991
+-- @cvs-id
+--
+
+-- this is from SL, but we're moving the address into contacts package
+
+ drop trigger ecst_shipments_audit_tr on ecst_shipments;
+
+ drop function ecst_shipments_audit_tr ();
+
+ drop table ecst_shipments_audit ();
+
+ drop trigger ecst_shipment_address_update_tr on ecst_shipments;
+
+ drop function ecst_shipment_address_update_tr ();
+
+ drop index ecst_shipments_by_shipment_date on ecst_shipments(shipment_date);
+ drop index ecst_shipments_by_order_id on ecst_shipments(order_id);
+
+ drop table ecst_shipments ();
+
+ drop view ecst_shipment_id_sequence as select nextval('ecst_shipment_id_seq') as nextval;
+
+drop index ecst_shipto_trans_id_key on ecst_shipto (trans_id);
+
+
+drop table ecst_shipto ();
+
+
Index: openacs-4/packages/spreadsheet/spreadsheet.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/spreadsheet/spreadsheet.info,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/spreadsheet/spreadsheet.info 3 Jul 2006 19:31:28 -0000 1.1
@@ -0,0 +1,27 @@
+
+
+
+
+ Spreadsheet
+ Spreadsheets
+ f
+ f
+
+
+ Torben Brosten
+ OpenACS community
+ Spreadsheet package for collaboratively building and managing spreadsheets.
+ Dekka Corp of Oregon
+ Spreadsheet package provides users with some spreadsheet-like functionality, such as ability to perform basic queries on package tables for generating customized reports. Smallest spreadsheet can be 1 by 1.
+ 0
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/packages/spreadsheet/sql/postgresql/spreadsheet-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/spreadsheet/sql/postgresql/spreadsheet-create.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/spreadsheet/sql/postgresql/spreadsheet-create.sql 3 Jul 2006 19:31:28 -0000 1.1
@@ -0,0 +1,98 @@
+-- spreadsheet-create.sql
+--
+-- @author Dekka Corp.
+-- @license GNU GENERAL PUBLIC LICENSE, Version 2, June 1991
+-- @cvs-id
+--
+
+ CREATE TABLE qss_sheets (
+ sheet_id integer constraint qss_sheets_sheet_id_fk
+ references acs_objects(object_id)
+ on delete cascade constraint qss_sheets_sheets_id_pk primary key,
+ -- sheet_id constrained to object_id for permissions
+
+ instance_id integer,
+ -- object_id of mounted instance (context_id)
+
+ name_abbrev varchar(40),
+ -- no spaces, single word reference that can be used in urls, filenames etc
+
+ style_ref varchar(300),
+ -- might be an absolute ref to a css page, or extended to other style references
+
+ sheet_title varchar(80),
+ sheet_description text,
+ orientation varchar(2) default 'RC',
+ -- rc = row reference, column reference
+
+ row_count integer,
+ -- use value if not null
+
+ column_count integer,
+ -- use value if not null
+
+ last_calculated timestamptz,
+ -- should be the max(qss_cells.last_calculated) for a sheet_id
+
+ last_modified timestamptz,
+ -- should be the max(qss_cells.last_modified) for a sheet_id
+
+ sheet_status varchar(8)
+ -- value will likely be one of
+ -- ready values have been calculated and no active processes working
+ -- working the spreadsheet is in a recalculating process
+ -- recalc values have expired, spreadsheet needs to be recalculated
+ );
+
+ CREATE TABLE qss_cells (
+ sheet_id varchar(40) not null,
+ -- should be a value from qss_sheets.sheet_id
+
+ cell_value varchar(1025),
+ -- returned by function or user input value
+ -- cell_row = 0 is default value for other cells in same column
+
+ cell_value_sq varchar(80),
+ -- square of cell_value, used frequently in statistics
+ -- values in this column are calculated when
+ -- cell_row = 0 and cell_value is a number
+
+ cell_format varchar(80),
+ -- formatting, css style class
+ -- cell_row = 0 is default value for other cells in same column
+ -- allow some kind of odd/even row formatting change
+ -- maybe two styles separated by comma
+ -- in row 0 represents first,second alternating
+
+ cell_proc varchar(1025),
+ -- usually blank or contains a function
+ -- cell_row = 0 is default proc for other cells in same column
+ -- we are calling this a proc because theoretically
+ -- an admin could define a macro-like proc that returns
+ -- a value after executing some task, for example, retrieving
+ -- a value from a url on the net.
+ -- See ecommerce templating for a similar implementation
+
+ cell_calc_depth integer not null default '0',
+ -- this value is to be automatically generated and show this
+ -- cells order of calculation based on calculation dependencies
+ -- for example, calc_depth = max (calc_depth of all dependent cells) + 1
+
+ cell_name varchar(40),
+ -- usually blank, an alternate reference to RC format
+ -- unique to a sheet
+ -- if cell_row is 0 then this is a column_name
+
+ cell_title varchar(80),
+ -- a label when displaying cell as a single value
+ -- if cell_row is 0 then this is a column_title
+
+ cell_row integer not null,
+ cell_column integer not null,
+ last_calculated timestamptz,
+ -- handy for checking when cell value dependencies have changed
+
+ last_modified timestamptz
+ -- data entry (cell value) last changed
+
+ );
Index: openacs-4/packages/spreadsheet/sql/postgresql/spreadsheet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/spreadsheet/sql/postgresql/spreadsheet-drop.sql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/spreadsheet/sql/postgresql/spreadsheet-drop.sql 3 Jul 2006 19:31:28 -0000 1.1
@@ -0,0 +1,8 @@
+-- spreadsheet-create.sql
+--
+-- @author Dekka Corp.
+-- @license GNU GENERAL PUBLIC LICENSE, Version 2, June 1991
+-- @cvs-id
+--
+ DROP TABLE qss_cells;
+ DROP TABLE qss_sheets;