mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-02-18 22:59:06 -05:00
Fix Reports and few other minor things
This commit is contained in:
@@ -811,6 +811,17 @@ class Reports extends Secure_Controller
|
||||
|
||||
foreach($report_data['summary'] as $key => $row)
|
||||
{
|
||||
if($row['sale_status'] == CANCELED)
|
||||
{
|
||||
$button_key = 'data-btn-restore';
|
||||
$button_label = $this->lang->line('common_restore');
|
||||
}
|
||||
else
|
||||
{
|
||||
$button_key = 'data-btn-delete';
|
||||
$button_label = $this->lang->line('common_delete');
|
||||
}
|
||||
|
||||
$summary_data[] = $this->xss_clean(array(
|
||||
'id' => anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target'=>'_blank')),
|
||||
'type_code' => $row['type_code'],
|
||||
@@ -823,7 +834,10 @@ class Reports extends Secure_Controller
|
||||
'cost' => to_currency($row['cost']),
|
||||
'profit' => to_currency($row['profit']),
|
||||
'payment_type' => $row['payment_type'],
|
||||
'comment' => $row['comment']));
|
||||
'comment' => $row['comment'],
|
||||
'edit' => anchor('sales/edit/'. $row['sale_id'], '<span class="glyphicon glyphicon-edit"></span>',
|
||||
array('class'=>'modal-dlg print_hide', $button_key => $button_label, 'data-btn-submit' => $this->lang->line('common_submit'), 'title' => $this->lang->line('sales_update')))
|
||||
));
|
||||
|
||||
foreach($report_data['details'][$key] as $drow)
|
||||
{
|
||||
@@ -898,6 +912,17 @@ class Reports extends Secure_Controller
|
||||
|
||||
foreach($report_data['summary'] as $key => $row)
|
||||
{
|
||||
if($row['sale_status'] == CANCELED)
|
||||
{
|
||||
$button_key = 'data-btn-restore';
|
||||
$button_label = $this->lang->line('common_restore');
|
||||
}
|
||||
else
|
||||
{
|
||||
$button_key = 'data-btn-delete';
|
||||
$button_label = $this->lang->line('common_delete');
|
||||
}
|
||||
|
||||
$summary_data[] = $this->xss_clean(array(
|
||||
'id' => anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target'=>'_blank')),
|
||||
'type_code' => $row['type_code'],
|
||||
@@ -910,7 +935,10 @@ class Reports extends Secure_Controller
|
||||
'cost' => to_currency($row['cost']),
|
||||
'profit' => to_currency($row['profit']),
|
||||
'payment_type' => $row['payment_type'],
|
||||
'comment' => $row['comment']));
|
||||
'comment' => $row['comment'],
|
||||
'edit' => anchor('sales/edit/'. $row['sale_id'], '<span class="glyphicon glyphicon-edit"></span>',
|
||||
array('class'=>'modal-dlg print_hide', $button_key => $button_label, 'data-btn-submit' => $this->lang->line('common_submit'), 'title' => $this->lang->line('sales_update')))
|
||||
));
|
||||
|
||||
foreach($report_data['details'][$key] as $drow)
|
||||
{
|
||||
@@ -987,18 +1015,33 @@ class Reports extends Secure_Controller
|
||||
|
||||
foreach($report_data['summary'] as $key => $row)
|
||||
{
|
||||
if($row['sale_status'] == CANCELED)
|
||||
{
|
||||
$button_key = 'data-btn-restore';
|
||||
$button_label = $this->lang->line('common_restore');
|
||||
}
|
||||
else
|
||||
{
|
||||
$button_key = 'data-btn-delete';
|
||||
$button_label = $this->lang->line('common_delete');
|
||||
}
|
||||
|
||||
$summary_data[] = $this->xss_clean(array(
|
||||
'id' => anchor('sales/receipt/'.$row['sale_id'], 'POS '.$row['sale_id'], array('target'=>'_blank')),
|
||||
'type_code' => $row['type_code'],
|
||||
'sale_date' => $row['sale_date'],
|
||||
'quantity' => to_quantity_decimals($row['items_purchased']),
|
||||
'employee_name' => $row['employee_name'],
|
||||
'customer_name' => $row['customer_name'],
|
||||
'subtotal' => to_currency($row['subtotal']),
|
||||
'tax' => to_currency_tax($row['tax']),
|
||||
'total' => to_currency($row['total']),
|
||||
'cost' => to_currency($row['cost']),
|
||||
'profit' => to_currency($row['profit']),
|
||||
'payment_type' => $row['payment_type'],
|
||||
'comment' => $row['comment']
|
||||
'comment' => $row['comment'],
|
||||
'edit' => anchor('sales/edit/'. $row['sale_id'], '<span class="glyphicon glyphicon-edit"></span>',
|
||||
array('class'=>'modal-dlg print_hide', $button_key => $button_label, 'data-btn-submit' => $this->lang->line('common_submit'), 'title' => $this->lang->line('sales_update')))
|
||||
));
|
||||
|
||||
foreach($report_data['details'][$key] as $drow)
|
||||
@@ -1262,7 +1305,13 @@ class Reports extends Secure_Controller
|
||||
{
|
||||
$quantity_purchased .= ' [' . $this->Stock_location->get_location_name($drow['item_location']) . ']';
|
||||
}
|
||||
$details_data[$row['receiving_id']][] = $this->xss_clean(array($drow['item_number'], $drow['name'], $drow['category'], $quantity_purchased, to_currency($drow['total']), $drow['discount_percent'].'%'));
|
||||
$details_data[$row['receiving_id']][] = $this->xss_clean(array(
|
||||
$drow['item_number'],
|
||||
$drow['name'],
|
||||
$drow['category'],
|
||||
$quantity_purchased,
|
||||
to_currency($drow['total']),
|
||||
$drow['discount_percent'].'%'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ $lang["reports_inventory_summary_report"] = "Inventory Summary Report";
|
||||
$lang["reports_item"] = "Item";
|
||||
$lang["reports_item_count"] = "Filter Item Count";
|
||||
$lang["reports_item_name"] = "Item Name";
|
||||
$lang["reports_item_number"] = "Item Number";
|
||||
$lang["reports_item_number"] = "Barcode";
|
||||
$lang["reports_items"] = "Items";
|
||||
$lang["reports_items_purchased"] = "Items Purchased";
|
||||
$lang["reports_items_received"] = "Items Received";
|
||||
|
||||
@@ -39,7 +39,9 @@ $lang["reports_expenses_categories"] = "Expenses";
|
||||
$lang["reports_expenses_categories_summary_report"] = "Expense Categories Summary Report";
|
||||
$lang["reports_expenses_category"] = "Category";
|
||||
$lang["reports_expenses_amount"] = "Amount";
|
||||
$lang["reports_expenses_tax_amount"] = "Tax";
|
||||
$lang["reports_expenses_total_amount"] = "Total Amount";
|
||||
$lang["reports_expenses_total_tax_amount"] = "Total Tax";
|
||||
$lang["reports_graphical_reports"] = "Graphical Reports";
|
||||
$lang["reports_inventory"] = "Inventory";
|
||||
$lang["reports_inventory_low"] = "Low Inventory";
|
||||
@@ -50,7 +52,7 @@ $lang["reports_inventory_summary_report"] = "Inventory Summary Report";
|
||||
$lang["reports_item"] = "Item";
|
||||
$lang["reports_item_count"] = "Filter Item Count";
|
||||
$lang["reports_item_name"] = "Item Name";
|
||||
$lang["reports_item_number"] = "Item Number";
|
||||
$lang["reports_item_number"] = "Barcode";
|
||||
$lang["reports_items"] = "Items";
|
||||
$lang["reports_items_purchased"] = "Items Purchased";
|
||||
$lang["reports_items_received"] = "Items Received";
|
||||
|
||||
@@ -484,7 +484,7 @@ class Item extends CI_Model
|
||||
{
|
||||
$suggestions = array();
|
||||
|
||||
$this->db->select($this->get_search_suggestion_format('item_id,name'));
|
||||
$this->db->select($this->get_search_suggestion_format('item_id, name'));
|
||||
$this->db->from('items');
|
||||
$this->db->where('deleted', $filters['is_deleted']);
|
||||
$this->db->where("item_type = " . ITEM); // standard, exclude kit items since kits will be picked up later
|
||||
@@ -495,7 +495,7 @@ class Item extends CI_Model
|
||||
$suggestions[] = array('value' => $row->item_id, 'label' => $this->get_search_suggestion_label($row));
|
||||
}
|
||||
|
||||
$this->db->select($this->get_search_suggestion_format('item_id,item_number'));
|
||||
$this->db->select($this->get_search_suggestion_format('item_id, item_number'));
|
||||
$this->db->from('items');
|
||||
$this->db->where('deleted', $filters['is_deleted']);
|
||||
$this->db->where("item_type = " . ITEM); // standard, exclude kit items since kits will be picked up later
|
||||
@@ -576,7 +576,6 @@ class Item extends CI_Model
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//only return $limit suggestions
|
||||
if(count($suggestions > $limit))
|
||||
{
|
||||
@@ -687,7 +686,6 @@ class Item extends CI_Model
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//only return $limit suggestions
|
||||
if(count($suggestions > $limit))
|
||||
{
|
||||
|
||||
@@ -1183,6 +1183,7 @@ class Sale extends CI_Model
|
||||
MAX(CONCAT(employee.first_name, " ", employee.last_name)) AS employee_name,
|
||||
items.item_id AS item_id,
|
||||
MAX(items.name) AS name,
|
||||
MAX(items.item_number) AS item_number,
|
||||
MAX(items.category) AS category,
|
||||
MAX(items.supplier_id) AS supplier_id,
|
||||
MAX(sales_items.quantity_purchased) AS quantity_purchased,
|
||||
|
||||
@@ -25,7 +25,7 @@ class Detailed_sales extends Report
|
||||
array('total' => $this->lang->line('reports_total'), 'sorter' => 'number_sorter'),
|
||||
array('cost' => $this->lang->line('reports_cost'), 'sorter' => 'number_sorter'),
|
||||
array('profit' => $this->lang->line('reports_profit'), 'sorter' => 'number_sorter'),
|
||||
array('payment_type' => $this->lang->line('sales_amount_tendered')),
|
||||
array('payment_type' => $this->lang->line('reports_payment_type')),
|
||||
array('comment' => $this->lang->line('reports_comments'))),
|
||||
'details' => array(
|
||||
$this->lang->line('reports_name'),
|
||||
@@ -50,14 +50,14 @@ class Detailed_sales extends Report
|
||||
$this->db->select('sale_id,
|
||||
sale_date,
|
||||
SUM(quantity_purchased) AS items_purchased,
|
||||
employee_name,
|
||||
customer_name,
|
||||
MAX(employee_name) AS employee_name,
|
||||
MAX(customer_name) AS customer_name,
|
||||
SUM(subtotal) AS subtotal,
|
||||
SUM(tax) AS tax,
|
||||
SUM(total) AS total,
|
||||
SUM(cost) AS cost,
|
||||
SUM(profit) AS profit,
|
||||
payment_type,
|
||||
MAX(payment_type) AS payment_type,
|
||||
comment');
|
||||
$this->db->from('sales_items_temp');
|
||||
$this->db->where('sale_id', $sale_id);
|
||||
|
||||
@@ -55,6 +55,7 @@ class Specific_customer extends Report
|
||||
WHEN sale_status = ' . CANCELED . ' THEN \'' . $this->lang->line('reports_code_canceled') . '\'
|
||||
ELSE \'\'
|
||||
END) AS type_code,
|
||||
MAX(sale_status) as sale_status,
|
||||
MAX(sale_date) AS sale_date,
|
||||
SUM(quantity_purchased) AS items_purchased,
|
||||
MAX(employee_name) AS employee_name,
|
||||
|
||||
@@ -18,10 +18,12 @@ class Specific_discount extends Report
|
||||
array('type_code' => $this->lang->line('reports_code_type')),
|
||||
array('sale_date' => $this->lang->line('reports_date')),
|
||||
array('quantity' => $this->lang->line('reports_quantity')),
|
||||
array('employee_name' => $this->lang->line('reports_sold_by')),
|
||||
array('customer_name' => $this->lang->line('reports_sold_to')),
|
||||
array('subtotal' => $this->lang->line('reports_subtotal'), 'sorter' => 'number_sorter'),
|
||||
array('tax' => $this->lang->line('reports_tax'), 'sorter' => 'number_sorter'),
|
||||
array('total' => $this->lang->line('reports_total'), 'sorter' => 'number_sorter'),
|
||||
array('cost' => $this->lang->line('reports_cost'), 'sorter' => 'number_sorter'),
|
||||
array('profit' => $this->lang->line('reports_profit'), 'sorter' => 'number_sorter'),
|
||||
array('payment_type' => $this->lang->line('reports_payment_type')),
|
||||
array('comment' => $this->lang->line('reports_comments'))),
|
||||
@@ -53,8 +55,10 @@ class Specific_discount extends Report
|
||||
WHEN sale_status = ' . CANCELED . ' THEN \'' . $this->lang->line('reports_code_canceled') . '\'
|
||||
ELSE \'\'
|
||||
END) AS type_code,
|
||||
MAX(sale_status) as sale_status,
|
||||
MAX(sale_date) AS sale_date,
|
||||
SUM(quantity_purchased) AS items_purchased,
|
||||
MAX(employee_name) AS employee_name,
|
||||
MAX(customer_name) AS customer_name,
|
||||
SUM(subtotal) AS subtotal,
|
||||
SUM(tax) AS tax,
|
||||
|
||||
@@ -55,6 +55,7 @@ class Specific_employee extends Report
|
||||
WHEN sale_status = ' . CANCELED . ' THEN \'' . $this->lang->line('reports_code_canceled') . '\'
|
||||
ELSE \'\'
|
||||
END) AS type_code,
|
||||
MAX(sale_status) as sale_status,
|
||||
MAX(sale_date) AS sale_date,
|
||||
SUM(quantity_purchased) AS items_purchased,
|
||||
MAX(customer_name) AS customer_name,
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
);?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('items_image'), 'items_image', array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
@@ -339,183 +339,182 @@
|
||||
<?php echo form_close(); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
//validation and submit handling
|
||||
$(document).ready(function()
|
||||
//validation and submit handling
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#new").click(function() {
|
||||
stay_open = true;
|
||||
$("#item_form").submit();
|
||||
});
|
||||
|
||||
$("#submit").click(function() {
|
||||
stay_open = false;
|
||||
});
|
||||
|
||||
var no_op = function(event, data, formatted){};
|
||||
$("#category").autocomplete({source: "<?php echo site_url('items/suggest_category');?>",delay:10,appendTo: '.modal-content'});
|
||||
|
||||
<?php for ($i = 1; $i <= 10; ++$i)
|
||||
{
|
||||
$("#new").click(function() {
|
||||
stay_open = true;
|
||||
$("#item_form").submit();
|
||||
});
|
||||
|
||||
$("#submit").click(function() {
|
||||
stay_open = false;
|
||||
});
|
||||
|
||||
var no_op = function(event, data, formatted){};
|
||||
$("#category").autocomplete({source: "<?php echo site_url('items/suggest_category');?>",delay:10,appendTo: '.modal-content'});
|
||||
|
||||
<?php for ($i = 1; $i <= 10; ++$i)
|
||||
{
|
||||
?>
|
||||
$("#custom"+<?php echo $i; ?>).autocomplete({
|
||||
source:function (request, response) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<?php echo site_url('items/suggest_custom');?>",
|
||||
dataType: "json",
|
||||
data: $.extend(request, $extend(csrf_form_base(), {field_no: <?php echo $i; ?>})),
|
||||
success: function(data) {
|
||||
response($.map(data, function(item) {
|
||||
return {
|
||||
value: item.label
|
||||
};
|
||||
}))
|
||||
}
|
||||
});
|
||||
},
|
||||
delay:10,
|
||||
appendTo: '.modal-content'});
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
$("a.fileinput-exists").click(function() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "<?php echo site_url("$controller_name/remove_logo/$item_info->item_id"); ?>",
|
||||
dataType: "json"
|
||||
})
|
||||
});
|
||||
|
||||
$('#item_form').validate($.extend({
|
||||
submitHandler: function(form, event) {
|
||||
$(form).ajaxSubmit({
|
||||
success: function(response) {
|
||||
var stay_open = dialog_support.clicked_id() != 'submit';
|
||||
if (stay_open)
|
||||
{
|
||||
// set action of item_form to url without item id, so a new one can be created
|
||||
$("#item_form").attr("action", "<?php echo site_url("items/save/")?>");
|
||||
// use a whitelist of fields to minimize unintended side effects
|
||||
$(':text, :password, :file, #description, #item_form').not('.quantity, #reorder_level, #tax_name_1,' +
|
||||
'#tax_percent_name_1, #reference_number, #name, #cost_price, #unit_price, #taxed_cost_price, #taxed_unit_price').val('');
|
||||
// de-select any checkboxes, radios and drop-down menus
|
||||
$(':input', '#item_form').not('#item_category_id').removeAttr('checked').removeAttr('selected');
|
||||
}
|
||||
else
|
||||
{
|
||||
dialog_support.hide();
|
||||
}
|
||||
table_support.handle_submit('<?php echo site_url('items'); ?>', response, stay_open);
|
||||
},
|
||||
dataType: 'json'
|
||||
?>
|
||||
$("#custom" + <?php echo $i; ?>).autocomplete({
|
||||
source:function (request, response) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<?php echo site_url('items/suggest_custom');?>",
|
||||
dataType: "json",
|
||||
data: $.extend(request, $extend(csrf_form_base(), {field_no: <?php echo $i; ?>})),
|
||||
success: function(data) {
|
||||
response($.map(data, function(item) {
|
||||
return {
|
||||
value: item.label
|
||||
};
|
||||
}))
|
||||
}
|
||||
});
|
||||
},
|
||||
delay: 10,
|
||||
appendTo: '.modal-content'});
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
rules:
|
||||
{
|
||||
name:"required",
|
||||
category:"required",
|
||||
item_number:
|
||||
{
|
||||
required: false,
|
||||
remote:
|
||||
$("a.fileinput-exists").click(function() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "<?php echo site_url("$controller_name/remove_logo/$item_info->item_id"); ?>",
|
||||
dataType: "json"
|
||||
})
|
||||
});
|
||||
|
||||
$('#item_form').validate($.extend({
|
||||
submitHandler: function(form, event) {
|
||||
$(form).ajaxSubmit({
|
||||
success: function(response) {
|
||||
var stay_open = dialog_support.clicked_id() != 'submit';
|
||||
if (stay_open)
|
||||
{
|
||||
url: "<?php echo site_url($controller_name . '/check_item_number')?>",
|
||||
type: "post",
|
||||
data: $.extend(csrf_form_base(),
|
||||
{
|
||||
"item_id" : "<?php echo $item_info->item_id; ?>",
|
||||
"item_number" : function()
|
||||
{
|
||||
return $("#item_number").val();
|
||||
},
|
||||
})
|
||||
// set action of item_form to url without item id, so a new one can be created
|
||||
$("#item_form").attr("action", "<?php echo site_url("items/save/")?>");
|
||||
// use a whitelist of fields to minimize unintended side effects
|
||||
$(':text, :password, :file, #description, #item_form').not('.quantity, #reorder_level, #tax_name_1,' +
|
||||
'#tax_percent_name_1, #reference_number, #name, #cost_price, #unit_price, #taxed_cost_price, #taxed_unit_price').val('');
|
||||
// de-select any checkboxes, radios and drop-down menus
|
||||
$(':input', '#item_form').not('#item_category_id').removeAttr('checked').removeAttr('selected');
|
||||
}
|
||||
else
|
||||
{
|
||||
dialog_support.hide();
|
||||
}
|
||||
table_support.handle_submit('<?php echo site_url('items'); ?>', response, stay_open);
|
||||
},
|
||||
cost_price:
|
||||
dataType: 'json'
|
||||
});
|
||||
},
|
||||
|
||||
rules:
|
||||
{
|
||||
name: "required",
|
||||
category: "required",
|
||||
item_number:
|
||||
{
|
||||
required: false,
|
||||
remote:
|
||||
{
|
||||
url: "<?php echo site_url($controller_name . '/check_item_number')?>",
|
||||
type: "post",
|
||||
data: $.extend(csrf_form_base(),
|
||||
{
|
||||
"item_id": "<?php echo $item_info->item_id; ?>",
|
||||
"item_number": function()
|
||||
{
|
||||
return $("#item_number").val();
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
cost_price:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
unit_price:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
<?php
|
||||
foreach($stock_locations as $key=>$location_detail)
|
||||
{
|
||||
?>
|
||||
<?php echo 'quantity_' . $key ?>:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
unit_price:
|
||||
{
|
||||
required:true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
<?php
|
||||
foreach($stock_locations as $key=>$location_detail)
|
||||
{
|
||||
?>
|
||||
<?php echo 'quantity_' . $key ?>:
|
||||
{
|
||||
required:true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
receiving_quantity:
|
||||
{
|
||||
required:true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
reorder_level:
|
||||
{
|
||||
required:true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
tax_percent:
|
||||
{
|
||||
required:true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
}
|
||||
},
|
||||
|
||||
messages:
|
||||
{
|
||||
name:"<?php echo $this->lang->line('items_name_required'); ?>",
|
||||
item_number: "<?php echo $this->lang->line('items_item_number_duplicate'); ?>",
|
||||
category:"<?php echo $this->lang->line('items_category_required'); ?>",
|
||||
cost_price:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_cost_price_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_cost_price_number'); ?>"
|
||||
},
|
||||
unit_price:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_unit_price_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_unit_price_number'); ?>"
|
||||
},
|
||||
<?php
|
||||
foreach($stock_locations as $key=>$location_detail)
|
||||
{
|
||||
?>
|
||||
<?php echo 'quantity_' . $key ?>:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_quantity_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
},
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
receiving_quantity:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_quantity_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
},
|
||||
reorder_level:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_reorder_level_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_reorder_level_number'); ?>"
|
||||
},
|
||||
tax_percent:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_tax_percent_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_tax_percent_number'); ?>"
|
||||
}
|
||||
<?php
|
||||
}
|
||||
}, form_support.error));
|
||||
});
|
||||
</script>
|
||||
?>
|
||||
receiving_quantity:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
reorder_level:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
},
|
||||
tax_percent:
|
||||
{
|
||||
required: true,
|
||||
remote: "<?php echo site_url($controller_name . '/check_numeric')?>"
|
||||
}
|
||||
},
|
||||
|
||||
messages:
|
||||
{
|
||||
name: "<?php echo $this->lang->line('items_name_required'); ?>",
|
||||
item_number: "<?php echo $this->lang->line('items_item_number_duplicate'); ?>",
|
||||
category: "<?php echo $this->lang->line('items_category_required'); ?>",
|
||||
cost_price:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_cost_price_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_cost_price_number'); ?>"
|
||||
},
|
||||
unit_price:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_unit_price_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_unit_price_number'); ?>"
|
||||
},
|
||||
<?php
|
||||
foreach($stock_locations as $key=>$location_detail)
|
||||
{
|
||||
?>
|
||||
<?php echo 'quantity_' . $key ?>:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_quantity_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
},
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
receiving_quantity:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_quantity_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
},
|
||||
reorder_level:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_reorder_level_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_reorder_level_number'); ?>"
|
||||
},
|
||||
tax_percent:
|
||||
{
|
||||
required: "<?php echo $this->lang->line('items_tax_percent_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_tax_percent_number'); ?>"
|
||||
}
|
||||
}
|
||||
}, form_support.error));
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<?php echo form_open('items/bulk_update/', array('id'=>'item_form', 'class'=>'form-horizontal')); ?>
|
||||
<fieldset id="bulk_item_basic_info">
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('items_name'), 'name', array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<?php echo form_input(array(
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('items_category'), 'category', array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<div class="input-group">
|
||||
@@ -29,7 +29,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('items_supplier'), 'supplier', array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<?php echo form_dropdown('supplier_id', $suppliers, '', array('class'=>'form-control'));?>
|
||||
@@ -120,7 +120,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('items_reorder_level'), 'reorder_level', array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-4'>
|
||||
<?php echo form_input(array(
|
||||
@@ -131,7 +131,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group form-group-sm">
|
||||
<div class="form-group form-group-sm">
|
||||
<?php echo form_label($this->lang->line('items_description'), 'description', array('class'=>'control-label col-xs-3')); ?>
|
||||
<div class='col-xs-8'>
|
||||
<?php echo form_textarea(array(
|
||||
@@ -161,8 +161,8 @@
|
||||
<script type="text/javascript">
|
||||
//validation and submit handling
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#category").autocomplete({source: "<?php echo site_url('items/suggest_category');?>",appendTo:'.modal-content',delay:10});
|
||||
{
|
||||
$("#category").autocomplete({source: "<?php echo site_url('items/suggest_category');?>", appendTo:'.modal-content', delay:10});
|
||||
|
||||
var confirm_message = false;
|
||||
$("#tax_percent_name_2, #tax_name_2").prop('disabled', true),
|
||||
@@ -179,7 +179,7 @@ $(document).ready(function()
|
||||
{
|
||||
$(form).ajaxSubmit({
|
||||
beforeSubmit: function(arr, $form, options) {
|
||||
arr.push({name: 'item_ids', value: table_support.selected_ids().join(":")});
|
||||
arr.push({name: 'item_ids', value: table_support.selected_ids().join(": ")});
|
||||
},
|
||||
success:function(response)
|
||||
{
|
||||
@@ -208,26 +208,25 @@ $(document).ready(function()
|
||||
{
|
||||
number:true
|
||||
}
|
||||
},
|
||||
messages:
|
||||
},
|
||||
messages:
|
||||
{
|
||||
unit_price:
|
||||
{
|
||||
number:"<?php echo $this->lang->line('items_unit_price_number'); ?>"
|
||||
number: "<?php echo $this->lang->line('items_unit_price_number'); ?>"
|
||||
},
|
||||
tax_percent:
|
||||
{
|
||||
number:"<?php echo $this->lang->line('items_tax_percent_number'); ?>"
|
||||
number: "<?php echo $this->lang->line('items_tax_percent_number'); ?>"
|
||||
},
|
||||
quantity:
|
||||
{
|
||||
number:"<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
number: "<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
},
|
||||
reorder_level:
|
||||
{
|
||||
number:"<?php echo $this->lang->line('items_reorder_level_number'); ?>"
|
||||
number: "<?php echo $this->lang->line('items_reorder_level_number'); ?>"
|
||||
}
|
||||
|
||||
}
|
||||
}, form_support.error));
|
||||
});
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
foreach($inventory_array as $row)
|
||||
{
|
||||
$employee = $this->Employee->get_info($row['trans_user']);
|
||||
array_push($employee_name, $employee->first_name . ' ' . $employee->last_name);
|
||||
array_push($employee_name, $employee->first_name . ' ' . $employee->last_name);
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
@@ -107,22 +107,22 @@ function display_stock(location_id)
|
||||
{
|
||||
var item_quantities = <?php echo json_encode($item_quantities); ?>;
|
||||
document.getElementById("quantity").value = parseFloat(item_quantities[location_id]).toFixed(<?php echo quantity_decimals(); ?>);
|
||||
|
||||
|
||||
var inventory_data = <?php echo json_encode($inventory_array); ?>;
|
||||
var employee_data = <?php echo json_encode($employee_name); ?>;
|
||||
|
||||
|
||||
var table = document.getElementById("inventory_result");
|
||||
|
||||
// Remove old query from tbody
|
||||
var rowCount = table.rows.length;
|
||||
for (var index = rowCount; index > 0; index--)
|
||||
{
|
||||
table.deleteRow(index-1);
|
||||
table.deleteRow(index-1);
|
||||
}
|
||||
|
||||
|
||||
// Add new query to tbody
|
||||
for (var index = 0; index < inventory_data.length; index++)
|
||||
{
|
||||
for (var index = 0; index < inventory_data.length; index++)
|
||||
{
|
||||
var data = inventory_data[index];
|
||||
if(data['trans_location'] == location_id)
|
||||
{
|
||||
@@ -131,17 +131,17 @@ function display_stock(location_id)
|
||||
var td = document.createElement('td');
|
||||
td.appendChild(document.createTextNode(data['trans_date']));
|
||||
tr.appendChild(td);
|
||||
|
||||
|
||||
td = document.createElement('td');
|
||||
td.appendChild(document.createTextNode(employee_data[index]));
|
||||
tr.appendChild(td);
|
||||
|
||||
|
||||
td = document.createElement('td');
|
||||
td.appendChild(document.createTextNode(parseFloat(data['trans_inventory']).toFixed(<?php echo quantity_decimals(); ?>)));
|
||||
td.setAttribute("style", "text-align:center");
|
||||
tr.appendChild(td);
|
||||
|
||||
td = document.createElement('td');
|
||||
|
||||
td = document.createElement('td');
|
||||
td.appendChild(document.createTextNode(data['trans_comment']));
|
||||
tr.appendChild(td);
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ $(document).ready(function()
|
||||
dialog_support.hide();
|
||||
table_support.handle_submit('<?php echo site_url('items'); ?>', response);
|
||||
},
|
||||
dataType:'json'
|
||||
dataType: 'json'
|
||||
});
|
||||
|
||||
},
|
||||
@@ -122,11 +122,10 @@ $(document).ready(function()
|
||||
},
|
||||
messages:
|
||||
{
|
||||
|
||||
newquantity:
|
||||
{
|
||||
required:"<?php echo $this->lang->line('items_quantity_required'); ?>",
|
||||
number:"<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
required: "<?php echo $this->lang->line('items_quantity_required'); ?>",
|
||||
number: "<?php echo $this->lang->line('items_quantity_number'); ?>"
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -137,4 +136,4 @@ function fill_quantity(val)
|
||||
var item_quantities = <?php echo json_encode($item_quantities); ?>;
|
||||
document.getElementById("quantity").value = parseFloat(item_quantities[val]).toFixed(<?php echo quantity_decimals(); ?>);
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="dist/opensourcepos.min.css?rel=1831dfe53b"/>
|
||||
<!-- end mincss template tags -->
|
||||
<!-- start minjs template tags -->
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=0310c09977"></script>
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=c496e315c6"></script>
|
||||
<!-- end minjs template tags -->
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
4
composer.lock
generated
4
composer.lock
generated
@@ -4,8 +4,8 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "35a55acb9ed53dbac86383781fa12b13",
|
||||
"content-hash": "df567f98466ce2053faf0a1d0475afa8",
|
||||
"hash": "70caa9e28d94e2435477700cdba628a5",
|
||||
"content-hash": "2e34a0c173a47d5f39d714465612eff9",
|
||||
"packages": [
|
||||
{
|
||||
"name": "codeigniter/framework",
|
||||
|
||||
Reference in New Issue
Block a user