Added one Post option to Post options in Quick Entry Lines (amount without decrease...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 25 Jan 2009 16:26:31 +0000 (16:26 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 25 Jan 2009 16:26:31 +0000 (16:26 +0000)
CHANGELOG.txt
gl/manage/gl_quick_entries.php
includes/types.inc
includes/ui/ui_view.inc
sql/alter2.1.sql

index 2144b3fec9fd494784b87b8c6e3ad136cc44fd7c..cc186c7200a92c6d39000189df4e83ce7bd1933c 100644 (file)
@@ -19,6 +19,14 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+26-Jan-2009 Joe Hunt
++ Added one Post option to Post options in Quick Entry Lines (amount without decrease or increase). Minor bug fixes.
+$ /gl/manage/gl_quick_entries.php
+  /includes/types.inc
+  /includes/ui/ui_view.inc
++ Added 'inactive' field in most 'catalog' tables.
+$ /sql/alter2.1.sql
+
 24-Jan-2009 Janusz Dobrowolski
 ! Set maximum width for select to avoid broken layout in two column layout.
 $ /themes/aqua/default.css
index e797cc8cd9c9307c4b3324ca6bddaa54090b43f3..9c011f090e12ffa0629f79d317dcaddec8839f66 100644 (file)
@@ -199,7 +199,7 @@ if ($selected_id != -1)
 
                $_POST['id']  = $myrow["id"];
                $_POST['description']  = $myrow["description"];
-               $_POST['deposit']  = $myrow["type"];
+               $_POST['type']  = $myrow["type"];
                $_POST['base_desc']  = $myrow["base_desc"];
                $_POST['base_amount']  = price_format($myrow["base_amount"]);
                hidden('selected_id', $selected_id);
@@ -245,15 +245,17 @@ if ($selected_id != -1)
 
                $act_type = strtolower(substr($myrow['action'], 0, 1));
 
-               if ($act_type == 't') {
+               if ($act_type == 't') 
+               {
                        label_cells($myrow['tax_name'], '');
-               } else {
+               } 
+               else 
+               {
                        label_cell($myrow['dest_id'].' '.$myrow['account_name']);
                        if ($act_type == '=') 
                                label_cell('');
-                       else
-                       if ($act_type == '%') 
-                               percent_cell($myrow['amount']);
+                       elseif ($act_type == '%') 
+                               label_cell(number_format2($myrow['amount'], user_exrate_dec()), "nowrap align=right ");
                        else
                                amount_cell($myrow['amount']);
                }               
@@ -298,13 +300,17 @@ if ($selected_id != -1)
 
        $actn = strtolower(substr($_POST['actn'],0,1));
 
-       if ($actn == 't') {
+       if ($actn == 't') 
+       {
                item_tax_types_list_row(_("Item Tax Type").":",'dest_id', null);
-       } else {
+       } 
+       else 
+       {
                gl_all_accounts_list_row(_("Account").":", 'dest_id', null);
-               if ($actn != '=') {
-                       if ($actn = '%') 
-                               percent_row(_("Part").":", 'amount', percent_format(0));
+               if ($actn != '=') 
+               {
+                       if ($actn == '%') 
+                               small_amount_row(_("Part").":", 'amount', price_format(0), null, "%", user_exrate_dec());
                        else
                                amount_row(_("Amount").":", 'amount', price_format(0));
                }
index 68696cd6e74e11d5eb823219d94d271752efb370..8162736e29544aa4338b8124fedb2bafcaf5fc8a 100644 (file)
@@ -302,8 +302,9 @@ class wo_types
 
 $quick_actions = array(
        '=' => _('Remainder'), // post current base amount to GL account
-       '-' => _('Amount, reduce base'), // post amount to GL account and reduce base
-       '+' => _('Amount, increase base'), // post amount to GL account and increase base
+       'a' => _('Amount'), // post amount to GL account
+       'a+' => _('Amount, increase base'), // post amount to GL account and increase base
+       'a-' => _('Amount, reduce base'), // post amount to GL account and reduce base
        '%' => _('% amount of base'),   // store acc*amount% to GL account
        '%+' => _('% amount of base, increase base'),   // ditto & increase base amount
        '%-' => _('% amount of base, reduce base'),     // ditto & reduce base amount
index 0de82dfed682fa1788392f0372626c8b31e4fb65..b72717861784aae2804803f60c441bd4b7d9395b 100644 (file)
@@ -576,12 +576,15 @@ function display_quick_entries(&$cart, $id, $base, $type, $descr='')
                                case "=": // post current base amount to GL account
                                        $part = $base;
                                        break;
-                               case "-": // post amount to GL account and reduce base
-                                       $part = $qe_line['amount']; $base -= $part;
+                               case "a": // post amount to GL account and reduce base
+                                       $part = $qe_line['amount'];
                                        break;
-                               case "+": // post amount to GL account and increase base
+                               case "a+": // post amount to GL account and increase base
                                        $part = $qe_line['amount']; $base += $part;
                                        break;
+                               case "a-": // post amount to GL account and reduce base
+                                       $part = $qe_line['amount']; $base -= $part;
+                                       break;
                                case "%":       // store acc*amount% to GL account
                                        $part = round2($base * $qe_line['amount'] / 100, user_price_dec());
                                        break;
@@ -600,10 +603,10 @@ function display_quick_entries(&$cart, $id, $base, $type, $descr='')
                                        $tax_total = 0;
                                        foreach ($taxes as $index => $item_tax) {
                                                if(substr($qe_line['action'],0,1) != 'T')
-                                                       $tax = round($base * $item_tax['rate'] 
+                                                       $tax = round2($base * $item_tax['rate'] 
                                                                / ($item_tax['rate'] + 100),  user_price_dec());
                                                else
-                                                       $tax = round($base * $item_tax['rate'] / 100,  user_price_dec());
+                                                       $tax = round2($base * $item_tax['rate'] / 100,  user_price_dec());
 
                                                $gl_code = $type != QE_DEPOSIT 
                                                        ? $item_tax['purchasing_gl_code'] : $item_tax['sales_gl_code'];
@@ -612,7 +615,8 @@ function display_quick_entries(&$cart, $id, $base, $type, $descr='')
                                                        $cart->add_gl_item($gl_code, 
                                                                $qe_line['dimension_id'], $qe_line['dimension2_id'], 
                                                                $tax, $qe['description']);
-                                               else {
+                                               else 
+                                               {
                                                        $acc_name = get_gl_account_name($gl_code);
                                                        $cart->add_gl_codes_to_trans($gl_code, 
                                                                $acc_name, $qe_line['dimension_id'], 
@@ -628,11 +632,12 @@ function display_quick_entries(&$cart, $id, $base, $type, $descr='')
                        if ($type != QE_SUPPINV)
                                $cart->add_gl_item($qe_line['dest_id'], $qe_line['dimension_id'],
                                        $qe_line['dimension2_id'], $part, $qe['description']);
-                       else {
-                                       $acc_name = get_gl_account_name($qe_line['dest_id']);
-                                       $cart->add_gl_codes_to_trans($qe_line['dest_id'], 
-                                               $acc_name, $qe_line['dimension_id'], 
-                                               $qe_line['dimension2_id'], $part, $qe['description']);
+                       else 
+                       {
+                               $acc_name = get_gl_account_name($qe_line['dest_id']);
+                               $cart->add_gl_codes_to_trans($qe_line['dest_id'], 
+                                       $acc_name, $qe_line['dimension_id'], 
+                                       $qe_line['dimension2_id'], $part, $qe['description']);
                        }
                }
        }       
index 8e5b45f1fb03a181f2ce09b6f5e8ed267a543cee..20ddffc826522e6bfb1a09b36fca2bee73bf8dfc 100644 (file)
@@ -32,13 +32,14 @@ DROP TABLE IF EXISTS `0_groups`;
 CREATE TABLE `0_groups` (
   `id` smallint(6) UNSIGNED NOT NULL auto_increment,
   `description` varchar(60) NOT NULL default '',
+  `inactive` tinyint(1) NOT NULL default 0,
   PRIMARY KEY  (`id`),
   UNIQUE KEY `description` (`description`)
 ) TYPE=MyISAM AUTO_INCREMENT=1 ;
 
-INSERT INTO `0_groups` VALUES ('1', 'Small');
-INSERT INTO `0_groups` VALUES ('2', 'Medium');
-INSERT INTO `0_groups` VALUES ('3', 'Large');
+INSERT INTO `0_groups` VALUES ('1', 'Small', '0');
+INSERT INTO `0_groups` VALUES ('2', 'Medium', '0');
+INSERT INTO `0_groups` VALUES ('3', 'Large', '0');
 
 DROP TABLE IF EXISTS `0_recurrent_invoices`;
 
@@ -91,11 +92,12 @@ CREATE TABLE `0_sales_pos` (
   `credit_sale` tinyint(1) NOT NULL,
   `pos_location` varchar(5) NOT NULL,
   `pos_account` smallint(6) UNSIGNED NOT NULL,
+  `inactive` tinyint(1) NOT NULL default 0,
   PRIMARY KEY  (`id`),
   UNIQUE KEY(`pos_name`)
 ) TYPE=MyISAM AUTO_INCREMENT=1;
 
-INSERT INTO `0_sales_pos` VALUES ('1', 'Default', '1', '1', 'DEF', '1');
+INSERT INTO `0_sales_pos` VALUES ('1', 'Default', '1', '1', 'DEF', '1', '0');
 
 ALTER TABLE `0_users` DROP COLUMN `pos`;
 ALTER TABLE `0_users` ADD `pos` SMALLINT(6) DEFAULT '1';
@@ -187,6 +189,7 @@ CREATE TABLE `0_item_codes` (
   `category_id` smallint(6) UNSIGNED NOT NULL,
   `quantity` double NOT NULL default '1',
   `is_foreign` tinyint(1) NOT NULL default 0,
+  `inactive` tinyint(1) NOT NULL default 0,
   PRIMARY KEY  (`id`),
   UNIQUE KEY(`stock_id`, `item_code`)
 ) TYPE=MyISAM AUTO_INCREMENT=1;
@@ -239,3 +242,49 @@ CREATE TABLE IF NOT EXISTS `0_sql_trail` (
   PRIMARY KEY (`id`)
 ) TYPE = MyISAM;
 
+ALTER TABLE `0_tax_types` DROP COLUMN `out`;
+
+ALTER TABLE `0_chart_master` DROP COLUMN `inactive`;
+ALTER TABLE `0_chart_master` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_currencies` DROP COLUMN `inactive`;
+ALTER TABLE `0_currencies` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_bank_accounts` DROP COLUMN `inactive`;
+ALTER TABLE `0_bank_accounts` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_stock_master` DROP COLUMN `inactive`;
+ALTER TABLE `0_stock_master` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_workcentres` DROP COLUMN `inactive`;
+ALTER TABLE `0_workcentres` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_locations` DROP COLUMN `inactive`;
+ALTER TABLE `0_locations` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_sales_types` DROP COLUMN `inactive`;
+ALTER TABLE `0_sales_types` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_areas` DROP COLUMN `inactive`;
+ALTER TABLE `0_areas` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_salesman` DROP COLUMN `inactive`;
+ALTER TABLE `0_salesman` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_shippers` DROP COLUMN `inactive`;
+ALTER TABLE `0_shippers` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_credit_status` DROP COLUMN `inactive`;
+ALTER TABLE `0_credit_status` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_payment_terms` DROP COLUMN `inactive`;
+ALTER TABLE `0_payment_terms` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_suppliers` DROP COLUMN `inactive`;
+ALTER TABLE `0_suppliers` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_stock_category` DROP COLUMN `inactive`;
+ALTER TABLE `0_stock_category` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';
+
+ALTER TABLE `0_item_units` DROP COLUMN `inactive`;
+ALTER TABLE `0_item_units` ADD `inactive` tinyint(1) NOT NULL DEFAULT '0';