Ejemplo n.º 1
0
					<span class="input-group-addon input-sm">%</span>
				</div>
			</div>

			<div class="form-group form-group-sm">	
				<?php 
echo form_label($this->lang->line('config_default_tax_rate_2'), 'default_tax_2_rate', array('class' => 'control-label col-xs-2'));
?>
				<div class='col-xs-2'>
					<?php 
echo form_input(array('name' => 'default_tax_2_name', 'id' => 'default_tax_2_name', 'class' => 'form-control input-sm', 'value' => $this->config->item('default_tax_2_name') !== FALSE ? $this->config->item('default_tax_2_name') : $this->lang->line('items_sales_tax_2')));
?>
				</div>
				<div class="col-xs-1 input-group">
					<?php 
echo form_input(array('name' => 'default_tax_2_rate', 'id' => 'default_tax_2_rate', 'class' => 'form-control input-sm', 'value' => to_tax_decimals($this->config->item('default_tax_2_rate'))));
?>
					<span class="input-group-addon input-sm">%</span>
				</div>
			</div>

			<div class="form-group form-group-sm">	
				<?php 
echo form_label($this->lang->line('config_tax_included'), 'tax_included', array('class' => 'control-label col-xs-2'));
?>
				<div class='col-xs-2'>
					<?php 
echo form_checkbox(array('name' => 'tax_included', 'id' => 'tax_included', 'value' => 'tax_included', 'checked' => $this->config->item('tax_included')));
?>
				</div>
			</div>
Ejemplo n.º 2
0
function get_item_data_row($item, $controller)
{
    $CI =& get_instance();
    $item_tax_info = $CI->Item_taxes->get_info($item->item_id);
    $tax_percents = '';
    foreach ($item_tax_info as $tax_info) {
        $tax_percents .= to_tax_decimals($tax_info['percent']) . '%, ';
    }
    // remove ', ' from last item
    $tax_percents = substr($tax_percents, 0, -2);
    $controller_name = strtolower(get_class($CI));
    $image = '';
    if (!empty($item->pic_id)) {
        $images = glob("uploads/item_pics/" . $item->pic_id . ".*");
        if (sizeof($images) > 0) {
            $image .= '<a class="rollover" href="' . base_url($images[0]) . '"><img src="' . site_url('items/pic_thumb/' . $item->pic_id) . '"></a>';
        }
    }
    return array('items.item_id' => $item->item_id, 'item_number' => $item->item_number, 'name' => $item->name, 'category' => $item->category, 'company_name' => $item->company_name, 'cost_price' => to_currency($item->cost_price), 'unit_price' => to_currency($item->unit_price), 'quantity' => to_quantity_decimals($item->quantity), 'tax_percents' => !$tax_percents ? '-' : $tax_percents, 'item_pic' => $image, 'inventory' => anchor($controller_name . "/inventory/{$item->item_id}", '<span class="glyphicon glyphicon-pushpin"></span>', array('class' => 'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title' => $CI->lang->line($controller_name . '_count'))), 'stock' => anchor($controller_name . "/count_details/{$item->item_id}", '<span class="glyphicon glyphicon-list-alt"></span>', array('class' => 'modal-dlg', 'title' => $CI->lang->line($controller_name . '_details_count'))), 'edit' => anchor($controller_name . "/view/{$item->item_id}", '<span class="glyphicon glyphicon-edit"></span>', array('class' => 'modal-dlg', 'data-btn-submit' => $CI->lang->line('common_submit'), 'title' => $CI->lang->line($controller_name . '_update'))));
}
Ejemplo n.º 3
0
 public function get_taxes()
 {
     $taxes = array();
     //Do not charge sales tax if we have a customer that is not taxable
     if ($this->is_customer_taxable()) {
         foreach ($this->get_cart() as $line => $item) {
             $tax_info = $this->CI->Item_taxes->get_info($item['item_id']);
             foreach ($tax_info as $tax) {
                 $name = to_tax_decimals($tax['percent']) . '% ' . $tax['name'];
                 $tax_amount = $this->get_item_tax($item['quantity'], $item['price'], $item['discount'], $tax['percent']);
                 if (!isset($taxes[$name])) {
                     $taxes[$name] = 0;
                 }
                 $taxes[$name] = bcadd($taxes[$name], $tax_amount);
             }
         }
     }
     return $taxes;
 }
Ejemplo n.º 4
0
			</div>
		</div>

		<div class="form-group form-group-sm">
			<?php 
echo form_label($this->lang->line('items_tax_2'), 'tax_percent_2', array('class' => 'control-label col-xs-3'));
?>
			<div class='col-xs-4'>
				<?php 
echo form_input(array('name' => 'tax_names[]', 'id' => 'tax_name_2', 'class' => 'form-control input-sm', 'value' => isset($item_tax_info[1]['name']) ? $item_tax_info[1]['name'] : $this->config->item('default_tax_2_name')));
?>
			</div>
			<div class="col-xs-4">
				<div class="input-group input-group-sm">
					<?php 
echo form_input(array('name' => 'tax_percents[]', 'class' => 'form-control input-sm', 'id' => 'tax_percent_name_2', 'value' => isset($item_tax_info[1]['percent']) ? to_tax_decimals($item_tax_info[1]['percent']) : to_tax_decimals($default_tax_2_rate)));
?>
					<span class="input-group-addon input-sm"><b>%</b></span>
				</div>
			</div>
		</div>

		<?php 
foreach ($stock_locations as $key => $location_detail) {
    ?>
			<div class="form-group form-group-sm">
				<?php 
    echo form_label($this->lang->line('items_quantity') . ' ' . $location_detail['location_name'], 'quantity_' . $key, array('class' => 'required control-label col-xs-3'));
    ?>
				<div class='col-xs-4'>
					<?php