mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-05 23:58:02 -05:00
Merge branch 'master' into develop/2.4
Conflicts: Dockerfile
This commit is contained in:
38
.travis.yml
38
.travis.yml
@@ -1,22 +1,16 @@
|
||||
language: php
|
||||
php:
|
||||
- 5.5
|
||||
install: npm install
|
||||
before_script:
|
||||
- npm update -g npm
|
||||
- npm install grunt-cli
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install apache2 libapache2-mod-fastcgi
|
||||
# enable php-fpm
|
||||
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
|
||||
- sudo a2enmod rewrite actions fastcgi alias
|
||||
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
|
||||
# configure apache virtual hosts
|
||||
- sudo cp -f travis-ci-apache /etc/apache2/sites-available/default
|
||||
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
|
||||
- sudo service apache2 restart
|
||||
- mysql -e "create database IF NOT EXISTS ospos;" -uroot
|
||||
- mysql -e "use ospos; source database/database.sql;" -uroot
|
||||
- cp application/config/database.php.tmpl application/config/database.php
|
||||
script: grunt mochaWebdriver:test
|
||||
sudo: false
|
||||
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- "4.1"
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
before_install:
|
||||
- docker build -t jekkos/opensourcepos .
|
||||
- docker run -d jekkos/opensourcepos
|
||||
|
||||
script:
|
||||
- docker exec -t -i $(docker ps | tail -n 1 | cut -d' ' -f1) /bin/sh -c "wget --retry-connrefused --tries=5 -q --waitretry=3 --spider http://localhost/index.php && cd /app && grunt mochaWebdriver:test"
|
||||
|
||||
21
Dockerfile
21
Dockerfile
@@ -1,18 +1,27 @@
|
||||
FROM jbfink/docker-lampstack
|
||||
FROM ubuntu:trusty
|
||||
MAINTAINER jekkos
|
||||
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 nodejs npm wget
|
||||
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
|
||||
# RUN add-apt-repository ppa:chris-lea/node.js
|
||||
|
||||
# Get latest Ospos source from Git
|
||||
RUN git clone https://github.com/jekkos/opensourcepos.git /app
|
||||
# RUN cd app && npm install
|
||||
# RUN cd app && git checkout develop/2.4
|
||||
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 ln -fs /app/* /var/www
|
||||
RUN ln -fs /app/* /var/www/html
|
||||
RUN rm /var/www/index.html
|
||||
ADD ./start_container.sh /start_container.sh
|
||||
ADD ./docker/start_container.sh /start_container.sh
|
||||
RUN chmod 755 /start_container.sh
|
||||
EXPOSE 80 3306
|
||||
CMD ["/bin/bash", "/start_container.sh"]
|
||||
|
||||
28
Gruntfile.js
28
Gruntfile.js
@@ -3,21 +3,33 @@ module.exports = function(grunt) {
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
concat: {
|
||||
options: {
|
||||
separator: ';'
|
||||
},
|
||||
dist: {
|
||||
src: ['js/jquery*', 'js/*.js'],
|
||||
dest: 'dist/<%= pkg.name %>.js'
|
||||
}
|
||||
js: {
|
||||
options: {
|
||||
separator: ';'
|
||||
},
|
||||
dist: {
|
||||
src: ['js/jquery*', 'js/*.js'],
|
||||
dest: 'dist/<%= pkg.name %>.js'
|
||||
}
|
||||
},
|
||||
sql: {
|
||||
options: {
|
||||
banner: '-- >> This file is autogenerated from tables.sql and constraints.sql. Do not modify directly << --'
|
||||
},
|
||||
files: {
|
||||
'database/database.sql': ['database/tables.sql', 'database/constraints.sql'],
|
||||
'database/migrate_phppos_dist.sql': ['database/tables.sql', 'database/phppos_migrate.sql', 'database/constraints.sql']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
uglify: {
|
||||
options: {
|
||||
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
|
||||
},
|
||||
dist: {
|
||||
files: {
|
||||
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
|
||||
'dist/<%= pkg.name %>.min.js': ['<%= concat.js.dist.dest %>']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
10
README.md
10
README.md
@@ -25,9 +25,15 @@ To build and run the image, issue following commands in a terminal with docker i
|
||||
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.
|
||||
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)
|
||||
|
||||
A more extensive setup guide can be found at [this site](http://www.opensourceposguide.com/guide/gettingstarted/installation)
|
||||
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)
|
||||
|
||||
If you like the project, and you are making money out of it on a daily basis, then consider to buy me a coffee so I can keep adding features.
|
||||
|
||||
|
||||
@@ -1,60 +1,49 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" rev="stylesheet" href="<?php echo base_url();?>css/login.css" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title>Open Source Point Of Sale <?php echo $this->lang->line('login_login'); ?></title>
|
||||
<script src="<?php echo base_url();?>js/jquery-1.8.3.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#login_form input:first").focus();
|
||||
});
|
||||
</script>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="stylesheet" rev="stylesheet" href="<?php echo base_url();?>css/login.css" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<title>Open Source Point Of Sale <?php echo $this->lang->line('login_login'); ?></title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="<?php echo base_url();?>/images/favicon.ico">
|
||||
<script src="<?php echo base_url();?>js/jquery-1.8.3.js" type="text/javascript" language="javascript" charset="UTF-8"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#login_form input:first").focus();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div align="center" style="margin-top:10px"><img src=<?php echo base_url();?>/images/logo.gif></div>
|
||||
|
||||
<div align="center" style="margin-top:10px"><img src=<?php echo base_url();?>/images/logo.gif>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="login">
|
||||
|
||||
|
||||
|
||||
<?php echo form_open('login') ?>
|
||||
<div id="container">
|
||||
<?php echo validation_errors(); ?>
|
||||
|
||||
<div id="login_form">
|
||||
<div id="login">
|
||||
|
||||
<?php echo form_open('login') ?>
|
||||
<div id="container">
|
||||
<?php echo validation_errors(); ?>
|
||||
|
||||
<div class="form_field_label"><?php echo $this->lang->line('login_username'); ?>: </div>
|
||||
<div class="form_field">
|
||||
<?php echo form_input(array(
|
||||
'name'=>'username',
|
||||
'id'=>'username',
|
||||
'size'=>'20')); ?>
|
||||
<div id="login_form">
|
||||
<div class="form_field_label"><?php echo $this->lang->line('login_username'); ?>: </div>
|
||||
<div class="form_field">
|
||||
<?php echo form_input(array(
|
||||
'name'=>'username',
|
||||
'id'=>'username',
|
||||
'size'=>'20')); ?>
|
||||
</div>
|
||||
|
||||
<div class="form_field_label"><?php echo $this->lang->line('login_password'); ?>: </div>
|
||||
<div class="form_field">
|
||||
<?php echo form_password(array(
|
||||
'name'=>'password',
|
||||
'id' => 'password',
|
||||
'size'=>'20')); ?>
|
||||
</div>
|
||||
|
||||
<div id="submit_button"><?php echo form_submit('loginButton','Go'); ?> </div>
|
||||
</div>
|
||||
|
||||
<div class="form_field_label"><?php echo $this->lang->line('login_password'); ?>: </div>
|
||||
<div class="form_field">
|
||||
<?php echo form_password(array(
|
||||
'name'=>'password',
|
||||
'id' => 'password',
|
||||
'size'=>'20')); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="submit_button">
|
||||
<?php echo form_submit('loginButton','Go'); ?>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php echo form_close(); ?><h1>Open Source Point Of Sale <?php echo $this->config->item('application_version'); ?></h1>
|
||||
<?php echo form_close(); ?><h1>Open Source Point Of Sale <?php echo $this->config->item('application_version'); ?></h1>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,41 +1,44 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<base href="<?php echo base_url();?>" />
|
||||
<title><?php echo $this->config->item('company').' -- '.$this->lang->line('common_powered_by').' OS Point Of Sale' ?></title>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
|
||||
<link rel="stylesheet" type="text/css" href="css/ospos.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="css/ospos_print.css" media="print" />
|
||||
|
||||
<?php if ($this->input->cookie('debug') == "true" || $this->input->get("debug") == "true") : ?>
|
||||
<!-- start js template tags -->
|
||||
<script type="text/javascript" src="js/jquery-1.8.3.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery-ui-1.11.4.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery-ui-timepicker-addon.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.ajax_queue.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.autocomplete.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.bgiframe.min.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.color.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.form-3.51.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.jkey-1.1.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.metadata.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.tablesorter-2.20.1.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.tablesorter.staticrow.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.validate-1.13.1-min.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/common.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/date.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/imgpreview.full.jquery.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/manage_tables.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/nominatim.autocomplete.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/swfobject.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/tabcontent.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/thickbox.js" language="javascript"></script>
|
||||
<!-- end js template tags -->
|
||||
<?php else : ?>
|
||||
<!-- start minjs template tags -->
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=cb9e5b15ec" language="javascript"></script>
|
||||
<!-- end minjs template tags -->
|
||||
<?php endif; ?>
|
||||
<!-- start js template tags -->
|
||||
<script type="text/javascript" src="js/jquery-1.8.3.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery-ui-1.11.4.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery-ui-timepicker-addon.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.ajax_queue.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.autocomplete.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.bgiframe.min.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.color.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.form-3.51.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.jkey-1.1.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.metadata.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.tablesorter-2.20.1.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.tablesorter.staticrow.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/jquery.validate-1.13.1-min.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/common.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/date.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/imgpreview.full.jquery.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/manage_tables.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/nominatim.autocomplete.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/phpjsdate.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/swfobject.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/tabcontent.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="js/thickbox.js" language="javascript"></script>
|
||||
<!-- end js template tags -->
|
||||
<?php else : ?>
|
||||
<!-- start minjs template tags -->
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=a8ae30ad50" language="javascript"></script>
|
||||
<!-- end minjs template tags -->
|
||||
<?php endif; ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
function logout(logout)
|
||||
{
|
||||
@@ -49,13 +52,30 @@
|
||||
window.location = "<?php echo site_url('home/logout'); ?>";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
html {
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
// live clock
|
||||
|
||||
function clockTick(){
|
||||
setInterval('updateClock();', 1000);
|
||||
}
|
||||
|
||||
// start the clock immediatly
|
||||
clockTick();
|
||||
|
||||
var now = new Date(<?php echo time() * 1000 ?>);
|
||||
|
||||
function updateClock() {
|
||||
now.setTime(now.getTime() + 1000);
|
||||
|
||||
document.getElementById('liveclock').innerHTML = phpjsDate("<?php echo $this->config->item('dateformat').' '.$this->config->item('timeformat') ?>", now);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
html {
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -87,7 +107,7 @@ html {
|
||||
</div>
|
||||
|
||||
<div id="menubar_date">
|
||||
<?php echo date($this->config->item('dateformat').' '.$this->config->item('timeformat')) ?>
|
||||
<div id="liveclock"><?php echo date($this->config->item('dateformat').' '.$this->config->item('timeformat')) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -259,8 +259,9 @@ if (isset($success))
|
||||
if(count($cart) > 0)
|
||||
{
|
||||
?>
|
||||
<?php echo form_open("sales/cancel_sale", array('id'=>'cancel_sale_form')); ?>
|
||||
|
||||
<div id="Cancel_sale">
|
||||
<?php echo form_open("sales/cancel_sale", array('id'=>'cancel_sale_form')); ?>
|
||||
<div class='small_button' id='cancel_sale_button' style='float:left; margin-top: 5px;'>
|
||||
<span><?php echo $this->lang->line('sales_cancel_sale'); ?></span>
|
||||
</div>
|
||||
@@ -279,8 +280,9 @@ if (isset($success))
|
||||
if(count($payments) > 0)
|
||||
{
|
||||
?>
|
||||
<?php echo form_open("sales/complete", array('id'=>'finish_sale_form')); ?>
|
||||
|
||||
<div id="finish_sale">
|
||||
<?php echo form_open("sales/complete", array('id'=>'finish_sale_form')); ?>
|
||||
<label id="comment_label" for="comment"><?php echo $this->lang->line('common_comments'); ?>:</label>
|
||||
<?php echo form_textarea(array('name'=>'comment', 'id'=>'comment', 'value'=>$comment, 'rows'=>'4', 'cols'=>'23'));?>
|
||||
<br />
|
||||
|
||||
@@ -1,15 +1,852 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 3.3.9
|
||||
-- http://www.phpmyadmin.net
|
||||
-- >> This file is autogenerated from tables.sql and constraints.sql. Do not modify directly << --
|
||||
--
|
||||
-- Host: localhost
|
||||
-- Generation Time: Apr 08, 2011 at 04:27 PM
|
||||
-- Server version: 5.1.54
|
||||
-- PHP Version: 5.3.3
|
||||
|
||||
--
|
||||
-- Database: `pos`
|
||||
-- Table structure for table `ospos_app_config`
|
||||
--
|
||||
|
||||
SOURCE tables.sql;
|
||||
SOURCE constraints.sql;
|
||||
CREATE TABLE `ospos_app_config` (
|
||||
`key` varchar(255) NOT NULL,
|
||||
`value` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`key`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_app_config`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('address', '123 Nowhere street'),
|
||||
('company', 'Open Source Point of Sale'),
|
||||
('default_tax_rate', '8'),
|
||||
('email', 'admin@pappastech.com'),
|
||||
('fax', ''),
|
||||
('phone', '555-555-5555'),
|
||||
('return_policy', 'Test'),
|
||||
('timezone', 'America/New_York'),
|
||||
('website', ''),
|
||||
('recv_invoice_format', '$CO'),
|
||||
('sales_invoice_format', '$CO'),
|
||||
('tax_included', '0'),
|
||||
('invoice_default_comments', 'This is a default comment'),
|
||||
('company_logo', ''),
|
||||
('barcode_content', 'id'),
|
||||
('barcode_type', 'Code39'),
|
||||
('barcode_width', '250'),
|
||||
('barcode_height', '50'),
|
||||
('barcode_quality', '100'),
|
||||
('barcode_font', 'Arial'),
|
||||
('barcode_font_size', '10'),
|
||||
('barcode_first_row', 'category'),
|
||||
('barcode_second_row', 'item_code'),
|
||||
('barcode_third_row', 'unit_price'),
|
||||
('barcode_num_in_row', '2'),
|
||||
('barcode_page_width', '100'),
|
||||
('barcode_page_cellspacing', '20'),
|
||||
('barcode_generate_if_empty', '0'),
|
||||
('receipt_show_taxes', '0'),
|
||||
('use_invoice_template', '1'),
|
||||
('invoice_email_message', 'Dear $CU, In attachment the receipt for sale $INV'),
|
||||
('print_silently', '1'),
|
||||
('print_header', '0'),
|
||||
('print_footer', '0'),
|
||||
('print_top_margin', '0'),
|
||||
('print_left_margin', '0'),
|
||||
('print_bottom_margin', '0'),
|
||||
('print_right_margin', '0'),
|
||||
('default_sales_discount', '0'),
|
||||
('lines_per_page', '25'),
|
||||
('show_total_discount', '1'),
|
||||
('dateformat', 'm/d/Y'),
|
||||
('timeformat', 'H:i:s'),
|
||||
('currency_symbol', '$');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_customers`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_customers` (
|
||||
`person_id` int(10) NOT NULL,
|
||||
`company_name` varchar(255) DEFAULT NULL,
|
||||
`account_number` varchar(255) DEFAULT NULL,
|
||||
`taxable` int(1) NOT NULL DEFAULT '1',
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
UNIQUE KEY `account_number` (`account_number`),
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_customers`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_employees`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_employees` (
|
||||
`username` varchar(255) NOT NULL,
|
||||
`password` varchar(255) NOT NULL,
|
||||
`person_id` int(10) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
UNIQUE KEY `username` (`username`),
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_employees`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`) VALUES
|
||||
('admin', '439a6de57d475c1a0ba9bcb1c39f0af6', 1, 0);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_giftcards`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_giftcards` (
|
||||
`record_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`giftcard_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`giftcard_number` int(10) NOT NULL,
|
||||
`value` decimal(15,2) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`person_id` INT(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`giftcard_id`),
|
||||
UNIQUE KEY `giftcard_number` (`giftcard_number`),
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_giftcards`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_inventory`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_inventory` (
|
||||
`trans_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`trans_items` int(11) NOT NULL DEFAULT '0',
|
||||
`trans_user` int(11) NOT NULL DEFAULT '0',
|
||||
`trans_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`trans_comment` text NOT NULL,
|
||||
`trans_location` int(11) NOT NULL,
|
||||
`trans_inventory` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`trans_id`),
|
||||
KEY `trans_items` (`trans_items`),
|
||||
KEY `trans_user` (`trans_user`),
|
||||
KEY `trans_location` (`trans_location`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_inventory`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_items` (
|
||||
`name` varchar(255) NOT NULL,
|
||||
`category` varchar(255) NOT NULL,
|
||||
`supplier_id` int(11) DEFAULT NULL,
|
||||
`item_number` varchar(255) DEFAULT NULL,
|
||||
`description` varchar(255) NOT NULL,
|
||||
`cost_price` decimal(15,2) NOT NULL,
|
||||
`unit_price` decimal(15,2) NOT NULL,
|
||||
`reorder_level` decimal(15,2) NOT NULL DEFAULT '0',
|
||||
`receiving_quantity` int(11) NOT NULL DEFAULT '1',
|
||||
`item_id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`pic_id` int(10) DEFAULT NULL,
|
||||
`allow_alt_description` tinyint(1) NOT NULL,
|
||||
`is_serialized` tinyint(1) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`custom1` VARCHAR(25) NOT NULL,
|
||||
`custom2` VARCHAR(25) NOT NULL,
|
||||
`custom3` VARCHAR(25) NOT NULL,
|
||||
`custom4` VARCHAR(25) NOT NULL,
|
||||
`custom5` VARCHAR(25) NOT NULL,
|
||||
`custom6` VARCHAR(25) NOT NULL,
|
||||
`custom7` VARCHAR(25) NOT NULL,
|
||||
`custom8` VARCHAR(25) NOT NULL,
|
||||
`custom9` VARCHAR(25) NOT NULL,
|
||||
`custom10` VARCHAR(25) NOT NULL,
|
||||
PRIMARY KEY (`item_id`),
|
||||
UNIQUE KEY `item_number` (`item_number`),
|
||||
KEY `supplier_id` (`supplier_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_items`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_items_taxes`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_items_taxes` (
|
||||
`item_id` int(10) NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`percent` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`item_id`,`name`,`percent`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_items_taxes`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_item_kits`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_item_kits` (
|
||||
`item_kit_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`description` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`item_kit_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_item_kits`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_item_kit_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_item_kit_items` (
|
||||
`item_kit_id` int(11) NOT NULL,
|
||||
`item_id` int(11) NOT NULL,
|
||||
`quantity` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`item_kit_id`,`item_id`,`quantity`),
|
||||
KEY `ospos_item_kit_items_ibfk_2` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_item_kit_items`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_item_quantities`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_item_quantities` (
|
||||
`item_id` int(11) NOT NULL,
|
||||
`location_id` int(11) NOT NULL,
|
||||
`quantity` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`item_id`,`location_id`),
|
||||
KEY `item_id` (`item_id`),
|
||||
KEY `location_id` (`location_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_modules`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_modules` (
|
||||
`name_lang_key` varchar(255) NOT NULL,
|
||||
`desc_lang_key` varchar(255) NOT NULL,
|
||||
`sort` int(10) NOT NULL,
|
||||
`module_id` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`module_id`),
|
||||
UNIQUE KEY `desc_lang_key` (`desc_lang_key`),
|
||||
UNIQUE KEY `name_lang_key` (`name_lang_key`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_modules`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
|
||||
('module_config', 'module_config_desc', 100, 'config'),
|
||||
('module_customers', 'module_customers_desc', 10, 'customers'),
|
||||
('module_employees', 'module_employees_desc', 80, 'employees'),
|
||||
('module_giftcards', 'module_giftcards_desc', 90, 'giftcards'),
|
||||
('module_items', 'module_items_desc', 20, 'items'),
|
||||
('module_item_kits', 'module_item_kits_desc', 30, 'item_kits'),
|
||||
('module_receivings', 'module_receivings_desc', 60, 'receivings'),
|
||||
('module_reports', 'module_reports_desc', 50, 'reports'),
|
||||
('module_sales', 'module_sales_desc', 70, 'sales'),
|
||||
('module_suppliers', 'module_suppliers_desc', 40, 'suppliers');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_people`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_people` (
|
||||
`first_name` varchar(255) NOT NULL,
|
||||
`last_name` varchar(255) NOT NULL,
|
||||
`gender` int(1) DEFAULT NULL,
|
||||
`phone_number` varchar(255) NOT NULL,
|
||||
`email` varchar(255) NOT NULL,
|
||||
`address_1` varchar(255) NOT NULL,
|
||||
`address_2` varchar(255) NOT NULL,
|
||||
`city` varchar(255) NOT NULL,
|
||||
`state` varchar(255) NOT NULL,
|
||||
`zip` varchar(255) NOT NULL,
|
||||
`country` varchar(255) NOT NULL,
|
||||
`comments` text NOT NULL,
|
||||
`person_id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_people`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_people` (`first_name`, `last_name`, `phone_number`, `email`, `address_1`, `address_2`, `city`, `state`, `zip`, `country`, `comments`, `person_id`) VALUES
|
||||
('John', 'Doe', '555-555-5555', 'admin@pappastech.com', 'Address 1', '', '', '', '', '', '', 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_permissions`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_permissions` (
|
||||
`permission_id` varchar(255) NOT NULL,
|
||||
`module_id` varchar(255) NOT NULL,
|
||||
`location_id` int(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`permission_id`),
|
||||
KEY `module_id` (`module_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_permissions`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('reports_customers', 'reports'),
|
||||
('reports_receivings', 'reports'),
|
||||
('reports_items', 'reports'),
|
||||
('reports_employees', 'reports'),
|
||||
('reports_suppliers', 'reports'),
|
||||
('reports_sales', 'reports'),
|
||||
('reports_discounts', 'reports'),
|
||||
('reports_taxes', 'reports'),
|
||||
('reports_inventory', 'reports'),
|
||||
('reports_categories', 'reports'),
|
||||
('reports_payments', 'reports'),
|
||||
('customers', 'customers'),
|
||||
('employees', 'employees'),
|
||||
('giftcards', 'giftcards'),
|
||||
('items', 'items'),
|
||||
('item_kits', 'item_kits'),
|
||||
('receivings', 'receivings'),
|
||||
('reports', 'reports'),
|
||||
('sales', 'sales'),
|
||||
('config', 'config'),
|
||||
('suppliers', 'suppliers');
|
||||
|
||||
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`, `location_id`) VALUES
|
||||
('items_stock', 'items', 1),
|
||||
('sales_stock', 'sales', 1),
|
||||
('receivings_stock', 'receivings', 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_grants`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_grants` (
|
||||
`permission_id` varchar(255) NOT NULL,
|
||||
`person_id` int(10) NOT NULL,
|
||||
PRIMARY KEY (`permission_id`,`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_grants`
|
||||
--
|
||||
-- --------------------------------------------------------
|
||||
|
||||
INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES
|
||||
('reports_customers', 1),
|
||||
('reports_receivings', 1),
|
||||
('reports_items', 1),
|
||||
('reports_inventory', 1),
|
||||
('reports_employees', 1),
|
||||
('reports_suppliers', 1),
|
||||
('reports_sales', 1),
|
||||
('reports_discounts', 1),
|
||||
('reports_taxes', 1),
|
||||
('reports_categories', 1),
|
||||
('reports_payments', 1),
|
||||
('customers', 1),
|
||||
('employees', 1),
|
||||
('giftcards', 1),
|
||||
('items', 1),
|
||||
('item_kits', 1),
|
||||
('receivings', 1),
|
||||
('reports', 1),
|
||||
('sales', 1),
|
||||
('config', 1),
|
||||
('items_stock', 1),
|
||||
('sales_stock', 1),
|
||||
('receivings_stock', 1),
|
||||
('suppliers', 1);
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_receivings`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_receivings` (
|
||||
`receiving_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`supplier_id` int(10) DEFAULT NULL,
|
||||
`employee_id` int(10) NOT NULL DEFAULT '0',
|
||||
`comment` text NOT NULL,
|
||||
`receiving_id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`payment_type` varchar(20) DEFAULT NULL,
|
||||
`invoice_number` varchar(32) DEFAULT NULL,
|
||||
PRIMARY KEY (`receiving_id`),
|
||||
KEY `supplier_id` (`supplier_id`),
|
||||
KEY `employee_id` (`employee_id`),
|
||||
UNIQUE KEY `invoice_number` (`invoice_number`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_receivings`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_receivings_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_receivings_items` (
|
||||
`receiving_id` int(10) NOT NULL DEFAULT '0',
|
||||
`item_id` int(10) NOT NULL DEFAULT '0',
|
||||
`description` varchar(30) DEFAULT NULL,
|
||||
`serialnumber` varchar(30) DEFAULT NULL,
|
||||
`line` int(3) NOT NULL,
|
||||
`quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0',
|
||||
`item_cost_price` decimal(15,2) NOT NULL,
|
||||
`item_unit_price` decimal(15,2) NOT NULL,
|
||||
`discount_percent` decimal(15,2) NOT NULL DEFAULT '0',
|
||||
`item_location` int(11) NOT NULL,
|
||||
`receiving_quantity` int(11) NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY (`receiving_id`,`item_id`,`line`),
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_receivings_items`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales` (
|
||||
`sale_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`customer_id` int(10) DEFAULT NULL,
|
||||
`employee_id` int(10) NOT NULL DEFAULT '0',
|
||||
`comment` text NOT NULL,
|
||||
`invoice_number` varchar(32) DEFAULT NULL,
|
||||
`sale_id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`sale_id`),
|
||||
KEY `customer_id` (`customer_id`),
|
||||
KEY `employee_id` (`employee_id`),
|
||||
KEY `sale_time` (`sale_time`),
|
||||
UNIQUE KEY `invoice_number` (`invoice_number`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_items` (
|
||||
`sale_id` int(10) NOT NULL DEFAULT '0',
|
||||
`item_id` int(10) NOT NULL DEFAULT '0',
|
||||
`description` varchar(30) DEFAULT NULL,
|
||||
`serialnumber` varchar(30) DEFAULT NULL,
|
||||
`line` int(3) NOT NULL DEFAULT '0',
|
||||
`quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0.00',
|
||||
`item_cost_price` decimal(15,2) NOT NULL,
|
||||
`item_unit_price` decimal(15,2) NOT NULL,
|
||||
`discount_percent` decimal(15,2) NOT NULL DEFAULT '0',
|
||||
`item_location` int(11) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`item_id`,`line`),
|
||||
KEY `sale_id` (`sale_id`),
|
||||
KEY `item_id` (`item_id`),
|
||||
KEY `item_location` (`item_location`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_items`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_items_taxes`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_items_taxes` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`item_id` int(10) NOT NULL,
|
||||
`line` int(3) NOT NULL DEFAULT '0',
|
||||
`name` varchar(255) NOT NULL,
|
||||
`percent` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`item_id`,`line`,`name`,`percent`),
|
||||
KEY `sale_id` (`sale_id`),
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_items_taxes`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_payments`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_payments` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`payment_type` varchar(40) NOT NULL,
|
||||
`payment_amount` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`payment_type`),
|
||||
KEY `sale_id` (`sale_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_payments`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_suspended`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended` (
|
||||
`sale_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`customer_id` int(10) DEFAULT NULL,
|
||||
`employee_id` int(10) NOT NULL DEFAULT '0',
|
||||
`comment` text NOT NULL,
|
||||
`invoice_number` varchar(32) DEFAULT NULL,
|
||||
`sale_id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`sale_id`),
|
||||
KEY `customer_id` (`customer_id`),
|
||||
KEY `employee_id` (`employee_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_suspended_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended_items` (
|
||||
`sale_id` int(10) NOT NULL DEFAULT '0',
|
||||
`item_id` int(10) NOT NULL DEFAULT '0',
|
||||
`description` varchar(30) DEFAULT NULL,
|
||||
`serialnumber` varchar(30) DEFAULT NULL,
|
||||
`line` int(3) NOT NULL DEFAULT '0',
|
||||
`quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0.00',
|
||||
`item_cost_price` decimal(15,2) NOT NULL,
|
||||
`item_unit_price` decimal(15,2) NOT NULL,
|
||||
`discount_percent` decimal(15,2) NOT NULL DEFAULT '0',
|
||||
`item_location` int(11) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`item_id`,`line`),
|
||||
KEY `sale_id` (`sale_id`),
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended_items`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_suspended_items_taxes`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended_items_taxes` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`item_id` int(10) NOT NULL,
|
||||
`line` int(3) NOT NULL DEFAULT '0',
|
||||
`name` varchar(255) NOT NULL,
|
||||
`percent` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`item_id`,`line`,`name`,`percent`),
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended_items_taxes`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_suspended_payments`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended_payments` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`payment_type` varchar(40) NOT NULL,
|
||||
`payment_amount` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`payment_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended_payments`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sessions`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sessions` (
|
||||
`session_id` varchar(40) NOT NULL DEFAULT '0',
|
||||
`ip_address` varchar(45) NOT NULL DEFAULT '0',
|
||||
`user_agent` varchar(120) NOT NULL,
|
||||
`last_activity` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`user_data` text,
|
||||
PRIMARY KEY (`session_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sessions`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_stock_locations`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_stock_locations` (
|
||||
`location_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`location_name` varchar(255) DEFAULT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`location_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_stock_locations`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_stock_locations` ( `deleted`, `location_name` ) VALUES ('0', 'stock');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_suppliers`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_suppliers` (
|
||||
`person_id` int(10) NOT NULL,
|
||||
`company_name` varchar(255) NOT NULL,
|
||||
`agency_name` varchar(255) NOT NULL,
|
||||
`account_number` varchar(255) DEFAULT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
UNIQUE KEY `account_number` (`account_number`),
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_suppliers`
|
||||
--
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- Constraints for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_customers`
|
||||
--
|
||||
ALTER TABLE `ospos_customers`
|
||||
ADD CONSTRAINT `ospos_customers_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_employees`
|
||||
--
|
||||
ALTER TABLE `ospos_employees`
|
||||
ADD CONSTRAINT `ospos_employees_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_inventory`
|
||||
--
|
||||
ALTER TABLE `ospos_inventory`
|
||||
ADD CONSTRAINT `ospos_inventory_ibfk_1` FOREIGN KEY (`trans_items`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_inventory_ibfk_2` FOREIGN KEY (`trans_user`) REFERENCES `ospos_employees` (`person_id`),
|
||||
ADD CONSTRAINT `ospos_inventory_ibfk_3` FOREIGN KEY (`trans_location`) REFERENCES `ospos_stock_locations` (`location_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_items`
|
||||
--
|
||||
ALTER TABLE `ospos_items`
|
||||
ADD CONSTRAINT `ospos_items_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_items_taxes`
|
||||
--
|
||||
ALTER TABLE `ospos_items_taxes`
|
||||
ADD CONSTRAINT `ospos_items_taxes_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_item_kit_items`
|
||||
--
|
||||
ALTER TABLE `ospos_item_kit_items`
|
||||
ADD CONSTRAINT `ospos_item_kit_items_ibfk_1` FOREIGN KEY (`item_kit_id`) REFERENCES `ospos_item_kits` (`item_kit_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_item_kit_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_permissions`
|
||||
--
|
||||
ALTER TABLE `ospos_permissions`
|
||||
ADD CONSTRAINT `ospos_permissions_ibfk_1` FOREIGN KEY (`module_id`) REFERENCES `ospos_modules` (`module_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_permissions_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `ospos_stock_locations` (`location_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_grants`
|
||||
--
|
||||
ALTER TABLE `ospos_grants`
|
||||
ADD CONSTRAINT `ospos_grants_ibfk_1` foreign key (`permission_id`) references `ospos_permissions` (`permission_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_grants_ibfk_2` foreign key (`person_id`) references `ospos_employees` (`person_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_receivings`
|
||||
--
|
||||
ALTER TABLE `ospos_receivings`
|
||||
ADD CONSTRAINT `ospos_receivings_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`),
|
||||
ADD CONSTRAINT `ospos_receivings_ibfk_2` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_receivings_items`
|
||||
--
|
||||
ALTER TABLE `ospos_receivings_items`
|
||||
ADD CONSTRAINT `ospos_receivings_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_receivings_items_ibfk_2` FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings` (`receiving_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales`
|
||||
--
|
||||
ALTER TABLE `ospos_sales`
|
||||
ADD CONSTRAINT `ospos_sales_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`),
|
||||
ADD CONSTRAINT `ospos_sales_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `ospos_customers` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_items`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_items`
|
||||
ADD CONSTRAINT `ospos_sales_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_sales_items_ibfk_2` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_items_ibfk_3` FOREIGN KEY (`item_location`) REFERENCES `ospos_stock_locations` (`location_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_items_taxes`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_items_taxes`
|
||||
ADD CONSTRAINT `ospos_sales_items_taxes_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_items` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_items_taxes_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_payments`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_payments`
|
||||
ADD CONSTRAINT `ospos_sales_payments_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_suspended`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_suspended`
|
||||
ADD CONSTRAINT `ospos_sales_suspended_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`),
|
||||
ADD CONSTRAINT `ospos_sales_suspended_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `ospos_customers` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_suspended_items`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_suspended_items`
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_ibfk_2` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_suspended` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_ibfk_3` FOREIGN KEY (`item_location`) REFERENCES `ospos_stock_locations` (`location_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_suspended_items_taxes`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_suspended_items_taxes`
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_taxes_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_suspended_items` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_taxes_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_suspended_payments`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_suspended_payments`
|
||||
ADD CONSTRAINT `ospos_sales_suspended_payments_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_suspended` (`sale_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_item_quantities`
|
||||
--
|
||||
ALTER TABLE `ospos_item_quantities`
|
||||
ADD CONSTRAINT `ospos_item_quantities_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_item_quantities_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `ospos_stock_locations` (`location_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_suppliers`
|
||||
--
|
||||
ALTER TABLE `ospos_suppliers`
|
||||
ADD CONSTRAINT `ospos_suppliers_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_giftcards`
|
||||
--
|
||||
ALTER TABLE `ospos_giftcards`
|
||||
ADD CONSTRAINT `ospos_giftcards_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`);
|
||||
|
||||
|
||||
964
database/migrate_phppos_dist.sql
Normal file
964
database/migrate_phppos_dist.sql
Normal file
@@ -0,0 +1,964 @@
|
||||
-- >> This file is autogenerated from tables.sql and constraints.sql. Do not modify directly << --
|
||||
--
|
||||
-- Table structure for table `ospos_app_config`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_app_config` (
|
||||
`key` varchar(255) NOT NULL,
|
||||
`value` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`key`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_app_config`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('address', '123 Nowhere street'),
|
||||
('company', 'Open Source Point of Sale'),
|
||||
('default_tax_rate', '8'),
|
||||
('email', 'admin@pappastech.com'),
|
||||
('fax', ''),
|
||||
('phone', '555-555-5555'),
|
||||
('return_policy', 'Test'),
|
||||
('timezone', 'America/New_York'),
|
||||
('website', ''),
|
||||
('recv_invoice_format', '$CO'),
|
||||
('sales_invoice_format', '$CO'),
|
||||
('tax_included', '0'),
|
||||
('invoice_default_comments', 'This is a default comment'),
|
||||
('company_logo', ''),
|
||||
('barcode_content', 'id'),
|
||||
('barcode_type', 'Code39'),
|
||||
('barcode_width', '250'),
|
||||
('barcode_height', '50'),
|
||||
('barcode_quality', '100'),
|
||||
('barcode_font', 'Arial'),
|
||||
('barcode_font_size', '10'),
|
||||
('barcode_first_row', 'category'),
|
||||
('barcode_second_row', 'item_code'),
|
||||
('barcode_third_row', 'unit_price'),
|
||||
('barcode_num_in_row', '2'),
|
||||
('barcode_page_width', '100'),
|
||||
('barcode_page_cellspacing', '20'),
|
||||
('barcode_generate_if_empty', '0'),
|
||||
('receipt_show_taxes', '0'),
|
||||
('use_invoice_template', '1'),
|
||||
('invoice_email_message', 'Dear $CU, In attachment the receipt for sale $INV'),
|
||||
('print_silently', '1'),
|
||||
('print_header', '0'),
|
||||
('print_footer', '0'),
|
||||
('print_top_margin', '0'),
|
||||
('print_left_margin', '0'),
|
||||
('print_bottom_margin', '0'),
|
||||
('print_right_margin', '0'),
|
||||
('default_sales_discount', '0'),
|
||||
('lines_per_page', '25'),
|
||||
('show_total_discount', '1'),
|
||||
('dateformat', 'm/d/Y'),
|
||||
('timeformat', 'H:i:s'),
|
||||
('currency_symbol', '$');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_customers`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_customers` (
|
||||
`person_id` int(10) NOT NULL,
|
||||
`company_name` varchar(255) DEFAULT NULL,
|
||||
`account_number` varchar(255) DEFAULT NULL,
|
||||
`taxable` int(1) NOT NULL DEFAULT '1',
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
UNIQUE KEY `account_number` (`account_number`),
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_customers`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_employees`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_employees` (
|
||||
`username` varchar(255) NOT NULL,
|
||||
`password` varchar(255) NOT NULL,
|
||||
`person_id` int(10) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
UNIQUE KEY `username` (`username`),
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_employees`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`) VALUES
|
||||
('admin', '439a6de57d475c1a0ba9bcb1c39f0af6', 1, 0);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_giftcards`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_giftcards` (
|
||||
`record_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`giftcard_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`giftcard_number` int(10) NOT NULL,
|
||||
`value` decimal(15,2) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`person_id` INT(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`giftcard_id`),
|
||||
UNIQUE KEY `giftcard_number` (`giftcard_number`),
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_giftcards`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_inventory`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_inventory` (
|
||||
`trans_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`trans_items` int(11) NOT NULL DEFAULT '0',
|
||||
`trans_user` int(11) NOT NULL DEFAULT '0',
|
||||
`trans_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`trans_comment` text NOT NULL,
|
||||
`trans_location` int(11) NOT NULL,
|
||||
`trans_inventory` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`trans_id`),
|
||||
KEY `trans_items` (`trans_items`),
|
||||
KEY `trans_user` (`trans_user`),
|
||||
KEY `trans_location` (`trans_location`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_inventory`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_items` (
|
||||
`name` varchar(255) NOT NULL,
|
||||
`category` varchar(255) NOT NULL,
|
||||
`supplier_id` int(11) DEFAULT NULL,
|
||||
`item_number` varchar(255) DEFAULT NULL,
|
||||
`description` varchar(255) NOT NULL,
|
||||
`cost_price` decimal(15,2) NOT NULL,
|
||||
`unit_price` decimal(15,2) NOT NULL,
|
||||
`reorder_level` decimal(15,2) NOT NULL DEFAULT '0',
|
||||
`receiving_quantity` int(11) NOT NULL DEFAULT '1',
|
||||
`item_id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`pic_id` int(10) DEFAULT NULL,
|
||||
`allow_alt_description` tinyint(1) NOT NULL,
|
||||
`is_serialized` tinyint(1) NOT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
`custom1` VARCHAR(25) NOT NULL,
|
||||
`custom2` VARCHAR(25) NOT NULL,
|
||||
`custom3` VARCHAR(25) NOT NULL,
|
||||
`custom4` VARCHAR(25) NOT NULL,
|
||||
`custom5` VARCHAR(25) NOT NULL,
|
||||
`custom6` VARCHAR(25) NOT NULL,
|
||||
`custom7` VARCHAR(25) NOT NULL,
|
||||
`custom8` VARCHAR(25) NOT NULL,
|
||||
`custom9` VARCHAR(25) NOT NULL,
|
||||
`custom10` VARCHAR(25) NOT NULL,
|
||||
PRIMARY KEY (`item_id`),
|
||||
UNIQUE KEY `item_number` (`item_number`),
|
||||
KEY `supplier_id` (`supplier_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_items`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_items_taxes`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_items_taxes` (
|
||||
`item_id` int(10) NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`percent` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`item_id`,`name`,`percent`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_items_taxes`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_item_kits`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_item_kits` (
|
||||
`item_kit_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`description` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`item_kit_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_item_kits`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_item_kit_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_item_kit_items` (
|
||||
`item_kit_id` int(11) NOT NULL,
|
||||
`item_id` int(11) NOT NULL,
|
||||
`quantity` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`item_kit_id`,`item_id`,`quantity`),
|
||||
KEY `ospos_item_kit_items_ibfk_2` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_item_kit_items`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_item_quantities`
|
||||
--
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `ospos_item_quantities` (
|
||||
`item_id` int(11) NOT NULL,
|
||||
`location_id` int(11) NOT NULL,
|
||||
`quantity` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`item_id`,`location_id`),
|
||||
KEY `item_id` (`item_id`),
|
||||
KEY `location_id` (`location_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_modules`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_modules` (
|
||||
`name_lang_key` varchar(255) NOT NULL,
|
||||
`desc_lang_key` varchar(255) NOT NULL,
|
||||
`sort` int(10) NOT NULL,
|
||||
`module_id` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`module_id`),
|
||||
UNIQUE KEY `desc_lang_key` (`desc_lang_key`),
|
||||
UNIQUE KEY `name_lang_key` (`name_lang_key`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_modules`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_modules` (`name_lang_key`, `desc_lang_key`, `sort`, `module_id`) VALUES
|
||||
('module_config', 'module_config_desc', 100, 'config'),
|
||||
('module_customers', 'module_customers_desc', 10, 'customers'),
|
||||
('module_employees', 'module_employees_desc', 80, 'employees'),
|
||||
('module_giftcards', 'module_giftcards_desc', 90, 'giftcards'),
|
||||
('module_items', 'module_items_desc', 20, 'items'),
|
||||
('module_item_kits', 'module_item_kits_desc', 30, 'item_kits'),
|
||||
('module_receivings', 'module_receivings_desc', 60, 'receivings'),
|
||||
('module_reports', 'module_reports_desc', 50, 'reports'),
|
||||
('module_sales', 'module_sales_desc', 70, 'sales'),
|
||||
('module_suppliers', 'module_suppliers_desc', 40, 'suppliers');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_people`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_people` (
|
||||
`first_name` varchar(255) NOT NULL,
|
||||
`last_name` varchar(255) NOT NULL,
|
||||
`gender` int(1) DEFAULT NULL,
|
||||
`phone_number` varchar(255) NOT NULL,
|
||||
`email` varchar(255) NOT NULL,
|
||||
`address_1` varchar(255) NOT NULL,
|
||||
`address_2` varchar(255) NOT NULL,
|
||||
`city` varchar(255) NOT NULL,
|
||||
`state` varchar(255) NOT NULL,
|
||||
`zip` varchar(255) NOT NULL,
|
||||
`country` varchar(255) NOT NULL,
|
||||
`comments` text NOT NULL,
|
||||
`person_id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_people`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_people` (`first_name`, `last_name`, `phone_number`, `email`, `address_1`, `address_2`, `city`, `state`, `zip`, `country`, `comments`, `person_id`) VALUES
|
||||
('John', 'Doe', '555-555-5555', 'admin@pappastech.com', 'Address 1', '', '', '', '', '', '', 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_permissions`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_permissions` (
|
||||
`permission_id` varchar(255) NOT NULL,
|
||||
`module_id` varchar(255) NOT NULL,
|
||||
`location_id` int(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`permission_id`),
|
||||
KEY `module_id` (`module_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_permissions`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`) VALUES
|
||||
('reports_customers', 'reports'),
|
||||
('reports_receivings', 'reports'),
|
||||
('reports_items', 'reports'),
|
||||
('reports_employees', 'reports'),
|
||||
('reports_suppliers', 'reports'),
|
||||
('reports_sales', 'reports'),
|
||||
('reports_discounts', 'reports'),
|
||||
('reports_taxes', 'reports'),
|
||||
('reports_inventory', 'reports'),
|
||||
('reports_categories', 'reports'),
|
||||
('reports_payments', 'reports'),
|
||||
('customers', 'customers'),
|
||||
('employees', 'employees'),
|
||||
('giftcards', 'giftcards'),
|
||||
('items', 'items'),
|
||||
('item_kits', 'item_kits'),
|
||||
('receivings', 'receivings'),
|
||||
('reports', 'reports'),
|
||||
('sales', 'sales'),
|
||||
('config', 'config'),
|
||||
('suppliers', 'suppliers');
|
||||
|
||||
INSERT INTO `ospos_permissions` (`permission_id`, `module_id`, `location_id`) VALUES
|
||||
('items_stock', 'items', 1),
|
||||
('sales_stock', 'sales', 1),
|
||||
('receivings_stock', 'receivings', 1);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_grants`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_grants` (
|
||||
`permission_id` varchar(255) NOT NULL,
|
||||
`person_id` int(10) NOT NULL,
|
||||
PRIMARY KEY (`permission_id`,`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_grants`
|
||||
--
|
||||
-- --------------------------------------------------------
|
||||
|
||||
INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES
|
||||
('reports_customers', 1),
|
||||
('reports_receivings', 1),
|
||||
('reports_items', 1),
|
||||
('reports_inventory', 1),
|
||||
('reports_employees', 1),
|
||||
('reports_suppliers', 1),
|
||||
('reports_sales', 1),
|
||||
('reports_discounts', 1),
|
||||
('reports_taxes', 1),
|
||||
('reports_categories', 1),
|
||||
('reports_payments', 1),
|
||||
('customers', 1),
|
||||
('employees', 1),
|
||||
('giftcards', 1),
|
||||
('items', 1),
|
||||
('item_kits', 1),
|
||||
('receivings', 1),
|
||||
('reports', 1),
|
||||
('sales', 1),
|
||||
('config', 1),
|
||||
('items_stock', 1),
|
||||
('sales_stock', 1),
|
||||
('receivings_stock', 1),
|
||||
('suppliers', 1);
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_receivings`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_receivings` (
|
||||
`receiving_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`supplier_id` int(10) DEFAULT NULL,
|
||||
`employee_id` int(10) NOT NULL DEFAULT '0',
|
||||
`comment` text NOT NULL,
|
||||
`receiving_id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`payment_type` varchar(20) DEFAULT NULL,
|
||||
`invoice_number` varchar(32) DEFAULT NULL,
|
||||
PRIMARY KEY (`receiving_id`),
|
||||
KEY `supplier_id` (`supplier_id`),
|
||||
KEY `employee_id` (`employee_id`),
|
||||
UNIQUE KEY `invoice_number` (`invoice_number`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_receivings`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_receivings_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_receivings_items` (
|
||||
`receiving_id` int(10) NOT NULL DEFAULT '0',
|
||||
`item_id` int(10) NOT NULL DEFAULT '0',
|
||||
`description` varchar(30) DEFAULT NULL,
|
||||
`serialnumber` varchar(30) DEFAULT NULL,
|
||||
`line` int(3) NOT NULL,
|
||||
`quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0',
|
||||
`item_cost_price` decimal(15,2) NOT NULL,
|
||||
`item_unit_price` decimal(15,2) NOT NULL,
|
||||
`discount_percent` decimal(15,2) NOT NULL DEFAULT '0',
|
||||
`item_location` int(11) NOT NULL,
|
||||
`receiving_quantity` int(11) NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY (`receiving_id`,`item_id`,`line`),
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_receivings_items`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales` (
|
||||
`sale_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`customer_id` int(10) DEFAULT NULL,
|
||||
`employee_id` int(10) NOT NULL DEFAULT '0',
|
||||
`comment` text NOT NULL,
|
||||
`invoice_number` varchar(32) DEFAULT NULL,
|
||||
`sale_id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`sale_id`),
|
||||
KEY `customer_id` (`customer_id`),
|
||||
KEY `employee_id` (`employee_id`),
|
||||
KEY `sale_time` (`sale_time`),
|
||||
UNIQUE KEY `invoice_number` (`invoice_number`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_items` (
|
||||
`sale_id` int(10) NOT NULL DEFAULT '0',
|
||||
`item_id` int(10) NOT NULL DEFAULT '0',
|
||||
`description` varchar(30) DEFAULT NULL,
|
||||
`serialnumber` varchar(30) DEFAULT NULL,
|
||||
`line` int(3) NOT NULL DEFAULT '0',
|
||||
`quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0.00',
|
||||
`item_cost_price` decimal(15,2) NOT NULL,
|
||||
`item_unit_price` decimal(15,2) NOT NULL,
|
||||
`discount_percent` decimal(15,2) NOT NULL DEFAULT '0',
|
||||
`item_location` int(11) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`item_id`,`line`),
|
||||
KEY `sale_id` (`sale_id`),
|
||||
KEY `item_id` (`item_id`),
|
||||
KEY `item_location` (`item_location`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_items`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_items_taxes`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_items_taxes` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`item_id` int(10) NOT NULL,
|
||||
`line` int(3) NOT NULL DEFAULT '0',
|
||||
`name` varchar(255) NOT NULL,
|
||||
`percent` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`item_id`,`line`,`name`,`percent`),
|
||||
KEY `sale_id` (`sale_id`),
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_items_taxes`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_payments`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_payments` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`payment_type` varchar(40) NOT NULL,
|
||||
`payment_amount` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`payment_type`),
|
||||
KEY `sale_id` (`sale_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_payments`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_suspended`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended` (
|
||||
`sale_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`customer_id` int(10) DEFAULT NULL,
|
||||
`employee_id` int(10) NOT NULL DEFAULT '0',
|
||||
`comment` text NOT NULL,
|
||||
`invoice_number` varchar(32) DEFAULT NULL,
|
||||
`sale_id` int(10) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`sale_id`),
|
||||
KEY `customer_id` (`customer_id`),
|
||||
KEY `employee_id` (`employee_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_suspended_items`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended_items` (
|
||||
`sale_id` int(10) NOT NULL DEFAULT '0',
|
||||
`item_id` int(10) NOT NULL DEFAULT '0',
|
||||
`description` varchar(30) DEFAULT NULL,
|
||||
`serialnumber` varchar(30) DEFAULT NULL,
|
||||
`line` int(3) NOT NULL DEFAULT '0',
|
||||
`quantity_purchased` decimal(15,2) NOT NULL DEFAULT '0.00',
|
||||
`item_cost_price` decimal(15,2) NOT NULL,
|
||||
`item_unit_price` decimal(15,2) NOT NULL,
|
||||
`discount_percent` decimal(15,2) NOT NULL DEFAULT '0',
|
||||
`item_location` int(11) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`item_id`,`line`),
|
||||
KEY `sale_id` (`sale_id`),
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended_items`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_suspended_items_taxes`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended_items_taxes` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`item_id` int(10) NOT NULL,
|
||||
`line` int(3) NOT NULL DEFAULT '0',
|
||||
`name` varchar(255) NOT NULL,
|
||||
`percent` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`item_id`,`line`,`name`,`percent`),
|
||||
KEY `item_id` (`item_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended_items_taxes`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_suspended_payments`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sales_suspended_payments` (
|
||||
`sale_id` int(10) NOT NULL,
|
||||
`payment_type` varchar(40) NOT NULL,
|
||||
`payment_amount` decimal(15,2) NOT NULL,
|
||||
PRIMARY KEY (`sale_id`,`payment_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_suspended_payments`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sessions`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_sessions` (
|
||||
`session_id` varchar(40) NOT NULL DEFAULT '0',
|
||||
`ip_address` varchar(45) NOT NULL DEFAULT '0',
|
||||
`user_agent` varchar(120) NOT NULL,
|
||||
`last_activity` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`user_data` text,
|
||||
PRIMARY KEY (`session_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sessions`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_stock_locations`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_stock_locations` (
|
||||
`location_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`location_name` varchar(255) DEFAULT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`location_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_stock_locations`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_stock_locations` ( `deleted`, `location_name` ) VALUES ('0', 'stock');
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_suppliers`
|
||||
--
|
||||
|
||||
CREATE TABLE `ospos_suppliers` (
|
||||
`person_id` int(10) NOT NULL,
|
||||
`company_name` varchar(255) NOT NULL,
|
||||
`agency_name` varchar(255) NOT NULL,
|
||||
`account_number` varchar(255) DEFAULT NULL,
|
||||
`deleted` int(1) NOT NULL DEFAULT '0',
|
||||
UNIQUE KEY `account_number` (`account_number`),
|
||||
KEY `person_id` (`person_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_suppliers`
|
||||
--
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- This migration script should be run after creating tables with the regular database script and before applying the constraints.
|
||||
--
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_customers`
|
||||
--
|
||||
INSERT INTO `ospos_customers` (`person_id`, `account_number`, `taxable`, `deleted`) SELECT `person_id`, `account_number`, `taxable`, `deleted` FROM `phppos`.phppos_customers;
|
||||
UPDATE `ospos_customers` c1, `ospos_customers` c2 SET `c1`.`account_number` = NULL WHERE `c1`.`person_id` > `c2`.`person_id` AND `c1`.`account_number` = `c2`.`account_number`;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_employees`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_employees` (`username`, `password`, `person_id`, `deleted`) SELECT `username`, `password`, `person_id`, `deleted` FROM `phppos`.phppos_employees;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_inventory`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_inventory` (`trans_id`, `trans_items`, `trans_user`, `trans_date`, `trans_comment`, `trans_location`, `trans_inventory`)
|
||||
SELECT `trans_id`, `trans_items`, `trans_user`, `trans_date`, `trans_comment`, 1, `trans_inventory` FROM `phppos`.phppos_inventory;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_items`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_items` (`name`, `category`, `supplier_id`, `item_number`, `description`, `cost_price`, `unit_price`, `reorder_level`, `receiving_quantity`, `item_id`, `pic_id`, `allow_alt_description`, `is_serialized`, `deleted`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `custom7`, `custom8`, `custom9`, `custom10`) SELECT `name`, `category`, `supplier_id`, `item_number`, `description`, `cost_price`, `unit_price`, `reorder_level`, 1, `item_id`, NULL, `allow_alt_description`, `is_serialized`, `deleted`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 FROM `phppos`.phppos_items;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_items_taxes`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_items_taxes` (`item_id`, `name`, `percent`) SELECT `item_id`, `name`, `percent` FROM `phppos`.phppos_items_taxes;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_item_kits`
|
||||
--
|
||||
|
||||
-- TODO add query here
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_people`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_people` (`first_name`, `last_name`, `phone_number`, `email`, `address_1`, `address_2`, `city`, `state`, `zip`, `country`, `comments`, `person_id`)
|
||||
SELECT `first_name`, `last_name`, `phone_number`, `email`, `address_1`, `address_2`, `city`, `state`, `zip`, `country`, `comments`, `person_id` FROM `phppos`.phppos_people;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_receivings`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_receivings` (`receiving_time`, `supplier_id`, `employee_id`, `comment`, `receiving_id`, `payment_type`, `invoice_number`)
|
||||
SELECT `receiving_time`, `supplier_id`, `employee_id`, `comment`, `receiving_id`, `payment_type`, NULL FROM `phppos`.phppos_receivings;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_receivings_items`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_receivings_items` (`receiving_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount_percent`)
|
||||
SELECT `receiving_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount_percent` FROM `phppos`.phppos_receivings_items;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_sales` (`sale_time`, `customer_id`, `employee_id`, `comment`, `sale_id`, `invoice_number`)
|
||||
SELECT `sale_time`, `customer_id`, `employee_id`, `comment`, `sale_id`, `invoice_number` FROM `phppos`.phppos_sales;
|
||||
UPDATE `ospos_sales` c1, `ospos_sales` c2 SET `c1`.`invoice_number` = NULL WHERE `c1`.`sale_id` > `c2`.`sale_id` AND `c1`.`invoice_number` = `c2`.`invoice_number`;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_items`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_sales_items` (`sale_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount_percent`, `item_location`)
|
||||
SELECT `sale_id`, `item_id`, `description`, `serialnumber`, `line`, `quantity_purchased`, `item_cost_price`, `item_unit_price`, `discount_percent`, 1 FROM `phppos`.phppos_sales_items;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_items_taxes`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_sales_items_taxes` (`sale_id`, `item_id`, `line`, `name`, `percent`)
|
||||
SELECT `sale_id`, `item_id`, `line`, `name`, `percent` FROM `phppos`.phppos_sales_items_taxes;
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Table structure for table `ospos_sales_payments`
|
||||
--
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_sales_payments`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_sales_payments` (`sale_id`, `payment_type`, `payment_amount`)
|
||||
SELECT `sale_id`, `payment_type`, `payment_amount` FROM `phppos`.phppos_sales_payments;
|
||||
|
||||
INSERT INTO `ospos_stock_locations` ( `deleted`, `location_name` ) VALUES (0, 'stock');
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_item_quantities`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_item_quantities` (`item_id`, `location_id`, `quantity`) SELECT `item_id`, 1, `quantity` FROM `phppos`.`phppos_items`;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_suppliers`
|
||||
--
|
||||
|
||||
INSERT INTO `ospos_suppliers` (`person_id`, `company_name`, `account_number`, `deleted`) SELECT `person_id`, `company_name`, `account_number`, `deleted` FROM `phppos`.phppos_suppliers;
|
||||
|
||||
-- Add constraints on copied data
|
||||
|
||||
--
|
||||
-- Constraints for dumped tables
|
||||
--
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_customers`
|
||||
--
|
||||
ALTER TABLE `ospos_customers`
|
||||
ADD CONSTRAINT `ospos_customers_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_employees`
|
||||
--
|
||||
ALTER TABLE `ospos_employees`
|
||||
ADD CONSTRAINT `ospos_employees_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_inventory`
|
||||
--
|
||||
ALTER TABLE `ospos_inventory`
|
||||
ADD CONSTRAINT `ospos_inventory_ibfk_1` FOREIGN KEY (`trans_items`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_inventory_ibfk_2` FOREIGN KEY (`trans_user`) REFERENCES `ospos_employees` (`person_id`),
|
||||
ADD CONSTRAINT `ospos_inventory_ibfk_3` FOREIGN KEY (`trans_location`) REFERENCES `ospos_stock_locations` (`location_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_items`
|
||||
--
|
||||
ALTER TABLE `ospos_items`
|
||||
ADD CONSTRAINT `ospos_items_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_items_taxes`
|
||||
--
|
||||
ALTER TABLE `ospos_items_taxes`
|
||||
ADD CONSTRAINT `ospos_items_taxes_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_item_kit_items`
|
||||
--
|
||||
ALTER TABLE `ospos_item_kit_items`
|
||||
ADD CONSTRAINT `ospos_item_kit_items_ibfk_1` FOREIGN KEY (`item_kit_id`) REFERENCES `ospos_item_kits` (`item_kit_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_item_kit_items_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_permissions`
|
||||
--
|
||||
ALTER TABLE `ospos_permissions`
|
||||
ADD CONSTRAINT `ospos_permissions_ibfk_1` FOREIGN KEY (`module_id`) REFERENCES `ospos_modules` (`module_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_permissions_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `ospos_stock_locations` (`location_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_grants`
|
||||
--
|
||||
ALTER TABLE `ospos_grants`
|
||||
ADD CONSTRAINT `ospos_grants_ibfk_1` foreign key (`permission_id`) references `ospos_permissions` (`permission_id`) ON DELETE CASCADE,
|
||||
ADD CONSTRAINT `ospos_grants_ibfk_2` foreign key (`person_id`) references `ospos_employees` (`person_id`) ON DELETE CASCADE;
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_receivings`
|
||||
--
|
||||
ALTER TABLE `ospos_receivings`
|
||||
ADD CONSTRAINT `ospos_receivings_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`),
|
||||
ADD CONSTRAINT `ospos_receivings_ibfk_2` FOREIGN KEY (`supplier_id`) REFERENCES `ospos_suppliers` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_receivings_items`
|
||||
--
|
||||
ALTER TABLE `ospos_receivings_items`
|
||||
ADD CONSTRAINT `ospos_receivings_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_receivings_items_ibfk_2` FOREIGN KEY (`receiving_id`) REFERENCES `ospos_receivings` (`receiving_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales`
|
||||
--
|
||||
ALTER TABLE `ospos_sales`
|
||||
ADD CONSTRAINT `ospos_sales_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`),
|
||||
ADD CONSTRAINT `ospos_sales_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `ospos_customers` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_items`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_items`
|
||||
ADD CONSTRAINT `ospos_sales_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_sales_items_ibfk_2` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_items_ibfk_3` FOREIGN KEY (`item_location`) REFERENCES `ospos_stock_locations` (`location_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_items_taxes`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_items_taxes`
|
||||
ADD CONSTRAINT `ospos_sales_items_taxes_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_items` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_items_taxes_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_payments`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_payments`
|
||||
ADD CONSTRAINT `ospos_sales_payments_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales` (`sale_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_suspended`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_suspended`
|
||||
ADD CONSTRAINT `ospos_sales_suspended_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `ospos_employees` (`person_id`),
|
||||
ADD CONSTRAINT `ospos_sales_suspended_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `ospos_customers` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_suspended_items`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_suspended_items`
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_ibfk_2` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_suspended` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_ibfk_3` FOREIGN KEY (`item_location`) REFERENCES `ospos_stock_locations` (`location_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_suspended_items_taxes`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_suspended_items_taxes`
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_taxes_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_suspended_items` (`sale_id`),
|
||||
ADD CONSTRAINT `ospos_sales_suspended_items_taxes_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_sales_suspended_payments`
|
||||
--
|
||||
ALTER TABLE `ospos_sales_suspended_payments`
|
||||
ADD CONSTRAINT `ospos_sales_suspended_payments_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `ospos_sales_suspended` (`sale_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_item_quantities`
|
||||
--
|
||||
ALTER TABLE `ospos_item_quantities`
|
||||
ADD CONSTRAINT `ospos_item_quantities_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `ospos_items` (`item_id`),
|
||||
ADD CONSTRAINT `ospos_item_quantities_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `ospos_stock_locations` (`location_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_suppliers`
|
||||
--
|
||||
ALTER TABLE `ospos_suppliers`
|
||||
ADD CONSTRAINT `ospos_suppliers_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`);
|
||||
|
||||
--
|
||||
-- Constraints for table `ospos_giftcards`
|
||||
--
|
||||
ALTER TABLE `ospos_giftcards`
|
||||
ADD CONSTRAINT `ospos_giftcards_ibfk_1` FOREIGN KEY (`person_id`) REFERENCES `ospos_people` (`person_id`);
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
-- This migration script should be run after creating tables with the regular database script and before applying the constraints.
|
||||
--
|
||||
|
||||
SOURCE tables.sql;
|
||||
|
||||
--
|
||||
-- Dumping data for table `ospos_customers`
|
||||
--
|
||||
@@ -111,4 +109,3 @@ INSERT INTO `ospos_item_quantities` (`item_id`, `location_id`, `quantity`) SELE
|
||||
INSERT INTO `ospos_suppliers` (`person_id`, `company_name`, `account_number`, `deleted`) SELECT `person_id`, `company_name`, `account_number`, `deleted` FROM `phppos`.phppos_suppliers;
|
||||
|
||||
-- Add constraints on copied data
|
||||
SOURCE constraints.sql;
|
||||
|
||||
46529
dist/opensourcepos.js
vendored
46529
dist/opensourcepos.js
vendored
File diff suppressed because one or more lines are too long
27
dist/opensourcepos.min.js
vendored
27
dist/opensourcepos.min.js
vendored
File diff suppressed because one or more lines are too long
9
docker/foreground.sh
Normal file
9
docker/foreground.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
read pid cmd state ppid pgrp session tty_nr tpgid rest < /proc/self/stat
|
||||
trap "kill -TERM -$pgrp; exit" EXIT TERM KILL SIGKILL SIGTERM SIGQUIT
|
||||
|
||||
|
||||
source /etc/apache2/envvars
|
||||
apache2 -D FOREGROUND
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
#!/bin/bash
|
||||
if [ ! -f /mysql-configured ]; then
|
||||
if [ ! -f /app/mysql-configured ]; then
|
||||
/usr/bin/mysqld_safe &
|
||||
sleep 10s
|
||||
MYSQL_PASSWORD=`pwgen -c -n -1 12`
|
||||
echo mysql root password: $MYSQL_PASSWORD
|
||||
echo $MYSQL_PASSWORD > /mysql-root-pw.txt
|
||||
echo $MYSQL_PASSWORD > /app/mysql-root-pw.txt
|
||||
[ -f /var/www/html/index.html ] && rm /var/www/html/index.html
|
||||
mysqladmin -u root password $MYSQL_PASSWORD
|
||||
cp /app/application/config/database.php.tmpl /app/application/config/database.php
|
||||
sed -i "s/\(password...=.\).*/\1'${MYSQL_PASSWORD}';/g" /app/application/config/database.php
|
||||
sed -i -e "s/\(user.*\?=.\).*\(.\)$/\1'root'\2/g" /app/application/config/database.php
|
||||
sed -i -e "s/\(password.*\?=.\).*\(.\)$/\1'${MYSQL_PASSWORD}'\2/g" /app/application/config/database.php
|
||||
sed -i -e "s/\(database.*\?=.\).*\(.\)$/\1'ospos'\2/g" /app/application/config/database.php
|
||||
mysql -e "CREATE DATABASE IF NOT EXISTS ospos; use ospos; source /app/database/tables.sql; source /app/database/constraints.sql;" -uroot -p${MYSQL_PASSWORD}
|
||||
touch /mysql-configured
|
||||
touch /app/mysql-configured
|
||||
killall mysqld
|
||||
sleep 10s
|
||||
fi
|
||||
147
docker/supervisor.conf
Normal file
147
docker/supervisor.conf
Normal file
@@ -0,0 +1,147 @@
|
||||
; Sample supervisor config file.
|
||||
;
|
||||
; For more information on the config file, please see:
|
||||
; http://supervisord.org/configuration.html
|
||||
;
|
||||
; Note: shell expansion ("~" or "$HOME") is not supported. Environment
|
||||
; variables can be expanded using this syntax: "%(ENV_HOME)s".
|
||||
|
||||
[unix_http_server]
|
||||
file=/tmp/supervisor.sock ; (the path to the socket file)
|
||||
;chmod=0700 ; socket file mode (default 0700)
|
||||
;chown=nobody:nogroup ; socket file uid:gid owner
|
||||
;username=user ; (default is no username (open server))
|
||||
;password=123 ; (default is no password (open server))
|
||||
|
||||
;[inet_http_server] ; inet (TCP) server disabled by default
|
||||
;port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface)
|
||||
;username=user ; (default is no username (open server))
|
||||
;password=123 ; (default is no password (open server))
|
||||
|
||||
[supervisord]
|
||||
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
|
||||
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
|
||||
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
|
||||
loglevel=info ; (log level;default info; others: debug,warn,trace)
|
||||
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
|
||||
nodaemon=false ; (start in foreground if true;default false)
|
||||
minfds=1024 ; (min. avail startup file descriptors;default 1024)
|
||||
minprocs=200 ; (min. avail process descriptors;default 200)
|
||||
;umask=022 ; (process file creation umask;default 022)
|
||||
;user=chrism ; (default is current user, required if root)
|
||||
;identifier=supervisor ; (supervisord identifier, default is 'supervisor')
|
||||
;directory=/tmp ; (default is not to cd during start)
|
||||
;nocleanup=true ; (don't clean up tempfiles at start;default false)
|
||||
;childlogdir=/tmp ; ('AUTO' child log dir, default $TEMP)
|
||||
;environment=KEY=value ; (key value pairs to add to environment)
|
||||
;strip_ansi=false ; (strip ansi escape codes in logs; def. false)
|
||||
|
||||
; the below section must remain in the config file for RPC
|
||||
; (supervisorctl/web interface) to work, additional interfaces may be
|
||||
; added by defining them in separate rpcinterface: sections
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
|
||||
;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
|
||||
;username=chris ; should be same as http_username if set
|
||||
;password=123 ; should be same as http_password if set
|
||||
;prompt=mysupervisor ; cmd line prompt (default "supervisor")
|
||||
;history_file=~/.sc_history ; use readline history if available
|
||||
|
||||
; The below sample program section shows all possible program subsection values,
|
||||
; create one or more 'real' program: sections to be able to control them under
|
||||
; supervisor.
|
||||
|
||||
;[program:theprogramname]
|
||||
;command=/bin/cat ; the program (relative uses PATH, can take args)
|
||||
;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
|
||||
;numprocs=1 ; number of processes copies to start (def 1)
|
||||
;directory=/tmp ; directory to cwd to before exec (def no cwd)
|
||||
;umask=022 ; umask for process (default None)
|
||||
;priority=999 ; the relative start priority (default 999)
|
||||
;autostart=true ; start at supervisord start (default: true)
|
||||
;autorestart=unexpected ; whether/when to restart (default: unexpected)
|
||||
;startsecs=1 ; number of secs prog must stay running (def. 1)
|
||||
;startretries=3 ; max # of serial start failures (default 3)
|
||||
;exitcodes=0,2 ; 'expected' exit codes for process (default 0,2)
|
||||
;stopsignal=QUIT ; signal used to kill process (default TERM)
|
||||
;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)
|
||||
;stopasgroup=false ; send stop signal to the UNIX process group (default false)
|
||||
;killasgroup=false ; SIGKILL the UNIX process group (def false)
|
||||
;user=chrism ; setuid to this UNIX account to run the program
|
||||
;redirect_stderr=true ; redirect proc stderr to stdout (default false)
|
||||
;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO
|
||||
;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
|
||||
;stdout_logfile_backups=10 ; # of stdout logfile backups (default 10)
|
||||
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)
|
||||
;stdout_events_enabled=false ; emit events on stdout writes (default false)
|
||||
;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO
|
||||
;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
|
||||
;stderr_logfile_backups=10 ; # of stderr logfile backups (default 10)
|
||||
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)
|
||||
;stderr_events_enabled=false ; emit events on stderr writes (default false)
|
||||
;environment=A=1,B=2 ; process environment additions (def no adds)
|
||||
;serverurl=AUTO ; override serverurl computation (childutils)
|
||||
|
||||
; The below sample eventlistener section shows all possible
|
||||
; eventlistener subsection values, create one or more 'real'
|
||||
; eventlistener: sections to be able to handle event notifications
|
||||
; sent by supervisor.
|
||||
|
||||
;[eventlistener:theeventlistenername]
|
||||
;command=/bin/eventlistener ; the program (relative uses PATH, can take args)
|
||||
;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
|
||||
;numprocs=1 ; number of processes copies to start (def 1)
|
||||
;events=EVENT ; event notif. types to subscribe to (req'd)
|
||||
;buffer_size=10 ; event buffer queue size (default 10)
|
||||
;directory=/tmp ; directory to cwd to before exec (def no cwd)
|
||||
;umask=022 ; umask for process (default None)
|
||||
;priority=-1 ; the relative start priority (default -1)
|
||||
;autostart=true ; start at supervisord start (default: true)
|
||||
;autorestart=unexpected ; whether/when to restart (default: unexpected)
|
||||
;startsecs=1 ; number of secs prog must stay running (def. 1)
|
||||
;startretries=3 ; max # of serial start failures (default 3)
|
||||
;exitcodes=0,2 ; 'expected' exit codes for process (default 0,2)
|
||||
;stopsignal=QUIT ; signal used to kill process (default TERM)
|
||||
;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)
|
||||
;stopasgroup=false ; send stop signal to the UNIX process group (default false)
|
||||
;killasgroup=false ; SIGKILL the UNIX process group (def false)
|
||||
;user=chrism ; setuid to this UNIX account to run the program
|
||||
;redirect_stderr=true ; redirect proc stderr to stdout (default false)
|
||||
;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO
|
||||
;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
|
||||
;stdout_logfile_backups=10 ; # of stdout logfile backups (default 10)
|
||||
;stdout_events_enabled=false ; emit events on stdout writes (default false)
|
||||
;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO
|
||||
;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
|
||||
;stderr_logfile_backups ; # of stderr logfile backups (default 10)
|
||||
;stderr_events_enabled=false ; emit events on stderr writes (default false)
|
||||
;environment=A=1,B=2 ; process environment additions
|
||||
;serverurl=AUTO ; override serverurl computation (childutils)
|
||||
|
||||
; The below sample group section shows all possible group values,
|
||||
; create one or more 'real' group: sections to create "heterogeneous"
|
||||
; process groups.
|
||||
|
||||
;[group:thegroupname]
|
||||
;programs=progname1,progname2 ; each refers to 'x' in [program:x] definitions
|
||||
;priority=999 ; the relative start priority (default 999)
|
||||
|
||||
; The [include] section can just contain the "files" setting. This
|
||||
; setting can list multiple files (separated by whitespace or
|
||||
; newlines). It can also contain wildcards. The filenames are
|
||||
; interpreted as relative to this file. Included files *cannot*
|
||||
; include files themselves.
|
||||
|
||||
;[include]
|
||||
;files = relative/directory/*.ini
|
||||
;mysql and apache2
|
||||
[program:mysqld]
|
||||
command=/usr/bin/mysqld_safe
|
||||
[program:httpd]
|
||||
command=/etc/apache2/foreground.sh
|
||||
stopsignal=6
|
||||
|
||||
|
||||
147
docker/supervisord.conf
Normal file
147
docker/supervisord.conf
Normal file
@@ -0,0 +1,147 @@
|
||||
; Sample supervisor config file.
|
||||
;
|
||||
; For more information on the config file, please see:
|
||||
; http://supervisord.org/configuration.html
|
||||
;
|
||||
; Note: shell expansion ("~" or "$HOME") is not supported. Environment
|
||||
; variables can be expanded using this syntax: "%(ENV_HOME)s".
|
||||
|
||||
[unix_http_server]
|
||||
file=/tmp/supervisor.sock ; (the path to the socket file)
|
||||
;chmod=0700 ; socket file mode (default 0700)
|
||||
;chown=nobody:nogroup ; socket file uid:gid owner
|
||||
;username=user ; (default is no username (open server))
|
||||
;password=123 ; (default is no password (open server))
|
||||
|
||||
;[inet_http_server] ; inet (TCP) server disabled by default
|
||||
;port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface)
|
||||
;username=user ; (default is no username (open server))
|
||||
;password=123 ; (default is no password (open server))
|
||||
|
||||
[supervisord]
|
||||
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
|
||||
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
|
||||
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
|
||||
loglevel=info ; (log level;default info; others: debug,warn,trace)
|
||||
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
|
||||
nodaemon=false ; (start in foreground if true;default false)
|
||||
minfds=1024 ; (min. avail startup file descriptors;default 1024)
|
||||
minprocs=200 ; (min. avail process descriptors;default 200)
|
||||
;umask=022 ; (process file creation umask;default 022)
|
||||
;user=chrism ; (default is current user, required if root)
|
||||
;identifier=supervisor ; (supervisord identifier, default is 'supervisor')
|
||||
;directory=/tmp ; (default is not to cd during start)
|
||||
;nocleanup=true ; (don't clean up tempfiles at start;default false)
|
||||
;childlogdir=/tmp ; ('AUTO' child log dir, default $TEMP)
|
||||
;environment=KEY=value ; (key value pairs to add to environment)
|
||||
;strip_ansi=false ; (strip ansi escape codes in logs; def. false)
|
||||
|
||||
; the below section must remain in the config file for RPC
|
||||
; (supervisorctl/web interface) to work, additional interfaces may be
|
||||
; added by defining them in separate rpcinterface: sections
|
||||
[rpcinterface:supervisor]
|
||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||
|
||||
[supervisorctl]
|
||||
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
|
||||
;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
|
||||
;username=chris ; should be same as http_username if set
|
||||
;password=123 ; should be same as http_password if set
|
||||
;prompt=mysupervisor ; cmd line prompt (default "supervisor")
|
||||
;history_file=~/.sc_history ; use readline history if available
|
||||
|
||||
; The below sample program section shows all possible program subsection values,
|
||||
; create one or more 'real' program: sections to be able to control them under
|
||||
; supervisor.
|
||||
|
||||
;[program:theprogramname]
|
||||
;command=/bin/cat ; the program (relative uses PATH, can take args)
|
||||
;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
|
||||
;numprocs=1 ; number of processes copies to start (def 1)
|
||||
;directory=/tmp ; directory to cwd to before exec (def no cwd)
|
||||
;umask=022 ; umask for process (default None)
|
||||
;priority=999 ; the relative start priority (default 999)
|
||||
;autostart=true ; start at supervisord start (default: true)
|
||||
;autorestart=unexpected ; whether/when to restart (default: unexpected)
|
||||
;startsecs=1 ; number of secs prog must stay running (def. 1)
|
||||
;startretries=3 ; max # of serial start failures (default 3)
|
||||
;exitcodes=0,2 ; 'expected' exit codes for process (default 0,2)
|
||||
;stopsignal=QUIT ; signal used to kill process (default TERM)
|
||||
;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)
|
||||
;stopasgroup=false ; send stop signal to the UNIX process group (default false)
|
||||
;killasgroup=false ; SIGKILL the UNIX process group (def false)
|
||||
;user=chrism ; setuid to this UNIX account to run the program
|
||||
;redirect_stderr=true ; redirect proc stderr to stdout (default false)
|
||||
;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO
|
||||
;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
|
||||
;stdout_logfile_backups=10 ; # of stdout logfile backups (default 10)
|
||||
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)
|
||||
;stdout_events_enabled=false ; emit events on stdout writes (default false)
|
||||
;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO
|
||||
;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
|
||||
;stderr_logfile_backups=10 ; # of stderr logfile backups (default 10)
|
||||
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)
|
||||
;stderr_events_enabled=false ; emit events on stderr writes (default false)
|
||||
;environment=A=1,B=2 ; process environment additions (def no adds)
|
||||
;serverurl=AUTO ; override serverurl computation (childutils)
|
||||
|
||||
; The below sample eventlistener section shows all possible
|
||||
; eventlistener subsection values, create one or more 'real'
|
||||
; eventlistener: sections to be able to handle event notifications
|
||||
; sent by supervisor.
|
||||
|
||||
;[eventlistener:theeventlistenername]
|
||||
;command=/bin/eventlistener ; the program (relative uses PATH, can take args)
|
||||
;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
|
||||
;numprocs=1 ; number of processes copies to start (def 1)
|
||||
;events=EVENT ; event notif. types to subscribe to (req'd)
|
||||
;buffer_size=10 ; event buffer queue size (default 10)
|
||||
;directory=/tmp ; directory to cwd to before exec (def no cwd)
|
||||
;umask=022 ; umask for process (default None)
|
||||
;priority=-1 ; the relative start priority (default -1)
|
||||
;autostart=true ; start at supervisord start (default: true)
|
||||
;autorestart=unexpected ; whether/when to restart (default: unexpected)
|
||||
;startsecs=1 ; number of secs prog must stay running (def. 1)
|
||||
;startretries=3 ; max # of serial start failures (default 3)
|
||||
;exitcodes=0,2 ; 'expected' exit codes for process (default 0,2)
|
||||
;stopsignal=QUIT ; signal used to kill process (default TERM)
|
||||
;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)
|
||||
;stopasgroup=false ; send stop signal to the UNIX process group (default false)
|
||||
;killasgroup=false ; SIGKILL the UNIX process group (def false)
|
||||
;user=chrism ; setuid to this UNIX account to run the program
|
||||
;redirect_stderr=true ; redirect proc stderr to stdout (default false)
|
||||
;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO
|
||||
;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
|
||||
;stdout_logfile_backups=10 ; # of stdout logfile backups (default 10)
|
||||
;stdout_events_enabled=false ; emit events on stdout writes (default false)
|
||||
;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO
|
||||
;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
|
||||
;stderr_logfile_backups ; # of stderr logfile backups (default 10)
|
||||
;stderr_events_enabled=false ; emit events on stderr writes (default false)
|
||||
;environment=A=1,B=2 ; process environment additions
|
||||
;serverurl=AUTO ; override serverurl computation (childutils)
|
||||
|
||||
; The below sample group section shows all possible group values,
|
||||
; create one or more 'real' group: sections to create "heterogeneous"
|
||||
; process groups.
|
||||
|
||||
;[group:thegroupname]
|
||||
;programs=progname1,progname2 ; each refers to 'x' in [program:x] definitions
|
||||
;priority=999 ; the relative start priority (default 999)
|
||||
|
||||
; The [include] section can just contain the "files" setting. This
|
||||
; setting can list multiple files (separated by whitespace or
|
||||
; newlines). It can also contain wildcards. The filenames are
|
||||
; interpreted as relative to this file. Included files *cannot*
|
||||
; include files themselves.
|
||||
|
||||
;[include]
|
||||
;files = relative/directory/*.ini
|
||||
;mysql and apache2
|
||||
[program:mysqld]
|
||||
command=/usr/bin/mysqld_safe
|
||||
[program:httpd]
|
||||
command=/etc/apache2/foreground.sh
|
||||
stopsignal=6
|
||||
|
||||
|
||||
BIN
images/favicon.ico
Normal file
BIN
images/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
344
js/phpjsdate.js
Normal file
344
js/phpjsdate.js
Normal file
@@ -0,0 +1,344 @@
|
||||
/*
|
||||
* Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io)
|
||||
* and Contributors (http://phpjs.org/authors)
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is furnished to do
|
||||
* so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
function phpjsDate(format, timestamp) {
|
||||
// discuss at: http://phpjs.org/functions/date/
|
||||
// original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)
|
||||
// original by: gettimeofday
|
||||
// parts by: Peter-Paul Koch (http://www.quirksmode.org/js/beat.html)
|
||||
// improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
|
||||
// improved by: MeEtc (http://yass.meetcweb.com)
|
||||
// improved by: Brad Touesnard
|
||||
// improved by: Tim Wiel
|
||||
// improved by: Bryan Elliott
|
||||
// improved by: David Randall
|
||||
// improved by: Theriault
|
||||
// improved by: Theriault
|
||||
// improved by: Brett Zamir (http://brett-zamir.me)
|
||||
// improved by: Theriault
|
||||
// improved by: Thomas Beaucourt (http://www.webapp.fr)
|
||||
// improved by: JT
|
||||
// improved by: Theriault
|
||||
// improved by: Rafal Kukawski (http://blog.kukawski.pl)
|
||||
// improved by: Theriault
|
||||
// input by: Brett Zamir (http://brett-zamir.me)
|
||||
// input by: majak
|
||||
// input by: Alex
|
||||
// input by: Martin
|
||||
// input by: Alex Wilson
|
||||
// input by: Haravikk
|
||||
// bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
|
||||
// bugfixed by: majak
|
||||
// bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
|
||||
// bugfixed by: Brett Zamir (http://brett-zamir.me)
|
||||
// bugfixed by: omid (http://phpjs.org/functions/380:380#comment_137122)
|
||||
// bugfixed by: Chris (http://www.devotis.nl/)
|
||||
// note: Uses global: php_js to store the default timezone
|
||||
// note: Although the function potentially allows timezone info (see notes), it currently does not set
|
||||
// note: per a timezone specified by date_default_timezone_set(). Implementers might use
|
||||
// note: this.php_js.currentTimezoneOffset and this.php_js.currentTimezoneDST set by that function
|
||||
// note: in order to adjust the dates in this function (or our other date functions!) accordingly
|
||||
// example 1: date('H:m:s \\m \\i\\s \\m\\o\\n\\t\\h', 1062402400);
|
||||
// returns 1: '09:09:40 m is month'
|
||||
// example 2: date('F j, Y, g:i a', 1062462400);
|
||||
// returns 2: 'September 2, 2003, 2:26 am'
|
||||
// example 3: date('Y W o', 1062462400);
|
||||
// returns 3: '2003 36 2003'
|
||||
// example 4: x = date('Y m d', (new Date()).getTime()/1000);
|
||||
// example 4: (x+'').length == 10 // 2009 01 09
|
||||
// returns 4: true
|
||||
// example 5: date('W', 1104534000);
|
||||
// returns 5: '53'
|
||||
// example 6: date('B t', 1104534000);
|
||||
// returns 6: '999 31'
|
||||
// example 7: date('W U', 1293750000.82); // 2010-12-31
|
||||
// returns 7: '52 1293750000'
|
||||
// example 8: date('W', 1293836400); // 2011-01-01
|
||||
// returns 8: '52'
|
||||
// example 9: date('W Y-m-d', 1293974054); // 2011-01-02
|
||||
// returns 9: '52 2011-01-02'
|
||||
|
||||
var that = this;
|
||||
var jsdate, f;
|
||||
// Keep this here (works, but for code commented-out below for file size reasons)
|
||||
// var tal= [];
|
||||
var txt_words = [
|
||||
'Sun', 'Mon', 'Tues', 'Wednes', 'Thurs', 'Fri', 'Satur',
|
||||
'January', 'February', 'March', 'April', 'May', 'June',
|
||||
'July', 'August', 'September', 'October', 'November', 'December'
|
||||
];
|
||||
// trailing backslash -> (dropped)
|
||||
// a backslash followed by any character (including backslash) -> the character
|
||||
// empty string -> empty string
|
||||
var formatChr = /\\?(.?)/gi;
|
||||
var formatChrCb = function(t, s) {
|
||||
return f[t] ? f[t]() : s;
|
||||
};
|
||||
var _pad = function(n, c) {
|
||||
n = String(n);
|
||||
while (n.length < c) {
|
||||
n = '0' + n;
|
||||
}
|
||||
return n;
|
||||
};
|
||||
f = {
|
||||
// Day
|
||||
d : function() {
|
||||
// Day of month w/leading 0; 01..31
|
||||
return _pad(f.j(), 2);
|
||||
},
|
||||
D : function() {
|
||||
// Shorthand day name; Mon...Sun
|
||||
return f.l()
|
||||
.slice(0, 3);
|
||||
},
|
||||
j : function() {
|
||||
// Day of month; 1..31
|
||||
return jsdate.getDate();
|
||||
},
|
||||
l : function() {
|
||||
// Full day name; Monday...Sunday
|
||||
return txt_words[f.w()] + 'day';
|
||||
},
|
||||
N : function() {
|
||||
// ISO-8601 day of week; 1[Mon]..7[Sun]
|
||||
return f.w() || 7;
|
||||
},
|
||||
S : function() {
|
||||
// Ordinal suffix for day of month; st, nd, rd, th
|
||||
var j = f.j();
|
||||
var i = j % 10;
|
||||
if (i <= 3 && parseInt((j % 100) / 10, 10) == 1) {
|
||||
i = 0;
|
||||
}
|
||||
return ['st', 'nd', 'rd'][i - 1] || 'th';
|
||||
},
|
||||
w : function() {
|
||||
// Day of week; 0[Sun]..6[Sat]
|
||||
return jsdate.getDay();
|
||||
},
|
||||
z : function() {
|
||||
// Day of year; 0..365
|
||||
var a = new Date(f.Y(), f.n() - 1, f.j());
|
||||
var b = new Date(f.Y(), 0, 1);
|
||||
return Math.round((a - b) / 864e5);
|
||||
},
|
||||
|
||||
// Week
|
||||
W : function() {
|
||||
// ISO-8601 week number
|
||||
var a = new Date(f.Y(), f.n() - 1, f.j() - f.N() + 3);
|
||||
var b = new Date(a.getFullYear(), 0, 4);
|
||||
return _pad(1 + Math.round((a - b) / 864e5 / 7), 2);
|
||||
},
|
||||
|
||||
// Month
|
||||
F : function() {
|
||||
// Full month name; January...December
|
||||
return txt_words[6 + f.n()];
|
||||
},
|
||||
m : function() {
|
||||
// Month w/leading 0; 01...12
|
||||
return _pad(f.n(), 2);
|
||||
},
|
||||
M : function() {
|
||||
// Shorthand month name; Jan...Dec
|
||||
return f.F()
|
||||
.slice(0, 3);
|
||||
},
|
||||
n : function() {
|
||||
// Month; 1...12
|
||||
return jsdate.getMonth() + 1;
|
||||
},
|
||||
t : function() {
|
||||
// Days in month; 28...31
|
||||
return (new Date(f.Y(), f.n(), 0))
|
||||
.getDate();
|
||||
},
|
||||
|
||||
// Year
|
||||
L : function() {
|
||||
// Is leap year?; 0 or 1
|
||||
var j = f.Y();
|
||||
return j % 4 === 0 & j % 100 !== 0 | j % 400 === 0;
|
||||
},
|
||||
o : function() {
|
||||
// ISO-8601 year
|
||||
var n = f.n();
|
||||
var W = f.W();
|
||||
var Y = f.Y();
|
||||
return Y + (n === 12 && W < 9 ? 1 : n === 1 && W > 9 ? -1 : 0);
|
||||
},
|
||||
Y : function() {
|
||||
// Full year; e.g. 1980...2010
|
||||
return jsdate.getFullYear();
|
||||
},
|
||||
y : function() {
|
||||
// Last two digits of year; 00...99
|
||||
return f.Y()
|
||||
.toString()
|
||||
.slice(-2);
|
||||
},
|
||||
|
||||
// Time
|
||||
a : function() {
|
||||
// am or pm
|
||||
return jsdate.getHours() > 11 ? 'pm' : 'am';
|
||||
},
|
||||
A : function() {
|
||||
// AM or PM
|
||||
return f.a()
|
||||
.toUpperCase();
|
||||
},
|
||||
B : function() {
|
||||
// Swatch Internet time; 000..999
|
||||
var H = jsdate.getUTCHours() * 36e2;
|
||||
// Hours
|
||||
var i = jsdate.getUTCMinutes() * 60;
|
||||
// Minutes
|
||||
// Seconds
|
||||
var s = jsdate.getUTCSeconds();
|
||||
return _pad(Math.floor((H + i + s + 36e2) / 86.4) % 1e3, 3);
|
||||
},
|
||||
g : function() {
|
||||
// 12-Hours; 1..12
|
||||
return f.G() % 12 || 12;
|
||||
},
|
||||
G : function() {
|
||||
// 24-Hours; 0..23
|
||||
return jsdate.getHours();
|
||||
},
|
||||
h : function() {
|
||||
// 12-Hours w/leading 0; 01..12
|
||||
return _pad(f.g(), 2);
|
||||
},
|
||||
H : function() {
|
||||
// 24-Hours w/leading 0; 00..23
|
||||
return _pad(f.G(), 2);
|
||||
},
|
||||
i : function() {
|
||||
// Minutes w/leading 0; 00..59
|
||||
return _pad(jsdate.getMinutes(), 2);
|
||||
},
|
||||
s : function() {
|
||||
// Seconds w/leading 0; 00..59
|
||||
return _pad(jsdate.getSeconds(), 2);
|
||||
},
|
||||
u : function() {
|
||||
// Microseconds; 000000-999000
|
||||
return _pad(jsdate.getMilliseconds() * 1000, 6);
|
||||
},
|
||||
|
||||
// Timezone
|
||||
e : function() {
|
||||
// Timezone identifier; e.g. Atlantic/Azores, ...
|
||||
// The following works, but requires inclusion of the very large
|
||||
// timezone_abbreviations_list() function.
|
||||
/* return that.date_default_timezone_get();
|
||||
*/
|
||||
throw 'Not supported (see source code of date() for timezone on how to add support)';
|
||||
},
|
||||
I : function() {
|
||||
// DST observed?; 0 or 1
|
||||
// Compares Jan 1 minus Jan 1 UTC to Jul 1 minus Jul 1 UTC.
|
||||
// If they are not equal, then DST is observed.
|
||||
var a = new Date(f.Y(), 0);
|
||||
// Jan 1
|
||||
var c = Date.UTC(f.Y(), 0);
|
||||
// Jan 1 UTC
|
||||
var b = new Date(f.Y(), 6);
|
||||
// Jul 1
|
||||
// Jul 1 UTC
|
||||
var d = Date.UTC(f.Y(), 6);
|
||||
return ((a - c) !== (b - d)) ? 1 : 0;
|
||||
},
|
||||
O : function() {
|
||||
// Difference to GMT in hour format; e.g. +0200
|
||||
var tzo = jsdate.getTimezoneOffset();
|
||||
var a = Math.abs(tzo);
|
||||
return (tzo > 0 ? '-' : '+') + _pad(Math.floor(a / 60) * 100 + a % 60, 4);
|
||||
},
|
||||
P : function() {
|
||||
// Difference to GMT w/colon; e.g. +02:00
|
||||
var O = f.O();
|
||||
return (O.substr(0, 3) + ':' + O.substr(3, 2));
|
||||
},
|
||||
T : function() {
|
||||
// Timezone abbreviation; e.g. EST, MDT, ...
|
||||
// The following works, but requires inclusion of the very
|
||||
// large timezone_abbreviations_list() function.
|
||||
/* var abbr, i, os, _default;
|
||||
if (!tal.length) {
|
||||
tal = that.timezone_abbreviations_list();
|
||||
}
|
||||
if (that.php_js && that.php_js.default_timezone) {
|
||||
_default = that.php_js.default_timezone;
|
||||
for (abbr in tal) {
|
||||
for (i = 0; i < tal[abbr].length; i++) {
|
||||
if (tal[abbr][i].timezone_id === _default) {
|
||||
return abbr.toUpperCase();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (abbr in tal) {
|
||||
for (i = 0; i < tal[abbr].length; i++) {
|
||||
os = -jsdate.getTimezoneOffset() * 60;
|
||||
if (tal[abbr][i].offset === os) {
|
||||
return abbr.toUpperCase();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
return 'UTC';
|
||||
},
|
||||
Z : function() {
|
||||
// Timezone offset in seconds (-43200...50400)
|
||||
return -jsdate.getTimezoneOffset() * 60;
|
||||
},
|
||||
|
||||
// Full Date/Time
|
||||
c : function() {
|
||||
// ISO-8601 date.
|
||||
return 'Y-m-d\\TH:i:sP'.replace(formatChr, formatChrCb);
|
||||
},
|
||||
r : function() {
|
||||
// RFC 2822
|
||||
return 'D, d M Y H:i:s O'.replace(formatChr, formatChrCb);
|
||||
},
|
||||
U : function() {
|
||||
// Seconds since UNIX epoch
|
||||
return jsdate / 1000 | 0;
|
||||
}
|
||||
};
|
||||
this.date = function(format, timestamp) {
|
||||
that = this;
|
||||
jsdate = (timestamp === undefined ? new Date() : // Not provided
|
||||
(timestamp instanceof Date) ? new Date(timestamp) : // JS Date()
|
||||
new Date(timestamp * 1000) // UNIX timestamp (auto-convert to int)
|
||||
);
|
||||
return format.replace(formatChr, formatChrCb);
|
||||
};
|
||||
return this.date(format, timestamp);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "opensourcepos",
|
||||
"version": "2.4.0",
|
||||
"version": "2.3.3",
|
||||
"description": "Open Source Point of Sale is a web based point of sale system written in the PHP language. It uses MySQL as the data storage back-end and has a simple user interface.",
|
||||
"main": "index.php",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,40 +1,22 @@
|
||||
var assert = require("assert"); // node.js core module
|
||||
var ospos = require("./ospos");
|
||||
|
||||
describe("giftcard numbering test", function () {
|
||||
|
||||
var server = "http://localhost/pos";
|
||||
|
||||
var url = function url(suffix) {
|
||||
return server + suffix + "?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=14241668456852'";
|
||||
};
|
||||
this.timeout(25000);
|
||||
|
||||
it("should be able to login", function (done) {
|
||||
return this.browser.get(url("/index.php"))
|
||||
.elementByName('username').type("admin").getValue()
|
||||
.then(function(value) {
|
||||
assert.equal(value, "admin");
|
||||
})
|
||||
.elementByName('password').type("pointofsale").getValue()
|
||||
.then(function(value) {
|
||||
assert.ok(value, "pointofsale");
|
||||
})
|
||||
.elementByName('loginButton').click()
|
||||
.elementById('home_module_list').then(function(value) {
|
||||
assert.ok(value, "Login failed!!")
|
||||
})
|
||||
.then(done, done);
|
||||
|
||||
return ospos.login(this.browser, done);
|
||||
});
|
||||
|
||||
it.skip("issue #65: giftcard numbering should add properly", function() {
|
||||
return this.browser.get(url("/index.php/giftcards")).waitForElementByCss(".big_button").click()
|
||||
.waitForElementByName("value", 4000).type("100").elementById('giftcard_number').clear().type("10")
|
||||
it("issue #65: giftcard numbering should add properly", function(done) {
|
||||
return this.browser.get(ospos.url("/index.php/giftcards")).waitForElementByCss(".big_button").click()
|
||||
.waitForElementByName("value", 10000).type("100").elementById('giftcard_number').clear().type("10")
|
||||
.elementById("submit").click().waitForElementByXPath("//table/tbody/tr[td/text()='10']/td[4]", 2000).text().then(function (value) {
|
||||
assert.ok(value, "giftcard failed to be added properly!");
|
||||
}).elementByCss(".big_button").click().waitForElementByName("value", 4000).type("100").elementById("submit").click()
|
||||
.waitForElementByXPath("//table/tbody/tr[td/text()='11']/td[4]").text().then(function (value) {
|
||||
assert.equal(value, "11", "giftcard number not incrementing properly!!");
|
||||
});
|
||||
}).then(done, done);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
exports.loginFirst = function() {
|
||||
|
||||
}
|
||||
42
test/make_sale_receiving.js
Normal file
42
test/make_sale_receiving.js
Normal file
@@ -0,0 +1,42 @@
|
||||
var assert = require('assert');
|
||||
var ospos = require('./ospos');
|
||||
|
||||
describe("create item and make sale", function () {
|
||||
this.timeout(25000);
|
||||
|
||||
var def_timeout = 3000;
|
||||
|
||||
var item = {name: "anItem", category: "aCategory", cost_price: 10, unit_price: 20};
|
||||
|
||||
it("should be able to add item", function (done) {
|
||||
return ospos.create_item(this.browser, item).then(done, done);
|
||||
});
|
||||
|
||||
it("should be able to make sale", function(done) {
|
||||
return this.browser.get(ospos.url("/index.php/sales"))
|
||||
.elementById("item", def_timeout).type("1\r\n")
|
||||
.waitForElementByName("quantity", def_timeout).clear().type("2").elementByName("discount", def_timeout).type(item.cost_price).elementByName("edit_item").click()
|
||||
.elementById("add_payment_button", def_timeout).click().elementByCssSelector("tbody#payment_contents tr td:last-child", def_timeout).text().then(function(value) {
|
||||
assert.equal(value, "$43.56", "price " + value + " in sale register is not correct!!");
|
||||
}).elementById("finish_sale_button", def_timeout).submit().elementByCssSelector("#receipt_items tbody tr:nth-child(7) td:last-child", def_timeout).text().then(function(value) {
|
||||
assert.equal(value, "$43.56", "price " + value + " on sale receipt is not correct!!");
|
||||
}).elementByCssSelector("#receipt_items tbody tr:nth-child(9) td:last-child div.total-value", def_timeout).text().then(function(value) {
|
||||
assert.equal(value, "-$43.56", "payment amount " + value + " on sale receipt is not correct!!")
|
||||
}).then(done, done);
|
||||
});
|
||||
|
||||
|
||||
it("should be able to make receiving", function(done) {
|
||||
return this.browser.get(ospos.url("/index.php/receivings"))
|
||||
.elementById("item", def_timeout).type("1\r\n")
|
||||
.waitForElementByName("quantity", def_timeout).clear().type("2").elementByName("edit_item").click()
|
||||
.elementByCssSelector("td:nth-last-child(2)").text().then(function(value) {
|
||||
assert.equal(value, "$20.00", "price " + value + " in receiving register is not correct!!");
|
||||
}).elementById("finish_receiving_button").submit().elementByCssSelector("#receipt_items tbody tr:nth-last-child(2) td:nth-child(2) div.total-value").text().then(function(value) {
|
||||
assert.equal(value, "$20.00", "price " + value + " on receiving receipt is not correct!!");
|
||||
})
|
||||
.then(done, done);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
47
test/ospos.js
Normal file
47
test/ospos.js
Normal file
@@ -0,0 +1,47 @@
|
||||
var assert = require('assert');
|
||||
|
||||
var ospos = function() {
|
||||
|
||||
var server = "http://localhost/index.php";
|
||||
|
||||
return {
|
||||
|
||||
url : function(suffix) {
|
||||
return server + suffix;
|
||||
}
|
||||
,
|
||||
login : function(browser, done) {
|
||||
return browser.get(this.url("/index.php"))
|
||||
.elementByName('username').type("admin").getValue()
|
||||
.then(function (value) {
|
||||
assert.equal(value, "admin");
|
||||
})
|
||||
.elementByName('password').type("pointofsale").getValue()
|
||||
.then(function (value) {
|
||||
assert.ok(value, "pointofsale");
|
||||
})
|
||||
.elementByName('loginButton').click()
|
||||
.elementById('home_module_list').then(function (value) {
|
||||
assert.ok(value, "Login failed!!")
|
||||
})
|
||||
.then(done, done);
|
||||
|
||||
},
|
||||
|
||||
create_item : function(browser, item)
|
||||
{
|
||||
return browser.get(this.url("/index.php/items")).elementByCssSelector("a[title='New Item']", 5000).click()
|
||||
.waitForElementByName("name", 10000).type(item.name).elementById("category").type(item.category)
|
||||
.elementById('cost_price', 2000).clear().type(item.cost_price).elementById("unit_price", 2000).type(item.unit_price)
|
||||
.elementById('tax_name_1', 2000).type('VAT').elementById("tax_percent_name_1", 2000).type("21")
|
||||
.elementById('receiving_quantity', 2000).type(item.receiving_quantity || 1)
|
||||
.elementById("1_quantity", 2000).type("1").elementById("reorder_level", 2000).type("0").elementById("submit", 2000).click()
|
||||
.waitForElementByXPath("//table/tbody/tr[td/text()='anItem']/td[3]").text().then(function (value) {
|
||||
assert.equal(value, "anItem", "item " + item.name + " could not be created!!");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = ospos();
|
||||
31
test/receiving_quantity.js
Normal file
31
test/receiving_quantity.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var assert = require('assert');
|
||||
var ospos = require('./ospos');
|
||||
|
||||
describe("test receiving quantity", function() {
|
||||
|
||||
var def_timeout = 5000;
|
||||
|
||||
var item = {
|
||||
name: "recvQty",
|
||||
category: "aCategory",
|
||||
cost_price: 10,
|
||||
unit_price: 20,
|
||||
receiving_quantity: 2
|
||||
};
|
||||
|
||||
it("should be able to creaate item with receiving quantity", function(done) {
|
||||
return ospos.create_item(this.browser, item).then(done, done);
|
||||
});
|
||||
|
||||
it("should be able to receive quantities with multiplier", function(done) {
|
||||
this.browser.get(ospos.url('/index.php/receivings')).elementById("item").type(item.name)
|
||||
.waitForElementByCssSelector(".ac_even", def_timeout).click().waitForElementByName("quantity", def_timeout)
|
||||
.elementByCssSelector("#cart_contents tr td:nth-child(5)").text().then(function(value) {
|
||||
assert(value, "x " + item.receiving_quantity, "receiving quantity " + item.receiving_quantity + " is not displayed correctly in receivings module!");
|
||||
}).elementById("finish_receiving_button", def_timeout).submit()
|
||||
.elementByCssSelector("#receipt_items tr:nth-child(2) td:nth-last-child(2)", def_timeout).text().then(function(value) {
|
||||
assert(value, "1 x " + item.receiving_quantity, "receiving quantity " + item.receiving_quantity + " is not displayed correctly on receipt!!");
|
||||
}).then(done, done);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -1,21 +0,0 @@
|
||||
Alias /pos %TRAVIS_BUILD_DIR%
|
||||
<VirtualHost *:80>
|
||||
|
||||
DocumentRoot %TRAVIS_BUILD_DIR%
|
||||
|
||||
<Directory "%TRAVIS_BUILD_DIR%">
|
||||
Options FollowSymLinks MultiViews ExecCGI
|
||||
AllowOverride All
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</Directory>
|
||||
|
||||
# Wire up Apache to use Travis CI's php-fpm.
|
||||
<IfModule mod_fastcgi.c>
|
||||
AddHandler php5-fcgi .php
|
||||
Action php5-fcgi /php5-fcgi
|
||||
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
|
||||
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
|
||||
</IfModule>
|
||||
|
||||
</VirtualHost>
|
||||
Reference in New Issue
Block a user