Added dimension entries in delivery and invoice forms
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 12 Nov 2008 16:32:05 +0000 (16:32 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 12 Nov 2008 16:32:05 +0000 (16:32 +0000)
14 files changed:
CHANGELOG.txt
includes/ui/ui_lists.inc
sales/credit_note_entry.php
sales/includes/cart_class.inc
sales/includes/db/cust_trans_db.inc
sales/includes/db/sales_credit_db.inc
sales/includes/db/sales_delivery_db.inc
sales/includes/db/sales_invoice_db.inc
sales/includes/db/sales_order_db.inc
sales/includes/sales_db.inc
sales/includes/ui/sales_credit_ui.inc
sales/includes/ui/sales_order_ui.inc
sales/sales_order_entry.php
sql/alter2.1.sql

index fc8fe31410a0cd07c09cb7b0143f2ed1df805d20..97c7f3bb3c424c24c727b55995d8d46b54f3c15d 100644 (file)
@@ -19,6 +19,22 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+12-Nov-2008 Joe Hunt
+! Added dimension entries in delivery and invoice forms
+$ /includes/ui/ui_lists.inc
+  /sales/credit_note_entry.php
+  /sales/includes/cart_class.inc
+  /sales/includes/db/cust_trans_db.inc
+  /sales/includes/db/sales_credit_db.inc
+  /sales/includes/db/sales_delivery_db.inc
+  /sales/includes/db/sales_invoice_db.inc
+  /sales/includes/db/sales_order_db.inc
+  /sales/includes/sales_db.inc
+  /sales/includes/ui/sales_credit_ui.inc
+  /sales/includes/ui/sales_order_ui.inc
+  /sales/sales_order_entry.php
+  /sql/alter2.1.sql
+  
 12-Nov-2008 Janusz Dobrowolski
 ! Changed db_pager API for inserted columns.
 $ /includes/db_pager.inc
index 3a0ec674006721ad622286ae2348a4f765bcf6a1..b960c27d9809af4fab279d189230a921634933eb 100644 (file)
@@ -586,22 +586,22 @@ $options = array(
 }
 
 function dimensions_list_cells($label, $name, $selected_id=null, $no_option=false, $showname=null,
-       $showclosed=false, $showtype=0)
+       $showclosed=false, $showtype=0, $submit_on_change=false)
 {
        if ($label != null)
                echo "<td>$label</td>\n";
        echo "<td>";
-       $str = dimensions_list($name, $selected_id, $no_option, $showname, false, $showclosed, $showtype);
+       $str = dimensions_list($name, $selected_id, $no_option, $showname, $submit_on_change, $showclosed, $showtype);
        echo "</td>\n";
        return $str;
 }
 
 function dimensions_list_row($label, $name, $selected_id=null, $no_option=false, $showname=null,
-       $showclosed=false, $showtype=0)
+       $showclosed=false, $showtype=0, $submit_on_change=false)
 {
        echo "<tr>\n";
        $str = dimensions_list_cells($label, $name, $selected_id, $no_option, $showname,
-               $showclosed, $showtype);
+               $showclosed, $showtype, $submit_on_change);
        echo "</tr>\n";
        return $str;
 }
index bfa8b788392f8e899e2e45eaabb7eded018ced54..c05a58bb91b44c5756a88bec58909be214d1eb8b 100644 (file)
@@ -13,6 +13,7 @@ include_once($path_to_root . "/sales/includes/sales_ui.inc");
 include_once($path_to_root . "/sales/includes/db/sales_types_db.inc");
 include_once($path_to_root . "/sales/includes/ui/sales_credit_ui.inc");
 include_once($path_to_root . "/sales/includes/ui/sales_order_ui.inc");
+include_once($path_to_root . "/reporting/includes/reporting.inc");
 
 $js = "";
 if ($use_popup_windows) {
@@ -61,7 +62,7 @@ if (isset($_GET['AddedID'])) {
 
        display_note(get_customer_trans_view_str($trans_type, $credit_no, _("&View this credit note")), 0, 1);
 
-       display_note(print_document_link($credit_no, _("&Print This Credit Invoice"), true, 11),1);
+       display_note(print_document_link($credit_no, _("&Print This Credit Invoice"), true, 11),0, 1);
 
        display_note(get_gl_view_str($trans_type, $credit_no, _("View the GL &Journal Entries for this Credit Note")));
 
@@ -88,6 +89,8 @@ function copy_to_cn()
        $_SESSION['Items']->sales_type = $_POST['sales_type_id'];
        $_SESSION['Items']->reference = $_POST['ref'];
        $_SESSION['Items']->ship_via = $_POST['ShipperID'];
+       $_SESSION['Items']->dimension_id = $_POST['dimension_id'];
+       $_SESSION['Items']->dimension2_id = $_POST['dimension2_id'];
 }
 
 //-----------------------------------------------------------------------------
@@ -101,6 +104,8 @@ function copy_from_cn()
        $_POST['sales_type_id'] = $_SESSION['Items']->sales_type;
        $_POST['ref'] = $_SESSION['Items']->reference;
        $_POST['ShipperID'] = $_SESSION['Items']->ship_via;
+       $_POST['dimension_id'] = $_SESSION['Items']->dimension_id;
+       $_POST['dimension2_id'] = $_SESSION['Items']->dimension2_id;
 }
 
 //-----------------------------------------------------------------------------
index 991139121954c66d6be78e232dc34bf40a840e08..628ab43a3ea5e3fd34ea59ed2f03db2b65e769db 100644 (file)
@@ -61,6 +61,8 @@ class cart
        var $cash_account;
        var $account_name;
        var $cash_discount;     // not used as of FA 2.1
+       var $dimension_id;
+       var $dimension2_id;
        //-------------------------------------------------------------------------
        //
        //  $trans_no==0 => open new/direct document
@@ -72,6 +74,8 @@ class cart
                $this->line_items = array();
                $this->sales_type = "";
                $this->trans_type = 30;
+               $this->dimension_id = 0;
+               $this->dimension2_id = 0;
                $this->read($type, $trans_no, $view );
        }
 
@@ -141,6 +145,27 @@ class cart
                                if (!is_date_in_fiscalyear($this->document_date))
                                        $this->document_date = end_fiscalyear();
                                $this->reference = references::get_next($this->trans_type);
+                               if ($type != 30) // Added 2.1 Joe Hunt 2008-11-12
+                               {
+                                       $dim = get_company_pref('use_dimension');
+                                       if ($dim > 0)
+                                       {
+                                               if ($this->customer_id == '')
+                                                       $this->dimension_id = 0;
+                                               else
+                                               {
+                                                       $cust = get_customer($this->customer_id);
+                                                       $this->dimension_id = $cust['dimension_id'];
+                                               }       
+                                               if ($dim > 1)
+                                               {
+                                                       if ($this->customer_id == '')
+                                                               $this->dimension2_id = 0;
+                                                       else
+                                                               $this->dimension2_id = $cust['dimension2_id'];
+                                               }               
+                                       }               
+                               }       
                                if ($type == 10) {
                                  $this->due_date =
                                        get_invoice_duedate($this->customer_id, $this->document_date);
index 3ee406ddf502852f55410d1ac31951da0fe0f730..709657d440c376432d403d3305897e337556ec97 100644 (file)
@@ -79,7 +79,7 @@ function get_customer_trans_version($type, $trans_no) {
 function write_customer_trans($trans_type, $trans_no, $debtor_no, $BranchNo,
        $date_, $reference, $Total, $discount=0, $Tax=0, $Freight=0, $FreightTax=0,
        $sales_type=0, $order_no=0, $trans_link=0, $ship_via=0, $due_date="",
-       $AllocAmt=0)
+       $AllocAmt=0, $dimension_id=0, $dimension2_id=0)
 {
 
        $curr = get_customer_currency($debtor_no);
@@ -101,13 +101,15 @@ function write_customer_trans($trans_type, $trans_no, $debtor_no, $BranchNo,
                reference, tpe,
                order_, ov_amount, ov_discount,
                ov_gst, ov_freight, ov_freight_tax,
-               rate, ship_via, alloc, trans_link
+               rate, ship_via, alloc, trans_link,
+               dimension_id, dimension2_id
                ) VALUES ($trans_no, $trans_type,
                ".db_escape($debtor_no).", ".db_escape($BranchNo).",
                '$SQLDate', '$SQLDueDate', ".db_escape($reference).",
                ".db_escape($sales_type).", $order_no, $Total, ".db_escape($discount).", $Tax,
                ".db_escape($Freight).",
-               $FreightTax, $rate, ".db_escape($ship_via).", $AllocAmt, ".db_escape($trans_link).")";
+               $FreightTax, $rate, ".db_escape($ship_via).", $AllocAmt, ".db_escape($trans_link).",
+               $dimension_id, $dimension2_id)";
        } else {        // may be optional argument should stay unchanged ?
        $sql = "UPDATE ".TB_PREF."debtor_trans SET
                debtor_no=".db_escape($debtor_no)." , branch_code=".db_escape($BranchNo).",
@@ -115,7 +117,8 @@ function write_customer_trans($trans_type, $trans_no, $debtor_no, $BranchNo,
                reference=".db_escape($reference).", tpe=".db_escape($sales_type).", order_=$order_no,
                ov_amount=$Total, ov_discount=".db_escape($discount).", ov_gst=$Tax,
                ov_freight=".db_escape($Freight).", ov_freight_tax=$FreightTax, rate=$rate,
-               ship_via=".db_escape($ship_via).", alloc=$AllocAmt, trans_link=$trans_link
+               ship_via=".db_escape($ship_via).", alloc=$AllocAmt, trans_link=$trans_link,
+               dimension_id=$dimension_id, dimension2_id=$dimension2_id
                WHERE trans_no=$trans_no AND type=$trans_type";
        }
        db_query($sql, "The debtor transaction record could not be inserted");
index 2f56e9012d03548015ab02a7fffdb17aa5da7351..3a81094490fa06aa7a69d63c89782929739cab72 100644 (file)
@@ -61,7 +61,8 @@ function write_credit_note($credit_note, $write_off_acc)
                $credit_note->freight_cost, $freight_added_tax,
                $credit_note->sales_type,
                $credit_note->order_no, $credit_invoice, $credit_note->ship_via,
-               null, $alloc); // 2008-06-14 extra $alloc
+               null, $alloc, $credit_note->dimension_id, $credit_note->dimension2_id); 
+               // 2008-06-14 extra $alloc, 2008-11-12 dimension_id Joe Hunt
 
        if ($trans_no==0) {
                $credit_note->trans_no = array($credit_no=>0);
@@ -207,8 +208,8 @@ function add_gl_trans_credit_costs($order, $order_line, $credit_no, $date_,
        $customer = get_customer($order->customer_id);
        // 2008-08-01. If there is a Customer Dimension, then override with this,
        // else take the Item Dimension (if any)
-       $dim = ($customer['dimension_id'] != 0 ? $customer["dimension_id"] : $stock_gl_codes["dimension_id"]);
-       $dim2 = ($customer['dimension2_id'] != 0 ? $customer["dimension2_id"] : $stock_gl_codes["dimension2_id"]);
+       $dim = ($order->dimension_id > 0 ? $order->dimension_id : ($customer['dimension_id'] != 0 ? $customer["dimension_id"] : $stock_gl_codes["dimension_id"]));
+       $dim2 = ($order->dimension2_id > 0 ? $order->dimension2_id : ($customer['dimension2_id'] != 0 ? $customer["dimension2_id"] : $stock_gl_codes["dimension2_id"]));
 
        /* insert gl_trans to credit stock and debit cost of sales at standard cost*/
        $standard_cost = get_standard_cost($order_line->stock_id);
index 11aa2f665c0cc57525320e3f8b87824c3d3a39b3..f2237dbd9fe0f6e21aef534990784543ae1a672c 100644 (file)
@@ -31,7 +31,7 @@ function write_sales_delivery(&$delivery,$bo_policy)
                $delivery->freight_cost,
                $delivery->tax_included ? 0 : $freight_tax,
                $delivery->sales_type, $delivery->order_no, 0,
-               $delivery->ship_via, $delivery->due_date);
+               $delivery->ship_via, $delivery->due_date, 0, $delivery->dimension_id, $delivery->dimension2_id);
 
        if ($trans_no == 0) {
                $delivery->trans_no = array($delivery_no=>0);
@@ -81,8 +81,8 @@ function write_sales_delivery(&$delivery,$bo_policy)
                                /*first the cost of sales entry*/
                                // 2008-08-01. If there is a Customer Dimension, then override with this,
                                // else take the Item Dimension (if any)
-                               $dim = ($customer['dimension_id'] != 0 ? $customer["dimension_id"] : $stock_gl_code["dimension_id"]);
-                               $dim2 = ($customer['dimension2_id'] != 0 ? $customer["dimension2_id"] : $stock_gl_code["dimension2_id"]);
+                               $dim = ($delivery->dimension_id > 0 ? $delivery->dimension_id : ($customer['dimension_id'] != 0 ? $customer["dimension_id"] : $stock_gl_code["dimension_id"]));
+                               $dim2 = ($delivery->dimension2_id > 0 ? $delivery->dimension2_id : ($customer['dimension2_id'] != 0 ? $customer["dimension2_id"] : $stock_gl_code["dimension2_id"]));
 
                                add_gl_trans_std_cost(13, $delivery_no,
                                        $delivery->document_date, $stock_gl_code["cogs_account"], $dim, $dim2, "",
index d11786356d4d2820942ec0e985515b461da0ae52..689cd95606873b8833b4fdc9b7d8d39ddeb5ff6e 100644 (file)
@@ -61,7 +61,8 @@ function write_sales_invoice(&$invoice)
                $invoice->Branch, $date_, $invoice->reference, $items_total, 0,
                $items_added_tax, $invoice->freight_cost, $freight_added_tax,
                $invoice->sales_type, $sales_order, $delivery_no,
-               $invoice->ship_via, $invoice->due_date, $alloc); // 2008-06-14 extra $alloc
+               $invoice->ship_via, $invoice->due_date, $alloc, $invoice->dimension_id, $invoice->dimension2_id); 
+               // 2008-06-14 extra $alloc, 2008-11-12 added dimension_id Joe Hunt
 
        if ($trans_no == 0) {
                $invoice->trans_no = array($invoice_no=>0);
@@ -104,8 +105,8 @@ function write_sales_invoice(&$invoice)
                                $sales_account = ($branch_data['sales_account'] != "" ? $branch_data['sales_account'] : $stock_gl_code['sales_account']);
                                // 2008-08-01. If there is a Customer Dimension, then override with this,
                                // else take the Item Dimension (if any)
-                               $dim = ($customer['dimension_id'] != 0 ? $customer["dimension_id"] : $stock_gl_code["dimension_id"]);
-                               $dim2 = ($customer['dimension2_id'] != 0 ? $customer["dimension2_id"] : $stock_gl_code["dimension2_id"]);
+                               $dim = ($invoice->dimension_id > 0 ? $invoice->dimension_id : ($customer['dimension_id'] != 0 ? $customer["dimension_id"] : $stock_gl_code["dimension_id"]));
+                               $dim2 = ($invoice->dimension2_id > 0 ? $invoice->dimension2_id : ($customer['dimension2_id'] != 0 ? $customer["dimension2_id"] : $stock_gl_code["dimension2_id"]));
                                add_gl_trans_customer(10, $invoice_no, $date_, $sales_account, $dim, $dim2,
                                        (-$line_taxfree_price * $invoice_line->qty_dispatched),
                                        $invoice->customer_id, "The sales price GL posting could not be inserted");
index 25e39abf579fb66c7da65065ffd856a96d810421..cbefe7aa09994fa82699e39be027b64a3d44cfcc 100644 (file)
@@ -450,6 +450,8 @@ function get_customer_to_order($customer_id) {
                  .TB_PREF."debtors_master.address, "
                  .TB_PREF."credit_status.dissallow_invoices, "
                  .TB_PREF."debtors_master.sales_type AS salestype, "
+                 .TB_PREF."debtors_master.dimension_id, "
+                 .TB_PREF."debtors_master.dimension2_id, "
                  .TB_PREF."sales_types.sales_type, "
                  .TB_PREF."sales_types.tax_included, "
                  .TB_PREF."sales_types.factor, "
index 4f98c78fc6ab5df0774ae38db8edd43026f9c213..f653c24a6b038ebf995601f50e7884d8a3575208 100644 (file)
@@ -240,7 +240,8 @@ function read_sales_trans($doc_type, $trans_no, &$cart)
                $cart->trans_link = $myrow["trans_link"];
                $cart->due_date = sql2date($myrow["due_date"]);
                $cart->document_date = sql2date($myrow["tran_date"]);
-
+               $cart->dimension_id = $myrow['dimension_id']; // added 2.1 Joe Hunt 2008-11-12
+               $cart->dimension2_id = $myrow['dimension2_id'];
                $cart->Comments = '';
                foreach ( $trans_no as $trans ) {
                        $coms =  get_comments($doc_type,$trans);
index be4adbf3060af84870e41abb06245b1d856f8830..9a52b8ae48358fbf555d7eb4fbeaabc66a83e6f6 100644 (file)
@@ -58,6 +58,14 @@ function display_credit_header(&$order)
                                    $Ajax->activate('sales_type_id');
                                    $change_prices = 1;
                                }
+                               if ($old_order->dimension_id != $order->dimension_id) {
+                                       $_POST['dimension_id'] = $order->dimension_id;
+                                   $Ajax->activate('dimension_id');
+                               }
+                               if ($old_order->dimension2_id != $order->dimension2_id) {
+                                       $_POST['dimension2_id'] = $order->dimension2_id;
+                                   $Ajax->activate('dimension2_id');
+                               }
                                unset($old_order);
          }
        set_global_customer($_POST['customer_id']);
@@ -101,6 +109,8 @@ function display_credit_header(&$order)
                $change_prices = 1;
        }
 
+    shippers_list_row(_("Shipping Company:"), 'ShipperID', $order->ship_via);
+
        label_row(_("Customer Discount:"), ($order->default_discount * 100) . "%");
        echo "</table>";
 
@@ -116,8 +126,29 @@ function display_credit_header(&$order)
                $change_prices = 1;
                $Ajax->activate('currency');
        }
-    shippers_list_row(_("Shipping Company:"), 'ShipperID', $order->ship_via);
-
+       // 2008-11-12 Joe Hunt added dimensions
+       $dim = get_company_pref('use_dimension');
+       if ($dim > 0)
+       {
+               if ($order->dimension_id != $_POST['dimension_id']) {
+                       $order->dimension_id = $_POST['dimension_id'];
+                       $Ajax->activate('dimension_id');
+               }       
+               dimensions_list_row(_("Dimension:"), 'dimension_id', null, true, ' ', false, 1, true);
+               if ($dim > 1)
+               {
+                       if ($order->dimension2_id != $_POST['dimension2_id']) {
+                               $order->dimension2_id = $_POST['dimension2_id'];
+                               $Ajax->activate('dimension2_id');
+                       }       
+                       dimensions_list_row(_("Dimension")." 2:", 'dimension2_id', null, true, ' ', false, 2, true);
+               }       
+       }               
+       if ($dim < 2)
+               hidden('dimension2_id', 0);
+       if ($dim < 1)
+               hidden('dimension_id', 0);
+       
        echo "</table>";
 
        echo "</td></tr>";
index 49cc8b736f99d30aae61f4525991c82a75789897..5d64b1448d62dea94f4f7be9c38fc56f5dff8d51 100644 (file)
@@ -41,6 +41,11 @@ function get_customer_details_to_order(&$order, $customer_id, $branch_id)
        $order->set_sales_type($myrow['salestype'], $myrow['sales_type'], $myrow['tax_included'],
            $myrow['factor']);
 
+       if ($order->trans_type != 30)
+       {
+               $order->dimension_id = $myrow['dimension_id'];
+               $order->dimension2_id = $myrow['dimension2_id'];
+       }
        $result = get_branch_to_order($customer_id, $branch_id);
 
        if (db_num_rows($result) == 0)
@@ -175,6 +180,10 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group
                hidden('customer_id', $order->customer_id);
                hidden('branch_id', $order->Branch);
                hidden('sales_type', $order->sales_type);
+               if ($order->trans_type != 30) {
+                       hidden('dimension_id', $order->dimension_id); // 2008-11-12 Joe Hunt
+                       hidden('dimension2_id', $order->dimension2_id);
+               }       
        }
        else
        {
@@ -237,6 +246,14 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group
                                    $Ajax->activate('sales_type');
                                    $change_prices = 1;
                                }
+                               if ($old_order->dimension_id != $order->dimension_id) {
+                                       $_POST['dimension_id'] = $order->dimension_id;
+                                   $Ajax->activate('dimension_id');
+                               }
+                               if ($old_order->dimension2_id != $order->dimension2_id) {
+                                       $_POST['dimension2_id'] = $order->dimension2_id;
+                                   $Ajax->activate('dimension2_id');
+                               }
                                unset($old_order);
                        }
                set_global_customer($_POST['customer_id']);
@@ -321,6 +338,30 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group
                                $_POST['delivery_date'] = add_days(get_post('OrderDate'), sys_prefs::default_delivery_required_by());
                        $Ajax->activate('delivery_date');
                }
+               if ($order->trans_type != 30)
+               {       // 2008-11-12 Joe Hunt added dimensions
+                       $dim = get_company_pref('use_dimension');
+                       if ($dim > 0)
+                       {
+                               if ($order->dimension_id != $_POST['dimension_id']) {
+                                       $order->dimension_id = $_POST['dimension_id'];
+                                       $Ajax->activate('dimension_id');
+                               }       
+                               dimensions_list_row(_("Dimension:"), 'dimension_id', null, true, ' ', false, 1, true);
+                               if ($dim > 1)
+                               {
+                                       if ($order->dimension2_id != $_POST['dimension2_id']) {
+                                               $order->dimension2_id = $_POST['dimension2_id'];
+                                               $Ajax->activate('dimension2_id');
+                                       }       
+                                       dimensions_list_row(_("Dimension")." 2:", 'dimension2_id', null, true, ' ', false, 2, true);
+                               }       
+                       }               
+                       if ($dim < 2)
+                               hidden('dimension2_id', 0);
+                       if ($dim < 1)
+                               hidden('dimension_id', 0);
+               }       
        }
        else
        {
@@ -348,6 +389,9 @@ function display_order_header(&$order, $editable, $date_text, $display_tax_group
                }
            $Ajax->activate('items_table');
        }
+       $f = fopen(dirname(__FILE__)."/debug.txt", "w");
+       fwrite($f, "dimension=".$order->dimension_id.",dimension 2=".$order->dimension2_id."\n");
+       fclose($f);
 
        return $customer_error;
 }
index 3017f0221a9b502a6769bf5292a4d0155e46f66a..db81c1ce0cf994015093bd9812024e86d4c13b60 100644 (file)
@@ -172,7 +172,11 @@ function copy_to_cart()
        $cart->customer_id      = $_POST['customer_id'];
        $cart->Branch = $_POST['branch_id'];
        $cart->sales_type = $_POST['sales_type'];
-       // POS 
+       // POS
+       if ($cart->trans_type!=30) { // 2008-11-12 Joe Hunt
+               $cart->dimension_id = $_POST['dimension_id'];
+               $cart->dimension2_id = $_POST['dimension2_id'];
+       }       
 }
 
 //-----------------------------------------------------------------------------
@@ -203,6 +207,11 @@ function copy_from_cart()
        // POS 
        if ($cart->trans_type == 10)
                $_POST['cash'] = $cart->cash;
+       if ($cart->trans_type!=30) { // 2008-11-12 Joe Hunt
+               $_POST['dimension_id'] = $cart->dimension_id;
+               $_POST['dimension2_id'] = $cart->dimension2_id;
+       }       
+               
 }
 //--------------------------------------------------------------------------------
 
@@ -278,7 +287,6 @@ if (isset($_POST['ProcessOrder']) && can_process()) {
 
        $modified = ($_SESSION['Items']->trans_no != 0);
        $so_type = $_SESSION['Items']->so_type;
-
        $_SESSION['Items']->write(1);
        if (count($messages)) { // abort on failure or error messages are lost
                $Ajax->activate('_page_body');
index 5d9d7a5baa17d51961803277482bf357a5b1d9b1..153ccda8dad380884a873f6268d851e1d95fd20a 100644 (file)
@@ -1,3 +1,6 @@
+ALTER TABLE `0_debtor_trans` ADD `dimension_id` int(11) NOT NULL default '0';
+ALTER TABLE `0_debtor_trans` ADD `dimension2_id` int(11) NOT NULL default '0';
+
 DROP TABLE IF EXISTS `0_bank_trans_types`;
 
 ALTER TABLE `0_bank_accounts` DROP PRIMARY KEY;