mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-11 18:38:08 -04:00
add configurable quantity decimals (#429)
This commit is contained in:
@@ -33,7 +33,7 @@ IndexIgnore *
|
||||
|
||||
# prevent access to generate_languages.php
|
||||
<Files generate_languages.php>
|
||||
order allow,deny
|
||||
order deny,allow
|
||||
deny from all
|
||||
allow from 127.0.0.1
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ $autoload['drivers'] = array();
|
||||
|
|
||||
| $autoload['helper'] = array('url', 'file');
|
||||
*/
|
||||
$autoload['helper'] = array('form', 'url', 'table', 'text', 'currency', 'html', 'download', 'directory', 'dateformat_helper');
|
||||
$autoload['helper'] = array('form', 'url', 'table', 'text', 'currency', 'html', 'download', 'directory', 'dateformat', 'quantity');
|
||||
|
||||
/*
|
||||
| -------------------------------------------------------------------
|
||||
|
||||
@@ -76,7 +76,8 @@ class Config extends Secure_area
|
||||
'dateformat'=>$this->input->post('dateformat'),
|
||||
'timeformat'=>$this->input->post('timeformat'),
|
||||
'thousands_separator'=>$this->input->post('thousands_separator'),
|
||||
'decimal_point'=>$this->input->post('decimal_point')
|
||||
'decimal_point'=>$this->input->post('decimal_point'),
|
||||
'quantity_decimals'=>$this->input->post('quantity_decimals')
|
||||
);
|
||||
|
||||
$result = $this->Appconfig->batch_save( $batch_save_data );
|
||||
|
||||
@@ -193,7 +193,7 @@ class Items extends Secure_area implements iData_controller
|
||||
foreach($locations_data as $location)
|
||||
{
|
||||
$quantity = $this->Item_quantity->get_item_quantity($item_id,$location['location_id'])->quantity;
|
||||
$quantity = ($item_id == -1) ? null: $quantity;
|
||||
$quantity = ($item_id == -1) ? 0 : $quantity;
|
||||
$location_array[$location['location_id']] = array('location_name'=>$location['location_name'], 'quantity'=>$quantity);
|
||||
$data['stock_locations'] = $location_array;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ class Reports extends Secure_area
|
||||
|
||||
foreach($report_data as $row)
|
||||
{
|
||||
$tabular_data[] = array($row['sale_date'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
$tabular_data[] = array($row['sale_date'], to_quantity($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
}
|
||||
|
||||
$data = array(
|
||||
@@ -128,7 +128,7 @@ class Reports extends Secure_area
|
||||
|
||||
foreach($report_data as $row)
|
||||
{
|
||||
$tabular_data[] = array($row['category'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
$tabular_data[] = array($row['category'], to_quantity($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
}
|
||||
|
||||
$data = array(
|
||||
@@ -153,7 +153,7 @@ class Reports extends Secure_area
|
||||
|
||||
foreach($report_data as $row)
|
||||
{
|
||||
$tabular_data[] = array($row['customer'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
$tabular_data[] = array($row['customer'], to_quantity($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
}
|
||||
|
||||
$data = array(
|
||||
@@ -178,7 +178,7 @@ class Reports extends Secure_area
|
||||
|
||||
foreach($report_data as $row)
|
||||
{
|
||||
$tabular_data[] = array($row['supplier'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
$tabular_data[] = array($row['supplier'], to_quantity($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
}
|
||||
|
||||
$data = array(
|
||||
@@ -203,7 +203,7 @@ class Reports extends Secure_area
|
||||
|
||||
foreach($report_data as $row)
|
||||
{
|
||||
$tabular_data[] = array(character_limiter($row['name'], 40), $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
$tabular_data[] = array(character_limiter($row['name'], 40), to_quantity($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
}
|
||||
|
||||
$data = array(
|
||||
@@ -228,7 +228,7 @@ class Reports extends Secure_area
|
||||
|
||||
foreach($report_data as $row)
|
||||
{
|
||||
$tabular_data[] = array($row['employee'], $row['quantity_purchased'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
$tabular_data[] = array($row['employee'], to_quantity($row['quantity_purchased']), to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']));
|
||||
}
|
||||
|
||||
$data = array(
|
||||
@@ -718,11 +718,11 @@ class Reports extends Secure_area
|
||||
|
||||
foreach($report_data['summary'] as $key=>$row)
|
||||
{
|
||||
$summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], $row['items_purchased'], $row['employee_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']);
|
||||
$summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], to_quantity($row['items_purchased']), $row['employee_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']);
|
||||
|
||||
foreach($report_data['details'][$key] as $drow)
|
||||
{
|
||||
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%');
|
||||
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -768,11 +768,11 @@ class Reports extends Secure_area
|
||||
|
||||
foreach($report_data['summary'] as $key=>$row)
|
||||
{
|
||||
$summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], $row['items_purchased'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']);
|
||||
$summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], to_quantity($row['items_purchased']), $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']);
|
||||
|
||||
foreach($report_data['details'][$key] as $drow)
|
||||
{
|
||||
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%');
|
||||
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']), to_currency($drow['cost']), to_currency($drow['profit']), $drow['discount_percent'].'%');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -818,11 +818,11 @@ class Reports extends Secure_area
|
||||
|
||||
foreach($report_data['summary'] as $key=>$row)
|
||||
{
|
||||
$summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], $row['items_purchased'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),/*to_currency($row['profit']),*/ $row['payment_type'], $row['comment']);
|
||||
$summary_data[] = array(anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target' => '_blank')), $row['sale_date'], to_quantity($row['items_purchased']), $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']),/*to_currency($row['profit']),*/ $row['payment_type'], $row['comment']);
|
||||
|
||||
foreach($report_data['details'][$key] as $drow)
|
||||
{
|
||||
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], $drow['quantity_purchased'], to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),/*to_currency($drow['profit']),*/ $drow['discount_percent'].'%');
|
||||
$details_data[$key][] = array($drow['name'], $drow['category'], $drow['serialnumber'], $drow['description'], to_quantity($drow['quantity_purchased']), to_currency($drow['subtotal']), to_currency($drow['total']), to_currency($drow['tax']),/*to_currency($drow['profit']),*/ $drow['discount_percent'].'%');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -856,11 +856,11 @@ class Reports extends Secure_area
|
||||
|
||||
foreach($report_data['summary'] as $key=>$row)
|
||||
{
|
||||
$summary_data[] = array(anchor('sales/edit/'.$row['sale_id'], 'POS '.$row['sale_id'], array('class' => 'modal-dlg modal-btn-submit')), $row['sale_date'], $row['items_purchased'], $row['employee_name'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']);
|
||||
$summary_data[] = array(anchor('sales/edit/'.$row['sale_id'], 'POS '.$row['sale_id'], array('class' => 'modal-dlg modal-btn-submit')), $row['sale_date'], to_quantity($row['items_purchased']), $row['employee_name'], $row['customer_name'], to_currency($row['subtotal']), to_currency($row['total']), to_currency($row['tax']), to_currency($row['cost']), to_currency($row['profit']), $row['payment_type'], $row['comment']);
|
||||
|
||||
foreach($report_data['details'][$key] as $drow)
|
||||
{
|
||||
$quantity_purchased = $drow['quantity_purchased'];
|
||||
$quantity_purchased = to_quantity($drow['quantity_purchased']);
|
||||
if ($show_locations)
|
||||
{
|
||||
$quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']';
|
||||
@@ -899,11 +899,11 @@ class Reports extends Secure_area
|
||||
|
||||
foreach($report_data['summary'] as $key=>$row)
|
||||
{
|
||||
$summary_data[] = array(anchor('receivings/edit/'.$row['receiving_id'], 'RECV '.$row['receiving_id'], array('class' => 'modal-dlg modal-btn-delete modal-btn-submit')), $row['receiving_date'], $row['items_purchased'], $row['employee_name'], $row['supplier_name'], to_currency($row['total']), $row['payment_type'], $row['invoice_number'], $row['comment']);
|
||||
$summary_data[] = array(anchor('receivings/edit/'.$row['receiving_id'], 'RECV '.$row['receiving_id'], array('class' => 'modal-dlg modal-btn-delete modal-btn-submit')), $row['receiving_date'], to_quantity($row['items_purchased']), $row['employee_name'], $row['supplier_name'], to_currency($row['total']), $row['payment_type'], $row['invoice_number'], $row['comment']);
|
||||
|
||||
foreach($report_data['details'][$key] as $drow)
|
||||
{
|
||||
$quantity_purchased = $drow['receiving_quantity'] > 1 ? $drow['quantity_purchased'] . ' x ' . $drow['receiving_quantity'] : $drow['quantity_purchased'];
|
||||
$quantity_purchased = $drow['receiving_quantity'] > 1 ? to_quantity($drow['quantity_purchased']) . ' x ' . to_quantity($drow['receiving_quantity']) : to_quantity($drow['quantity_purchased']);
|
||||
if ($show_locations)
|
||||
{
|
||||
$quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']';
|
||||
|
||||
@@ -1,29 +1,40 @@
|
||||
<?php
|
||||
function to_currency($number,$escape=FALSE)
|
||||
|
||||
function to_currency($number, $escape=FALSE)
|
||||
{
|
||||
$CI =& get_instance();
|
||||
|
||||
$currency_symbol = $CI->config->item('currency_symbol') ? $CI->config->item('currency_symbol') : '$';
|
||||
$currency_symbol = $currency_symbol == '$' && $escape ? '\$' : $currency_symbol;
|
||||
$thousands_separator = $CI->config->item('thousands_separator') ? $CI->config->item('thousands_separator') : '';
|
||||
$decimal_point = $CI->config->item('decimal_point') ? $CI->config->item('decimal_point') : '.';
|
||||
$decimals = $CI->config->item('currency_decimals') ? $CI->config->item('currency_decimals') : 2;
|
||||
|
||||
if($number >= 0)
|
||||
{
|
||||
if($CI->config->item('currency_side') !== 'currency_side')
|
||||
return $currency_symbol.number_format($number, 2, $decimal_point, $thousands_separator);
|
||||
return $currency_symbol.number_format($number, $decimals, $decimal_point, $thousands_separator);
|
||||
else
|
||||
return number_format($number, 2, $decimal_point, $thousands_separator).$currency_symbol;
|
||||
return number_format($number, $decimals, $decimal_point, $thousands_separator).$currency_symbol;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($CI->config->item('currency_side') !== 'currency_side')
|
||||
return '-'.$currency_symbol.number_format(abs($number), 2, $decimal_point, $thousands_separator);
|
||||
return '-'.$currency_symbol.number_format(abs($number), $decimals, $decimal_point, $thousands_separator);
|
||||
else
|
||||
return '-'.number_format(abs($number), 2, $decimal_point, $thousands_separator).$currency_symbol;
|
||||
return '-'.number_format(abs($number), $decimals, $decimal_point, $thousands_separator).$currency_symbol;
|
||||
}
|
||||
}
|
||||
|
||||
function to_currency_no_money($number)
|
||||
{
|
||||
return number_format($number, 2, '.', '');
|
||||
$CI =& get_instance();
|
||||
|
||||
$thousands_separator = $CI->config->item('thousands_separator') ? $CI->config->item('thousands_separator') : '';
|
||||
$decimal_point = $CI->config->item('decimal_point') ? $CI->config->item('decimal_point') : '.';
|
||||
$decimals = $CI->config->item('currency_decimals') ? $CI->config->item('currency_decimals') : 2;
|
||||
|
||||
return number_format($number, $decimals, $decimal_point, $thousands_separator);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
13
application/helpers/quantity_helper.php
Normal file
13
application/helpers/quantity_helper.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
function to_quantity($number)
|
||||
{
|
||||
$CI =& get_instance();
|
||||
|
||||
$decimals = $CI->config->item('quantity_decimals') ? $CI->config->item('quantity_decimals') : 0;
|
||||
$decimal_point = $CI->config->item('decimal_point') ? $CI->config->item('decimal_point') : '.';
|
||||
|
||||
return number_format($number, $decimals, $decimal_point, '');
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
function get_random_colors($how_many)
|
||||
{
|
||||
$colors = array();
|
||||
@@ -45,4 +46,6 @@ function show_report($report_prefix, $report_name, $lang_key='')
|
||||
<li><a href="<?php echo site_url('reports/' . $report_prefix . preg_replace('/reports_(.*)/', '$1', $report_name));?>"><?php echo $report_label; ?></a></li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -341,7 +341,7 @@ function get_item_data_row($item,$controller)
|
||||
$table_data_row.='<td width="10%">'.$item->company_name.'</td>';
|
||||
$table_data_row.='<td width="10%">'.to_currency($item->cost_price).'</td>';
|
||||
$table_data_row.='<td width="10%">'.to_currency($item->unit_price).'</td>';
|
||||
$table_data_row.='<td width="8%">'.$item->quantity.'</td>';
|
||||
$table_data_row.='<td width="8%">'.to_quantity($item->quantity).'</td>';
|
||||
$table_data_row.='<td width="8%">'.$tax_percents.'</td>';
|
||||
$image = '';
|
||||
if (!empty($item->pic_id))
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang["config_print_silently"] = "Zeige Druckdialog";
|
||||
$lang["config_print_top_margin"] = "Rand oben";
|
||||
$lang["config_print_top_margin_number"] = "Rand oben muss eine Zahl sein";
|
||||
$lang["config_print_top_margin_required"] = "Rand oben ist erforderlich";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_receipt_configuration"] = "Druckereinstellungen";
|
||||
$lang["config_receipt_info"] = "Quittungsinformation";
|
||||
$lang["config_receipt_printer"] = "Quittungsdrucker";
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang["config_print_silently"] = "Show Print Dialog";
|
||||
$lang["config_print_top_margin"] = "Margin Top";
|
||||
$lang["config_print_top_margin_number"] = "The default top margin must be a number";
|
||||
$lang["config_print_top_margin_required"] = "The default top margin is a required field";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_receipt_configuration"] = "Print Settings";
|
||||
$lang["config_receipt_info"] = "Receipt Configuration Information";
|
||||
$lang["config_receipt_printer"] = "Ticket Printer";
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang["config_print_silently"] = "Mostrar cuadro de Dialogo de impresión";
|
||||
$lang["config_print_top_margin"] = "Margen Superior";
|
||||
$lang["config_print_top_margin_number"] = "Margen Superior debe ser un número";
|
||||
$lang["config_print_top_margin_required"] = "Margen Superior es requerido";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_receipt_configuration"] = "Parámetros de Impresión";
|
||||
$lang["config_receipt_info"] = "Información de Configuración de Recibo";
|
||||
$lang["config_receipt_printer"] = "Impresora de Ticket";
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang["config_print_silently"] = "Show Print Dialog";
|
||||
$lang["config_print_top_margin"] = "Margin Top";
|
||||
$lang["config_print_top_margin_number"] = "The default top margin must be a number";
|
||||
$lang["config_print_top_margin_required"] = "The default top margin is a required field";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_receipt_configuration"] = "Print Settings";
|
||||
$lang["config_receipt_info"] = "Receipt Configuration Information";
|
||||
$lang["config_receipt_printer"] = "Ticket Printer";
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang["config_print_silently"] = "Show Print Dialog";
|
||||
$lang["config_print_top_margin"] = "Margin Top";
|
||||
$lang["config_print_top_margin_number"] = "The default top margin must be a number";
|
||||
$lang["config_print_top_margin_required"] = "The default top margin is a required field";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_receipt_configuration"] = "Print Settings";
|
||||
$lang["config_receipt_info"] = "Receipt Configuration Information";
|
||||
$lang["config_receipt_printer"] = "Ticket Printer";
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang["config_print_silently"] = "Toon Printvenster";
|
||||
$lang["config_print_top_margin"] = "Marge Boven";
|
||||
$lang["config_print_top_margin_number"] = "The default top margin must be a number";
|
||||
$lang["config_print_top_margin_required"] = "The default top margin is a required field";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_receipt_configuration"] = "Print Instellingen";
|
||||
$lang["config_receipt_info"] = "Ticket Instellingen";
|
||||
$lang["config_receipt_printer"] = "Ticket Printer";
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang["config_print_silently"] = "Show Print Dialog";
|
||||
$lang["config_print_top_margin"] = "Margin Top";
|
||||
$lang["config_print_top_margin_number"] = "The default top margin must be a number";
|
||||
$lang["config_print_top_margin_required"] = "The default top margin is a required field";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_receipt_configuration"] = "Print Settings";
|
||||
$lang["config_receipt_info"] = "Receipt Configuration Information";
|
||||
$lang["config_receipt_printer"] = "Ticket Printer";
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang["config_print_silently"] = "Show Print Dialog";
|
||||
$lang["config_print_top_margin"] = "Margin Top";
|
||||
$lang["config_print_top_margin_number"] = "The default top margin must be a number";
|
||||
$lang["config_print_top_margin_required"] = "The default top margin is a required field";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_receipt_configuration"] = "Print Settings";
|
||||
$lang["config_receipt_info"] = "Receipt Configuration Information";
|
||||
$lang["config_receipt_printer"] = "Ticket Printer";
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang["config_print_silently"] = "Show Print Dialog";
|
||||
$lang["config_print_top_margin"] = "Margin Top";
|
||||
$lang["config_print_top_margin_number"] = "The default top margin must be a number";
|
||||
$lang["config_print_top_margin_required"] = "The default top margin is a required field";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_receipt_configuration"] = "Print Settings";
|
||||
$lang["config_receipt_info"] = "Receipt Configuration Information";
|
||||
$lang["config_receipt_printer"] = "Ticket Printer";
|
||||
|
||||
@@ -100,6 +100,7 @@ $lang["config_print_silently"] = "Show Print Dialog";
|
||||
$lang["config_print_top_margin"] = "Margin Top";
|
||||
$lang["config_print_top_margin_number"] = "The default top margin must be a number";
|
||||
$lang["config_print_top_margin_required"] = "The default top margin is a required field";
|
||||
$lang["config_quantity_decimals"] = "Quantity Decimals";
|
||||
$lang["config_receipt_configuration"] = "Print Settings";
|
||||
$lang["config_receipt_info"] = "Receipt Configuration Information";
|
||||
$lang["config_receipt_printer"] = "Ticket Printer";
|
||||
|
||||
@@ -51,17 +51,17 @@ class Receiving extends CI_Model
|
||||
return $success;
|
||||
}
|
||||
|
||||
function save ($items,$supplier_id,$employee_id,$comment,$invoice_number,$payment_type,$receiving_id=false)
|
||||
function save($items, $supplier_id, $employee_id, $comment, $invoice_number, $payment_type, $receiving_id=false)
|
||||
{
|
||||
if(count($items)==0)
|
||||
return -1;
|
||||
|
||||
$receivings_data = array(
|
||||
'supplier_id'=> $this->Supplier->exists($supplier_id) ? $supplier_id : null,
|
||||
'employee_id'=>$employee_id,
|
||||
'payment_type'=>$payment_type,
|
||||
'comment'=>$comment,
|
||||
'invoice_number'=>$invoice_number
|
||||
'supplier_id'=>$this->Supplier->exists($supplier_id) ? $supplier_id : null,
|
||||
'employee_id'=>$employee_id,
|
||||
'payment_type'=>$payment_type,
|
||||
'comment'=>$comment,
|
||||
'invoice_number'=>$invoice_number
|
||||
);
|
||||
|
||||
//Run these queries as a transaction, we want to make sure we do all or nothing
|
||||
@@ -70,11 +70,9 @@ class Receiving extends CI_Model
|
||||
$this->db->insert('receivings',$receivings_data);
|
||||
$receiving_id = $this->db->insert_id();
|
||||
|
||||
|
||||
foreach($items as $line=>$item)
|
||||
{
|
||||
$cur_item_info = $this->Item->get_info($item['item_id']);
|
||||
|
||||
|
||||
$receivings_items_data = array(
|
||||
'receiving_id'=>$receiving_id,
|
||||
@@ -90,7 +88,7 @@ class Receiving extends CI_Model
|
||||
'item_location'=>$item['item_location']
|
||||
);
|
||||
|
||||
$this->db->insert('receivings_items',$receivings_items_data);
|
||||
$this->db->insert('receivings_items', $receivings_items_data);
|
||||
|
||||
$items_received = $item['receiving_quantity'] != 0 ? $item['quantity'] * $item['receiving_quantity'] : $item['quantity'];
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_currency_symbol'), 'currency_symbol', array('class'=>'control-label col-xs-2')); ?>
|
||||
<div class='col-sm-1'>
|
||||
<div class='col-xs-1'>
|
||||
<?php echo form_input(array(
|
||||
'name'=>'currency_symbol',
|
||||
'id'=>'currency_symbol',
|
||||
'class'=>'form-control input-sm',
|
||||
'value'=>$this->config->item('currency_symbol')));?>
|
||||
</div>
|
||||
<div class='checkbox col-sm-2'>
|
||||
<div class='checkbox col-xs-2'>
|
||||
<label>
|
||||
<?php echo form_checkbox(array(
|
||||
'name'=>'currency_side',
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_decimal_point'), 'language', array('class'=>'control-label col-xs-2')); ?>
|
||||
<div class='col-sm-2'>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_dropdown('decimal_point', array(
|
||||
'.' => '. (dot)',
|
||||
',' => ', (comma)'
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_thousands_separator'), 'language', array('class'=>'control-label col-xs-2')); ?>
|
||||
<div class='col-sm-2'>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_dropdown('thousands_separator', array(
|
||||
''' => '' (apostrophe)',
|
||||
',' => ', (comma)',
|
||||
@@ -51,6 +51,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_quantity_decimals'), 'language', array('class'=>'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-2'>
|
||||
<?php echo form_dropdown('quantity_decimals', array(
|
||||
'0' => '0',
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3'
|
||||
),
|
||||
$this->config->item('quantity_decimals'), array('class'=>'form-control input-sm'));
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('config_language'), 'language', array('class'=>'control-label col-xs-2')); ?>
|
||||
<div class='col-xs-4'>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<?php $item_info = $this->Item->get_info($item_kit_item['item_id']); ?>
|
||||
<td><a href='#' onclick='return delete_item_kit_row(this);'><span class='glyphicon glyphicon-trash'></span></a></td>
|
||||
<td><?php echo $item_info->name; ?></td>
|
||||
<td><input class='quantity form-control input-sm' id='item_kit_item_<?php echo $item_kit_item['item_id'] ?>' name=item_kit_item[<?php echo $item_kit_item['item_id'] ?>] value='<?php echo $item_kit_item['quantity'] ?>' size='5'/></td>
|
||||
<td><input class='quantity form-control input-sm' id='item_kit_item_<?php echo $item_kit_item['item_id'] ?>' name=item_kit_item[<?php echo $item_kit_item['item_id'] ?>] value='<?php echo to_quantity($item_kit_item['quantity']) ?>' size='5'/></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
'id'=>'quantity',
|
||||
'class'=>'form-control input-sm',
|
||||
'disabled'=>'',
|
||||
'value'=>current($item_quantities))
|
||||
'value'=>to_quantity(current($item_quantities)))
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -105,7 +105,7 @@ $(document).ready(function()
|
||||
|
||||
function display_stock(location_id)
|
||||
{
|
||||
var item_quantities= <?php echo json_encode($item_quantities); ?>;
|
||||
var item_quantities = <?php echo json_encode($item_quantities); ?>;
|
||||
document.getElementById("quantity").value = item_quantities[location_id];
|
||||
|
||||
var inventory_data = <?php echo json_encode($inventory_array); ?>;
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
'name'=>'quantity_' . $key,
|
||||
'id'=>'quantity_' . $key,
|
||||
'class'=>'required quantity form-control',
|
||||
'value'=>isset($item_info->item_id) ? $location_detail['quantity'] : 0)
|
||||
'value'=>isset($item_info->item_id) ? to_quantity($location_detail['quantity']) : 0)
|
||||
);?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -155,7 +155,7 @@
|
||||
'name'=>'receiving_quantity',
|
||||
'id'=>'receiving_quantity',
|
||||
'class'=>'required form-control input-sm',
|
||||
'value'=>$item_info->receiving_quantity)
|
||||
'value'=>to_quantity($item_info->receiving_quantity))
|
||||
);?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -167,7 +167,7 @@
|
||||
'name'=>'reorder_level',
|
||||
'id'=>'reorder_level',
|
||||
'class'=>'form-control input-sm',
|
||||
'value'=>!isset($item_info->item_id) ? 0 : $item_info->reorder_level)
|
||||
'value'=>!isset($item_info->item_id) ? 0 : to_quantity($item_info->reorder_level))
|
||||
);?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
'id'=>'quantity',
|
||||
'class'=>'form-control input-sm',
|
||||
'disabled'=>'',
|
||||
'value'=>current($item_quantities))
|
||||
'value'=>to_quantity(current($item_quantities)))
|
||||
); ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -135,7 +135,7 @@ $(document).ready(function()
|
||||
|
||||
function fill_quantity(val)
|
||||
{
|
||||
var item_quantities= <?php echo json_encode($item_quantities ); ?>;
|
||||
var item_quantities = <?php echo json_encode($item_quantities); ?>;
|
||||
document.getElementById("quantity").value = item_quantities[val];
|
||||
}
|
||||
</script>
|
||||
@@ -73,8 +73,8 @@ if (isset($error_message))
|
||||
<tr>
|
||||
<td><span class='long_name'><?php echo $item['name']; ?></span><span class='short_name'><?php echo character_limiter($item['name'],10); ?></span></td>
|
||||
<td><?php echo to_currency($item['price']); ?></td>
|
||||
<td><?php echo $item['quantity'] . " " . ($show_stock_locations ? " [" . $item['stock_name'] . "]" : "");
|
||||
?> x <?php echo $item['receiving_quantity'] != 0 ? $item['receiving_quantity'] : 1; ?></td>
|
||||
<td><?php echo to_quantity($item['quantity']) . " " . ($show_stock_locations ? " [" . $item['stock_name'] . "]" : "");
|
||||
?> x <?php echo $item['receiving_quantity'] != 0 ? to_quantity($item['receiving_quantity']) : 1; ?></td>
|
||||
<td><div class="total-value"><?php echo to_currency($item['total']); ?></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -141,12 +141,12 @@ if (isset($error))
|
||||
}
|
||||
?>
|
||||
|
||||
<td><?php echo form_input(array('name'=>'quantity', 'class'=>'form-control input-sm', 'value'=>$item['quantity'])); ?></td>
|
||||
<td><?php echo form_input(array('name'=>'quantity', 'class'=>'form-control input-sm', 'value'=>to_quantity($item['quantity']))); ?></td>
|
||||
<?php
|
||||
if ($item['receiving_quantity'] > 1)
|
||||
{
|
||||
?>
|
||||
<td><?php echo 'x'.$item['receiving_quantity']; ?></td>
|
||||
<td><?php echo 'x'.to_quantity($item['receiving_quantity']); ?></td>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
|
||||
@@ -82,7 +82,7 @@ if (isset($error_message))
|
||||
<tr class="item-row">
|
||||
<td><?php echo $item['item_number']; ?></td>
|
||||
<td class="item-name"><textarea rows="5" cols="6" class='long_name'><?php echo $item['is_serialized'] || $item['allow_alt_description'] && !empty($item['description']) ? $item['description'] : $item['name']; ?></textarea></td>
|
||||
<td style='text-align:center;'><textarea rows="5" cols="6"><?php echo $item['quantity']; ?></textarea></td>
|
||||
<td style='text-align:center;'><textarea rows="5" cols="6"><?php echo to_quantity($item['quantity']); ?></textarea></td>
|
||||
<td><textarea rows="5" cols="6"><?php echo to_currency($item['price']); ?></textarea></td>
|
||||
<td style='text-align:center;'><textarea rows="5" cols="6"><?php echo $item['discount'] .'%'; ?></textarea></td>
|
||||
<td style='border-right: solid 1px; text-align:right;'><textarea rows="5" cols="6"><?php echo to_currency($item['discounted_total']); ?></textarea></td>
|
||||
|
||||
@@ -86,7 +86,7 @@ if (isset($error_message))
|
||||
<tr class="item-row">
|
||||
<td><?php echo $item['item_number']; ?></td>
|
||||
<td class="item-name long_name"><?php echo $item['name']; ?></td>
|
||||
<td><?php echo $item['quantity']; ?></td>
|
||||
<td><?php echo to_quantity($item['quantity']); ?></td>
|
||||
<td><?php echo to_currency($item['price']); ?></td>
|
||||
<td><?php echo $item['discount'] .'%'; ?></td>
|
||||
<td class="total-line"><?php echo to_currency($item['discounted_total']); ?></td>
|
||||
|
||||
@@ -76,7 +76,7 @@ if (isset($error_message))
|
||||
<tr>
|
||||
<td><span class='long_name'><?php echo ucfirst($item['name']); ?></span></td>
|
||||
<td><?php echo to_currency($item['price']); ?></td>
|
||||
<td><?php echo $item['quantity'] . " " . ($show_stock_locations ? " [" . $item['stock_name'] . "]" : ""); ?></td>
|
||||
<td><?php echo to_quantity($item['quantity']) . " " . ($show_stock_locations ? " [" . $item['stock_name'] . "]" : ""); ?></td>
|
||||
<td><div class="total-value"><?php echo to_currency($item[($this->Appconfig->get('show_total_discount') ? 'total' : 'discounted_total')]); ?></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<td><?php echo $item['item_number']; ?></td>
|
||||
<td><span class='long_name'><?php echo $item['name']; ?></span><span class='short_name'><?php echo character_limiter($item['name'],10); ?></span></td>
|
||||
<td><?php echo to_currency($item['price']); ?></td>
|
||||
<td style='text-align:center;'><?php echo $item['quantity']; ?></td>
|
||||
<td style='text-align:center;'><?php echo to_quantity($item['quantity']); ?></td>
|
||||
<td style='text-align:center;'><?php echo $item['discount']; ?></td>
|
||||
<td style='text-align:right;'><?php echo to_currency($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100); ?></td>
|
||||
</tr>
|
||||
|
||||
@@ -152,12 +152,12 @@ if (isset($success))
|
||||
<?php
|
||||
if($item['is_serialized']==1)
|
||||
{
|
||||
echo $item['quantity'];
|
||||
echo form_hidden('quantity',$item['quantity']);
|
||||
echo to_quantity($item['quantity']);
|
||||
echo form_hidden('quantity', $item['quantity']);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo form_input(array('name'=>'quantity', 'class'=>'form-control input-sm', 'value'=>$item['quantity'], 'tabindex'=>$tabindex));
|
||||
echo form_input(array('name'=>'quantity', 'class'=>'form-control input-sm', 'value'=>to_quantity($item['quantity']), 'tabindex'=>$tabindex));
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -99,6 +99,7 @@ config_print_silently,Zeige Druckdialog,Toon Printvenster,Mostrar cuadro de Dial
|
||||
config_print_top_margin,Rand oben,Marge Boven,Margen Superior,Margin Top,Margin Top,Margin Top,Margin Top,Margin Top,Margin Top,Margin Top
|
||||
config_print_top_margin_number,Rand oben muss eine Zahl sein,The default top margin must be a number,Margen Superior debe ser un número,The default top margin must be a number,The default top margin must be a number,The default top margin must be a number,The default top margin must be a number,The default top margin must be a number,The default top margin must be a number,The default top margin must be a number
|
||||
config_print_top_margin_required,Rand oben ist erforderlich,The default top margin is a required field,Margen Superior es requerido,The default top margin is a required field,The default top margin is a required field,The default top margin is a required field,The default top margin is a required field,The default top margin is a required field,The default top margin is a required field,The default top margin is a required field
|
||||
config_quantity_decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals,Quantity Decimals
|
||||
config_receipt_configuration,Druckereinstellungen,Print Instellingen,Parámetros de Impresión,Print Settings,Print Settings,Print Settings,Print Settings,Print Settings,Print Settings,Print Settings
|
||||
config_receipt_info,Quittungsinformation,Ticket Instellingen,Información de Configuración de Recibo,Receipt Configuration Information,Receipt Configuration Information,Receipt Configuration Information,Receipt Configuration Information,Receipt Configuration Information,Receipt Configuration Information,Receipt Configuration Information
|
||||
config_receipt_printer,Quittungsdrucker,Ticket Printer,Impresora de Ticket,Ticket Printer,Ticket Printer,Ticket Printer,Ticket Printer,Ticket Printer,Ticket Printer,Ticket Printer
|
||||
|
||||
|
Reference in New Issue
Block a user