Removed obsolete stock_move.discount_percent field
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 4 Apr 2015 18:55:46 +0000 (20:55 +0200)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 5 Apr 2015 12:44:30 +0000 (14:44 +0200)
doc/api_changes.txt
includes/db/inventory_db.inc
reporting/rep304.php
reporting/rep306.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 79b41920e9a0b0a814ae278dce2a3c44da3182c7..6839ed30f7d239a7d667baacf0994463edcc3efd 100644 (file)
@@ -15,8 +15,9 @@ Changed functions:
        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="")
+       add_stock_move($type, $stock_id, $trans_no, $location, $date_, $reference, $quantity, $std_cost, $person_id=0, $price=0)
+ sales_db.inc:
+       add_stock_move_customer() removed
 
 Before 2.4:
        get_tax_type_default_rate($type_id)
@@ -79,9 +80,9 @@ Before 2.4:
                $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="")
+               $person_id=0, $price=0)
 Description:
-       Removed parameter $show_or_hide (obsolete after `visible` field removal).
+       Removed parameters $show_or_hide, $discount_percent and $error_msg as obsolete after removal of related stock_moves fields.
 
 Before 2.4:
        get_stock_moves($type, $type_no, $visible=false)
@@ -89,3 +90,11 @@ Now:
        get_stock_moves($type, $type_no)
 Description:
        Removed parameter $visible (obsolete after `visible` field removal).
+
+Before 2.4
+       add_stock_move_customer($type, $stock_id, $trans_id, $location, $date_, $reference,
+               $quantity, $std_cost, $price=0, $discount_percent=0)
+Now:
+       None
+Description:
+       Obsolete and removed.
index 117e318d96d53b590c263407706206527da045ee..b0807f19108ba9267c7e06e1a3eb77b35c34a9dc 100644 (file)
@@ -357,24 +357,18 @@ function handle_negative_inventory($stock_id, $quantity, $standard_cost, $date_)
 // $price - in $person_id's currency
 
 function add_stock_move($type, $stock_id, $trans_no, $location,
-    $date_, $reference, $quantity, $std_cost, $person_id=0,
-    $price=0, $discount_percent=0, $error_msg="")
+    $date_, $reference, $quantity, $std_cost, $person_id=0, $price=0)
 {
        $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, price,
-               discount_percent) VALUES (".db_escape($stock_id)
-               .", ".db_escape($trans_no).", ".db_escape($type)
-               .",     ".db_escape($location).", '$date', "
+               tran_date, person_id, reference, qty, standard_cost, price) 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($price).", ".db_escape($discount_percent).")";
+               .db_escape($quantity).", ".db_escape($std_cost)."," .db_escape($price).")";
 
-       if ($error_msg == "")
-               $error_msg = "The stock movement record cannot be inserted";
-
-       db_query($sql, $error_msg);
+       db_query($sql, "The stock movement record cannot be inserted");
 
        return db_insert_id();
 }
@@ -428,7 +422,6 @@ function void_stock_move($type, $type_no)
                        update_average_material_cost($row["person_id"], $row["stock_id"],
                                $unit_cost, -$row["qty"], sql2date($row["tran_date"]));
                }
-
     }
        $sql = "DELETE FROM ".TB_PREF."stock_moves WHERE type=".db_escape($type)
                ."      AND trans_no=".db_escape($type_no);
index 63c6fc2eb5aa2872ef3021adeb16e2456d27c6c4..4bdedbcb0e90e1b63428b509fa96e856d2be5104 100644 (file)
@@ -33,39 +33,39 @@ function getTransactions($category, $location, $fromcust, $from, $to)
 {
        $from = date2sql($from);
        $to = date2sql($to);
-       $sql = "SELECT ".TB_PREF."stock_master.category_id,
-                       ".TB_PREF."stock_category.description AS cat_description,
-                       ".TB_PREF."stock_master.stock_id,
-                       ".TB_PREF."stock_master.description, ".TB_PREF."stock_master.inactive,
-                       ".TB_PREF."stock_moves.loc_code,
-                       ".TB_PREF."debtor_trans.debtor_no,
-                       ".TB_PREF."debtors_master.name AS debtor_name,
-                       ".TB_PREF."stock_moves.tran_date,
-                       SUM(-".TB_PREF."stock_moves.qty) AS qty,
-                       SUM(-".TB_PREF."stock_moves.qty*".TB_PREF."stock_moves.price*(1-".TB_PREF."stock_moves.discount_percent)) AS amt,
-                       SUM(-IF(".TB_PREF."stock_moves.standard_cost <> 0, ".TB_PREF."stock_moves.qty * ".TB_PREF."stock_moves.standard_cost, ".TB_PREF."stock_moves.qty *(".TB_PREF."stock_master.material_cost + ".TB_PREF."stock_master.labour_cost + ".TB_PREF."stock_master.overhead_cost))) AS cost
-               FROM ".TB_PREF."stock_master,
-                       ".TB_PREF."stock_category,
-                       ".TB_PREF."debtor_trans,
-                       ".TB_PREF."debtors_master,
-                       ".TB_PREF."stock_moves
-               WHERE ".TB_PREF."stock_master.stock_id=".TB_PREF."stock_moves.stock_id
-               AND ".TB_PREF."stock_master.category_id=".TB_PREF."stock_category.category_id
-               AND ".TB_PREF."debtor_trans.debtor_no=".TB_PREF."debtors_master.debtor_no
-               AND ".TB_PREF."stock_moves.type=".TB_PREF."debtor_trans.type
-               AND ".TB_PREF."stock_moves.trans_no=".TB_PREF."debtor_trans.trans_no
-               AND ".TB_PREF."stock_moves.tran_date>='$from'
-               AND ".TB_PREF."stock_moves.tran_date<='$to'
-               AND (".TB_PREF."debtor_trans.type=".ST_CUSTDELIVERY." OR ".TB_PREF."stock_moves.type=".ST_CUSTCREDIT.")
-               AND (".TB_PREF."stock_master.mb_flag='B' OR ".TB_PREF."stock_master.mb_flag='M')";
+       $sql = "SELECT item.category_id,
+                       category.description AS cat_description,
+                       item.stock_id,
+                       item.description, item.inactive,
+                       move.loc_code,
+                       trans.debtor_no,
+                       debtor.name AS debtor_name,
+                       move.tran_date,
+                       SUM(-move.qty) AS qty,
+                       SUM(-move.qty*move.price) AS amt,
+                       SUM(-IF(move.standard_cost <> 0, move.qty * move.standard_cost, move.qty *(item.material_cost + item.labour_cost + item.overhead_cost))) AS cost
+               FROM ".TB_PREF."stock_master item,
+                       ".TB_PREF."stock_category category,
+                       ".TB_PREF."debtor_trans trans,
+                       ".TB_PREF."debtors_master debtor,
+                       ".TB_PREF."stock_moves move
+               WHERE item.stock_id=move.stock_id
+               AND item.category_id=category.category_id
+               AND trans.debtor_no=debtor.debtor_no
+               AND move.type=trans.type
+               AND move.trans_no=trans.trans_no
+               AND move.tran_date>='$from'
+               AND move.tran_date<='$to'
+               AND (trans.type=".ST_CUSTDELIVERY." OR move.type=".ST_CUSTCREDIT.")
+               AND (item.mb_flag='B' OR item.mb_flag='M')";
                if ($category != 0)
-                       $sql .= " AND ".TB_PREF."stock_master.category_id = ".db_escape($category);
+                       $sql .= " AND item.category_id = ".db_escape($category);
                if ($location != '')
-                       $sql .= " AND ".TB_PREF."stock_moves.loc_code = ".db_escape($location);
+                       $sql .= " AND move.loc_code = ".db_escape($location);
                if ($fromcust != '')
-                       $sql .= " AND ".TB_PREF."debtors_master.debtor_no = ".db_escape($fromcust);
-               $sql .= " GROUP BY ".TB_PREF."stock_master.stock_id, ".TB_PREF."debtors_master.name ORDER BY ".TB_PREF."stock_master.category_id,
-                       ".TB_PREF."stock_master.stock_id, ".TB_PREF."debtors_master.name";
+                       $sql .= " AND debtor.debtor_no = ".db_escape($fromcust);
+               $sql .= " GROUP BY item.stock_id, debtor.name ORDER BY item.category_id,
+                       item.stock_id, debtor.name";
     return db_query($sql,"No transactions were returned");
 
 }
index 51806bf6bf669517812898212d044233f00342ae..7e5c56c265e47da0796205c0289130703054911c 100644 (file)
@@ -33,55 +33,55 @@ function getTransactions($category, $location, $fromsupp, $item, $from, $to)
 {
        $from = date2sql($from);
        $to = date2sql($to);
-       $sql = "SELECT ".TB_PREF."stock_master.category_id,
-                       ".TB_PREF."stock_category.description AS cat_description,
-                       ".TB_PREF."stock_master.stock_id,
-                       ".TB_PREF."stock_master.description, ".TB_PREF."stock_master.inactive,
-                       ".TB_PREF."stock_moves.loc_code,
-                       ".TB_PREF."suppliers.supplier_id,
-                       ".TB_PREF."suppliers.supp_name AS supplier_name,
-                       ".TB_PREF."stock_moves.tran_date,
-                       ".TB_PREF."stock_moves.qty AS qty,
-                       ".TB_PREF."stock_moves.price*(1-".TB_PREF."stock_moves.discount_percent) AS price
-               FROM ".TB_PREF."stock_master,
-                       ".TB_PREF."stock_category,
-                       ".TB_PREF."suppliers,
-                       ".TB_PREF."stock_moves
-               WHERE ".TB_PREF."stock_master.stock_id=".TB_PREF."stock_moves.stock_id
-               AND ".TB_PREF."stock_master.category_id=".TB_PREF."stock_category.category_id
-               AND ".TB_PREF."stock_moves.person_id=".TB_PREF."suppliers.supplier_id
-               AND ".TB_PREF."stock_moves.tran_date>='$from'
-               AND ".TB_PREF."stock_moves.tran_date<='$to'
-               AND (".TB_PREF."stock_moves.type=".ST_SUPPRECEIVE." OR ".TB_PREF."stock_moves.type=".ST_SUPPCREDIT.")
-               AND (".TB_PREF."stock_master.mb_flag='B' OR ".TB_PREF."stock_master.mb_flag='M')";
+       $sql = "SELECT item.category_id,
+                       category.description AS cat_description,
+                       item.stock_id,
+                       item.description, item.inactive,
+                       move.loc_code,
+                       supplier.supplier_id,
+                       supplier.supp_name AS supplier_name,
+                       move.tran_date,
+                       move.qty AS qty,
+                       move.price
+               FROM ".TB_PREF."stock_master item,
+                       ".TB_PREF."stock_category category,
+                       ".TB_PREF."suppliers supplier,
+                       ".TB_PREF."stock_moves move
+               WHERE item.stock_id=move.stock_id
+               AND item.category_id=category.category_id
+               AND move.person_id=supplier.supplier_id
+               AND move.tran_date>='$from'
+               AND move.tran_date<='$to'
+               AND (move.type=".ST_SUPPRECEIVE." OR move.type=".ST_SUPPCREDIT.")
+               AND (item.mb_flag='B' OR item.mb_flag='M')";
                if ($category != 0)
-                       $sql .= " AND ".TB_PREF."stock_master.category_id = ".db_escape($category);
+                       $sql .= " AND item.category_id = ".db_escape($category);
                if ($location != '')
-                       $sql .= " AND ".TB_PREF."stock_moves.loc_code = ".db_escape($location);
+                       $sql .= " AND move.loc_code = ".db_escape($location);
                if ($fromsupp != '')
-                       $sql .= " AND ".TB_PREF."suppliers.supplier_id = ".db_escape($fromsupp);
+                       $sql .= " AND supplier.supplier_id = ".db_escape($fromsupp);
                if ($item != '')
-                       $sql .= " AND ".TB_PREF."stock_master.stock_id = ".db_escape($item);
-               $sql .= " ORDER BY ".TB_PREF."stock_master.category_id,
-                       ".TB_PREF."suppliers.supp_name, ".TB_PREF."stock_master.stock_id, ".TB_PREF."stock_moves.tran_date";
+                       $sql .= " AND item.stock_id = ".db_escape($item);
+               $sql .= " ORDER BY item.category_id,
+                       supplier.supp_name, item.stock_id, move.tran_date";
     return db_query($sql,"No transactions were returned");
 
 }
 
 function get_supp_inv_reference($supplier_id, $stock_id, $date)
 {
-       $sql = "SELECT ".TB_PREF."supp_trans.supp_reference
-               FROM ".TB_PREF."supp_trans,
-                       ".TB_PREF."supp_invoice_items,
-                       ".TB_PREF."grn_batch,
-                       ".TB_PREF."grn_items
-               WHERE ".TB_PREF."supp_trans.type=".TB_PREF."supp_invoice_items.supp_trans_type
-               AND ".TB_PREF."supp_trans.trans_no=".TB_PREF."supp_invoice_items.supp_trans_no
-               AND ".TB_PREF."grn_items.grn_batch_id=".TB_PREF."grn_batch.id
-               AND ".TB_PREF."grn_items.item_code=".TB_PREF."supp_invoice_items.stock_id
-               AND ".TB_PREF."supp_trans.supplier_id=".db_escape($supplier_id)."
-               AND ".TB_PREF."supp_invoice_items.stock_id=".db_escape($stock_id)."
-               AND ".TB_PREF."supp_trans.tran_date=".db_escape($date);
+       $sql = "SELECT trans.supp_reference
+               FROM ".TB_PREF."supp_trans trans,
+                       ".TB_PREF."supp_invoice_items line,
+                       ".TB_PREF."grn_batch batch,
+                       ".TB_PREF."grn_items item
+               WHERE trans.type=line.supp_trans_type
+               AND trans.trans_no=line.supp_trans_no
+               AND item.grn_batch_id=batch.id
+               AND item.item_code=line.stock_id
+               AND trans.supplier_id=".db_escape($supplier_id)."
+               AND line.stock_id=".db_escape($stock_id)."
+               AND trans.tran_date=".db_escape($date);
     $result = db_query($sql,"No transactions were returned");
     $row = db_fetch_row($result);
     if (isset($row[0]))
index 75c91fe17d1b6b0bbff0b99711cd941eb7f5bf43..25fe3fc280ba95b28230cf35a2f87639ebadb3c8 100644 (file)
@@ -125,7 +125,7 @@ function write_credit_note(&$credit_note, $write_off_acc)
 
                if ($credit_type == 'Return')
                        add_credit_movements_item($credit_note, $credit_line,
-                               $credit_type, $line_taxfree_price+$line_tax, $credit_invoice);
+                               $credit_type, ($line_taxfree_price+$line_tax)*(1-$credit_line->discount_percent), $credit_invoice);
 
                $total += add_gl_trans_credit_costs($credit_note, $credit_line, $credit_no,
                    $credit_date, $credit_type, $write_off_acc, $branch_data);
@@ -189,13 +189,12 @@ function add_credit_movements_item(&$credit_note, &$credit_line,
        $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, $price,
-           $credit_line->discount_percent);
+           add_stock_move(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);
+       }
 }
 
 //----------------------------------------------------------------------------------------
index f1c15fd2f508b5198d7d7d114b70c9d317356092..434401326d021da64121b45903f08150e81d6dde 100644 (file)
@@ -94,10 +94,10 @@ function write_sales_delivery(&$delivery,$bo_policy)
                                $delivery_line->qty_dispatched-$delivery_line->qty_old);
 
                if ($delivery_line->qty_dispatched != 0) {
-                       add_stock_move_customer(ST_CUSTDELIVERY, $delivery_line->stock_id, $delivery_no,
+                       add_stock_move(ST_CUSTDELIVERY, $delivery_line->stock_id, $delivery_no,
                                $delivery->Location, $delivery->document_date, $delivery->reference,
-                               -$delivery_line->qty_dispatched, $delivery_line->standard_cost,
-                               $line_price, $delivery_line->discount_percent);
+                               -$delivery_line->qty_dispatched, $delivery_line->standard_cost, 0,
+                                $line_price*(1-$delivery_line->discount_percent));
 
                        $stock_gl_code = get_stock_gl_code($delivery_line->stock_id);
 
index 9a63833e35c7f7b64a656b89262c137290355b75..965238f7b85596ca4fa6c6ab20120c12b631b7c7 100644 (file)
@@ -27,21 +27,6 @@ include_once($path_to_root . "/sales/includes/db/payment_db.inc");
 include_once($path_to_root . "/sales/includes/db/branches_db.inc");
 include_once($path_to_root . "/sales/includes/db/customers_db.inc");
 
-//----------------------------------------------------------------------------------------
-// $price in customer's currency
-// $quantity is used as is (if it's neg it's neg, if it's pos it's pos)
-// $std_cost is in home currency
-// $show_or_hide 1 show this item in invoice/credit views, 0 to hide it (used for write-off items)
-// $type is 10 (invoice) or 11 (credit)
-
-function add_stock_move_customer($type, $stock_id, $trans_id, $location, $date_, $reference,
-       $quantity, $std_cost, $price=0, $discount_percent=0)
-{
-       return add_stock_move($type, $stock_id, $trans_id, $location, $date_, $reference,
-               $quantity, $std_cost, 0, $price, $discount_percent,
-               "The customer stock movement record cannot be inserted");
-}
-
 //----------------------------------------------------------------------------------------
 // add a debtor-related gl transaction
 // $date_ is display date (non-sql)
index df69f877157a714ab6b387f52a5dc08505487321..aabaed559921e4fd40d072835c892a38a36a7309 100644 (file)
@@ -231,3 +231,8 @@ DELETE moves
        WHERE moves.`type`=11;
 
 ALTER TABLE `0_stock_moves` DROP COLUMN `visible`;
+# stock_moves.discount_percent field are obsolete
+
+UPDATE `0_stock_moves` SET
+       price = price*(1-discount_percent);
+ALTER TABLE `0_stock_moves` DROP COLUMN `discount_percent`;
index 574d5cd4ba91be759eddae99b934ea08ef9ea56d..4d04e82ea7d7a0c89bdba9c36f7c01b726eafdd0 100644 (file)
@@ -1837,7 +1837,6 @@ CREATE TABLE `0_stock_moves` (
   `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`),
@@ -1849,42 +1848,42 @@ CREATE TABLE `0_stock_moves` (
 --
 
 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');
+('1', '1', '102', '25', 'DEF', '2009-06-21', '2', '10', '', '100', '10'),
+('2', '1', '103', '25', 'DEF', '2009-06-21', '2', '11', '', '100', '11'),
+('3', '1', '104', '25', 'DEF', '2009-06-21', '2', '12', '', '100', '12'),
+('4', '1', '102', '26', 'DEF', '2009-06-21', '0', '0', '1', '-10', '0'),
+('5', '1', '103', '26', 'DEF', '2009-06-21', '0', '0', '1', '-10', '0'),
+('6', '1', '104', '26', 'DEF', '2009-06-21', '0', '0', '1', '-10', '0'),
+('7', '1', '3400', '26', 'DEF', '2009-06-21', '0', '0', '1', '10', '0'),
+('8', '2', '102', '13', 'DEF', '2009-06-21', '0', '30.4', '1', '-2', '10'),
+('9', '3', '102', '13', 'DEF', '2009-06-21', '0', '50', 'auto', '-1', '10'),
+('10', '4', '102', '13', 'DEF', '2009-06-21', '0', '35.89', 'auto', '-1', '10'),
+('11', '3', '102', '26', 'DEF', '2009-06-21', '0', '0', '3', '-2', '0'),
+('12', '3', '103', '26', 'DEF', '2009-06-21', '0', '0', '3', '-2', '0'),
+('13', '3', '104', '26', 'DEF', '2009-06-21', '0', '0', '3', '-2', '0'),
+('14', '3', '3400', '26', 'DEF', '2009-06-21', '0', '0', '3', '2', '0'),
+('15', '4', '102', '26', 'DEF', '2009-06-21', '0', '0', '4', '-4', '0'),
+('16', '4', '103', '26', 'DEF', '2009-06-21', '0', '0', '4', '-4', '0'),
+('17', '4', '104', '26', 'DEF', '2009-06-21', '0', '0', '4', '-4', '0'),
+('18', '4', '3400', '26', 'DEF', '2009-06-21', '0', '0', '4', '4', '0'),
+('19', '2', '102', '26', 'DEF', '2009-06-21', '0', '0', '', '-2', '0'),
+('20', '2', '103', '26', 'DEF', '2009-06-21', '0', '0', '', '-2', '0'),
+('21', '2', '104', '26', 'DEF', '2009-06-21', '0', '0', '', '-2', '0'),
+('22', '1', '3400', '29', 'DEF', '2009-06-21', '0', '0', '', '2', '0'),
+('23', '5', '102', '26', 'DEF', '2009-06-21', '0', '0', '5', '-5', '0'),
+('24', '5', '103', '26', 'DEF', '2009-06-21', '0', '0', '5', '-5', '0'),
+('25', '5', '104', '26', 'DEF', '2009-06-21', '0', '0', '5', '-5', '0'),
+('26', '5', '3400', '26', 'DEF', '2009-06-21', '0', '0', '5', '5', '0'),
+('27', '6', '102', '26', 'DEF', '2009-06-21', '0', '0', '6', '5', '0'),
+('28', '6', '103', '26', 'DEF', '2009-06-21', '0', '0', '6', '5', '0'),
+('29', '6', '104', '26', 'DEF', '2009-06-21', '0', '0', '6', '5', '0'),
+('30', '6', '3400', '26', 'DEF', '2009-06-21', '0', '0', '6', '-5', '0'),
+('31', '7', '102', '26', 'DEF', '2009-06-21', '0', '0', '7', '2', '0'),
+('32', '7', '103', '26', 'DEF', '2009-06-21', '0', '0', '7', '2', '0'),
+('33', '7', '104', '26', 'DEF', '2009-06-21', '0', '0', '7', '2', '0'),
+('34', '7', '3400', '26', 'DEF', '2009-06-21', '0', '0', '7', '-2', '0'),
+('35', '5', '102', '13', 'DEF', '2009-06-21', '0', '50', 'auto', '-1', '10'),
+('36', '3', '102', '11', 'DEF', '2009-06-21', '0', '37.68', 'Return Ex Inv: 18', '1', '10');
 
 ### Structure of table `0_supp_allocations` ###
 
index 9904b0c4f99e480edd382898e173849857d42411..802ccfdf8a383bfa08a44a40313ebafcc50f691e 100644 (file)
@@ -1644,7 +1644,6 @@ CREATE TABLE `0_stock_moves` (
   `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`),