diff --git a/application/models/receiving.php b/application/models/receiving.php index 7b7ac409c..b6ee9c13f 100644 --- a/application/models/receiving.php +++ b/application/models/receiving.php @@ -213,7 +213,7 @@ class Receiving extends CI_Model //We create a temp table that allows us to do easy report/receiving queries public function create_receivings_items_temp_table() { - $this->db->query("CREATE TEMPORARY TABLE ".$this->db->dbprefix('receivings_items_temp')." + $this->db->query("CREATE TEMPORARY TABLE IF NOT EXISTS ".$this->db->dbprefix('receivings_items_temp')." (SELECT date(receiving_time) as receiving_date, ".$this->db->dbprefix('receivings_items').".receiving_id, comment, item_location, invoice_number, payment_type, employee_id, ".$this->db->dbprefix('items').".item_id, ".$this->db->dbprefix('receivings').".supplier_id, quantity_purchased, ".$this->db->dbprefix('receivings_items').".receiving_quantity, item_cost_price, item_unit_price, discount_percent, (item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100) as subtotal, diff --git a/application/models/sale.php b/application/models/sale.php index 167cdaa41..ad4e6fc33 100644 --- a/application/models/sale.php +++ b/application/models/sale.php @@ -395,7 +395,7 @@ class Sale extends CI_Model $subtotal = "1"; } - $this->db->query("CREATE TEMPORARY TABLE ".$this->db->dbprefix('sales_items_temp')." + $this->db->query("CREATE TEMPORARY TABLE IF NOT EXISTS ".$this->db->dbprefix('sales_items_temp')." (SELECT date(sale_time) as sale_date, sale_time, ".$this->db->dbprefix('sales_items').".sale_id, comment,payments.payment_type, item_location, customer_id, employee_id, ".$this->db->dbprefix('items').".item_id, supplier_id, quantity_purchased, item_cost_price, item_unit_price, SUM(percent) as item_tax_percent, discount_percent, ROUND((item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100)*$subtotal,2) as subtotal, diff --git a/system/language/es/db_lang.php b/system/language/es/db_lang.php new file mode 100644 index 000000000..ceaaf20b1 --- /dev/null +++ b/system/language/es/db_lang.php @@ -0,0 +1,29 @@ +