diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 99c3f645d..9dcd1f4de 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -14,6 +14,7 @@ class Config extends Secure_area $data['stock_locations'] = $this->Stock_location->get_all()->result_array(); $data['support_barcode'] = $this->barcode_lib->get_list_barcodes(); $data['logo_exists'] = $this->Appconfig->get('company_logo') != ''; + $this->load->view("configs/manage", $data); } @@ -80,12 +81,14 @@ class Config extends Secure_area $result = $this->Appconfig->batch_save( $batch_save_data ); $success = $result ? true : false; + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } function stock_locations() { $stock_locations = $this->Stock_location->get_all()->result_array(); + $this->load->view('partial/stock_locations', array('stock_locations' => $stock_locations)); } @@ -124,7 +127,9 @@ class Config extends Secure_area { $this->Stock_location->delete($location_id); } + $success = $this->db->trans_complete(); + echo json_encode(array('success'=>$success,'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } @@ -149,6 +154,7 @@ class Config extends Secure_area $result = $this->Appconfig->batch_save( $batch_save_data ); $success = $result ? true : false; + echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully'))); } @@ -176,7 +182,8 @@ class Config extends Secure_area public function remove_logo() { - $result = $this->Appconfig->batch_save(array('company_logo' => ''));; + $result = $this->Appconfig->batch_save(array('company_logo' => '')); + echo json_encode(array('success' => $result)); } diff --git a/application/libraries/Receiving_lib.php b/application/libraries/Receiving_lib.php index c4b0be7c9..d2044a3f9 100644 --- a/application/libraries/Receiving_lib.php +++ b/application/libraries/Receiving_lib.php @@ -226,8 +226,8 @@ class Receiving_lib } $this->set_cart($items); - return true; + return true; } function edit_item($line,$description,$serialnumber,$quantity,$discount,$price) diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index 8861238b9..828e9536a 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -66,7 +66,6 @@ class Sale_lib { $this->CI->session->set_userdata('sales_invoice_number', $invoice_number); } - } function clear_invoice_number() @@ -133,8 +132,8 @@ class Sale_lib } $this->set_payments( $payments ); + return true; - } // Multiple Payments @@ -331,8 +330,8 @@ class Sale_lib } $this->set_cart($items); + return true; - } function out_of_stock($item_id,$item_location) @@ -356,6 +355,7 @@ class Sale_lib { return $this->CI->lang->line('sales_quantity_less_than_reorder_level'); } + return false; } @@ -426,6 +426,7 @@ class Sale_lib return true; } } + return false; } @@ -589,6 +590,7 @@ class Sale_lib $discount = bcadd($discount, $item_discount, PRECISION); } } + return $discount; } @@ -618,8 +620,10 @@ class Sale_lib if ($include_discount) { $discount_amount = $this->get_item_discount($quantity, $price, $discount_percentage); + return bcsub($total, $discount_amount, PRECISION); } + return $total; } @@ -627,6 +631,7 @@ class Sale_lib { $total = bcmul($quantity, $price, PRECISION); $discount_fraction = bcdiv($discount_percentage, 100, PRECISION); + return bcmul($total, $discount_fraction, PRECISION); } @@ -642,6 +647,7 @@ class Sale_lib return bcsub($price, $price_tax_excl, PRECISION); } $tax_fraction = bcdiv($tax_percentage, 100, PRECISION); + return bcmul($price, $tax_fraction, PRECISION); } @@ -659,6 +665,7 @@ class Sale_lib $subtotal = bcadd($subtotal, $this->get_item_total($item['quantity'], $item['price'], $item['discount'], $include_discount), PRECISION); } } + return $subtotal; } @@ -688,6 +695,7 @@ class Sale_lib if(!$item_id) return false; } + return true; } } diff --git a/application/views/login.php b/application/views/login.php index cbf881fc7..884933fc4 100644 --- a/application/views/login.php +++ b/application/views/login.php @@ -30,17 +30,17 @@
lang->line('login_username'); ?>:
'username', - 'id'=>'username', - 'size'=>'20')); ?> + 'name'=>'username', + 'id'=>'username', + 'size'=>'20')); ?>
lang->line('login_password'); ?>:
'password', - 'id' => 'password', - 'size'=>'20')); ?> + 'name'=>'password', + 'id' => 'password', + 'size'=>'20')); ?>