X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sql%2Falter2.2.php;h=3f557aae94edebca3bcfc1b8b41977e773535352;hb=c4eae7a18f0eb824e6eda7be2ba6fa820e9e58c9;hp=7a9ca410205c82f3c2008260db660fcfb33c3969;hpb=2250f142e1034dc28adb819c4d8f7cce05911489;p=fa-stable.git diff --git a/sql/alter2.2.php b/sql/alter2.2.php index 7a9ca410..3f557aae 100644 --- a/sql/alter2.2.php +++ b/sql/alter2.2.php @@ -20,8 +20,16 @@ class fa2_2 { function install($pref, $force) { global $db; - - return true; + // set item category dflt accounts to values from company GL setup + $prefs = get_company_prefs(); + $sql = "UPDATE {$pref}stock_category SET " + ."dflt_sales_act = '" . $prefs['default_inv_sales_act'] . "'," + ."dflt_cogs_act = '". $prefs['default_cogs_act'] . "'," + ."dflt_inventory_act = '" . $prefs['default_inventory_act'] . "'," + ."dflt_adjustment_act = '" . $prefs['default_adj_act'] . "'," + ."dflt_assembly_act = '" . $prefs['default_assembly_act']."'"; + $ret = db_query($sql, "Cannot update category default GL accounts"); + return $ret; } // // Checking before install @@ -35,6 +43,7 @@ class fa2_2 { // function installed($pref) { if (check_table($pref, 'company', 'default_delivery_required')) return false; + if (check_table($pref, 'stock_category', 'dflt_dim2')) return false; return true; } };