Removed obsolete stock_moves.visible field; changed add_stock_move() prototype.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 10 May 2013 10:48:03 +0000 (12:48 +0200)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 5 Apr 2015 12:44:29 +0000 (14:44 +0200)
12 files changed:
doc/api_changes.txt
includes/db/inventory_db.inc
manufacturing/includes/db/work_orders_quick_db.inc
purchasing/includes/db/grn_db.inc
purchasing/includes/db/invoice_db.inc
reporting/rep302.php
sales/includes/db/sales_credit_db.inc
sales/includes/db/sales_delivery_db.inc
sales/includes/sales_db.inc
sql/alter2.4.sql
sql/en_US-demo.sql
sql/en_US-new.sql

index 36c94fe443c6d957b7035c866886d294d6aa5d1b..79b41920e9a0b0a814ae278dce2a3c44da3182c7 100644 (file)
@@ -13,6 +13,10 @@ Changed functions:
        save_to_file($path, $zip, $fileData)
  tax_types_db.inc:
        get_tax_type_default_rate($type_id) => get_tax_type_rate($type_id)
+ inventory_db.inc:
+       get_stock_moves($type, $type_no)
+       add_stock_move($type, $stock_id, $trans_no, $location, $date_, $reference, $quantity, $std_cost, 
+               $person_id=0, $price=0, $discount_percent=0, $error_msg="")
 
 Before 2.4:
        get_tax_type_default_rate($type_id)
@@ -69,3 +73,19 @@ Now:
        save_to_file($path, $zip, $fileData)
 Description:
        $path parameter have to contain full path to file, no assumptions to target folder is done inside function.
+
+Before 2.4:
+       add_stock_move($type, $stock_id, $trans_no, $location, $date_, $reference, $quantity, $std_cost, 
+               $person_id=0, $show_or_hide=1, $price=0, $discount_percent=0, $error_msg="")
+Now:
+       add_stock_move($type, $stock_id, $trans_no, $location, $date_, $reference, $quantity, $std_cost, 
+               $person_id=0, $price=0, $discount_percent=0, $error_msg="")
+Description:
+       Removed parameter $show_or_hide (obsolete after `visible` field removal).
+
+Before 2.4:
+       get_stock_moves($type, $type_no, $visible=false)
+Now:
+       get_stock_moves($type, $type_no)
+Description:
+       Removed parameter $visible (obsolete after `visible` field removal).
index dea42fdaebe71068800d82b8345195b70890f7bc..117e318d96d53b590c263407706206527da045ee 100644 (file)
@@ -354,23 +354,21 @@ function handle_negative_inventory($stock_id, $quantity, $standard_cost, $date_)
 
 // $date_ - display / non-sql date
 // $std_cost - in HOME currency
-// $show_or_hide - wil this move be visible in reports, etc
 // $price - in $person_id's currency
 
 function add_stock_move($type, $stock_id, $trans_no, $location,
-    $date_, $reference, $quantity, $std_cost, $person_id=0, $show_or_hide=1,
+    $date_, $reference, $quantity, $std_cost, $person_id=0,
     $price=0, $discount_percent=0, $error_msg="")
 {
        $date = date2sql($date_);
 
        $sql = "INSERT INTO ".TB_PREF."stock_moves (stock_id, trans_no, type, loc_code,
-               tran_date, person_id, reference, qty, standard_cost, visible, price,
+               tran_date, person_id, reference, qty, standard_cost, price,
                discount_percent) VALUES (".db_escape($stock_id)
                .", ".db_escape($trans_no).", ".db_escape($type)
                .",     ".db_escape($location).", '$date', "
                .db_escape($person_id).", ".db_escape($reference).", "
                .db_escape($quantity).", ".db_escape($std_cost).","
-               .db_escape($show_or_hide).", "
                .db_escape($price).", ".db_escape($discount_percent).")";
 
        if ($error_msg == "")
@@ -392,7 +390,7 @@ function update_stock_move($type, $trans_no, $stock_id, $cost)
 
 //--------------------------------------------------------------------------------------------------
 
-function get_stock_moves($type, $type_no, $visible=false)
+function get_stock_moves($type, $type_no)
 {
        $sql = "SELECT ".TB_PREF."stock_moves.*, ".TB_PREF."stock_master.description, "
                .TB_PREF."stock_master.units,".TB_PREF."locations.location_name,"
@@ -403,8 +401,6 @@ function get_stock_moves($type, $type_no, $visible=false)
                WHERE ".TB_PREF."stock_moves.stock_id = ".TB_PREF."stock_master.stock_id
                AND ".TB_PREF."locations.loc_code=".TB_PREF."stock_moves.loc_code
                AND type=".db_escape($type)." AND trans_no=".db_escape($type_no)." ORDER BY trans_id";
-       if ($visible)
-               $sql .= " AND ".TB_PREF."stock_moves.visible=1";
 
        return db_query($sql, "Could not get stock moves");
 }
index 1ce76932a61ee06994b454edd6ae8dcdc9117460..7474802477abaf6e8b022f38f3eaacb0921a0c2a 100644 (file)
@@ -68,7 +68,7 @@ function add_work_order_quick($wo_ref, $loc_code, $units_reqd, $stock_id, $type,
                // insert a -ve stock move for each item
                $UnitCost = get_standard_cost($bom_item["component"]);
                add_stock_move(ST_WORKORDER, $bom_item["component"], $woid,
-                       $bom_item["loc_code"], $date_, $wo_ref, -$item_quantity, $UnitCost, 0, 1, $UnitCost);
+                       $bom_item["loc_code"], $date_, $wo_ref, -$item_quantity, $UnitCost, 0, $UnitCost);
        }
        
        // -------------------------------------------------------------------------
index 09090c302fc6a2bf08b3afbab50f94bfd2b0653b..58320e7cb8b078b2506918d1300ba642c918ef2a 100644 (file)
@@ -153,7 +153,7 @@ function add_grn(&$po)
                        /* Update location stock records - NB  a po cannot be entered for a service/kit parts done automatically */
                        add_stock_move(ST_SUPPRECEIVE, $order_line->stock_id, $grn, $po->Location, $date_, "",
                                $order_line->receive_qty, $order_line->standard_cost,
-                       $po->supplier_id, 1, $order_line->taxfree_charge_price($po));
+                       $po->supplier_id, $order_line->taxfree_charge_price($po));
 
                } /*quantity received is != 0 */
        } /*end of order_line loop */
@@ -259,7 +259,7 @@ function set_grn_item_credited(&$entered_grn, $supplier, $transno, $date)
        db_query($sql);
 
     add_stock_move(ST_SUPPCREDIT, $entered_grn->item_code, $transno, $myrow['loc_code'], $date, "",
-               $entered_grn->this_quantity_inv, $mcost, $supplier, 1, $entered_grn->chg_price);
+               $entered_grn->this_quantity_inv, $mcost, $supplier, $entered_grn->chg_price);
 }
 
 function get_grn_items($grn_batch_id=0, $supplier_id="", $outstanding_only=false,
index 89834f40cd043c83da760691b3089a8642077d21..ab5cd43903192748fdc5dbc1fe57779bf1fcdb3f 100644 (file)
@@ -675,7 +675,7 @@ function remove_not_invoice_item($id)
         $price = get_tax_free_price_for_item($myrow['item_code'], $myrow['unit_price'], $supp['tax_group_id'], $supp['tax_included']);        
 
     add_stock_move(ST_SUPPRECEIVE, $myrow["item_code"], $myrow['grn_batch_id'], $grn['loc_code'], sql2date($grn["delivery_date"]), "",
-        -$myrow["QtyOstdg"], $myrow['std_cost_unit'], $grn["supplier_id"], 1, $price);
+        -$myrow["QtyOstdg"], $myrow['std_cost_unit'], $grn["supplier_id"], $price);
         
     $clearing_act = get_company_pref('grn_clearing_act');
     if ($clearing_act) {    // otherwise GRN clearing account is not used
index bff1c573d5dbfcc2334692dfdb877d1794983532..55c766c02440db9448d6e0a3556573e5dd6d85ed 100644 (file)
@@ -75,8 +75,7 @@ function getPeriods($stockid, $location)
                        FROM ".TB_PREF."stock_moves
                        WHERE stock_id='$stockid'
                        AND loc_code ='$location'
-                       AND (type=13 OR type=11)
-                       AND visible=1";
+                       AND (type=13 OR type=11)";
 
     $TransResult = db_query($sql,"No transactions were returned");
        return db_fetch($TransResult);
index 9e8e9ae732a6be9421212439d1d9064075116044..75c91fe17d1b6b0bbff0b99711cd941eb7f5bf43 100644 (file)
@@ -122,8 +122,10 @@ function write_credit_note(&$credit_note, $write_off_acc)
                        $credit_line->line_price(), $line_tax, $credit_line->discount_percent,
                        $credit_line->standard_cost, $credit_line->src_id, $trans_no==0 ? 0:  $credit_line->id);
 
-               add_credit_movements_item($credit_note, $credit_line,
-                       $credit_type, $line_taxfree_price+$line_tax, $credit_invoice);
+
+               if ($credit_type == 'Return')
+                       add_credit_movements_item($credit_note, $credit_line,
+                               $credit_type, $line_taxfree_price+$line_tax, $credit_invoice);
 
                $total += add_gl_trans_credit_costs($credit_note, $credit_line, $credit_no,
                    $credit_date, $credit_type, $write_off_acc, $branch_data);
@@ -181,36 +183,19 @@ function write_credit_note(&$credit_note, $write_off_acc)
 function add_credit_movements_item(&$credit_note, &$credit_line,
        $credit_type, $price, $credited_invoice=0)
 {
-
     //Chaitanya : Stamp current cost in stock moves $credit_line does not fetch cost
     $curr_std_cost = get_standard_cost($credit_line->stock_id);
 
-       if ($credit_type == "Return") {
-
-               $reference = "Return ";
-               if ($credited_invoice) {
-                       $reference .= "Ex Inv: " . $credited_invoice;
-               }
-
-       } elseif ($credit_type == "WriteOff") {
-
-               $reference = "WriteOff ";
-               if ($credited_invoice)
-                       $reference .= "Ex Inv: " . $credited_invoice;
-
-               add_stock_move_customer(ST_CUSTCREDIT,  $credit_line->stock_id,
-               key($credit_note->trans_no), $credit_note->Location,
-               $credit_note->document_date, $reference, -$credit_line->qty_dispatched,
-               $curr_std_cost,  0, $price,
-               $credit_line->discount_percent);
-
+       $reference = _("Return");
+       if ($credited_invoice) {
+               $reference .= ' '._("Ex Inv:").' ' . $credited_invoice;
        }
-    add_stock_move_customer(ST_CUSTCREDIT,  $credit_line->stock_id,
-        key($credit_note->trans_no), $credit_note->Location,
-        $credit_note->document_date, $reference, $credit_line->qty_dispatched,
-        $curr_std_cost,  0, $price,
-        $credit_line->discount_percent);
 
+    add_stock_move_customer(ST_CUSTCREDIT,  $credit_line->stock_id,
+           key($credit_note->trans_no), $credit_note->Location,
+               $credit_note->document_date, $reference, $credit_line->qty_dispatched,
+        $curr_std_cost, $price,
+           $credit_line->discount_percent);
 }
 
 //----------------------------------------------------------------------------------------
index eec60c8df166ecbc7fb46cdc3dbd9018263d8116..f1c15fd2f508b5198d7d7d114b70c9d317356092 100644 (file)
@@ -96,7 +96,7 @@ function write_sales_delivery(&$delivery,$bo_policy)
                if ($delivery_line->qty_dispatched != 0) {
                        add_stock_move_customer(ST_CUSTDELIVERY, $delivery_line->stock_id, $delivery_no,
                                $delivery->Location, $delivery->document_date, $delivery->reference,
-                               -$delivery_line->qty_dispatched, $delivery_line->standard_cost,1,
+                               -$delivery_line->qty_dispatched, $delivery_line->standard_cost,
                                $line_price, $delivery_line->discount_percent);
 
                        $stock_gl_code = get_stock_gl_code($delivery_line->stock_id);
index efa2706c21aeb0c4191835e59e2a2b14ff86ef7b..9a63833e35c7f7b64a656b89262c137290355b75 100644 (file)
@@ -35,10 +35,10 @@ include_once($path_to_root . "/sales/includes/db/customers_db.inc");
 // $type is 10 (invoice) or 11 (credit)
 
 function add_stock_move_customer($type, $stock_id, $trans_id, $location, $date_, $reference,
-       $quantity, $std_cost, $show_or_hide=1, $price=0, $discount_percent=0)
+       $quantity, $std_cost, $price=0, $discount_percent=0)
 {
        return add_stock_move($type, $stock_id, $trans_id, $location, $date_, $reference,
-               $quantity, $std_cost, 0, $show_or_hide, $price, $discount_percent,
+               $quantity, $std_cost, 0, $price, $discount_percent,
                "The customer stock movement record cannot be inserted");
 }
 
index c00bee34ffa328a40cc288837104c3a17d3780f2..df69f877157a714ab6b387f52a5dc08505487321 100644 (file)
@@ -222,3 +222,12 @@ INSERT IGNORE INTO `0_sys_prefs` VALUES
        ('bcc_email', 'setup.company', 'varchar', 100, ''),
        ('alternative_tax_include_on_docs', 'setup.company', 'tinyint', 1, '0'),
        ('suppress_tax_rates', 'setup.company', 'tinyint', 1, '0');
+
+# stock_moves.visible field is obsolete
+# removing obsolete moves for writeoffs
+DELETE moves
+       FROM `0_stock_moves` moves 
+       INNER JOIN (SELECT * FROM `0_stock_moves` WHERE `type`=11 AND `qty`<0) writeoffs ON writeoffs.`trans_no`=moves.`trans_no` AND writeoffs.`type`=11
+       WHERE moves.`type`=11;
+
+ALTER TABLE `0_stock_moves` DROP COLUMN `visible`;
index 976e91e761c084b70633e03bef244eb180fc247b..574d5cd4ba91be759eddae99b934ea08ef9ea56d 100644 (file)
@@ -1826,65 +1826,67 @@ INSERT INTO `0_stock_master` VALUES('3400', 3, 1, 'P4 Business System', '', 'eac
 --
 
 DROP TABLE IF EXISTS `0_stock_moves`;
-CREATE TABLE IF NOT EXISTS `0_stock_moves` (
-  `trans_id` int(11) NOT NULL auto_increment,
-  `trans_no` int(11) NOT NULL default '0',
-  `stock_id` char(20) NOT NULL default '',
-  `type` smallint(6) NOT NULL default '0',
-  `loc_code` char(5) NOT NULL default '',
-  `tran_date` date NOT NULL default '0000-00-00',
-  `person_id` int(11) default NULL,
-  `price` double NOT NULL default '0',
-  `reference` char(40) NOT NULL default '',
-  `qty` double NOT NULL default '1',
-  `discount_percent` double NOT NULL default '0',
-  `standard_cost` double NOT NULL default '0',
-  `visible` tinyint(1) NOT NULL default '1',
-  PRIMARY KEY  (`trans_id`),
+CREATE TABLE `0_stock_moves` (
+  `trans_id` int(11) NOT NULL AUTO_INCREMENT,
+  `trans_no` int(11) NOT NULL DEFAULT '0',
+  `stock_id` char(20) NOT NULL DEFAULT '',
+  `type` smallint(6) NOT NULL DEFAULT '0',
+  `loc_code` char(5) NOT NULL DEFAULT '',
+  `tran_date` date NOT NULL DEFAULT '0000-00-00',
+  `person_id` int(11) DEFAULT NULL,
+  `price` double NOT NULL DEFAULT '0',
+  `reference` char(40) NOT NULL DEFAULT '',
+  `qty` double NOT NULL DEFAULT '1',
+  `discount_percent` double NOT NULL DEFAULT '0',
+  `standard_cost` double NOT NULL DEFAULT '0',
+  PRIMARY KEY (`trans_id`),
   KEY `type` (`type`,`trans_no`),
   KEY `Move` (`stock_id`,`loc_code`,`tran_date`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8  AUTO_INCREMENT=37 ;
+) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 ;
 
 --
 -- Dumping data for table `0_stock_moves`
 --
 
-INSERT INTO `0_stock_moves` VALUES(1, 1, '102', 25, 'DEF', '2014-06-21', 2, 10, '', 100, 0, 10, 1);
-INSERT INTO `0_stock_moves` VALUES(2, 1, '103', 25, 'DEF', '2014-06-21', 2, 11, '', 100, 0, 11, 1);
-INSERT INTO `0_stock_moves` VALUES(3, 1, '104', 25, 'DEF', '2014-06-21', 2, 12, '', 100, 0, 12, 1);
-INSERT INTO `0_stock_moves` VALUES(4, 1, '102', 26, 'DEF', '2014-06-21', 0, 0, '1', -10, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(5, 1, '103', 26, 'DEF', '2014-06-21', 0, 0, '1', -10, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(6, 1, '104', 26, 'DEF', '2014-06-21', 0, 0, '1', -10, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(7, 1, '3400', 26, 'DEF', '2014-06-21', 0, 0, '1', 10, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(8, 2, '102', 13, 'DEF', '2014-06-21', 0, 30.4, '1', -2, 0, 10, 1);
-INSERT INTO `0_stock_moves` VALUES(9, 3, '102', 13, 'DEF', '2014-06-21', 0, 50, 'auto', -1, 0, 10, 1);
-INSERT INTO `0_stock_moves` VALUES(10, 4, '102', 13, 'DEF', '2014-06-21', 0, 35.89, 'auto', -1, 0, 10, 1);
-INSERT INTO `0_stock_moves` VALUES(11, 3, '102', 26, 'DEF', '2014-06-21', 0, 0, '3', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(12, 3, '103', 26, 'DEF', '2014-06-21', 0, 0, '3', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(13, 3, '104', 26, 'DEF', '2014-06-21', 0, 0, '3', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(14, 3, '3400', 26, 'DEF', '2014-06-21', 0, 0, '3', 2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(15, 4, '102', 26, 'DEF', '2014-06-21', 0, 0, '4', -4, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(16, 4, '103', 26, 'DEF', '2014-06-21', 0, 0, '4', -4, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(17, 4, '104', 26, 'DEF', '2014-06-21', 0, 0, '4', -4, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(18, 4, '3400', 26, 'DEF', '2014-06-21', 0, 0, '4', 4, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(19, 2, '102', 26, 'DEF', '2014-06-21', 0, 0, '', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(20, 2, '103', 26, 'DEF', '2014-06-21', 0, 0, '', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(21, 2, '104', 26, 'DEF', '2014-06-21', 0, 0, '', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(22, 1, '3400', 29, 'DEF', '2014-06-21', 0, 0, '', 2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(23, 5, '102', 26, 'DEF', '2014-06-21', 0, 0, '5', -5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(24, 5, '103', 26, 'DEF', '2014-06-21', 0, 0, '5', -5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(25, 5, '104', 26, 'DEF', '2014-06-21', 0, 0, '5', -5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(26, 5, '3400', 26, 'DEF', '2014-06-21', 0, 0, '5', 5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(27, 6, '102', 26, 'DEF', '2014-06-21', 0, 0, '6', 5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(28, 6, '103', 26, 'DEF', '2014-06-21', 0, 0, '6', 5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(29, 6, '104', 26, 'DEF', '2014-06-21', 0, 0, '6', 5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(30, 6, '3400', 26, 'DEF', '2014-06-21', 0, 0, '6', -5, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(31, 7, '102', 26, 'DEF', '2014-06-21', 0, 0, '7', 2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(32, 7, '103', 26, 'DEF', '2014-06-21', 0, 0, '7', 2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(33, 7, '104', 26, 'DEF', '2014-06-21', 0, 0, '7', 2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(34, 7, '3400', 26, 'DEF', '2014-06-21', 0, 0, '7', -2, 0, 0, 1);
-INSERT INTO `0_stock_moves` VALUES(35, 5, '102', 13, 'DEF', '2014-06-21', 0, 50, 'auto', -1, 0, 10, 1);
-INSERT INTO `0_stock_moves` VALUES(36, 3, '102', 11, 'DEF', '2014-06-21', 0, 37.68, 'Return Ex Inv: 18', 1, 0, 10, 0);
+INSERT INTO `0_stock_moves` VALUES
+('1', '1', '102', '25', 'DEF', '2009-06-21', '2', '10', '', '100', '0', '10'),
+('2', '1', '103', '25', 'DEF', '2009-06-21', '2', '11', '', '100', '0', '11'),
+('3', '1', '104', '25', 'DEF', '2009-06-21', '2', '12', '', '100', '0', '12'),
+('4', '1', '102', '26', 'DEF', '2009-06-21', '0', '0', '1', '-10', '0', '0'),
+('5', '1', '103', '26', 'DEF', '2009-06-21', '0', '0', '1', '-10', '0', '0'),
+('6', '1', '104', '26', 'DEF', '2009-06-21', '0', '0', '1', '-10', '0', '0'),
+('7', '1', '3400', '26', 'DEF', '2009-06-21', '0', '0', '1', '10', '0', '0'),
+('8', '2', '102', '13', 'DEF', '2009-06-21', '0', '30.4', '1', '-2', '0', '10'),
+('9', '3', '102', '13', 'DEF', '2009-06-21', '0', '50', 'auto', '-1', '0', '10'),
+('10', '4', '102', '13', 'DEF', '2009-06-21', '0', '35.89', 'auto', '-1', '0', '10'),
+('11', '3', '102', '26', 'DEF', '2009-06-21', '0', '0', '3', '-2', '0', '0'),
+('12', '3', '103', '26', 'DEF', '2009-06-21', '0', '0', '3', '-2', '0', '0'),
+('13', '3', '104', '26', 'DEF', '2009-06-21', '0', '0', '3', '-2', '0', '0'),
+('14', '3', '3400', '26', 'DEF', '2009-06-21', '0', '0', '3', '2', '0', '0'),
+('15', '4', '102', '26', 'DEF', '2009-06-21', '0', '0', '4', '-4', '0', '0'),
+('16', '4', '103', '26', 'DEF', '2009-06-21', '0', '0', '4', '-4', '0', '0'),
+('17', '4', '104', '26', 'DEF', '2009-06-21', '0', '0', '4', '-4', '0', '0'),
+('18', '4', '3400', '26', 'DEF', '2009-06-21', '0', '0', '4', '4', '0', '0'),
+('19', '2', '102', '26', 'DEF', '2009-06-21', '0', '0', '', '-2', '0', '0'),
+('20', '2', '103', '26', 'DEF', '2009-06-21', '0', '0', '', '-2', '0', '0'),
+('21', '2', '104', '26', 'DEF', '2009-06-21', '0', '0', '', '-2', '0', '0'),
+('22', '1', '3400', '29', 'DEF', '2009-06-21', '0', '0', '', '2', '0', '0'),
+('23', '5', '102', '26', 'DEF', '2009-06-21', '0', '0', '5', '-5', '0', '0'),
+('24', '5', '103', '26', 'DEF', '2009-06-21', '0', '0', '5', '-5', '0', '0'),
+('25', '5', '104', '26', 'DEF', '2009-06-21', '0', '0', '5', '-5', '0', '0'),
+('26', '5', '3400', '26', 'DEF', '2009-06-21', '0', '0', '5', '5', '0', '0'),
+('27', '6', '102', '26', 'DEF', '2009-06-21', '0', '0', '6', '5', '0', '0'),
+('28', '6', '103', '26', 'DEF', '2009-06-21', '0', '0', '6', '5', '0', '0'),
+('29', '6', '104', '26', 'DEF', '2009-06-21', '0', '0', '6', '5', '0', '0'),
+('30', '6', '3400', '26', 'DEF', '2009-06-21', '0', '0', '6', '-5', '0', '0'),
+('31', '7', '102', '26', 'DEF', '2009-06-21', '0', '0', '7', '2', '0', '0'),
+('32', '7', '103', '26', 'DEF', '2009-06-21', '0', '0', '7', '2', '0', '0'),
+('33', '7', '104', '26', 'DEF', '2009-06-21', '0', '0', '7', '2', '0', '0'),
+('34', '7', '3400', '26', 'DEF', '2009-06-21', '0', '0', '7', '-2', '0', '0'),
+('35', '5', '102', '13', 'DEF', '2009-06-21', '0', '50', 'auto', '-1', '0', '10'),
+('36', '3', '102', '11', 'DEF', '2009-06-21', '0', '37.68', 'Return Ex Inv: 18', '1', '0', '10');
+
+### Structure of table `0_supp_allocations` ###
 
 -- --------------------------------------------------------
 
index 4667e952c072af8205c4a22c16e8d23503c5a3da..9904b0c4f99e480edd382898e173849857d42411 100644 (file)
@@ -1633,26 +1633,23 @@ CREATE TABLE IF NOT EXISTS `0_stock_master` (
 -- Table structure for table `0_stock_moves`
 --
 
-DROP TABLE IF EXISTS `0_stock_moves`;
-CREATE TABLE IF NOT EXISTS `0_stock_moves` (
-  `trans_id` int(11) NOT NULL auto_increment,
-  `trans_no` int(11) NOT NULL default '0',
-  `stock_id` char(20) NOT NULL default '',
-  `type` smallint(6) NOT NULL default '0',
-  `loc_code` char(5) NOT NULL default '',
-  `tran_date` date NOT NULL default '0000-00-00',
-  `person_id` int(11) default NULL,
-  `price` double NOT NULL default '0',
-  `reference` char(40) NOT NULL default '',
-  `qty` double NOT NULL default '1',
-  `discount_percent` double NOT NULL default '0',
-  `standard_cost` double NOT NULL default '0',
-  `visible` tinyint(1) NOT NULL default '1',
-  PRIMARY KEY  (`trans_id`),
+CREATE TABLE `0_stock_moves` (
+  `trans_id` int(11) NOT NULL AUTO_INCREMENT,
+  `trans_no` int(11) NOT NULL DEFAULT '0',
+  `stock_id` char(20) NOT NULL DEFAULT '',
+  `type` smallint(6) NOT NULL DEFAULT '0',
+  `loc_code` char(5) NOT NULL DEFAULT '',
+  `tran_date` date NOT NULL DEFAULT '0000-00-00',
+  `person_id` int(11) DEFAULT NULL,
+  `price` double NOT NULL DEFAULT '0',
+  `reference` char(40) NOT NULL DEFAULT '',
+  `qty` double NOT NULL DEFAULT '1',
+  `discount_percent` double NOT NULL DEFAULT '0',
+  `standard_cost` double NOT NULL DEFAULT '0',
+  PRIMARY KEY (`trans_id`),
   KEY `type` (`type`,`trans_no`),
   KEY `Move` (`stock_id`,`loc_code`,`tran_date`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
 --
 -- Dumping data for table `0_stock_moves`
 --