From: Janusz Dobrowolski Date: Fri, 10 May 2013 10:48:03 +0000 (+0200) Subject: Removed obsolete stock_moves.visible field; changed add_stock_move() prototype. X-Git-Tag: v2.4.2~19^2~226 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=3fd7df0efa6893e784c538b996f7968cd6dcd4d0;hp=15b522128f3033b684f005b54d4d5a836d49c382;p=fa-stable.git Removed obsolete stock_moves.visible field; changed add_stock_move() prototype. --- diff --git a/doc/api_changes.txt b/doc/api_changes.txt index 36c94fe4..79b41920 100644 --- a/doc/api_changes.txt +++ b/doc/api_changes.txt @@ -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). diff --git a/includes/db/inventory_db.inc b/includes/db/inventory_db.inc index dea42fda..117e318d 100644 --- a/includes/db/inventory_db.inc +++ b/includes/db/inventory_db.inc @@ -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"); } diff --git a/manufacturing/includes/db/work_orders_quick_db.inc b/manufacturing/includes/db/work_orders_quick_db.inc index 1ce76932..74748024 100644 --- a/manufacturing/includes/db/work_orders_quick_db.inc +++ b/manufacturing/includes/db/work_orders_quick_db.inc @@ -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); } // ------------------------------------------------------------------------- diff --git a/purchasing/includes/db/grn_db.inc b/purchasing/includes/db/grn_db.inc index 09090c30..58320e7c 100644 --- a/purchasing/includes/db/grn_db.inc +++ b/purchasing/includes/db/grn_db.inc @@ -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, diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index 89834f40..ab5cd439 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -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 diff --git a/reporting/rep302.php b/reporting/rep302.php index bff1c573..55c766c0 100644 --- a/reporting/rep302.php +++ b/reporting/rep302.php @@ -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); diff --git a/sales/includes/db/sales_credit_db.inc b/sales/includes/db/sales_credit_db.inc index 9e8e9ae7..75c91fe1 100644 --- a/sales/includes/db/sales_credit_db.inc +++ b/sales/includes/db/sales_credit_db.inc @@ -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); } //---------------------------------------------------------------------------------------- diff --git a/sales/includes/db/sales_delivery_db.inc b/sales/includes/db/sales_delivery_db.inc index eec60c8d..f1c15fd2 100644 --- a/sales/includes/db/sales_delivery_db.inc +++ b/sales/includes/db/sales_delivery_db.inc @@ -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); diff --git a/sales/includes/sales_db.inc b/sales/includes/sales_db.inc index efa2706c..9a63833e 100644 --- a/sales/includes/sales_db.inc +++ b/sales/includes/sales_db.inc @@ -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"); } diff --git a/sql/alter2.4.sql b/sql/alter2.4.sql index c00bee34..df69f877 100644 --- a/sql/alter2.4.sql +++ b/sql/alter2.4.sql @@ -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`; diff --git a/sql/en_US-demo.sql b/sql/en_US-demo.sql index 976e91e7..574d5cd4 100644 --- a/sql/en_US-demo.sql +++ b/sql/en_US-demo.sql @@ -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` ### -- -------------------------------------------------------- diff --git a/sql/en_US-new.sql b/sql/en_US-new.sql index 4667e952..9904b0c4 100644 --- a/sql/en_US-new.sql +++ b/sql/en_US-new.sql @@ -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` --