<?php
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU Affero General Public License,
+ AGPL, as published by the Free Software Foundation, either version
+ 3 of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+***********************************************************************/
class fa2_1 {
var $version = '2.1'; // version installed
var $description = 'Version 2.1';
}
}
// copy all item codes from stock_master into item_codes
- $sql = "SELECT `stock_id`,`description` FROM `".$pref."stock_master`";
+ $sql = "SELECT `stock_id`,`description`,`category_id` FROM ".$pref."stock_master";
$result = db_query($sql);
if (!$result) {
display_error(_("Cannot select stock identificators")
} else {
while ($row = db_fetch_assoc($result)) {
$sql = "INSERT IGNORE "
- .$pref."item_codes (`item_code`,`stock_id`,`description`)
+ .$pref."item_codes (`item_code`,`stock_id`,`description`,`category_id`)
VALUES('".$row['stock_id']."','".$row['stock_id']."','"
- .$row['description']."')";
+ .$row['description']."','".$row['category_id']."')";
$res2 = db_query($sql);
if (!$res2) {
display_error(_("Cannot insert stock id into item_codes")
function installed($pref) {
if (check_table($pref, 'item_codes')) return false;
if (check_table($pref, 'company', 'foreign_codes')) return false;
+ if (check_table($pref, 'supplier', 'credit_limit') return false;
return true;
}
};