mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-02-24 02:46:56 -05:00
code comments, various bits and bobs (#116)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -226,8 +226,8 @@ class Receiving_lib
|
||||
}
|
||||
|
||||
$this->set_cart($items);
|
||||
return true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function edit_item($line,$description,$serialnumber,$quantity,$discount,$price)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,17 +30,17 @@
|
||||
<div class="form_field_label"><?php echo $this->lang->line('login_username'); ?>: </div>
|
||||
<div class="form_field">
|
||||
<?php echo form_input(array(
|
||||
'name'=>'username',
|
||||
'id'=>'username',
|
||||
'size'=>'20')); ?>
|
||||
'name'=>'username',
|
||||
'id'=>'username',
|
||||
'size'=>'20')); ?>
|
||||
</div>
|
||||
|
||||
<div class="form_field_label"><?php echo $this->lang->line('login_password'); ?>: </div>
|
||||
<div class="form_field">
|
||||
<?php echo form_password(array(
|
||||
'name'=>'password',
|
||||
'id' => 'password',
|
||||
'size'=>'20')); ?>
|
||||
'name'=>'password',
|
||||
'id' => 'password',
|
||||
'size'=>'20')); ?>
|
||||
</div>
|
||||
|
||||
<input class="btn btn-primary btn-block" type="submit" name="loginButton" value="Go"/>
|
||||
|
||||
Reference in New Issue
Block a user