From 231addc23887aa8b906dca18ea0b2a6fe63c3c39 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sun, 3 May 2009 13:58:07 +0000 Subject: [PATCH] Added audit trail. --- gl/includes/db/gl_db_banking.inc | 2 ++ gl/includes/db/gl_db_trans.inc | 4 ++- includes/main.inc | 1 + inventory/includes/db/items_adjust_db.inc | 1 + inventory/includes/db/items_trans_db.inc | 15 ++++---- inventory/includes/db/items_transfer_db.inc | 1 + .../includes/db/work_order_issues_db.inc | 1 + .../db/work_order_produce_items_db.inc | 1 + manufacturing/includes/db/work_orders_db.inc | 4 +++ .../includes/db/work_orders_quick_db.inc | 2 +- purchasing/includes/db/grn_db.inc | 2 ++ purchasing/includes/db/po_db.inc | 1 + purchasing/includes/db/supp_trans_db.inc | 1 + sales/includes/db/cust_trans_db.inc | 8 +++-- sales/includes/db/sales_order_db.inc | 3 ++ sql/alter2.2.php | 17 +++++++-- sql/alter2.2.sql | 27 ++++++++++++-- sql/en_US-demo.sql | 35 +++++++++++++++---- sql/en_US-new.sql | 34 ++++++++++++++---- 19 files changed, 132 insertions(+), 28 deletions(-) diff --git a/gl/includes/db/gl_db_banking.inc b/gl/includes/db/gl_db_banking.inc index 903b22b5..981de46e 100644 --- a/gl/includes/db/gl_db_banking.inc +++ b/gl/includes/db/gl_db_banking.inc @@ -99,6 +99,7 @@ function add_bank_transfer($from_account, $to_account, $date_, add_comments($trans_type, $trans_no, $date_, $memo_); references::save_last($ref, $trans_type); + add_audit_trail($trans_type, $trans_no, $date_); commit_transaction(); @@ -218,6 +219,7 @@ function add_bank_transaction($trans_type, $from_account, $items, $date_, add_comments($trans_type, $trans_no, $date_, $memo_); references::save_last($ref, $trans_type); + add_audit_trail($trans_type, $trans_no, $date_); commit_transaction(); diff --git a/gl/includes/db/gl_db_trans.inc b/gl/includes/db/gl_db_trans.inc index 89eaa252..eb9cf02f 100644 --- a/gl/includes/db/gl_db_trans.inc +++ b/gl/includes/db/gl_db_trans.inc @@ -338,6 +338,7 @@ function add_journal_entries($items, $date_, $ref, $reverse, $memo_=null) add_comments($trans_type, $trans_id, $date_, $memo_); references::save($trans_type, $trans_id, $ref); + add_audit_trail($trans_type, $trans_id, $date_); if ($reverse) { @@ -364,12 +365,13 @@ function add_journal_entries($items, $date_, $ref, $reverse, $memo_=null) } // store tax details if the gl account is a tax account add_gl_tax_details($journal_item->code_id, - $trans_type, $trans_id, $journal_item->amount, 1, $date, $memo_); + $trans_type, $trans_id, $journal_item->amount, 1, $reversingDate, $memo_); } add_comments($trans_type, $trans_id_reverse, $reversingDate, $memo_); references::save($trans_type, $trans_id_reverse, $ref); + add_audit_trail($trans_type, $trans_id_reverse, $reversingDate); } commit_transaction(); diff --git a/includes/main.inc b/includes/main.inc index 5d4371ba..4687f707 100644 --- a/includes/main.inc +++ b/includes/main.inc @@ -19,6 +19,7 @@ include_once($path_to_root . "/includes/references.inc"); include_once($path_to_root . "/includes/prefs/sysprefs.inc"); include_once($path_to_root . "/includes/db/comments_db.inc"); include_once($path_to_root . "/includes/db/sql_functions.inc"); +include_once($path_to_root . "/includes/db/audit_trail_db.inc"); include_once($path_to_root . "/admin/db/users_db.inc"); include_once($path_to_root . "/includes/ui/ui_view.inc"); diff --git a/inventory/includes/db/items_adjust_db.inc b/inventory/includes/db/items_adjust_db.inc index 57f74bb5..61d130d5 100644 --- a/inventory/includes/db/items_adjust_db.inc +++ b/inventory/includes/db/items_adjust_db.inc @@ -30,6 +30,7 @@ function add_stock_adjustment($items, $location, $date_, $type, $increase, $refe add_comments(systypes::inventory_adjustment(), $adj_id, $date_, $memo_); references::save_last($reference, systypes::inventory_adjustment()); + add_audit_trail(systypes::inventory_adjustment(), $adj_id, $date_); commit_transaction(); diff --git a/inventory/includes/db/items_trans_db.inc b/inventory/includes/db/items_trans_db.inc index 9a16d7b3..eb044cd7 100644 --- a/inventory/includes/db/items_trans_db.inc +++ b/inventory/includes/db/items_trans_db.inc @@ -43,22 +43,23 @@ function stock_cost_update($stock_id, $material_cost, $labour_cost, $overhead_co $date_ = end_fiscalyear(); $stock_gl_code = get_stock_gl_code($stock_id); - + $new_cost = $material_cost + $labour_cost + $overhead_cost; - + $value_of_change = $qoh * ($new_cost - $last_cost); - + $memo_ = "Cost was " . $last_cost . " changed to " . $new_cost . " x quantity on hand of $qoh"; add_gl_trans_std_cost(systypes::cost_update(), $update_no, $date_, $stock_gl_code["adjustment_account"], $stock_gl_code["dimension_id"], $stock_gl_code["dimension2_id"], $memo_, (-$value_of_change)); add_gl_trans_std_cost(systypes::cost_update(), $update_no, $date_, $stock_gl_code["inventory_account"], 0, 0, $memo_, - $value_of_change); - } + $value_of_change); + } + add_audit_trail(systypes::cost_update(), $update_no, $date_); commit_transaction(); - - return $update_no; + + return $update_no; } //------------------------------------------------------------------------------------------------------------- diff --git a/inventory/includes/db/items_transfer_db.inc b/inventory/includes/db/items_transfer_db.inc index dc587e3d..c1eac28b 100644 --- a/inventory/includes/db/items_transfer_db.inc +++ b/inventory/includes/db/items_transfer_db.inc @@ -26,6 +26,7 @@ function add_stock_transfer($Items, $location_from, $location_to, $date_, $type, add_comments(systypes::location_transfer(), $transfer_id, $date_, $memo_); references::save_last($reference, systypes::location_transfer()); + add_audit_trail(systypes::location_transfer(), $transfer_id, $date_); commit_transaction(); diff --git a/manufacturing/includes/db/work_order_issues_db.inc b/manufacturing/includes/db/work_order_issues_db.inc index 0df06846..a8fc6b1c 100644 --- a/manufacturing/includes/db/work_order_issues_db.inc +++ b/manufacturing/includes/db/work_order_issues_db.inc @@ -59,6 +59,7 @@ function add_work_order_issue($woid, $ref, $to_work_order, $items, $location, $w add_comments(28, $number, $date_, $memo_); references::save_last($ref, 28); + add_audit_trail(28, $number, $date_); commit_transaction(); } diff --git a/manufacturing/includes/db/work_order_produce_items_db.inc b/manufacturing/includes/db/work_order_produce_items_db.inc index 5b2dad2d..4419e7e2 100644 --- a/manufacturing/includes/db/work_order_produce_items_db.inc +++ b/manufacturing/includes/db/work_order_produce_items_db.inc @@ -54,6 +54,7 @@ function work_order_produce($woid, $ref, $quantity, $date_, $memo_, $close_wo) add_comments(29, $id, $date_, $memo_); references::save_last($ref, 29); + add_audit_trail(29, $id, $date_, _("Production.")); commit_transaction(); } diff --git a/manufacturing/includes/db/work_orders_db.inc b/manufacturing/includes/db/work_orders_db.inc index 5df4082b..1c17ea86 100644 --- a/manufacturing/includes/db/work_orders_db.inc +++ b/manufacturing/includes/db/work_orders_db.inc @@ -60,6 +60,7 @@ function add_work_order($wo_ref, $loc_code, $units_reqd, $stock_id, add_comments(systypes::work_order(), $woid, $required_by, $memo_); references::save_last($wo_ref, systypes::work_order()); + add_audit_trail(systypes::work_order(), $woid, $date_); commit_transaction(); @@ -88,6 +89,7 @@ function update_work_order($woid, $loc_code, $units_reqd, $stock_id, db_query($sql, "could not update work order"); update_comments(systypes::work_order(), $woid, null, $memo_); + add_audit_trail(systypes::work_order(), $woid, $date_, _("Updated.")); commit_transaction(); } @@ -106,6 +108,7 @@ function delete_work_order($woid) db_query($sql,"The work order could not be deleted"); delete_comments(systypes::work_order(), $woid); + add_audit_trail(systypes::work_order(), $woid, $_POST['date_'], _("Canceled.")); commit_transaction(); } @@ -181,6 +184,7 @@ function release_work_order($woid, $releaseDate, $memo_) create_wo_requirements($woid, $stock_id); add_comments(systypes::work_order(), $woid, $releaseDate, $memo_); + add_audit_trail(systypes::work_order(), $woid, $releaseDate,_("Released.")); commit_transaction(); } diff --git a/manufacturing/includes/db/work_orders_quick_db.inc b/manufacturing/includes/db/work_orders_quick_db.inc index a2b3c124..8595b210 100644 --- a/manufacturing/includes/db/work_orders_quick_db.inc +++ b/manufacturing/includes/db/work_orders_quick_db.inc @@ -73,7 +73,7 @@ function add_work_order_quick($wo_ref, $loc_code, $units_reqd, $stock_id, $type, add_comments(systypes::work_order(), $woid, $date_, $memo_); references::save_last($wo_ref, systypes::work_order()); - + add_audit_trail(systypes::work_order(), $woid, $date_,_("Quick production.")); commit_transaction(); return $woid; } diff --git a/purchasing/includes/db/grn_db.inc b/purchasing/includes/db/grn_db.inc index c0fdf54a..df526f14 100644 --- a/purchasing/includes/db/grn_db.inc +++ b/purchasing/includes/db/grn_db.inc @@ -97,6 +97,8 @@ function add_grn(&$po, $date_, $reference, $location) references::save_last($reference, 25); + add_audit_trail(25, $grn, $date_); + commit_transaction(); return $grn; diff --git a/purchasing/includes/db/po_db.inc b/purchasing/includes/db/po_db.inc index d3135f56..350b8280 100644 --- a/purchasing/includes/db/po_db.inc +++ b/purchasing/includes/db/po_db.inc @@ -60,6 +60,7 @@ function add_po(&$po_obj) //add_comments(systypes::po(), $po_obj->order_no, $po_obj->orig_order_date, $po_obj->Comments); + add_audit_trail(systypes::po(), systypes::po(), $po_obj->orig_order_date); commit_transaction(); return $po_obj->order_no; diff --git a/purchasing/includes/db/supp_trans_db.inc b/purchasing/includes/db/supp_trans_db.inc index 207cd7dc..52071cc6 100644 --- a/purchasing/includes/db/supp_trans_db.inc +++ b/purchasing/includes/db/supp_trans_db.inc @@ -37,6 +37,7 @@ function add_supp_trans($type, $supplier_id, $date_, $due_date, $reference, $sup $err_msg = "Cannot insert a supplier transaction record"; db_query($sql, $err_msg); + add_audit_trail($type, $trans_no, $date_); return $trans_no; } diff --git a/sales/includes/db/cust_trans_db.inc b/sales/includes/db/cust_trans_db.inc index 7beb733c..fb98b62f 100644 --- a/sales/includes/db/cust_trans_db.inc +++ b/sales/includes/db/cust_trans_db.inc @@ -91,18 +91,18 @@ function write_customer_trans($trans_type, $trans_no, $debtor_no, $BranchNo, $sales_type=0, $order_no=0, $trans_link=0, $ship_via=0, $due_date="", $AllocAmt=0, $rate=0, $dimension_id=0, $dimension2_id=0) { - + $new = $trans_no==0; $curr = get_customer_currency($debtor_no); if ($rate == 0) $rate = get_exchange_rate_from_home_currency($curr, $date_); $SQLDate = date2sql($date_); if ($due_date == "") - $SQLDueDate = "000-00-00"; + $SQLDueDate = "0000-00-00"; else $SQLDueDate = date2sql($due_date); - if ($trans_no==0) { + if ($new) { $trans_no = get_next_trans_no($trans_type); $sql = "INSERT INTO ".TB_PREF."debtor_trans ( @@ -134,6 +134,8 @@ function write_customer_trans($trans_type, $trans_no, $debtor_no, $BranchNo, } db_query($sql, "The debtor transaction record could not be inserted"); + add_audit_trail($trans_type, $trans_no, $date_, $new ? '': _("Updated.")); + return $trans_no; } diff --git a/sales/includes/db/sales_order_db.inc b/sales/includes/db/sales_order_db.inc index ef66b0b7..03b18e02 100644 --- a/sales/includes/db/sales_order_db.inc +++ b/sales/includes/db/sales_order_db.inc @@ -128,6 +128,7 @@ function add_sales_order(&$order) } /* inserted line items into sales order details */ + add_audit_trail(30, $order_no, $order->document_date); commit_transaction(); if ($loc_notification == 1 && count($st_ids) > 0) @@ -163,6 +164,7 @@ function delete_sales_order($order_no) $sql = "DELETE FROM ".TB_PREF."sales_order_details WHERE order_no =" . $order_no; db_query($sql, "order Detail Delete"); + add_audit_trail(30, $order_no, Today(), _("Deleted.")); commit_transaction(); } @@ -268,6 +270,7 @@ function update_sales_order($order) } /* inserted line items into sales order details */ + add_audit_trail(30, $order_no, $order->document_date, _("Updated.")); commit_transaction(); if ($loc_notification == 1 && count($st_ids) > 0) { diff --git a/sql/alter2.2.php b/sql/alter2.2.php index c839df17..72a26840 100644 --- a/sql/alter2.2.php +++ b/sql/alter2.2.php @@ -28,8 +28,20 @@ class fa2_2 { ."dflt_inventory_act = '" . $prefs['default_inventory_act'] . "'," ."dflt_adjustment_act = '" . $prefs['default_adj_act'] . "'," ."dflt_assembly_act = '" . $prefs['default_assembly_act']."'"; - $ret = db_query($sql, "Cannot update category default GL accounts"); - return $ret; + if (db_query($sql)==false) { + display_error("Cannot update category default GL accounts" + .':
'. db_error_msg($db)); + return false; + } +/* FIX + // add audit_trail data for all transactions + $datatbl = array ("gl_trans", "purch_orders", "sales_orders", + "workorders"); + $sql = "INSERT INTO ".$pref."audit_trail" + ." (type, trans_no, user, fiscal_year, gl_date) VALUES (" + . "$type,$trans_no,$user,$year,$date)"; +*/ + return true; } // // Checking before install @@ -45,6 +57,7 @@ class fa2_2 { if (check_table($pref, 'company', 'default_delivery_required')) return false; if (check_table($pref, 'stock_category', 'dflt_dim2')) return false; if (check_table($pref, 'users', 'sticky_doc_date')) return false; + if (check_table($pref, 'audit_trail')) return false; return true; } }; diff --git a/sql/alter2.2.sql b/sql/alter2.2.sql index 5904d82b..b70e3a08 100644 --- a/sql/alter2.2.sql +++ b/sql/alter2.2.sql @@ -7,9 +7,10 @@ ALTER TABLE `0_company` DROP COLUMN `custom3_value`; ALTER TABLE `0_company` ADD COLUMN `default_delivery_required` SMALLINT(6) NULL DEFAULT '1'; ALTER TABLE `0_company` ADD COLUMN `version_id` VARCHAR(11) NOT NULL DEFAULT ''; -ALTER TABLE `0_company` CHANGE `purch_exchange_diff_act` `profit_loss_year_act` VARCHAR(11) NOT NULL DEFAULT ''; +ALTER TABLE `0_company` DROP COLUMN `purch_exchange_diff_act`; +ALTER TABLE `0_company` ADD COLUMN`profit_loss_year_act` VARCHAR(11) NOT NULL DEFAULT '' AFTER `exchange_diff_act`; ALTER TABLE `0_company` ADD COLUMN `time_zone` TINYINT(1) NOT NULL DEFAULT '0'; -INSERT INTO `0_chart_master` VALUES ('8900', '', 'Profit and Loss this year', '52', '0'); +#INSERT INTO `0_chart_master` VALUES ('8900', '', 'Profit and Loss this year', '52', '0'); UPDATE `0_company` SET `profit_loss_year_act`='8900', `version_id`='2.2' WHERE `coy_code`=1; ALTER TABLE `0_stock_category` DROP COLUMN `stock_act`; @@ -43,3 +44,25 @@ ALTER TABLE `0_item_tax_types` ADD COLUMN `inactive` tinyint(1) NOT NULL default ALTER TABLE `0_tax_types` ADD COLUMN `inactive` tinyint(1) NOT NULL default '0'; ALTER TABLE `0_tax_groups` ADD COLUMN `inactive` tinyint(1) NOT NULL default '0'; ALTER TABLE `0_tax_group_items` DROP COLUMN `included_in_price`; + +ALTER TABLE `0_users` DROP PRIMARY KEY; +ALTER TABLE `0_users` ADD `id` SMALLINT(6) AUTO_INCREMENT PRIMARY KEY FIRST; +ALTER TABLE `0_users` ADD UNIQUE KEY (`user_id`); +ALTER TABLE `0_users` ADD COLUMN `inactive` tinyint(1) NOT NULL default '0'; + +DROP TABLE IF EXISTS `0_audit_trail`; +# fiscal_year, gl_date, gl_seq - journal sequence data +CREATE TABLE `0_audit_trail` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `type` smallint(6) unsigned NOT NULL default '0', + `trans_no` int(11) unsigned NOT NULL default '0', + `user` smallint(6) unsigned NOT NULL default '0', + `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP, + `description` varchar(60) default NULL, + `fiscal_year` int(11) NOT NULL, + `gl_date` date NOT NULL default '0000-00-00', + `gl_seq` int(11) unsigned default NULL, + PRIMARY KEY (`id`), + KEY (`fiscal_year`, `gl_seq`) +) TYPE=InnoDB ; + diff --git a/sql/en_US-demo.sql b/sql/en_US-demo.sql index 538f1dfd..60650bd3 100644 --- a/sql/en_US-demo.sql +++ b/sql/en_US-demo.sql @@ -50,6 +50,28 @@ CREATE TABLE `0_attachments` ( ### Data of table `0_attachments` ### +### Structure of table `0_audit_trail` ### + +DROP TABLE IF EXISTS `0_audit_trail`; + +CREATE TABLE `0_audit_trail` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `type` smallint(6) unsigned NOT NULL default '0', + `trans_no` int(11) unsigned NOT NULL default '0', + `user` smallint(6) unsigned NOT NULL default '0', + `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP, + `description` varchar(60) default NULL, + `fiscal_year` int(11) NOT NULL, + `gl_date` date NOT NULL default '0000-00-00', + `gl_seq` int(11) unsigned default NULL, + PRIMARY KEY (`id`), + KEY (`fiscal_year`, `gl_seq`) +) TYPE=InnoDB ; + +### Data of table `0_audit_trail` ### + + + ### Structure of table `0_bank_accounts` ### @@ -2245,12 +2267,12 @@ INSERT INTO `0_trans_tax_details` VALUES ('57', '1', '8', '2009-01-29', '3', '25 INSERT INTO `0_trans_tax_details` VALUES ('58', '20', '13', '2009-01-29', '3', '25', '1', '0', '40', '10', 'gg'); INSERT INTO `0_trans_tax_details` VALUES ('59', '2', '6', '2009-01-29', '3', '25', '1', '0', '40', '10', ''); - ### Structure of table `0_users` ### DROP TABLE IF EXISTS `0_users`; CREATE TABLE `0_users` ( + `id` SMALLINT(6) AUTO_INCREMENT, `user_id` varchar(60) NOT NULL default '', `password` varchar(100) NOT NULL default '', `real_name` varchar(100) NOT NULL default '', @@ -2278,15 +2300,16 @@ CREATE TABLE `0_users` ( `print_profile` varchar(30) NOT NULL default '1', `rep_popup` tinyint(1) default '1', `sticky_doc_date` tinyint(1) default '0', - PRIMARY KEY (`user_id`) -) TYPE=MyISAM ; + `inactive` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY (`user_id`) +) TYPE=MyISAM AUTO_INCREMENT=2; ### Data of table `0_users` ### -INSERT INTO `0_users` VALUES ('demouser', '5f4dcc3b5aa765d61d8327deb882cf99', 'Demo User', '1', '999-999-999', 'demo@demo.nu', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '3', '1', '1', '0', '0', '2008-02-06 19:02:35', '10', '1', '1', '1', '1', '0'); -INSERT INTO `0_users` VALUES ('admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', '2', '', 'adm@adm.com', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '4', '1', '1', '0', '0', '2009-01-30 09:39:03', '10', '1', '1', '', '1', '0'); - +INSERT INTO `0_users` VALUES ('1', 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', '2', '', 'adm@adm.com', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '4', '1', '1', '0', '0', '2009-01-30 09:39:03', '10', '1', '1', '1', '1', '0', '0'); +INSERT INTO `0_users` VALUES ('2', 'demouser', '5f4dcc3b5aa765d61d8327deb882cf99', 'Demo User', '1', '999-999-999', 'demo@demo.nu', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '3', '1', '1', '0', '0', '2008-02-06 19:02:35', '10', '1', '1', '1', '1', '0', '0'); ### Structure of table `0_voided` ### diff --git a/sql/en_US-new.sql b/sql/en_US-new.sql index a9681851..76658b74 100644 --- a/sql/en_US-new.sql +++ b/sql/en_US-new.sql @@ -24,7 +24,6 @@ CREATE TABLE `0_areas` ( INSERT INTO `0_areas` VALUES ('1', 'USA', '0'); - ### Structure of table `0_attachments` ### DROP TABLE IF EXISTS `0_attachments`; @@ -46,6 +45,26 @@ CREATE TABLE `0_attachments` ( ### Data of table `0_attachments` ### +### Structure of table `0_audit_trail` ### + +DROP TABLE IF EXISTS `0_audit_trail`; + +CREATE TABLE `0_audit_trail` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `type` smallint(6) unsigned NOT NULL default '0', + `trans_no` int(11) unsigned NOT NULL default '0', + `user` smallint(6) unsigned NOT NULL default '0', + `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP, + `description` varchar(60) default NULL, + `fiscal_year` int(11) NOT NULL, + `gl_date` date NOT NULL default '0000-00-00', + `gl_seq` int(11) unsigned default NULL, + PRIMARY KEY (`id`), + KEY (`fiscal_year`, `gl_seq`) +) TYPE=InnoDB ; + +### Data of table `0_audit_trail` ### + ### Structure of table `0_bank_accounts` ### @@ -347,7 +366,7 @@ CREATE TABLE `0_company` ( ### Data of table `0_company` ### -INSERT INTO `0_company` VALUES ('1', 'Company name', '', '', '1', '1', 'N/A', '', '', '', '', '', 'USD', '1500', '4250', '2630', '1430', '4260', '4220', '2050', '3800', '3000', '3000', '3200', '1420', '4010', '4210', '3000', '1410', '5000', '0', '10', '10', '1000', '20', '20', '30', '1', '1', '0', '0', '0', '-1', '0', '0', '', '1'. '2.2', '0'); +INSERT INTO `0_company` VALUES ('1', 'Company name', '', '', '1', '1', 'N/A', '', '', '', '', '', 'USD', '1500', '4250', '2630', '1430', '4260', '4220', '2050', '3800', '3000', '3000', '3200', '1420', '4010', '4210', '3000', '1410', '5000', '0', '10', '10', '1000', '20', '20', '30', '1', '1', '0', '0', '0', '-1', '0', '0', '', '1', '2.2', '0'); ### Structure of table `0_credit_status` ### @@ -1518,7 +1537,7 @@ CREATE TABLE `0_trans_tax_details` ( `amount` double NOT NULL default '0', `memo` tinytext, PRIMARY KEY (`id`) -) TYPE=InnoDB AUTO_INCREMENT=1 ; +) TYPE=InnoDB AUTO_INCREMENT=1 ; ### Data of table `0_trans_tax_details` ### @@ -1530,6 +1549,7 @@ CREATE TABLE `0_trans_tax_details` ( DROP TABLE IF EXISTS `0_users`; CREATE TABLE `0_users` ( + `id` SMALLINT(6) AUTO_INCREMENT, `user_id` varchar(60) NOT NULL default '', `password` varchar(100) NOT NULL default '', `real_name` varchar(100) NOT NULL default '', @@ -1557,13 +1577,15 @@ CREATE TABLE `0_users` ( `print_profile` varchar(30) NOT NULL default '1', `rep_popup` tinyint(1) default '1', `sticky_doc_date` tinyint(1) default '0', - PRIMARY KEY (`user_id`) -) TYPE=MyISAM ; + `inactive` tinyint(1) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY (`user_id`) +) TYPE=MyISAM AUTO_INCREMENT=2; ### Data of table `0_users` ### -INSERT INTO `0_users` VALUES ('admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', '2', '', 'adm@adm.com', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '4', '1', '1', '0', '0', '2008-04-04 12:34:29', '10', '1', '1', '1', '1', '0'); +INSERT INTO `0_users` VALUES ('1', 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Administrator', '2', '', 'adm@adm.com', 'en_US', '0', '0', '0', '0', 'default', 'Letter', '2', '2', '4', '1', '1', '0', '0', '2008-04-04 12:34:29', '10', '1', '1', '1', '1', '0', '0'); ### Structure of table `0_voided` ### -- 2.30.2