Fix temporal dependency in migration

This commit is contained in:
jekkos
2018-11-04 18:53:25 +01:00
committed by jekkos
parent db6963a8a6
commit 465a2c29d5
2 changed files with 5 additions and 5 deletions

View File

@@ -36,9 +36,9 @@ class Migration_Sales_Tax_Data extends CI_Migration
private function upgrade_tax_history_for_sale($sale_id)
{
$CI =& get_instance();
$tax_decimals = $CI->config->config['tax_decimals'];
$tax_included = $CI->config->config['tax_included'];
$customer_sales_tax_support = $CI->config->config['customer_sales_tax_support'];
$tax_decimals = $CI->Appconfig->get('tax_decimals', 2);
$tax_included = $CI->Appconfig->get('tax_included', 0);
$customer_sales_tax_support = $CI->Appconfig->get('customer_sales_tax_support', 0);
if($tax_included)
{

View File

@@ -22,7 +22,7 @@ class Appconfig extends CI_Model
return $this->db->get();
}
public function get($key)
public function get($key, $default = '')
{
$query = $this->db->get_where('app_config', array('key' => $key), 1);
@@ -31,7 +31,7 @@ class Appconfig extends CI_Model
return $query->row()->value;
}
return '';
return $default;
}
public function save($key, $value)