mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-02-05 15:11:07 -05:00
Fixed customer + supplier search box width + spinner position under linux Fonts set to relative browser size Dutch language files updated (missing labels added) Conflicts: WHATS_NEW.txt application/config/autoload.php application/config/config.php application/config/migration.php application/config/routes.php application/controllers/giftcards.php application/controllers/items.php application/controllers/person_controller.php application/controllers/receivings.php application/controllers/reports.php application/controllers/sales.php application/controllers/suppliers.php application/helpers/table_helper.php application/hooks/load_config.php application/language/english/common_lang.php application/language/english/config_lang.php application/language/english/customers_lang.php application/language/english/employees_lang.php application/language/english/error_lang.php application/language/english/giftcards_lang.php application/language/english/index.html application/language/english/items_lang.php application/language/english/login_lang.php application/language/english/module_lang.php application/language/english/receivings_lang.php application/language/english/reports_lang.php application/language/english/sales_lang.php application/language/english/suppliers_lang.php application/libraries/Receiving_lib.php application/libraries/ofc-library/JSON.php application/libraries/ofc-library/README.txt application/libraries/ofc-library/dot_base.php application/libraries/ofc-library/json_format.php application/libraries/ofc-library/ofc_area_base.php application/libraries/ofc-library/ofc_area_hollow.php application/libraries/ofc-library/ofc_area_line.php application/libraries/ofc-library/ofc_arrow.php application/libraries/ofc-library/ofc_bar.php application/libraries/ofc-library/ofc_bar_3d.php application/libraries/ofc-library/ofc_bar_base.php application/libraries/ofc-library/ofc_bar_filled.php application/libraries/ofc-library/ofc_bar_glass.php application/libraries/ofc-library/ofc_bar_sketch.php application/libraries/ofc-library/ofc_bar_stack.php application/libraries/ofc-library/ofc_candle.php application/libraries/ofc-library/ofc_hbar.php application/libraries/ofc-library/ofc_line.php application/libraries/ofc-library/ofc_line_base.php application/libraries/ofc-library/ofc_line_dot.php application/libraries/ofc-library/ofc_line_hollow.php application/libraries/ofc-library/ofc_line_style.php application/libraries/ofc-library/ofc_menu.php application/libraries/ofc-library/ofc_pie.php application/libraries/ofc-library/ofc_radar_axis.php application/libraries/ofc-library/ofc_radar_axis_labels.php application/libraries/ofc-library/ofc_radar_spoke_labels.php application/libraries/ofc-library/ofc_scatter.php application/libraries/ofc-library/ofc_scatter_line.php application/libraries/ofc-library/ofc_shape.php application/libraries/ofc-library/ofc_sugar.php application/libraries/ofc-library/ofc_tags.php application/libraries/ofc-library/ofc_title.php application/libraries/ofc-library/ofc_tooltip.php application/libraries/ofc-library/ofc_x_axis.php application/libraries/ofc-library/ofc_x_axis_label.php application/libraries/ofc-library/ofc_x_axis_labels.php application/libraries/ofc-library/ofc_x_legend.php application/libraries/ofc-library/ofc_y_axis.php application/libraries/ofc-library/ofc_y_axis_base.php application/libraries/ofc-library/ofc_y_axis_label.php application/libraries/ofc-library/ofc_y_axis_labels.php application/libraries/ofc-library/ofc_y_axis_right.php application/libraries/ofc-library/ofc_y_legend.php application/libraries/ofc-library/open-flash-chart-object.php application/libraries/ofc-library/open-flash-chart.php application/models/giftcard.php application/models/item.php application/models/person.php application/models/receiving.php application/models/sale.php application/models/supplier.php application/views/config.php application/views/items/form.php application/views/items/form_bulk.php application/views/items/manage.php application/views/receivings/receiving.php application/views/reports/date_input.php application/views/reports/listing.php application/views/reports/tabular_details.php application/views/sales/edit.php application/views/sales/register.php application/views/suppliers/form.php css/reports.css css/tables.css database/database.sql import_items.csv index.php js/jquery.ajax_queue.js js/jquery.metadata.js license/license.txt
197 lines
6.5 KiB
PHP
197 lines
6.5 KiB
PHP
<?php
|
|
require_once ("secure_area.php");
|
|
class Receivings extends Secure_area
|
|
{
|
|
function __construct()
|
|
{
|
|
parent::__construct('receivings');
|
|
$this->load->library('receiving_lib');
|
|
}
|
|
|
|
function index()
|
|
{
|
|
$this->_reload();
|
|
}
|
|
|
|
function item_search()
|
|
{
|
|
$suggestions = $this->Item->get_item_search_suggestions($this->input->post('q'),$this->input->post('limit'));
|
|
$suggestions = array_merge($suggestions, $this->Item_kit->get_item_kit_search_suggestions($this->input->post('q'),$this->input->post('limit')));
|
|
echo implode("\n",$suggestions);
|
|
}
|
|
|
|
function supplier_search()
|
|
{
|
|
$suggestions = $this->Supplier->get_suppliers_search_suggestions($this->input->post('q'),$this->input->post('limit'));
|
|
echo implode("\n",$suggestions);
|
|
}
|
|
|
|
function select_supplier()
|
|
{
|
|
$supplier_id = $this->input->post("supplier");
|
|
$this->receiving_lib->set_supplier($supplier_id);
|
|
$this->_reload();
|
|
}
|
|
|
|
function change_mode()
|
|
{
|
|
$mode = $this->input->post("mode");
|
|
$this->receiving_lib->set_mode($mode);
|
|
$this->_reload();
|
|
}
|
|
|
|
function add()
|
|
{
|
|
$data=array();
|
|
$mode = $this->receiving_lib->get_mode();
|
|
$item_id_or_number_or_item_kit_or_receipt = $this->input->post("item");
|
|
$quantity = $mode=="receive" ? 1:-1;
|
|
|
|
if($this->receiving_lib->is_valid_receipt($item_id_or_number_or_item_kit_or_receipt) && $mode=='return')
|
|
{
|
|
$this->receiving_lib->return_entire_receiving($item_id_or_number_or_item_kit_or_receipt);
|
|
}
|
|
elseif($this->receiving_lib->is_valid_item_kit($item_id_or_number_or_item_kit_or_receipt))
|
|
{
|
|
$this->receiving_lib->add_item_kit($item_id_or_number_or_item_kit_or_receipt);
|
|
}
|
|
elseif(!$this->receiving_lib->add_item($item_id_or_number_or_item_kit_or_receipt,$quantity))
|
|
{
|
|
$data['error']=$this->lang->line('recvs_unable_to_add_item');
|
|
}
|
|
$this->_reload($data);
|
|
}
|
|
|
|
function edit_item($item_id)
|
|
{
|
|
$data= array();
|
|
|
|
$this->form_validation->set_rules('price', 'lang:items_price', 'required|numeric');
|
|
$this->form_validation->set_rules('quantity', 'lang:items_quantity', 'required|integer');
|
|
$this->form_validation->set_rules('discount', 'lang:items_discount', 'required|integer');
|
|
|
|
$description = $this->input->post("description");
|
|
$serialnumber = $this->input->post("serialnumber");
|
|
$price = $this->input->post("price");
|
|
$quantity = $this->input->post("quantity");
|
|
$discount = $this->input->post("discount");
|
|
|
|
if ($this->form_validation->run() != FALSE)
|
|
{
|
|
$this->receiving_lib->edit_item($item_id,$description,$serialnumber,$quantity,$discount,$price);
|
|
}
|
|
else
|
|
{
|
|
$data['error']=$this->lang->line('recvs_error_editing_item');
|
|
}
|
|
|
|
$this->_reload($data);
|
|
}
|
|
|
|
function delete_item($item_number)
|
|
{
|
|
$this->receiving_lib->delete_item($item_number);
|
|
$this->_reload();
|
|
}
|
|
|
|
function delete_supplier()
|
|
{
|
|
$this->receiving_lib->delete_supplier();
|
|
$this->_reload();
|
|
}
|
|
|
|
function complete()
|
|
{
|
|
$data['cart']=$this->receiving_lib->get_cart();
|
|
$data['total']=$this->receiving_lib->get_total();
|
|
$data['receipt_title']=$this->lang->line('recvs_receipt');
|
|
$data['transaction_time']= date('m/d/Y h:i:s a');
|
|
$supplier_id=$this->receiving_lib->get_supplier();
|
|
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
|
|
$comment = $this->input->post('comment');
|
|
$emp_info=$this->Employee->get_info($employee_id);
|
|
$payment_type = $this->input->post('payment_type');
|
|
$data['payment_type']=$this->input->post('payment_type');
|
|
|
|
if ($this->input->post('amount_tendered'))
|
|
{
|
|
$data['amount_tendered'] = $this->input->post('amount_tendered');
|
|
$data['amount_change'] = to_currency($data['amount_tendered'] - round($data['total'], 2));
|
|
}
|
|
$data['employee']=$emp_info->first_name.' '.$emp_info->last_name;
|
|
|
|
if($supplier_id!=-1)
|
|
{
|
|
$suppl_info=$this->Supplier->get_info($supplier_id);
|
|
$data['supplier']=$suppl_info->first_name.' '.$suppl_info->last_name;
|
|
}
|
|
|
|
//SAVE receiving to database
|
|
$data['receiving_id']='RECV '.$this->Receiving->save($data['cart'], $supplier_id,$employee_id,$comment,$payment_type);
|
|
|
|
if ($data['receiving_id'] == 'RECV -1')
|
|
{
|
|
$data['error_message'] = $this->lang->line('receivings_transaction_failed');
|
|
}
|
|
|
|
$this->load->view("receivings/receipt",$data);
|
|
$this->receiving_lib->clear_all();
|
|
}
|
|
|
|
function receipt($receiving_id)
|
|
{
|
|
$receiving_info = $this->Receiving->get_info($receiving_id)->row_array();
|
|
$this->receiving_lib->copy_entire_receiving($receiving_id);
|
|
$data['cart']=$this->receiving_lib->get_cart();
|
|
$data['total']=$this->receiving_lib->get_total();
|
|
$data['receipt_title']=$this->lang->line('recvs_receipt');
|
|
$data['transaction_time']= date('m/d/Y h:i:s a', strtotime($receiving_info['receiving_time']));
|
|
$supplier_id=$this->receiving_lib->get_supplier();
|
|
$emp_info=$this->Employee->get_info($receiving_info['employee_id']);
|
|
$data['payment_type']=$receiving_info['payment_type'];
|
|
|
|
$data['employee']=$emp_info->first_name.' '.$emp_info->last_name;
|
|
|
|
if($supplier_id!=-1)
|
|
{
|
|
$supplier_info=$this->Supplier->get_info($supplier_id);
|
|
$data['supplier']=$supplier_info->first_name.' '.$supplier_info->last_name;
|
|
}
|
|
$data['receiving_id']='RECV '.$receiving_id;
|
|
$this->load->view("receivings/receipt",$data);
|
|
$this->receiving_lib->clear_all();
|
|
|
|
}
|
|
|
|
function _reload($data=array())
|
|
{
|
|
$person_info = $this->Employee->get_logged_in_employee_info();
|
|
$data['cart']=$this->receiving_lib->get_cart();
|
|
$data['modes']=array('receive'=>$this->lang->line('recvs_receiving'),'return'=>$this->lang->line('recvs_return'));
|
|
$data['mode']=$this->receiving_lib->get_mode();
|
|
$data['total']=$this->receiving_lib->get_total();
|
|
$data['items_module_allowed'] = $this->Employee->has_permission('items', $person_info->person_id);
|
|
$data['payment_options']=array(
|
|
$this->lang->line('sales_cash') => $this->lang->line('sales_cash'),
|
|
$this->lang->line('sales_check') => $this->lang->line('sales_check'),
|
|
$this->lang->line('sales_debit') => $this->lang->line('sales_debit'),
|
|
$this->lang->line('sales_credit') => $this->lang->line('sales_credit')
|
|
);
|
|
|
|
$supplier_id=$this->receiving_lib->get_supplier();
|
|
if($supplier_id!=-1)
|
|
{
|
|
$info=$this->Supplier->get_info($supplier_id);
|
|
$data['supplier']=$info->first_name.' '.$info->last_name;
|
|
}
|
|
$this->load->view("receivings/receiving",$data);
|
|
}
|
|
|
|
function cancel_receiving()
|
|
{
|
|
$this->receiving_lib->clear_all();
|
|
$this->_reload();
|
|
}
|
|
|
|
}
|
|
?>
|