This commit is contained in:
sonnysk76
2016-06-10 16:58:26 -05:00
parent fa01e18e41
commit 9f7ea6f1cb
317 changed files with 7335 additions and 17124 deletions

View File

@@ -1,5 +1,6 @@
{
"scripts": {
"postinstall": "grunt"
"postinstall": "grunt",
"postuninstall": "grunt"
}
}

21
.dockerignore Normal file
View File

@@ -0,0 +1,21 @@
node_modules
bower_components
tmp
application/config/email.php
application/config/database.php
*.patch
patches/
.idea/
git-svn-diff.py
*.bash
.swp
.buildpath
.project
.settings/*
*.swp
*.rej
*.orig
*~
*.~
*.log
application/sessions/*

View File

@@ -1,16 +1,34 @@
sudo: false
sudo: true # Required to install packages
language: node_js
services: - docker
node_js:
- "4.1"
env:
global:
- DOCKER_VERSION=1.7.1 # Install Docker version 1.7.1
- DOCKER_COMPOSE_VERSION=1.7.1
- DOCKER_VERSION=get.docker.com # Install Docker using get.docker.com (may break)
services:
- docker
- BRANCH=stable # Use 'stable' branch
- BRANCH=develop # Use 'develop' branch
- QUIET=1 # Less verbose logging
- UML_FIG=0 # Don't install fig
- UML_DOCKERCOMPOSE=1 # Install docker-compose
install:
# Install https://github.com/moul/travis-docker toolchain
# - curl -sLo - http://j.mp/install-travis-docker | sh -xe
before_install:
- docker build -t jekkos/opensourcepos .
- docker run -d jekkos/opensourcepos
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- docker-compose build
- docker-compose up -d
script:
- docker exec -t -i $(docker ps | tail -n 1 | cut -d' ' -f1) /bin/sh -c "while ! curl http://localhost/index.php | grep username; do sleep 1; done; cd app && grunt mochaWebdriver:test"
- docker-wait opensourcepos_php_1
after_success:
- docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker push jekkos/opensourcepos

View File

@@ -1,27 +1,19 @@
FROM ubuntu:utopic
FROM php:5-apache
MAINTAINER jekkos
RUN sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-client mysql-server apache2 libapache2-mod-php5 pwgen python-setuptools vim-tiny php5-mysql php5-gd php5-apcu nodejs npm curl
RUN easy_install supervisor
ADD ./docker/foreground.sh /etc/apache2/foreground.sh
ADD ./docker/supervisord.conf /etc/supervisord.conf
RUN chmod 755 /etc/apache2/foreground.sh
# Install dependencies
RUN apt-get install -y --no-install-recommends software-properties-common
RUN apt-get install -y python git
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
php5-gd \
php5-apcu
# Get latest Ospos source from Git
RUN git clone https://github.com/jekkos/opensourcepos.git /app
RUN cd app && git checkout origin/master
RUN ln -s /usr/bin/nodejs /usr/bin/node
RUN cd app && npm install
RUN npm install -g grunt-cli
RUN ln -s /usr/local/bin/grunt /usr/bin/grunt
RUN a2enmod rewrite
RUN docker-php-ext-install mysql mysqli
RUN ln -fs /app/* /var/www/html
ADD ./docker/start_container.sh /start_container.sh
RUN chmod 755 /start_container.sh
EXPOSE 80 3306
CMD ["/bin/bash", "/start_container.sh"]
WORKDIR /app
COPY . /app
RUN cp application/config/database.php.tmpl application/config/database.php && \
sed -i -e "s/\(localhost\)/web/g" test/ospos.js && \
sed -i -e "s/\(user.*\?=.\).*\(.\)$/\1'${MYSQL_USERNAME}'\2/g" application/config/database.php && \
sed -i -e "s/\(password.*\?=.\).*\(.\)$/\1'${MYSQL_PASSWORD}'\2/g" application/config/database.php && \
sed -i -e "s/\(database.*\?=.\).*\(.\)$/\1'${MYSQL_DB_NAME}'\2/g" application/config/database.php && \
sed -i -e "s/\(hostname.*\?=.\).*\(.\)$/\1'${MYSQL_HOST_NAME}'\2/g" application/config/database.php

11
Dockerfile.test Normal file
View File

@@ -0,0 +1,11 @@
FROM digitallyseamless/nodejs-bower-grunt:5
MAINTAINER jekkos
apt-get install curl
COPY Gruntfile.js .
COPY package.json .
COPY test .
RUN npm install
CMD ['while ! curl web/index.php | grep username; do sleep 1; done; && grunt mochaWebdriver:test']

View File

@@ -17,7 +17,8 @@ module.exports = function(grunt) {
bower_concat: {
all: {
mainFiles: {
'bootswatch-dist': ['bootstrap/dist/js/bootstrap.js']
'bootswatch-dist': ['bootstrap/dist/js/bootstrap.js'],
'bootstrap-table': [ "src/bootstrap-table.js", "src/bootstrap-table.css", "dist/extensions/export/bootstrap-table-export.js", "dist/extensions/mobile/bootstrap-table-mobile.js"]
},
dest: {
'js': 'tmp/opensourcepos_bower.js',
@@ -146,8 +147,7 @@ module.exports = function(grunt) {
absolutePath: true
},
src: ['js/jquery*', 'js/*.js'],
dest: 'application/views/partial/header.php',
dest: 'templates/spacelab/views/partial/header.php'
dest: 'application/views/partial/header.php'
},
minjs: {
options: {
@@ -157,8 +157,7 @@ module.exports = function(grunt) {
absolutePath: true
},
src: ['dist/*min.js'],
dest: 'application/views/partial/header.php',
dest: 'templates/spacelab/views/partial/header.php'
dest: 'application/views/partial/header.php'
}
},
mochaWebdriver: {
@@ -195,6 +194,7 @@ module.exports = function(grunt) {
});
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-mocha-webdriver');
grunt.registerTask('default', ['wiredep', 'bower_concat', 'bowercopy', 'concat', 'uglify', 'cssmin', 'tags', 'cachebreaker']);

View File

@@ -58,23 +58,14 @@ FAQ
---
If a blank page (HTTP status 500) shows after search completion or receipt generation, then double check php5-gd presence in your php installation. On windows check in php.ini whether the lib is installed. On Ubuntu issue `sudo apt-get install php5-gd`. Also have a look at the Dockerfile for a complete list of recommended packages.
13/01/2016: Install using Docker
08/06/2014: Install using Docker
--------------------------------
From now on ospos can be deployed using Docker on Linux, Mac or Windows. This setup dramatically reduces the number of possible issues as all setup is now done in a Dockerfile. Docker runs natively on mac and linux, but will require more overhead on windows. Please refer to the docker documentation for instructions on how to set it up on your platform.
To build and run the image, issue following commands in a terminal with docker installed
docker build -t me/ospos https://github.com/jekkos/opensourcepos.git
docker run -d -p 80:80 me/ospos
Docker will clone the latest master into the image and start a LAMP stack with the application configured. If you like to persist your changes in this install, then you can use two docker data containers to store database and filesystem changes. In this case you will need following command (first time only)
docker run -d -v /app --name="ospos" -v /var/lib/mysql --name="ospos-sql" -p 127.0.0.1:80:80 me/ospos
After stopping the created container for the first time, this command will be replaced with
docker run -d -v /app --volumes-from="ospos" -v /var/lib/mysql --volumes-from="ospos-sql" -p 127.0.0.1:80:80 me/ospos
Both the data and mysql directories will be persisted in a separate docker container and can be mounted within any other container using the last command. A more extensive setup guide can be found at [this site](http://www.opensourceposguide.com/guide/gettingstarted/installation)
docker-compose build
docker-commpose up

View File

@@ -89,7 +89,7 @@ $config['url_suffix'] = '';
| than english.
|
*/
$config['language'] = 'en';
$config['language'] = 'es';
/*
|--------------------------------------------------------------------------
@@ -327,7 +327,7 @@ $config['cache_query_string'] = FALSE;
| https://codeigniter.com/user_guide/libraries/encryption.html
|
*/
$config['encryption_key'] = '';
$config['encryption_key'] = 'r';
/*
|--------------------------------------------------------------------------

View File

@@ -57,13 +57,12 @@ $route['sales/index/([^/]+)'] = 'sales/manage/$1';
$route['sales/index/([^/]+)/([^/]+)'] = 'sales/manage/$1/$2';
$route['sales/index/([^/]+)/([^/]+)/([^/]+)'] = 'sales/manage/$1/$2/$3';
$route['reports/(summary_:any)/([^/]+)/([^/]+)'] = 'reports/$1/$2/$3';
$route['reports/summary_:any'] = 'reports/date_input_excel_export';
$route['reports/summary_:any'] = 'reports/date_input';
$route['reports/(graphical_:any)/([^/]+)/([^/]+)'] = 'reports/$1/$2/$3';
$route['reports/graphical_:any'] = 'reports/date_input';
$route['reports/(inventory_:any)/([^/]+)'] = 'reports/$1/$2';
$route['reports/inventory_:any'] = 'reports/excel_export';
$route['reports/inventory_summary'] = 'reports/inventory_summary_input';
$route['reports/(inventory_summary)/([^/]+)/([^/]+)/([^/]+)'] = 'reports/$1/$2/$3/$4';
$route['reports/(inventory_summary)/([^/]+)/([^/]+)/([^/]+)'] = 'reports/$1/$2';
$route['reports/(detailed_sales)/([^/]+)/([^/]+)/([^/]+)'] = 'reports/$1/$2/$3$/$4';
$route['reports/detailed_sales'] = 'reports/date_input_sales';

View File

@@ -1,16 +0,0 @@
<?php
require_once ("Secure_area.php");
class Barcode extends Secure_area
{
function __construct()
{
parent::__construct();
}
function index()
{
$this->load->view('barcode');
}
}
?>

View File

@@ -1,125 +1,138 @@
<?php
require_once ("Secure_area.php");
class Config extends Secure_area
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once("Secure_Controller.php");
class Config extends Secure_Controller
{
function __construct()
public function __construct()
{
parent::__construct('config');
$this->load->library('barcode_lib');
}
function index()
public function index()
{
$location_names = array();
$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') != '';
$data = $this->xss_clean($data);
$this->load->view("configs/manage", $data);
}
function save_info()
public function save_info()
{
$upload_success = $this->_handle_logo_upload();
$upload_data = $this->upload->data();
$batch_save_data = array(
'company'=>$this->input->post('company'),
'address'=>$this->input->post('address'),
'phone'=>$this->input->post('phone'),
'email'=>$this->input->post('email'),
'fax'=>$this->input->post('fax'),
'website'=>$this->input->post('website'),
'return_policy'=>$this->input->post('return_policy')
'company' => $this->input->post('company'),
'address' => $this->input->post('address'),
'phone' => $this->input->post('phone'),
'email' => $this->input->post('email'),
'fax' => $this->input->post('fax'),
'website' => $this->input->post('website'),
'return_policy' => $this->input->post('return_policy')
);
if (!empty($upload_data['orig_name']))
{
$batch_save_data['company_logo'] = $upload_data['raw_name'] . $upload_data['file_ext'];
// XSS file image sanity check
if ($this->xss_clean($upload_data['raw_name'], TRUE) === TRUE)
{
$batch_save_data['company_logo'] = $upload_data['raw_name'] . $upload_data['file_ext'];
}
}
$result = $this->Appconfig->batch_save($batch_save_data);
$success = $upload_success && $result ? true : false;
$success = $upload_success && $result ? TRUE : FALSE;
$message = $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully');
$message = $upload_success ? $message : $this->upload->display_errors();
echo json_encode(array('success'=>$success, 'message'=>$message));
echo json_encode(array('success' => $success, 'message' => $message));
}
function save_general()
public function save_general()
{
$batch_save_data = array(
'default_tax_1_rate'=>$this->input->post('default_tax_1_rate'),
'default_tax_1_name'=>$this->input->post('default_tax_1_name'),
'default_tax_2_rate'=>$this->input->post('default_tax_2_rate'),
'default_tax_2_name'=>$this->input->post('default_tax_2_name'),
'tax_included'=>$this->input->post('tax_included') != null,
'receiving_calculate_average_price'=>$this->input->post('receiving_calculate_average_price') != null,
'lines_per_page'=>$this->input->post('lines_per_page'),
'default_sales_discount'=>$this->input->post('default_sales_discount'),
'custom1_name'=>$this->input->post('custom1_name'),
'custom2_name'=>$this->input->post('custom2_name'),
'custom3_name'=>$this->input->post('custom3_name'),
'custom4_name'=>$this->input->post('custom4_name'),
'custom5_name'=>$this->input->post('custom5_name'),
'custom6_name'=>$this->input->post('custom6_name'),
'custom7_name'=>$this->input->post('custom7_name'),
'custom8_name'=>$this->input->post('custom8_name'),
'custom9_name'=>$this->input->post('custom9_name'),
'custom10_name'=>$this->input->post('custom10_name')
'default_tax_1_rate' => $this->input->post('default_tax_1_rate'),
'default_tax_1_name' => $this->input->post('default_tax_1_name'),
'default_tax_2_rate' => $this->input->post('default_tax_2_rate'),
'default_tax_2_name' => $this->input->post('default_tax_2_name'),
'tax_included' => $this->input->post('tax_included') != NULL,
'receiving_calculate_average_price' => $this->input->post('receiving_calculate_average_price') != NULL,
'lines_per_page' => $this->input->post('lines_per_page'),
'default_sales_discount' => $this->input->post('default_sales_discount'),
'config_notify_horizontal_position' => $this->input->post('config_notify_horizontal_position'),
'config_notify_vertical_position' => $this->input->post('config_notify_vertical_position'),
'custom1_name' => $this->input->post('custom1_name'),
'custom2_name' => $this->input->post('custom2_name'),
'custom3_name' => $this->input->post('custom3_name'),
'custom4_name' => $this->input->post('custom4_name'),
'custom5_name' => $this->input->post('custom5_name'),
'custom6_name' => $this->input->post('custom6_name'),
'custom7_name' => $this->input->post('custom7_name'),
'custom8_name' => $this->input->post('custom8_name'),
'custom9_name' => $this->input->post('custom9_name'),
'custom10_name' => $this->input->post('custom10_name')
);
$result = $this->Appconfig->batch_save($batch_save_data);
$success = $result ? true : false;
$success = $result ? TRUE : FALSE;
echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
}
function save_locale()
{
$batch_save_data = array(
'currency_symbol'=>$this->input->post('currency_symbol'),
'currency_side'=>$this->input->post('currency_side') != null,
'language'=>$this->input->post('language'),
'timezone'=>$this->input->post('timezone'),
'dateformat'=>$this->input->post('dateformat'),
'timeformat'=>$this->input->post('timeformat'),
'thousands_separator'=>$this->input->post('thousands_separator'),
'decimal_point'=>$this->input->post('decimal_point'),
'currency_decimals'=>$this->input->post('currency_decimals'),
'tax_decimals'=>$this->input->post('tax_decimals'),
'quantity_decimals'=>$this->input->post('quantity_decimals')
'currency_symbol' => $this->input->post('currency_symbol'),
'currency_side' => $this->input->post('currency_side') != NULL,
'language' => $this->input->post('language'),
'timezone' => $this->input->post('timezone'),
'dateformat' => $this->input->post('dateformat'),
'timeformat' => $this->input->post('timeformat'),
'thousands_separator' => $this->input->post('thousands_separator'),
'decimal_point' => $this->input->post('decimal_point'),
'currency_decimals' => $this->input->post('currency_decimals'),
'tax_decimals' => $this->input->post('tax_decimals'),
'quantity_decimals' => $this->input->post('quantity_decimals'),
'country_codes' => $this->input->post('country_codes')
);
$result = $this->Appconfig->batch_save($batch_save_data);
$success = $result ? true : false;
$success = $result ? TRUE : FALSE;
echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
}
function save_message()
public function save_message()
{
$batch_save_data = array(
'msg_msg'=>$this->input->post('msg_msg'),
'msg_uid'=>$this->input->post('msg_uid'),
'msg_pwd'=>$this->input->post('msg_pwd'),
'msg_src'=>$this->input->post('msg_src')
'msg_msg' => $this->input->post('msg_msg'),
'msg_uid' => $this->input->post('msg_uid'),
'msg_pwd' => $this->input->post('msg_pwd'),
'msg_src' => $this->input->post('msg_src')
);
$result = $this->Appconfig->batch_save($batch_save_data);
$success = $result ? true : false;
$success = $result ? TRUE : FALSE;
echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
}
function stock_locations()
public function stock_locations()
{
$stock_locations = $this->Stock_location->get_all()->result_array();
$stock_locations = $this->xss_clean($stock_locations);
$this->load->view('partial/stock_locations', array('stock_locations'=>$stock_locations));
$this->load->view('partial/stock_locations', array('stock_locations' => $stock_locations));
}
function _clear_session_state()
private function _clear_session_state()
{
$this->load->library('sale_lib');
$this->sale_lib->clear_sale_location();
@@ -130,7 +143,7 @@ class Config extends Secure_area
$this->receiving_lib->clear_all();
}
function save_locations()
public function save_locations()
{
$this->db->trans_start();
@@ -142,7 +155,7 @@ class Config extends Secure_area
$location_id = preg_replace("/.*?_(\d+)$/", "$1", $key);
unset($deleted_locations[$location_id]);
// save or update
$location_data = array('location_name'=>$value);
$location_data = array('location_name' => $value);
if ($this->Stock_location->save($location_data, $location_id))
{
$this->_clear_session_state();
@@ -156,80 +169,82 @@ class Config extends Secure_area
$this->Stock_location->delete($location_id);
}
$success = $this->db->trans_complete();
$this->db->trans_complete();
echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
$success = $this->db->trans_status();
echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
}
function save_barcode()
public function save_barcode()
{
$batch_save_data = array(
'barcode_type'=>$this->input->post('barcode_type'),
'barcode_quality'=>$this->input->post('barcode_quality'),
'barcode_width'=>$this->input->post('barcode_width'),
'barcode_height'=>$this->input->post('barcode_height'),
'barcode_font'=>$this->input->post('barcode_font'),
'barcode_font_size'=>$this->input->post('barcode_font_size'),
'barcode_first_row'=>$this->input->post('barcode_first_row'),
'barcode_second_row'=>$this->input->post('barcode_second_row'),
'barcode_third_row'=>$this->input->post('barcode_third_row'),
'barcode_num_in_row'=>$this->input->post('barcode_num_in_row'),
'barcode_page_width'=>$this->input->post('barcode_page_width'),
'barcode_page_cellspacing'=>$this->input->post('barcode_page_cellspacing'),
'barcode_generate_if_empty'=>$this->input->post('barcode_generate_if_empty') != null,
'barcode_content'=>$this->input->post('barcode_content')
'barcode_type' => $this->input->post('barcode_type'),
'barcode_quality' => $this->input->post('barcode_quality'),
'barcode_width' => $this->input->post('barcode_width'),
'barcode_height' => $this->input->post('barcode_height'),
'barcode_font' => $this->input->post('barcode_font'),
'barcode_font_size' => $this->input->post('barcode_font_size'),
'barcode_first_row' => $this->input->post('barcode_first_row'),
'barcode_second_row' => $this->input->post('barcode_second_row'),
'barcode_third_row' => $this->input->post('barcode_third_row'),
'barcode_num_in_row' => $this->input->post('barcode_num_in_row'),
'barcode_page_width' => $this->input->post('barcode_page_width'),
'barcode_page_cellspacing' => $this->input->post('barcode_page_cellspacing'),
'barcode_generate_if_empty' => $this->input->post('barcode_generate_if_empty') != NULL,
'barcode_content' => $this->input->post('barcode_content')
);
$result = $this->Appconfig->batch_save($batch_save_data);
$success = $result ? true : false;
$success = $result ? TRUE : FALSE;
echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
}
function save_receipt()
public function save_receipt()
{
$batch_save_data = array (
'receipt_show_taxes'=>$this->input->post('receipt_show_taxes') != null,
'receipt_show_total_discount'=>$this->input->post('receipt_show_total_discount') != null,
'receipt_show_description'=>$this->input->post('receipt_show_description') != null,
'receipt_show_serialnumber'=>$this->input->post('receipt_show_serialnumber') != null,
'print_silently'=>$this->input->post('print_silently') != null,
'print_header'=>$this->input->post('print_header') != null,
'print_footer'=>$this->input->post('print_footer') != null,
'print_top_margin'=>$this->input->post('print_top_margin'),
'print_left_margin'=>$this->input->post('print_left_margin'),
'print_bottom_margin'=>$this->input->post('print_bottom_margin'),
'print_right_margin'=>$this->input->post('print_right_margin')
'receipt_show_taxes' => $this->input->post('receipt_show_taxes') != NULL,
'receipt_show_total_discount' => $this->input->post('receipt_show_total_discount') != NULL,
'receipt_show_description' => $this->input->post('receipt_show_description') != NULL,
'receipt_show_serialnumber' => $this->input->post('receipt_show_serialnumber') != NULL,
'print_silently' => $this->input->post('print_silently') != NULL,
'print_header' => $this->input->post('print_header') != NULL,
'print_footer' => $this->input->post('print_footer') != NULL,
'print_top_margin' => $this->input->post('print_top_margin'),
'print_left_margin' => $this->input->post('print_left_margin'),
'print_bottom_margin' => $this->input->post('print_bottom_margin'),
'print_right_margin' => $this->input->post('print_right_margin')
);
$result = $this->Appconfig->batch_save($batch_save_data);
$success = $result ? true : false;
$success = $result ? TRUE : FALSE;
echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
}
function save_invoice()
public function save_invoice()
{
$batch_save_data = array (
'invoice_enable'=>$this->input->post('invoice_enable') != null,
'sales_invoice_format'=>$this->input->post('sales_invoice_format'),
'recv_invoice_format'=>$this->input->post('recv_invoice_format'),
'use_invoice_template'=>$this->input->post('use_invoice_template') != null,
'invoice_default_comments'=>$this->input->post('invoice_default_comments'),
'invoice_email_message'=>$this->input->post('invoice_email_message')
'invoice_enable' => $this->input->post('invoice_enable') != NULL,
'sales_invoice_format' => $this->input->post('sales_invoice_format'),
'recv_invoice_format' => $this->input->post('recv_invoice_format'),
'use_invoice_template' => $this->input->post('use_invoice_template') != NULL,
'invoice_default_comments' => $this->input->post('invoice_default_comments'),
'invoice_email_message' => $this->input->post('invoice_email_message')
);
$result = $this->Appconfig->batch_save($batch_save_data);
$success = $result ? true : false;
$success = $result ? TRUE : FALSE;
echo json_encode(array('success'=>$success, 'message'=>$this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
echo json_encode(array('success' => $success, 'message' => $this->lang->line('config_saved_' . ($success ? '' : 'un') . 'successfully')));
}
public function remove_logo()
{
$result = $this->Appconfig->batch_save(array('company_logo' => ''));
echo json_encode(array('success'=>$result));
echo json_encode(array('success' => $result));
}
private function _handle_logo_upload()
@@ -249,12 +264,13 @@ class Config extends Secure_area
return strlen($this->upload->display_errors()) == 0 || !strcmp($this->upload->display_errors(), '<p>'.$this->lang->line('upload_no_file_selected').'</p>');
}
function backup_db()
public function backup_db()
{
$employee_id = $this->Employee->get_logged_in_employee_info()->person_id;
if($this->Employee->has_module_grant('config',$employee_id))
if($this->Employee->has_module_grant('config', $employee_id))
{
$this->load->dbutil();
$prefs = array(
'format' => 'zip',
'filename' => 'ospos.sql'
@@ -263,12 +279,13 @@ class Config extends Secure_area
$backup =& $this->dbutil->backup($prefs);
$file_name = 'ospos-' . date("Y-m-d-H-i-s") .'.zip';
$save = 'uploads/'.$file_name;
$save = 'uploads/' . $file_name;
$this->load->helper('download');
while (ob_get_level())
while(ob_get_level())
{
ob_end_clean();
}
force_download($file_name, $backup);
}
else

View File

@@ -1,20 +1,17 @@
<?php
require_once ("Person_controller.php");
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Customers extends Person_controller
require_once("Persons.php");
class Customers extends Persons
{
function __construct()
public function __construct()
{
parent::__construct('customers');
}
function index($limit_from=0)
public function index()
{
$data['controller_name'] = $this->get_controller_name();
$lines_per_page = $this->Appconfig->get('lines_per_page');
$customers = $this->Customer->get_all($lines_per_page, $limit_from);
$data['links'] = $this->_initialize_pagination($this->Customer, $lines_per_page, $limit_from);
$data['manage_table'] = get_people_manage_table($customers, $this);
$data['table_headers'] = $this->xss_clean(get_people_manage_table_headers());
$this->load->view('people/manage', $data);
}
@@ -22,33 +19,41 @@ class Customers extends Person_controller
/*
Returns customer table data rows. This will be called with AJAX.
*/
function search()
public function search()
{
$search = $this->input->post('search') != '' ? $this->input->post('search') : null;
$limit_from = $this->input->post('limit_from');
$lines_per_page = $this->Appconfig->get('lines_per_page');
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$order = $this->input->get('order');
$customers = $this->Customer->search($search, $lines_per_page, $limit_from);
$customers = $this->Customer->search($search, $limit, $offset, $sort, $order);
$total_rows = $this->Customer->get_found_rows($search);
$links = $this->_initialize_pagination($this->Customer,$lines_per_page, $limit_from, $total_rows);
$data_rows = get_people_manage_table_data_rows($customers, $this);
echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
$data_rows = array();
foreach($customers->result() as $person)
{
$data_rows[] = get_person_data_row($person, $this);
}
$data_rows = $this->xss_clean($data_rows);
echo json_encode(array('total' => $total_rows, 'rows' => $data_rows));
}
/*
Gives search suggestions based on what is being searched for
*/
function suggest()
public function suggest()
{
$suggestions = $this->Customer->get_search_suggestions($this->input->get('term'), TRUE);
$suggestions = $this->xss_clean($this->Customer->get_search_suggestions($this->input->get('term'), TRUE));
echo json_encode($suggestions);
}
function suggest_search()
public function suggest_search()
{
$suggestions = $this->Customer->get_search_suggestions($this->input->post('term'), FALSE);
$suggestions = $this->xss_clean($this->Customer->get_search_suggestions($this->input->post('term'), FALSE));
echo json_encode($suggestions);
}
@@ -56,10 +61,16 @@ class Customers extends Person_controller
/*
Loads the customer edit form
*/
function view($customer_id=-1)
public function view($customer_id = -1)
{
$data['person_info'] = $this->Customer->get_info($customer_id);
$data['total'] = $this->Customer->get_totals($customer_id)->total;
$info = $this->Customer->get_info($customer_id);
foreach(get_object_vars($info) as $property => $value)
{
$info->$property = $this->xss_clean($value);
}
$data['person_info'] = $info;
$data['total'] = $this->xss_clean($this->Customer->get_totals($customer_id)->total);
$this->load->view("customers/form", $data);
}
@@ -67,52 +78,58 @@ class Customers extends Person_controller
/*
Inserts/updates a customer
*/
function save($customer_id=-1)
public function save($customer_id = -1)
{
$person_data = array(
'first_name'=>$this->input->post('first_name'),
'last_name'=>$this->input->post('last_name'),
'gender'=>$this->input->post('gender'),
'email'=>$this->input->post('email'),
'phone_number'=>$this->input->post('phone_number'),
'address_1'=>$this->input->post('address_1'),
'address_2'=>$this->input->post('address_2'),
'city'=>$this->input->post('city'),
'state'=>$this->input->post('state'),
'zip'=>$this->input->post('zip'),
'country'=>$this->input->post('country'),
'comments'=>$this->input->post('comments')
'first_name' => $this->input->post('first_name'),
'last_name' => $this->input->post('last_name'),
'gender' => $this->input->post('gender'),
'email' => $this->input->post('email'),
'phone_number' => $this->input->post('phone_number'),
'address_1' => $this->input->post('address_1'),
'address_2' => $this->input->post('address_2'),
'city' => $this->input->post('city'),
'state' => $this->input->post('state'),
'zip' => $this->input->post('zip'),
'country' => $this->input->post('country'),
'comments' => $this->input->post('comments')
);
$customer_data=array(
'account_number'=>$this->input->post('account_number') == '' ? null : $this->input->post('account_number'),
'company_name'=>$this->input->post('company_name') == '' ? null : $this->input->post('company_name'),
'discount_percent'=>$this->input->post('discount_percent') == '' ? 0.00 : $this->input->post('discount_percent'),
'taxable'=>$this->input->post('taxable') != null
$customer_data = array(
'account_number' => $this->input->post('account_number') == '' ? NULL : $this->input->post('account_number'),
'company_name' => $this->input->post('company_name') == '' ? NULL : $this->input->post('company_name'),
'discount_percent' => $this->input->post('discount_percent') == '' ? 0.00 : $this->input->post('discount_percent'),
'taxable' => $this->input->post('taxable') != NULL
);
if($this->Customer->save_customer($person_data,$customer_data,$customer_id))
if($this->Customer->save_customer($person_data, $customer_data, $customer_id))
{
$person_data = $this->xss_clean($person_data);
$customer_data = $this->xss_clean($customer_data);
//New customer
if($customer_id==-1)
if($customer_id == -1)
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('customers_successful_adding').' '.
$person_data['first_name'].' '.$person_data['last_name'],'person_id'=>$customer_data['person_id']));
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('customers_successful_adding').' '.
$person_data['first_name'].' '.$person_data['last_name'], 'id' => $customer_data['person_id']));
}
else //previous customer
else //Existing customer
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('customers_successful_updating').' '.
$person_data['first_name'].' '.$person_data['last_name'],'person_id'=>$customer_id));
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('customers_successful_updating').' '.
$person_data['first_name'].' '.$person_data['last_name'], 'id' => $customer_id));
}
}
else//failure
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('customers_error_adding_updating').' '.
$person_data['first_name'].' '.$person_data['last_name'],'person_id'=>-1));
{
$person_data = $this->xss_clean($person_data);
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_error_adding_updating').' '.
$person_data['first_name'].' '.$person_data['last_name'], 'id' => -1));
}
}
function check_account_number()
public function check_account_number()
{
$exists = $this->Customer->account_number_exists($this->input->post('account_number'),$this->input->post('person_id'));
$exists = $this->Customer->account_number_exists($this->input->post('account_number'), $this->input->post('person_id'));
echo !$exists ? 'true' : 'false';
}
@@ -120,83 +137,93 @@ class Customers extends Person_controller
/*
This deletes customers from the customers table
*/
function delete()
public function delete()
{
$customers_to_delete=$this->input->post('ids');
$customers_to_delete = $this->xss_clean($this->input->post('ids'));
if($this->Customer->delete_list($customers_to_delete))
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('customers_successful_deleted').' '.
count($customers_to_delete).' '.$this->lang->line('customers_one_or_multiple')));
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('customers_successful_deleted').' '.
count($customers_to_delete).' '.$this->lang->line('customers_one_or_multiple')));
}
else
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('customers_cannot_be_deleted')));
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_cannot_be_deleted')));
}
}
function excel()
/*
Customer import from excel spreadsheet
*/
public function excel()
{
$data = file_get_contents("import_customers.csv");
$name = 'import_customers.csv';
$data = file_get_contents($name);
force_download($name, $data);
}
function excel_import()
public function excel_import()
{
$this->load->view("customers/form_excel_import", null);
$this->load->view('customers/form_excel_import', NULL);
}
function do_excel_import()
public function do_excel_import()
{
$msg = 'do_excel_import';
$failCodes = array();
if ($_FILES['file_path']['error']!=UPLOAD_ERR_OK)
if($_FILES['file_path']['error'] != UPLOAD_ERR_OK)
{
$msg = $this->lang->line('items_excel_import_failed');
echo json_encode( array('success'=>false,'message'=>$msg) );
return;
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_excel_import_failed')));
}
else
{
if (($handle = fopen($_FILES['file_path']['tmp_name'], "r")) !== FALSE)
if(($handle = fopen($_FILES['file_path']['tmp_name'], 'r')) !== FALSE)
{
//Skip first row
// Skip the first row as it's the table description
fgetcsv($handle);
$i=1;
while (($data = fgetcsv($handle)) !== FALSE)
$i = 1;
$failCodes = array();
while(($data = fgetcsv($handle)) !== FALSE)
{
$person_data = array(
'first_name'=>$data[0],
'last_name'=>$data[1],
'gender'=>$data[2],
'email'=>$data[3],
'phone_number'=>$data[4],
'address_1'=>$data[5],
'address_2'=>$data[6],
'city'=>$data[7],
'state'=>$data[8],
'zip'=>$data[9],
'country'=>$data[10],
'comments'=>$data[11]
);
$customer_data = array(
'company_name'=>$data[12],
'discount_percent'=>$data[14],
'taxable'=>$data[15]=='' ? 0 : 1
);
$account_number = $data[13];
$invalidated = false;
if ($account_number != "")
// XSS file data sanity check
$data = $this->xss_clean($data);
if(sizeof($data) >= 15)
{
$customer_data['account_number'] = $account_number;
$invalidated = $this->Customer->account_number_exists($account_number);
$person_data = array(
'first_name' => $data[0],
'last_name' => $data[1],
'gender' => $data[2],
'email' => $data[3],
'phone_number' => $data[4],
'address_1' => $data[5],
'address_2' => $data[6],
'city' => $data[7],
'state' => $data[8],
'zip' => $data[9],
'country' => $data[10],
'comments' => $data[11]
);
$customer_data = array(
'company_name' => $data[12],
'discount_percent' => $data[14],
'taxable' => $data[15] == '' ? 0 : 1
);
$account_number = $data[13];
$invalidated = FALSE;
if($account_number != '')
{
$customer_data['account_number'] = $account_number;
$invalidated = $this->Customer->account_number_exists($account_number);
}
}
else
{
$invalidated = TRUE;
}
if($invalidated || !$this->Customer->save_customer($person_data, $customer_data))
{
$failCodes[] = $i;
@@ -204,27 +231,23 @@ class Customers extends Person_controller
$i++;
}
if(count($failCodes) > 0)
{
$message = $this->lang->line('customers_excel_import_partially_failed') . ' (' . count($failCodes) . '): ' . implode(', ', $failCodes);
echo json_encode(array('success' => FALSE, 'message' => $message));
}
else
{
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('customers_excel_import_success')));
}
}
else
{
echo json_encode( array('success'=>false, 'message'=>'Your upload file has no data or not in supported format.') );
return;
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('customers_excel_import_nodata_wrongformat')));
}
}
$success = true;
if(count($failCodes) > 0)
{
$msg = "Most customers imported. But some were not, here is list of their CODE (" .count($failCodes) ."): ".implode(", ", $failCodes);
$success = false;
}
else
{
$msg = "Import Customers successful";
}
echo json_encode( array('success'=>$success, 'message'=>$msg) );
}
}
?>

View File

@@ -1,130 +1,167 @@
<?php
require_once ("Person_controller.php");
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Employees extends Person_controller
require_once("Persons.php");
class Employees extends Persons
{
function __construct()
public function __construct()
{
parent::__construct('employees');
}
function index($limit_from=0)
public function index()
{
$data['controller_name'] = $this->get_controller_name();
$lines_per_page = $this->Appconfig->get('lines_per_page');
$employees = $this->Employee->get_all($lines_per_page, $limit_from);
$data['links'] = $this->_initialize_pagination($this->Employee, $lines_per_page, $limit_from);
$data['manage_table'] = get_people_manage_table($employees, $this);
$this->load->view('people/manage',$data);
$data['table_headers'] = $this->xss_clean(get_people_manage_table_headers());
$this->load->view('people/manage', $data);
}
/*
Returns employee table data rows. This will be called with AJAX.
*/
function search()
public function search()
{
$search = $this->input->post('search') != '' ? $this->input->post('search') : null;
$limit_from = $this->input->post('limit_from');
$lines_per_page = $this->Appconfig->get('lines_per_page');
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$order = $this->input->get('order');
$employees = $this->Employee->search($search, $limit_from, $lines_per_page);
$employees = $this->Employee->search($search, $limit, $offset, $sort, $order);
$total_rows = $this->Employee->get_found_rows($search);
$links = $this->_initialize_pagination($this->Employee, $lines_per_page, $limit_from, $total_rows);
$data_rows = get_people_manage_table_data_rows($employees, $this);
echo json_encode(array('rows' => $data_rows, 'pagination' => $links));
$data_rows = array();
foreach($employees->result() as $person)
{
$data_rows[] = get_person_data_row($person, $this);
}
$data_rows = $this->xss_clean($data_rows);
echo json_encode(array('total' => $total_rows, 'rows' => $data_rows));
}
/*
Gives search suggestions based on what is being searched for
*/
function suggest_search()
public function suggest_search()
{
$suggestions = $this->Employee->get_search_suggestions($this->input->post('term'));
$suggestions = $this->xss_clean($this->Employee->get_search_suggestions($this->input->post('term')));
echo json_encode($suggestions);
}
/*
Loads the employee edit form
*/
function view($employee_id=-1)
public function view($employee_id = -1)
{
$data['person_info']=$this->Employee->get_info($employee_id);
$data['all_modules']=$this->Module->get_all_modules();
$data['all_subpermissions']=$this->Module->get_all_subpermissions();
$this->load->view("employees/form",$data);
$person_info = $this->Employee->get_info($employee_id);
foreach(get_object_vars($person_info) as $property => $value)
{
$person_info->$property = $this->xss_clean($value);
}
$data['person_info'] = $person_info;
$modules = array();
foreach($this->Module->get_all_modules()->result() as $module)
{
$module->module_id = $this->xss_clean($module->module_id);
$module->grant = $this->xss_clean($this->Employee->has_grant($module->module_id, $person_info->person_id));
$modules[] = $module;
}
$data['all_modules'] = $modules;
$permissions = array();
foreach($this->Module->get_all_subpermissions()->result() as $permission)
{
$permission->module_id = $this->xss_clean($permission->module_id);
$permission->permission_id = $this->xss_clean($permission->permission_id);
$permission->grant = $this->xss_clean($this->Employee->has_grant($permission->permission_id, $person_info->person_id));
$permissions[] = $permission;
}
$data['all_subpermissions'] = $permissions;
$this->load->view("employees/form", $data);
}
/*
Inserts/updates an employee
*/
function save($employee_id=-1)
public function save($employee_id = -1)
{
$person_data = array(
'first_name'=>$this->input->post('first_name'),
'last_name'=>$this->input->post('last_name'),
'gender'=>$this->input->post('gender'),
'email'=>$this->input->post('email'),
'phone_number'=>$this->input->post('phone_number'),
'address_1'=>$this->input->post('address_1'),
'address_2'=>$this->input->post('address_2'),
'city'=>$this->input->post('city'),
'state'=>$this->input->post('state'),
'zip'=>$this->input->post('zip'),
'country'=>$this->input->post('country'),
'comments'=>$this->input->post('comments')
'first_name' => $this->input->post('first_name'),
'last_name' => $this->input->post('last_name'),
'gender' => $this->input->post('gender'),
'email' => $this->input->post('email'),
'phone_number' => $this->input->post('phone_number'),
'address_1' => $this->input->post('address_1'),
'address_2' => $this->input->post('address_2'),
'city' => $this->input->post('city'),
'state' => $this->input->post('state'),
'zip' => $this->input->post('zip'),
'country' => $this->input->post('country'),
'comments' => $this->input->post('comments')
);
$grants_data = $this->input->post('grants') != null ? $this->input->post('grants') : array();
$grants_data = $this->input->post('grants') != NULL ? $this->input->post('grants') : array();
//Password has been changed OR first time password set
if ( $this->input->post('password') != '' )
if($this->input->post('password') != '')
{
$employee_data=array(
'username'=>$this->input->post('username'),
'password'=>md5($this->input->post('password'))
$employee_data = array(
'username' => $this->input->post('username'),
'password' => md5($this->input->post('password'))
);
}
else //Password not changed
{
$employee_data=array('username'=>$this->input->post('username'));
$employee_data = array('username' => $this->input->post('username'));
}
if($this->Employee->save_employee($person_data,$employee_data,$grants_data,$employee_id))
if($this->Employee->save_employee($person_data, $employee_data, $grants_data, $employee_id))
{
$person_data = $this->xss_clean($person_data);
$employee_data = $this->xss_clean($employee_data);
//New employee
if($employee_id==-1)
if($employee_id == -1)
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('employees_successful_adding').' '.
$person_data['first_name'].' '.$person_data['last_name'],'person_id'=>$employee_data['person_id']));
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('employees_successful_adding').' '.
$person_data['first_name'].' '.$person_data['last_name'], 'id' => $employee_data['person_id']));
}
else //previous employee
else //Existing employee
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('employees_successful_updating').' '.
$person_data['first_name'].' '.$person_data['last_name'],'person_id'=>$employee_id));
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('employees_successful_updating').' '.
$person_data['first_name'].' '.$person_data['last_name'], 'id' => $employee_id));
}
}
else//failure
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('employees_error_adding_updating').' '.
$person_data['first_name'].' '.$person_data['last_name'],'person_id'=>-1));
{
$person_data = $this->xss_clean($person_data);
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('employees_error_adding_updating').' '.
$person_data['first_name'].' '.$person_data['last_name'], 'id' => -1));
}
}
/*
This deletes employees from the employees table
*/
function delete()
public function delete()
{
$employees_to_delete=$this->input->post('ids');
$employees_to_delete = $this->xss_clean($this->input->post('ids'));
if($this->Employee->delete_list($employees_to_delete))
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('employees_successful_deleted').' '.
count($employees_to_delete).' '.$this->lang->line('employees_one_or_multiple')));
echo json_encode(array('success' => TRUE,'message' => $this->lang->line('employees_successful_deleted').' '.
count($employees_to_delete).' '.$this->lang->line('employees_one_or_multiple')));
}
else
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('employees_cannot_be_deleted')));
echo json_encode(array('success' => FALSE,'message' => $this->lang->line('employees_cannot_be_deleted')));
}
}
}

View File

@@ -1,111 +1,124 @@
<?php
require_once ("Secure_area.php");
require_once ("interfaces/Idata_controller.php");
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Giftcards extends Secure_area implements iData_controller
require_once("Secure_Controller.php");
class Giftcards extends Secure_Controller
{
function __construct()
public function __construct()
{
parent::__construct('giftcards');
}
function index($limit_from=0)
public function index()
{
$data['controller_name'] = $this->get_controller_name();
$lines_per_page = $this->Appconfig->get('lines_per_page');
$giftcards = $this->Giftcard->get_all($lines_per_page, $limit_from);
$data['links'] = $this->_initialize_pagination($this->Giftcard, $lines_per_page, $limit_from);
$data['manage_table'] = get_giftcards_manage_table($giftcards, $this);
$data['table_headers'] = $this->xss_clean(get_giftcards_manage_table_headers());
$this->load->view('giftcards/manage', $data);
}
/*
Returns Giftcards table data rows. This will be called with AJAX.
*/
function search()
public function search()
{
$search = $this->input->post('search') != '' ? $this->input->post('search') : null;
$limit_from = $this->input->post('limit_from');
$lines_per_page = $this->Appconfig->get('lines_per_page');
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$order = $this->input->get('order');
$giftcards = $this->Giftcard->search($search, $lines_per_page, $limit_from);
$giftcards = $this->Giftcard->search($search, $limit, $offset, $sort, $order);
$total_rows = $this->Giftcard->get_found_rows($search);
$links = $this->_initialize_pagination($this->Giftcard, $lines_per_page, $limit_from, $total_rows);
$data_rows = get_giftcards_manage_table_data_rows($giftcards, $this);
echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
$data_rows = array();
foreach($giftcards->result() as $giftcard)
{
$data_rows[] = get_giftcard_data_row($giftcard, $this);
}
$data_rows = $this->xss_clean($data_rows);
echo json_encode(array('total' => $total_rows, 'rows' => $data_rows));
}
/*
Gives search suggestions based on what is being searched for
*/
function suggest_search()
public function suggest_search()
{
$suggestions = $this->Giftcard->get_search_suggestions($this->input->post('term'));
$suggestions = $this->xss_clean($this->Giftcard->get_search_suggestions($this->input->post('term')));
echo json_encode($suggestions);
}
function get_row()
public function get_row($row_id)
{
$giftcard_id = $this->input->post('row_id');
$data_row = get_giftcard_data_row($this->Giftcard->get_info($giftcard_id), $this);
echo $data_row;
$data_row = $this->xss_clean(get_giftcard_data_row($this->Giftcard->get_info($row_id), $this));
echo json_encode($data_row);
}
function view($giftcard_id=-1)
public function view($giftcard_id = -1)
{
$giftcard_info = $this->Giftcard->get_info($giftcard_id);
$person_name=$giftcard_id > 0? $giftcard_info->first_name . ' ' . $giftcard_info->last_name : '';
$data['selected_person_name'] = $giftcard_id > 0 && isset($giftcard_info->person_id) ? $person_name : '';
$data['selected_person_id'] = $giftcard_info->person_id;
$data['giftcard_number'] = $giftcard_id > 0 ? $giftcard_info->giftcard_number : $this->Giftcard->get_max_number()->giftcard_number + 1;
$data['giftcard_info'] = $giftcard_info;
$this->load->view("giftcards/form",$data);
$data['selected_person_name'] = ($giftcard_id > 0 && isset($giftcard_info->person_id)) ? $giftcard_info->first_name . ' ' . $giftcard_info->last_name : '';
$data['selected_person_id'] = $giftcard_info->person_id;
$data['giftcard_number'] = $giftcard_id > 0 ? $giftcard_info->giftcard_number : $this->Giftcard->get_max_number()->giftcard_number + 1;
$data['giftcard_id'] = $giftcard_id;
$data['giftcard_value'] = $giftcard_info->value;
$data = $this->xss_clean($data);
$this->load->view("giftcards/form", $data);
}
function save($giftcard_id=-1)
public function save($giftcard_id = -1)
{
$giftcard_data = array(
'record_time' => date('Y-m-d H:i:s'),
'giftcard_number'=>$this->input->post('giftcard_number', TRUE),
'value'=>$this->input->post('value', TRUE),
'person_id'=>$this->input->post('person_id', TRUE) ? $this->input->post('person_id') : null
'giftcard_number' => $this->input->post('giftcard_number'),
'value' => $this->input->post('value'),
'person_id' => $this->input->post('person_id')
);
if( $this->Giftcard->save( $giftcard_data, $giftcard_id ) )
if($this->Giftcard->save($giftcard_data, $giftcard_id))
{
$giftcard_data = $this->xss_clean($giftcard_data);
//New giftcard
if($giftcard_id==-1)
if($giftcard_id == -1)
{
echo json_encode(array('success'=>true, 'message'=>$this->lang->line('giftcards_successful_adding').' '.
$giftcard_data['giftcard_number'], 'giftcard_id'=>$giftcard_data['giftcard_id']));
$giftcard_id = $giftcard_data['giftcard_id'];
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_adding').' '.
$giftcard_data['giftcard_number'], 'id' => $giftcard_data['giftcard_id']));
}
else //previous giftcard
else //Existing giftcard
{
echo json_encode(array('success'=>true, 'message'=>$this->lang->line('giftcards_successful_updating').' '.
$giftcard_data['giftcard_number'], 'giftcard_id'=>$giftcard_id));
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_updating').' '.
$giftcard_data['giftcard_number'], 'id' => $giftcard_id));
}
}
else//failure
else //failure
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('giftcards_error_adding_updating').' '.
$giftcard_data['giftcard_number'], 'giftcard_id'=>-1));
$giftcard_data = $this->xss_clean($giftcard_data);
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('giftcards_error_adding_updating').' '.
$giftcard_data['giftcard_number'], 'id' => -1));
}
}
function delete()
public function delete()
{
$giftcards_to_delete=$this->input->post('ids');
$giftcards_to_delete = $this->xss_clean($this->input->post('ids'));
if($this->Giftcard->delete_list($giftcards_to_delete))
{
echo json_encode(array('success'=>true, 'message'=>$this->lang->line('giftcards_successful_deleted').' '.
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('giftcards_successful_deleted').' '.
count($giftcards_to_delete).' '.$this->lang->line('giftcards_one_or_multiple')));
}
else
{
echo json_encode(array('success'=>false, 'message'=>$this->lang->line('giftcards_cannot_be_deleted')));
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('giftcards_cannot_be_deleted')));
}
}
}

View File

@@ -1,19 +1,20 @@
<?php
require_once ("Secure_area.php");
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends Secure_area
require_once("Secure_Controller.php");
class Home extends Secure_Controller
{
function __construct()
public function __construct()
{
parent::__construct();
}
function index()
public function index()
{
$this->load->view("home");
$this->load->view('home');
}
function logout()
public function logout()
{
$this->Employee->logout();
}

View File

@@ -1,23 +1,27 @@
<?php
require_once ("Secure_area.php");
require_once ("interfaces/Idata_controller.php");
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Item_kits extends Secure_area implements iData_controller
require_once("Secure_Controller.php");
class Item_kits extends Secure_Controller
{
function __construct()
public function __construct()
{
parent::__construct('item_kits');
}
// add the total cost and retail price to a passed items kit retrieving the data from each singolar item part of the kit
private function add_totals_to_item_kit($item_kit)
private function _add_totals_to_item_kit($item_kit)
{
$item_kit->total_cost_price = 0;
$item_kit->total_unit_price = 0;
foreach ($this->Item_kit_items->get_info($item_kit->item_kit_id) as $item_kit_item)
foreach($this->Item_kit_items->get_info($item_kit->item_kit_id) as $item_kit_item)
{
$item_info = $this->Item->get_info($item_kit_item['item_id']);
foreach(get_object_vars($item_info) as $property => $value)
{
$item_info->$property = $this->xss_clean($value);
}
$item_kit->total_cost_price += $item_info->cost_price * $item_kit_item['quantity'];
$item_kit->total_unit_price += $item_info->unit_price * $item_kit_item['quantity'];
@@ -26,96 +30,95 @@ class Item_kits extends Secure_area implements iData_controller
return $item_kit;
}
function index($limit_from=0)
public function index()
{
$data['controller_name'] = $this->get_controller_name();
$lines_per_page = $this->Appconfig->get('lines_per_page');
$item_kits = $this->Item_kit->get_all($lines_per_page, $limit_from);
foreach($item_kits->result() as $item_kit)
{
// calculate the total cost and retail price of the Kit so it can be printed out in the manage table
$item_kit = $this->add_totals_to_item_kit($item_kit);
}
$data['links'] = $this->_initialize_pagination($this->Item_kit, $lines_per_page, $limit_from);
$data['manage_table'] = get_item_kits_manage_table($item_kits, $this);
$data['table_headers'] = $this->xss_clean(get_item_kits_manage_table_headers());
$this->load->view('item_kits/manage', $data);
}
/*
Returns Item kits table data rows. This will be called with AJAX.
*/
function search()
public function search()
{
$search = $this->input->post('search') != '' ? $this->input->post('search') : null;
$limit_from = $this->input->post('limit_from');
$lines_per_page = $this->Appconfig->get('lines_per_page');
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$order = $this->input->get('order');
$item_kits = $this->Item_kit->search($search, $lines_per_page, $limit_from);
$item_kits = $this->Item_kit->search($search, $limit, $offset, $sort, $order);
$total_rows = $this->Item_kit->get_found_rows($search);
$links = $this->_initialize_pagination($this->Item_kit, $lines_per_page, $limit_from, $total_rows, 'search');
$data_rows = array();
foreach($item_kits->result() as $item_kit)
{
// calculate the total cost and retail price of the Kit so it can be printed out in the manage table
$item_kit = $this->add_totals_to_item_kit($item_kit);
$item_kit = $this->_add_totals_to_item_kit($item_kit);
$data_rows[] = get_item_kit_data_row($item_kit, $this);
}
$data_rows = get_item_kits_manage_table_data_rows($item_kits, $this);
$data_rows = $this->xss_clean($data_rows);
echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
echo json_encode(array('total' => $total_rows, 'rows' => $data_rows));
}
function suggest_search()
public function suggest_search()
{
$suggestions = $this->Item_kit->get_search_suggestions($this->input->post('term'));
$suggestions = $this->xss_clean($this->Item_kit->get_search_suggestions($this->input->post('term')));
echo json_encode($suggestions);
}
function get_row()
public function get_row($row_id)
{
$item_kit_id = $this->input->post('row_id');
// calculate the total cost and retail price of the Kit so it can be added to the table refresh
$item_kit = $this->add_totals_to_item_kit($this->Item_kit->get_info($item_kit_id));
$item_kit = $this->_add_totals_to_item_kit($this->Item_kit->get_info($row_id));
echo (get_item_kit_data_row($item_kit, $this));
echo json_encode(get_item_kit_data_row($item_kit, $this));
}
function view($item_kit_id=-1)
public function view($item_kit_id = -1)
{
$data['item_kit_info'] = $this->Item_kit->get_info($item_kit_id);
$info = $this->Item_kit->get_info($item_kit_id);
foreach(get_object_vars($info) as $property => $value)
{
$info->$property = $this->xss_clean($value);
}
$data['item_kit_info'] = $info;
$items = array();
foreach($this->Item_kit_items->get_info($item_kit_id) as $item_kit_item)
{
$item['name'] = $this->xss_clean($this->Item->get_info($item_kit_item['item_id'])->name);
$item['item_id'] = $this->xss_clean($item_kit_item['item_id']);
$item['quantity'] = $this->xss_clean($item_kit_item['quantity']);
$items[] = $item;
}
$data['item_kit_items'] = $items;
$this->load->view("item_kits/form", $data);
}
function save($item_kit_id=-1)
public function save($item_kit_id = -1)
{
$item_kit_data = array(
'name' => $this->input->post('name'),
'description' => $this->input->post('description')
);
if ($this->Item_kit->save($item_kit_data, $item_kit_id))
if($this->Item_kit->save($item_kit_data, $item_kit_id))
{
$success = TRUE;
//New item kit
if ($item_kit_id==-1)
if ($item_kit_id == -1)
{
$item_kit_id = $item_kit_data['item_kit_id'];
echo json_encode(array('success'=>true,
'message'=>$this->lang->line('item_kits_successful_adding').' '.$item_kit_data['name'],
'item_kit_id'=>$item_kit_id));
}
else //previous item
{
echo json_encode(array('success'=>true,
'message'=>$this->lang->line('item_kits_successful_updating').' '.$item_kit_data['name'],
'item_kit_id'=>$item_kit_id));
}
if ( $this->input->post('item_kit_item') != null )
if($this->input->post('item_kit_item') != NULL)
{
$item_kit_items = array();
foreach($this->input->post('item_kit_item') as $item_id => $quantity)
@@ -125,46 +128,53 @@ class Item_kits extends Secure_area implements iData_controller
'quantity' => $quantity
);
}
$this->Item_kit_items->save($item_kit_items, $item_kit_id);
$success = $this->Item_kit_items->save($item_kit_items, $item_kit_id);
}
$item_kit_data = $this->xss_clean($item_kit_data);
echo json_encode(array('success' => $success,
'message' => $this->lang->line('item_kits_successful_adding').' '.$item_kit_data['name'], 'id' => $item_kit_id));
}
else//failure
{
echo json_encode(array('success'=>false,
'message'=>$this->lang->line('item_kits_error_adding_updating').' '.$item_kit_data['name'],
'item_kit_id'=>-1));
$item_kit_data = $this->xss_clean($item_kit_data);
echo json_encode(array('success' => FALSE,
'message' => $this->lang->line('item_kits_error_adding_updating').' '.$item_kit_data['name'], 'id' => -1));
}
}
function delete()
public function delete()
{
$item_kits_to_delete = $this->input->post('ids');
$item_kits_to_delete = $this->xss_clean($this->input->post('ids'));
if ($this->Item_kit->delete_list($item_kits_to_delete))
if($this->Item_kit->delete_list($item_kits_to_delete))
{
echo json_encode(array('success'=>true,
'message'=>$this->lang->line('item_kits_successful_deleted').' '.count($item_kits_to_delete).' '.$this->lang->line('item_kits_one_or_multiple')));
echo json_encode(array('success' => TRUE,
'message' => $this->lang->line('item_kits_successful_deleted').' '.count($item_kits_to_delete).' '.$this->lang->line('item_kits_one_or_multiple')));
}
else
{
echo json_encode(array('success'=>false,
'message'=>$this->lang->line('item_kits_cannot_be_deleted')));
echo json_encode(array('success' => FALSE,
'message' => $this->lang->line('item_kits_cannot_be_deleted')));
}
}
function generate_barcodes($item_kit_ids)
public function generate_barcodes($item_kit_ids)
{
$this->load->library('barcode_lib');
$result = array();
$item_kit_ids = explode(':', $item_kit_ids);
foreach ($item_kit_ids as $item_kid_id)
foreach($item_kit_ids as $item_kid_id)
{
// calculate the total cost and retail price of the Kit so it can be added to the barcode text at the bottom
$item_kit = $this->add_totals_to_item_kit($this->Item_kit->get_info($item_kid_id));
$item_kit = $this->_add_totals_to_item_kit($this->Item_kit->get_info($item_kid_id));
$result[] = array('name'=>$item_kit->name, 'item_id'=>'KIT '.$item_kid_id, 'item_number'=>'KIT '.$item_kid_id, 'cost_price'=>$item_kit->total_cost_price, 'unit_price'=>$item_kit->total_unit_price);
$result[] = array('name' => $item_kit->name, 'item_id' => urldecode($item_kid_id), 'item_number' => urldecode($item_kid_id),
'cost_price' => $item_kit->total_cost_price, 'unit_price' => $item_kit->total_unit_price);
}
$data['items'] = $result;
@@ -176,7 +186,7 @@ class Item_kits extends Secure_area implements iData_controller
$barcode_config['barcode_type'] = 'Code128';
}
$data['barcode_config'] = $barcode_config;
// display barcodes
$this->load->view("barcodes/barcode_sheet", $data);
}

View File

@@ -1,36 +1,30 @@
<?php
require_once ("Secure_area.php");
require_once ("interfaces/Idata_controller.php");
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Items extends Secure_area implements iData_controller
require_once("Secure_Controller.php");
class Items extends Secure_Controller
{
function __construct()
public function __construct()
{
parent::__construct('items');
$this->load->library('item_lib');
}
function index($limit_from=0)
public function index()
{
$stock_location = $this->item_lib->get_item_location();
$stock_locations = $this->Stock_location->get_allowed_locations();
$data['table_headers'] = $this->xss_clean(get_items_manage_table_headers());
$data['controller_name'] = $this->get_controller_name();
$lines_per_page = $this->Appconfig->get('lines_per_page');
$items = $this->Item->get_all($stock_location, $lines_per_page, $limit_from);
$data['links'] = $this->_initialize_pagination($this->Item, $lines_per_page, $limit_from);
$data['stock_location'] = $this->xss_clean($this->item_lib->get_item_location());
$data['stock_locations'] = $this->xss_clean($this->Stock_location->get_allowed_locations());
// filters that will be loaded in the multiselect dropdown
$data['filters'] = array('empty_upc' => $this->lang->line('items_empty_upc_items'),
'low_inventory' => $this->lang->line('items_low_inventory_items'),
'is_serialized' => $this->lang->line('items_serialized_items'),
'no_description' => $this->lang->line('items_no_description_items'),
'search_custom' => $this->lang->line('items_search_custom_items'),
'is_deleted' => $this->lang->line('items_is_deleted'));
$data['stock_location'] = $stock_location;
$data['stock_locations'] = $stock_locations;
$data['manage_table'] = get_items_manage_table( $this->Item->get_all($stock_location, $lines_per_page, $limit_from), $this );
'low_inventory' => $this->lang->line('items_low_inventory_items'),
'is_serialized' => $this->lang->line('items_serialized_items'),
'no_description' => $this->lang->line('items_no_description_items'),
'search_custom' => $this->lang->line('items_search_custom_items'),
'is_deleted' => $this->lang->line('items_is_deleted'));
$this->load->view('items/manage', $data);
}
@@ -38,15 +32,18 @@ class Items extends Secure_area implements iData_controller
/*
Returns Items table data rows. This will be called with AJAX.
*/
function search()
public function search()
{
$search = $this->input->post('search') != '' ? $this->input->post('search') : null;
$limit_from = $this->input->post('limit_from');
$lines_per_page = $this->Appconfig->get('lines_per_page');
$this->item_lib->set_item_location($this->input->post('stock_location'));
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$order = $this->input->get('order');
$filters = array('start_date' => $this->input->post('start_date'),
'end_date' => $this->input->post('end_date'),
$this->item_lib->set_item_location($this->input->get('stock_location'));
$filters = array('start_date' => $this->input->get('start_date'),
'end_date' => $this->input->get('end_date'),
'stock_location_id' => $this->item_lib->get_item_location(),
'empty_upc' => FALSE,
'low_inventory' => FALSE,
@@ -56,35 +53,33 @@ class Items extends Secure_area implements iData_controller
'is_deleted' => FALSE);
// check if any filter is set in the multiselect dropdown
if( $this->input->post('filters') != null )
{
foreach($this->input->post('filters') as $key)
{
$filters[$key] = TRUE;
}
}
$items = $this->Item->search($search, $filters, $lines_per_page, $limit_from);
$data_rows = get_items_manage_table_data_rows($items, $this);
$total_rows = $this->Item->get_found_rows($search, $filters);
$links = $this->_initialize_pagination($this->Item, $lines_per_page, $limit_from, $total_rows, 'search');
$data_rows = get_items_manage_table_data_rows($items, $this);
$filledup = array_fill_keys($this->input->get('filters'), TRUE);
$filters = array_merge($filters, $filledup);
echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
$items = $this->Item->search($search, $filters, $limit, $offset, $sort, $order);
$total_rows = $this->xss_clean($this->Item->get_found_rows($search, $filters));
$data_rows = array();
foreach($items->result() as $item)
{
$data_rows[] = $this->xss_clean(get_item_data_row($item, $this));
}
echo json_encode(array('total' => $total_rows, 'rows' => $data_rows));
}
function pic_thumb($pic_id)
public function pic_thumb($pic_id)
{
$this->load->helper('file');
$this->load->library('image_lib');
$base_path = "uploads/item_pics/" . $pic_id ;
$images = glob ($base_path. "*");
if (sizeof($images) > 0)
if(sizeof($images) > 0)
{
$image_path = $images[0];
$ext = pathinfo($image_path, PATHINFO_EXTENSION);
$thumb_path = $base_path . $this->image_lib->thumb_marker.'.'.$ext;
if (sizeof($images) < 2)
$thumb_path = $base_path . $this->image_lib->thumb_marker . '.' . $ext;
if(sizeof($images) < 2)
{
$config['image_library'] = 'gd2';
$config['source_image'] = $image_path;
@@ -104,26 +99,18 @@ class Items extends Secure_area implements iData_controller
/*
Gives search suggestions based on what is being searched for
*/
function suggest_search()
public function suggest_search()
{
$suggestions = $this->Item->get_search_suggestions($this->input->post_get('term'),
array(
'search_custom' => $this->input->post('search_custom'),
'is_deleted' => $this->input->post('is_deleted') != null
),
FALSE);
$suggestions = $this->xss_clean($this->Item->get_search_suggestions($this->input->post_get('term'),
array('search_custom' => $this->input->post('search_custom'), 'is_deleted' => $this->input->post('is_deleted') != NULL), FALSE));
echo json_encode($suggestions);
}
function suggest()
public function suggest()
{
$suggestions = $this->Item->get_search_suggestions($this->input->post_get('term'),
array(
'search_custom' => FALSE,
'is_deleted' => FALSE
),
TRUE);
$suggestions = $this->xss_clean($this->Item->get_search_suggestions($this->input->post_get('term'),
array('search_custom' => FALSE, 'is_deleted' => FALSE), TRUE));
echo json_encode($suggestions);
}
@@ -131,9 +118,9 @@ class Items extends Secure_area implements iData_controller
/*
Gives search suggestions based on what is being searched for
*/
function suggest_category()
public function suggest_category()
{
$suggestions = $this->Item->get_category_suggestions($this->input->get('term'));
$suggestions = $this->xss_clean($this->Item->get_category_suggestions($this->input->get('term')));
echo json_encode($suggestions);
}
@@ -141,9 +128,9 @@ class Items extends Secure_area implements iData_controller
/*
Gives search suggestions based on what is being searched for
*/
function suggest_location()
public function suggest_location()
{
$suggestions = $this->Item->get_location_suggestions($this->input->get('term'));
$suggestions = $this->xss_clean($this->Item->get_location_suggestions($this->input->get('term')));
echo json_encode($suggestions);
}
@@ -151,34 +138,39 @@ class Items extends Secure_area implements iData_controller
/*
Gives search suggestions based on what is being searched for
*/
function suggest_custom()
public function suggest_custom()
{
$suggestions = $this->Item->get_custom_suggestions($this->input->post('term'), $this->input->post('field_no'));
$suggestions = $this->xss_clean($this->Item->get_custom_suggestions($this->input->post('term'), $this->input->post('field_no')));
echo json_encode($suggestions);
}
function get_row()
public function get_row($item_ids)
{
$item_id = $this->input->post('row_id');
$item_info = $this->Item->get_info($item_id);
$stock_location = $this->item_lib->get_item_location();
$item_quantity = $this->Item_quantity->get_item_quantity($item_id,$stock_location);
$item_info->quantity = $item_quantity->quantity;
$data_row = get_item_data_row($item_info,$this);
echo $data_row;
$item_infos = $this->Item->get_multiple_info(explode(":", $item_ids), $this->item_lib->get_item_location());
$result = array();
foreach($item_infos->result() as $item_info)
{
$result[$item_info->item_id] = $this->xss_clean(get_item_data_row($item_info, $this));
}
echo json_encode($result);
}
function view($item_id=-1)
public function view($item_id = -1)
{
$item_info = $this->Item->get_info($item_id);
$data['item_tax_info'] = $this->Item_taxes->get_info($item_id);
$data['item_tax_info'] = $this->xss_clean($this->Item_taxes->get_info($item_id));
$data['default_tax_1_rate'] = '';
$data['default_tax_2_rate'] = '';
if($item_id==-1)
$item_info = $this->Item->get_info($item_id);
foreach(get_object_vars($item_info) as $property => $value)
{
$item_info->$property = $this->xss_clean($value);
}
if($item_id == -1)
{
$data['default_tax_1_rate'] = $this->Appconfig->get('default_tax_1_rate');
$data['default_tax_2_rate'] = $this->Appconfig->get('default_tax_2_rate');
@@ -188,11 +180,11 @@ class Items extends Secure_area implements iData_controller
}
$data['item_info'] = $item_info;
$suppliers = array(''=>$this->lang->line('items_none'));
$suppliers = array('' => $this->lang->line('items_none'));
foreach($this->Supplier->get_all()->result_array() as $row)
{
$suppliers[$row['person_id']] = $row['company_name'];
$suppliers[$this->xss_clean($row['person_id'])] = $this->xss_clean($row['company_name']);
}
$data['suppliers'] = $suppliers;
$data['selected_supplier'] = $item_info->supplier_id;
@@ -201,64 +193,83 @@ class Items extends Secure_area implements iData_controller
$images = glob("uploads/item_pics/" . $item_info->pic_id . ".*");
$data['image_path'] = sizeof($images) > 0 ? base_url($images[0]) : '';
$locations_data = $this->Stock_location->get_undeleted_all()->result_array();
foreach($locations_data as $location)
$stock_locations = $this->Stock_location->get_undeleted_all()->result_array();
foreach($stock_locations as $location)
{
$quantity = $this->Item_quantity->get_item_quantity($item_id,$location['location_id'])->quantity;
$location = $this->xss_clean($location);
$quantity = $this->xss_clean($this->Item_quantity->get_item_quantity($item_id, $location['location_id'])->quantity);
$quantity = ($item_id == -1) ? 0 : $quantity;
$location_array[$location['location_id']] = array('location_name'=>$location['location_name'], 'quantity'=>$quantity);
$location_array[$location['location_id']] = array('location_name' => $location['location_name'], 'quantity' => $quantity);
$data['stock_locations'] = $location_array;
}
$this->load->view("items/form", $data);
$this->load->view('items/form', $data);
}
function inventory($item_id=-1)
public function inventory($item_id = -1)
{
$data['item_info'] = $this->Item->get_info($item_id);
$item_info = $this->Item->get_info($item_id);
foreach(get_object_vars($item_info) as $property => $value)
{
$item_info->$property = $this->xss_clean($value);
}
$data['item_info'] = $item_info;
$data['stock_locations'] = array();
$stock_locations = $this->Stock_location->get_undeleted_all()->result_array();
foreach($stock_locations as $location_data)
{
$data['stock_locations'][$location_data['location_id']] = $location_data['location_name'];
$data['item_quantities'][$location_data['location_id']] = $this->Item_quantity->get_item_quantity($item_id,$location_data['location_id'])->quantity;
}
$this->load->view("items/form_inventory", $data);
foreach($stock_locations as $location)
{
$location = $this->xss_clean($location);
$quantity = $this->xss_clean($this->Item_quantity->get_item_quantity($item_id, $location['location_id'])->quantity);
$data['stock_locations'][$location['location_id']] = $location['location_name'];
$data['item_quantities'][$location['location_id']] = $quantity;
}
$this->load->view('items/form_inventory', $data);
}
function count_details($item_id=-1)
public function count_details($item_id = -1)
{
$data['item_info'] = $this->Item->get_info($item_id);
$item_info = $this->Item->get_info($item_id);
foreach(get_object_vars($item_info) as $property => $value)
{
$item_info->$property = $this->xss_clean($value);
}
$data['item_info'] = $item_info;
$data['stock_locations'] = array();
$stock_locations = $this->Stock_location->get_undeleted_all()->result_array();
foreach($stock_locations as $location_data)
{
$data['stock_locations'][$location_data['location_id']] = $location_data['location_name'];
$data['item_quantities'][$location_data['location_id']] = $this->Item_quantity->get_item_quantity($item_id,$location_data['location_id'])->quantity;
}
$this->load->view("items/form_count_details", $data);
foreach($stock_locations as $location)
{
$location = $this->xss_clean($location);
$quantity = $this->xss_clean($this->Item_quantity->get_item_quantity($item_id, $location['location_id'])->quantity);
$data['stock_locations'][$location['location_id']] = $location['location_name'];
$data['item_quantities'][$location['location_id']] = $quantity;
}
$this->load->view('items/form_count_details', $data);
}
function generate_barcodes($item_ids)
public function generate_barcodes($item_ids)
{
$this->load->library('barcode_lib');
$result = array();
$item_ids = explode(':', $item_ids);
$result = $this->Item->get_multiple_info($item_ids)->result_array();
$result = $this->Item->get_multiple_info($item_ids, $this->item_lib->get_item_location())->result_array();
$config = $this->barcode_lib->get_barcode_config();
$data['barcode_config'] = $config;
// check the list of items to see if any item_number field is empty
foreach($result as &$item)
{
// update the UPC/EAN/ISBN field if empty / null with the newly generated barcode
if (empty($item['item_number']) && $this->Appconfig->get('barcode_generate_if_empty'))
$item = $this->xss_clean($item);
// update the UPC/EAN/ISBN field if empty / NULL with the newly generated barcode
if(empty($item['item_number']) && $this->Appconfig->get('barcode_generate_if_empty'))
{
// get the newly generated barcode
$barcode_instance = Barcode_lib::barcode_instance($item, $config);
@@ -277,76 +288,81 @@ class Items extends Secure_area implements iData_controller
$data['items'] = $result;
// display barcodes
$this->load->view("barcodes/barcode_sheet", $data);
$this->load->view('barcodes/barcode_sheet', $data);
}
function bulk_edit()
public function bulk_edit()
{
$data = array();
$suppliers = array('' => $this->lang->line('items_none'));
foreach($this->Supplier->get_all()->result_array() as $row)
{
$row = $this->xss_clean($row);
$suppliers[$row['person_id']] = $row['company_name'];
}
$data['suppliers'] = $suppliers;
$data['allow_alt_description_choices'] = array(
''=>$this->lang->line('items_do_nothing'),
1 =>$this->lang->line('items_change_all_to_allow_alt_desc'),
0 =>$this->lang->line('items_change_all_to_not_allow_allow_desc'));
$data['serialization_choices'] = array(
''=>$this->lang->line('items_do_nothing'),
1 =>$this->lang->line('items_change_all_to_serialized'),
0 =>$this->lang->line('items_change_all_to_unserialized'));
'' => $this->lang->line('items_do_nothing'),
1 => $this->lang->line('items_change_all_to_allow_alt_desc'),
0 => $this->lang->line('items_change_all_to_not_allow_allow_desc'));
$this->load->view("items/form_bulk", $data);
$data['serialization_choices'] = array(
'' => $this->lang->line('items_do_nothing'),
1 => $this->lang->line('items_change_all_to_serialized'),
0 => $this->lang->line('items_change_all_to_unserialized'));
$this->load->view('items/form_bulk', $data);
}
function save($item_id=-1)
public function save($item_id = -1)
{
$upload_success = $this->_handle_image_upload();
$upload_data = $this->upload->data();
//Save item data
$item_data = array(
'name'=>$this->input->post('name'),
'description'=>$this->input->post('description'),
'category'=>$this->input->post('category'),
'supplier_id'=>$this->input->post('supplier_id') == '' ? null : $this->input->post('supplier_id'),
'item_number'=>$this->input->post('item_number') == '' ? null : $this->input->post('item_number'),
'cost_price'=>$this->input->post('cost_price'),
'unit_price'=>$this->input->post('unit_price'),
'reorder_level'=>$this->input->post('reorder_level'),
'receiving_quantity'=>$this->input->post('receiving_quantity'),
'allow_alt_description'=>$this->input->post('allow_alt_description') != null,
'is_serialized'=>$this->input->post('is_serialized') != null,
'deleted'=>$this->input->post('is_deleted') != null,
'custom1'=>$this->input->post('custom1') == null ? '' : $this->input->post('custom1'),
'custom2'=>$this->input->post('custom2') == null ? '' : $this->input->post('custom2'),
'custom3'=>$this->input->post('custom3') == null ? '' : $this->input->post('custom3'),
'custom4'=>$this->input->post('custom4') == null ? '' : $this->input->post('custom4'),
'custom5'=>$this->input->post('custom5') == null ? '' : $this->input->post('custom5'),
'custom6'=>$this->input->post('custom6') == null ? '' : $this->input->post('custom6'),
'custom7'=>$this->input->post('custom7') == null ? '' : $this->input->post('custom7'),
'custom8'=>$this->input->post('custom8') == null ? '' : $this->input->post('custom8'),
'custom9'=>$this->input->post('custom9') == null ? '' : $this->input->post('custom9'),
'custom10'=>$this->input->post('custom10') == null ? '' : $this->input->post('custom10')
'name' => $this->input->post('name'),
'description' => $this->input->post('description'),
'category' => $this->input->post('category'),
'supplier_id' => $this->input->post('supplier_id') == '' ? NULL : $this->input->post('supplier_id'),
'item_number' => $this->input->post('item_number') == '' ? NULL : $this->input->post('item_number'),
'cost_price' => $this->input->post('cost_price'),
'unit_price' => $this->input->post('unit_price'),
'reorder_level' => $this->input->post('reorder_level'),
'receiving_quantity' => $this->input->post('receiving_quantity'),
'allow_alt_description' => $this->input->post('allow_alt_description') != NULL,
'is_serialized' => $this->input->post('is_serialized') != NULL,
'deleted' => $this->input->post('is_deleted') != NULL,
'custom1' => $this->input->post('custom1') == NULL ? '' : $this->input->post('custom1'),
'custom2' => $this->input->post('custom2') == NULL ? '' : $this->input->post('custom2'),
'custom3' => $this->input->post('custom3') == NULL ? '' : $this->input->post('custom3'),
'custom4' => $this->input->post('custom4') == NULL ? '' : $this->input->post('custom4'),
'custom5' => $this->input->post('custom5') == NULL ? '' : $this->input->post('custom5'),
'custom6' => $this->input->post('custom6') == NULL ? '' : $this->input->post('custom6'),
'custom7' => $this->input->post('custom7') == NULL ? '' : $this->input->post('custom7'),
'custom8' => $this->input->post('custom8') == NULL ? '' : $this->input->post('custom8'),
'custom9' => $this->input->post('custom9') == NULL ? '' : $this->input->post('custom9'),
'custom10' => $this->input->post('custom10') == NULL ? '' : $this->input->post('custom10')
);
if (!empty($upload_data['orig_name']))
if(!empty($upload_data['orig_name']))
{
$item_data['pic_id'] = $upload_data['raw_name'];
// XSS file image sanity check
if($this->xss_clean($upload_data['raw_name'], TRUE) === TRUE)
{
$item_data['pic_id'] = $upload_data['raw_name'];
}
}
$employee_id = $this->Employee->get_logged_in_employee_info()->person_id;
$cur_item_info = $this->Item->get_info($item_id);
if($this->Item->save($item_data,$item_id))
if($this->Item->save($item_data, $item_id))
{
$success = TRUE;
$new_item = FALSE;
//New item
if ($item_id==-1)
if($item_id == -1)
{
$item_id = $item_data['item_id'];
$new_item = TRUE;
@@ -357,62 +373,63 @@ class Items extends Secure_area implements iData_controller
$tax_percents = $this->input->post('tax_percents');
for($k = 0; $k < count($tax_percents); $k++)
{
if (is_numeric($tax_percents[$k]))
if(is_numeric($tax_percents[$k]))
{
$items_taxes_data[] = array('name'=>$tax_names[$k], 'percent'=>$tax_percents[$k] );
$items_taxes_data[] = array('name' => $tax_names[$k], 'percent' => $tax_percents[$k]);
}
}
$success &= $this->Item_taxes->save($items_taxes_data, $item_id);
//Save item quantity
$stock_locations = $this->Stock_location->get_undeleted_all()->result_array();
foreach($stock_locations as $location_data)
foreach($stock_locations as $location)
{
$updated_quantity = $this->input->post('quantity_' . $location_data['location_id']);
$location_detail = array('item_id'=>$item_id,
'location_id'=>$location_data['location_id'],
'quantity'=>$updated_quantity);
$item_quantity = $this->Item_quantity->get_item_quantity($item_id, $location_data['location_id']);
if ($item_quantity->quantity != $updated_quantity || $new_item)
$updated_quantity = $this->input->post('quantity_' . $location['location_id']);
$location_detail = array('item_id' => $item_id,
'location_id' => $location['location_id'],
'quantity' => $updated_quantity);
$item_quantity = $this->Item_quantity->get_item_quantity($item_id, $location['location_id']);
if($item_quantity->quantity != $updated_quantity || $new_item)
{
$success &= $this->Item_quantity->save($location_detail, $item_id, $location_data['location_id']);
$success &= $this->Item_quantity->save($location_detail, $item_id, $location['location_id']);
$inv_data = array(
'trans_date'=>date('Y-m-d H:i:s'),
'trans_items'=>$item_id,
'trans_user'=>$employee_id,
'trans_location'=>$location_data['location_id'],
'trans_comment'=>$this->lang->line('items_manually_editing_of_quantity'),
'trans_inventory'=>$updated_quantity - $item_quantity->quantity
'trans_date' => date('Y-m-d H:i:s'),
'trans_items' => $item_id,
'trans_user' => $employee_id,
'trans_location' => $location['location_id'],
'trans_comment' => $this->lang->line('items_manually_editing_of_quantity'),
'trans_inventory' => $updated_quantity - $item_quantity->quantity
);
$success &= $this->Inventory->insert($inv_data);
}
}
if($success && $upload_success)
{
$success_message = $this->lang->line('items_successful_' . ($new_item ? 'adding' : 'updating')) .' '. $item_data['name'];
$message = $this->xss_clean($this->lang->line('items_successful_' . ($new_item ? 'adding' : 'updating')) . ' ' . $item_data['name']);
echo json_encode(array('success'=>true, 'message'=>$success_message, 'item_id'=>$item_id));
echo json_encode(array('success' => TRUE, 'message' => $message, 'id' => $item_id));
}
else
{
$error_message = $upload_success ?
$this->lang->line('items_error_adding_updating') .' '. $item_data['name'] :
$this->upload->display_errors();
$message = $this->xss_clean($upload_success ? $this->lang->line('items_error_adding_updating') . ' ' . $item_data['name'] : $this->upload->display_errors());
echo json_encode(array('success'=>false, 'message'=>$error_message, 'item_id'=>$item_id));
echo json_encode(array('success' => FALSE, 'message' => $message, 'id' => $item_id));
}
}
else//failure
{
echo json_encode(array('success'=>false, 'message'=>$this->lang->line('items_error_adding_updating').' '.$item_data['name'], 'item_id'=>-1));
$message = $this->xss_clean($this->lang->line('items_error_adding_updating') . ' ' . $item_data['name']);
echo json_encode(array('success' => FALSE, 'message' => $message, 'id' => -1));
}
}
function check_item_number()
public function check_item_number()
{
$exists = $this->Item->item_number_exists($this->input->post('item_number'),$this->input->post('item_id'));
$exists = $this->Item->item_number_exists($this->input->post('item_number'), $this->input->post('item_id'));
echo !$exists ? 'true' : 'false';
}
@@ -424,11 +441,12 @@ class Items extends Secure_area implements iData_controller
// load upload library
$config = array('upload_path' => './uploads/item_pics/',
'allowed_types' => 'gif|jpg|png',
'max_size' => '100',
'max_width' => '640',
'max_height' => '480',
'file_name' => sizeof($map) + 1);
'allowed_types' => 'gif|jpg|png',
'max_size' => '100',
'max_width' => '640',
'max_height' => '480',
'file_name' => sizeof($map) + 1
);
$this->load->library('upload', $config);
$this->upload->do_upload('item_image');
@@ -437,54 +455,56 @@ class Items extends Secure_area implements iData_controller
public function remove_logo($item_id)
{
$item_data = array('pic_id' => null);
$item_data = array('pic_id' => NULL);
$result = $this->Item->save($item_data, $item_id);
echo json_encode(array('success' => $result));
}
function save_inventory($item_id=-1)
public function save_inventory($item_id = -1)
{
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
$employee_id = $this->Employee->get_logged_in_employee_info()->person_id;
$cur_item_info = $this->Item->get_info($item_id);
$location_id = $this->input->post('stock_location');
$inv_data = array(
'trans_date'=>date('Y-m-d H:i:s'),
'trans_items'=>$item_id,
'trans_user'=>$employee_id,
'trans_location'=>$location_id,
'trans_comment'=>$this->input->post('trans_comment'),
'trans_inventory'=>$this->input->post('newquantity')
'trans_date' => date('Y-m-d H:i:s'),
'trans_items' => $item_id,
'trans_user' => $employee_id,
'trans_location' => $location_id,
'trans_comment' => $this->input->post('trans_comment'),
'trans_inventory' => $this->input->post('newquantity')
);
$this->Inventory->insert($inv_data);
//Update stock quantity
$item_quantity= $this->Item_quantity->get_item_quantity($item_id,$location_id);
$item_quantity = $this->Item_quantity->get_item_quantity($item_id, $location_id);
$item_quantity_data = array(
'item_id'=>$item_id,
'location_id'=>$location_id,
'quantity'=>$item_quantity->quantity + $this->input->post('newquantity')
'item_id' => $item_id,
'location_id' => $location_id,
'quantity' => $item_quantity->quantity + $this->input->post('newquantity')
);
if($this->Item_quantity->save($item_quantity_data,$item_id,$location_id))
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('items_successful_updating').' '.
$cur_item_info->name,'item_id'=>$item_id));
if($this->Item_quantity->save($item_quantity_data, $item_id, $location_id))
{
$message = $this->xss_clean($this->lang->line('items_successful_updating') . ' ' . $cur_item_info->name);
echo json_encode(array('success' => TRUE, 'message' => $message, 'id' => $item_id));
}
else//failure
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('items_error_adding_updating').' '.
$cur_item_info->name,'item_id'=>-1));
{
$message = $this->xss_clean($this->lang->line('items_error_adding_updating') . ' ' . $cur_item_info->name);
echo json_encode(array('success' => FALSE, 'message' => $message, 'id' => -1));
}
}
function bulk_update()
public function bulk_update()
{
$items_to_update=$this->input->post('item_ids');
$items_to_update = $this->input->post('item_ids');
$item_data = array();
foreach($_POST as $key=>$value)
foreach($_POST as $key => $value)
{
//This field is nullable, so treat it differently
if($key == 'supplier_id' && $value != '')
@@ -503,15 +523,15 @@ class Items extends Secure_area implements iData_controller
$items_taxes_data = array();
$tax_names = $this->input->post('tax_names');
$tax_percents = $this->input->post('tax_percents');
$tax_updated = false;
$tax_updated = FALSE;
for($k = 0; $k < count($tax_percents); $k++)
{
if( !empty($tax_names[$k]) && is_numeric($tax_percents[$k]))
if(!empty($tax_names[$k]) && is_numeric($tax_percents[$k]))
{
$tax_updated = true;
$tax_updated = TRUE;
$items_taxes_data[] = array('name'=>$tax_names[$k], 'percent'=>$tax_percents[$k]);
$items_taxes_data[] = array('name' => $tax_names[$k], 'percent' => $tax_percents[$k]);
}
}
@@ -520,87 +540,88 @@ class Items extends Secure_area implements iData_controller
$this->Item_taxes->save_multiple($items_taxes_data, $items_to_update);
}
echo json_encode(array('success'=>true,'message'=>$this->lang->line('items_successful_bulk_edit')));
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('items_successful_bulk_edit'), 'id' => $this->xss_clean($items_to_update)));
}
else
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('items_error_updating_multiple')));
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('items_error_updating_multiple')));
}
}
function delete()
public function delete()
{
$items_to_delete = $this->input->post('ids');
if($this->Item->delete_list($items_to_delete))
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('items_successful_deleted').' '.
count($items_to_delete).' '.$this->lang->line('items_one_or_multiple')));
$message = $this->lang->line('items_successful_deleted') . ' ' . count($items_to_delete) . ' ' . $this->lang->line('items_one_or_multiple');
echo json_encode(array('success' => TRUE, 'message' => $message));
}
else
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('items_cannot_be_deleted')));
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('items_cannot_be_deleted')));
}
}
function excel()
public function excel()
{
$data = file_get_contents("import_items.csv");
$name = 'import_items.csv';
$data = file_get_contents($name);
force_download($name, $data);
}
function excel_import()
public function excel_import()
{
$this->load->view("items/form_excel_import", null);
$this->load->view('items/form_excel_import', NULL);
}
function do_excel_import()
public function do_excel_import()
{
$msg = 'do_excel_import';
$failCodes = array();
if ($_FILES['file_path']['error']!=UPLOAD_ERR_OK)
if($_FILES['file_path']['error'] != UPLOAD_ERR_OK)
{
$msg = $this->lang->line('items_excel_import_failed');
echo json_encode( array('success'=>false,'message'=>$msg) );
return;
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('items_excel_import_failed')));
}
else
{
if (($handle = fopen($_FILES['file_path']['tmp_name'], "r")) !== FALSE)
if(($handle = fopen($_FILES['file_path']['tmp_name'], 'r')) !== FALSE)
{
//Skip first row
// Skip the first row as it's the table description
fgetcsv($handle);
$i=1;
while (($data = fgetcsv($handle)) !== FALSE)
$i = 1;
$failCodes = array();
while(($data = fgetcsv($handle)) !== FALSE)
{
if (sizeof($data) >= 23) {
// XSS file data sanity check
$data = $this->xss_clean($data);
if(sizeof($data) >= 23)
{
$item_data = array(
'name' => $data[1],
'description' => $data[11],
'category' => $data[2],
'cost_price' => $data[4],
'unit_price' => $data[5],
'reorder_level' => $data[10],
'supplier_id' => $this->Supplier->exists($data[3]) ? $data[3] : null,
'allow_alt_description' => $data[12] != '' ? '1' : '0',
'is_serialized' => $data[13] != '' ? '1' : '0',
'custom1' => $data[14],
'custom2' => $data[15],
'custom3' => $data[16],
'custom4' => $data[17],
'custom5' => $data[18],
'custom6' => $data[19],
'custom7' => $data[20],
'custom8' => $data[21],
'custom9' => $data[22],
'custom10' => $data[23]
'name' => $data[1],
'description' => $data[11],
'category' => $data[2],
'cost_price' => $data[4],
'unit_price' => $data[5],
'reorder_level' => $data[10],
'supplier_id' => $this->Supplier->exists($data[3]) ? $data[3] : NULL,
'allow_alt_description' => $data[12] != '' ? '1' : '0',
'is_serialized' => $data[13] != '' ? '1' : '0',
'custom1' => $data[14],
'custom2' => $data[15],
'custom3' => $data[16],
'custom4' => $data[17],
'custom5' => $data[18],
'custom6' => $data[19],
'custom7' => $data[20],
'custom8' => $data[21],
'custom9' => $data[22],
'custom10' => $data[23]
);
$item_number = $data[0];
$invalidated = false;
if ($item_number != "")
$invalidated = FALSE;
if($item_number != '')
{
$item_data['item_number'] = $item_number;
$invalidated = $this->Item->item_number_exists($item_number);
@@ -608,21 +629,22 @@ class Items extends Secure_area implements iData_controller
}
else
{
$invalidated = true;
$invalidated = TRUE;
}
if(!$invalidated && $this->Item->save($item_data))
{
$items_taxes_data = null;
$items_taxes_data = NULL;
//tax 1
if( is_numeric($data[7]) && $data[6]!='' )
if(is_numeric($data[7]) && $data[6] != '')
{
$items_taxes_data[] = array('name'=>$data[6], 'percent'=>$data[7] );
$items_taxes_data[] = array('name' => $data[6], 'percent' => $data[7] );
}
//tax 2
if( is_numeric($data[9]) && $data[8]!='' )
if(is_numeric($data[9]) && $data[8] != '')
{
$items_taxes_data[] = array('name'=>$data[8], 'percent'=>$data[9] );
$items_taxes_data[] = array('name' => $data[8], 'percent' => $data[9] );
}
// save tax values
@@ -631,21 +653,21 @@ class Items extends Secure_area implements iData_controller
$this->Item_taxes->save($items_taxes_data, $item_data['item_id']);
}
// quantities & inventory Info
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
$emp_info=$this->Employee->get_info($employee_id);
// quantities & inventory Info
$employee_id = $this->Employee->get_logged_in_employee_info()->person_id;
$emp_info = $this->Employee->get_info($employee_id);
$comment ='Qty CSV Imported';
$cols = count($data);
// array to store information if location got a quantity
$allowed_locations = $this->Stock_location->get_allowed_locations();
for ($col = 24; $col < $cols; $col = $col + 2)
for($col = 24; $col < $cols; $col = $col + 2)
{
$location_id = $data[$col];
if (array_key_exists($location_id, $allowed_locations))
if(array_key_exists($location_id, $allowed_locations))
{
$item_quantity_data = array (
$item_quantity_data = array(
'item_id' => $item_data['item_id'],
'location_id' => $location_id,
'quantity' => $data[$col + 1],
@@ -653,11 +675,11 @@ class Items extends Secure_area implements iData_controller
$this->Item_quantity->save($item_quantity_data, $item_data['item_id'], $location_id);
$excel_data = array(
'trans_items'=>$item_data['item_id'],
'trans_user'=>$employee_id,
'trans_comment'=>$comment,
'trans_location'=>$data[$col],
'trans_inventory'=>$data[$col + 1]
'trans_items' => $item_data['item_id'],
'trans_user' => $employee_id,
'trans_comment' => $comment,
'trans_location' => $data[$col],
'trans_inventory' => $data[$col + 1]
);
$this->Inventory->insert($excel_data);
@@ -679,45 +701,41 @@ class Items extends Secure_area implements iData_controller
);
$this->Item_quantity->save($item_quantity_data, $item_data['item_id'], $data[$col]);
$excel_data = array
(
'trans_items'=>$item_data['item_id'],
'trans_user'=>$employee_id,
'trans_comment'=>$comment,
'trans_location'=>$location_id,
'trans_inventory'=>0
);
$this->db->insert('inventory',$excel_data);
$excel_data = array(
'trans_items' => $item_data['item_id'],
'trans_user' => $employee_id,
'trans_comment' => $comment,
'trans_location' => $location_id,
'trans_inventory' => 0
);
$this->Inventory->insert($excel_data);
}
}
else//insert or update item failure
else //insert or update item failure
{
$failCodes[] = $i;
}
$i++;
}
}
else
{
echo json_encode( array('success'=>false, 'message'=>'Your upload file has no data or not in supported format.') );
return;
}
if(count($failCodes) > 0)
{
$message = $this->lang->line('items_excel_import_partially_failed') . ' (' . count($failCodes) . '): ' . implode(', ', $failCodes);
echo json_encode(array('success' => FALSE, 'message' => $message));
}
else
{
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('items_excel_import_success')));
}
}
else
{
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('items_excel_import_nodata_wrongformat')));
}
}
$success = true;
if(count($failCodes) > 0)
{
$msg = "Most items imported. But some were not, here is list of their CODE (" .count($failCodes) ."): ".implode(", ", $failCodes);
$success = false;
}
else
{
$msg = "Import items successful";
}
echo json_encode( array('success'=>$success, 'message'=>$msg) );
}
}
?>

View File

@@ -1,192 +0,0 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
// ---------------------------------------------------------------------
class Languagecheck extends CI_Controller {
/*
* use this language as comparison reference.
* this should be the one that is complete.
*/
private $reference = 'english';
private $lang_path = 'language';
// -----------------------------------------------------------------
/*
* controller constructor
*/
function Languagecheck()
{
parent::Controller();
}
// -----------------------------------------------------------------
/*
* use remap to capture all calls to this controller
*/
function _remap()
{
// load the required helpers
$this->load->helper('directory');
// for simplicity, we don't use views
$this->output('h1', 'Open Source Point of Sale - Language file checking and validation');
// determine the language file path
if ( ! is_dir($this->lang_path) )
{
$this->lang_path = APPPATH . $this->lang_path;
if ( ! is_dir($this->lang_path) )
{
$this->output('h2', 'Defined language path "'.$this->lang_path.'" not found!', TRUE);
exit;
}
}
// fetch the languages directory map
$languages = directory_map( $this->lang_path, TRUE );
// is our reference language present?
if ( ! in_array($this->reference, $languages ) )
{
$this->output('h2', 'Reference language "'.$this->reference.'" not found!', TRUE);
exit;
}
// load the list of language files for the reference language
$references = directory_map( $this->lang_path . '/' . $this->reference, TRUE );
// now process the list
foreach( $references as $reference )
{
// skip non-language files in the language directory
if ( strpos($reference, '_lang.php') === FALSE )
{
continue;
}
// process it
$this->output('h2', 'Processing '.$this->reference . ' &raquo; ' .$reference);
// load the language file
include $this->lang_path . '/' . $this->reference . '/' . $reference;
// did the file contain any language strings?
if ( empty($lang) )
{
// language file was empty or not properly defined
$this->output('h3', 'Language file doesn\'t contain any language strings. Skipping file!', TRUE);
continue;
}
// store the loaded language strings
$lang_ref = $lang;
unset($lang);
// now loop through the available languages
foreach ( $languages as $language )
{
// skip the reference language
if ( $language == $this->reference )
{
continue;
}
// language file to check
$file = $this->lang_path . '/' . $language . '/' . $reference;
// check if the language file exists for this language
if ( ! file_exists( $file ) )
{
// file not found
$this->output('h3', 'Language file doesn\'t exist for the language '.$language.'!', TRUE);
}
else
{
// load the file to compare
include $file;
// did the file contain any language strings?
if ( empty($lang) )
{
// language file was empty or not properly defined
$this->output('h3', 'Language file for the language '.$language.' doesn\'t contain any language strings!', TRUE);
}
else
{
// start comparing
$this->output('h3', 'Comparing with the '.$language.' version:');
// assume all goes well
$failures = 0;
// start comparing language keys
foreach( $lang_ref as $key => $value )
{
if ( ! isset($lang[$key]) )
{
// report the missing key
$this->output('', 'Missing language string "'.$key.'"', TRUE);
// increment the failure counter
$failures++;
}
}
if ( ! $failures )
{
$this->output('', 'The two language files have matching strings.');
}
}
// make sure the lang array is deleted before the next check
if ( isset($lang) )
{
unset($lang);
}
}
}
}
$this->output('h2', 'Language file checking and validation completed');
}
// -----------------------------------------------------------------
private function output($type = '', $line = '', $highlight = FALSE)
{
switch ($type)
{
case 'h1':
$html = "<h1>{line}</h1>\n<hr />\n";
break;
case 'h2':
$html = "<h2>{line}</h2>\n";
break;
case 'h3':
$html = "<h3>&nbsp;&nbsp;&nbsp;{line}</h3>\n";
break;
default:
$html = "&nbsp;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;{line}<br />";
break;
}
if ( $highlight )
{
$line = '<span style="color:red;font-weight:bold;">' . $line . '</span>';
}
echo str_replace('{line}', $line, $html);
}
// -----------------------------------------------------------------
}
/* End of file languagecheck.php */
/* Location: ./application/controllers/languagecheck.php */

View File

@@ -1,12 +1,13 @@
<?php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Login extends CI_Controller
{
function __construct()
public function __construct()
{
parent::__construct();
}
function index()
public function index()
{
if($this->Employee->is_logged_in())
{
@@ -28,7 +29,7 @@ class Login extends CI_Controller
}
}
function login_check($username)
public function login_check($username)
{
$password = $this->input->post('password');
@@ -36,10 +37,10 @@ class Login extends CI_Controller
{
$this->form_validation->set_message('login_check', $this->lang->line('login_invalid_username_and_password'));
return false;
return FALSE;
}
return true;
return TRUE;
}
}
?>

View File

@@ -1,64 +1,73 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once ("Secure_area.php");
class Messages extends Secure_area
require_once("Secure_Controller.php");
class Messages extends Secure_Controller
{
function __construct()
public function __construct()
{
parent::__construct('messages');
}
public function index()
{
$data['controller_name'] = $this->get_controller_name();
$this->load->view('messages/sms');
}
function view($person_id=-1)
public function view($person_id = -1)
{
$data['person_info'] = $this->Person->get_info($person_id);
$info = $this->Person->get_info($person_id);
foreach(get_object_vars($info) as $property => $value)
{
$info->$property = $this->xss_clean($value);
}
$data['person_info'] = $info;
$this->load->view('messages/form_sms', $data);
}
function send()
public function send()
{
$username = $this->config->item('msg_uid');
$password = $this->config->item('msg_pwd');
$phone = $this->input->post('phone');
$message = $this->input->post('message');
$username = $this->config->item('msg_uid');
$password = $this->config->item('msg_pwd');
$phone = $this->input->post('phone');
$message = $this->input->post('message');
$originator = $this->config->item('msg_src');
$response = $this->sms->sendSMS($username, $password, $phone, $message, $originator);
$phone = $this->xss_clean($phone);
if($response)
{
echo json_encode(array('success'=>true, 'message'=>$this->lang->line('messages_successfully_sent') . ' ' . $phone));
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('messages_successfully_sent') . ' ' . $phone));
}
else
{
echo json_encode(array('success'=>false, 'message'=>$this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone));
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone));
}
}
function send_form($person_id=-1)
public function send_form($person_id = -1)
{
$username = $this->config->item('msg_uid');
$password = $this->config->item('msg_pwd');
$phone = $this->input->post('phone');
$message = $this->input->post('message');
$username = $this->config->item('msg_uid');
$password = $this->config->item('msg_pwd');
$phone = $this->input->post('phone');
$message = $this->input->post('message');
$originator = $this->config->item('msg_src');
$response = $this->sms->sendSMS($username, $password, $phone, $message, $originator);
$phone = $this->xss_clean($phone);
$person_id = $this->xss_clean($person_id);
if($response)
{
echo json_encode(array('success'=>true, 'message'=>$this->lang->line('messages_successfully_sent') . ' ' . $phone, 'person_id'=>$person_id));
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('messages_successfully_sent') . ' ' . $phone, 'person_id' => $person_id));
}
else
{
echo json_encode(array('success'=>false, 'message'=>$this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone, 'person_id'=>-1));
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('messages_unsuccessfully_sent') . ' ' . $phone, 'person_id' => -1));
}
}
}

View File

@@ -1,16 +1,20 @@
<?php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class No_Access extends CI_Controller
{
function __construct()
public function __construct()
{
parent::__construct();
}
function index($module_id='',$permission_id='')
public function index($module_id = '', $permission_id = '')
{
$data['module_name']=$this->Module->get_module_name($module_id);
$data['permission_id']=$permission_id;
$this->load->view('no_access',$data);
$data['module_name'] = $this->Module->get_module_name($module_id);
$data['permission_id'] = $permission_id;
$data = $this->security->xss_clean($data);
$this->load->view('no_access', $data);
}
}
?>

View File

@@ -1,53 +0,0 @@
<?php
require_once ("interfaces/Iperson_controller.php");
require_once ("Secure_area.php");
abstract class Person_controller extends Secure_area implements iPerson_controller
{
function __construct($module_id=null)
{
parent::__construct($module_id);
}
/*
This returns a mailto link for persons with a certain id. This is called with AJAX.
*/
function mailto()
{
$people_to_email=$this->input->post('ids');
if($people_to_email!=false)
{
$mailto_url='mailto:';
foreach($this->Person->get_multiple_info($people_to_email)->result() as $person)
{
$mailto_url.=$person->email.',';
}
//remove last comma
$mailto_url=substr($mailto_url,0,strlen($mailto_url)-1);
echo $mailto_url;
exit;
}
echo '#';
}
/*
Gives search suggestions based on what is being searched for
*/
function suggest()
{
$suggestions = $this->Person->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));
echo implode("\n",$suggestions);
}
/*
Gets one row for a person manage table. This is called using AJAX to update one row.
*/
function get_row()
{
$person_id = $this->input->post('row_id');
$data_row=get_person_data_row($this->Person->get_info($person_id),$this);
echo $data_row;
}
}
?>

View File

@@ -0,0 +1,32 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once("Secure_Controller.php");
abstract class Persons extends Secure_Controller
{
public function __construct($module_id = NULL)
{
parent::__construct($module_id);
}
/*
Gives search suggestions based on what is being searched for
*/
public function suggest()
{
$suggestions = $this->xss_clean($this->Person->get_search_suggestions($this->input->post('term')));
echo json_encode($suggestions);
}
/*
Gets one row for a person manage table. This is called using AJAX to update one row.
*/
public function get_row($row_id)
{
$data_row = $this->xss_clean(get_person_data_row($this->Person->get_info($row_id), $this));
echo json_encode($data_row);
}
}
?>

View File

@@ -1,10 +1,13 @@
<?php
require_once ("Secure_area.php");
class Receivings extends Secure_area
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once("Secure_Controller.php");
class Receivings extends Secure_Controller
{
function __construct()
{
parent::__construct('receivings');
$this->load->library('receiving_lib');
$this->load->library('barcode_lib');
}
@@ -16,7 +19,9 @@ class Receivings extends Secure_area
function item_search()
{
$suggestions = $this->Item->get_search_suggestions($this->input->get('term'));
$suggestions = $this->Item->get_search_suggestions($this->input->get('term'), array(
'search_custom' => FALSE, 'is_deleted' => FALSE
), TRUE);
$suggestions = array_merge($suggestions, $this->Item_kit->get_search_suggestions($this->input->get('term')));
echo json_encode($suggestions);
}
@@ -263,10 +268,9 @@ class Receivings extends Secure_area
private function _substitute_invoice_number($supplier_info='')
{
$invoice_number=$this->receiving_lib->get_invoice_number();
$invoice_number=$this->config->config['recv_invoice_format'];
$invoice_number = $this->_substitute_variables($invoice_number,$supplier_info);
$this->receiving_lib->set_invoice_number($invoice_number);
$this->receiving_lib->set_invoice_number($invoice_number, TRUE);
return $this->receiving_lib->get_invoice_number();
}
@@ -358,13 +362,13 @@ class Receivings extends Secure_area
$this->load->view("receivings/receiving",$data);
}
function save($receiving_id)
function save($receiving_id = -1)
{
$date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $this->input->post('date', TRUE));
$date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $this->input->post('date'));
$receiving_data = array(
'receiving_time' => $date_formatter->format('Y-m-d H:i:s'),
'supplier_id' => $this->input->post('supplier_id', TRUE) ? $this->input->post('supplier_id') : null,
'supplier_id' => $this->input->post('supplier_id') ? $this->input->post('supplier_id') : null,
'employee_id' => $this->input->post('employee_id'),
'comment' => $this->input->post('comment'),
'invoice_number' => $this->input->post('invoice_number')

View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,13 @@
<?php
require_once ("Secure_area.php");
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Sales extends Secure_area
require_once("Secure_Controller.php");
class Sales extends Secure_Controller
{
function __construct()
{
parent::__construct('sales');
$this->load->library('sale_lib');
$this->load->library('barcode_lib');
}
@@ -15,7 +17,7 @@ class Sales extends Secure_area
$this->_reload();
}
function manage($only_invoices = FALSE, $only_cash = FALSE, $limit_from = 0)
function manage()
{
$person_id = $this->session->userdata('person_id');
@@ -25,36 +27,8 @@ class Sales extends Secure_area
}
else
{
$this->Sale->create_sales_items_temp_table();
$data['table_headers'] = get_sales_manage_table_headers();
$data['controller_name'] = $this->get_controller_name();
$lines_per_page = $this->Appconfig->get('lines_per_page');
$today_start = date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), mktime(0, 0, 0));
$today_end = date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), mktime(23, 59, 59));
$start_date = $this->input->post('start_date') != null ? $this->input->post('start_date') : $today_start;
$start_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $start_date);
$end_date = $this->input->post('end_date') != null ? $this->input->post('end_date') : $today_end;
$end_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $end_date);
$sale_type = 'all';
$location_id = 'all';
$is_valid_receipt = FALSE;
$search = null;
$filters = array('sale_type' => $sale_type,
'location_id' => $location_id,
'start_date' => $start_date_formatter->format('Y-m-d H:i:s'),
'end_date' => $end_date_formatter->format('Y-m-d H:i:s'),
'only_cash' => $only_cash,
'only_invoices' => $only_invoices,
'is_valid_receipt' => $is_valid_receipt);
$sales = $this->Sale->search($search, $filters, $lines_per_page, $limit_from)->result_array();
$payments = $this->Sale->get_payments_summary($search, $filters);
$total_rows = $this->Sale->get_found_rows($search, $filters);
// filters that will be loaded in the multiselect dropdown
if($this->config->item('invoice_enable') == TRUE)
{
@@ -65,98 +39,76 @@ class Sales extends Secure_area
{
$data['filters'] = array('only_cash' => $this->lang->line('sales_cash_filter'));
}
$data['selected'] = array( ($only_cash ? 'only_cash' : ''), ($only_invoices ? 'only_invoices' : '') );
$data['start_date'] = $start_date;
$data['end_date'] = $end_date;
$data['links'] = $this->_initialize_pagination($this->Sale, $lines_per_page, $limit_from, $total_rows, 'manage', $only_invoices);
$data['manage_table'] = get_sales_manage_table($sales, $this);
$data['payments_summary'] = get_sales_manage_payments_summary($payments, $sales, $this);
$this->load->view($data['controller_name'] . '/manage', $data);
$this->load->view('sales/manage', $data);
}
}
function get_row()
function get_row($row_id)
{
$this->Sale->create_sales_items_temp_table();
$sale_id = $this->input->post('row_id');
$sale_info = $this->Sale->get_info($sale_id)->result_array();
$data_row = get_sales_manage_sale_data_row($sale_info[0], $this);
$sale_info = $this->Sale->get_info($row_id)->row();
$data_row = get_sale_data_row($sale_info, $this);
echo $data_row;
echo json_encode($data_row);
}
/*
Returns Sales table data rows. This will be called with AJAX.
*/
function search()
{
$this->Sale->create_sales_items_temp_table();
$search = $this->input->post('search') != '' ? $this->input->post('search') : null;
$limit_from = $this->input->post('limit_from');
$lines_per_page = $this->Appconfig->get('lines_per_page');
$today = date($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'));
$start_date = $this->input->post('start_date') != null ? $this->input->post('start_date') : $today;
$start_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $start_date);
$end_date = $this->input->post('end_date') != null ? $this->input->post('end_date') : $today;
$end_date_formatter = date_create_from_format($this->config->item('dateformat') . ' ' . $this->config->item('timeformat'), $end_date);
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$order = $this->input->get('order');
$is_valid_receipt = isset($search) ? $this->sale_lib->is_valid_receipt($search) : FALSE;
$sale_type = 'all';
$location_id = 'all';
if($this->config->item('invoice_enable') == TRUE)
{
$only_invoices = $this->input->post('only_invoices') != null;
}
else
{
$only_invoices = FALSE;
}
$only_cash = $this->input->post('only_cash') != null;
$filters = array('sale_type' => 'all',
'location_id' => 'all',
'start_date' => $this->input->get('start_date'),
'end_date' => $this->input->get('end_date'),
'only_cash' => FALSE,
'only_invoices' => $this->config->item('invoice_enable') && $this->input->get('only_invoices'),
'is_valid_receipt' => $is_valid_receipt);
$filters = array('sale_type' => $sale_type,
'location_id' => $location_id,
'start_date' => $start_date_formatter->format('Y-m-d H:i:s'),
'end_date' => $end_date_formatter->format('Y-m-d H:i:s'),
'only_cash' => FALSE,
'only_invoices' => FALSE,
'is_valid_receipt' => $is_valid_receipt);
// check if any filter is set in the multiselect dropdown
if( $this->input->post('filters') != null )
{
foreach($this->input->post('filters') as $key)
{
$filters[$key] = TRUE;
}
}
$filledup = array_fill_keys($this->input->get('filters'), TRUE);
$filters = array_merge($filters, $filledup);
$sales = $this->Sale->search($search, $filters, $lines_per_page, $limit_from)->result_array();
$payments = $this->Sale->get_payments_summary($search, $filters);
$sales = $this->Sale->search($search, $filters, $limit, $offset, $sort, $order);
$total_rows = $this->Sale->get_found_rows($search, $filters);
$links = $this->_initialize_pagination($this->Sale, $lines_per_page, $limit_from, $total_rows, 'search', $only_invoices);
$sale_rows = get_sales_manage_table_data_rows($sales, $this);
$payments = $this->Sale->get_payments_summary($search, $filters);
$payment_summary = get_sales_manage_payments_summary($payments, $sales, $this);
echo json_encode(array('total_rows' => $total_rows, 'rows' => $sale_rows, 'pagination' => $links, 'payment_summary' => $payment_summary));
$data_rows = array();
foreach($sales->result() as $sale)
{
$data_rows[] = get_sale_data_row($sale, $this);
}
if ($total_rows > 0)
{
$total_rows++;
$data_rows[] = get_sale_data_last_row($sales, $this);
}
echo json_encode(array('total' => $total_rows, 'rows' => $data_rows,'payment_summary' => $payment_summary));
}
function item_search()
{
$suggestions = array();
$search = $this->input->get('term') != '' ? $this->input->get('term') : null;
$receipt = $search = $this->input->get('term') != '' ? $this->input->get('term') : null;
if ($this->sale_lib->get_mode() == 'return' && $this->sale_lib->is_valid_receipt($search) )
if ($this->sale_lib->get_mode() == 'return' && $this->sale_lib->is_valid_receipt($receipt) )
{
$suggestions[] = $search;
// if a valid receipt or invoice was found the search term will be replaced with a receipt number (POS #)
$suggestions[] = $receipt;
}
$suggestions = array_merge($suggestions, $this->Item->get_search_suggestions($search));
$suggestions = array_merge($suggestions, $this->Item->get_search_suggestions($search, array('search_custom' => FALSE, 'is_deleted' => FALSE), TRUE));
$suggestions = array_merge($suggestions, $this->Item_kit->get_search_suggestions($search));
echo json_encode($suggestions);
@@ -183,10 +135,10 @@ class Sales extends Secure_area
function change_mode()
{
$stock_location = $this->input->post("stock_location");
$stock_location = $this->input->post('stock_location');
if (!$stock_location || $stock_location == $this->sale_lib->get_sale_location())
{
$mode = $this->input->post("mode");
$mode = $this->input->post('mode');
$this->sale_lib->set_mode($mode);
}
else if ($this->Stock_location->is_allowed_location($stock_location, 'sales'))
@@ -440,7 +392,7 @@ class Sales extends Secure_area
}
else
{
$this->email->message($this->load->view("sales/receipt_email", $data, true));
$this->email->message($this->load->view('sales/receipt_email', $data, true));
}
$this->email->send();
}
@@ -449,11 +401,11 @@ class Sales extends Secure_area
$data['print_after_sale'] = $this->sale_lib->is_print_after_sale();
if ($this->sale_lib->is_invoice_number_enabled() && $this->config->item('use_invoice_template'))
{
$this->load->view("sales/invoice", $data);
$this->load->view('sales/invoice', $data);
}
else
{
$this->load->view("sales/receipt", $data);
$this->load->view('sales/receipt', $data);
}
$this->sale_lib->clear_all();
@@ -609,7 +561,7 @@ class Sales extends Secure_area
function receipt($sale_id)
{
$data = $this->_load_sale_data($sale_id);
$this->load->view("sales/receipt", $data);
$this->load->view('sales/receipt', $data);
$this->sale_lib->clear_all();
}
@@ -620,7 +572,7 @@ class Sales extends Secure_area
$sale_info = $this->_load_sale_data($sale_id);
}
$this->load->view("sales/invoice", $sale_info);
$this->load->view('sales/invoice', $sale_info);
$this->sale_lib->clear_all();
}
@@ -663,7 +615,7 @@ class Sales extends Secure_area
}
}
function save($sale_id)
function save($sale_id = -1)
{
$newdate = $this->input->post('date');

View File

@@ -0,0 +1,52 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Secure_Controller extends CI_Controller
{
/*
* Controllers that are considered secure extend Secure_Controller, optionally a $module_id can
* be set to also check if a user can access a particular module in the system.
*/
public function __construct($module_id = NULL, $submodule_id = NULL)
{
parent::__construct();
$this->load->model('Employee');
$model = $this->Employee;
if(!$model->is_logged_in())
{
redirect('login');
}
$logged_in_employee_info = $model->get_logged_in_employee_info();
if(!$model->has_module_grant($module_id, $logged_in_employee_info->person_id) ||
(isset($submodule_id) && !$model->has_module_grant($submodule_id, $logged_in_employee_info->person_id)))
{
redirect('no_access/' . $module_id . '/' . $submodule_id);
}
// load up global data visible to all the loaded views
$data['allowed_modules'] = $this->Module->get_allowed_modules($logged_in_employee_info->person_id);
$data['user_info'] = $logged_in_employee_info;
$data['controller_name'] = $module_id;
$this->load->vars($data);
}
/*
* Internal method to do XSS clean in the derived classes
*/
protected function xss_clean($str, $is_image = FALSE)
{
return $this->security->xss_clean($str, $is_image);
}
// this is the basic set of methods most OSPOS Controllers will implement
public function index() { return FALSE; }
public function search() { return FALSE; }
public function suggest_search() { return FALSE; }
public function view($data_item_id = -1) { return FALSE; }
public function save($data_item_id = -1) { return FALSE; }
public function delete() { return FALSE; }
}
?>

View File

@@ -1,65 +0,0 @@
<?php
class Secure_area extends CI_Controller
{
private $controller_name;
/*
Controllers that are considered secure extend Secure_area, optionally a $module_id can
be set to also check if a user can access a particular module in the system.
*/
function __construct($module_id=null,$submodule_id=null)
{
parent::__construct();
$this->load->model('Employee');
if(!$this->Employee->is_logged_in())
{
redirect('login');
}
$employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
if(!$this->Employee->has_module_grant($module_id,$employee_id) ||
(isset($submodule_id) && !$this->Employee->has_module_grant($submodule_id,$employee_id)))
{
redirect('no_access/'.$module_id.'/'.$submodule_id);
}
//load up global data
$logged_in_employee_info=$this->Employee->get_logged_in_employee_info();
$data['allowed_modules']=$this->Module->get_allowed_modules($logged_in_employee_info->person_id);
$data['backup_allowed']=false;
foreach($data['allowed_modules']->result_array() as $module)
{
$data['backup_allowed']|=$module['module_id']==='config';
}
$data['user_info']=$logged_in_employee_info;
$data['controller_name']=$module_id;
$this->controller_name=$module_id;
$this->load->vars($data);
}
function get_controller_name()
{
return strtolower($this->controller_name);
}
function _initialize_pagination($object, $lines_per_page, $limit_from = 0, $total_rows = -1, $function='index', $filter='')
{
$this->load->library('pagination');
$config['base_url'] = site_url($this->get_controller_name() . "/$function/" . $filter);
$config['total_rows'] = $total_rows > -1 ? $total_rows : call_user_func(array($object, 'get_total_rows'));
$config['per_page'] = $lines_per_page;
$config['num_links'] = 2;
$config['last_link'] = $this->lang->line('common_last_page');
$config['first_link'] = $this->lang->line('common_first_page');
// page is calculated here instead of in pagination lib
$config['cur_page'] = $limit_from > 0 ? $limit_from : 0;
$config['page_query_string'] = FALSE;
$config['uri_segment'] = 0;
$this->pagination->initialize($config);
return $this->pagination->create_links();
}
}
?>

View File

@@ -1,136 +1,145 @@
<?php
require_once ("Person_controller.php");
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Suppliers extends Person_controller
require_once("Persons.php");
class Suppliers extends Persons
{
function __construct()
public function __construct()
{
parent::__construct('suppliers');
}
function index($limit_from=0)
public function index()
{
$data['controller_name'] = $this->get_controller_name();
$lines_per_page = $this->Appconfig->get('lines_per_page');
$suppliers = $this->Supplier->get_all($lines_per_page);
$data['links'] = $this->_initialize_pagination($this->Supplier, $lines_per_page, $limit_from);
$data['manage_table'] = get_supplier_manage_table($suppliers, $this);
$this->load->view('suppliers/manage', $data);
$data['table_headers'] = $this->xss_clean(get_suppliers_manage_table_headers());
$this->load->view('people/manage', $data);
}
/*
Returns Supplier table data rows. This will be called with AJAX.
*/
function search()
public function search()
{
$search = $this->input->post('search') != '' ? $this->input->post('search') : null;
$limit_from = $this->input->post('limit_from');
$lines_per_page = $this->Appconfig->get('lines_per_page');
$search = $this->input->get('search');
$limit = $this->input->get('limit');
$offset = $this->input->get('offset');
$sort = $this->input->get('sort');
$order = $this->input->get('order');
$suppliers = $this->Supplier->search($search, $lines_per_page, $limit_from);
$suppliers = $this->Supplier->search($search, $limit, $offset, $sort, $order);
$total_rows = $this->Supplier->get_found_rows($search);
$links = $this->_initialize_pagination($this->Supplier, $lines_per_page, $limit_from, $total_rows);
$data_rows = get_supplier_manage_table_data_rows($suppliers, $this);
echo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));
$data_rows = array();
foreach($suppliers->result() as $supplier)
{
$data_rows[] = get_supplier_data_row($supplier, $this);
}
$data_rows = $this->xss_clean($data_rows);
echo json_encode(array('total' => $total_rows, 'rows' => $data_rows));
}
/*
Gives search suggestions based on what is being searched for
*/
function suggest()
public function suggest()
{
$suggestions = $this->Supplier->get_search_suggestions($this->input->get('term'), TRUE);
$suggestions = $this->xss_clean($this->Supplier->get_search_suggestions($this->input->get('term'), TRUE));
echo json_encode($suggestions);
}
function suggest_search()
public function suggest_search()
{
$suggestions = $this->Supplier->get_search_suggestions($this->input->post('term'), FALSE);
$suggestions = $this->xss_clean($this->Supplier->get_search_suggestions($this->input->post('term'), FALSE));
echo json_encode($suggestions);
}
/*
Loads the supplier edit form
*/
function view($supplier_id=-1)
public function view($supplier_id = -1)
{
$data['person_info']=$this->Supplier->get_info($supplier_id);
$this->load->view("suppliers/form",$data);
$info = $this->Supplier->get_info($supplier_id);
foreach(get_object_vars($info) as $property => $value)
{
$info->$property = $this->xss_clean($value);
}
$data['person_info'] = $info;
$this->load->view("suppliers/form", $data);
}
/*
Inserts/updates a supplier
*/
function save($supplier_id=-1)
public function save($supplier_id = -1)
{
$person_data = array(
'first_name'=>$this->input->post('first_name'),
'last_name'=>$this->input->post('last_name'),
'gender'=>$this->input->post('gender'),
'email'=>$this->input->post('email'),
'phone_number'=>$this->input->post('phone_number'),
'address_1'=>$this->input->post('address_1'),
'address_2'=>$this->input->post('address_2'),
'city'=>$this->input->post('city'),
'state'=>$this->input->post('state'),
'zip'=>$this->input->post('zip'),
'country'=>$this->input->post('country'),
'comments'=>$this->input->post('comments')
'first_name' => $this->input->post('first_name'),
'last_name' => $this->input->post('last_name'),
'gender' => $this->input->post('gender'),
'email' => $this->input->post('email'),
'phone_number' => $this->input->post('phone_number'),
'address_1' => $this->input->post('address_1'),
'address_2' => $this->input->post('address_2'),
'city' => $this->input->post('city'),
'state' => $this->input->post('state'),
'zip' => $this->input->post('zip'),
'country' => $this->input->post('country'),
'comments' => $this->input->post('comments')
);
$supplier_data=array(
'company_name'=>$this->input->post('company_name'),
'agency_name'=>$this->input->post('agency_name'),
'account_number'=>$this->input->post('account_number') == '' ? null : $this->input->post('account_number')
$supplier_data = array(
'company_name' => $this->input->post('company_name'),
'agency_name' => $this->input->post('agency_name'),
'account_number' => $this->input->post('account_number') == '' ? NULL : $this->input->post('account_number')
);
if($this->Supplier->save_supplier($person_data,$supplier_data,$supplier_id))
if($this->Supplier->save_supplier($person_data, $supplier_data, $supplier_id))
{
$supplier_data = $this->xss_clean($supplier_data);
//New supplier
if($supplier_id==-1)
if($supplier_id == -1)
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('suppliers_successful_adding').' '.
$supplier_data['company_name'],'person_id'=>$supplier_data['person_id']));
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('suppliers_successful_adding').' '.
$supplier_data['company_name'], 'id' => $supplier_data['person_id']));
}
else //previous supplier
else //Existing supplier
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('suppliers_successful_updating').' '.
$supplier_data['company_name'],'person_id'=>$supplier_id));
echo json_encode(array('success' => TRUE, 'message' => $this->lang->line('suppliers_successful_updating').' '.
$supplier_data['company_name'], 'id' => $supplier_id));
}
}
else//failure
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('suppliers_error_adding_updating').' '.
$supplier_data['company_name'],'person_id'=>-1));
{
$supplier_data = $this->xss_clean($supplier_data);
echo json_encode(array('success' => FALSE, 'message' => $this->lang->line('suppliers_error_adding_updating').' '.
$supplier_data['company_name'], 'id' => -1));
}
}
/*
This deletes suppliers from the suppliers table
*/
function delete()
public function delete()
{
$suppliers_to_delete=$this->input->post('ids');
$suppliers_to_delete = $this->xss_clean($this->input->post('ids'));
if($this->Supplier->delete_list($suppliers_to_delete))
{
echo json_encode(array('success'=>true,'message'=>$this->lang->line('suppliers_successful_deleted').' '.
count($suppliers_to_delete).' '.$this->lang->line('suppliers_one_or_multiple')));
echo json_encode(array('success' => TRUE,'message' => $this->lang->line('suppliers_successful_deleted').' '.
count($suppliers_to_delete).' '.$this->lang->line('suppliers_one_or_multiple')));
}
else
{
echo json_encode(array('success'=>false,'message'=>$this->lang->line('suppliers_cannot_be_deleted')));
echo json_encode(array('success' => FALSE,'message' => $this->lang->line('suppliers_cannot_be_deleted')));
}
}
/*
Gets one row for a supplier manage table. This is called using AJAX to update one row.
*/
function get_row()
{
$person_id = $this->input->post('row_id');
$data_row=get_supplier_data_row($this->Supplier->get_info($person_id),$this);
echo $data_row;
}
}
?>

View File

@@ -1,16 +0,0 @@
<?php
/*
This interface is implemented by any controller that keeps track of data items, such
as the customers, employees, and items controllers.
*/
interface iData_controller
{
public function index();
public function search();
public function suggest_search();
public function get_row();
public function view($data_item_id=-1);
public function save($data_item_id=-1);
public function delete();
}
?>

View File

@@ -1,11 +0,0 @@
<?php
/*
This interface is implemented by any controller that keeps track of people, such
as customers and employees.
*/
require_once("Idata_controller.php");
interface iPerson_controller extends iData_controller
{
public function mailto();
}
?>

View File

@@ -4,7 +4,7 @@
* Currency locale
*/
function to_currency($number, $escape=FALSE)
function to_currency($number, $escape = FALSE)
{
$CI =& get_instance();
@@ -14,26 +14,40 @@ function to_currency($number, $escape=FALSE)
$decimal_point = $CI->config->item('decimal_point') ? $CI->config->item('decimal_point') : '.';
$decimals = $CI->config->item('currency_decimals') ? $CI->config->item('currency_decimals') : 0;
// the conversion function needs a non null var, so if the number is null set it to 0
if(empty($number))
{
$number = 0;
}
if($number >= 0)
{
if(!$CI->config->item('currency_side'))
{
return $currency_symbol.number_format($number, $decimals, $decimal_point, $thousands_separator);
}
else
{
return number_format($number, $decimals, $decimal_point, $thousands_separator).$currency_symbol;
}
}
else
{
if(!$CI->config->item('currency_side'))
{
return '-'.$currency_symbol.number_format(abs($number), $decimals, $decimal_point, $thousands_separator);
}
else
{
return '-'.number_format(abs($number), $decimals, $decimal_point, $thousands_separator).$currency_symbol;
}
}
}
function to_currency_no_money($number)
{
// ignore empty strings as they are just for empty input
if( empty($number) )
if(empty($number))
{
return $number;
}

View File

@@ -1,48 +1,32 @@
<?php
function get_sales_manage_table($sales, $controller)
function get_sales_manage_table_headers()
{
$CI =& get_instance();
$table='<table class="tablesorter table table-striped table-hover" id="sortable_table">';
$headers = array('&nbsp;',
$CI->lang->line('sales_receipt_number'),
$CI->lang->line('sales_sale_time'),
$CI->lang->line('customers_customer'),
$CI->lang->line('sales_amount_tendered'),
$CI->lang->line('sales_amount_due'),
$CI->lang->line('sales_change_due'),
$CI->lang->line('sales_payment'));
$headers = array(
array('sale_id' => $CI->lang->line('common_id')),
array('sale_time' => $CI->lang->line('sales_sale_time')),
array('customer_name' => $CI->lang->line('customers_customer')),
array('amount_tendered' => $CI->lang->line('sales_amount_tendered')),
array('amount_due' => $CI->lang->line('sales_amount_due')),
array('change_due' => $CI->lang->line('sales_change_due')),
array('payment_type' => $CI->lang->line('sales_payment_type'))
);
if($CI->config->item('invoice_enable') == TRUE)
{
$headers[] = $CI->lang->line('sales_invoice_number');
$headers[] = '&nbsp';
$headers[] = '&nbsp';
$headers[] = '&nbsp';
}
else
{
$headers[] = '&nbsp';
$headers[] = '&nbsp';
$headers[] = array('invoice_number' => $CI->lang->line('sales_invoice_number'));
$headers[] = array('invoice' => '&nbsp', 'sortable' => FALSE);
}
$table.='<thead><tr>';
foreach($headers as $header)
{
$table.="<th>$header</th>";
}
$table.='</tr></thead><tbody>';
$table.=get_sales_manage_table_data_rows($sales, $controller);
$table.='</tbody></table>';
return $table;
return transform_headers(array_merge($headers, array(array('receipt' => '&nbsp', 'sortable' => FALSE))));
}
/*
Gets the html data rows for the sales.
*/
function get_sales_manage_table_data_rows($sales, $controller)
function get_sale_data_last_row($sales, $controller)
{
$CI =& get_instance();
$table_data_rows = '';
@@ -50,59 +34,52 @@ function get_sales_manage_table_data_rows($sales, $controller)
$sum_amount_due = 0;
$sum_change_due = 0;
foreach($sales as $key=>$sale)
foreach($sales->result() as $key=>$sale)
{
$table_data_rows .= get_sales_manage_sale_data_row($sale, $controller);
$sum_amount_tendered += $sale['amount_tendered'];
$sum_amount_due += $sale['amount_due'];
$sum_change_due += $sale['change_due'];
$sum_amount_tendered += $sale->amount_tendered;
$sum_amount_due += $sale->amount_due;
$sum_change_due += $sale->change_due;
}
if($table_data_rows == '')
{
$table_data_rows .= "<tr><td colspan='12'><div class='alert alert-dismissible alert-info'>".$CI->lang->line('sales_no_sales_to_display')."</div></td></tr>";
}
else
{
$table_data_rows .= "<tr class='static-last'><td>&nbsp;</td><td>".$CI->lang->line('sales_total')."</td><td>&nbsp;</td><td>&nbsp;</td><td>".to_currency($sum_amount_tendered)."</td><td>".to_currency($sum_amount_due)."</td><td>".to_currency($sum_change_due)."</td><td colspan=\"5\"></td></tr>";
}
return $table_data_rows;
return array(
'sale_id' => '-',
'sale_time' => '<b>'.$CI->lang->line('sales_total').'</b>',
'amount_tendered' => '<b>'. to_currency($sum_amount_tendered).'</b>',
'amount_due' => '<b>'.to_currency($sum_amount_due).'</b>',
'change_due' => '<b>'.to_currency($sum_change_due).'</b>'
);
}
function get_sales_manage_sale_data_row($sale, $controller)
function get_sale_data_row($sale, $controller)
{
$CI =& get_instance();
$controller_name = $CI->uri->segment(1);
$table_data_row='<tr>';
$table_data_row.='<td width="3%"><input class="print_hide" type="checkbox" id="sale_' . $sale['sale_id'] . '" value="' . $sale['sale_id']. '" /></td>';
$table_data_row.='<td width="15%">'.'POS ' . $sale['sale_id'] . '</td>';
$table_data_row.='<td width="17%">'.date( $CI->config->item('dateformat') . ' ' . $CI->config->item('timeformat'), strtotime($sale['sale_time']) ).'</td>';
$table_data_row.='<td width="23%">'.character_limiter( $sale['customer_name'], 25).'</td>';
$table_data_row.='<td width="8%">'.to_currency( $sale['amount_tendered'] ).'</td>';
$table_data_row.='<td width="8%">'.to_currency( $sale['amount_due'] ).'</td>';
$table_data_row.='<td width="8%">'.to_currency( $sale['change_due'] ).'</td>';
if($CI->config->item('invoice_enable') == TRUE)
{
$table_data_row.='<td width="12%">'.$sale['payment_type'].'</td>';
$table_data_row.='<td width="8%">'.$sale['invoice_number'].'</td>';
}
else
{
// this size includes the 8% of invoice number and 5% of the invoice glyphicon, plus of course the 12% for the field itself
$table_data_row.='<td width="25%">'.$sale['payment_type'].'</td>';
}
$table_data_row.='<td width="5%" class="print_hide">'.anchor($controller_name."/edit/" . $sale['sale_id'], '<span class="glyphicon glyphicon-edit"></span>', array('class'=>'modal-dlg modal-btn-delete modal-btn-submit print_hide', 'title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
$table_data_row.='<td width="5%" class="print_hide">'.anchor($controller_name."/receipt/" . $sale['sale_id'], '<span class="glyphicon glyphicon-print"></span>', array('class'=>'print_hide', 'title'=>$CI->lang->line('sales_show_receipt'))).'</td>';
if($CI->config->item('invoice_enable') == TRUE)
{
$table_data_row.='<td width="5%" class="print_hide">'.anchor($controller_name."/invoice/" . $sale['sale_id'], '<span class="glyphicon glyphicon-list-alt"></span>', array('class'=>'print_hide', 'title'=>$CI->lang->line('sales_show_invoice'))).'</td>';
}
$table_data_row.='</tr>';
$row = array (
'sale_id' => $sale->sale_id,
'sale_time' => date( $CI->config->item('dateformat') . ' ' . $CI->config->item('timeformat'), strtotime($sale->sale_time) ),
'customer_name' => character_limiter( $sale->customer_name, 25),
'amount_tendered' => to_currency( $sale->amount_tendered ),
'amount_due' => to_currency($sale->amount_due),
'change_due' => to_currency($sale->change_due),
'payment_type' => $sale->payment_type,
'invoice_number' => $sale->invoice_number,
'receipt' => anchor($controller_name."/receipt/$sale->sale_id", '<span class="glyphicon glyphicon-print"></span>',
array('title'=>$CI->lang->line('sales_show_receipt'))
),
'edit' => anchor($controller_name."/edit/$sale->sale_id", '<span class="glyphicon glyphicon-edit"></span>',
array('class'=>"modal-dlg modal-btn-delete modal-btn-submit print_hide", 'title'=>$CI->lang->line($controller_name.'_update'))
)
);
return $table_data_row;
if ($CI->config->item('invoice_enable'))
{
$row['invoice'] = anchor($controller_name."/invoice/$sale->sale_id", '<span class="glyphicon glyphicon-list-alt"></span>',
array('title'=>$CI->lang->line('sales_show_invoice'))
);
}
return $row;
}
/*
@@ -121,7 +98,7 @@ function get_sales_manage_payments_summary($payments, $sales, $controller)
// therefore we remove from the total cash amount any change due
if( $payment['payment_type'] == $CI->lang->line('sales_cash') )
{
foreach($sales as $key=>$sale)
foreach($sales->result_array() as $key=>$sale)
{
$amount -= $sale['change_due'];
}
@@ -129,241 +106,145 @@ function get_sales_manage_payments_summary($payments, $sales, $controller)
$table.='<div class="summary_row">'.$payment['payment_type'].': '.to_currency( $amount ) . '</div>';
}
$table.='</div>';
return $table;
}
/*
Gets the html table to manage people.
*/
function get_people_manage_table($people,$controller)
{
$CI =& get_instance();
$table='<table class="tablesorter table table-striped table-hover" id="sortable_table">';
$headers = array('<input type="checkbox" id="select_all" />',
$CI->lang->line('common_last_name'),
$CI->lang->line('common_first_name'),
$CI->lang->line('common_email'),
$CI->lang->line('common_phone_number'),
'&nbsp');
if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id')))
{
$headers[] = '&nbsp';
}
$table.='<thead><tr>';
foreach($headers as $header)
{
$table.="<th>$header</th>";
}
$table.='</tr></thead><tbody>';
$table.=get_people_manage_table_data_rows($people,$controller);
$table.='</tbody></table>';
return $table;
}
/*
Gets the html data rows for the people.
*/
function get_people_manage_table_data_rows($people,$controller)
function transform_headers_readonly($array)
{
$CI =& get_instance();
$table_data_rows='';
foreach($people->result() as $person)
$result = array();
foreach($array as $key => $value)
{
$table_data_rows.=get_person_data_row($person,$controller);
$result[] = array('field' => $key, 'title' => $value, 'sortable' => $value != '', 'switchable' => !preg_match('(^$|&nbsp)', $value));
}
if($people->num_rows()==0)
{
$table_data_rows.="<tr><td colspan='6'><div class='alert alert-dismissible alert-info'>".$CI->lang->line('common_no_persons_to_display')."</div></td></tr>";
}
return $table_data_rows;
return json_encode($result);
}
function get_person_data_row($person,$controller)
function transform_headers($array)
{
$CI =& get_instance();
$controller_name=strtolower(get_class($CI));
$table_data_row='<tr>';
$table_data_row.="<td width='4%'><input type='checkbox' id='person_$person->person_id' value='".$person->person_id."'/></td>";
$table_data_row.='<td width="20%">'.character_limiter($person->last_name,13).'</td>';
$table_data_row.='<td width="20%">'.character_limiter($person->first_name,13).'</td>';
$table_data_row.='<td width="30%">'.mailto($person->email,character_limiter($person->email,22)).'</td>';
$table_data_row.='<td width="20%">'.character_limiter($person->phone_number,13).'</td>';
if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id')))
$result = array();
$array = array_merge(array(array('checkbox' => 'select', 'sortable' => FALSE)),
$array, array(array('edit' => '')));
foreach($array as $element)
{
$table_data_row.='<td width="3%">'.anchor("Messages/view/$person->person_id", '<span class="glyphicon glyphicon-phone"></span>', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))).'</td>';
$table_data_row.='<td width="3%">'.anchor($controller_name."/view/$person->person_id", '<span class="glyphicon glyphicon-edit"></span>', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
$result[] = array('field' => key($element),
'title' => current($element),
'switchable' => isset($element['switchable']) ?
$element['switchable'] : !preg_match('(^$|&nbsp)', current($element)),
'sortable' => isset($element['sortable']) ?
$element['sortable'] : current($element) != '',
'checkbox' => isset($element['checkbox']) ?
$element['checkbox'] : FALSE,
'class' => isset($element['checkbox']) || preg_match('(^$|&nbsp)', current($element)) ?
'print_hide' : '');
}
else
{
$table_data_row.='<td width="6%">'.anchor($controller_name."/view/$person->person_id", '<span class="glyphicon glyphicon-edit"></span>', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
}
$table_data_row.='</tr>';
return $table_data_row;
return json_encode($result);
}
function get_detailed_data_row($row, $controller)
{
$table_data_row='<tr>';
$table_data_row.='<td><a href="#" class="expand">+</a></td>';
foreach($row as $cell)
{
$table_data_row.='<td>';
$table_data_row.=$cell;
$table_data_row.='</td>';
}
$table_data_row.='</tr>';
return $table_data_row;
}
/*
Gets the html table to manage suppliers.
*/
function get_supplier_manage_table($suppliers,$controller)
function get_people_manage_table_headers()
{
$CI =& get_instance();
$table='<table class="tablesorter table table-striped table-hover" id="sortable_table">';
$headers = array('<input type="checkbox" id="select_all" />',
$CI->lang->line('suppliers_company_name'),
$CI->lang->line('suppliers_agency_name'),
$CI->lang->line('common_last_name'),
$CI->lang->line('common_first_name'),
$CI->lang->line('common_email'),
$CI->lang->line('common_phone_number'),
$CI->lang->line('suppliers_supplier_id'),
'&nbsp');
if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id')))
{
$headers[] = '&nbsp';
}
$table.='<thead><tr>';
foreach($headers as $header)
{
$table.="<th>$header</th>";
}
$table.='</tr></thead><tbody>';
$table.=get_supplier_manage_table_data_rows($suppliers,$controller);
$table.='</tbody></table>';
return $table;
}
/*
Gets the html data rows for the supplier.
*/
function get_supplier_manage_table_data_rows($suppliers,$controller)
{
$CI =& get_instance();
$table_data_rows='';
foreach($suppliers->result() as $supplier)
{
$table_data_rows.=get_supplier_data_row($supplier,$controller);
}
if($suppliers->num_rows()==0)
{
$table_data_rows.="<tr><td colspan='9'><div class='alert alert-dismissible alert-info'>".$CI->lang->line('common_no_persons_to_display')."</div></td></tr>";
}
return $table_data_rows;
}
function get_supplier_data_row($supplier,$controller)
{
$CI =& get_instance();
$controller_name=strtolower(get_class($CI));
$table_data_row='<tr>';
$table_data_row.="<td width='2%'><input type='checkbox' id='person_$supplier->person_id' value='".$supplier->person_id."'/></td>";
$table_data_row.='<td width="15%">'.character_limiter($supplier->company_name,13).'</td>';
$table_data_row.='<td width="14%">'.character_limiter($supplier->agency_name,13).'</td>';
$table_data_row.='<td width="15%">'.character_limiter($supplier->last_name,13).'</td>';
$table_data_row.='<td width="15%">'.character_limiter($supplier->first_name,13).'</td>';
$table_data_row.='<td width="20%">'.mailto($supplier->email,character_limiter($supplier->email,22)).'</td>';
$table_data_row.='<td width="10%">'.character_limiter($supplier->phone_number,13).'</td>';
$table_data_row.='<td width="3%">'.character_limiter($supplier->person_id,5).'</td>';
if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id')))
{
$table_data_row.='<td width="3%">'.anchor("Messages/view/$supplier->person_id", '<span class="glyphicon glyphicon-phone"></span>', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))).'</td>';
$table_data_row.='<td width="3%">'.anchor($controller_name."/view/$supplier->person_id", '<span class="glyphicon glyphicon-edit"></span>', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
}
else
{
$table_data_row.='<td width="6%">'.anchor($controller_name."/view/$supplier->person_id", '<span class="glyphicon glyphicon-edit"></span>', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
}
$table_data_row.='</tr>';
return $table_data_row;
}
/*
Gets the html table to manage items.
*/
function get_items_manage_table($items,$controller)
{
$CI =& get_instance();
$table='<table class="tablesorter table table-striped table-hover" id="sortable_table">';
$headers = array('<input type="checkbox" id="select_all" />',
$CI->lang->line('items_item_number'),
$CI->lang->line('items_name'),
$CI->lang->line('items_category'),
$CI->lang->line('suppliers_company_name'),
$CI->lang->line('items_cost_price'),
$CI->lang->line('items_unit_price'),
$CI->lang->line('items_quantity'),
$CI->lang->line('items_tax_percents'),
$CI->lang->line('items_image'),
'&nbsp;',
'&nbsp;',
'&nbsp;'
$headers = array(
array('people.person_id' => $CI->lang->line('common_id')),
array('last_name' => $CI->lang->line('common_last_name')),
array('first_name' => $CI->lang->line('common_first_name')),
array('email' => $CI->lang->line('common_email')),
array('phone_number' => $CI->lang->line('common_phone_number'))
);
$table.='<thead><tr>';
foreach($headers as $header)
{
$table.="<th>$header</th>";
}
$table.='</tr></thead><tbody>';
$table.=get_items_manage_table_data_rows($items,$controller);
$table.='</tbody></table>';
return $table;
if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id')))
{
$headers[] = array('messages' => '', 'sortable' => FALSE);
}
return transform_headers($headers);
}
/*
Gets the html data rows for the items.
*/
function get_items_manage_table_data_rows($items,$controller)
function get_person_data_row($person, $controller)
{
$CI =& get_instance();
$table_data_rows='';
foreach($items->result() as $item)
{
$table_data_rows.=get_item_data_row($item,$controller);
}
if($items->num_rows()==0)
{
$table_data_rows.="<tr><td colspan='13'><div class='alert alert-dismissible alert-info'>".$CI->lang->line('items_no_items_to_display')."</div></td></tr>";
}
return $table_data_rows;
$controller_name=strtolower(get_class($CI));
return array (
'people.person_id' => $person->person_id,
'last_name' => character_limiter($person->last_name,13),
'first_name' => character_limiter($person->first_name,13),
'email' => empty($person->email) ? '' : mailto($person->email,character_limiter($person->email,22)),
'phone_number' => character_limiter($person->phone_number,13),
'messages' => empty($person->phone_number) ? '' : anchor("Messages/view/$person->person_id", '<span class="glyphicon glyphicon-phone"></span>',
array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))),
'edit' => anchor($controller_name."/view/$person->person_id", '<span class="glyphicon glyphicon-edit"></span>',
array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))
));
}
function get_item_data_row($item,$controller)
function get_suppliers_manage_table_headers()
{
$CI =& get_instance();
$headers = array(
array('people.person_id' => $CI->lang->line('common_id')),
array('company_name' => $CI->lang->line('suppliers_company_name')),
array('agency_name' => $CI->lang->line('suppliers_agency_name')),
array('last_name' => $CI->lang->line('common_last_name')),
array('first_name' => $CI->lang->line('common_first_name')),
array('email' => $CI->lang->line('common_email')),
array('phone_number' => $CI->lang->line('common_phone_number'))
);
if($CI->Employee->has_grant('messages', $CI->session->userdata('person_id')))
{
$headers[] = array('messages' => '');
}
return transform_headers($headers);
}
function get_supplier_data_row($supplier, $controller)
{
$CI =& get_instance();
$controller_name=strtolower(get_class($CI));
return array (
'people.person_id' => $supplier->person_id,
'company_name' => character_limiter($supplier->company_name,13),
'agency_name' => character_limiter($supplier->agency_name,13),
'last_name' => character_limiter($supplier->last_name,13),
'first_name' => character_limiter($supplier->first_name,13),
'email' => empty($supplier->email) ? '' : mailto($supplier->email,character_limiter($supplier->email,22)),
'phone_number' => character_limiter($supplier->phone_number,13),
'messages' => empty($supplier->phone_number) ? '' : anchor("Messages/view/$supplier->person_id", '<span class="glyphicon glyphicon-phone"></span>',
array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))),
'edit' => anchor($controller_name."/view/$supplier->person_id", '<span class="glyphicon glyphicon-edit"></span>',
array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))
));
}
function get_items_manage_table_headers()
{
$CI =& get_instance();
$headers = array(
array('items.item_id' => $CI->lang->line('common_id')),
array('item_number' => $CI->lang->line('items_item_number')),
array('name' => $CI->lang->line('items_name')),
array('category' => $CI->lang->line('items_category')),
array('company_name' => $CI->lang->line('suppliers_company_name')),
array('cost_price' => $CI->lang->line('items_cost_price')),
array('unit_price' => $CI->lang->line('items_unit_price')),
array('quantity' => $CI->lang->line('items_quantity')),
array('tax_percents' => $CI->lang->line('items_tax_percents'), 'sortable' => FALSE),
array('item_pic' => $CI->lang->line('items_image'), 'sortable' => FALSE),
array('inventory' => ''),
array('stock' => '')
);
return transform_headers($headers);
}
function get_item_data_row($item, $controller)
{
$CI =& get_instance();
$item_tax_info=$CI->Item_taxes->get_info($item->item_id);
@@ -376,148 +257,82 @@ function get_item_data_row($item,$controller)
$tax_percents=substr($tax_percents, 0, -2);
$controller_name=strtolower(get_class($CI));
$item_quantity='';
$table_data_row='<tr>';
$table_data_row.="<td width='2%'><input type='checkbox' id='item_$item->item_id' value='".$item->item_id."'/></td>";
$table_data_row.='<td width="10%">'.$item->item_number.'</td>';
$table_data_row.='<td width="15%">'.$item->name.'</td>';
$table_data_row.='<td width="10%">'.$item->category.'</td>';
$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%">'.to_quantity_decimals($item->quantity).'</td>';
$table_data_row.='<td width="8%">'.$tax_percents.'</td>';
$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>';
$image .= '<a class="rollover" href="'. base_url($images[0]) .'"><img src="'.site_url('items/pic_thumb/'.$item->pic_id).'"></a>';
}
}
$table_data_row.='<td align="center" width="8%">' . $image . '</td>';
$table_data_row.='<td width="3%">'.anchor($controller_name."/view/$item->item_id", '<span class="glyphicon glyphicon-edit"></span>', array('class'=>"modal-dlg modal-btn-new modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
$table_data_row.='<td width="3%">'.anchor($controller_name."/inventory/$item->item_id", '<span class="glyphicon glyphicon-pushpin"></span>', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_count'))).'</td>';//inventory count
$table_data_row.='<td width="3%">'.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'))).'</td>';//inventory details
$table_data_row.='</tr>';
return $table_data_row;
return array (
'items.item_id' => $item->item_id,
'item_number' => $item->item_number,
'name' => character_limiter($item->name,13),
'category' => character_limiter($item->category,13),
'company_name' => character_limiter($item->company_name,20),
'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 modal-btn-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 modal-btn-submit", 'title' => $CI->lang->line($controller_name.'_update'))
));
}
/*
Gets the html table to manage giftcards.
*/
function get_giftcards_manage_table( $giftcards, $controller )
function get_giftcards_manage_table_headers()
{
$CI =& get_instance();
$table='<table class="tablesorter table table-striped table-hover" id="sortable_table">';
$headers = array('<input type="checkbox" id="select_all" />',
$CI->lang->line('common_last_name'),
$CI->lang->line('common_first_name'),
$CI->lang->line('giftcards_giftcard_number'),
$CI->lang->line('giftcards_card_value'),
'&nbsp');
$table.='<thead><tr>';
foreach($headers as $header)
{
$table.="<th>$header</th>";
}
$table.='</tr></thead><tbody>';
$table.=get_giftcards_manage_table_data_rows( $giftcards, $controller );
$table.='</tbody></table>';
return $table;
$headers = array(
array('giftcard_id' => $CI->lang->line('common_id')),
array('last_name' => $CI->lang->line('common_last_name')),
array('first_name' => $CI->lang->line('common_first_name')),
array('giftcard_number' => $CI->lang->line('giftcards_giftcard_number')),
array('value' => $CI->lang->line('giftcards_card_value'))
);
return transform_headers($headers);
}
/*
Gets the html data rows for the giftcard.
*/
function get_giftcards_manage_table_data_rows( $giftcards, $controller )
{
$CI =& get_instance();
$table_data_rows='';
foreach($giftcards->result() as $giftcard)
{
$table_data_rows.=get_giftcard_data_row( $giftcard, $controller );
}
if($giftcards->num_rows()==0)
{
$table_data_rows.="<tr><td colspan='6'><div class='alert alert-dismissible alert-info'>".$CI->lang->line('giftcards_no_giftcards_to_display')."</div></td></tr>";
}
return $table_data_rows;
}
function get_giftcard_data_row($giftcard,$controller)
function get_giftcard_data_row($giftcard, $controller)
{
$CI =& get_instance();
$controller_name=strtolower(get_class($CI));
$table_data_row='<tr>';
$table_data_row.="<td width='3%'><input type='checkbox' id='giftcard_$giftcard->giftcard_id' value='".$giftcard->giftcard_id."'/></td>";
$table_data_row.='<td width="15%">'.$giftcard->last_name.'</td>';
$table_data_row.='<td width="15%">'.$giftcard->first_name.'</td>';
$table_data_row.='<td width="15%">'.$giftcard->giftcard_number.'</td>';
$table_data_row.='<td width="20%">'.to_currency($giftcard->value).'</td>';
$table_data_row.='<td width="5%">'.anchor($controller_name."/view/$giftcard->giftcard_id", '<span class="glyphicon glyphicon-edit"></span>', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
$table_data_row.='</tr>';
return $table_data_row;
return array (
'giftcard_id' => $giftcard->giftcard_id,
'last_name' => character_limiter($giftcard->last_name,13),
'first_name' => character_limiter($giftcard->first_name,13),
'giftcard_number' => $giftcard->giftcard_number,
'value' => to_currency($giftcard->value),
'edit' => anchor($controller_name."/view/$giftcard->giftcard_id", '<span class="glyphicon glyphicon-edit"></span>',
array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))
));
}
/*
Gets the html table to manage item kits.
*/
function get_item_kits_manage_table( $item_kits, $controller )
function get_item_kits_manage_table_headers()
{
$CI =& get_instance();
$table='<table class="tablesorter table table-striped table-hover" id="sortable_table">';
$headers = array('<input type="checkbox" id="select_all" />',
$CI->lang->line('item_kits_kit'),
$CI->lang->line('item_kits_name'),
$CI->lang->line('item_kits_description'),
$CI->lang->line('items_cost_price'),
$CI->lang->line('items_unit_price'),
'&nbsp');
$table.='<thead><tr>';
foreach($headers as $header)
{
$table.="<th>$header</th>";
}
$table.='</tr></thead><tbody>';
$table.=get_item_kits_manage_table_data_rows( $item_kits, $controller );
$table.='</tbody></table>';
return $table;
}
$headers = array(
array('item_kit_id' => $CI->lang->line('item_kits_kit')),
array('name' => $CI->lang->line('item_kits_name')),
array('description' => $CI->lang->line('item_kits_description')),
array('cost_price' => $CI->lang->line('items_cost_price'), 'sortable' => FALSE),
array('unit_price' => $CI->lang->line('items_unit_price'), 'sortable' => FALSE)
);
/*
Gets the html data rows for the item kits.
*/
function get_item_kits_manage_table_data_rows($item_kits, $controller)
{
$CI =& get_instance();
$table_data_rows='';
foreach($item_kits->result() as $item_kit)
{
$table_data_rows .= get_item_kit_data_row($item_kit, $controller);
}
if($item_kits->num_rows()==0)
{
$table_data_rows .= "<tr><td colspan='7'><div class='alert alert-dismissible alert-info'>".$CI->lang->line('item_kits_no_item_kits_to_display')."</div></td></tr>";
}
return $table_data_rows;
return transform_headers($headers);
}
function get_item_kit_data_row($item_kit, $controller)
@@ -525,17 +340,15 @@ function get_item_kit_data_row($item_kit, $controller)
$CI =& get_instance();
$controller_name=strtolower(get_class($CI));
$table_data_row='<tr>';
$table_data_row.="<td width='3%'><input type='checkbox' id='item_kit_$item_kit->item_kit_id' value='".$item_kit->item_kit_id."'/></td>";
$table_data_row.='<td width="15%">'.'KIT '.$item_kit->item_kit_id.'</td>';
$table_data_row.='<td width="15%">'.$item_kit->name.'</td>';
$table_data_row.='<td width="20%">'.character_limiter($item_kit->description, 25).'</td>';
$table_data_row.='<td width="15%">'.to_currency($item_kit->total_cost_price).'</td>';
$table_data_row.='<td width="15%">'.to_currency($item_kit->total_unit_price).'</td>';
$table_data_row.='<td width="5%">'.anchor($controller_name."/view/$item_kit->item_kit_id", '<span class="glyphicon glyphicon-edit"></span>', array('class'=>"modal-dlg modal-btn-submit",'title'=>$CI->lang->line($controller_name.'_update'))).'</td>';
$table_data_row.='</tr>';
return $table_data_row;
return array (
'item_kit_id' => $item_kit->item_kit_id,
'name' => character_limiter($item_kit->name),
'description' => character_limiter($item_kit->description,13),
'cost_price' => to_currency($item_kit->total_cost_price),
'unit_price' => to_currency($item_kit->total_unit_price),
'edit' => anchor($controller_name."/view/$item_kit->item_kit_id", '<span class="glyphicon glyphicon-edit"></span>',
array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line($controller_name.'_update'))
));
}
?>

View File

@@ -3,43 +3,44 @@
function load_config()
{
$CI =& get_instance();
foreach( $CI->Appconfig->get_all()->result() as $app_config )
{
$CI->config->set_item( $app_config->key, $app_config->value );
foreach($CI->Appconfig->get_all()->result() as $app_config)
{
$CI->config->set_item($CI->security->xss_clean($app_config->key), $CI->security->xss_clean($app_config->value));
}
//Set language from config database
$language = $CI->config->item('language');
//Loads all the language files from the language directory
if ( $CI->config->item( 'language' ) )
if(!empty($language))
{
$CI->config->set_item( 'language', $CI->config->item( 'language' ) );
// fallback to english if language folder does not exist
$language = $CI->config->item( 'language' );
if (!file_exists('./application/language/' . $language))
// fallback to English if language folder does not exist
if(!file_exists('./application/language/' . $language))
{
$language = 'en';
}
$CI->config->set_item('language', $language);
$map = directory_map('./application/language/' . $language);
foreach($map as $file)
{
if ( !is_array($file) && substr(strrchr($file,'.'), 1) == "php")
if(!is_array($file) && substr(strrchr($file,'.'), 1) == "php")
{
$CI->lang->load( str_replace( '_lang.php', '', $file ), $language);
$CI->lang->load(str_replace('_lang.php', '', $file), $language);
}
}
}
//Set timezone from config database
if ( $CI->config->item( 'timezone' ) )
if($CI->config->item('timezone'))
{
date_default_timezone_set( $CI->config->item( 'timezone' ) );
date_default_timezone_set($CI->config->item('timezone'));
}
else
{
date_default_timezone_set( 'America/New_York' );
date_default_timezone_set('America/New_York');
}
}
?>

View File

@@ -0,0 +1,10 @@
<?php
$lang["tables_loading"] = "Lade, bitte warten...";
$lang["tables_rows_per_page"] = "{0} Einträge pro Seite";
$lang["tables_page_from_to"] = "Zeige {0} bis {1} von {2} Zeile(n)";
$lang["tables_hide_show_pagination"] = "Hide/Show pagination";
$lang["tables_refresh"] = "Refresh";
$lang["tables_toggle"] = "Umschalten";
$lang["tables_columns"] = "Spalten";
$lang["tables_all"] = "All";

View File

@@ -60,3 +60,4 @@ $lang["common_export_excel"] = "Excel Export";
$lang["common_export_excel_yes"] = "Yes";
$lang["common_export_excel_no"] = "No";
$lang["common_required"] = "Erforderlich";
$lang["common_id"] = "Id";

View File

@@ -148,3 +148,6 @@ $lang["config_timezone"] = "Zeitzone";
$lang["config_use_invoice_template"] = "Verwende Rechnungsvorlage";
$lang["config_website"] = "Website";
$lang["config_datetimeformat"] = "Datum und Zeit";
$lang["config_country_codes"] = "Country Codes";
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
$lang["config_notify_alignment"] = "Notification Popup Position";

View File

@@ -18,3 +18,7 @@ $lang["customers_taxable"] = "Steuerpflichtig";
$lang["customers_total"] = "Total";
$lang["customers_update"] = "Kunde ändern";
$lang["customers_import_items_excel"] = "Importiere Kunden via Excel";
$lang["customers_excel_import_failed"] = "Excel Import fehlerhaft";
$lang["customers_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["customers_excel_import_success"] = "Import of Customers successful";
$lang["customers_excel_import_partially_failed"] = "Most Customers imported. But some were not, here is the list";

View File

@@ -30,6 +30,9 @@ $lang["items_edit_multiple_items"] = "Sammeländerung";
$lang["items_error_adding_updating"] = "Fehler beim Hinzufügen/Ändern";
$lang["items_error_updating_multiple"] = "Fehler beim Ändern";
$lang["items_excel_import_failed"] = "Excel Import fehlerhaft";
$lang["items_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["items_excel_import_success"] = "Import of Items successful";
$lang["items_excel_import_partially_failed"] = "Most Items imported. But some were not, here is the list";
$lang["items_generate_barcodes"] = "Generiere Barcodes";
$lang["items_image"] = "Bild";
$lang["items_info_provided_by"] = "Info provided by";
@@ -44,7 +47,6 @@ $lang["items_location"] = "Ort";
$lang["items_empty_upc_items"] = "Leere UPC Artikel";
$lang["items_low_inventory_items"] = "nicht am Lager";
$lang["items_manually_editing_of_quantity"] = "Manuelle Bestandesänderung";
$lang["items_must_select_item_for_barcode"] = "Sie müssen mindestens einen Artikel wählen, um Barcodes zu generieren";
$lang["items_name"] = "Artikelname";
$lang["items_name_required"] = "Artikelname ist erforderlich";
$lang["items_new"] = "Neuer Artikel";

View File

@@ -11,7 +11,7 @@ $lang["recvs_cost"] = "Kosten";
$lang["recvs_date"] = "Eingangsdatum";
$lang["recvs_date_required"] = "Ein korrektes Datum ist erforderlich";
$lang["recvs_date_type"] = "Datum ist erforderlich";
$lang["recvs_delete_confirmation"] = "Wollen Sie diesen Eingang wirklich löschen? Rückgängig nicht möglich";
$lang["receivings_confirm_delete"] = "Wollen Sie diesen Eingang wirklich löschen? Rückgängig nicht möglich";
$lang["recvs_delete_entire_sale"] = "Wareneingang löschen";
$lang["recvs_discount"] = "Rabatt %";
$lang["recvs_edit"] = "Ändern";
@@ -48,4 +48,4 @@ $lang["recvs_supplier"] = "Lieferant";
$lang["recvs_total"] = "Total";
$lang["recvs_unable_to_add_item"] = "Kann Artikel nicht zum Eingang hinzufügen";
$lang["recvs_unsuccessfully_updated"] = "Eingang nicht erfolgreich geändert";
$lang["recvs_update"] = "Ändern";
$lang["receivings_update"] = "Ändern";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Zwischentotal";
$lang["reports_total_inventory_value"] = "Total Inventarwert";
$lang["reports_zero_and_less"] = "Null und weniger";
$lang["reports_more_than_zero"] = "Mehr als Null";
$lang["reports_no_reports_to_display"] = "Keine Artikel zum Anzeigen";

View File

@@ -0,0 +1,10 @@
<?php
$lang["tables_loading"] = "Loading, please wait...";
$lang["tables_rows_per_page"] = "{0} rows per page";
$lang["tables_page_from_to"] = "Showing {0} to {1} of {2} rows";
$lang["tables_hide_show_pagination"] = "Hide/Show pagination";
$lang["tables_refresh"] = "Refresh";
$lang["tables_toggle"] = "Toggle";
$lang["tables_columns"] = "Columns";
$lang["tables_all"] = "All";

View File

@@ -60,3 +60,4 @@ $lang["common_export_excel"] = "Excel Export";
$lang["common_export_excel_yes"] = "Yes";
$lang["common_export_excel_no"] = "No";
$lang["common_required"] = "Required";
$lang["common_id"] = "Id";

View File

@@ -148,3 +148,6 @@ $lang["config_timezone"] = "Timezone";
$lang["config_use_invoice_template"] = "Use Invoice Template";
$lang["config_website"] = "Website";
$lang["config_datetimeformat"] = "Date and Time format";
$lang["config_country_codes"] = "Country Codes";
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
$lang["config_notify_alignment"] = "Notification Popup Position";

View File

@@ -18,3 +18,7 @@ $lang["customers_taxable"] = "Taxable";
$lang["customers_total"] = "Total";
$lang["customers_update"] = "Update Customer";
$lang["customers_import_items_excel"] = "Import customers from Excel sheet";
$lang["customers_excel_import_failed"] = "Excel import failed";
$lang["customers_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["customers_excel_import_success"] = "Import of Customers successful";
$lang["customers_excel_import_partially_failed"] = "Most Customers imported. But some were not, here is the list";

View File

@@ -30,6 +30,9 @@ $lang["items_edit_multiple_items"] = "Editing Multiple Items";
$lang["items_error_adding_updating"] = "Error adding/updating item";
$lang["items_error_updating_multiple"] = "Error updating items";
$lang["items_excel_import_failed"] = "Excel import failed";
$lang["items_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["items_excel_import_success"] = "Import of Items successful";
$lang["items_excel_import_partially_failed"] = "Most Items imported. But some were not, here is the list";
$lang["items_generate_barcodes"] = "Generate Barcodes";
$lang["items_image"] = "Avatar";
$lang["items_info_provided_by"] = "Info provided by";
@@ -44,7 +47,6 @@ $lang["items_location"] = "Location";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "Out Of Stock Items";
$lang["items_manually_editing_of_quantity"] = "Manual Edit of Quantity";
$lang["items_must_select_item_for_barcode"] = "You must select at least 1 item to generate barcodes";
$lang["items_name"] = "Item Name";
$lang["items_name_required"] = "Item Name is a required field";
$lang["items_new"] = "New Item";

View File

@@ -11,7 +11,7 @@ $lang["recvs_cost"] = "Cost";
$lang["recvs_date"] = "Receiving Date";
$lang["recvs_date_required"] = "A correct date needs to be filled in";
$lang["recvs_date_type"] = "Date field is required";
$lang["recvs_delete_confirmation"] = "Are you sure you want to delete this receiving, this action cannot be undone";
$lang["receivings_confirm_delete"] = "Are you sure you want to delete this receiving, this action cannot be undone";
$lang["recvs_delete_entire_sale"] = "Delete entire sale";
$lang["recvs_discount"] = "Disc %";
$lang["recvs_edit"] = "Edit";
@@ -48,4 +48,4 @@ $lang["recvs_supplier"] = "Supplier";
$lang["recvs_total"] = "Total";
$lang["recvs_unable_to_add_item"] = "Unable to add item to receiving";
$lang["recvs_unsuccessfully_updated"] = "Receiving unsuccessfully updated";
$lang["recvs_update"] = "Update";
$lang["receivings_update"] = "Update";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Sub Total";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";
$lang["reports_no_reports_to_display"] = "No Items to display";

View File

@@ -0,0 +1,10 @@
<?php
$lang["tables_loading"] = "Por favor espere...";
$lang["tables_rows_per_page"] = "{0} resultados por página";
$lang["tables_page_from_to"] = "Mostrando desde {0} hasta {1} - En total {2} resultados";
$lang["tables_hide_show_pagination"] = "Ocultar/Mostrar paginación";
$lang["tables_refresh"] = "Refrescar";
$lang["tables_toggle"] = "Ocultar/Mostrar";
$lang["tables_columns"] = "Columnas";
$lang["tables_all"] = "Todos";

View File

@@ -60,3 +60,4 @@ $lang["common_export_excel"] = "Excel Export";
$lang["common_export_excel_yes"] = "Yes";
$lang["common_export_excel_no"] = "No";
$lang["common_required"] = "Requerido";
$lang["common_id"] = "Id";

View File

@@ -148,3 +148,6 @@ $lang["config_timezone"] = "Zona Horaria";
$lang["config_use_invoice_template"] = "Use plantilla de factura";
$lang["config_website"] = "Sitio Web";
$lang["config_datetimeformat"] = "Date and Time format";
$lang["config_country_codes"] = "Country Codes";
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
$lang["config_notify_alignment"] = "Notification Popup Position";

View File

@@ -18,3 +18,7 @@ $lang["customers_taxable"] = "Gravable";
$lang["customers_total"] = "Total";
$lang["customers_update"] = "Actualizar Cliente";
$lang["customers_import_items_excel"] = "Importar Clientes desde Excel";
$lang["customers_excel_import_failed"] = "Falló la importación de Hoja de Cálculo";
$lang["customers_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["customers_excel_import_success"] = "Import of Customers successful";
$lang["customers_excel_import_partially_failed"] = "Most Customers imported. But some were not, here is the list";

View File

@@ -30,6 +30,9 @@ $lang["items_edit_multiple_items"] = "Editando Artículos Múltiples";
$lang["items_error_adding_updating"] = "Error agregando/actualizando artículo";
$lang["items_error_updating_multiple"] = "Error actualizando artículos";
$lang["items_excel_import_failed"] = "Falló la importación de Hoja de Cálculo";
$lang["items_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["items_excel_import_success"] = "Import of Items successful";
$lang["items_excel_import_partially_failed"] = "Most Items imported. But some were not, here is the list";
$lang["items_generate_barcodes"] = "Generar Códigos de Barras";
$lang["items_image"] = "Avatar";
$lang["items_info_provided_by"] = "Info provista por";
@@ -44,7 +47,6 @@ $lang["items_location"] = "Ubicación";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "Artículos de Inventario Escaso";
$lang["items_manually_editing_of_quantity"] = "Edición Manual de Cantidad";
$lang["items_must_select_item_for_barcode"] = "Debes seleccionar al menos 1 artículo para generar códigos de barras";
$lang["items_name"] = "Nombre del Artículo";
$lang["items_name_required"] = "Nombre de Artículo es requerido";
$lang["items_new"] = "Nuevo Artículo";

View File

@@ -11,7 +11,7 @@ $lang["recvs_cost"] = "Costo";
$lang["recvs_date"] = "Fecha de Recepción";
$lang["recvs_date_required"] = "Una fecha correcta debe ser ingresada";
$lang["recvs_date_type"] = "Campo Fecha es requerido";
$lang["recvs_delete_confirmation"] = "¿Seguro(a) que desea borrar este ingreso? Esta acción no se puede deshacer";
$lang["receivings_confirm_delete"] = "¿Seguro(a) que desea borrar este ingreso? Esta acción no se puede deshacer";
$lang["recvs_delete_entire_sale"] = "Borrar venta completa";
$lang["recvs_discount"] = "Descuento %";
$lang["recvs_edit"] = "Editar";
@@ -48,4 +48,4 @@ $lang["recvs_supplier"] = "Proveedor";
$lang["recvs_total"] = "Total";
$lang["recvs_unable_to_add_item"] = "No se puede agregar el artículo a la entrada";
$lang["recvs_unsuccessfully_updated"] = "Recepción actualizada sin exito";
$lang["recvs_update"] = "Editar";
$lang["receivings_update"] = "Editar";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Subtotal";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";
$lang["reports_no_reports_to_display"] = "No hay artículos que mostrar";

View File

@@ -0,0 +1,10 @@
<?php
$lang["tables_loading"] = "Chargement en cours, patientez, s?il vous pla?t ...";
$lang["tables_rows_per_page"] = "{0} lignes par page";
$lang["tables_page_from_to"] = "Affichage des lignes {0} à {1} sur {2} lignes au total";
$lang["tables_hide_show_pagination"] = "Hide/Show pagination";
$lang["tables_refresh"] = "Rafra?chir";
$lang["tables_toggle"] = "Alterner";
$lang["tables_columns"] = "Colonnes";
$lang["tables_all"] = "Tous";

View File

@@ -60,3 +60,4 @@ $lang["common_export_excel"] = "Excel Export";
$lang["common_export_excel_yes"] = "Yes";
$lang["common_export_excel_no"] = "No";
$lang["common_required"] = "Required";
$lang["common_id"] = "Id";

View File

@@ -148,3 +148,6 @@ $lang["config_timezone"] = "Fuseau Horaire";
$lang["config_use_invoice_template"] = "Use Invoice Template";
$lang["config_website"] = "Site-web";
$lang["config_datetimeformat"] = "Date and Time format";
$lang["config_country_codes"] = "Country Codes";
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
$lang["config_notify_alignment"] = "Notification Popup Position";

View File

@@ -18,3 +18,7 @@ $lang["customers_taxable"] = "Imposable";
$lang["customers_total"] = "Total";
$lang["customers_update"] = "Éditer Client";
$lang["customers_import_items_excel"] = "Import customers from Excel sheet";
$lang["customers_excel_import_failed"] = "Echec Import d'Excel";
$lang["customers_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["customers_excel_import_success"] = "Import of Customers successful";
$lang["customers_excel_import_partially_failed"] = "Most Customers imported. But some were not, here is the list";

View File

@@ -30,6 +30,9 @@ $lang["items_edit_multiple_items"] = "Édition Multiple d'Items";
$lang["items_error_adding_updating"] = "Erreur d'ajout/éditionn";
$lang["items_error_updating_multiple"] = "Erreur d'édition";
$lang["items_excel_import_failed"] = "Echec Import d'Excel";
$lang["items_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["items_excel_import_success"] = "Import of Items successful";
$lang["items_excel_import_partially_failed"] = "Most Items imported. But some were not, here is the list";
$lang["items_generate_barcodes"] = "Générer des Coddes-barre";
$lang["items_image"] = "Avatar";
$lang["items_info_provided_by"] = "Infos fournies by";
@@ -44,7 +47,6 @@ $lang["items_location"] = "Location";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "Items à Stock Faible";
$lang["items_manually_editing_of_quantity"] = "Édition Manuelle de Quantité";
$lang["items_must_select_item_for_barcode"] = "Vous devez sélectionner au moins un item";
$lang["items_name"] = "Nom";
$lang["items_name_required"] = "Le Nom est requis";
$lang["items_new"] = "Nouvel Item";

View File

@@ -11,7 +11,7 @@ $lang["recvs_cost"] = "Cout";
$lang["recvs_date"] = "";
$lang["recvs_date_required"] = "";
$lang["recvs_date_type"] = "";
$lang["recvs_delete_confirmation"] = "";
$lang["receivings_confirm_delete"] = "";
$lang["recvs_delete_entire_sale"] = "Delete entire sale";
$lang["recvs_discount"] = "Remise %";
$lang["recvs_edit"] = "Éditer";
@@ -48,4 +48,4 @@ $lang["recvs_supplier"] = "Fournisseur";
$lang["recvs_total"] = "Total";
$lang["recvs_unable_to_add_item"] = "Impossible d'ajouter l'item aux arrivages";
$lang["recvs_unsuccessfully_updated"] = "Receiving unsuccessfully updated";
$lang["recvs_update"] = "Éditer";
$lang["receivings_update"] = "Éditer";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Sous-Total";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Zero and less";
$lang["reports_more_than_zero"] = "More than zero";
$lang["reports_no_reports_to_display"] = "Aucun Items à afficher";

View File

@@ -0,0 +1,10 @@
<?php
$lang["tables_loading"] = "Molimo pričekajte ...";
$lang["tables_rows_per_page"] = "{0} broj zapisa po stranici";
$lang["tables_page_from_to"] = "Prikazujem {0}. - {1} od ukupnog broja zapisa {2}";
$lang["tables_hide_show_pagination"] = "Prikaži/sakrij stranice";
$lang["tables_refresh"] = "Osvježi";
$lang["tables_toggle"] = "Promijeni prikaz";
$lang["tables_columns"] = "Kolone";
$lang["tables_all"] = "Sve";

View File

@@ -60,3 +60,4 @@ $lang["common_export_excel"] = "Excel izvoz";
$lang["common_export_excel_yes"] = "Da";
$lang["common_export_excel_no"] = "Ne";
$lang["common_required"] = "Potreban";
$lang["common_id"] = "Id";

View File

@@ -148,3 +148,6 @@ $lang["config_timezone"] = "Vremenska zona";
$lang["config_use_invoice_template"] = "Koristi predložak za fakture";
$lang["config_website"] = "web strana";
$lang["config_datetimeformat"] = "Oblik datuma i vremena";
$lang["config_country_codes"] = "Country Codes";
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
$lang["config_notify_alignment"] = "Notification Popup Position";

View File

@@ -18,3 +18,7 @@ $lang["customers_taxable"] = "Oporezivo";
$lang["customers_total"] = "Total";
$lang["customers_update"] = "Ažuriraj kupca";
$lang["customers_import_items_excel"] = "Učitaj kupce iz excel datoteke";
$lang["customers_excel_import_failed"] = "Greška kod uvoza iz Excel-a";
$lang["customers_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["customers_excel_import_success"] = "Import of Customers successful";
$lang["customers_excel_import_partially_failed"] = "Most Customers imported. But some were not, here is the list";

View File

@@ -30,6 +30,9 @@ $lang["items_edit_multiple_items"] = "Uredi višestruke stavke";
$lang["items_error_adding_updating"] = "Greška kod dodavanja/ažuriranja stavke";
$lang["items_error_updating_multiple"] = "Greška kod ažuriranja stavki";
$lang["items_excel_import_failed"] = "Greška kod uvoza iz Excel-a";
$lang["items_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["items_excel_import_success"] = "Import of Items successful";
$lang["items_excel_import_partially_failed"] = "Most Items imported. But some were not, here is the list";
$lang["items_generate_barcodes"] = "Generiraj barkod";
$lang["items_image"] = "Slika";
$lang["items_info_provided_by"] = "Info daje";
@@ -44,7 +47,6 @@ $lang["items_location"] = "Mjesto";
$lang["items_empty_upc_items"] = "UPC artikal";
$lang["items_low_inventory_items"] = "Rasprodaja artikala";
$lang["items_manually_editing_of_quantity"] = "Ručno uređivanje količine";
$lang["items_must_select_item_for_barcode"] = "Morate odabrati barem jedan artikl da generirate barkod";
$lang["items_name"] = "Naziv artikla";
$lang["items_name_required"] = "Naziv artikla je potreban";
$lang["items_new"] = "Novi artikal";

View File

@@ -11,7 +11,7 @@ $lang["recvs_cost"] = "Cijena";
$lang["recvs_date"] = "Datum";
$lang["recvs_date_required"] = "Potrebno je unijeti ispravan datum";
$lang["recvs_date_type"] = "Datum je potreban";
$lang["recvs_delete_confirmation"] = "Želite li obrisati ovu primku? To ne ne može vratiti.";
$lang["receivings_confirm_delete"] = "Želite li obrisati ovu primku? To ne ne može vratiti.";
$lang["recvs_delete_entire_sale"] = "Obrisati cijelu prodaju";
$lang["recvs_discount"] = "Rabat %";
$lang["recvs_edit"] = "Urediti";
@@ -48,4 +48,4 @@ $lang["recvs_supplier"] = "Dobavljač";
$lang["recvs_total"] = "Ukupno";
$lang["recvs_unable_to_add_item"] = "Ne mogu dodati artikal u primku";
$lang["recvs_unsuccessfully_updated"] = "Neuspješno ažurirana primka";
$lang["recvs_update"] = "Ažuriraj";
$lang["receivings_update"] = "Ažuriraj";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Iznos međuzbroja";
$lang["reports_total_inventory_value"] = "Ukupan iznos inventure";
$lang["reports_zero_and_less"] = "Nula i manje";
$lang["reports_more_than_zero"] = "Više od nule";
$lang["reports_no_reports_to_display"] = "Nema artikla za prikazati";

View File

@@ -0,0 +1,10 @@
<?php
$lang["tables_loading"] = "Betöltés, kérem várjon...";
$lang["tables_rows_per_page"] = "{0} rekord per oldal";
$lang["tables_page_from_to"] = "Megjelenítve {0} {1} / {2} összesen";
$lang["tables_hide_show_pagination"] = "Lapozó elrejtése/megjelenítése";
$lang["tables_refresh"] = "Refresh";
$lang["tables_toggle"] = "Toggle";
$lang["tables_columns"] = "Columns";
$lang["tables_all"] = "All";

View File

@@ -60,3 +60,4 @@ $lang["common_export_excel"] = "Excel Export";
$lang["common_export_excel_yes"] = "Igen";
$lang["common_export_excel_no"] = "Nem";
$lang["common_required"] = "Kötelező";
$lang["common_id"] = "ID";

View File

@@ -148,3 +148,6 @@ $lang["config_timezone"] = "Időzóna";
$lang["config_use_invoice_template"] = "Számla sablon használata";
$lang["config_website"] = "Weboldal";
$lang["config_datetimeformat"] = "Dátum és idő formátum";
$lang["config_country_codes"] = "Country Codes";
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
$lang["config_notify_alignment"] = "Notification Popup Position";

View File

@@ -18,3 +18,7 @@ $lang["customers_taxable"] = "Adóköteles";
$lang["customers_total"] = "Total";
$lang["customers_update"] = "Vevő módosítása";
$lang["customers_import_items_excel"] = "Vevők importálása Excelből";
$lang["customers_excel_import_failed"] = "Excel import sikertelen";
$lang["customers_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["customers_excel_import_success"] = "Import of Customers successful";
$lang["customers_excel_import_partially_failed"] = "Most Customers imported. But some were not, here is the list";

View File

@@ -30,6 +30,9 @@ $lang["items_edit_multiple_items"] = "Editing Multiple Items";
$lang["items_error_adding_updating"] = "Termék módositása/hozzáadása sikertelen.";
$lang["items_error_updating_multiple"] = "Termék módositás sikertelen";
$lang["items_excel_import_failed"] = "Excel import sikertelen";
$lang["items_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["items_excel_import_success"] = "Import of Items successful";
$lang["items_excel_import_partially_failed"] = "Most Items imported. But some were not, here is the list";
$lang["items_generate_barcodes"] = "Vonalkód generálás";
$lang["items_image"] = "Avatar";
$lang["items_info_provided_by"] = "Info provided by";
@@ -44,7 +47,6 @@ $lang["items_location"] = "Helyszín";
$lang["items_empty_upc_items"] = "Üres UPC term.";
$lang["items_low_inventory_items"] = "Kifogyott term.";
$lang["items_manually_editing_of_quantity"] = "Mennyiség módosítása manuálisan";
$lang["items_must_select_item_for_barcode"] = "Legalább 1 (egy) terméket ki kell választania vonalkód generálásához";
$lang["items_name"] = "Terméknév";
$lang["items_name_required"] = "Terméknév kötelező mező";
$lang["items_new"] = "Új termék";

View File

@@ -11,7 +11,7 @@ $lang["recvs_cost"] = "Költség";
$lang["recvs_date"] = "Beérkezés dátuma";
$lang["recvs_date_required"] = "Korrekt dátumot kell megadni";
$lang["recvs_date_type"] = "Dátum mező kötelező";
$lang["recvs_delete_confirmation"] = "Biztos, hogy törli az átvételt? Nem lehet visszavonni!";
$lang["receivings_confirm_delete"] = "Biztos, hogy törli az átvételt? Nem lehet visszavonni!";
$lang["recvs_delete_entire_sale"] = "Teljes értékesités törlése";
$lang["recvs_discount"] = "Kedv. %";
$lang["recvs_edit"] = "Szerkeszt";
@@ -48,4 +48,4 @@ $lang["recvs_supplier"] = "Szállitó";
$lang["recvs_total"] = "Összesen";
$lang["recvs_unable_to_add_item"] = "Nem sikerült terméket hozzáadni";
$lang["recvs_unsuccessfully_updated"] = "Átvétel sikertelenül módositva";
$lang["recvs_update"] = "Módosít";
$lang["receivings_update"] = "Módosít";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Sub Total";
$lang["reports_total_inventory_value"] = "Total Inventory Value";
$lang["reports_zero_and_less"] = "Nulla és kevesebb";
$lang["reports_more_than_zero"] = "Több mint nulla";
$lang["reports_no_reports_to_display"] = "Nincsenek megjeleníthető termékek";

View File

@@ -0,0 +1,10 @@
<?php
$lang["tables_loading"] = "Loading, please wait...";
$lang["tables_rows_per_page"] = "{0} rows per page";
$lang["tables_page_from_to"] = "Showing {0} to {1} of {2} rows";
$lang["tables_hide_show_pagination"] = "Hide/Show pagination";
$lang["tables_refresh"] = "Refresh";
$lang["tables_toggle"] = "Toggle";
$lang["tables_columns"] = "Columns";
$lang["tables_all"] = "All";

View File

@@ -60,3 +60,4 @@ $lang["common_export_excel"] = "Excel Export";
$lang["common_export_excel_yes"] = "Yes";
$lang["common_export_excel_no"] = "No";
$lang["common_required"] = "Required";
$lang["common_id"] = "Id";

View File

@@ -148,3 +148,6 @@ $lang["config_timezone"] = "Zona Waktu";
$lang["config_use_invoice_template"] = "Use Invoice Template";
$lang["config_website"] = "Situs Perusahaan";
$lang["config_datetimeformat"] = "Date and Time format";
$lang["config_country_codes"] = "Country Codes";
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
$lang["config_notify_alignment"] = "Notification Popup Position";

View File

@@ -18,3 +18,7 @@ $lang["customers_taxable"] = "Dapat dikenakan pajak";
$lang["customers_total"] = "Total";
$lang["customers_update"] = "Ubah Pelanggan";
$lang["customers_import_items_excel"] = "Import customers from Excel sheet";
$lang["customers_excel_import_failed"] = "Impor dari Excel tidak berhasil dilakukan";
$lang["customers_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["customers_excel_import_success"] = "Import of Customers successful";
$lang["customers_excel_import_partially_failed"] = "Most Customers imported. But some were not, here is the list";

View File

@@ -30,6 +30,9 @@ $lang["items_edit_multiple_items"] = "Ubah Beberapa Item";
$lang["items_error_adding_updating"] = "Kesalahan ketika menambahkan/memperbarui item";
$lang["items_error_updating_multiple"] = "Kesalahan ketika memperbarui item";
$lang["items_excel_import_failed"] = "Impor dari Excel tidak berhasil dilakukan";
$lang["items_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["items_excel_import_success"] = "Import of Items successful";
$lang["items_excel_import_partially_failed"] = "Most Items imported. But some were not, here is the list";
$lang["items_generate_barcodes"] = "Buat Barcode";
$lang["items_image"] = "Avatar";
$lang["items_info_provided_by"] = "Info disediakan oleh";
@@ -44,7 +47,6 @@ $lang["items_location"] = "Lokasi Barang";
$lang["items_empty_upc_items"] = "Empty UPC Items";
$lang["items_low_inventory_items"] = "Daftar Stock Rendah";
$lang["items_manually_editing_of_quantity"] = "Perubahan jumlah Stok secara manual";
$lang["items_must_select_item_for_barcode"] = "Anda harus memilih minimal 1 item untuk membuat barcode";
$lang["items_name"] = "Nama Barang";
$lang["items_name_required"] = "Nama item wajib diisi";
$lang["items_new"] = "Buat Item Baru";

View File

@@ -11,7 +11,7 @@ $lang["recvs_cost"] = "Harga";
$lang["recvs_date"] = "Tanggal";
$lang["recvs_date_required"] = "Tanngalnya harus diisi";
$lang["recvs_date_type"] = "Model Tanggal";
$lang["recvs_delete_confirmation"] = "Konfirmasi Hapus";
$lang["receivings_confirm_delete"] = "Konfirmasi Hapus";
$lang["recvs_delete_entire_sale"] = "Hapus Semua Penjualan";
$lang["recvs_discount"] = "Diskon %";
$lang["recvs_edit"] = "Ubah";
@@ -48,4 +48,4 @@ $lang["recvs_supplier"] = "Pemasok";
$lang["recvs_total"] = "Total";
$lang["recvs_unable_to_add_item"] = "Item tidak dapat ditambahkan ke penerimaan barang masuk";
$lang["recvs_unsuccessfully_updated"] = "Tidak Berhasil Diperbaharui";
$lang["recvs_update"] = "Ubah";
$lang["receivings_update"] = "Ubah";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Sub Total";
$lang["reports_total_inventory_value"] = "Total Nilai Persediaan";
$lang["reports_zero_and_less"] = "Stok habis dan minus";
$lang["reports_more_than_zero"] = "Stok belum habis";
$lang["reports_no_reports_to_display"] = "Tidak ada item untuk ditampilkan";

View File

@@ -0,0 +1,10 @@
<?php
$lang["tables_loading"] = "Laden, even geduld...";
$lang["tables_rows_per_page"] = "{0} records per pagina";
$lang["tables_page_from_to"] = "Toon {0} tot {1} van {2} record(s)";
$lang["tables_hide_show_pagination"] = "Toon %s record(s)";
$lang["tables_refresh"] = "Vernieuwen";
$lang["tables_toggle"] = "Omschakelen";
$lang["tables_columns"] = "Kolommen";
$lang["tables_all"] = "Alle";

View File

@@ -60,3 +60,4 @@ $lang["common_export_excel"] = "Excel Export";
$lang["common_export_excel_yes"] = "Yes";
$lang["common_export_excel_no"] = "No";
$lang["common_required"] = "Required";
$lang["common_id"] = "Id";

View File

@@ -148,3 +148,6 @@ $lang["config_timezone"] = "Tijdzone";
$lang["config_use_invoice_template"] = "Gebruik template voor facturen";
$lang["config_website"] = "Website";
$lang["config_datetimeformat"] = "Date and Time format";
$lang["config_country_codes"] = "Country Codes";
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
$lang["config_notify_alignment"] = "Notification Popup Position";

View File

@@ -18,3 +18,7 @@ $lang["customers_taxable"] = "Belastbaar";
$lang["customers_total"] = "Total";
$lang["customers_update"] = "Bewerk Klant";
$lang["customers_import_items_excel"] = "Import customers from Excel sheet";
$lang["customers_excel_import_failed"] = "Excel import mislukt";
$lang["customers_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["customers_excel_import_success"] = "Import of Customers successful";
$lang["customers_excel_import_partially_failed"] = "Most Customers imported. But some were not, here is the list";

View File

@@ -30,6 +30,9 @@ $lang["items_edit_multiple_items"] = "Meerdere Producten Bewerken";
$lang["items_error_adding_updating"] = "Fout bij het toevoegen/aanpassen van een product";
$lang["items_error_updating_multiple"] = "Fout bij het bewaren van producten";
$lang["items_excel_import_failed"] = "Excel import mislukt";
$lang["items_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["items_excel_import_success"] = "Import of Items successful";
$lang["items_excel_import_partially_failed"] = "Most Items imported. But some were not, here is the list";
$lang["items_generate_barcodes"] = "Genereer Barcodes";
$lang["items_image"] = "Afbeelding";
$lang["items_info_provided_by"] = "Info provided by";
@@ -44,7 +47,6 @@ $lang["items_location"] = "Locatie";
$lang["items_empty_upc_items"] = "Zonder barcode";
$lang["items_low_inventory_items"] = "Niet in stock";
$lang["items_manually_editing_of_quantity"] = "Manuele aanpassing hoeveelheid";
$lang["items_must_select_item_for_barcode"] = "U moet ten minste 1 product selecteren om een barcode te genereren";
$lang["items_name"] = "Productnaam";
$lang["items_name_required"] = "Productnaam moet ingevuld worden";
$lang["items_new"] = "Nieuw Product";

View File

@@ -11,7 +11,7 @@ $lang["recvs_cost"] = "Kost";
$lang["recvs_date"] = "Order Datum";
$lang["recvs_date_required"] = "Er moet een correcte datum ingevuld worden";
$lang["recvs_date_type"] = "Datum is vereist";
$lang["recvs_delete_confirmation"] = "Bent u zeker dat u dit order wil verwijderen? Dit kan niet ongedaan gemaakt worden.";
$lang["receivings_confirm_delete"] = "Bent u zeker dat u dit order wil verwijderen? Dit kan niet ongedaan gemaakt worden.";
$lang["recvs_delete_entire_sale"] = "Verwijder";
$lang["recvs_discount"] = "Korting %";
$lang["recvs_edit"] = "Bewerk";
@@ -48,4 +48,4 @@ $lang["recvs_supplier"] = "Leverancier";
$lang["recvs_total"] = "Totaal";
$lang["recvs_unable_to_add_item"] = "Onmogelijk om product aan order toe te voegen";
$lang["recvs_unsuccessfully_updated"] = "Receiving unsuccessfully updated";
$lang["recvs_update"] = "Bewerk";
$lang["receivings_update"] = "Bewerk";

View File

@@ -94,3 +94,4 @@ $lang["reports_sub_total_value"] = "Subtotaal";
$lang["reports_total_inventory_value"] = "Totale waarde stock";
$lang["reports_zero_and_less"] = "Nul en minder";
$lang["reports_more_than_zero"] = "Meer dan nul";
$lang["reports_no_reports_to_display"] = "Er werden geen producten gevonden";

View File

@@ -0,0 +1,10 @@
<?php
$lang["tables_loading"] = "Carregando, aguarde...";
$lang["tables_rows_per_page"] = "{0} registros por página";
$lang["tables_page_from_to"] = "Exibindo {0} até {1} de {2} linhas";
$lang["tables_hide_show_pagination"] = "Ocultar/Exibir paginação";
$lang["tables_refresh"] = "Recarregar";
$lang["tables_toggle"] = "Ocultar/Exibir paginação";
$lang["tables_columns"] = "Colunas";
$lang["tables_all"] = "Tudo";

View File

@@ -60,3 +60,4 @@ $lang["common_export_excel"] = "Exportar para Excel";
$lang["common_export_excel_yes"] = "Sim";
$lang["common_export_excel_no"] = "Não";
$lang["common_required"] = "Requerido";
$lang["common_id"] = "Id";

View File

@@ -93,16 +93,16 @@ $lang["config_location"] = "Estoque";
$lang["config_location_configuration"] = "Localização do Estoque";
$lang["config_location_info"] = "Informações da localização";
$lang["config_logout"] = "Você não quer fazer uma cópia de segurança antes de sair? Clique [OK] para fazer a cópia de segurança";
$lang["config_message"] = "Message";
$lang["config_message_configuration"] = "Message Configuration";
$lang["config_msg_msg"] = "Saved Text Message";
$lang["config_msg_msg_placeholder"] = "If you wish to use a SMS template save your message here. Otherwise leave the box blank.";
$lang["config_msg_uid"] = "SMS-API Username";
$lang["config_msg_uid_required"] = "SMS-API Username is a required field";
$lang["config_msg_pwd"] = "SMS-API Password";
$lang["config_msg_pwd_required"] = "SMS-API Password is a required field";
$lang["config_msg_src"] = "SMS-API Sender ID";
$lang["config_msg_src_required"] = "SMS-API Sender ID is a required field";
$lang["config_message"] = "Mensagem";
$lang["config_message_configuration"] = "Configuração de Mensagens";
$lang["config_msg_msg"] = "Salvar mensagem de texto";
$lang["config_msg_msg_placeholder"] = "Se você deseja usar um modelo de SMS salvar a sua mensagem aqui. Caso contrário, deixe a caixa em branco.";
$lang["config_msg_uid"] = "SMS-API usuário";
$lang["config_msg_uid_required"] = "SMS-API usuário é um campo obrigatório";
$lang["config_msg_pwd"] = "SMS-API senha";
$lang["config_msg_pwd_required"] = "SMS-API Senha é um campo obrigatório";
$lang["config_msg_src"] = "SMS-API Remetente ID";
$lang["config_msg_src_required"] = "SMS-API Remetente ID é um campo obrigatório ";
$lang["config_number_format"] = "Formato do número";
$lang["config_phone"] = "Telefone";
$lang["config_phone_required"] = "Telefone da Empresa é requerido";
@@ -148,3 +148,6 @@ $lang["config_timezone"] = "Fuso horário";
$lang["config_use_invoice_template"] = "Usar modelo de fatura";
$lang["config_website"] = "Site da internet";
$lang["config_datetimeformat"] = "Formato da data e hora";
$lang["config_country_codes"] = "Country Codes";
$lang["config_country_codes_tooltip"] = "Comma separated list of country codes for nominatim address lookup.";
$lang["config_notify_alignment"] = "Notification Popup Position";

View File

@@ -6,7 +6,7 @@ $lang["customers_cannot_be_deleted"] = "Não foi possível excluir clientes sele
$lang["customers_company_name"] = "Empresa";
$lang["customers_confirm_delete"] = "Tem certeza de que deseja excluir os clientes selecionados?";
$lang["customers_customer"] = "Cliente";
$lang["customers_discount"] = "Discount";
$lang["customers_discount"] = "Desconto";
$lang["customers_error_adding_updating"] = "Erro adicionar/atualizar cliente";
$lang["customers_new"] = "Novo Cliente";
$lang["customers_none_selected"] = "Você não selecionou nenhum clientes para apagar";
@@ -18,3 +18,7 @@ $lang["customers_taxable"] = "Tributável";
$lang["customers_total"] = "Total";
$lang["customers_update"] = "Atualizar Cliente";
$lang["customers_import_items_excel"] = "Importar clientes com planilha do Excel";
$lang["customers_excel_import_failed"] = "Importação do Excel falhou";
$lang["customers_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["customers_excel_import_success"] = "Import of Customers successful";
$lang["customers_excel_import_partially_failed"] = "Most Customers imported. But some were not, here is the list";

View File

@@ -41,7 +41,7 @@ $lang["giftcards_no_giftcards_to_display"] = "Sem cartões de presente para exib
$lang["giftcards_none"] = "Nenhum";
$lang["giftcards_none_selected"] = "Você não selecionou nenhum cartão de presente para editar";
$lang["giftcards_number"] = "Cartão de presente deve ser um número";
$lang["giftcards_number_information"] = "Númerocartão de presente";
$lang["giftcards_number_information"] = "Número cartão de presente";
$lang["giftcards_number_required"] = "Número cartão de presente é um campo obrigatório";
$lang["giftcards_one_or_multiple"] = "cartão de presente(s)";
$lang["giftcards_person_id"] = "Cliente";

View File

@@ -9,7 +9,7 @@ $lang["item_kits_info"] = "Informação do conjunto de Itens";
$lang["item_kits_item"] = "Item";
$lang["item_kits_items"] = "Itens";
$lang["item_kits_kit"] = "Conjunto Id";
$lang["item_kits_name"] = "Nome coonjunto de Itens";
$lang["item_kits_name"] = "Nome conjunto de Itens";
$lang["item_kits_new"] = "Novo conjunto de Itens";
$lang["item_kits_no_item_kits_to_display"] = "Não há conjuntos de itens para exibir";
$lang["item_kits_none_selected"] = "Você não selecionou nenhum conjunto de itens";

View File

@@ -13,9 +13,9 @@ $lang["items_category_required"] = "Categoria é um campo obrigatório";
$lang["items_change_all_to_allow_alt_desc"] = "Permitir alterar desconto para todos";
$lang["items_change_all_to_not_allow_allow_desc"] = "Não Permitir alterar desconto para todos";
$lang["items_change_all_to_serialized"] = "Alterar todos para serializados";
$lang["items_change_all_to_unserialized"] = "Alterar todos para desserializados";
$lang["items_change_all_to_unserialized"] = "Alterar todos para não serializados";
$lang["items_confirm_bulk_edit"] = "Tem certeza de que deseja editar todos os itens selecionados?";
$lang["items_confirm_bulk_edit_wipe_taxes"] = "Tem certeza de que deseja editar todos osimpostos selecionados?";
$lang["items_confirm_bulk_edit_wipe_taxes"] = "Tem certeza de que deseja editar todos os impostos selecionados?";
$lang["items_confirm_delete"] = "Tem certeza de que deseja excluir os itens selecionados?";
$lang["items_cost_price"] = "Preço de Custo";
$lang["items_cost_price_number"] = "Preço de custo deve ser um número";
@@ -30,6 +30,9 @@ $lang["items_edit_multiple_items"] = "Editando Múltiplos Itens";
$lang["items_error_adding_updating"] = "Erro ao adicionar/atualizar item ";
$lang["items_error_updating_multiple"] = "Erro na atualização de itens";
$lang["items_excel_import_failed"] = "Importação do Excel falhou";
$lang["items_excel_import_nodata_wrongformat"] = "Your uploaded file has no data or wrong format";
$lang["items_excel_import_success"] = "Import of Items successful";
$lang["items_excel_import_partially_failed"] = "Most Items imported. But some were not, here is the list";
$lang["items_generate_barcodes"] = "Gerar Códigos de Barras";
$lang["items_image"] = "Avatar";
$lang["items_info_provided_by"] = "Informação fornecida por";
@@ -44,7 +47,6 @@ $lang["items_location"] = "Localização";
$lang["items_empty_upc_items"] = "Vazio UPC Itens";
$lang["items_low_inventory_items"] = "Itens sem estoque";
$lang["items_manually_editing_of_quantity"] = "Editar manualmente a quantidade";
$lang["items_must_select_item_for_barcode"] = "Você deve selecionar pelo menos um item para gerar códigos de barras";
$lang["items_name"] = "Nome produto";
$lang["items_name_required"] = "Nome do item é um campo obrigatório";
$lang["items_new"] = "Novo Item";

View File

@@ -1,14 +1,14 @@
<?php
$lang["messages_sms_send"] = "Send SMS";
$lang["messages_first_name"] = "First name";
$lang["messages_last_name"] = "Last name";
$lang["messages_phone"] = "Phone number";
$lang["messages_phone_placeholder"] = "Mobile Number(s) here...";
$lang["messages_phone_number_required"] = "Phone number required";
$lang["messages_message"] = "Message";
$lang["messages_message_placeholder"] = "Your Message here...";
$lang["messages_message_required"] = "Message required";
$lang["messages_multiple_phones"] = "(In case of multiple recipients, enter mobile numbers separated by commas)";
$lang["messages_successfully_sent"] = "Message successfully sent to: ";
$lang["messages_unsuccessfully_sent"] = "Message unsuccessfully sent to: ";
$lang["messages_sms_send"] = "Enviar SMS";
$lang["messages_first_name"] = "Primeiro nome";
$lang["messages_last_name"] = "Último nome";
$lang["messages_phone"] = "Número de telefone";
$lang["messages_phone_placeholder"] = "Numero (s) do Celulares aqui ...";
$lang["messages_phone_number_required"] = "Celular é obrigatóriodesejado";
$lang["messages_message"] = "Mensagem";
$lang["messages_message_placeholder"] = "Sua mensagem aqui ...";
$lang["messages_message_required"] = "mensagem é requerida";
$lang["messages_multiple_phones"] = "(No caso de vários destinatários, digite os números celulares separadas por vírgula)";
$lang["messages_successfully_sent"] = "Mensagem enviada com sucesso para:";
$lang["messages_unsuccessfully_sent"] = "Mensagem sem sucesso no envio para: ";

View File

@@ -21,5 +21,5 @@ $lang["module_sales"] = "Vendas";
$lang["module_sales_desc"] = "Processar vendas e devoluções";
$lang["module_suppliers"] = "Fornecedores";
$lang["module_suppliers_desc"] = "Adicionar, atualizar, excluir e Pesquisar fornecedores";
$lang["module_messages"] = "Messages";
$lang["module_messages_desc"] = "Send Messages to Customers, Suppliers, Employees et al.";
$lang["module_messages"] = "Mensagens";
$lang["module_messages_desc"] = "Enviar mensagens para os clientes, fornecedores, colaboradores etc.";

View File

@@ -11,7 +11,7 @@ $lang["recvs_cost"] = "Custo";
$lang["recvs_date"] = "Data Recebimento";
$lang["recvs_date_required"] = "A data correta precisa ser preenchida";
$lang["recvs_date_type"] = "Campo de data é obrigatório";
$lang["recvs_delete_confirmation"] = "Tem certeza de que deseja excluir este recebimento esta ação não pode ser desfeita";
$lang["receivings_confirm_delete"] = "Tem certeza de que deseja excluir este recebimento esta ação não pode ser desfeita";
$lang["recvs_delete_entire_sale"] = "Apagar toda a venda";
$lang["recvs_discount"] = "Desc. %";
$lang["recvs_edit"] = "Editar";
@@ -48,4 +48,4 @@ $lang["recvs_supplier"] = "Fornecedor";
$lang["recvs_total"] = "Total";
$lang["recvs_unable_to_add_item"] = "Não é possível adicionar item para recebimento";
$lang["recvs_unsuccessfully_updated"] = "Recebimento não atualizado";
$lang["recvs_update"] = "Atualizar";
$lang["receivings_update"] = "Atualizar";

Some files were not shown because too many files have changed in this diff Show More