Compare commits
5 commits
demo
...
8_increase
Author | SHA1 | Date | |
---|---|---|---|
|
b78e6a93e2 | ||
|
54e11dc838 | ||
|
afd82a4901 | ||
|
33eec7aa25 | ||
|
f2965e6673 |
145
.drone.yml
|
@ -1,145 +0,0 @@
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: build and test
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: rubocop
|
|
||||||
image: circleci/ruby:2.7-bullseye-node-browsers-legacy
|
|
||||||
commands:
|
|
||||||
- sudo apt install --no-install-recommends -y libmagic-dev
|
|
||||||
- sudo -E bundle install
|
|
||||||
- sudo -E bundle exec rubocop
|
|
||||||
volumes:
|
|
||||||
- name: gem-cache
|
|
||||||
path: /bundle
|
|
||||||
- name: tmp
|
|
||||||
path: /drone/src/tmp
|
|
||||||
failure: ignore
|
|
||||||
|
|
||||||
|
|
||||||
- name: build_test
|
|
||||||
image: circleci/ruby:2.7-bullseye-node-browsers-legacy
|
|
||||||
commands:
|
|
||||||
- sudo apt install --no-install-recommends -y libmagic-dev
|
|
||||||
- echo 'Wait for db container'; sleep 30
|
|
||||||
- bundle config set path '/bundle'
|
|
||||||
- bundle config set without 'production'
|
|
||||||
- sudo -E bundle install
|
|
||||||
- sudo -E bundle exec rake foodsoft:setup_development_docker || true
|
|
||||||
- sudo -E bundle exec rake rspec-rerun:spec
|
|
||||||
volumes:
|
|
||||||
- name: gem-cache
|
|
||||||
path: /bundle
|
|
||||||
- name: tmp
|
|
||||||
path: /drone/src/tmp
|
|
||||||
environment:
|
|
||||||
RAILS_LOG_TO_STDOUT: true
|
|
||||||
RAILS_ENV: test
|
|
||||||
COVERAGE: lcov
|
|
||||||
DATABASE_URL: mysql2://user:password@mariadb/test?encoding=utf8mb4
|
|
||||||
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: true
|
|
||||||
PARALLEL_TEST_PROCESSORS: 60
|
|
||||||
|
|
||||||
services:
|
|
||||||
- name: mariadb
|
|
||||||
image: mariadb
|
|
||||||
environment:
|
|
||||||
MYSQL_USER: user
|
|
||||||
MYSQL_PASSWORD: password
|
|
||||||
MYSQL_DATABASE: test
|
|
||||||
MYSQL_ROOT_PASSWORD: password
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- name: gem-cache
|
|
||||||
host:
|
|
||||||
path: /tmp/cache
|
|
||||||
- name: tmp
|
|
||||||
temp: {}
|
|
||||||
---
|
|
||||||
|
|
||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: docker build and deploy
|
|
||||||
steps:
|
|
||||||
- name: build and publish docker image
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
registry: git.local-it.org
|
|
||||||
repo: git.local-it.org/foodsoft/foodsoft
|
|
||||||
username: philipp
|
|
||||||
password:
|
|
||||||
from_secret: docker_registry
|
|
||||||
tags:
|
|
||||||
- latest
|
|
||||||
- ${DRONE_BRANCH}
|
|
||||||
- ${DRONE_COMMIT:0:8}
|
|
||||||
cache_from:
|
|
||||||
- "git.local-it.org/foodsoft/foodsoft:latest"
|
|
||||||
- "git.local-it.org/foodsoft/foodsoft:${DRONE_BRANCH}"
|
|
||||||
- name: deployment
|
|
||||||
image: git.local-it.org/philipp/stack-ssh-deply:latest
|
|
||||||
settings:
|
|
||||||
stack: "foodsoft_${DRONE_BRANCH}"
|
|
||||||
compose: "deployment/compose.yml"
|
|
||||||
deploy_key:
|
|
||||||
from_secret: drone_deploy_key
|
|
||||||
host: "dev.local-it.cloud"
|
|
||||||
user: "root"
|
|
||||||
port: 22
|
|
||||||
reg_user: philipp
|
|
||||||
reg_pass:
|
|
||||||
from_secret: docker_registry
|
|
||||||
reg_url: git.local-it.org
|
|
||||||
image: git.local-it.org/foodsoft/foodsoft:${DRONE_COMMIT:0:8}
|
|
||||||
generate_secrets: true
|
|
||||||
networks:
|
|
||||||
- proxy
|
|
||||||
environment:
|
|
||||||
IMAGE: git.local-it.org/foodsoft/foodsoft:${DRONE_COMMIT:0:8}
|
|
||||||
STACK_NAME: "foodsoft_${DRONE_BRANCH}"
|
|
||||||
DOMAIN: "foodsoft.dev.local-it.cloud"
|
|
||||||
LETS_ENCRYPT_ENV: production
|
|
||||||
FOODCOOP_MULTI_INSTALL: true
|
|
||||||
FOODCOOP_NAME: Einkaufskooperative Foobar
|
|
||||||
FOODCOOP_CITY: Berlin
|
|
||||||
FOODCOOP_COUNTRY: Deutschland
|
|
||||||
FOODCOOP_EMAIL: foodsoft@local-it.org
|
|
||||||
FOODCOOP_PHONE: 123456789
|
|
||||||
FOODCOOP_STREET: Einkaufsstraße 5
|
|
||||||
FOODCOOP_ZIP_CODE: 12345
|
|
||||||
FOODCOOP_HOMEPAGE: https://foodsoft.local-it.org
|
|
||||||
FOODCOOP_HELP_URL: https://git.local-it.org/foodsoft/foodsoft
|
|
||||||
FOODCOOP_TIME_ZONE: Berlin
|
|
||||||
FOODCOOP_USE_NICK: true
|
|
||||||
FOODCOOP_LANGUAGE: de
|
|
||||||
FOODCOOP_FOOTER: '<a href="https://foodsoft.local-it.org/">Foodsoft</a> hosted by <a href="https://local-it.org">local-it e,V,</a>.'
|
|
||||||
USE_APPLE_POINTS: false
|
|
||||||
STOP_ORDERING_UNDER: 75
|
|
||||||
MINIMUM_BALANCE: 0
|
|
||||||
MYSQL_DB: foodsoft
|
|
||||||
MYSQL_HOST: db
|
|
||||||
MYSQL_PORT: 3306
|
|
||||||
MYSQL_USER: foodsoft
|
|
||||||
EMAIL_SENDER: demo@local-it.org
|
|
||||||
EMAIL_ERROR: flip@yksflip.de
|
|
||||||
SMTP_ADDRESS: mail.local-it.org
|
|
||||||
SMTP_AUTHENTICATION: login
|
|
||||||
SMTP_DOMAIN: mail.local-it.org
|
|
||||||
SMTP_ENABLE_STARTTLS_AUTO: true
|
|
||||||
SMTP_PORT: 587
|
|
||||||
SMTP_USER_NAME: demo@local-it.org
|
|
||||||
EMAIL_REPLY_DOMAIN:
|
|
||||||
SMTP_SERVER_HOST: 0.0.0.0
|
|
||||||
SMTP_SERVER_PORT: 2525
|
|
||||||
SECRET_DB_PASSWORD_VERSION: v1
|
|
||||||
SECRET_DB_ROOT_PASSWORD_VERSION: v1
|
|
||||||
SECRET_SHARED_LISTS_DB_PASSWORD_VERSION: v1
|
|
||||||
SECRET_SMTP_PASSWORD_VERSION: v1
|
|
||||||
SECRET_SECRET_KEY_BASE_VERSION: v1
|
|
||||||
APP_CONFIG_VERSION: v1
|
|
||||||
DB_CONFIG_VERSION: v1
|
|
||||||
ENTRYPOINT_VERSION: v1
|
|
||||||
PRODUCTION_ENV_VERSION: v1
|
|
||||||
trigger:
|
|
||||||
branch:
|
|
||||||
- demo
|
|
|
@ -266,7 +266,7 @@ Metrics/AbcSize:
|
||||||
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods, inherit_mode.
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods, inherit_mode.
|
||||||
# AllowedMethods: refine
|
# AllowedMethods: refine
|
||||||
Metrics/BlockLength:
|
Metrics/BlockLength:
|
||||||
Max: 212
|
Max: 210
|
||||||
|
|
||||||
# Offense count: 6
|
# Offense count: 6
|
||||||
# Configuration parameters: CountBlocks.
|
# Configuration parameters: CountBlocks.
|
||||||
|
@ -451,24 +451,6 @@ RSpec/DescribedClass:
|
||||||
- "spec/models/ordergroup_spec.rb"
|
- "spec/models/ordergroup_spec.rb"
|
||||||
- "spec/models/user_spec.rb"
|
- "spec/models/user_spec.rb"
|
||||||
|
|
||||||
# Offense count: 15
|
|
||||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
||||||
RSpec/EmptyExampleGroup:
|
|
||||||
Exclude:
|
|
||||||
- 'spec/requests/api/article_categories_spec.rb'
|
|
||||||
- 'spec/requests/api/configs_spec.rb'
|
|
||||||
- 'spec/requests/api/financial_transaction_classes_spec.rb'
|
|
||||||
- 'spec/requests/api/financial_transaction_types_spec.rb'
|
|
||||||
- 'spec/requests/api/financial_transactions_spec.rb'
|
|
||||||
- 'spec/requests/api/navigations_spec.rb'
|
|
||||||
- 'spec/requests/api/order_articles_spec.rb'
|
|
||||||
- 'spec/requests/api/orders_spec.rb'
|
|
||||||
- 'spec/requests/api/user/financial_transactions_spec.rb'
|
|
||||||
- 'spec/requests/api/user/group_order_articles_spec.rb'
|
|
||||||
- 'spec/requests/api/user/users_spec.rb'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Offense count: 65
|
# Offense count: 65
|
||||||
# Configuration parameters: CountAsOne.
|
# Configuration parameters: CountAsOne.
|
||||||
RSpec/ExampleLength:
|
RSpec/ExampleLength:
|
||||||
|
@ -599,14 +581,6 @@ RSpec/ScatteredSetup:
|
||||||
- "spec/integration/balancing_spec.rb"
|
- "spec/integration/balancing_spec.rb"
|
||||||
- "spec/integration/login_spec.rb"
|
- "spec/integration/login_spec.rb"
|
||||||
|
|
||||||
# Offense count: 4
|
|
||||||
# Configuration parameters: AllowedPatterns, IgnoredPatterns.
|
|
||||||
# SupportedStyles: snake_case, camelCase
|
|
||||||
RSpec/VariableName:
|
|
||||||
EnforcedStyle: snake_case
|
|
||||||
AllowedPatterns:
|
|
||||||
- ^Authorization$
|
|
||||||
|
|
||||||
# Offense count: 1
|
# Offense count: 1
|
||||||
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
|
||||||
RSpec/VerifiedDoubles:
|
RSpec/VerifiedDoubles:
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2.7.2
|
2.6.9
|
||||||
|
|
14
Dockerfile
|
@ -1,4 +1,4 @@
|
||||||
FROM ruby:2.7
|
FROM ruby:2.6
|
||||||
|
|
||||||
RUN supercronicUrl=https://github.com/aptible/supercronic/releases/download/v0.1.3/supercronic-linux-amd64 && \
|
RUN supercronicUrl=https://github.com/aptible/supercronic/releases/download/v0.1.3/supercronic-linux-amd64 && \
|
||||||
supercronicBin=/usr/local/bin/supercronic && \
|
supercronicBin=/usr/local/bin/supercronic && \
|
||||||
|
@ -15,16 +15,13 @@ ENV PORT=3000 \
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
COPY Gemfile Gemfile.lock ./
|
COPY . ./
|
||||||
COPY plugins/ ./plugins
|
|
||||||
COPY config/ ./config
|
|
||||||
|
|
||||||
# install dependencies and generate crontab
|
# install dependencies and generate crontab
|
||||||
RUN buildDeps='libmagic-dev' && \
|
RUN buildDeps='libmagic-dev' && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install --no-install-recommends -y $buildDeps && \
|
apt-get install --no-install-recommends -y $buildDeps && \
|
||||||
echo 'gem: --no-document' >> ~/.gemrc && \
|
echo 'gem: --no-document' >> ~/.gemrc && \
|
||||||
gem install bundler && \
|
|
||||||
bundle config build.nokogiri "--use-system-libraries" && \
|
bundle config build.nokogiri "--use-system-libraries" && \
|
||||||
bundle install --deployment --without development test -j 4 && \
|
bundle install --deployment --without development test -j 4 && \
|
||||||
apt-get purge -y --auto-remove $buildDeps && \
|
apt-get purge -y --auto-remove $buildDeps && \
|
||||||
|
@ -32,8 +29,6 @@ RUN buildDeps='libmagic-dev' && \
|
||||||
\
|
\
|
||||||
bundle exec whenever >crontab
|
bundle exec whenever >crontab
|
||||||
|
|
||||||
COPY . ./
|
|
||||||
|
|
||||||
# compile assets with temporary mysql server
|
# compile assets with temporary mysql server
|
||||||
RUN export DATABASE_URL=mysql2://localhost/temp?encoding=utf8 && \
|
RUN export DATABASE_URL=mysql2://localhost/temp?encoding=utf8 && \
|
||||||
export SECRET_KEY_BASE=thisisnotimportantnow && \
|
export SECRET_KEY_BASE=thisisnotimportantnow && \
|
||||||
|
@ -53,10 +48,9 @@ RUN export DATABASE_URL=mysql2://localhost/temp?encoding=utf8 && \
|
||||||
rm -Rf /var/lib/apt/lists/* /var/cache/apt/*
|
rm -Rf /var/lib/apt/lists/* /var/cache/apt/*
|
||||||
|
|
||||||
# Make relevant dirs and files writable for app user
|
# Make relevant dirs and files writable for app user
|
||||||
RUN mkdir -p tmp storage && \
|
RUN mkdir -p tmp && \
|
||||||
chown nobody config/app_config.yml && \
|
chown nobody config/app_config.yml && \
|
||||||
chown nobody tmp && \
|
chown nobody tmp
|
||||||
chown nobody storage
|
|
||||||
|
|
||||||
# Run app as unprivileged user
|
# Run app as unprivileged user
|
||||||
USER nobody
|
USER nobody
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM ruby:2.7
|
FROM ruby:2.6
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN deps='libmagic-dev chromium nodejs' && \
|
RUN deps='libmagic-dev chromium nodejs' && \
|
||||||
|
@ -19,7 +19,6 @@ ENV PORT=3000 \
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN gem install bundler
|
|
||||||
RUN bundle config build.nokogiri "--use-system-libraries"
|
RUN bundle config build.nokogiri "--use-system-libraries"
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
25
Gemfile
|
@ -1,12 +1,11 @@
|
||||||
# A sample Gemfile
|
# A sample Gemfile
|
||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
gem "rails", '~> 7.0'
|
gem "rails", '~> 5.2'
|
||||||
gem 'mail', '~> 2.7.1' # bug with mail 2.8.0 https://github.com/mikel/mail/issues/1489
|
|
||||||
|
|
||||||
|
gem 'sass-rails'
|
||||||
gem 'sassc-rails'
|
|
||||||
gem 'less-rails'
|
gem 'less-rails'
|
||||||
|
gem 'uglifier', '>= 1.0.3'
|
||||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||||
gem 'therubyracer', platforms: :ruby
|
gem 'therubyracer', platforms: :ruby
|
||||||
|
|
||||||
|
@ -23,7 +22,7 @@ gem 'bootsnap', require: false
|
||||||
gem 'mysql2'
|
gem 'mysql2'
|
||||||
gem 'prawn'
|
gem 'prawn'
|
||||||
gem 'prawn-table'
|
gem 'prawn-table'
|
||||||
gem 'haml', '~> 5.0'
|
gem 'haml'
|
||||||
gem 'haml-rails'
|
gem 'haml-rails'
|
||||||
gem 'kaminari'
|
gem 'kaminari'
|
||||||
gem 'simple_form'
|
gem 'simple_form'
|
||||||
|
@ -47,9 +46,7 @@ gem 'whenever', require: false # For defining cronjobs, see config/schedule.rb
|
||||||
gem 'ruby-units'
|
gem 'ruby-units'
|
||||||
gem 'attribute_normalizer'
|
gem 'attribute_normalizer'
|
||||||
gem 'ice_cube'
|
gem 'ice_cube'
|
||||||
# At time of development 01-06-2022 mmddyyyy necessary fix for config_helper.rb form builder was not in rubygems so we pull from github, see: https://github.com/gregschmit/recurring_select/pull/152
|
gem 'recurring_select'
|
||||||
gem 'recurring_select', git: 'https://github.com/gregschmit/recurring_select'
|
|
||||||
gem 'foodsoft_article_import', git: 'https://git.local-it.org/Foodsoft/foodsoft_article_import', tag: 'v1.0'
|
|
||||||
gem 'roo'
|
gem 'roo'
|
||||||
gem 'roo-xls'
|
gem 'roo-xls'
|
||||||
gem 'spreadsheet'
|
gem 'spreadsheet'
|
||||||
|
@ -58,8 +55,6 @@ gem 'gaffe'
|
||||||
gem 'ruby-filemagic'
|
gem 'ruby-filemagic'
|
||||||
gem 'mime-types'
|
gem 'mime-types'
|
||||||
gem 'midi-smtp-server'
|
gem 'midi-smtp-server'
|
||||||
gem 'rswag-api'
|
|
||||||
gem 'rswag-ui'
|
|
||||||
|
|
||||||
# we use the git version of acts_as_versioned, and need to include it in this Gemfile
|
# we use the git version of acts_as_versioned, and need to include it in this Gemfile
|
||||||
gem 'acts_as_versioned', git: 'https://github.com/technoweenie/acts_as_versioned.git'
|
gem 'acts_as_versioned', git: 'https://github.com/technoweenie/acts_as_versioned.git'
|
||||||
|
@ -86,8 +81,7 @@ group :development do
|
||||||
gem 'binding_of_caller'
|
gem 'binding_of_caller'
|
||||||
# gem "rails-i18n-debug"
|
# gem "rails-i18n-debug"
|
||||||
# chrome debugging extension https://github.com/dejan/rails_panel
|
# chrome debugging extension https://github.com/dejan/rails_panel
|
||||||
# TODO: disabled due to https://github.com/rails/rails/issues/40781
|
gem 'meta_request'
|
||||||
# gem 'meta_request'
|
|
||||||
|
|
||||||
# Get infos when not using proper eager loading
|
# Get infos when not using proper eager loading
|
||||||
gem 'bullet'
|
gem 'bullet'
|
||||||
|
@ -118,15 +112,10 @@ group :test do
|
||||||
gem 'rspec-core'
|
gem 'rspec-core'
|
||||||
gem 'rspec-rerun'
|
gem 'rspec-rerun'
|
||||||
gem 'i18n-spec'
|
gem 'i18n-spec'
|
||||||
gem 'rails-controller-testing'
|
|
||||||
# code coverage
|
# code coverage
|
||||||
gem 'simplecov', require: false
|
gem 'simplecov', require: false
|
||||||
gem 'simplecov-lcov', require: false
|
gem 'simplecov-lcov', require: false
|
||||||
# api
|
# api
|
||||||
gem 'rswag-specs'
|
gem 'apivore', require: false
|
||||||
gem 'hashie', '~> 3.4.6', require: false # https://github.com/westfieldlabs/apivore/issues/114
|
gem 'hashie', '~> 3.4.6', require: false # https://github.com/westfieldlabs/apivore/issues/114
|
||||||
end
|
end
|
||||||
|
|
||||||
gem "importmap-rails", "~> 1.1"
|
|
||||||
gem "image_processing", "~> 1.12"
|
|
||||||
gem "terser", "~> 1.1"
|
|
||||||
|
|
381
Gemfile.lock
|
@ -1,22 +1,3 @@
|
||||||
GIT
|
|
||||||
remote: https://git.local-it.org/Foodsoft/foodsoft_article_import
|
|
||||||
revision: 49a0c1ddb3bb67a357c692c63af0cda2db7c45b0
|
|
||||||
tag: v1.0
|
|
||||||
specs:
|
|
||||||
foodsoft_article_import (1.0.0)
|
|
||||||
roo (~> 2.9.0)
|
|
||||||
|
|
||||||
GIT
|
|
||||||
remote: https://github.com/gregschmit/recurring_select
|
|
||||||
revision: 29febc4c4abdd6c30636c33a7d2daecb09973ecf
|
|
||||||
specs:
|
|
||||||
recurring_select (3.0.0)
|
|
||||||
coffee-rails (>= 3.1)
|
|
||||||
ice_cube (>= 0.11)
|
|
||||||
jquery-rails (>= 3.0)
|
|
||||||
rails (>= 5.2)
|
|
||||||
sass-rails (>= 4.0)
|
|
||||||
|
|
||||||
GIT
|
GIT
|
||||||
remote: https://github.com/technoweenie/acts_as_versioned.git
|
remote: https://github.com/technoweenie/acts_as_versioned.git
|
||||||
revision: 63b1fc8529d028fae632fe80ec0cb25df56cd76b
|
revision: 63b1fc8529d028fae632fe80ec0cb25df56cd76b
|
||||||
|
@ -78,83 +59,67 @@ PATH
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (7.0.4)
|
actioncable (5.2.8.1)
|
||||||
actionpack (= 7.0.4)
|
actionpack (= 5.2.8.1)
|
||||||
activesupport (= 7.0.4)
|
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailbox (7.0.4)
|
actionmailer (5.2.8.1)
|
||||||
actionpack (= 7.0.4)
|
actionpack (= 5.2.8.1)
|
||||||
activejob (= 7.0.4)
|
actionview (= 5.2.8.1)
|
||||||
activerecord (= 7.0.4)
|
activejob (= 5.2.8.1)
|
||||||
activestorage (= 7.0.4)
|
|
||||||
activesupport (= 7.0.4)
|
|
||||||
mail (>= 2.7.1)
|
|
||||||
net-imap
|
|
||||||
net-pop
|
|
||||||
net-smtp
|
|
||||||
actionmailer (7.0.4)
|
|
||||||
actionpack (= 7.0.4)
|
|
||||||
actionview (= 7.0.4)
|
|
||||||
activejob (= 7.0.4)
|
|
||||||
activesupport (= 7.0.4)
|
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
net-imap
|
|
||||||
net-pop
|
|
||||||
net-smtp
|
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (7.0.4)
|
actionpack (5.2.8.1)
|
||||||
actionview (= 7.0.4)
|
actionview (= 5.2.8.1)
|
||||||
activesupport (= 7.0.4)
|
activesupport (= 5.2.8.1)
|
||||||
rack (~> 2.0, >= 2.2.0)
|
rack (~> 2.0, >= 2.0.8)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
actiontext (7.0.4)
|
actionview (5.2.8.1)
|
||||||
actionpack (= 7.0.4)
|
activesupport (= 5.2.8.1)
|
||||||
activerecord (= 7.0.4)
|
|
||||||
activestorage (= 7.0.4)
|
|
||||||
activesupport (= 7.0.4)
|
|
||||||
globalid (>= 0.6.0)
|
|
||||||
nokogiri (>= 1.8.5)
|
|
||||||
actionview (7.0.4)
|
|
||||||
activesupport (= 7.0.4)
|
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
||||||
active_model_serializers (0.10.13)
|
active_model_serializers (0.10.13)
|
||||||
actionpack (>= 4.1, < 7.1)
|
actionpack (>= 4.1, < 7.1)
|
||||||
activemodel (>= 4.1, < 7.1)
|
activemodel (>= 4.1, < 7.1)
|
||||||
case_transform (>= 0.2)
|
case_transform (>= 0.2)
|
||||||
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
||||||
activejob (7.0.4)
|
activejob (5.2.8.1)
|
||||||
activesupport (= 7.0.4)
|
activesupport (= 5.2.8.1)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (7.0.4)
|
activemodel (5.2.8.1)
|
||||||
activesupport (= 7.0.4)
|
activesupport (= 5.2.8.1)
|
||||||
activerecord (7.0.4)
|
activerecord (5.2.8.1)
|
||||||
activemodel (= 7.0.4)
|
activemodel (= 5.2.8.1)
|
||||||
activesupport (= 7.0.4)
|
activesupport (= 5.2.8.1)
|
||||||
activestorage (7.0.4)
|
arel (>= 9.0)
|
||||||
actionpack (= 7.0.4)
|
activestorage (5.2.8.1)
|
||||||
activejob (= 7.0.4)
|
actionpack (= 5.2.8.1)
|
||||||
activerecord (= 7.0.4)
|
activerecord (= 5.2.8.1)
|
||||||
activesupport (= 7.0.4)
|
marcel (~> 1.0.0)
|
||||||
marcel (~> 1.0)
|
activesupport (5.2.8.1)
|
||||||
mini_mime (>= 1.1.0)
|
|
||||||
activesupport (7.0.4)
|
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 1.6, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
minitest (>= 5.1)
|
minitest (~> 5.1)
|
||||||
tzinfo (~> 2.0)
|
tzinfo (~> 1.1)
|
||||||
acts_as_tree (2.9.1)
|
acts_as_tree (2.9.1)
|
||||||
activerecord (>= 3.0.0)
|
activerecord (>= 3.0.0)
|
||||||
addressable (2.8.1)
|
addressable (2.8.1)
|
||||||
public_suffix (>= 2.0.2, < 6.0)
|
public_suffix (>= 2.0.2, < 6.0)
|
||||||
|
apivore (1.6.2)
|
||||||
|
actionpack (>= 4, < 6)
|
||||||
|
hashie (~> 3.3)
|
||||||
|
json-schema (~> 2.5)
|
||||||
|
rspec (~> 3)
|
||||||
|
rspec-expectations (~> 3.1)
|
||||||
|
rspec-mocks (~> 3.1)
|
||||||
apparition (0.6.0)
|
apparition (0.6.0)
|
||||||
capybara (~> 3.13, < 4)
|
capybara (~> 3.13, < 4)
|
||||||
websocket-driver (>= 0.6.5)
|
websocket-driver (>= 0.6.5)
|
||||||
|
arel (9.0.0)
|
||||||
ast (2.4.2)
|
ast (2.4.2)
|
||||||
attribute_normalizer (1.2.0)
|
attribute_normalizer (1.2.0)
|
||||||
base32 (0.3.4)
|
base32 (0.3.4)
|
||||||
|
@ -165,15 +130,15 @@ GEM
|
||||||
bindex (0.8.1)
|
bindex (0.8.1)
|
||||||
binding_of_caller (1.0.0)
|
binding_of_caller (1.0.0)
|
||||||
debug_inspector (>= 0.0.1)
|
debug_inspector (>= 0.0.1)
|
||||||
bootsnap (1.15.0)
|
bootsnap (1.13.0)
|
||||||
msgpack (~> 1.2)
|
msgpack (~> 1.2)
|
||||||
bootstrap-datepicker-rails (1.9.0.1)
|
bootstrap-datepicker-rails (1.9.0.1)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
builder (3.2.4)
|
builder (3.2.4)
|
||||||
bullet (7.0.7)
|
bullet (7.0.3)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
uniform_notifier (~> 1.11)
|
uniform_notifier (~> 1.11)
|
||||||
capybara (3.38.0)
|
capybara (3.36.0)
|
||||||
addressable
|
addressable
|
||||||
matrix
|
matrix
|
||||||
mini_mime (>= 0.1.3)
|
mini_mime (>= 0.1.3)
|
||||||
|
@ -205,7 +170,6 @@ GEM
|
||||||
activerecord (>= 5.a)
|
activerecord (>= 5.a)
|
||||||
database_cleaner-core (~> 2.0.0)
|
database_cleaner-core (~> 2.0.0)
|
||||||
database_cleaner-core (2.0.1)
|
database_cleaner-core (2.0.1)
|
||||||
date (3.3.3)
|
|
||||||
date_time_attribute (0.1.2)
|
date_time_attribute (0.1.2)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
debug_inspector (1.1.0)
|
debug_inspector (1.1.0)
|
||||||
|
@ -218,13 +182,13 @@ GEM
|
||||||
diff-lcs (1.5.0)
|
diff-lcs (1.5.0)
|
||||||
diffy (3.4.2)
|
diffy (3.4.2)
|
||||||
docile (1.4.0)
|
docile (1.4.0)
|
||||||
doorkeeper (5.6.2)
|
doorkeeper (5.6.0)
|
||||||
railties (>= 5)
|
railties (>= 5)
|
||||||
doorkeeper-i18n (5.2.6)
|
doorkeeper-i18n (5.2.5)
|
||||||
doorkeeper (>= 5.2)
|
doorkeeper (>= 5.2)
|
||||||
email_reply_trimmer (0.1.13)
|
email_reply_trimmer (0.1.13)
|
||||||
erubi (1.12.0)
|
erubi (1.11.0)
|
||||||
eventmachine (1.0.9.1)
|
eventmachine (1.2.7)
|
||||||
exception_notification (4.5.0)
|
exception_notification (4.5.0)
|
||||||
actionmailer (>= 5.2, < 8)
|
actionmailer (>= 5.2, < 8)
|
||||||
activesupport (>= 5.2, < 8)
|
activesupport (>= 5.2, < 8)
|
||||||
|
@ -235,15 +199,16 @@ GEM
|
||||||
factory_bot_rails (6.2.0)
|
factory_bot_rails (6.2.0)
|
||||||
factory_bot (~> 6.2.0)
|
factory_bot (~> 6.2.0)
|
||||||
railties (>= 5.0.0)
|
railties (>= 5.0.0)
|
||||||
faker (3.1.0)
|
faker (2.22.0)
|
||||||
i18n (>= 1.8.11, < 2)
|
i18n (>= 1.8.11, < 2)
|
||||||
ffi (1.15.5)
|
ffi (1.15.5)
|
||||||
gaffe (1.2.0)
|
gaffe (1.2.0)
|
||||||
rails (>= 4.0.0)
|
rails (>= 4.0.0)
|
||||||
globalid (1.0.0)
|
globalid (1.0.0)
|
||||||
activesupport (>= 5.0)
|
activesupport (>= 5.0)
|
||||||
haml (5.2.2)
|
haml (6.0.5)
|
||||||
temple (>= 0.8.0)
|
temple (>= 0.8.2)
|
||||||
|
thor
|
||||||
tilt
|
tilt
|
||||||
haml-rails (2.1.0)
|
haml-rails (2.1.0)
|
||||||
actionpack (>= 5.1)
|
actionpack (>= 5.1)
|
||||||
|
@ -262,12 +227,6 @@ GEM
|
||||||
i18n-spec (0.6.0)
|
i18n-spec (0.6.0)
|
||||||
iso
|
iso
|
||||||
ice_cube (0.16.4)
|
ice_cube (0.16.4)
|
||||||
image_processing (1.12.2)
|
|
||||||
mini_magick (>= 4.9.5, < 5)
|
|
||||||
ruby-vips (>= 2.0.17, < 3)
|
|
||||||
importmap-rails (1.1.5)
|
|
||||||
actionpack (>= 6.0.0)
|
|
||||||
railties (>= 6.0.0)
|
|
||||||
inherited_resources (1.13.1)
|
inherited_resources (1.13.1)
|
||||||
actionpack (>= 5.2, < 7.1)
|
actionpack (>= 5.2, < 7.1)
|
||||||
has_scope (~> 0.6)
|
has_scope (~> 0.6)
|
||||||
|
@ -276,13 +235,13 @@ GEM
|
||||||
interception (0.5)
|
interception (0.5)
|
||||||
iso (0.4.0)
|
iso (0.4.0)
|
||||||
i18n
|
i18n
|
||||||
jquery-rails (4.5.1)
|
jquery-rails (4.5.0)
|
||||||
rails-dom-testing (>= 1, < 3)
|
rails-dom-testing (>= 1, < 3)
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (2.6.3)
|
json (2.6.2)
|
||||||
json-schema (3.0.0)
|
json-schema (2.8.1)
|
||||||
addressable (>= 2.8)
|
addressable (>= 2.4)
|
||||||
jsonapi-renderer (0.2.2)
|
jsonapi-renderer (0.2.2)
|
||||||
kaminari (1.2.2)
|
kaminari (1.2.2)
|
||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
|
@ -302,7 +261,7 @@ GEM
|
||||||
actionpack (>= 5.0)
|
actionpack (>= 5.0)
|
||||||
less (~> 2.6.0)
|
less (~> 2.6.0)
|
||||||
sprockets (~> 3.0)
|
sprockets (~> 3.0)
|
||||||
libv8 (3.16.14.19-x86_64-linux)
|
libv8 (3.16.14.19)
|
||||||
listen (3.7.1)
|
listen (3.7.1)
|
||||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||||
rb-inotify (~> 0.9, >= 0.9.10)
|
rb-inotify (~> 0.9, >= 0.9.10)
|
||||||
|
@ -323,34 +282,29 @@ GEM
|
||||||
thin
|
thin
|
||||||
marcel (1.0.2)
|
marcel (1.0.2)
|
||||||
matrix (0.4.2)
|
matrix (0.4.2)
|
||||||
|
meta_request (0.7.3)
|
||||||
|
rack-contrib (>= 1.1, < 3)
|
||||||
|
railties (>= 3.0.0, < 7)
|
||||||
method_source (1.0.0)
|
method_source (1.0.0)
|
||||||
midi-smtp-server (3.0.3)
|
midi-smtp-server (3.0.3)
|
||||||
mime-types (3.4.1)
|
mime-types (3.4.1)
|
||||||
mime-types-data (~> 3.2015)
|
mime-types-data (~> 3.2015)
|
||||||
mime-types-data (3.2022.0105)
|
mime-types-data (3.2022.0105)
|
||||||
mini_magick (4.12.0)
|
|
||||||
mini_mime (1.1.2)
|
mini_mime (1.1.2)
|
||||||
minitest (5.17.0)
|
mini_portile2 (2.8.0)
|
||||||
|
minitest (5.16.3)
|
||||||
mono_logger (1.1.1)
|
mono_logger (1.1.1)
|
||||||
msgpack (1.6.0)
|
msgpack (1.6.0)
|
||||||
multi_json (1.15.0)
|
multi_json (1.15.0)
|
||||||
mustermann (3.0.0)
|
mustermann (3.0.0)
|
||||||
ruby2_keywords (~> 0.0.1)
|
ruby2_keywords (~> 0.0.1)
|
||||||
mysql2 (0.5.4)
|
mysql2 (0.5.4)
|
||||||
net-imap (0.3.4)
|
|
||||||
date
|
|
||||||
net-protocol
|
|
||||||
net-pop (0.1.2)
|
|
||||||
net-protocol
|
|
||||||
net-protocol (0.2.1)
|
|
||||||
timeout
|
|
||||||
net-smtp (0.3.3)
|
|
||||||
net-protocol
|
|
||||||
nio4r (2.5.8)
|
nio4r (2.5.8)
|
||||||
nokogiri (1.13.10-x86_64-linux)
|
nokogiri (1.13.10)
|
||||||
|
mini_portile2 (~> 2.8.0)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
parallel (1.22.1)
|
parallel (1.22.1)
|
||||||
parser (3.2.0.0)
|
parser (3.1.2.1)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
pdf-core (0.9.0)
|
pdf-core (0.9.0)
|
||||||
polyglot (0.3.5)
|
polyglot (0.3.5)
|
||||||
|
@ -368,73 +322,75 @@ GEM
|
||||||
pry-stack_explorer (0.6.1)
|
pry-stack_explorer (0.6.1)
|
||||||
binding_of_caller (~> 1.0)
|
binding_of_caller (~> 1.0)
|
||||||
pry (~> 0.13)
|
pry (~> 0.13)
|
||||||
public_suffix (5.0.1)
|
public_suffix (5.0.0)
|
||||||
puma (6.0.2)
|
puma (5.6.5)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
racc (1.6.2)
|
racc (1.6.1)
|
||||||
rack (2.2.5)
|
rack (2.2.4)
|
||||||
|
rack-contrib (2.3.0)
|
||||||
|
rack (~> 2.0)
|
||||||
rack-cors (1.1.1)
|
rack-cors (1.1.1)
|
||||||
rack (>= 2.0.0)
|
rack (>= 2.0.0)
|
||||||
rack-protection (3.0.5)
|
rack-protection (3.0.4)
|
||||||
rack
|
rack
|
||||||
rack-test (2.0.2)
|
rack-test (2.0.2)
|
||||||
rack (>= 1.3)
|
rack (>= 1.3)
|
||||||
rails (7.0.4)
|
rails (5.2.8.1)
|
||||||
actioncable (= 7.0.4)
|
actioncable (= 5.2.8.1)
|
||||||
actionmailbox (= 7.0.4)
|
actionmailer (= 5.2.8.1)
|
||||||
actionmailer (= 7.0.4)
|
actionpack (= 5.2.8.1)
|
||||||
actionpack (= 7.0.4)
|
actionview (= 5.2.8.1)
|
||||||
actiontext (= 7.0.4)
|
activejob (= 5.2.8.1)
|
||||||
actionview (= 7.0.4)
|
activemodel (= 5.2.8.1)
|
||||||
activejob (= 7.0.4)
|
activerecord (= 5.2.8.1)
|
||||||
activemodel (= 7.0.4)
|
activestorage (= 5.2.8.1)
|
||||||
activerecord (= 7.0.4)
|
activesupport (= 5.2.8.1)
|
||||||
activestorage (= 7.0.4)
|
bundler (>= 1.3.0)
|
||||||
activesupport (= 7.0.4)
|
railties (= 5.2.8.1)
|
||||||
bundler (>= 1.15.0)
|
sprockets-rails (>= 2.0.0)
|
||||||
railties (= 7.0.4)
|
|
||||||
rails-assets-listjs (0.2.0.beta.4)
|
rails-assets-listjs (0.2.0.beta.4)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
rails-controller-testing (1.0.5)
|
|
||||||
actionpack (>= 5.0.1.rc1)
|
|
||||||
actionview (>= 5.0.1.rc1)
|
|
||||||
activesupport (>= 5.0.1.rc1)
|
|
||||||
rails-dom-testing (2.0.3)
|
rails-dom-testing (2.0.3)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
nokogiri (>= 1.6)
|
nokogiri (>= 1.6)
|
||||||
rails-html-sanitizer (1.4.4)
|
rails-html-sanitizer (1.4.4)
|
||||||
loofah (~> 2.19, >= 2.19.1)
|
loofah (~> 2.19, >= 2.19.1)
|
||||||
rails-i18n (7.0.6)
|
rails-i18n (5.1.3)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
railties (>= 6.0.0, < 8)
|
railties (>= 5.0, < 6)
|
||||||
rails-settings-cached (0.4.3)
|
rails-settings-cached (0.4.3)
|
||||||
rails (>= 4.2.0)
|
rails (>= 4.2.0)
|
||||||
rails_tokeninput (1.7.0)
|
rails_tokeninput (1.7.0)
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.1.0)
|
||||||
railties (7.0.4)
|
railties (5.2.8.1)
|
||||||
actionpack (= 7.0.4)
|
actionpack (= 5.2.8.1)
|
||||||
activesupport (= 7.0.4)
|
activesupport (= 5.2.8.1)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 12.2)
|
rake (>= 0.8.7)
|
||||||
thor (~> 1.0)
|
thor (>= 0.19.0, < 2.0)
|
||||||
zeitwerk (~> 2.5)
|
|
||||||
rainbow (3.1.1)
|
rainbow (3.1.1)
|
||||||
rake (13.0.6)
|
rake (13.0.6)
|
||||||
ransack (3.2.1)
|
ransack (2.5.0)
|
||||||
activerecord (>= 6.1.5)
|
activerecord (>= 5.2.4)
|
||||||
activesupport (>= 6.1.5)
|
activesupport (>= 5.2.4)
|
||||||
i18n
|
i18n
|
||||||
rb-fsevent (0.11.2)
|
rb-fsevent (0.11.2)
|
||||||
rb-inotify (0.10.1)
|
rb-inotify (0.10.1)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
|
recurring_select (3.0.0)
|
||||||
|
coffee-rails (>= 3.1)
|
||||||
|
ice_cube (>= 0.11)
|
||||||
|
jquery-rails (>= 3.0)
|
||||||
|
rails (>= 5.2)
|
||||||
|
sass-rails (>= 4.0)
|
||||||
redis (5.0.5)
|
redis (5.0.5)
|
||||||
redis-client (>= 0.9.0)
|
redis-client (>= 0.9.0)
|
||||||
redis-client (0.11.2)
|
redis-client (0.9.0)
|
||||||
connection_pool
|
connection_pool
|
||||||
redis-namespace (1.10.0)
|
redis-namespace (1.9.0)
|
||||||
redis (>= 4)
|
redis (>= 4)
|
||||||
ref (2.0.0)
|
ref (2.0.0)
|
||||||
regexp_parser (2.6.1)
|
regexp_parser (2.6.0)
|
||||||
responders (3.0.1)
|
responders (3.0.1)
|
||||||
actionpack (>= 5.0)
|
actionpack (>= 5.0)
|
||||||
railties (>= 5.0)
|
railties (>= 5.0)
|
||||||
|
@ -444,71 +400,59 @@ GEM
|
||||||
redis-namespace (~> 1.6)
|
redis-namespace (~> 1.6)
|
||||||
sinatra (>= 0.9.2)
|
sinatra (>= 0.9.2)
|
||||||
rexml (3.2.5)
|
rexml (3.2.5)
|
||||||
roo (2.9.0)
|
roo (2.8.3)
|
||||||
nokogiri (~> 1)
|
nokogiri (~> 1)
|
||||||
rubyzip (>= 1.3.0, < 3.0.0)
|
rubyzip (>= 1.3.0, < 3.0.0)
|
||||||
roo-xls (1.2.0)
|
roo-xls (1.2.0)
|
||||||
nokogiri
|
nokogiri
|
||||||
roo (>= 2.0.0, < 3)
|
roo (>= 2.0.0, < 3)
|
||||||
spreadsheet (> 0.9.0)
|
spreadsheet (> 0.9.0)
|
||||||
rspec (3.12.0)
|
rspec (3.11.0)
|
||||||
rspec-core (~> 3.12.0)
|
rspec-core (~> 3.11.0)
|
||||||
rspec-expectations (~> 3.12.0)
|
rspec-expectations (~> 3.11.0)
|
||||||
rspec-mocks (~> 3.12.0)
|
rspec-mocks (~> 3.11.0)
|
||||||
rspec-core (3.12.0)
|
rspec-core (3.11.0)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.11.0)
|
||||||
rspec-expectations (3.12.1)
|
rspec-expectations (3.11.1)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.11.0)
|
||||||
rspec-mocks (3.12.1)
|
rspec-mocks (3.11.1)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.11.0)
|
||||||
rspec-rails (6.0.1)
|
rspec-rails (5.1.2)
|
||||||
actionpack (>= 6.1)
|
actionpack (>= 5.2)
|
||||||
activesupport (>= 6.1)
|
activesupport (>= 5.2)
|
||||||
railties (>= 6.1)
|
railties (>= 5.2)
|
||||||
rspec-core (~> 3.11)
|
rspec-core (~> 3.10)
|
||||||
rspec-expectations (~> 3.11)
|
rspec-expectations (~> 3.10)
|
||||||
rspec-mocks (~> 3.11)
|
rspec-mocks (~> 3.10)
|
||||||
rspec-support (~> 3.11)
|
rspec-support (~> 3.10)
|
||||||
rspec-rerun (1.1.0)
|
rspec-rerun (1.1.0)
|
||||||
rspec (~> 3.0)
|
rspec (~> 3.0)
|
||||||
rspec-support (3.12.0)
|
rspec-support (3.11.1)
|
||||||
rswag-api (2.7.0)
|
rubocop (1.36.0)
|
||||||
railties (>= 3.1, < 7.1)
|
|
||||||
rswag-specs (2.7.0)
|
|
||||||
activesupport (>= 3.1, < 7.1)
|
|
||||||
json-schema (>= 2.2, < 4.0)
|
|
||||||
railties (>= 3.1, < 7.1)
|
|
||||||
rspec-core (>= 2.14)
|
|
||||||
rswag-ui (2.7.0)
|
|
||||||
actionpack (>= 3.1, < 7.1)
|
|
||||||
railties (>= 3.1, < 7.1)
|
|
||||||
rubocop (1.43.0)
|
|
||||||
json (~> 2.3)
|
json (~> 2.3)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 3.2.0.0)
|
parser (>= 3.1.2.1)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
regexp_parser (>= 1.8, < 3.0)
|
regexp_parser (>= 1.8, < 3.0)
|
||||||
rexml (>= 3.2.5, < 4.0)
|
rexml (>= 3.2.5, < 4.0)
|
||||||
rubocop-ast (>= 1.24.1, < 2.0)
|
rubocop-ast (>= 1.20.1, < 2.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 2.4.0, < 3.0)
|
unicode-display_width (>= 1.4.0, < 3.0)
|
||||||
rubocop-ast (1.24.1)
|
rubocop-ast (1.21.0)
|
||||||
parser (>= 3.1.1.0)
|
parser (>= 3.1.1.0)
|
||||||
rubocop-rails (2.17.4)
|
rubocop-rails (2.16.1)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
rubocop (>= 1.33.0, < 2.0)
|
rubocop (>= 1.33.0, < 2.0)
|
||||||
rubocop-rspec (2.16.0)
|
rubocop-rspec (2.13.2)
|
||||||
rubocop (~> 1.33)
|
rubocop (~> 1.33)
|
||||||
ruby-filemagic (0.7.3)
|
ruby-filemagic (0.7.3)
|
||||||
ruby-ole (1.2.12.2)
|
ruby-ole (1.2.12.2)
|
||||||
ruby-prof (1.4.5)
|
ruby-prof (1.4.3)
|
||||||
ruby-progressbar (1.11.0)
|
ruby-progressbar (1.11.0)
|
||||||
ruby-units (3.0.0)
|
ruby-units (3.0.0)
|
||||||
ruby-vips (2.1.4)
|
|
||||||
ffi (~> 1.12)
|
|
||||||
ruby2_keywords (0.0.5)
|
ruby2_keywords (0.0.5)
|
||||||
rubyzip (2.3.2)
|
rubyzip (2.3.2)
|
||||||
sass-rails (6.0.0)
|
sass-rails (6.0.0)
|
||||||
|
@ -531,21 +475,21 @@ GEM
|
||||||
simple_form (5.1.0)
|
simple_form (5.1.0)
|
||||||
actionpack (>= 5.2)
|
actionpack (>= 5.2)
|
||||||
activemodel (>= 5.2)
|
activemodel (>= 5.2)
|
||||||
simplecov (0.22.0)
|
simplecov (0.21.2)
|
||||||
docile (~> 1.1)
|
docile (~> 1.1)
|
||||||
simplecov-html (~> 0.11)
|
simplecov-html (~> 0.11)
|
||||||
simplecov_json_formatter (~> 0.1)
|
simplecov_json_formatter (~> 0.1)
|
||||||
simplecov-html (0.12.3)
|
simplecov-html (0.12.3)
|
||||||
simplecov-lcov (0.8.0)
|
simplecov-lcov (0.8.0)
|
||||||
simplecov_json_formatter (0.1.4)
|
simplecov_json_formatter (0.1.4)
|
||||||
sinatra (3.0.5)
|
sinatra (3.0.4)
|
||||||
mustermann (~> 3.0)
|
mustermann (~> 3.0)
|
||||||
rack (~> 2.2, >= 2.2.4)
|
rack (~> 2.2, >= 2.2.4)
|
||||||
rack-protection (= 3.0.5)
|
rack-protection (= 3.0.4)
|
||||||
tilt (~> 2.0)
|
tilt (~> 2.0)
|
||||||
skinny (0.2.4)
|
skinny (0.2.2)
|
||||||
eventmachine (~> 1.0.0)
|
eventmachine (~> 1.0)
|
||||||
thin (>= 1.5, < 1.7)
|
thin
|
||||||
spreadsheet (1.3.0)
|
spreadsheet (1.3.0)
|
||||||
ruby-ole
|
ruby-ole
|
||||||
sprockets (3.7.2)
|
sprockets (3.7.2)
|
||||||
|
@ -559,19 +503,17 @@ GEM
|
||||||
sqlite3-ruby (1.3.3)
|
sqlite3-ruby (1.3.3)
|
||||||
sqlite3 (>= 1.3.3)
|
sqlite3 (>= 1.3.3)
|
||||||
table_print (1.5.7)
|
table_print (1.5.7)
|
||||||
temple (0.9.1)
|
temple (0.8.2)
|
||||||
terser (1.1.13)
|
|
||||||
execjs (>= 0.3.0, < 3)
|
|
||||||
therubyracer (0.12.3)
|
therubyracer (0.12.3)
|
||||||
libv8 (~> 3.16.14.15)
|
libv8 (~> 3.16.14.15)
|
||||||
ref
|
ref
|
||||||
thin (1.6.2)
|
thin (1.8.1)
|
||||||
daemons (>= 1.0.9)
|
daemons (~> 1.0, >= 1.0.9)
|
||||||
eventmachine (>= 1.0.0)
|
eventmachine (~> 1.0, >= 1.0.4)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1, < 3)
|
||||||
thor (1.2.1)
|
thor (1.2.1)
|
||||||
|
thread_safe (0.3.6)
|
||||||
tilt (2.0.11)
|
tilt (2.0.11)
|
||||||
timeout (0.3.1)
|
|
||||||
ttfunk (1.7.0)
|
ttfunk (1.7.0)
|
||||||
twitter-bootstrap-rails (2.2.8)
|
twitter-bootstrap-rails (2.2.8)
|
||||||
actionpack (>= 3.1)
|
actionpack (>= 3.1)
|
||||||
|
@ -580,18 +522,20 @@ GEM
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
twitter-text (1.14.7)
|
twitter-text (1.14.7)
|
||||||
unf (~> 0.1.0)
|
unf (~> 0.1.0)
|
||||||
tzinfo (2.0.5)
|
tzinfo (1.2.10)
|
||||||
concurrent-ruby (~> 1.0)
|
thread_safe (~> 0.1)
|
||||||
|
uglifier (4.2.0)
|
||||||
|
execjs (>= 0.3.0, < 3)
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
unf_ext
|
unf_ext
|
||||||
unf_ext (0.0.8.2)
|
unf_ext (0.0.8.2)
|
||||||
unicode-display_width (2.4.2)
|
unicode-display_width (2.3.0)
|
||||||
uniform_notifier (1.16.0)
|
uniform_notifier (1.16.0)
|
||||||
web-console (4.2.0)
|
web-console (3.7.0)
|
||||||
actionview (>= 6.0.0)
|
actionview (>= 5.0)
|
||||||
activemodel (>= 6.0.0)
|
activemodel (>= 5.0)
|
||||||
bindex (>= 0.4.0)
|
bindex (>= 0.4.0)
|
||||||
railties (>= 6.0.0)
|
railties (>= 5.0)
|
||||||
websocket-driver (0.7.5)
|
websocket-driver (0.7.5)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.5)
|
websocket-extensions (0.1.5)
|
||||||
|
@ -605,15 +549,15 @@ GEM
|
||||||
twitter-text
|
twitter-text
|
||||||
xpath (3.2.0)
|
xpath (3.2.0)
|
||||||
nokogiri (~> 1.8)
|
nokogiri (~> 1.8)
|
||||||
zeitwerk (2.6.6)
|
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
x86_64-linux
|
ruby
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
active_model_serializers (~> 0.10.0)
|
active_model_serializers (~> 0.10.0)
|
||||||
acts_as_tree
|
acts_as_tree
|
||||||
acts_as_versioned!
|
acts_as_versioned!
|
||||||
|
apivore
|
||||||
apparition
|
apparition
|
||||||
attribute_normalizer
|
attribute_normalizer
|
||||||
better_errors
|
better_errors
|
||||||
|
@ -631,7 +575,6 @@ DEPENDENCIES
|
||||||
exception_notification
|
exception_notification
|
||||||
factory_bot_rails
|
factory_bot_rails
|
||||||
faker
|
faker
|
||||||
foodsoft_article_import!
|
|
||||||
foodsoft_discourse!
|
foodsoft_discourse!
|
||||||
foodsoft_documents!
|
foodsoft_documents!
|
||||||
foodsoft_links!
|
foodsoft_links!
|
||||||
|
@ -639,21 +582,19 @@ DEPENDENCIES
|
||||||
foodsoft_polls!
|
foodsoft_polls!
|
||||||
foodsoft_wiki!
|
foodsoft_wiki!
|
||||||
gaffe
|
gaffe
|
||||||
haml (~> 5.0)
|
haml
|
||||||
haml-rails
|
haml-rails
|
||||||
hashie (~> 3.4.6)
|
hashie (~> 3.4.6)
|
||||||
i18n-js (~> 3.0.0.rc8)
|
i18n-js (~> 3.0.0.rc8)
|
||||||
i18n-spec
|
i18n-spec
|
||||||
ice_cube
|
ice_cube
|
||||||
image_processing (~> 1.12)
|
|
||||||
importmap-rails (~> 1.1)
|
|
||||||
inherited_resources
|
inherited_resources
|
||||||
jquery-rails
|
jquery-rails
|
||||||
kaminari
|
kaminari
|
||||||
less-rails
|
less-rails
|
||||||
listen
|
listen
|
||||||
mail (~> 2.7.1)
|
|
||||||
mailcatcher
|
mailcatcher
|
||||||
|
meta_request
|
||||||
midi-smtp-server
|
midi-smtp-server
|
||||||
mime-types
|
mime-types
|
||||||
mysql2
|
mysql2
|
||||||
|
@ -663,30 +604,26 @@ DEPENDENCIES
|
||||||
pry-stack_explorer
|
pry-stack_explorer
|
||||||
puma
|
puma
|
||||||
rack-cors
|
rack-cors
|
||||||
rails (~> 7.0)
|
rails (~> 5.2)
|
||||||
rails-assets-listjs (= 0.2.0.beta.4)
|
rails-assets-listjs (= 0.2.0.beta.4)
|
||||||
rails-controller-testing
|
|
||||||
rails-i18n
|
rails-i18n
|
||||||
rails-settings-cached (= 0.4.3)
|
rails-settings-cached (= 0.4.3)
|
||||||
rails_tokeninput
|
rails_tokeninput
|
||||||
ransack
|
ransack
|
||||||
recurring_select!
|
recurring_select
|
||||||
resque
|
resque
|
||||||
roo
|
roo
|
||||||
roo-xls
|
roo-xls
|
||||||
rspec-core
|
rspec-core
|
||||||
rspec-rails
|
rspec-rails
|
||||||
rspec-rerun
|
rspec-rerun
|
||||||
rswag-api
|
|
||||||
rswag-specs
|
|
||||||
rswag-ui
|
|
||||||
rubocop
|
rubocop
|
||||||
rubocop-rails
|
rubocop-rails
|
||||||
rubocop-rspec
|
rubocop-rspec
|
||||||
ruby-filemagic
|
ruby-filemagic
|
||||||
ruby-prof
|
ruby-prof
|
||||||
ruby-units
|
ruby-units
|
||||||
sassc-rails
|
sass-rails
|
||||||
sd_notify
|
sd_notify
|
||||||
select2-rails
|
select2-rails
|
||||||
simple-navigation (~> 3.14.0)
|
simple-navigation (~> 3.14.0)
|
||||||
|
@ -698,11 +635,11 @@ DEPENDENCIES
|
||||||
sprockets (< 4)
|
sprockets (< 4)
|
||||||
sqlite3 (~> 1.3.6)
|
sqlite3 (~> 1.3.6)
|
||||||
table_print
|
table_print
|
||||||
terser (~> 1.1)
|
|
||||||
therubyracer
|
therubyracer
|
||||||
twitter-bootstrap-rails (~> 2.2.8)
|
twitter-bootstrap-rails (~> 2.2.8)
|
||||||
|
uglifier (>= 1.0.3)
|
||||||
web-console
|
web-console
|
||||||
whenever
|
whenever
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.4.5
|
1.17.3
|
||||||
|
|
161
README.md
|
@ -1,124 +1,65 @@
|
||||||
Foodsoft
|
Foodsoft
|
||||||
=========
|
=========
|
||||||
|
[![Build Status](https://github.com/foodcoops/foodsoft/workflows/Ruby/badge.svg)](https://github.com/foodcoops/foodsoft/actions)
|
||||||
|
[![Coverage Status](https://coveralls.io/repos/foodcoops/foodsoft/badge.svg?branch=master)](https://coveralls.io/r/foodcoops/foodsoft?branch=master)
|
||||||
|
[![Docs Status](https://inch-ci.org/github/foodcoops/foodsoft.svg?branch=master)](http://inch-ci.org/github/foodcoops/foodsoft)
|
||||||
|
[![Code Climate](https://codeclimate.com/github/foodcoops/foodsoft.svg)](https://codeclimate.com/github/foodcoops/foodsoft)
|
||||||
|
[![Docker Status](https://img.shields.io/docker/cloud/build/foodcoops/foodsoft.svg)](https://hub.docker.com/r/foodcoops/foodsoft)
|
||||||
|
[![Documentation](https://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/foodcoops/foodsoft)
|
||||||
|
|
||||||
[Website](https://foodsoft.local-it.org)
|
Web-based software to manage a non-profit food coop (product catalog, ordering, accounting, job scheduling).
|
||||||
[Prototypefund](https://prototypefund.de/project/weiterentwicklung-von-foodsoft/)
|
|
||||||
|
A food cooperative is a group of people that buy food from suppliers of their own choosing. A collective do-it-yourself supermarket. Members order their products online and collect them on a specified day. And all put in a bit of work to make that possible. Foodsoft facilitates the process.
|
||||||
|
|
||||||
|
If you're a food coop considering to use foodsoft, please have a look at the [wiki page for foodcoops](https://github.com/foodcoops/foodsoft/wiki/For-foodcoops). When you'd like to experiment with or develop foodsoft, you can read [how to set it up](https://github.com/foodcoops/foodsoft/blob/master/doc/SETUP_DEVELOPMENT.md) on your own computer.
|
||||||
|
|
||||||
|
More information about using this software and contributing can be found on the [wiki](https://github.com/foodcoops/foodsoft/wiki).
|
||||||
|
|
||||||
|
|
||||||
Foodsoft ist ein Tool für [Lebensmittelkooperativen](https://de.wikipedia.org/wiki/Lebensmittelkooperative), welches selbstorganisierte gemeinsame Bestellungen in Großmengen von regionalen und ökologischen Produkten vereinfacht und transparent gestaltet.
|
Developing
|
||||||
|
----------
|
||||||
|
|
||||||
Foodsoft wurde ursprünglich entwickelt und betrieben von [foodcoops.net](https://foodcoops.net/)
|
Get foodsoft [running locally](doc/SETUP_DEVELOPMENT.md),
|
||||||
|
then visit our [Developing Guidelines](https://github.com/foodcoops/foodsoft/wiki/Developing-Guidelines)
|
||||||
|
page on the wiki.
|
||||||
|
|
||||||
|
Get a foodsoft dev-environment running in the browser with Gitpod
|
||||||
|
|
||||||
|
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/foodcoops/foodsoft)
|
||||||
|
|
||||||
|
Follow these [instructions](doc/SETUP_DEVELOPMENT_GITPOD.md) to complete setup from within the Gitpod workspace.
|
||||||
|
|
||||||
|
Deploying
|
||||||
|
---------
|
||||||
|
|
||||||
|
Setup foodsoft to [run in production](doc/SETUP_PRODUCTION.md), or join an existing
|
||||||
|
[hosting platform](https://foodcoops.net/foodsoft-hosting/).
|
||||||
|
|
||||||
|
|
||||||
#### Zielgruppe
|
License
|
||||||
|
-------
|
||||||
|
|
||||||
Unsere Zielgruppen sind Bürger:innen, Gruppen und Vereine, die eine Einkauskooperative aufbauen wollen und eine Software, die die Bestellung, Verteilung und Abrechnung erleichtert, benötigen.
|
Foodsoft is licensed under the [AGPL](https://www.gnu.org/licenses/agpl-3.0.html)
|
||||||
|
license (version 3 or later). Practically this means that you are free to use,
|
||||||
|
adapt and redistribute the software, as long as you publish any changes you
|
||||||
|
make to the code.
|
||||||
|
|
||||||
#### Vorhaben
|
For private use, there are no restrictions, but if you give others access to
|
||||||
|
Foodsoft (like running it open to the internet), you must also make your
|
||||||
|
changes available under the same license. This can be as easy as
|
||||||
|
[forking](https://github.com/foodcoops/foodsoft/fork) the project on Github and
|
||||||
|
pushing your changes. You are not required to integrate your changes back into
|
||||||
|
the main Foodsoft version (but if you're up for it that would be very welcome).
|
||||||
|
|
||||||
* ✅ Technische Schuld reduzieren
|
To make it a little easier, configuration files are exempt, so you can just
|
||||||
* ✅ Ruby on Rails Upgrade
|
install and configure Foodsoft without having to publish your changes. These
|
||||||
* ✅ Artikel Import verbessern
|
files are marked as public domain in the file header.
|
||||||
(Großhandelschnitstelle)
|
|
||||||
* ✅ Userexperience Verbessern
|
|
||||||
|
|
||||||
#### Was ist eine Einkaufskooperative?
|
|
||||||
|
|
||||||
![Wie funktioniert eine Einkauskooperative?](./doc/foodcoop-explained.jpg)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
State of this Fork
|
|
||||||
------------------
|
|
||||||
|
|
||||||
#### Increase Test Coverage
|
|
||||||
|
|
||||||
1. integration and model tests
|
|
||||||
* [x] fork
|
|
||||||
* [x] upstream [#966](https://github.com/foodcoops/foodsoft/pull/966)
|
|
||||||
1. Controller tests
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/8_increase_test_coverage_controllers)
|
|
||||||
* [ ] upstream [#970](https://github.com/foodcoops/foodsoft/pull/970)
|
|
||||||
|
|
||||||
#### Upgrade
|
|
||||||
|
|
||||||
1. Migrate to RSwag API Tests
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/28_introduce_rswag)
|
|
||||||
* [x] upstream [#969](https://github.com/foodcoops/foodsoft/pull/969)
|
|
||||||
1. Rails v7
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/9_rails_v_7)
|
|
||||||
* [x] upstream [#979](https://github.com/foodcoops/foodsoft/pull/979)
|
|
||||||
disussion [#956](https://github.com/foodcoops/foodsoft/issues/956)
|
|
||||||
1. Javascript Importmap
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/9_rails_v_7_js_importmap)
|
|
||||||
* [x] upstream
|
|
||||||
|
|
||||||
#### Article Order Import/Export
|
|
||||||
|
|
||||||
Updating Articles from large resellers and exporting orders is now much easier!
|
|
||||||
|
|
||||||
1. adds bnn fileformat that is used from large german resellers e.g. naturkost nord
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/11_bnn_import_article_update)
|
|
||||||
[gem](https://git.local-it.org/Foodsoft/foodsoft_article_import)
|
|
||||||
* [ ] upstream
|
|
||||||
1. Import category field
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/56_add_update_of_article_category_to_file_import)
|
|
||||||
* [ ] upstream
|
|
||||||
1. Export order as a custom csv file
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/12_generate_custom_csv_file)
|
|
||||||
* [ ] upstream
|
|
||||||
1. Naturkostnord Plugin
|
|
||||||
* [ ] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/12_nkn_file_plugin)
|
|
||||||
* [ ] upstream
|
|
||||||
|
|
||||||
#### Improve User Experience
|
|
||||||
|
|
||||||
1. Richtext editor for messages. Also allows sending attachements.
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/16_html_message_templates)
|
|
||||||
* [x] upstream
|
|
||||||
1. Show the sum of all order group balances
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/47_finance_ordergroup_sums)
|
|
||||||
* [x] upstream
|
|
||||||
1. UI improvements for group order view
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/uxui_group_order)
|
|
||||||
* [ ] upstream
|
|
||||||
1. Favorites
|
|
||||||
* [ ] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/20_favourites)
|
|
||||||
* [ ] upstream
|
|
||||||
1. Show the per kilo / litre price
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/11_include_kilo_litre_price)
|
|
||||||
* [ ] upstream
|
|
||||||
|
|
||||||
#### Other
|
|
||||||
|
|
||||||
1. Fix broken plugin mechanism
|
|
||||||
* [x] [fork](https://git.local-it.org/Foodsoft/foodsoft/src/branch/downgrade-haml)
|
|
||||||
* [x] upstream
|
|
||||||
|
|
||||||
#### Screenshots
|
|
||||||
|
|
||||||
![rswag](./doc/screenshots/rswag.png)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
![bnn upload](./doc/screenshots/bnn_upload.png)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
![message formatting](./doc/screenshots/message_formatting.png)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
![balance sum](./doc/screenshots/balance_sum.png)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
![custom csv export](./doc/screenshots/custom_csv_export.png)
|
|
||||||
csv export
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
![order](./doc/screenshots/order.png)
|
|
||||||
|
|
||||||
|
If you have any remaining questions, please
|
||||||
|
[open an issue](https://github.com/foodcoops/foodsoft/issues/new) or open a new
|
||||||
|
topic at the [forum](https://forum.foodcoops.net).
|
||||||
|
|
||||||
|
Please see [LICENSE](LICENSE.md) for the full and authoritative text. Some
|
||||||
|
bundled third-party components have [other licenses](vendor/README.md).
|
||||||
|
|
||||||
|
Thanks to [Icons8](http://icons8.com/) for letting us use their icons.
|
||||||
|
|
|
@ -179,13 +179,17 @@ function updateBalance() {
|
||||||
var balance = groupBalance - total;
|
var balance = groupBalance - total;
|
||||||
$('#new_balance').html(I18n.l("currency", balance));
|
$('#new_balance').html(I18n.l("currency", balance));
|
||||||
$('#total_balance').val(I18n.l("currency", balance));
|
$('#total_balance').val(I18n.l("currency", balance));
|
||||||
|
// determine bgcolor and submit button state according to balance
|
||||||
|
var bgcolor = '';
|
||||||
if (balance < minimumBalance) {
|
if (balance < minimumBalance) {
|
||||||
|
bgcolor = '#FF0000';
|
||||||
$('#submit_button').attr('disabled', 'disabled')
|
$('#submit_button').attr('disabled', 'disabled')
|
||||||
$('#balance-alert').css('display', 'block')
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$('#submit_button').removeAttr('disabled')
|
$('#submit_button').removeAttr('disabled')
|
||||||
$('#balance-alert').css('display', 'none')
|
}
|
||||||
|
// update bgcolor
|
||||||
|
for (i in itemTotal) {
|
||||||
|
$('#td_price_' + i).css('background-color', bgcolor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
/*
|
|
||||||
* Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
|
|
||||||
* the trix-editor content (whether displayed or under editing). Feel free to incorporate this
|
|
||||||
* inclusion directly in any other asset bundle and remove this file.
|
|
||||||
*
|
|
||||||
*= require trix
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We need to override trix.css’s image gallery styles to accommodate the
|
|
||||||
* <action-text-attachment> element we wrap around attachments. Otherwise,
|
|
||||||
* images in galleries will be squished by the max-width: 33%; rule.
|
|
||||||
*/
|
|
||||||
.trix-content .attachment-gallery > action-text-attachment,
|
|
||||||
.trix-content .attachment-gallery > .attachment {
|
|
||||||
flex: 1 0 33%;
|
|
||||||
padding: 0 0.5em;
|
|
||||||
max-width: 33%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trix-content .attachment-gallery.attachment-gallery--2 > action-text-attachment,
|
|
||||||
.trix-content .attachment-gallery.attachment-gallery--2 > .attachment, .trix-content .attachment-gallery.attachment-gallery--4 > action-text-attachment,
|
|
||||||
.trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
|
|
||||||
flex-basis: 50%;
|
|
||||||
max-width: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trix-content action-text-attachment .attachment {
|
|
||||||
padding: 0 !important;
|
|
||||||
max-width: 100% !important;
|
|
||||||
}
|
|
|
@ -7,5 +7,4 @@
|
||||||
*= require list.unlist
|
*= require list.unlist
|
||||||
*= require list.missing
|
*= require list.missing
|
||||||
*= require recurring_select
|
*= require recurring_select
|
||||||
*= require actiontext
|
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ table {
|
||||||
margin: .5em 0;
|
margin: .5em 0;
|
||||||
|
|
||||||
input:disabled {
|
input:disabled {
|
||||||
background-color: gray; }
|
background-color: red; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -241,9 +241,6 @@ table {
|
||||||
tr.order-article:hover .article-info {
|
tr.order-article:hover .article-info {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
tr.order-article:focus .article-info {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#order-footer {
|
#order-footer {
|
||||||
|
@ -278,13 +275,10 @@ tr.order-article .article-info {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.order-article:focus .article-info {
|
tr.order-article:hover .article-info {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.order-article:focus {
|
|
||||||
background-color: #E9E9E9;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ********* Articles
|
// ********* Articles
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,11 @@
|
||||||
.missing-many td {
|
.list .missing-many td, .list .missing-many:hover td {
|
||||||
background-color: #ffc590aa;
|
background-color: #ebbebe;
|
||||||
}
|
}
|
||||||
|
|
||||||
.missing-many:hover td, .missing-many:focus td {
|
.list .missing-few td, .list .missing-few:hover td {
|
||||||
background-color: #ffc590;
|
background-color: #ffee75;
|
||||||
}
|
}
|
||||||
|
|
||||||
.missing-few td {
|
.list .missing-none td, .list .missing-none:hover td {
|
||||||
background-color: #fcf488aa;
|
background-color: #E4EED6;
|
||||||
}
|
|
||||||
|
|
||||||
.missing-few:hover td, .missing-few:focus td {
|
|
||||||
background-color: #fcf488;
|
|
||||||
}
|
|
||||||
|
|
||||||
.missing-none td {
|
|
||||||
background-color: #d0f6ffaa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.missing-none:hover td, .missing-none:focus td {
|
|
||||||
background-color: #d0f6ff;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,11 +46,6 @@ class ArticlesController < ApplicationController
|
||||||
render :layout => false
|
render :layout => false
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
|
||||||
@article = Article.find(params[:id])
|
|
||||||
render :action => 'new', :layout => false
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@article = Article.new(params[:article])
|
@article = Article.new(params[:article])
|
||||||
if @article.valid? && @article.save
|
if @article.valid? && @article.save
|
||||||
|
@ -60,6 +55,11 @@ class ArticlesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@article = Article.find(params[:id])
|
||||||
|
render :action => 'new', :layout => false
|
||||||
|
end
|
||||||
|
|
||||||
# Updates one Article and highlights the line if succeded
|
# Updates one Article and highlights the line if succeded
|
||||||
def update
|
def update
|
||||||
@article = Article.find(params[:id])
|
@article = Article.find(params[:id])
|
||||||
|
@ -148,12 +148,10 @@ class ArticlesController < ApplicationController
|
||||||
# Update articles from a spreadsheet
|
# Update articles from a spreadsheet
|
||||||
def parse_upload
|
def parse_upload
|
||||||
uploaded_file = params[:articles]['file'] or raise I18n.t('articles.controller.parse_upload.no_file')
|
uploaded_file = params[:articles]['file'] or raise I18n.t('articles.controller.parse_upload.no_file')
|
||||||
type = params[:articles]['type']
|
|
||||||
options = { filename: uploaded_file.original_filename }
|
options = { filename: uploaded_file.original_filename }
|
||||||
options[:outlist_absent] = (params[:articles]['outlist_absent'] == '1')
|
options[:outlist_absent] = (params[:articles]['outlist_absent'] == '1')
|
||||||
options[:convert_units] = (params[:articles]['convert_units'] == '1')
|
options[:convert_units] = (params[:articles]['convert_units'] == '1')
|
||||||
options[:update_category] = (params[:articles]['update_category'] == '1')
|
@updated_article_pairs, @outlisted_articles, @new_articles = @supplier.sync_from_file uploaded_file.tempfile, options
|
||||||
@updated_article_pairs, @outlisted_articles, @new_articles = @supplier.sync_from_file uploaded_file.tempfile, type, options
|
|
||||||
if @updated_article_pairs.empty? && @outlisted_articles.empty? && @new_articles.empty?
|
if @updated_article_pairs.empty? && @outlisted_articles.empty? && @new_articles.empty?
|
||||||
redirect_to supplier_articles_path(@supplier), :notice => I18n.t('articles.controller.parse_upload.notice')
|
redirect_to supplier_articles_path(@supplier), :notice => I18n.t('articles.controller.parse_upload.notice')
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Finance::FinancialTransactionsController < ApplicationController
|
||||||
sort = "created_on DESC"
|
sort = "created_on DESC"
|
||||||
end
|
end
|
||||||
|
|
||||||
@q = FinancialTransaction.ransack(params[:q])
|
@q = FinancialTransaction.search(params[:q])
|
||||||
@financial_transactions_all = @q.result(distinct: true).includes(:user).order(sort)
|
@financial_transactions_all = @q.result(distinct: true).includes(:user).order(sort)
|
||||||
@financial_transactions_all = @financial_transactions_all.visible unless params[:show_hidden]
|
@financial_transactions_all = @financial_transactions_all.visible unless params[:show_hidden]
|
||||||
@financial_transactions_all = @financial_transactions_all.where(ordergroup_id: @ordergroup.id) if @ordergroup
|
@financial_transactions_all = @financial_transactions_all.where(ordergroup_id: @ordergroup.id) if @ordergroup
|
||||||
|
|
|
@ -11,10 +11,7 @@ class Finance::OrdergroupsController < Finance::BaseController
|
||||||
@ordergroups = Ordergroup.undeleted.order(sort)
|
@ordergroups = Ordergroup.undeleted.order(sort)
|
||||||
@ordergroups = @ordergroups.include_transaction_class_sum
|
@ordergroups = @ordergroups.include_transaction_class_sum
|
||||||
@ordergroups = @ordergroups.where('groups.name LIKE ?', "%#{params[:query]}%") unless params[:query].nil?
|
@ordergroups = @ordergroups.where('groups.name LIKE ?', "%#{params[:query]}%") unless params[:query].nil?
|
||||||
@ordergroups = @ordergroups.page(params[:page]).per(@per_page)
|
|
||||||
|
|
||||||
@total_balances = FinancialTransactionClass.sorted.each_with_object({}) do |c, tmp|
|
@ordergroups = @ordergroups.page(params[:page]).per(@per_page)
|
||||||
tmp[c.id] = c.financial_transactions.reduce(0) { | sum, t | sum + t.amount }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,7 +18,7 @@ class HomeController < ApplicationController
|
||||||
@bank_accounts = @types.includes(:bank_account).map(&:bank_account).uniq.compact
|
@bank_accounts = @types.includes(:bank_account).map(&:bank_account).uniq.compact
|
||||||
@bank_accounts = [BankAccount.last] if @bank_accounts.empty?
|
@bank_accounts = [BankAccount.last] if @bank_accounts.empty?
|
||||||
else
|
else
|
||||||
redirect_to root_path, alert: I18n.t('group_orders.errors.no_member')
|
redirect_to root_url, alert: I18n.t('group_orders.errors.no_member')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ class HomeController < ApplicationController
|
||||||
if @current_user.update(user_params)
|
if @current_user.update(user_params)
|
||||||
@current_user.ordergroup.update(ordergroup_params) if ordergroup_params
|
@current_user.ordergroup.update(ordergroup_params) if ordergroup_params
|
||||||
session[:locale] = @current_user.locale
|
session[:locale] = @current_user.locale
|
||||||
redirect_to my_profile_path, notice: I18n.t('home.changes_saved')
|
redirect_to my_profile_url, notice: I18n.t('home.changes_saved')
|
||||||
else
|
else
|
||||||
render :profile
|
render :profile
|
||||||
end
|
end
|
||||||
|
|
|
@ -49,7 +49,7 @@ class OrdersController < ApplicationController
|
||||||
send_order_pdf @order, params[:document]
|
send_order_pdf @order, params[:document]
|
||||||
end
|
end
|
||||||
format.csv do
|
format.csv do
|
||||||
send_data OrderCsv.new(@order, options= {custom_csv: params[:custom_csv]}).to_csv, filename: @order.name + '.csv', type: 'text/csv'
|
send_data OrderCsv.new(@order).to_csv, filename: @order.name + '.csv', type: 'text/csv'
|
||||||
end
|
end
|
||||||
format.text do
|
format.text do
|
||||||
send_data OrderTxt.new(@order).to_txt, filename: @order.name + '.txt', type: 'text/plain'
|
send_data OrderTxt.new(@order).to_txt, filename: @order.name + '.txt', type: 'text/plain'
|
||||||
|
@ -57,19 +57,6 @@ class OrdersController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def custom_csv
|
|
||||||
@order = Order.find(params[:id])
|
|
||||||
@view = (params[:view] || 'default').gsub(/[^-_a-zA-Z0-9]/, '')
|
|
||||||
@partial = case @view
|
|
||||||
when 'default' then 'articles'
|
|
||||||
when 'groups' then 'shared/articles_by/groups'
|
|
||||||
when 'articles' then 'shared/articles_by/articles'
|
|
||||||
else 'articles'
|
|
||||||
end
|
|
||||||
|
|
||||||
render :layout => false
|
|
||||||
end
|
|
||||||
|
|
||||||
# Page to create a new order.
|
# Page to create a new order.
|
||||||
def new
|
def new
|
||||||
if params[:order_id]
|
if params[:order_id]
|
||||||
|
|
|
@ -53,12 +53,4 @@ module GroupOrdersHelper
|
||||||
return 'missing-many'
|
return 'missing-many'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def price_per_base_unit(article:, price:)
|
|
||||||
quantity_unit = QuantityUnit.parse(article.unit)
|
|
||||||
return nil unless quantity_unit.present?
|
|
||||||
|
|
||||||
scaled_price, base_unit = quantity_unit.scale_price_to_base_unit(price)
|
|
||||||
"#{number_to_currency(scaled_price)}/#{base_unit}"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -155,16 +155,4 @@ module OrdersHelper
|
||||||
link_to t('orders.index.action_receive'), receive_order_path(order), class: "btn#{' btn-success' unless order.received?} #{options[:class]}"
|
link_to t('orders.index.action_receive'), receive_order_path(order), class: "btn#{' btn-success' unless order.received?} #{options[:class]}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def custom_csv_collection
|
|
||||||
[
|
|
||||||
OrderArticle.human_attribute_name(:units_to_order),
|
|
||||||
Article.human_attribute_name(:order_number),
|
|
||||||
Article.human_attribute_name(:name),
|
|
||||||
Article.human_attribute_name(:unit),
|
|
||||||
Article.human_attribute_name(:unit_quantity_short),
|
|
||||||
ArticlePrice.human_attribute_name(:price),
|
|
||||||
OrderArticle.human_attribute_name(:total_price)
|
|
||||||
]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
|
|
||||||
import "trix"
|
|
||||||
import "@rails/actiontext"
|
|
|
@ -1,61 +0,0 @@
|
||||||
require 'csv'
|
|
||||||
|
|
||||||
class OrderCsv < RenderCsv
|
|
||||||
def header
|
|
||||||
params = @options[:custom_csv]
|
|
||||||
arr = if params.nil?
|
|
||||||
[
|
|
||||||
OrderArticle.human_attribute_name(:units_to_order),
|
|
||||||
Article.human_attribute_name(:order_number),
|
|
||||||
Article.human_attribute_name(:name),
|
|
||||||
Article.human_attribute_name(:unit),
|
|
||||||
Article.human_attribute_name(:unit_quantity_short),
|
|
||||||
ArticlePrice.human_attribute_name(:price),
|
|
||||||
OrderArticle.human_attribute_name(:total_price)
|
|
||||||
]
|
|
||||||
else
|
|
||||||
[
|
|
||||||
params[:first],
|
|
||||||
params[:second],
|
|
||||||
params[:third],
|
|
||||||
params[:fourth],
|
|
||||||
params[:fifth],
|
|
||||||
params[:sixth],
|
|
||||||
params[:seventh]
|
|
||||||
]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def data
|
|
||||||
@object.order_articles.ordered.includes([:article, :article_price]).all.map do |oa|
|
|
||||||
yield [
|
|
||||||
match_params(oa, header[0]),
|
|
||||||
match_params(oa, header[1]),
|
|
||||||
match_params(oa, header[2]),
|
|
||||||
match_params(oa, header[3]),
|
|
||||||
match_params(oa, header[4]),
|
|
||||||
match_params(oa, header[5]),
|
|
||||||
match_params(oa, header[6])
|
|
||||||
]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def match_params(object, attribute)
|
|
||||||
case attribute
|
|
||||||
when OrderArticle.human_attribute_name(:units_to_order)
|
|
||||||
object.units_to_order
|
|
||||||
when Article.human_attribute_name(:order_number)
|
|
||||||
object.article.order_number
|
|
||||||
when Article.human_attribute_name(:name)
|
|
||||||
object.article.name
|
|
||||||
when Article.human_attribute_name(:unit)
|
|
||||||
object.article.unit
|
|
||||||
when Article.human_attribute_name(:unit_quantity_short)
|
|
||||||
object.price.unit_quantity > 1 ? object.price.unit_quantity : nil
|
|
||||||
when ArticlePrice.human_attribute_name(:price)
|
|
||||||
number_to_currency(object.price.price * object.price.unit_quantity)
|
|
||||||
when OrderArticle.human_attribute_name(:total_price)
|
|
||||||
number_to_currency(object.total_price)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,59 +0,0 @@
|
||||||
class QuantityUnit
|
|
||||||
def initialize(quantity, unit)
|
|
||||||
@quantity = quantity
|
|
||||||
@unit = unit
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.parse(number_with_unit)
|
|
||||||
# remove whitespace
|
|
||||||
number_with_unit = number_with_unit.gsub(/\s+/, '')
|
|
||||||
# to lowercase
|
|
||||||
number_with_unit = number_with_unit.downcase
|
|
||||||
# remove numerical part
|
|
||||||
number = number_with_unit.gsub(/[^0-9.,]/, '')
|
|
||||||
# remove unit part
|
|
||||||
unit = number_with_unit.gsub(/[^a-zA-Z]/, '')
|
|
||||||
# convert comma to dot
|
|
||||||
number = number.gsub(',', '.')
|
|
||||||
# convert to float
|
|
||||||
number = number.to_f
|
|
||||||
|
|
||||||
return nil unless unit.in?(%w[g kg l ml])
|
|
||||||
|
|
||||||
QuantityUnit.new(number, unit)
|
|
||||||
end
|
|
||||||
|
|
||||||
def scale_price_to_base_unit(price)
|
|
||||||
return nil unless price.is_a?(Numeric)
|
|
||||||
|
|
||||||
factor = if @unit == 'kg' || @unit == 'l'
|
|
||||||
1
|
|
||||||
elsif @unit == 'g' || @unit == 'ml'
|
|
||||||
1000
|
|
||||||
end
|
|
||||||
|
|
||||||
scaled_price = price / @quantity * factor
|
|
||||||
scaled_price.round(2)
|
|
||||||
|
|
||||||
base_unit = if @unit == 'kg' || @unit == 'g'
|
|
||||||
'kg'
|
|
||||||
elsif @unit == 'l' || @unit == 'ml'
|
|
||||||
'L'
|
|
||||||
end
|
|
||||||
|
|
||||||
[scaled_price, base_unit]
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def to_s
|
|
||||||
"#{@quantity} #{@unit}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def quantity
|
|
||||||
@quantity
|
|
||||||
end
|
|
||||||
|
|
||||||
def unit
|
|
||||||
@unit
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -143,7 +143,8 @@ class Article < ApplicationRecord
|
||||||
new_unit = new_article.unit
|
new_unit = new_article.unit
|
||||||
end
|
end
|
||||||
|
|
||||||
attribute_hash = {
|
return Article.compare_attributes(
|
||||||
|
{
|
||||||
:name => [self.name, new_article.name],
|
:name => [self.name, new_article.name],
|
||||||
:manufacturer => [self.manufacturer, new_article.manufacturer.to_s],
|
:manufacturer => [self.manufacturer, new_article.manufacturer.to_s],
|
||||||
:origin => [self.origin, new_article.origin],
|
:origin => [self.origin, new_article.origin],
|
||||||
|
@ -155,12 +156,7 @@ class Article < ApplicationRecord
|
||||||
:unit_quantity => [self.unit_quantity.to_s.to_f, new_unit_quantity.to_s.to_f],
|
:unit_quantity => [self.unit_quantity.to_s.to_f, new_unit_quantity.to_s.to_f],
|
||||||
:note => [self.note.to_s, new_article.note.to_s]
|
:note => [self.note.to_s, new_article.note.to_s]
|
||||||
}
|
}
|
||||||
if options[:update_category] == true
|
)
|
||||||
new_article_category = new_article.article_category
|
|
||||||
attribute_hash[:article_category] = [self.article_category, new_article_category] unless new_article_category.blank?
|
|
||||||
end
|
|
||||||
|
|
||||||
Article.compare_attributes(attribute_hash)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Compare attributes from two different articles.
|
# Compare attributes from two different articles.
|
||||||
|
|
|
@ -8,7 +8,7 @@ module LocalizeInput
|
||||||
separator = I18n.t("separator", scope: "number.format")
|
separator = I18n.t("separator", scope: "number.format")
|
||||||
delimiter = I18n.t("delimiter", scope: "number.format")
|
delimiter = I18n.t("delimiter", scope: "number.format")
|
||||||
input.gsub!(delimiter, "") if input.match(/\d+#{Regexp.escape(delimiter)}+\d+#{Regexp.escape(separator)}+\d+/) # Remove delimiter
|
input.gsub!(delimiter, "") if input.match(/\d+#{Regexp.escape(delimiter)}+\d+#{Regexp.escape(separator)}+\d+/) # Remove delimiter
|
||||||
input.gsub!(separator, ".") or input.gsub!(",", ".") # Replace separator with db compatible character
|
input.gsub!(separator, ".") # Replace separator with db compatible character
|
||||||
input
|
input
|
||||||
rescue
|
rescue
|
||||||
Rails.logger.warn "Can't localize input: #{input}"
|
Rails.logger.warn "Can't localize input: #{input}"
|
||||||
|
|
|
@ -32,8 +32,8 @@ class GroupOrder < ApplicationRecord
|
||||||
# Generate some data for the javascript methods in ordering view
|
# Generate some data for the javascript methods in ordering view
|
||||||
def load_data
|
def load_data
|
||||||
data = {}
|
data = {}
|
||||||
data[:account_balance] = ordergroup.nil? ? BigDecimal('+Infinity') : ordergroup.account_balance
|
data[:account_balance] = ordergroup.nil? ? BigDecimal.new('+Infinity') : ordergroup.account_balance
|
||||||
data[:available_funds] = ordergroup.nil? ? BigDecimal('+Infinity') : ordergroup.get_available_funds(self)
|
data[:available_funds] = ordergroup.nil? ? BigDecimal.new('+Infinity') : ordergroup.get_available_funds(self)
|
||||||
|
|
||||||
# load prices and other stuff....
|
# load prices and other stuff....
|
||||||
data[:order_articles] = {}
|
data[:order_articles] = {}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
require 'foodsoft_article_import'
|
|
||||||
class Supplier < ApplicationRecord
|
class Supplier < ApplicationRecord
|
||||||
include MarkAsDeletedWithName
|
include MarkAsDeletedWithName
|
||||||
include CustomFields
|
include CustomFields
|
||||||
|
@ -74,24 +73,15 @@ class Supplier < ApplicationRecord
|
||||||
# Synchronise articles with spreadsheet.
|
# Synchronise articles with spreadsheet.
|
||||||
#
|
#
|
||||||
# @param file [File] Spreadsheet file to parse
|
# @param file [File] Spreadsheet file to parse
|
||||||
# @param options [Hash] Options passed to {FoodsoftArticleImport#parse} except when listed here.
|
# @param options [Hash] Options passed to {FoodsoftFile#parse} except when listed here.
|
||||||
# @option options [Boolean] :outlist_absent Set to +true+ to remove articles not in spreadsheet.
|
# @option options [Boolean] :outlist_absent Set to +true+ to remove articles not in spreadsheet.
|
||||||
# @option options [Boolean] :convert_units Omit or set to +true+ to keep current units, recomputing unit quantity and price.
|
# @option options [Boolean] :convert_units Omit or set to +true+ to keep current units, recomputing unit quantity and price.
|
||||||
def sync_from_file(file, type, options = {})
|
def sync_from_file(file, options = {})
|
||||||
all_order_numbers = []
|
all_order_numbers = []
|
||||||
updated_article_pairs, outlisted_articles, new_articles = [], [], []
|
updated_article_pairs, outlisted_articles, new_articles = [], [], []
|
||||||
custom_codes_path = File.join(Rails.root, "config", "custom_codes.yml")
|
FoodsoftFile::parse file, options do |status, new_attrs, line|
|
||||||
opts = options.except(:convert_units, :outlist_absent, :update_category)
|
|
||||||
custom_codes_file_path = custom_codes_path if File.exist?(custom_codes_path)
|
|
||||||
FoodsoftArticleImport.parse(file, custom_file_path: custom_codes_file_path, type: type, **opts) do |new_attrs, status, line|
|
|
||||||
article = articles.undeleted.where(order_number: new_attrs[:order_number]).first
|
article = articles.undeleted.where(order_number: new_attrs[:order_number]).first
|
||||||
|
new_attrs[:article_category] = ArticleCategory.find_match(new_attrs[:article_category])
|
||||||
if new_attrs[:article_category].present? && options[:update_category]
|
|
||||||
new_attrs[:article_category] = ArticleCategory.find_match(new_attrs[:article_category]) || ArticleCategory.create_or_find_by!(name: new_attrs[:article_category])
|
|
||||||
else
|
|
||||||
new_attrs[:article_category] = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
new_attrs[:tax] ||= FoodsoftConfig[:tax_default]
|
new_attrs[:tax] ||= FoodsoftConfig[:tax_default]
|
||||||
new_article = articles.build(new_attrs)
|
new_article = articles.build(new_attrs)
|
||||||
|
|
||||||
|
@ -99,7 +89,7 @@ class Supplier < ApplicationRecord
|
||||||
if article.nil?
|
if article.nil?
|
||||||
new_articles << new_article
|
new_articles << new_article
|
||||||
else
|
else
|
||||||
unequal_attributes = article.unequal_attributes(new_article, options.slice(:convert_units, :update_category))
|
unequal_attributes = article.unequal_attributes(new_article, options.slice(:convert_units))
|
||||||
unless unequal_attributes.empty?
|
unless unequal_attributes.empty?
|
||||||
article.attributes = unequal_attributes
|
article.attributes = unequal_attributes
|
||||||
updated_article_pairs << [article, unequal_attributes]
|
updated_article_pairs << [article, unequal_attributes]
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %>">
|
|
||||||
<% if blob.representable? %>
|
|
||||||
<%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<figcaption class="attachment__caption">
|
|
||||||
<% if caption = blob.try(:caption) %>
|
|
||||||
<%= caption %>
|
|
||||||
<% else %>
|
|
||||||
<span class="attachment__name"><%= blob.filename %></span>
|
|
||||||
<span class="attachment__size"><%= number_to_human_size blob.byte_size %></span>
|
|
||||||
<% end %>
|
|
||||||
</figcaption>
|
|
||||||
</figure>
|
|
|
@ -49,8 +49,7 @@
|
||||||
.input-prepend
|
.input-prepend
|
||||||
%span.add-on= t 'number.currency.format.unit'
|
%span.add-on= t 'number.currency.format.unit'
|
||||||
= form.text_field 'deposit', class: 'input-mini', style: 'width: 45px'
|
= form.text_field 'deposit', class: 'input-mini', style: 'width: 45px'
|
||||||
%td{:style => highlight_new(attrs, :article_category)}
|
%td= form.select :article_category_id, ArticleCategory.all.map {|a| [ a.name, a.id ] },
|
||||||
= form.select :article_category_id, ArticleCategory.all.map {|a| [ a.name, a.id ] },
|
|
||||||
{include_blank: true}, class: 'input-small'
|
{include_blank: true}, class: 'input-small'
|
||||||
- unless changed_article.errors.empty?
|
- unless changed_article.errors.empty?
|
||||||
%tr.alert
|
%tr.alert
|
||||||
|
|
|
@ -71,19 +71,11 @@
|
||||||
= form_for :articles, :url => parse_upload_supplier_articles_path(@supplier),
|
= form_for :articles, :url => parse_upload_supplier_articles_path(@supplier),
|
||||||
:html => { multipart: true, class: "form-horizontal" } do |f|
|
:html => { multipart: true, class: "form-horizontal" } do |f|
|
||||||
|
|
||||||
|
|
||||||
.control-group
|
.control-group
|
||||||
%label(for="articles_file")
|
%label(for="articles_file")= t '.file_label'
|
||||||
%strong= t '.file_label'
|
|
||||||
= f.file_field "file"
|
= f.file_field "file"
|
||||||
%label(for="articles_file")
|
|
||||||
%strong="select the file type you are about to upload"
|
|
||||||
=f.collection_select :type, ["bnn","foodsoft","odin"], :to_s, :to_s
|
|
||||||
|
|
||||||
.control-group
|
.control-group
|
||||||
%label(for="articles_update_category")
|
|
||||||
= f.check_box "update_category"
|
|
||||||
= t '.options.update_category'
|
|
||||||
%label(for="articles_outlist_absent")
|
%label(for="articles_outlist_absent")
|
||||||
= f.check_box "outlist_absent"
|
= f.check_box "outlist_absent"
|
||||||
= t '.options.outlist_absent'
|
= t '.options.outlist_absent'
|
||||||
|
|
|
@ -22,12 +22,3 @@
|
||||||
%td
|
%td
|
||||||
= link_to t('.new_transaction'), new_finance_ordergroup_transaction_path(ordergroup), class: 'btn btn-mini'
|
= link_to t('.new_transaction'), new_finance_ordergroup_transaction_path(ordergroup), class: 'btn btn-mini'
|
||||||
= link_to t('.account_statement'), finance_ordergroup_transactions_path(ordergroup), class: 'btn btn-mini'
|
= link_to t('.account_statement'), finance_ordergroup_transactions_path(ordergroup), class: 'btn btn-mini'
|
||||||
%thead
|
|
||||||
%tr
|
|
||||||
%th= t 'Total'
|
|
||||||
%th
|
|
||||||
- FinancialTransactionClass.sorted.each do |c|
|
|
||||||
- name = FinancialTransactionClass.has_multiple_classes ? c.display : heading_helper(Ordergroup, :account_balance)
|
|
||||||
%th.numeric= format_currency @total_balances[c.id]
|
|
||||||
%th.numeric
|
|
||||||
= format_currency @total_balances.values.reduce(:+)
|
|
|
@ -1,15 +0,0 @@
|
||||||
%h4= t '.title'
|
|
||||||
%hr
|
|
||||||
%table.table-condensed
|
|
||||||
%thead
|
|
||||||
%th= t '.package_fill_level'
|
|
||||||
%tbody
|
|
||||||
%tr{class: "missing-none"}
|
|
||||||
%td= t '.missing_none'
|
|
||||||
%tr{class: "missing-few"}
|
|
||||||
%td= t '.missing_few'
|
|
||||||
%tr{class: "missing-many"}
|
|
||||||
%td= t '.missing_many'
|
|
||||||
%hr
|
|
||||||
%b= t('.tolerance') + ':'
|
|
||||||
= t '.tolerance_explained'
|
|
|
@ -22,41 +22,54 @@
|
||||||
|
|
||||||
- title t('.title'), false
|
- title t('.title'), false
|
||||||
|
|
||||||
.alert.alert-error#balance-alert{style: ('display:none')}
|
|
||||||
=t 'group_orders.errors.balance_alert'
|
|
||||||
.row-fluid
|
.row-fluid
|
||||||
.span2
|
.well.pull-left
|
||||||
.well
|
= close_button :alert
|
||||||
= render 'switch_order', current_order: @order
|
%h2= @order.name
|
||||||
.well
|
%dl.dl-horizontal
|
||||||
= render 'explanations'
|
- unless @order.note.blank?
|
||||||
.well.span9
|
%dt= heading_helper Order, :note
|
||||||
%h2.span9= t '.sub_title', order_name: @order.name
|
%dd= @order.note
|
||||||
.span3
|
%dt= heading_helper Order, :created_by
|
||||||
%table.table-condensed
|
%dd= show_user_link(@order.created_by)
|
||||||
-if @order.ends
|
%dt= heading_helper Order, :ends
|
||||||
%tr
|
%dd= format_time(@order.ends)
|
||||||
%td= heading_helper(Order, :ends) + ': '
|
%dt= heading_helper Order, :pickup
|
||||||
%td= format_time(@order.ends)
|
%dd= format_date(@order.pickup)
|
||||||
- unless @order.stockit? or @order.supplier.min_order_quantity.blank?
|
- unless @order.stockit? or @order.supplier.min_order_quantity.blank?
|
||||||
%tr
|
%dt= heading_helper Supplier, :min_order_quantity, short: true
|
||||||
%td= heading_helper(Supplier, :min_order_quantity)
|
%dd= @order.supplier.min_order_quantity
|
||||||
%td= number_to_currency(@order.supplier.min_order_quantity)
|
%dt= t '.sum_amount'
|
||||||
%tr
|
%dd= number_to_currency @order.sum
|
||||||
%td= t('group_orders.form.sum_amount') + ':'
|
- unless @group_order.new_record?
|
||||||
%td= number_to_currency(@order.sum)
|
%dt= heading_helper GroupOrder, :updated_by
|
||||||
%hr
|
%dd
|
||||||
.form-search.pull-right
|
= show_user(@group_order.updated_by)
|
||||||
|
(#{format_time(@group_order.updated_on)})
|
||||||
|
%dt= heading_helper Ordergroup, :account_balance
|
||||||
|
%dd= number_to_currency(@ordering_data[:account_balance])
|
||||||
|
- unless FoodsoftConfig[:charge_members_manually]
|
||||||
|
%dt= heading_helper Ordergroup, :available_funds
|
||||||
|
%dd= number_to_currency(@ordering_data[:available_funds])
|
||||||
|
|
||||||
|
.well.pull-right
|
||||||
|
= close_button :alert
|
||||||
|
= render 'switch_order', current_order: @order
|
||||||
|
|
||||||
|
.row-fluid
|
||||||
|
.well.clear
|
||||||
|
.form-search
|
||||||
.input-append
|
.input-append
|
||||||
= text_field_tag :article, params[:article], placeholder: t('.search_article'), class: 'search-query delayed-search resettable'
|
= text_field_tag :article, params[:article], placeholder: t('.search_article'), class: 'search-query delayed-search resettable'
|
||||||
%button.add-on.btn.reset-search{:type => :button, :title => t('.reset_article_search')}
|
%button.add-on.btn.reset-search{:type => :button, :title => t('.reset_article_search')}
|
||||||
%i.icon.icon-remove
|
%i.icon.icon-remove
|
||||||
|
|
||||||
= form_for @group_order do |f|
|
= form_for @group_order do |f|
|
||||||
= f.hidden_field :lock_version
|
= f.hidden_field :lock_version
|
||||||
= f.hidden_field :order_id
|
= f.hidden_field :order_id
|
||||||
= f.hidden_field :updated_by_user_id
|
= f.hidden_field :updated_by_user_id
|
||||||
= f.hidden_field :ordergroup_id
|
= f.hidden_field :ordergroup_id
|
||||||
%table.table
|
%table.table.table-hover
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th= heading_helper Article, :name
|
%th= heading_helper Article, :name
|
||||||
|
@ -64,7 +77,6 @@
|
||||||
%th{style: 'width:120px'}= heading_helper StockArticle, :supplier
|
%th{style: 'width:120px'}= heading_helper StockArticle, :supplier
|
||||||
%th{style: "width:13px;"}
|
%th{style: "width:13px;"}
|
||||||
%th{style: "width:4.5em;"}= t '.price'
|
%th{style: "width:4.5em;"}= t '.price'
|
||||||
%th{style: "width:4.5em;"}= t '.price_per_base_unit'
|
|
||||||
%th{style: "width:4.5em;"}= heading_helper Article, :unit
|
%th{style: "width:4.5em;"}= heading_helper Article, :unit
|
||||||
- unless @order.stockit?
|
- unless @order.stockit?
|
||||||
%th{style: "width:70px;"}= heading_helper OrderArticle, :missing_units, short: true
|
%th{style: "width:70px;"}= heading_helper OrderArticle, :missing_units, short: true
|
||||||
|
@ -82,13 +94,12 @@
|
||||||
%i.icon-tag
|
%i.icon-tag
|
||||||
%td{colspan: "9"}
|
%td{colspan: "9"}
|
||||||
- order_articles.each do |order_article|
|
- order_articles.each do |order_article|
|
||||||
%tr{class: "#{cycle('even', 'odd', name: 'articles')} order-article #{get_missing_units_css_class(@ordering_data[:order_articles][order_article.id][:missing_units])}", valign: "top", tabindex: "0"}
|
%tr{class: "#{cycle('even', 'odd', name: 'articles')} order-article #{get_missing_units_css_class(@ordering_data[:order_articles][order_article.id][:missing_units])}", valign: "top"}
|
||||||
%td.name= order_article.article.name
|
%td.name= order_article.article.name
|
||||||
- if @order.stockit?
|
- if @order.stockit?
|
||||||
%td= truncate order_article.article.supplier.name, length: 15
|
%td= truncate order_article.article.supplier.name, length: 15
|
||||||
%td= h order_article.article.origin
|
%td= h order_article.article.origin
|
||||||
%td= number_to_currency(@ordering_data[:order_articles][order_article.id][:price])
|
%td= number_to_currency(@ordering_data[:order_articles][order_article.id][:price])
|
||||||
%td= price_per_base_unit(article: order_article.article, price: @ordering_data[:order_articles][order_article.id][:price])
|
|
||||||
%td= order_article.article.unit
|
%td= order_article.article.unit
|
||||||
%td
|
%td
|
||||||
- if @order.stockit?
|
- if @order.stockit?
|
||||||
|
@ -97,16 +108,15 @@
|
||||||
%span{id: "missing_units_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:missing_units]
|
%span{id: "missing_units_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:missing_units]
|
||||||
|
|
||||||
%td.quantity
|
%td.quantity
|
||||||
.outer{style: "diyplay: inline-block; float: left; width: 50px;"}
|
|
||||||
%input{id: "q_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][quantity]", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:quantity], 'data-min' => (@ordering_data[:order_articles][order_article.id][:quantity] if @order.boxfill?), 'data-max' => (@ordering_data[:order_articles][order_article.id][:quantity]+@ordering_data[:order_articles][order_article.id][:missing_units] if @order.boxfill?)}/
|
%input{id: "q_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][quantity]", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:quantity], 'data-min' => (@ordering_data[:order_articles][order_article.id][:quantity] if @order.boxfill?), 'data-max' => (@ordering_data[:order_articles][order_article.id][:quantity]+@ordering_data[:order_articles][order_article.id][:missing_units] if @order.boxfill?)}/
|
||||||
%span.used{id: "q_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_quantity]
|
%span.used{id: "q_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_quantity]
|
||||||
+
|
+
|
||||||
%span.unused{id: "q_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] - @ordering_data[:order_articles][order_article.id][:used_quantity]
|
%span.unused{id: "q_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] - @ordering_data[:order_articles][order_article.id][:used_quantity]
|
||||||
.btn-group
|
.btn-group
|
||||||
%a.btn.btn-ordering{'data-decrease_quantity' => order_article.id}
|
|
||||||
%i.icon-minus
|
|
||||||
%a.btn.btn-ordering{'data-increase_quantity' => order_article.id}
|
%a.btn.btn-ordering{'data-increase_quantity' => order_article.id}
|
||||||
%i.icon-plus
|
%i.icon-plus
|
||||||
|
%a.btn.btn-ordering{'data-decrease_quantity' => order_article.id}
|
||||||
|
%i.icon-minus
|
||||||
|
|
||||||
%td.tolerance{style: ('display:none' if @order.stockit?)}
|
%td.tolerance{style: ('display:none' if @order.stockit?)}
|
||||||
%input{id: "t_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][tolerance]", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:tolerance], 'data-min' => (@ordering_data[:order_articles][order_article.id][:tolerance] if @order.boxfill?)}/
|
%input{id: "t_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][tolerance]", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:tolerance], 'data-min' => (@ordering_data[:order_articles][order_article.id][:tolerance] if @order.boxfill?)}/
|
||||||
|
@ -115,10 +125,10 @@
|
||||||
+
|
+
|
||||||
%span.unused{id: "t_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] - @ordering_data[:order_articles][order_article.id][:used_tolerance]
|
%span.unused{id: "t_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] - @ordering_data[:order_articles][order_article.id][:used_tolerance]
|
||||||
.btn-group
|
.btn-group
|
||||||
%a.btn.btn-ordering{'data-decrease_tolerance' => order_article.id}
|
|
||||||
%i.icon-minus
|
|
||||||
%a.btn.btn-ordering{'data-increase_tolerance' => order_article.id}
|
%a.btn.btn-ordering{'data-increase_tolerance' => order_article.id}
|
||||||
%i.icon-plus
|
%i.icon-plus
|
||||||
|
%a.btn.btn-ordering{'data-decrease_tolerance' => order_article.id}
|
||||||
|
%i.icon-minus
|
||||||
|
|
||||||
%td{id: "td_price_#{order_article.id}", style: "text-align:right; padding-right:10px; width:4em"}
|
%td{id: "td_price_#{order_article.id}", style: "text-align:right; padding-right:10px; width:4em"}
|
||||||
%span{id: "price_#{order_article.id}_display"}= number_to_currency(@ordering_data[:order_articles][order_article.id][:total_price])
|
%span{id: "price_#{order_article.id}_display"}= number_to_currency(@ordering_data[:order_articles][order_article.id][:total_price])
|
||||||
|
@ -144,7 +154,25 @@
|
||||||
#order-footer
|
#order-footer
|
||||||
#info-box
|
#info-box
|
||||||
#total-sum
|
#total-sum
|
||||||
= render 'total_sum'
|
%table
|
||||||
|
%tr
|
||||||
|
%td= t('.total_sum_amount') + ':'
|
||||||
|
%td.currency
|
||||||
|
%span#total_price= number_to_currency(@group_order.price)
|
||||||
|
%tr
|
||||||
|
- if FoodsoftConfig[:charge_members_manually]
|
||||||
|
- old_balance = @ordering_data[:account_balance]
|
||||||
|
%td= heading_helper(Ordergroup, :account_balance) + ':'
|
||||||
|
%td.currency= number_to_currency(@ordering_data[:account_balance])
|
||||||
|
- else
|
||||||
|
- old_balance = @ordering_data[:available_funds]
|
||||||
|
%td= heading_helper(Ordergroup, :available_funds) + ':'
|
||||||
|
%td.currency= number_to_currency(@ordering_data[:available_funds])
|
||||||
|
%tr
|
||||||
|
%td= t('.new_funds') + ':'
|
||||||
|
%td.currency
|
||||||
|
%strong
|
||||||
|
%span#new_balance= number_to_currency(old_balance - @group_order.price)
|
||||||
#order-button
|
#order-button
|
||||||
= submit_tag( t('.action_save'), id: 'submit_button', class: 'btn btn-primary' )
|
= submit_tag( t('.action_save'), id: 'submit_button', class: 'btn btn-primary' )
|
||||||
#{link_to t('ui.or_cancel'), group_orders_path}
|
#{link_to t('ui.or_cancel'), group_orders_path}
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
- orders = Order.open.started
|
- orders = Order.open.started.reject{ |order| order == current_order }
|
||||||
- unless orders.empty?
|
- unless orders.empty?
|
||||||
%ul.nav.nav-pills.nav-stacked
|
%h2= t '.title'
|
||||||
.nav-header= t '.title'
|
%ul.unstyled
|
||||||
%li= link_to t('ui.overview'), :group_orders
|
|
||||||
- orders.each do |order|
|
- orders.each do |order|
|
||||||
.btn-small.pull-right
|
%li
|
||||||
=link_to_ordering(order, style: (order == current_order ? 'color: white' : '' ), 'data-confirm_switch_order' => true){ t 'ui.edit' }
|
= link_to_ordering(order, 'data-confirm_switch_order' => true)
|
||||||
%li( class="#{ order == current_order ? 'active' : ''}")
|
- if order.ends
|
||||||
=link_to_ordering(order, show: true, 'data-confirm_switch_order' => true)
|
= t '.remaining', remaining: time_ago_in_words(order.ends)
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
%table
|
|
||||||
%tr
|
|
||||||
%td= t('group_orders.form.total_sum_amount') + ':'
|
|
||||||
%td.currency
|
|
||||||
%span#total_price= number_to_currency(@group_order.price)
|
|
||||||
%tr
|
|
||||||
- if FoodsoftConfig[:charge_members_manually]
|
|
||||||
- old_balance = @ordering_data[:account_balance]
|
|
||||||
%td= heading_helper(Ordergroup, :account_balance) + ':'
|
|
||||||
%td.currency= number_to_currency(@ordering_data[:account_balance])
|
|
||||||
- else
|
|
||||||
- old_balance = @ordering_data[:available_funds]
|
|
||||||
%td= heading_helper(Ordergroup, :available_funds) + ':'
|
|
||||||
%td.currency= number_to_currency(@ordering_data[:available_funds])
|
|
||||||
%tr
|
|
||||||
%td= t('group_orders.form.new_funds') + ':'
|
|
||||||
%td.currency
|
|
||||||
%strong
|
|
||||||
%span#new_balance= number_to_currency(old_balance - @group_order.price)
|
|
|
@ -18,13 +18,10 @@
|
||||||
%th= heading_helper Ordergroup, :available_funds
|
%th= heading_helper Ordergroup, :available_funds
|
||||||
%th.numeric= number_to_currency(@ordergroup.get_available_funds)
|
%th.numeric= number_to_currency(@ordergroup.get_available_funds)
|
||||||
|
|
||||||
.row-fluid
|
|
||||||
.span9
|
|
||||||
= render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup}
|
= render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup}
|
||||||
|
|
||||||
// finished orders
|
// finished orders
|
||||||
- unless @finished_not_closed_orders_including_group_order.empty?
|
- unless @finished_not_closed_orders_including_group_order.empty?
|
||||||
.row-fluid
|
|
||||||
.span9
|
|
||||||
%section
|
%section
|
||||||
%h2= t '.finished_orders.title'
|
%h2= t '.finished_orders.title'
|
||||||
= render partial: 'orders', locals: {orders: @finished_not_closed_orders_including_group_order, pagination: false}
|
= render partial: 'orders', locals: {orders: @finished_not_closed_orders_including_group_order, pagination: false}
|
||||||
|
@ -35,8 +32,6 @@
|
||||||
|
|
||||||
// closed orders
|
// closed orders
|
||||||
- unless @closed_orders_including_group_order.empty?
|
- unless @closed_orders_including_group_order.empty?
|
||||||
.row-fluid
|
|
||||||
.span9
|
|
||||||
%section
|
%section
|
||||||
%h2= t '.closed_orders.title'
|
%h2= t '.closed_orders.title'
|
||||||
= render partial: 'orders', locals: {orders: @closed_orders_including_group_order, pagination: false}
|
= render partial: 'orders', locals: {orders: @closed_orders_including_group_order, pagination: false}
|
||||||
|
|
|
@ -7,52 +7,44 @@
|
||||||
- title t('.title', order: @order.name)
|
- title t('.title', order: @order.name)
|
||||||
|
|
||||||
.row-fluid
|
.row-fluid
|
||||||
|
.well.pull-left
|
||||||
.well.span2
|
// Order summary
|
||||||
= render 'switch_order', current_order: @order
|
|
||||||
.well.span9
|
|
||||||
%h2= t '.articles.title'
|
|
||||||
%dl.dl-horizontal
|
%dl.dl-horizontal
|
||||||
// Name
|
|
||||||
%dt= heading_helper Order, :name
|
%dt= heading_helper Order, :name
|
||||||
%dd= @order.name
|
%dd= @order.name
|
||||||
// Order Ends
|
%dt= heading_helper Order, :note
|
||||||
|
%dd= @order.note
|
||||||
%dt= heading_helper Order, :ends
|
%dt= heading_helper Order, :ends
|
||||||
%dd= format_time(@order.ends)
|
%dd= format_time(@order.ends)
|
||||||
// Pickup
|
|
||||||
- unless @order.pickup.blank?
|
|
||||||
%dt= heading_helper Order, :pickup
|
%dt= heading_helper Order, :pickup
|
||||||
%dd= format_date(@order.pickup)
|
%dd= format_date(@order.pickup)
|
||||||
// Min Order Quantity
|
%dt= heading_helper GroupOrder, :price
|
||||||
- unless @order.stockit? or @order.supplier.min_order_quantity.blank?
|
|
||||||
%dt= heading_helper Supplier, :min_order_quantity, short: true
|
|
||||||
%dd= @order.supplier.min_order_quantity
|
|
||||||
// Group Order Sum Amount
|
|
||||||
%dt= t 'group_orders.form.sum_amount'
|
|
||||||
%dd= number_to_currency @order.sum
|
|
||||||
// Created By
|
|
||||||
%dt= heading_helper Order, :created_by
|
|
||||||
%dd= show_user_link(@order.created_by)
|
|
||||||
// Updated By
|
|
||||||
- unless @group_order.new_record?
|
|
||||||
%dt= heading_helper GroupOrder, :updated_by
|
|
||||||
%dd
|
%dd
|
||||||
= show_user(@group_order.updated_by)
|
- if @group_order
|
||||||
(#{format_time(@group_order.updated_on)})
|
= number_to_currency(@group_order.price)
|
||||||
// Closed By
|
- else
|
||||||
|
= t '.not_ordered'
|
||||||
|
- if @group_order && @group_order.transport
|
||||||
|
%dt= heading_helper GroupOrder, :transport
|
||||||
|
%dd= number_to_currency(@group_order.transport)
|
||||||
|
%dt= heading_helper GroupOrder, :total
|
||||||
|
%dd= number_to_currency(@group_order.total)
|
||||||
- if @order.closed?
|
- if @order.closed?
|
||||||
%dt= heading_helper Order, :closed_by
|
%dt= heading_helper Order, :closed_by
|
||||||
%dd= show_user_link @order.updated_by
|
%dd= show_user_link @order.updated_by
|
||||||
// Note
|
%p= link_to t('.comment'), "#comments"
|
||||||
- unless @order.note.blank?
|
|
||||||
%dt= heading_helper Order, :note
|
.well.pull-right
|
||||||
%dd= @order.note
|
= close_button :alert
|
||||||
|
= render 'switch_order', current_order: @order
|
||||||
|
|
||||||
// Article box
|
// Article box
|
||||||
%section
|
%section
|
||||||
|
%h2= t '.articles.title'
|
||||||
.column_content#result
|
.column_content#result
|
||||||
- if @group_order
|
- if @group_order
|
||||||
%p= link_to t('.articles.show_hide'), '#', 'data-toggle-this' => 'tr.ignored'
|
%p.pull-right= link_to t('.articles.show_hide'), '#', 'data-toggle-this' => 'tr.ignored'
|
||||||
|
%p= link_to(t('.articles.edit_order'), edit_group_order_path(@group_order, order_id: @order.id), class: 'btn btn-primary') if @order.open?
|
||||||
%table.table.table-hover
|
%table.table.table-hover
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
|
@ -105,15 +97,15 @@
|
||||||
%th= number_to_currency(@group_order.total)
|
%th= number_to_currency(@group_order.total)
|
||||||
%br/
|
%br/
|
||||||
= link_to_top
|
= link_to_top
|
||||||
%p.pull-right= link_to(t('.articles.edit_order'), edit_group_order_path(@group_order, order_id: @order.id), class: 'btn btn-primary') if @order.open?
|
|
||||||
- else
|
- else
|
||||||
- if @order.open?
|
- if @order.open?
|
||||||
= t '.articles.not_ordered_msg'
|
= t '.articles.not_ordered_msg'
|
||||||
= link_to t('.articles.order_now'), action: "order", id: @order
|
= link_to t('.articles.order_now'), action: "order", id: @order
|
||||||
- else
|
- else
|
||||||
= t '.articles.order_closed_msg'
|
= t '.articles.order_closed_msg'
|
||||||
|
|
||||||
// Comments box
|
// Comments box
|
||||||
%hr
|
%section
|
||||||
%h2= t '.comments.title'
|
%h2= t '.comments.title'
|
||||||
#comments
|
#comments
|
||||||
= render 'shared/comments', comments: @order.comments
|
= render 'shared/comments', comments: @order.comments
|
||||||
|
|
|
@ -8,10 +8,10 @@
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
= stylesheet_link_tag "application", :media => "all"
|
= stylesheet_link_tag "application", :media => "all"
|
||||||
//%link(href="images/favicon.ico" rel="shortcut icon")
|
//%link(href="images/favicon.ico" rel="shortcut icon")
|
||||||
|
|
||||||
= yield(:head)
|
= yield(:head)
|
||||||
= foodcoop_css_tag
|
= foodcoop_css_tag
|
||||||
|
|
||||||
|
|
||||||
%body
|
%body
|
||||||
= yield
|
= yield
|
||||||
|
|
||||||
|
@ -19,9 +19,7 @@
|
||||||
Javascripts
|
Javascripts
|
||||||
\==================================================
|
\==================================================
|
||||||
/ Placed at the end of the document so the pages load faster
|
/ Placed at the end of the document so the pages load faster
|
||||||
= javascript_importmap_tags
|
= javascript_include_tag "application"
|
||||||
= javascript_include_tag "application_legacy"
|
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
I18n.defaultLocale = "#{I18n.default_locale}";
|
I18n.defaultLocale = "#{I18n.default_locale}";
|
||||||
I18n.locale = "#{I18n.locale}";
|
I18n.locale = "#{I18n.locale}";
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
<div class="trix-content">
|
|
||||||
<%= yield -%>
|
|
||||||
</div>
|
|
|
@ -1,12 +0,0 @@
|
||||||
= yield
|
|
||||||
\
|
|
||||||
%hr
|
|
||||||
%ul
|
|
||||||
%li
|
|
||||||
%a{href: root_url} Foodsoft
|
|
||||||
- if FoodsoftConfig[:homepage]
|
|
||||||
%li
|
|
||||||
%a{href: FoodsoftConfig[:homepage]} Foodcoop
|
|
||||||
- if FoodsoftConfig[:help_url]
|
|
||||||
%li
|
|
||||||
%a{href: FoodsoftConfig[:help_url]}= t '.help'
|
|
|
@ -1,15 +0,0 @@
|
||||||
= simple_form_for :custom_csv,format: :csv, :url => order_path(@order, view: @view, format: :csv), method: :get do |f|
|
|
||||||
.modal-header
|
|
||||||
= close_button :modal
|
|
||||||
.h3=I18n.t('.orders.custom_csv.description')
|
|
||||||
.modal-body
|
|
||||||
= f.input :first, as: :select, collection: custom_csv_collection, label: "1. " + I18n.t('.orders.custom_csv.column')
|
|
||||||
= f.input :second, as: :select, collection: custom_csv_collection, required: false, label: "2. " + I18n.t('.orders.custom_csv.column')
|
|
||||||
= f.input :third, as: :select, collection: custom_csv_collection, required: false, label: "3. " + I18n.t('.orders.custom_csv.column')
|
|
||||||
= f.input :fourth, as: :select, collection: custom_csv_collection, required: false, label: "4. " + I18n.t('.orders.custom_csv.column')
|
|
||||||
= f.input :fifth, as: :select, collection: custom_csv_collection, required: false, label: "5. " + I18n.t('.orders.custom_csv.column')
|
|
||||||
= f.input :sixth, as: :select, collection: custom_csv_collection, required: false, label: "6. " + I18n.t('.orders.custom_csv.column')
|
|
||||||
= f.input :seventh, as: :select, collection: custom_csv_collection, required: false, label: "7. " + I18n.t('.orders.custom_csv.column')
|
|
||||||
.modal-footer
|
|
||||||
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
|
|
||||||
= f.submit class: 'btn btn-primary'
|
|
|
@ -1,3 +0,0 @@
|
||||||
$('#modalContainer').html('#{j(render("custom_csv_form"))}');
|
|
||||||
$('#modalContainer').modal();
|
|
||||||
$('#modalContainer').submit(function() {$('#modalContainer').modal('hide');});
|
|
|
@ -9,7 +9,6 @@
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th= heading_helper Order, :name
|
%th= heading_helper Order, :name
|
||||||
%th
|
|
||||||
%th= heading_helper Order, :pickup
|
%th= heading_helper Order, :pickup
|
||||||
%th= heading_helper Order, :ends
|
%th= heading_helper Order, :ends
|
||||||
%th= t '.who_ordered'
|
%th= t '.who_ordered'
|
||||||
|
@ -18,23 +17,21 @@
|
||||||
- total = 0
|
- total = 0
|
||||||
- orders.each do |order|
|
- orders.each do |order|
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td= link_to_ordering(order)
|
||||||
= link_to_ordering(order, show: true)
|
|
||||||
%td
|
|
||||||
.btn-small= link_to_ordering(order){ t 'ui.edit' }
|
|
||||||
%td= format_date(order.pickup) unless order.pickup.nil?
|
%td= format_date(order.pickup) unless order.pickup.nil?
|
||||||
%td= format_time(order.ends) unless order.ends.nil?
|
%td= format_time(order.ends) unless order.ends.nil?
|
||||||
- if group_order = order.group_order(ordergroup)
|
- if group_order = order.group_order(ordergroup)
|
||||||
- total += group_order.price
|
- total += group_order.price
|
||||||
%td= "#{show_user group_order.updated_by} (#{format_time(group_order.updated_on)})"
|
%td= "#{show_user group_order.updated_by} (#{format_time(group_order.updated_on)})"
|
||||||
%td.numeric
|
%td.numeric
|
||||||
|
= link_to_ordering(order, show: true) do
|
||||||
= number_to_currency(group_order.price)
|
= number_to_currency(group_order.price)
|
||||||
- else
|
- else
|
||||||
%td{:colspan => 2}
|
%td{:colspan => 2}
|
||||||
- if total > 0
|
- if total > 0
|
||||||
%tfooter
|
%tfooter
|
||||||
%tr
|
%tr
|
||||||
%th(colspan="4")
|
%th(colspan="3")
|
||||||
%th= t('.total_sum') + ':'
|
%th= t('.total_sum') + ':'
|
||||||
%th.numeric= number_to_currency(total)
|
%th.numeric= number_to_currency(total)
|
||||||
- else
|
- else
|
||||||
|
|
|
@ -10,4 +10,3 @@
|
||||||
- unless order.stockit?
|
- unless order.stockit?
|
||||||
%li= link_to t('.fax_txt'), order_path(order, format: :txt), {title: t('.download_file')}
|
%li= link_to t('.fax_txt'), order_path(order, format: :txt), {title: t('.download_file')}
|
||||||
%li= link_to t('.fax_csv'), order_path(order, format: :csv), {title: t('.download_file')}
|
%li= link_to t('.fax_csv'), order_path(order, format: :csv), {title: t('.download_file')}
|
||||||
%li= link_to t('.custom_csv'), custom_csv_order_path(order), remote: true
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/usr/bin/env ruby
|
|
||||||
|
|
||||||
require_relative "../config/application"
|
|
||||||
require "importmap/commands"
|
|
29
bin/setup
|
@ -1,33 +1,36 @@
|
||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
require "fileutils"
|
require 'fileutils'
|
||||||
|
include FileUtils
|
||||||
|
|
||||||
# path to your application root.
|
# path to your application root.
|
||||||
APP_ROOT = File.expand_path("..", __dir__)
|
APP_ROOT = File.expand_path('..', __dir__)
|
||||||
|
|
||||||
def system!(*args)
|
def system!(*args)
|
||||||
system(*args) || abort("\n== Command #{args} failed ==")
|
system(*args) || abort("\n== Command #{args} failed ==")
|
||||||
end
|
end
|
||||||
|
|
||||||
FileUtils.chdir APP_ROOT do
|
chdir APP_ROOT do
|
||||||
# This script is a way to set up or update your development environment automatically.
|
# This script is a starting point to setup your application.
|
||||||
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
|
||||||
# Add necessary setup steps to this file.
|
# Add necessary setup steps to this file.
|
||||||
|
|
||||||
puts "== Installing dependencies =="
|
puts '== Installing dependencies =='
|
||||||
system! "gem install bundler --conservative"
|
system! 'gem install bundler --conservative'
|
||||||
system("bundle check") || system!("bundle install")
|
system('bundle check') || system!('bundle install')
|
||||||
|
|
||||||
|
# Install JavaScript dependencies if using Yarn
|
||||||
|
# system('bin/yarn')
|
||||||
|
|
||||||
# puts "\n== Copying sample files =="
|
# puts "\n== Copying sample files =="
|
||||||
# unless File.exist?("config/database.yml")
|
# unless File.exist?('config/database.yml')
|
||||||
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
|
# cp 'config/database.yml.sample', 'config/database.yml'
|
||||||
# end
|
# end
|
||||||
|
|
||||||
puts "\n== Preparing database =="
|
puts "\n== Preparing database =="
|
||||||
system! "bin/rails db:prepare"
|
system! 'bin/rails db:setup'
|
||||||
|
|
||||||
puts "\n== Removing old logs and tempfiles =="
|
puts "\n== Removing old logs and tempfiles =="
|
||||||
system! "bin/rails log:clear tmp:clear"
|
system! 'bin/rails log:clear tmp:clear'
|
||||||
|
|
||||||
puts "\n== Restarting application server =="
|
puts "\n== Restarting application server =="
|
||||||
system! "bin/rails restart"
|
system! 'bin/rails restart'
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ Bundler.require(*Rails.groups)
|
||||||
module Foodsoft
|
module Foodsoft
|
||||||
class Application < Rails::Application
|
class Application < Rails::Application
|
||||||
# Initialize configuration defaults for originally generated Rails version.
|
# Initialize configuration defaults for originally generated Rails version.
|
||||||
config.load_defaults 7.0
|
config.load_defaults 5.0
|
||||||
|
|
||||||
# Settings in config/environments/* take precedence over those specified here.
|
# Settings in config/environments/* take precedence over those specified here.
|
||||||
# Application configuration can go into files in config/initializers
|
# Application configuration can go into files in config/initializers
|
||||||
|
@ -36,6 +36,9 @@ module Foodsoft
|
||||||
# Configure the default encoding used in templates for Ruby 1.9.
|
# Configure the default encoding used in templates for Ruby 1.9.
|
||||||
config.encoding = "utf-8"
|
config.encoding = "utf-8"
|
||||||
|
|
||||||
|
# TODO: Remove this. See CVE-2022-32224 for details.
|
||||||
|
config.active_record.yaml_column_permitted_classes = [BigDecimal, Date, Symbol, Time]
|
||||||
|
|
||||||
# Enable escaping HTML in JSON.
|
# Enable escaping HTML in JSON.
|
||||||
config.active_support.escape_html_entities_in_json = true
|
config.active_support.escape_html_entities_in_json = true
|
||||||
|
|
||||||
|
@ -63,14 +66,6 @@ module Foodsoft
|
||||||
# Load legacy scripts from vendor
|
# Load legacy scripts from vendor
|
||||||
config.assets.precompile += ['vendor/assets/javascripts/*.js']
|
config.assets.precompile += ['vendor/assets/javascripts/*.js']
|
||||||
|
|
||||||
config.active_record.yaml_column_permitted_classes = [Symbol, BigDecimal]
|
|
||||||
|
|
||||||
config.autoloader = :zeitwerk
|
|
||||||
|
|
||||||
config.active_storage.variant_processor = :mini_magick
|
|
||||||
|
|
||||||
# Ex:- :default =>''
|
|
||||||
|
|
||||||
# CORS for API
|
# CORS for API
|
||||||
config.middleware.insert_before 0, Rack::Cors do
|
config.middleware.insert_before 0, Rack::Cors do
|
||||||
allow do
|
allow do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require "active_support/core_ext/integer/time"
|
|
||||||
|
|
||||||
# Foodsoft production configuration.
|
# Foodsoft production configuration.
|
||||||
#
|
#
|
||||||
# This file is in the public domain.
|
# This file is in the public domain.
|
||||||
|
@ -29,23 +27,23 @@ Rails.application.configure do
|
||||||
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
||||||
|
|
||||||
# Compress JavaScripts and CSS.
|
# Compress JavaScripts and CSS.
|
||||||
config.assets.js_compressor = :terser
|
config.assets.js_compressor = :uglifier
|
||||||
config.assets.css_compressor = :sass
|
config.assets.css_compressor = :sass
|
||||||
|
|
||||||
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
||||||
config.assets.compile = false
|
config.assets.compile = false
|
||||||
|
|
||||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||||
# config.asset_host = "http://assets.example.com"
|
# config.action_controller.asset_host = 'http://assets.example.com'
|
||||||
|
|
||||||
# Specifies the header that your server uses for sending files.
|
# Specifies the header that your server uses for sending files.
|
||||||
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
||||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
||||||
|
|
||||||
# Store uploaded files on the local file system (see config/storage.yml for options).
|
# Store uploaded files on the local file system (see config/storage.yml for options)
|
||||||
config.active_storage.service = :local
|
config.active_storage.service = :local
|
||||||
|
|
||||||
# Mount Action Cable outside main process or domain.
|
# Mount Action Cable outside main process or domain
|
||||||
# config.action_cable.mount_path = nil
|
# config.action_cable.mount_path = nil
|
||||||
# config.action_cable.url = 'wss://example.com/cable'
|
# config.action_cable.url = 'wss://example.com/cable'
|
||||||
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
||||||
|
@ -53,8 +51,6 @@ Rails.application.configure do
|
||||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||||
config.force_ssl = ENV["RAILS_FORCE_SSL"] != "false"
|
config.force_ssl = ENV["RAILS_FORCE_SSL"] != "false"
|
||||||
|
|
||||||
# Include generic and useful information about system operation, but avoid logging too much
|
|
||||||
# information to avoid inadvertent exposure of personally identifiable information (PII).
|
|
||||||
# Set to :debug to see everything in the log.
|
# Set to :debug to see everything in the log.
|
||||||
config.log_level = :info
|
config.log_level = :info
|
||||||
|
|
||||||
|
@ -67,10 +63,6 @@ Rails.application.configure do
|
||||||
# Use a different cache store in production.
|
# Use a different cache store in production.
|
||||||
# config.cache_store = :mem_cache_store
|
# config.cache_store = :mem_cache_store
|
||||||
|
|
||||||
# Use a real queuing backend for Active Job (and separate queues per environment).
|
|
||||||
# config.active_job.queue_adapter = :resque
|
|
||||||
# config.active_job.queue_name_prefix = "foodsoft_production"
|
|
||||||
|
|
||||||
config.action_mailer.perform_caching = false
|
config.action_mailer.perform_caching = false
|
||||||
|
|
||||||
# Ignore bad email addresses and do not raise email delivery errors.
|
# Ignore bad email addresses and do not raise email delivery errors.
|
||||||
|
@ -106,7 +98,7 @@ Rails.application.configure do
|
||||||
end
|
end
|
||||||
|
|
||||||
# Use default logging formatter so that PID and timestamp are not suppressed.
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
||||||
config.log_formatter = Logger::Formatter.new
|
config.log_formatter = ::Logger::Formatter.new
|
||||||
|
|
||||||
# Use a different logger for distributed setups.
|
# Use a different logger for distributed setups.
|
||||||
# require 'syslog/logger'
|
# require 'syslog/logger'
|
||||||
|
|
|
@ -1,31 +1,30 @@
|
||||||
require "active_support/core_ext/integer/time"
|
# Foodsoft test configuration.
|
||||||
|
#
|
||||||
|
# This file is in the public domain.
|
||||||
|
|
||||||
|
Rails.application.configure do
|
||||||
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
# The test environment is used exclusively to run your application's
|
# The test environment is used exclusively to run your application's
|
||||||
# test suite. You never need to work with it otherwise. Remember that
|
# test suite. You never need to work with it otherwise. Remember that
|
||||||
# your test database is "scratch space" for the test suite and is wiped
|
# your test database is "scratch space" for the test suite and is wiped
|
||||||
# and recreated between test runs. Don't rely on the data there!
|
# and recreated between test runs. Don't rely on the data there!
|
||||||
|
|
||||||
Rails.application.configure do
|
|
||||||
# Settings specified here will take precedence over those in config/application.rb.
|
|
||||||
|
|
||||||
# Turn false under Spring and add config.action_view.cache_template_loading = true.
|
|
||||||
config.cache_classes = true
|
config.cache_classes = true
|
||||||
|
|
||||||
# Eager loading loads your whole application. When running a single test locally,
|
# Do not eager load code on boot. This avoids loading your whole application
|
||||||
# this probably isn't necessary. It's a good idea to do in a continuous integration
|
# just for the purpose of running a single test. If you are using a tool that
|
||||||
# system, or in some way before deploying your code.
|
# preloads Rails for running tests, you may have to set it to true.
|
||||||
config.eager_load = ENV["CI"].present?
|
config.eager_load = false
|
||||||
|
|
||||||
# Configure public file server for tests with Cache-Control for performance.
|
# Configure public file server for tests with Cache-Control for performance.
|
||||||
config.public_file_server.enabled = true
|
config.public_file_server.enabled = true
|
||||||
config.public_file_server.headers = {
|
config.public_file_server.headers = {
|
||||||
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Show full error reports and disable caching.
|
# Show full error reports and disable caching.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
config.action_controller.perform_caching = false
|
config.action_controller.perform_caching = false
|
||||||
config.cache_store = :null_store
|
|
||||||
|
|
||||||
# Raise exceptions instead of rendering exception templates.
|
# Raise exceptions instead of rendering exception templates.
|
||||||
config.action_dispatch.show_exceptions = false
|
config.action_dispatch.show_exceptions = false
|
||||||
|
@ -33,7 +32,7 @@ Rails.application.configure do
|
||||||
# Disable request forgery protection in test environment.
|
# Disable request forgery protection in test environment.
|
||||||
config.action_controller.allow_forgery_protection = false
|
config.action_controller.allow_forgery_protection = false
|
||||||
|
|
||||||
# Store uploaded files on the local file system in a temporary directory.
|
# Store uploaded files on the local file system in a temporary directory
|
||||||
config.active_storage.service = :test
|
config.active_storage.service = :test
|
||||||
|
|
||||||
config.action_mailer.perform_caching = false
|
config.action_mailer.perform_caching = false
|
||||||
|
@ -46,15 +45,6 @@ Rails.application.configure do
|
||||||
# Print deprecation notices to the stderr.
|
# Print deprecation notices to the stderr.
|
||||||
config.active_support.deprecation = :stderr
|
config.active_support.deprecation = :stderr
|
||||||
|
|
||||||
# Raise exceptions for disallowed deprecations.
|
# Raises error for missing translations
|
||||||
config.active_support.disallowed_deprecation = :raise
|
# config.action_view.raise_on_missing_translations = true
|
||||||
|
|
||||||
# Tell Active Support which deprecation messages to disallow.
|
|
||||||
config.active_support.disallowed_deprecation_warnings = []
|
|
||||||
|
|
||||||
# Raises error for missing translations.
|
|
||||||
# config.i18n.raise_on_missing_translations = true
|
|
||||||
|
|
||||||
# Annotate rendered view with file names.
|
|
||||||
# config.action_view.annotate_rendered_view_with_filenames = true
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
# Pin npm packages by running ./bin/importmap
|
|
||||||
pin "application", preload: true
|
|
||||||
pin "trix"
|
|
||||||
pin "@rails/actiontext", to: "actiontext.js"
|
|
|
@ -5,8 +5,10 @@ Rails.application.config.assets.version = '1.0'
|
||||||
|
|
||||||
# Add additional assets to the asset load path.
|
# Add additional assets to the asset load path.
|
||||||
# Rails.application.config.assets.paths << Emoji.images_path
|
# Rails.application.config.assets.paths << Emoji.images_path
|
||||||
|
# Add Yarn node_modules folder to the asset load path.
|
||||||
|
Rails.application.config.assets.paths << Rails.root.join('node_modules')
|
||||||
|
|
||||||
# Precompile additional assets.
|
# Precompile additional assets.
|
||||||
# application.js, application.css, and all non-JS/CSS in the app/assets
|
# application.js, application.css, and all non-JS/CSS in the app/assets
|
||||||
# folder are already added.
|
# folder are already added.
|
||||||
Rails.application.config.assets.precompile += %w( application_legacy.js jquery.min.js )
|
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
# Define an application-wide content security policy.
|
# Define an application-wide content security policy
|
||||||
# See the Securing Rails Applications Guide for more information:
|
# For further information see the following documentation
|
||||||
# https://guides.rubyonrails.org/security.html#content-security-policy-header
|
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
||||||
|
|
||||||
# Rails.application.configure do
|
# Rails.application.config.content_security_policy do |policy|
|
||||||
# config.content_security_policy do |policy|
|
|
||||||
# policy.default_src :self, :https
|
# policy.default_src :self, :https
|
||||||
# policy.font_src :self, :https, :data
|
# policy.font_src :self, :https, :data
|
||||||
# policy.img_src :self, :https, :data
|
# policy.img_src :self, :https, :data
|
||||||
# policy.object_src :none
|
# policy.object_src :none
|
||||||
# policy.script_src :self, :https
|
# policy.script_src :self, :https
|
||||||
# policy.style_src :self, :https
|
# policy.style_src :self, :https
|
||||||
|
|
||||||
# # Specify URI for violation reports
|
# # Specify URI for violation reports
|
||||||
# # policy.report_uri "/csp-violation-report-endpoint"
|
# # policy.report_uri "/csp-violation-report-endpoint"
|
||||||
# end
|
# end
|
||||||
#
|
|
||||||
# # Generate session nonces for permitted importmap and inline scripts
|
# If you are using UJS then enable automatic nonce generation
|
||||||
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
|
||||||
# config.content_security_policy_nonce_directives = %w(script-src)
|
|
||||||
#
|
# Report CSP violations to a specified URI
|
||||||
# # Report violations without enforcing the policy.
|
# For further information see the following documentation:
|
||||||
# # config.content_security_policy_report_only = true
|
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
|
||||||
# end
|
# Rails.application.config.content_security_policy_report_only = true
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
# Be sure to restart your server when you modify this file.
|
|
||||||
|
|
||||||
# Avoid CORS issues when API is called from the frontend app.
|
|
||||||
# Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests.
|
|
||||||
|
|
||||||
# Read more: https://github.com/cyu/rack-cors
|
|
||||||
|
|
||||||
# Rails.application.config.middleware.insert_before 0, Rack::Cors do
|
|
||||||
# allow do
|
|
||||||
# origins "example.com"
|
|
||||||
#
|
|
||||||
# resource "*",
|
|
||||||
# headers: :any,
|
|
||||||
# methods: [:get, :post, :put, :patch, :delete, :options, :head]
|
|
||||||
# end
|
|
||||||
# end
|
|
|
@ -1,7 +1,7 @@
|
||||||
# remove all currency translations, so that we can set the default language and
|
# remove all currency translations, so that we can set the default language and
|
||||||
# have it shown in all other languages too
|
# have it shown in all other languages too
|
||||||
I18n.available_locales.each do |locale|
|
::I18n.available_locales.each do |locale|
|
||||||
unless locale == I18n.default_locale
|
unless locale == ::I18n.default_locale
|
||||||
I18n.backend.store_translations(locale, number: { currency: { format: { unit: nil } } })
|
::I18n.backend.store_translations(locale, number: { currency: { format: { unit: nil } } })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ class String
|
||||||
# remove comma from decimal inputs
|
# remove comma from decimal inputs
|
||||||
def self.delocalized_decimal(string)
|
def self.delocalized_decimal(string)
|
||||||
if !string.blank? and string.is_a?(String)
|
if !string.blank? and string.is_a?(String)
|
||||||
BigDecimal(string.sub(',', '.'))
|
BigDecimal.new(string.sub(',', '.'))
|
||||||
else
|
else
|
||||||
string
|
string
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
# Configure parameters to be filtered from the log file. Use this to limit dissemination of
|
# Configure sensitive parameters which will be filtered from the log file.
|
||||||
# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
|
Rails.application.config.filter_parameters += [:password]
|
||||||
# notations and behaviors.
|
|
||||||
Rails.application.config.filter_parameters += [
|
|
||||||
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
|
||||||
]
|
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
Rails.application.config.to_prepare do
|
|
||||||
FoodsoftMailReceiver.register BounceMailReceiver
|
FoodsoftMailReceiver.register BounceMailReceiver
|
||||||
end
|
|
||||||
|
|
17
config/initializers/new_framework_defaults.rb
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
#
|
||||||
|
# This file contains migration options to ease your Rails 5.0 upgrade.
|
||||||
|
#
|
||||||
|
# Once upgraded flip defaults one by one to migrate to the new default.
|
||||||
|
#
|
||||||
|
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
||||||
|
|
||||||
|
# Enable per-form CSRF tokens. Previous versions had false.
|
||||||
|
Rails.application.config.action_controller.per_form_csrf_tokens = false
|
||||||
|
|
||||||
|
# Enable origin-checking CSRF mitigation. Previous versions had false.
|
||||||
|
Rails.application.config.action_controller.forgery_protection_origin_check = false
|
||||||
|
|
||||||
|
# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
|
||||||
|
# Previous versions had false.
|
||||||
|
ActiveSupport.to_time_preserves_timezone = false
|
14
config/initializers/new_framework_defaults_5_1.rb
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
#
|
||||||
|
# This file contains migration options to ease your Rails 5.1 upgrade.
|
||||||
|
#
|
||||||
|
# Once upgraded flip defaults one by one to migrate to the new default.
|
||||||
|
#
|
||||||
|
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
||||||
|
|
||||||
|
# Make `form_with` generate non-remote forms.
|
||||||
|
Rails.application.config.action_view.form_with_generates_remote_forms = false
|
||||||
|
|
||||||
|
# Unknown asset fallback will return the path passed in when the given
|
||||||
|
# asset is not present in the asset pipeline.
|
||||||
|
# Rails.application.config.assets.unknown_asset_fallback = false
|
38
config/initializers/new_framework_defaults_5_2.rb
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
#
|
||||||
|
# This file contains migration options to ease your Rails 5.2 upgrade.
|
||||||
|
#
|
||||||
|
# Once upgraded flip defaults one by one to migrate to the new default.
|
||||||
|
#
|
||||||
|
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
||||||
|
|
||||||
|
# Make Active Record use stable #cache_key alongside new #cache_version method.
|
||||||
|
# This is needed for recyclable cache keys.
|
||||||
|
# Rails.application.config.active_record.cache_versioning = true
|
||||||
|
|
||||||
|
# Use AES-256-GCM authenticated encryption for encrypted cookies.
|
||||||
|
# Also, embed cookie expiry in signed or encrypted cookies for increased security.
|
||||||
|
#
|
||||||
|
# This option is not backwards compatible with earlier Rails versions.
|
||||||
|
# It's best enabled when your entire app is migrated and stable on 5.2.
|
||||||
|
#
|
||||||
|
# Existing cookies will be converted on read then written with the new scheme.
|
||||||
|
# Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true
|
||||||
|
|
||||||
|
# Use AES-256-GCM authenticated encryption as default cipher for encrypting messages
|
||||||
|
# instead of AES-256-CBC, when use_authenticated_message_encryption is set to true.
|
||||||
|
# Rails.application.config.active_support.use_authenticated_message_encryption = true
|
||||||
|
|
||||||
|
# Add default protection from forgery to ActionController::Base instead of in
|
||||||
|
# ApplicationController.
|
||||||
|
# Rails.application.config.action_controller.default_protect_from_forgery = true
|
||||||
|
|
||||||
|
# Store boolean values are in sqlite3 databases as 1 and 0 instead of 't' and
|
||||||
|
# 'f' after migrating old data.
|
||||||
|
Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
|
||||||
|
|
||||||
|
# Use SHA-1 instead of MD5 to generate non-sensitive digests, such as the ETag header.
|
||||||
|
# Rails.application.config.active_support.use_sha1_digests = true
|
||||||
|
|
||||||
|
# Make `form_with` generate id attributes for any generated HTML tags.
|
||||||
|
# Rails.application.config.action_view.form_with_generates_ids = true
|
|
@ -1,11 +0,0 @@
|
||||||
# Define an application-wide HTTP permissions policy. For further
|
|
||||||
# information see https://developers.google.com/web/updates/2018/06/feature-policy
|
|
||||||
#
|
|
||||||
# Rails.application.config.permissions_policy do |f|
|
|
||||||
# f.camera :none
|
|
||||||
# f.gyroscope :none
|
|
||||||
# f.microphone :none
|
|
||||||
# f.usb :none
|
|
||||||
# f.fullscreen :self
|
|
||||||
# f.payment :self, "https://secure.example.com"
|
|
||||||
# end
|
|
98
config/initializers/rails6_backports.rb
Normal file
|
@ -0,0 +1,98 @@
|
||||||
|
raise "Remove no-longer-needed #{__FILE__}!" if Rails::VERSION::MAJOR >= 6
|
||||||
|
|
||||||
|
require "weakref"
|
||||||
|
|
||||||
|
module ActiveRecord
|
||||||
|
# Backport https://github.com/rails/rails/pull/36998 and https://github.com/rails/rails/pull/36999
|
||||||
|
# to avoid `ThreadError: can't create Thread: Resource temporarily unavailable` issues
|
||||||
|
module ConnectionAdapters
|
||||||
|
class ConnectionPool
|
||||||
|
class Reaper
|
||||||
|
@mutex = Mutex.new
|
||||||
|
@pools = {}
|
||||||
|
@threads = {}
|
||||||
|
|
||||||
|
class << self
|
||||||
|
def register_pool(pool, frequency) # :nodoc:
|
||||||
|
@mutex.synchronize do
|
||||||
|
unless @threads[frequency]&.alive?
|
||||||
|
@threads[frequency] = spawn_thread(frequency)
|
||||||
|
end
|
||||||
|
@pools[frequency] ||= []
|
||||||
|
@pools[frequency] << WeakRef.new(pool)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def spawn_thread(frequency)
|
||||||
|
Thread.new(frequency) do |t|
|
||||||
|
running = true
|
||||||
|
while running
|
||||||
|
sleep t
|
||||||
|
@mutex.synchronize do
|
||||||
|
@pools[frequency].select!(&:weakref_alive?)
|
||||||
|
@pools[frequency].each do |p|
|
||||||
|
p.reap
|
||||||
|
p.flush
|
||||||
|
rescue WeakRef::RefError
|
||||||
|
end
|
||||||
|
|
||||||
|
if @pools[frequency].empty?
|
||||||
|
@pools.delete(frequency)
|
||||||
|
@threads.delete(frequency)
|
||||||
|
running = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def run
|
||||||
|
return unless frequency && frequency > 0
|
||||||
|
|
||||||
|
self.class.register_pool(pool, frequency)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def reap
|
||||||
|
stale_connections = synchronize do
|
||||||
|
return unless @connections
|
||||||
|
|
||||||
|
@connections.select do |conn|
|
||||||
|
conn.in_use? && !conn.owner.alive?
|
||||||
|
end.each(&:steal!)
|
||||||
|
end
|
||||||
|
|
||||||
|
stale_connections.each do |conn|
|
||||||
|
if conn.active?
|
||||||
|
conn.reset!
|
||||||
|
checkin conn
|
||||||
|
else
|
||||||
|
remove conn
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def flush(minimum_idle = @idle_timeout)
|
||||||
|
return if minimum_idle.nil?
|
||||||
|
|
||||||
|
idle_connections = synchronize do
|
||||||
|
return unless @connections
|
||||||
|
|
||||||
|
@connections.select do |conn|
|
||||||
|
!conn.in_use? && conn.seconds_idle >= minimum_idle
|
||||||
|
end.each do |conn|
|
||||||
|
conn.lease
|
||||||
|
|
||||||
|
@available.delete conn
|
||||||
|
@connections.delete conn
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
idle_connections.each(&:disconnect!)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,13 +0,0 @@
|
||||||
Rswag::Api.configure do |c|
|
|
||||||
# Specify a root folder where Swagger JSON files are located
|
|
||||||
# This is used by the Swagger middleware to serve requests for API descriptions
|
|
||||||
# NOTE: If you're using rswag-specs to generate Swagger, you'll need to ensure
|
|
||||||
# that it's configured to generate files in the same folder
|
|
||||||
c.swagger_root = Rails.root.to_s + '/swagger'
|
|
||||||
|
|
||||||
# Inject a lambda function to alter the returned Swagger prior to serialization
|
|
||||||
# The function will have access to the rack env for the current request
|
|
||||||
# For example, you could leverage this to dynamically assign the "host" property
|
|
||||||
#
|
|
||||||
# c.swagger_filter = lambda { |swagger, env| swagger['host'] = env['HTTP_HOST'] }
|
|
||||||
end
|
|
|
@ -1,15 +0,0 @@
|
||||||
Rswag::Ui.configure do |c|
|
|
||||||
# List the Swagger endpoints that you want to be documented through the
|
|
||||||
# swagger-ui. The first parameter is the path (absolute or relative to the UI
|
|
||||||
# host) to the corresponding endpoint and the second is a title that will be
|
|
||||||
# displayed in the document selector.
|
|
||||||
# NOTE: If you're using rspec-api to expose Swagger files
|
|
||||||
# (under swagger_root) as JSON or YAML endpoints, then the list below should
|
|
||||||
# correspond to the relative paths for those endpoints.
|
|
||||||
|
|
||||||
c.swagger_endpoint '/api-docs/v1/swagger.yaml', 'API V1 Docs'
|
|
||||||
|
|
||||||
# Add Basic Auth in case your API is private
|
|
||||||
# c.basic_auth_enabled = true
|
|
||||||
# c.basic_auth_credentials 'username', 'password'
|
|
||||||
end
|
|
|
@ -1,5 +0,0 @@
|
||||||
# config/initializers/zeitwerk.rb
|
|
||||||
ActiveSupport::Dependencies
|
|
||||||
.autoload_paths
|
|
||||||
.delete("#{Rails.root}/app/controllers/concerns")
|
|
||||||
|
|
|
@ -568,7 +568,6 @@ de:
|
||||||
options:
|
options:
|
||||||
convert_units: Derzeitige Einheiten beibehalten, berechne Mengeneinheit und Preis (wie Synchronisieren).
|
convert_units: Derzeitige Einheiten beibehalten, berechne Mengeneinheit und Preis (wie Synchronisieren).
|
||||||
outlist_absent: Artikel löschen, die nicht in der hochgeladenen Datei sind.
|
outlist_absent: Artikel löschen, die nicht in der hochgeladenen Datei sind.
|
||||||
update_category: Kategorien aus der Datei übernehmen und erstellen.
|
|
||||||
sample:
|
sample:
|
||||||
juices: Säfte
|
juices: Säfte
|
||||||
nuts: Nüsse
|
nuts: Nüsse
|
||||||
|
@ -1046,33 +1045,17 @@ de:
|
||||||
error_stale: In der Zwischenzeit hat jemand anderes auch bestellt, daher konnte die Bestellung nicht aktualisiert werden.
|
error_stale: In der Zwischenzeit hat jemand anderes auch bestellt, daher konnte die Bestellung nicht aktualisiert werden.
|
||||||
notice: Die Bestellung wurde gespeichert.
|
notice: Die Bestellung wurde gespeichert.
|
||||||
errors:
|
errors:
|
||||||
balance_alert: Kontostand im Minus
|
|
||||||
closed: Diese Bestellung ist bereits abgeschlossen.
|
closed: Diese Bestellung ist bereits abgeschlossen.
|
||||||
no_member: Du bist kein Mitglieder einer Bestellgruppe.
|
no_member: Du bist kein Mitglieder einer Bestellgruppe.
|
||||||
notfound: Fehlerhafte URL, das ist nicht Deine Bestellung.
|
notfound: Fehlerhafte URL, das ist nicht Deine Bestellung.
|
||||||
explanations:
|
|
||||||
package_fill_level: |
|
|
||||||
Gebindefüllstand
|
|
||||||
missing_none: |
|
|
||||||
Voll
|
|
||||||
missing_few: |
|
|
||||||
Wenig fehlt
|
|
||||||
missing_many: |
|
|
||||||
Viel fehlt
|
|
||||||
title: Erklärungen
|
|
||||||
tolerance_explained: |
|
|
||||||
Zusätzliche Menge die du bestellen würdest, damit das Gebinde voll wird.
|
|
||||||
tolerance: Toleranz
|
|
||||||
form:
|
form:
|
||||||
action_save: Bestellung speichern
|
action_save: Bestellung speichern
|
||||||
new_funds: Neuer Kontostand
|
new_funds: Neuer Kontostand
|
||||||
price: Preis
|
price: Preis
|
||||||
price_per_base_unit: Grundpreis
|
|
||||||
reset_article_search: Suche zurücksetzen
|
reset_article_search: Suche zurücksetzen
|
||||||
search_article: Artikel suchen...
|
search_article: Artikel suchen...
|
||||||
sum_amount: Gesamtbestellmenge bisher
|
sum_amount: Gesamtbestellmenge bisher
|
||||||
title: Bestellen
|
title: Bestellen
|
||||||
sub_title: Bestellung für %{order_name} aufgeben
|
|
||||||
total_sum_amount: Gesamtbetrag
|
total_sum_amount: Gesamtbetrag
|
||||||
total_tolerance: Gesamt-Toleranz
|
total_tolerance: Gesamt-Toleranz
|
||||||
units: Gebinde
|
units: Gebinde
|
||||||
|
@ -1116,6 +1099,7 @@ de:
|
||||||
sum: Summe
|
sum: Summe
|
||||||
title: Dein Bestellergebnis für %{order}
|
title: Dein Bestellergebnis für %{order}
|
||||||
switch_order:
|
switch_order:
|
||||||
|
remaining: "noch %{remaining}"
|
||||||
title: Laufende Bestellungen
|
title: Laufende Bestellungen
|
||||||
update:
|
update:
|
||||||
error_general: Die Bestellung konnte nicht aktualisiert werden, da ein Fehler auftrat.
|
error_general: Die Bestellung konnte nicht aktualisiert werden, da ein Fehler auftrat.
|
||||||
|
@ -1237,7 +1221,6 @@ de:
|
||||||
footer_2_foodsoft: 'Foodsoft: %{url}'
|
footer_2_foodsoft: 'Foodsoft: %{url}'
|
||||||
footer_3_homepage: 'Foodcoop: %{url}'
|
footer_3_homepage: 'Foodcoop: %{url}'
|
||||||
footer_4_help: 'Hilfe: %{url}'
|
footer_4_help: 'Hilfe: %{url}'
|
||||||
help: 'Hilfe'
|
|
||||||
foodsoft: Foodsoft
|
foodsoft: Foodsoft
|
||||||
footer:
|
footer:
|
||||||
revision: Revision %{revision}
|
revision: Revision %{revision}
|
||||||
|
@ -1480,9 +1463,6 @@ de:
|
||||||
units_ordered: Bestellte Einheiten
|
units_ordered: Bestellte Einheiten
|
||||||
create:
|
create:
|
||||||
notice: Die Bestellung wurde erstellt.
|
notice: Die Bestellung wurde erstellt.
|
||||||
custom_csv:
|
|
||||||
description: Wähle die Attribute und deren Reihenfolge für die zu erzeugende CSV Datei
|
|
||||||
column: Spalte
|
|
||||||
edit:
|
edit:
|
||||||
title: 'Bestellung bearbeiten: %{name}'
|
title: 'Bestellung bearbeiten: %{name}'
|
||||||
edit_amount:
|
edit_amount:
|
||||||
|
|
|
@ -569,7 +569,6 @@ en:
|
||||||
options:
|
options:
|
||||||
convert_units: Keep current units, recompute unit quantity and price (like synchronize).
|
convert_units: Keep current units, recompute unit quantity and price (like synchronize).
|
||||||
outlist_absent: Delete articles not in uploaded file.
|
outlist_absent: Delete articles not in uploaded file.
|
||||||
update_category: Create and replace categories from uploaded file.
|
|
||||||
sample:
|
sample:
|
||||||
juices: Juices
|
juices: Juices
|
||||||
nuts: Nuts
|
nuts: Nuts
|
||||||
|
@ -1048,33 +1047,17 @@ en:
|
||||||
error_stale: Someone else has ordered in the meantime, couldn't update the order.
|
error_stale: Someone else has ordered in the meantime, couldn't update the order.
|
||||||
notice: The order was saved.
|
notice: The order was saved.
|
||||||
errors:
|
errors:
|
||||||
balance_alert: Negative account balance
|
|
||||||
closed: This order is already closed.
|
closed: This order is already closed.
|
||||||
no_member: You are not a member of an ordergroup.
|
no_member: You are not a member of an ordergroup.
|
||||||
notfound: Incorrect URL, this is not your order.
|
notfound: Incorrect URL, this is not your order.
|
||||||
explanations:
|
|
||||||
title: Explanations
|
|
||||||
tolerance: Tolerance
|
|
||||||
package_fill_level: |
|
|
||||||
Package Fill Level
|
|
||||||
missing_none: |
|
|
||||||
No more missing
|
|
||||||
missing_few: |
|
|
||||||
Few missing
|
|
||||||
missing_many: |
|
|
||||||
Many missing
|
|
||||||
tolerance_explained: |
|
|
||||||
Additional amount you would buy to fill a wholesale package
|
|
||||||
form:
|
form:
|
||||||
action_save: Save order
|
action_save: Save order
|
||||||
new_funds: New account balance
|
new_funds: New account balance
|
||||||
price: Price
|
price: Price
|
||||||
price_per_base_unit: Base price
|
|
||||||
reset_article_search: Reset search
|
reset_article_search: Reset search
|
||||||
search_article: Search for articles...
|
search_article: Search for articles...
|
||||||
sum_amount: Current amount
|
sum_amount: Current amount
|
||||||
title: Orders
|
title: Orders
|
||||||
sub_title: Place order for %{order_name}
|
|
||||||
total_sum_amount: Total amount
|
total_sum_amount: Total amount
|
||||||
total_tolerance: Total tolerance
|
total_tolerance: Total tolerance
|
||||||
units: Units
|
units: Units
|
||||||
|
@ -1118,6 +1101,7 @@ en:
|
||||||
sum: Sum
|
sum: Sum
|
||||||
title: Your order result for %{order}
|
title: Your order result for %{order}
|
||||||
switch_order:
|
switch_order:
|
||||||
|
remaining: "%{remaining} remaining"
|
||||||
title: Current orders
|
title: Current orders
|
||||||
update:
|
update:
|
||||||
error_general: The order couldn’t be updated due to a bug.
|
error_general: The order couldn’t be updated due to a bug.
|
||||||
|
@ -1240,7 +1224,6 @@ en:
|
||||||
footer_2_foodsoft: 'Foodsoft: %{url}'
|
footer_2_foodsoft: 'Foodsoft: %{url}'
|
||||||
footer_3_homepage: 'Foodcoop: %{url}'
|
footer_3_homepage: 'Foodcoop: %{url}'
|
||||||
footer_4_help: 'Help: %{url}'
|
footer_4_help: 'Help: %{url}'
|
||||||
help: 'Help'
|
|
||||||
foodsoft: Foodsoft
|
foodsoft: Foodsoft
|
||||||
footer:
|
footer:
|
||||||
revision: revision %{revision}
|
revision: revision %{revision}
|
||||||
|
@ -1490,9 +1473,6 @@ en:
|
||||||
units_ordered: Units ordered
|
units_ordered: Units ordered
|
||||||
create:
|
create:
|
||||||
notice: The order was created.
|
notice: The order was created.
|
||||||
custom_csv:
|
|
||||||
description: Please choose the order as well as the attributes for the csv file
|
|
||||||
column: column
|
|
||||||
edit:
|
edit:
|
||||||
title: 'Edit order: %{name}'
|
title: 'Edit order: %{name}'
|
||||||
edit_amount:
|
edit_amount:
|
||||||
|
@ -1646,7 +1626,6 @@ en:
|
||||||
who_ordered: Who ordered?
|
who_ordered: Who ordered?
|
||||||
order_download_button:
|
order_download_button:
|
||||||
article_pdf: Article PDF
|
article_pdf: Article PDF
|
||||||
custom_csv: Custom CSV
|
|
||||||
download_file: Download file
|
download_file: Download file
|
||||||
fax_csv: Fax CSV
|
fax_csv: Fax CSV
|
||||||
fax_pdf: Fax PDF
|
fax_pdf: Fax PDF
|
||||||
|
|
|
@ -515,7 +515,6 @@ es:
|
||||||
options:
|
options:
|
||||||
convert_units: Mantener unidades actuales, recomputar la cantidad y precio de unidades (como sincronizar).
|
convert_units: Mantener unidades actuales, recomputar la cantidad y precio de unidades (como sincronizar).
|
||||||
outlist_absent: Borrar artículos que no están en el archivo subido.
|
outlist_absent: Borrar artículos que no están en el archivo subido.
|
||||||
update_category: Toma las categorías del archivo subido.
|
|
||||||
sample:
|
sample:
|
||||||
juices: Jugos
|
juices: Jugos
|
||||||
nuts: Nueces
|
nuts: Nueces
|
||||||
|
@ -930,7 +929,6 @@ es:
|
||||||
action_save: Guardar pedido
|
action_save: Guardar pedido
|
||||||
new_funds: Nuevo balance de cuenta
|
new_funds: Nuevo balance de cuenta
|
||||||
price: Precio
|
price: Precio
|
||||||
price_per_base_unit: Precio de base
|
|
||||||
reset_article_search: Reinicia la búsqueda
|
reset_article_search: Reinicia la búsqueda
|
||||||
search_article: Busca artículos...
|
search_article: Busca artículos...
|
||||||
sum_amount: Cantidad actual
|
sum_amount: Cantidad actual
|
||||||
|
@ -1084,7 +1082,6 @@ es:
|
||||||
layouts:
|
layouts:
|
||||||
email:
|
email:
|
||||||
footer_4_help: 'Ayuda: %{url}'
|
footer_4_help: 'Ayuda: %{url}'
|
||||||
help: 'Ayuda'
|
|
||||||
footer:
|
footer:
|
||||||
revision: revisión %{revision}
|
revision: revisión %{revision}
|
||||||
header:
|
header:
|
||||||
|
@ -1262,9 +1259,6 @@ es:
|
||||||
units_ordered: Unidades pedidas
|
units_ordered: Unidades pedidas
|
||||||
create:
|
create:
|
||||||
notice: Se ha creado el pedido
|
notice: Se ha creado el pedido
|
||||||
custom_csv:
|
|
||||||
description: Por favor elija el orden de los atributos así como los atributos para el archivo csv
|
|
||||||
column: columna
|
|
||||||
edit:
|
edit:
|
||||||
title: 'Edita pedido: %{name}'
|
title: 'Edita pedido: %{name}'
|
||||||
edit_amount:
|
edit_amount:
|
||||||
|
|
|
@ -678,7 +678,6 @@ fr:
|
||||||
action_save: Enregistrer ta commande
|
action_save: Enregistrer ta commande
|
||||||
new_funds: Nouveau solde
|
new_funds: Nouveau solde
|
||||||
price: Prix
|
price: Prix
|
||||||
price_per_base_unit: Prix de base
|
|
||||||
reset_article_search: Réinitialiser la recherche
|
reset_article_search: Réinitialiser la recherche
|
||||||
search_article: Rechercher des produits...
|
search_article: Rechercher des produits...
|
||||||
sum_amount: Quantité déjà commandée
|
sum_amount: Quantité déjà commandée
|
||||||
|
@ -835,7 +834,6 @@ fr:
|
||||||
email:
|
email:
|
||||||
footer_3_homepage: 'Boufcoop: %{url}'
|
footer_3_homepage: 'Boufcoop: %{url}'
|
||||||
footer_4_help: 'Aide: %{url}'
|
footer_4_help: 'Aide: %{url}'
|
||||||
help: 'Aide'
|
|
||||||
footer:
|
footer:
|
||||||
revision: révision %{revision}
|
revision: révision %{revision}
|
||||||
header:
|
header:
|
||||||
|
@ -1012,9 +1010,6 @@ fr:
|
||||||
units_ordered: Unités commandées
|
units_ordered: Unités commandées
|
||||||
create:
|
create:
|
||||||
notice: La commande a bien été définie.
|
notice: La commande a bien été définie.
|
||||||
custom_csv:
|
|
||||||
description: Veuillez choisir l'ordre des attributs ainsi que les attributs pour le fichier csv
|
|
||||||
column: colonne
|
|
||||||
edit:
|
edit:
|
||||||
title: 'Modifier la commande: %{name}'
|
title: 'Modifier la commande: %{name}'
|
||||||
edit_amount:
|
edit_amount:
|
||||||
|
|
|
@ -539,7 +539,6 @@ nl:
|
||||||
options:
|
options:
|
||||||
convert_units: Bestaande eenheden behouden, herbereken groothandelseenheid en prijs (net als synchronizeren).
|
convert_units: Bestaande eenheden behouden, herbereken groothandelseenheid en prijs (net als synchronizeren).
|
||||||
outlist_absent: Artikelen die niet in het bestand voorkomen, verwijderen.
|
outlist_absent: Artikelen die niet in het bestand voorkomen, verwijderen.
|
||||||
upload_category: Categorieën overnemen uit bestand.
|
|
||||||
sample:
|
sample:
|
||||||
juices: Sappen
|
juices: Sappen
|
||||||
nuts: Noten
|
nuts: Noten
|
||||||
|
@ -1018,7 +1017,6 @@ nl:
|
||||||
error_stale: In de tussentijd heeft iemand anders ook bestelt, daarom kon de bestelling niet bijgewerkt worden.
|
error_stale: In de tussentijd heeft iemand anders ook bestelt, daarom kon de bestelling niet bijgewerkt worden.
|
||||||
notice: Bestelling opgeslagen.
|
notice: Bestelling opgeslagen.
|
||||||
errors:
|
errors:
|
||||||
balance_alert: Accountsaldo in het rood
|
|
||||||
closed: Deze bestelling is al gesloten.
|
closed: Deze bestelling is al gesloten.
|
||||||
no_member: Je bent geen lid van dit huishouden.
|
no_member: Je bent geen lid van dit huishouden.
|
||||||
notfound: Foute URL, dit is niet jouw bestelling.
|
notfound: Foute URL, dit is niet jouw bestelling.
|
||||||
|
@ -1026,12 +1024,10 @@ nl:
|
||||||
action_save: Bestelling opslaan
|
action_save: Bestelling opslaan
|
||||||
new_funds: Nieuw tegoed
|
new_funds: Nieuw tegoed
|
||||||
price: Prijs
|
price: Prijs
|
||||||
price_per_base_unit: Basisprjis
|
|
||||||
reset_article_search: Alles tonen
|
reset_article_search: Alles tonen
|
||||||
search_article: Artikelen zoeken...
|
search_article: Artikelen zoeken...
|
||||||
sum_amount: Huidig totaalbedrag
|
sum_amount: Huidig totaalbedrag
|
||||||
title: Bestellen
|
title: Bestellen
|
||||||
sub_title: Plaats bestelling voor %{order_name}
|
|
||||||
total_sum_amount: Totalbedrag
|
total_sum_amount: Totalbedrag
|
||||||
total_tolerance: Totale tolerantie
|
total_tolerance: Totale tolerantie
|
||||||
units: Eenheden
|
units: Eenheden
|
||||||
|
@ -1075,6 +1071,7 @@ nl:
|
||||||
sum: Som
|
sum: Som
|
||||||
title: Jouw bestelling voor %{order}
|
title: Jouw bestelling voor %{order}
|
||||||
switch_order:
|
switch_order:
|
||||||
|
remaining: "nog %{remaining}"
|
||||||
title: Lopende bestellingen
|
title: Lopende bestellingen
|
||||||
update:
|
update:
|
||||||
error_general: Er is een probleem opgetreden, de bestelling kon niet bijgewerkt worden.
|
error_general: Er is een probleem opgetreden, de bestelling kon niet bijgewerkt worden.
|
||||||
|
@ -1197,7 +1194,6 @@ nl:
|
||||||
footer_2_foodsoft: 'Foodsoft: %{url}'
|
footer_2_foodsoft: 'Foodsoft: %{url}'
|
||||||
footer_3_homepage: 'Foodcoop: %{url}'
|
footer_3_homepage: 'Foodcoop: %{url}'
|
||||||
footer_4_help: 'Help: %{url}'
|
footer_4_help: 'Help: %{url}'
|
||||||
help: 'Help'
|
|
||||||
foodsoft: Foodsoft
|
foodsoft: Foodsoft
|
||||||
footer:
|
footer:
|
||||||
revision: revisie %{revision}
|
revision: revisie %{revision}
|
||||||
|
@ -1442,9 +1438,6 @@ nl:
|
||||||
units_ordered: Bestelde eenheden
|
units_ordered: Bestelde eenheden
|
||||||
create:
|
create:
|
||||||
notice: De bestelling is aangemaakt.
|
notice: De bestelling is aangemaakt.
|
||||||
custom_csv:
|
|
||||||
description: Kies de volgorde van de attributen en de attributen voor het csv-bestand
|
|
||||||
column: kolom
|
|
||||||
edit:
|
edit:
|
||||||
title: 'Bestelling aanpassen: %{name}'
|
title: 'Bestelling aanpassen: %{name}'
|
||||||
edit_amount:
|
edit_amount:
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
mount Rswag::Ui::Engine => '/api-docs'
|
|
||||||
mount Rswag::Api::Engine => '/api-docs'
|
|
||||||
get "order_comments/new"
|
get "order_comments/new"
|
||||||
|
|
||||||
get "comments/new"
|
get "comments/new"
|
||||||
|
@ -47,7 +45,6 @@ Rails.application.routes.draw do
|
||||||
get :receive
|
get :receive
|
||||||
post :receive
|
post :receive
|
||||||
|
|
||||||
get :custom_csv
|
|
||||||
get :receive_on_order_article_create
|
get :receive_on_order_article_create
|
||||||
get :receive_on_order_article_update
|
get :receive_on_order_article_update
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
# This migration comes from active_storage (originally 20190112182829)
|
|
||||||
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
|
|
||||||
def up
|
|
||||||
return unless table_exists?(:active_storage_blobs)
|
|
||||||
|
|
||||||
unless column_exists?(:active_storage_blobs, :service_name)
|
|
||||||
add_column :active_storage_blobs, :service_name, :string
|
|
||||||
|
|
||||||
if configured_service = ActiveStorage::Blob.service.name
|
|
||||||
ActiveStorage::Blob.unscoped.update_all(service_name: configured_service)
|
|
||||||
end
|
|
||||||
|
|
||||||
change_column :active_storage_blobs, :service_name, :string, null: false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def down
|
|
||||||
return unless table_exists?(:active_storage_blobs)
|
|
||||||
|
|
||||||
remove_column :active_storage_blobs, :service_name
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,28 +0,0 @@
|
||||||
# This migration comes from active_storage (originally 20191206030411)
|
|
||||||
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
|
|
||||||
def change
|
|
||||||
return unless table_exists?(:active_storage_blobs)
|
|
||||||
|
|
||||||
# Use Active Record's configured type for primary key
|
|
||||||
create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t|
|
|
||||||
t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type
|
|
||||||
t.string :variation_digest, null: false
|
|
||||||
|
|
||||||
t.index [:blob_id, :variation_digest], name: "index_active_storage_variant_records_uniqueness", unique: true
|
|
||||||
t.foreign_key :active_storage_blobs, column: :blob_id
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def primary_key_type
|
|
||||||
config = Rails.configuration.generators
|
|
||||||
config.options[config.orm][:primary_key_type] || :primary_key
|
|
||||||
end
|
|
||||||
|
|
||||||
def blobs_primary_key_type
|
|
||||||
pkey_name = connection.primary_key(:active_storage_blobs)
|
|
||||||
pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name }
|
|
||||||
pkey_column.bigint? ? :bigint : pkey_column.type
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,8 +0,0 @@
|
||||||
# This migration comes from active_storage (originally 20211119233751)
|
|
||||||
class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
|
|
||||||
def change
|
|
||||||
return unless table_exists?(:active_storage_blobs)
|
|
||||||
|
|
||||||
change_column_null(:active_storage_blobs, :checksum, true)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,26 +0,0 @@
|
||||||
# This migration comes from action_text (originally 20180528164100)
|
|
||||||
class CreateActionTextTables < ActiveRecord::Migration[6.0]
|
|
||||||
def change
|
|
||||||
# Use Active Record's configured type for primary and foreign keys
|
|
||||||
primary_key_type, foreign_key_type = primary_and_foreign_key_types
|
|
||||||
|
|
||||||
create_table :action_text_rich_texts, id: primary_key_type do |t|
|
|
||||||
t.string :name, null: false
|
|
||||||
t.text :body, size: :long
|
|
||||||
t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
|
|
||||||
|
|
||||||
t.timestamps
|
|
||||||
|
|
||||||
t.index [ :record_type, :record_id, :name ], name: "index_action_text_rich_texts_uniqueness", unique: true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
def primary_and_foreign_key_types
|
|
||||||
config = Rails.configuration.generators
|
|
||||||
setting = config.options[config.orm][:primary_key_type]
|
|
||||||
primary_key_type = setting || :primary_key
|
|
||||||
foreign_key_type = setting || :bigint
|
|
||||||
[primary_key_type, foreign_key_type]
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,10 +0,0 @@
|
||||||
class MigrateMessageBodyToActionText < ActiveRecord::Migration[7.0]
|
|
||||||
include ActionView::Helpers::TextHelper
|
|
||||||
def change
|
|
||||||
rename_column :messages, :body, :body_old
|
|
||||||
Message.all.each do |message|
|
|
||||||
message.update_attribute(:body, simple_format(message.body_old))
|
|
||||||
end
|
|
||||||
remove_column :messages, :body_old
|
|
||||||
end
|
|
||||||
end
|
|
250
db/schema.rb
|
@ -2,70 +2,54 @@
|
||||||
# of editing this file, please use the migrations feature of Active Record to
|
# of editing this file, please use the migrations feature of Active Record to
|
||||||
# incrementally modify your database, and then regenerate this schema definition.
|
# incrementally modify your database, and then regenerate this schema definition.
|
||||||
#
|
#
|
||||||
# This file is the source Rails uses to define your schema when running `bin/rails
|
# Note that this schema.rb definition is the authoritative source for your
|
||||||
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
# database schema. If you need to create the application database on another
|
||||||
# be faster and is potentially less error prone than running all of your
|
# system, you should be using db:schema:load, not running all the migrations
|
||||||
# migrations from scratch. Old migrations may fail to apply correctly if those
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
||||||
# migrations use external dependencies or application code.
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
ActiveRecord::Schema.define(version: 2021_02_05_090257) do
|
||||||
create_table "action_text_rich_texts", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
|
||||||
t.string "name", null: false
|
|
||||||
t.text "body", size: :long
|
|
||||||
t.string "record_type", null: false
|
|
||||||
t.bigint "record_id", null: false
|
|
||||||
t.datetime "created_at", null: false
|
|
||||||
t.datetime "updated_at", null: false
|
|
||||||
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "active_storage_attachments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "active_storage_attachments", id: :integer, force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.string "record_type", null: false
|
t.string "record_type", null: false
|
||||||
t.bigint "record_id", null: false
|
t.bigint "record_id", null: false
|
||||||
t.bigint "blob_id", null: false
|
t.bigint "blob_id", null: false
|
||||||
t.datetime "created_at", precision: nil, null: false
|
t.datetime "created_at", null: false
|
||||||
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
|
||||||
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "active_storage_blobs", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "active_storage_blobs", id: :integer, force: :cascade do |t|
|
||||||
t.string "key", null: false
|
t.string "key", null: false
|
||||||
t.string "filename", null: false
|
t.string "filename", null: false
|
||||||
t.string "content_type"
|
t.string "content_type"
|
||||||
t.text "metadata"
|
t.text "metadata"
|
||||||
t.bigint "byte_size", null: false
|
t.bigint "byte_size", null: false
|
||||||
t.string "checksum"
|
t.string "checksum", null: false
|
||||||
t.datetime "created_at", precision: nil, null: false
|
t.datetime "created_at", null: false
|
||||||
t.string "service_name", null: false
|
|
||||||
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "active_storage_variant_records", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "article_categories", id: :integer, force: :cascade do |t|
|
||||||
t.integer "blob_id", null: false
|
|
||||||
t.string "variation_digest", null: false
|
|
||||||
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
|
||||||
end
|
|
||||||
|
|
||||||
create_table "article_categories", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
|
||||||
t.string "name", default: "", null: false
|
t.string "name", default: "", null: false
|
||||||
t.string "description"
|
t.string "description"
|
||||||
t.index ["name"], name: "index_article_categories_on_name", unique: true
|
t.index ["name"], name: "index_article_categories_on_name", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "article_prices", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "article_prices", id: :integer, force: :cascade do |t|
|
||||||
t.integer "article_id", null: false
|
t.integer "article_id", null: false
|
||||||
t.decimal "price", precision: 8, scale: 2, default: "0.0", null: false
|
t.decimal "price", precision: 8, scale: 2, default: "0.0", null: false
|
||||||
t.decimal "tax", precision: 8, scale: 2, default: "0.0", null: false
|
t.decimal "tax", precision: 8, scale: 2, default: "0.0", null: false
|
||||||
t.decimal "deposit", precision: 8, scale: 2, default: "0.0", null: false
|
t.decimal "deposit", precision: 8, scale: 2, default: "0.0", null: false
|
||||||
t.integer "unit_quantity"
|
t.integer "unit_quantity"
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.index ["article_id"], name: "index_article_prices_on_article_id"
|
t.index ["article_id"], name: "index_article_prices_on_article_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "articles", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "articles", id: :integer, force: :cascade do |t|
|
||||||
t.string "name", default: "", null: false
|
t.string "name", default: "", null: false
|
||||||
t.integer "supplier_id", default: 0, null: false
|
t.integer "supplier_id", default: 0, null: false
|
||||||
t.integer "article_category_id", default: 0, null: false
|
t.integer "article_category_id", default: 0, null: false
|
||||||
|
@ -74,15 +58,15 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.boolean "availability", default: true, null: false
|
t.boolean "availability", default: true, null: false
|
||||||
t.string "manufacturer"
|
t.string "manufacturer"
|
||||||
t.string "origin"
|
t.string "origin"
|
||||||
t.datetime "shared_updated_on", precision: nil
|
t.datetime "shared_updated_on"
|
||||||
t.decimal "price", precision: 8, scale: 2
|
t.decimal "price", precision: 8, scale: 2
|
||||||
t.float "tax"
|
t.float "tax"
|
||||||
t.decimal "deposit", precision: 8, scale: 2, default: "0.0"
|
t.decimal "deposit", precision: 8, scale: 2, default: "0.0"
|
||||||
t.integer "unit_quantity", default: 1, null: false
|
t.integer "unit_quantity", default: 1, null: false
|
||||||
t.string "order_number"
|
t.string "order_number"
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at"
|
||||||
t.datetime "deleted_at", precision: nil
|
t.datetime "deleted_at"
|
||||||
t.string "type"
|
t.string "type"
|
||||||
t.integer "quantity", default: 0
|
t.integer "quantity", default: 0
|
||||||
t.index ["article_category_id"], name: "index_articles_on_article_category_id"
|
t.index ["article_category_id"], name: "index_articles_on_article_category_id"
|
||||||
|
@ -91,31 +75,31 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.index ["type"], name: "index_articles_on_type"
|
t.index ["type"], name: "index_articles_on_type"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "assignments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "assignments", id: :integer, force: :cascade do |t|
|
||||||
t.integer "user_id", default: 0, null: false
|
t.integer "user_id", default: 0, null: false
|
||||||
t.integer "task_id", default: 0, null: false
|
t.integer "task_id", default: 0, null: false
|
||||||
t.boolean "accepted", default: false
|
t.boolean "accepted", default: false
|
||||||
t.index ["user_id", "task_id"], name: "index_assignments_on_user_id_and_task_id", unique: true
|
t.index ["user_id", "task_id"], name: "index_assignments_on_user_id_and_task_id", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "bank_accounts", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "bank_accounts", id: :integer, force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.string "iban"
|
t.string "iban"
|
||||||
t.string "description"
|
t.string "description"
|
||||||
t.decimal "balance", precision: 12, scale: 2, default: "0.0", null: false
|
t.decimal "balance", precision: 12, scale: 2, default: "0.0", null: false
|
||||||
t.datetime "last_import", precision: nil
|
t.datetime "last_import"
|
||||||
t.string "import_continuation_point"
|
t.string "import_continuation_point"
|
||||||
t.integer "bank_gateway_id"
|
t.integer "bank_gateway_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "bank_gateways", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "bank_gateways", id: :integer, force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.string "url", null: false
|
t.string "url", null: false
|
||||||
t.string "authorization"
|
t.string "authorization"
|
||||||
t.integer "unattended_user_id"
|
t.integer "unattended_user_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "bank_transactions", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "bank_transactions", id: :integer, force: :cascade do |t|
|
||||||
t.integer "bank_account_id", null: false
|
t.integer "bank_account_id", null: false
|
||||||
t.string "external_id"
|
t.string "external_id"
|
||||||
t.date "date"
|
t.date "date"
|
||||||
|
@ -124,32 +108,32 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.string "reference"
|
t.string "reference"
|
||||||
t.text "text"
|
t.text "text"
|
||||||
t.text "receipt"
|
t.text "receipt"
|
||||||
t.binary "image", size: :medium
|
t.binary "image", limit: 16777215
|
||||||
t.integer "financial_link_id"
|
t.integer "financial_link_id"
|
||||||
t.index ["financial_link_id"], name: "index_bank_transactions_on_financial_link_id"
|
t.index ["financial_link_id"], name: "index_bank_transactions_on_financial_link_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "documents", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "documents", id: :integer, force: :cascade do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.string "mime"
|
t.string "mime"
|
||||||
t.binary "data", size: :long
|
t.binary "data", limit: 4294967295
|
||||||
t.integer "created_by_user_id"
|
t.integer "created_by_user_id"
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at"
|
||||||
t.integer "parent_id"
|
t.integer "parent_id"
|
||||||
t.index ["parent_id"], name: "index_documents_on_parent_id"
|
t.index ["parent_id"], name: "index_documents_on_parent_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "financial_links", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "financial_links", id: :integer, force: :cascade do |t|
|
||||||
t.text "note"
|
t.text "note"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "financial_transaction_classes", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "financial_transaction_classes", id: :integer, force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.boolean "ignore_for_account_balance", default: false, null: false
|
t.boolean "ignore_for_account_balance", default: false, null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "financial_transaction_types", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "financial_transaction_types", id: :integer, force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.integer "financial_transaction_class_id", null: false
|
t.integer "financial_transaction_class_id", null: false
|
||||||
t.string "name_short"
|
t.string "name_short"
|
||||||
|
@ -157,12 +141,12 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.index ["name_short"], name: "index_financial_transaction_types_on_name_short"
|
t.index ["name_short"], name: "index_financial_transaction_types_on_name_short"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "financial_transactions", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "financial_transactions", id: :integer, force: :cascade do |t|
|
||||||
t.integer "ordergroup_id"
|
t.integer "ordergroup_id"
|
||||||
t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false
|
t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false
|
||||||
t.text "note", null: false
|
t.text "note", null: false
|
||||||
t.integer "user_id", default: 0, null: false
|
t.integer "user_id", default: 0, null: false
|
||||||
t.datetime "created_on", precision: nil, null: false
|
t.datetime "created_on", null: false
|
||||||
t.integer "financial_transaction_type_id", null: false
|
t.integer "financial_transaction_type_id", null: false
|
||||||
t.integer "financial_link_id"
|
t.integer "financial_link_id"
|
||||||
t.integer "reverts_id"
|
t.integer "reverts_id"
|
||||||
|
@ -171,20 +155,20 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.index ["reverts_id"], name: "index_financial_transactions_on_reverts_id", unique: true
|
t.index ["reverts_id"], name: "index_financial_transactions_on_reverts_id", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "group_order_article_quantities", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "group_order_article_quantities", id: :integer, force: :cascade do |t|
|
||||||
t.integer "group_order_article_id", default: 0, null: false
|
t.integer "group_order_article_id", default: 0, null: false
|
||||||
t.integer "quantity", default: 0
|
t.integer "quantity", default: 0
|
||||||
t.integer "tolerance", default: 0
|
t.integer "tolerance", default: 0
|
||||||
t.datetime "created_on", precision: nil, null: false
|
t.datetime "created_on", null: false
|
||||||
t.index ["group_order_article_id"], name: "index_group_order_article_quantities_on_group_order_article_id"
|
t.index ["group_order_article_id"], name: "index_group_order_article_quantities_on_group_order_article_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "group_order_articles", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "group_order_articles", id: :integer, force: :cascade do |t|
|
||||||
t.integer "group_order_id", default: 0, null: false
|
t.integer "group_order_id", default: 0, null: false
|
||||||
t.integer "order_article_id", default: 0, null: false
|
t.integer "order_article_id", default: 0, null: false
|
||||||
t.integer "quantity", default: 0, null: false
|
t.integer "quantity", default: 0, null: false
|
||||||
t.integer "tolerance", default: 0, null: false
|
t.integer "tolerance", default: 0, null: false
|
||||||
t.datetime "updated_on", precision: nil, null: false
|
t.datetime "updated_on", null: false
|
||||||
t.decimal "result", precision: 8, scale: 3
|
t.decimal "result", precision: 8, scale: 3
|
||||||
t.decimal "result_computed", precision: 8, scale: 3
|
t.decimal "result_computed", precision: 8, scale: 3
|
||||||
t.index ["group_order_id", "order_article_id"], name: "goa_index", unique: true
|
t.index ["group_order_id", "order_article_id"], name: "goa_index", unique: true
|
||||||
|
@ -192,12 +176,12 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.index ["order_article_id"], name: "index_group_order_articles_on_order_article_id"
|
t.index ["order_article_id"], name: "index_group_order_articles_on_order_article_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "group_orders", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "group_orders", id: :integer, force: :cascade do |t|
|
||||||
t.integer "ordergroup_id"
|
t.integer "ordergroup_id"
|
||||||
t.integer "order_id", default: 0, null: false
|
t.integer "order_id", default: 0, null: false
|
||||||
t.decimal "price", precision: 8, scale: 2, default: "0.0", null: false
|
t.decimal "price", precision: 8, scale: 2, default: "0.0", null: false
|
||||||
t.integer "lock_version", default: 0, null: false
|
t.integer "lock_version", default: 0, null: false
|
||||||
t.datetime "updated_on", precision: nil, null: false
|
t.datetime "updated_on", null: false
|
||||||
t.integer "updated_by_user_id"
|
t.integer "updated_by_user_id"
|
||||||
t.decimal "transport", precision: 8, scale: 2
|
t.decimal "transport", precision: 8, scale: 2
|
||||||
t.index ["order_id"], name: "index_group_orders_on_order_id"
|
t.index ["order_id"], name: "index_group_orders_on_order_id"
|
||||||
|
@ -205,18 +189,18 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.index ["ordergroup_id"], name: "index_group_orders_on_ordergroup_id"
|
t.index ["ordergroup_id"], name: "index_group_orders_on_ordergroup_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "groups", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "groups", id: :integer, force: :cascade do |t|
|
||||||
t.string "type", default: "", null: false
|
t.string "type", default: "", null: false
|
||||||
t.string "name", default: "", null: false
|
t.string "name", default: "", null: false
|
||||||
t.string "description"
|
t.string "description"
|
||||||
t.decimal "account_balance", precision: 12, scale: 2, default: "0.0", null: false
|
t.decimal "account_balance", precision: 12, scale: 2, default: "0.0", null: false
|
||||||
t.datetime "created_on", precision: nil, null: false
|
t.datetime "created_on", null: false
|
||||||
t.boolean "role_admin", default: false, null: false
|
t.boolean "role_admin", default: false, null: false
|
||||||
t.boolean "role_suppliers", default: false, null: false
|
t.boolean "role_suppliers", default: false, null: false
|
||||||
t.boolean "role_article_meta", default: false, null: false
|
t.boolean "role_article_meta", default: false, null: false
|
||||||
t.boolean "role_finance", default: false, null: false
|
t.boolean "role_finance", default: false, null: false
|
||||||
t.boolean "role_orders", default: false, null: false
|
t.boolean "role_orders", default: false, null: false
|
||||||
t.datetime "deleted_at", precision: nil
|
t.datetime "deleted_at"
|
||||||
t.string "contact_person"
|
t.string "contact_person"
|
||||||
t.string "contact_phone"
|
t.string "contact_phone"
|
||||||
t.string "contact_address"
|
t.string "contact_address"
|
||||||
|
@ -230,16 +214,16 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.index ["name"], name: "index_groups_on_name", unique: true
|
t.index ["name"], name: "index_groups_on_name", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "invites", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "invites", id: :integer, force: :cascade do |t|
|
||||||
t.string "token", default: "", null: false
|
t.string "token", default: "", null: false
|
||||||
t.datetime "expires_at", precision: nil, null: false
|
t.datetime "expires_at", null: false
|
||||||
t.integer "group_id", default: 0, null: false
|
t.integer "group_id", default: 0, null: false
|
||||||
t.integer "user_id", default: 0, null: false
|
t.integer "user_id", default: 0, null: false
|
||||||
t.string "email", default: "", null: false
|
t.string "email", default: "", null: false
|
||||||
t.index ["token"], name: "index_invites_on_token"
|
t.index ["token"], name: "index_invites_on_token"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "invoices", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "invoices", id: :integer, force: :cascade do |t|
|
||||||
t.integer "supplier_id"
|
t.integer "supplier_id"
|
||||||
t.string "number"
|
t.string "number"
|
||||||
t.date "date"
|
t.date "date"
|
||||||
|
@ -248,16 +232,16 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false
|
t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false
|
||||||
t.decimal "deposit", precision: 8, scale: 2, default: "0.0", null: false
|
t.decimal "deposit", precision: 8, scale: 2, default: "0.0", null: false
|
||||||
t.decimal "deposit_credit", precision: 8, scale: 2, default: "0.0", null: false
|
t.decimal "deposit_credit", precision: 8, scale: 2, default: "0.0", null: false
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at"
|
||||||
t.integer "created_by_user_id"
|
t.integer "created_by_user_id"
|
||||||
t.string "attachment_mime"
|
t.string "attachment_mime"
|
||||||
t.binary "attachment_data", size: :medium
|
t.binary "attachment_data", limit: 16777215
|
||||||
t.integer "financial_link_id"
|
t.integer "financial_link_id"
|
||||||
t.index ["supplier_id"], name: "index_invoices_on_supplier_id"
|
t.index ["supplier_id"], name: "index_invoices_on_supplier_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "links", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "links", id: :integer, force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.string "url", null: false
|
t.string "url", null: false
|
||||||
t.integer "workgroup_id"
|
t.integer "workgroup_id"
|
||||||
|
@ -265,80 +249,81 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.string "authorization"
|
t.string "authorization"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "mail_delivery_status", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "mail_delivery_status", id: :integer, force: :cascade do |t|
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.string "email", null: false
|
t.string "email", null: false
|
||||||
t.string "message", null: false
|
t.string "message", null: false
|
||||||
t.string "attachment_mime"
|
t.string "attachment_mime"
|
||||||
t.binary "attachment_data", size: :long
|
t.binary "attachment_data", limit: 4294967295
|
||||||
t.index ["email"], name: "index_mail_delivery_status_on_email"
|
t.index ["email"], name: "index_mail_delivery_status_on_email"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "memberships", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "memberships", id: :integer, force: :cascade do |t|
|
||||||
t.integer "group_id", default: 0, null: false
|
t.integer "group_id", default: 0, null: false
|
||||||
t.integer "user_id", default: 0, null: false
|
t.integer "user_id", default: 0, null: false
|
||||||
t.index ["user_id", "group_id"], name: "index_memberships_on_user_id_and_group_id", unique: true
|
t.index ["user_id", "group_id"], name: "index_memberships_on_user_id_and_group_id", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "message_recipients", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "message_recipients", id: :integer, force: :cascade do |t|
|
||||||
t.integer "message_id", null: false
|
t.integer "message_id", null: false
|
||||||
t.integer "user_id", null: false
|
t.integer "user_id", null: false
|
||||||
t.integer "email_state", default: 0, null: false
|
t.integer "email_state", default: 0, null: false
|
||||||
t.datetime "read_at", precision: nil
|
t.datetime "read_at"
|
||||||
t.index ["message_id"], name: "index_message_recipients_on_message_id"
|
t.index ["message_id"], name: "index_message_recipients_on_message_id"
|
||||||
t.index ["user_id", "read_at"], name: "index_message_recipients_on_user_id_and_read_at"
|
t.index ["user_id", "read_at"], name: "index_message_recipients_on_user_id_and_read_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "messages", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "messages", id: :integer, force: :cascade do |t|
|
||||||
t.integer "sender_id"
|
t.integer "sender_id"
|
||||||
t.string "subject", null: false
|
t.string "subject", null: false
|
||||||
|
t.text "body"
|
||||||
t.boolean "private", default: false
|
t.boolean "private", default: false
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.integer "reply_to"
|
t.integer "reply_to"
|
||||||
t.integer "group_id"
|
t.integer "group_id"
|
||||||
t.string "salt"
|
t.string "salt"
|
||||||
t.binary "received_email", size: :medium
|
t.binary "received_email", limit: 16777215
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "oauth_access_grants", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "oauth_access_grants", id: :integer, force: :cascade do |t|
|
||||||
t.integer "resource_owner_id", null: false
|
t.integer "resource_owner_id", null: false
|
||||||
t.integer "application_id", null: false
|
t.integer "application_id", null: false
|
||||||
t.string "token", null: false
|
t.string "token", null: false
|
||||||
t.integer "expires_in", null: false
|
t.integer "expires_in", null: false
|
||||||
t.text "redirect_uri", null: false
|
t.text "redirect_uri", null: false
|
||||||
t.datetime "created_at", precision: nil, null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "revoked_at", precision: nil
|
t.datetime "revoked_at"
|
||||||
t.string "scopes"
|
t.string "scopes"
|
||||||
t.index ["token"], name: "index_oauth_access_grants_on_token", unique: true
|
t.index ["token"], name: "index_oauth_access_grants_on_token", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "oauth_access_tokens", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "oauth_access_tokens", id: :integer, force: :cascade do |t|
|
||||||
t.integer "resource_owner_id"
|
t.integer "resource_owner_id"
|
||||||
t.integer "application_id"
|
t.integer "application_id"
|
||||||
t.string "token", null: false
|
t.string "token", null: false
|
||||||
t.string "refresh_token"
|
t.string "refresh_token"
|
||||||
t.integer "expires_in"
|
t.integer "expires_in"
|
||||||
t.datetime "revoked_at", precision: nil
|
t.datetime "revoked_at"
|
||||||
t.datetime "created_at", precision: nil, null: false
|
t.datetime "created_at", null: false
|
||||||
t.string "scopes"
|
t.string "scopes"
|
||||||
t.index ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true
|
t.index ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true
|
||||||
t.index ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id"
|
t.index ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id"
|
||||||
t.index ["token"], name: "index_oauth_access_tokens_on_token", unique: true
|
t.index ["token"], name: "index_oauth_access_tokens_on_token", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "oauth_applications", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "oauth_applications", id: :integer, force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.string "uid", null: false
|
t.string "uid", null: false
|
||||||
t.string "secret", null: false
|
t.string "secret", null: false
|
||||||
t.text "redirect_uri", null: false
|
t.text "redirect_uri", null: false
|
||||||
t.string "scopes", default: "", null: false
|
t.string "scopes", default: "", null: false
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at"
|
||||||
t.boolean "confidential", default: true, null: false
|
t.boolean "confidential", default: true, null: false
|
||||||
t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true
|
t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "order_articles", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "order_articles", id: :integer, force: :cascade do |t|
|
||||||
t.integer "order_id", default: 0, null: false
|
t.integer "order_id", default: 0, null: false
|
||||||
t.integer "article_id", default: 0, null: false
|
t.integer "article_id", default: 0, null: false
|
||||||
t.integer "quantity", default: 0, null: false
|
t.integer "quantity", default: 0, null: false
|
||||||
|
@ -352,45 +337,45 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.index ["order_id"], name: "index_order_articles_on_order_id"
|
t.index ["order_id"], name: "index_order_articles_on_order_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "order_comments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "order_comments", id: :integer, force: :cascade do |t|
|
||||||
t.integer "order_id"
|
t.integer "order_id"
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.text "text"
|
t.text "text"
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.index ["order_id"], name: "index_order_comments_on_order_id"
|
t.index ["order_id"], name: "index_order_comments_on_order_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "orders", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "orders", id: :integer, force: :cascade do |t|
|
||||||
t.integer "supplier_id"
|
t.integer "supplier_id"
|
||||||
t.text "note"
|
t.text "note"
|
||||||
t.datetime "starts", precision: nil
|
t.datetime "starts"
|
||||||
t.datetime "ends", precision: nil
|
t.datetime "ends"
|
||||||
t.string "state", default: "open"
|
t.string "state", default: "open"
|
||||||
t.integer "lock_version", default: 0, null: false
|
t.integer "lock_version", default: 0, null: false
|
||||||
t.integer "updated_by_user_id"
|
t.integer "updated_by_user_id"
|
||||||
t.decimal "foodcoop_result", precision: 8, scale: 2
|
t.decimal "foodcoop_result", precision: 8, scale: 2
|
||||||
t.integer "created_by_user_id"
|
t.integer "created_by_user_id"
|
||||||
t.datetime "boxfill", precision: nil
|
t.datetime "boxfill"
|
||||||
t.integer "invoice_id"
|
t.integer "invoice_id"
|
||||||
t.date "pickup"
|
t.date "pickup"
|
||||||
t.datetime "last_sent_mail", precision: nil
|
t.datetime "last_sent_mail"
|
||||||
t.integer "end_action", default: 0, null: false
|
t.integer "end_action", default: 0, null: false
|
||||||
t.decimal "transport", precision: 8, scale: 2
|
t.decimal "transport", precision: 8, scale: 2
|
||||||
t.index ["state"], name: "index_orders_on_state"
|
t.index ["state"], name: "index_orders_on_state"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "page_versions", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "page_versions", id: :integer, force: :cascade do |t|
|
||||||
t.integer "page_id"
|
t.integer "page_id"
|
||||||
t.integer "lock_version"
|
t.integer "lock_version"
|
||||||
t.text "body"
|
t.text "body"
|
||||||
t.integer "updated_by"
|
t.integer "updated_by"
|
||||||
t.integer "redirect"
|
t.integer "redirect"
|
||||||
t.integer "parent_id"
|
t.integer "parent_id"
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at"
|
||||||
t.index ["page_id"], name: "index_page_versions_on_page_id"
|
t.index ["page_id"], name: "index_page_versions_on_page_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "pages", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "pages", id: :integer, force: :cascade do |t|
|
||||||
t.string "title"
|
t.string "title"
|
||||||
t.text "body"
|
t.text "body"
|
||||||
t.string "permalink"
|
t.string "permalink"
|
||||||
|
@ -398,41 +383,41 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.integer "updated_by"
|
t.integer "updated_by"
|
||||||
t.integer "redirect"
|
t.integer "redirect"
|
||||||
t.integer "parent_id"
|
t.integer "parent_id"
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at"
|
||||||
t.index ["permalink"], name: "index_pages_on_permalink"
|
t.index ["permalink"], name: "index_pages_on_permalink"
|
||||||
t.index ["title"], name: "index_pages_on_title"
|
t.index ["title"], name: "index_pages_on_title"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "periodic_task_groups", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "periodic_task_groups", id: :integer, force: :cascade do |t|
|
||||||
t.date "next_task_date"
|
t.date "next_task_date"
|
||||||
t.datetime "created_at", precision: nil, null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", precision: nil, null: false
|
t.datetime "updated_at", null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "poll_choices", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "poll_choices", id: :integer, force: :cascade do |t|
|
||||||
t.integer "poll_vote_id", null: false
|
t.integer "poll_vote_id", null: false
|
||||||
t.integer "choice", null: false
|
t.integer "choice", null: false
|
||||||
t.integer "value", null: false
|
t.integer "value", null: false
|
||||||
t.index ["poll_vote_id", "choice"], name: "index_poll_choices_on_poll_vote_id_and_choice", unique: true
|
t.index ["poll_vote_id", "choice"], name: "index_poll_choices_on_poll_vote_id_and_choice", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "poll_votes", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "poll_votes", id: :integer, force: :cascade do |t|
|
||||||
t.integer "poll_id", null: false
|
t.integer "poll_id", null: false
|
||||||
t.integer "user_id", null: false
|
t.integer "user_id", null: false
|
||||||
t.integer "ordergroup_id"
|
t.integer "ordergroup_id"
|
||||||
t.text "note"
|
t.text "note"
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at"
|
||||||
t.index ["poll_id", "user_id", "ordergroup_id"], name: "index_poll_votes_on_poll_id_and_user_id_and_ordergroup_id", unique: true
|
t.index ["poll_id", "user_id", "ordergroup_id"], name: "index_poll_votes_on_poll_id_and_user_id_and_ordergroup_id", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "polls", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "polls", id: :integer, force: :cascade do |t|
|
||||||
t.integer "created_by_user_id", null: false
|
t.integer "created_by_user_id", null: false
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.text "description"
|
t.text "description"
|
||||||
t.datetime "starts", precision: nil
|
t.datetime "starts"
|
||||||
t.datetime "ends", precision: nil
|
t.datetime "ends"
|
||||||
t.boolean "one_vote_per_ordergroup", default: false, null: false
|
t.boolean "one_vote_per_ordergroup", default: false, null: false
|
||||||
t.text "required_ordergroup_custom_fields"
|
t.text "required_ordergroup_custom_fields"
|
||||||
t.text "required_user_custom_fields"
|
t.text "required_user_custom_fields"
|
||||||
|
@ -442,66 +427,66 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.integer "multi_select_count", default: 0, null: false
|
t.integer "multi_select_count", default: 0, null: false
|
||||||
t.integer "min_points"
|
t.integer "min_points"
|
||||||
t.integer "max_points"
|
t.integer "max_points"
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at"
|
||||||
t.index ["final_choice"], name: "index_polls_on_final_choice"
|
t.index ["final_choice"], name: "index_polls_on_final_choice"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "printer_job_updates", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "printer_job_updates", id: :integer, force: :cascade do |t|
|
||||||
t.integer "printer_job_id", null: false
|
t.integer "printer_job_id", null: false
|
||||||
t.datetime "created_at", precision: nil, null: false
|
t.datetime "created_at", null: false
|
||||||
t.string "state", null: false
|
t.string "state", null: false
|
||||||
t.text "message"
|
t.text "message"
|
||||||
t.index ["printer_job_id", "created_at"], name: "index_printer_job_updates_on_printer_job_id_and_created_at"
|
t.index ["printer_job_id", "created_at"], name: "index_printer_job_updates_on_printer_job_id_and_created_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "printer_jobs", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "printer_jobs", id: :integer, force: :cascade do |t|
|
||||||
t.integer "order_id"
|
t.integer "order_id"
|
||||||
t.string "document", null: false
|
t.string "document", null: false
|
||||||
t.integer "created_by_user_id", null: false
|
t.integer "created_by_user_id", null: false
|
||||||
t.integer "finished_by_user_id"
|
t.integer "finished_by_user_id"
|
||||||
t.datetime "finished_at", precision: nil
|
t.datetime "finished_at"
|
||||||
t.index ["finished_at"], name: "index_printer_jobs_on_finished_at"
|
t.index ["finished_at"], name: "index_printer_jobs_on_finished_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "settings", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "settings", id: :integer, force: :cascade do |t|
|
||||||
t.string "var", null: false
|
t.string "var", null: false
|
||||||
t.text "value"
|
t.text "value"
|
||||||
t.integer "thing_id"
|
t.integer "thing_id"
|
||||||
t.string "thing_type", limit: 30
|
t.string "thing_type", limit: 30
|
||||||
t.datetime "created_at", precision: nil, null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", precision: nil, null: false
|
t.datetime "updated_at", null: false
|
||||||
t.index ["thing_type", "thing_id", "var"], name: "index_settings_on_thing_type_and_thing_id_and_var", unique: true
|
t.index ["thing_type", "thing_id", "var"], name: "index_settings_on_thing_type_and_thing_id_and_var", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "stock_changes", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "stock_changes", id: :integer, force: :cascade do |t|
|
||||||
t.integer "stock_event_id"
|
t.integer "stock_event_id"
|
||||||
t.integer "order_id"
|
t.integer "order_id"
|
||||||
t.integer "stock_article_id"
|
t.integer "stock_article_id"
|
||||||
t.integer "quantity", default: 0
|
t.integer "quantity", default: 0
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.index ["stock_article_id"], name: "index_stock_changes_on_stock_article_id"
|
t.index ["stock_article_id"], name: "index_stock_changes_on_stock_article_id"
|
||||||
t.index ["stock_event_id"], name: "index_stock_changes_on_stock_event_id"
|
t.index ["stock_event_id"], name: "index_stock_changes_on_stock_event_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "stock_events", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "stock_events", id: :integer, force: :cascade do |t|
|
||||||
t.integer "supplier_id"
|
t.integer "supplier_id"
|
||||||
t.date "date"
|
t.date "date"
|
||||||
t.datetime "created_at", precision: nil
|
t.datetime "created_at"
|
||||||
t.text "note"
|
t.text "note"
|
||||||
t.integer "invoice_id"
|
t.integer "invoice_id"
|
||||||
t.string "type", null: false
|
t.string "type", null: false
|
||||||
t.index ["supplier_id"], name: "index_stock_events_on_supplier_id"
|
t.index ["supplier_id"], name: "index_stock_events_on_supplier_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "supplier_categories", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "supplier_categories", id: :integer, force: :cascade do |t|
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.string "description"
|
t.string "description"
|
||||||
t.integer "financial_transaction_class_id"
|
t.integer "financial_transaction_class_id"
|
||||||
t.integer "bank_account_id"
|
t.integer "bank_account_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "suppliers", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "suppliers", id: :integer, force: :cascade do |t|
|
||||||
t.string "name", default: "", null: false
|
t.string "name", default: "", null: false
|
||||||
t.string "address", default: "", null: false
|
t.string "address", default: "", null: false
|
||||||
t.string "phone", default: "", null: false
|
t.string "phone", default: "", null: false
|
||||||
|
@ -516,21 +501,21 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.string "note"
|
t.string "note"
|
||||||
t.integer "shared_supplier_id"
|
t.integer "shared_supplier_id"
|
||||||
t.string "min_order_quantity"
|
t.string "min_order_quantity"
|
||||||
t.datetime "deleted_at", precision: nil
|
t.datetime "deleted_at"
|
||||||
t.string "shared_sync_method"
|
t.string "shared_sync_method"
|
||||||
t.string "iban"
|
t.string "iban"
|
||||||
t.integer "supplier_category_id"
|
t.integer "supplier_category_id"
|
||||||
t.index ["name"], name: "index_suppliers_on_name", unique: true
|
t.index ["name"], name: "index_suppliers_on_name", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "tasks", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "tasks", id: :integer, force: :cascade do |t|
|
||||||
t.string "name", default: "", null: false
|
t.string "name", default: "", null: false
|
||||||
t.text "description"
|
t.text "description"
|
||||||
t.date "due_date"
|
t.date "due_date"
|
||||||
t.boolean "done", default: false
|
t.boolean "done", default: false
|
||||||
t.integer "workgroup_id"
|
t.integer "workgroup_id"
|
||||||
t.datetime "created_on", precision: nil, null: false
|
t.datetime "created_on", null: false
|
||||||
t.datetime "updated_on", precision: nil, null: false
|
t.datetime "updated_on", null: false
|
||||||
t.integer "required_users", default: 1
|
t.integer "required_users", default: 1
|
||||||
t.integer "duration", default: 1
|
t.integer "duration", default: 1
|
||||||
t.integer "periodic_task_group_id"
|
t.integer "periodic_task_group_id"
|
||||||
|
@ -540,7 +525,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.index ["workgroup_id"], name: "index_tasks_on_workgroup_id"
|
t.index ["workgroup_id"], name: "index_tasks_on_workgroup_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "users", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
create_table "users", id: :integer, force: :cascade do |t|
|
||||||
t.string "nick"
|
t.string "nick"
|
||||||
t.string "password_hash", default: "", null: false
|
t.string "password_hash", default: "", null: false
|
||||||
t.string "password_salt", default: "", null: false
|
t.string "password_salt", default: "", null: false
|
||||||
|
@ -548,16 +533,15 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_15_085312) do
|
||||||
t.string "last_name", default: "", null: false
|
t.string "last_name", default: "", null: false
|
||||||
t.string "email", default: "", null: false
|
t.string "email", default: "", null: false
|
||||||
t.string "phone"
|
t.string "phone"
|
||||||
t.datetime "created_on", precision: nil, null: false
|
t.datetime "created_on", null: false
|
||||||
t.string "reset_password_token"
|
t.string "reset_password_token"
|
||||||
t.datetime "reset_password_expires", precision: nil
|
t.datetime "reset_password_expires"
|
||||||
t.datetime "last_login", precision: nil
|
t.datetime "last_login"
|
||||||
t.datetime "last_activity", precision: nil
|
t.datetime "last_activity"
|
||||||
t.datetime "deleted_at", precision: nil
|
t.datetime "deleted_at"
|
||||||
t.string "iban"
|
t.string "iban"
|
||||||
t.index ["email"], name: "index_users_on_email", unique: true
|
t.index ["email"], name: "index_users_on_email", unique: true
|
||||||
t.index ["nick"], name: "index_users_on_nick", unique: true
|
t.index ["nick"], name: "index_users_on_nick", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# default seed is minimal
|
# default seed is minimal
|
||||||
require Rails.root.join('db/seeds/demo-seeds.rb')
|
require Rails.root.join('db/seeds/minimal.seeds.rb')
|
||||||
|
|
||||||
# to generate new seeds, use the seed_dumper gem
|
# to generate new seeds, use the seed_dumper gem
|
||||||
|
|
|
@ -1,147 +0,0 @@
|
||||||
require_relative 'seed_helper.rb'
|
|
||||||
|
|
||||||
FinancialTransactionClass.create!(:id => 1, :name => 'Standard')
|
|
||||||
FinancialTransactionClass.create!(:id => 2, :name => 'Foodsoft')
|
|
||||||
FinancialTransactionType.create!(:id => 1, :name => "Foodcoop", :financial_transaction_class_id => 1)
|
|
||||||
|
|
||||||
alice = User.create!(:id => 1, :nick => "alice", :password => "secret", :first_name => "Alice", :last_name => "Administrator", :email => "admin@foo.test", :phone => "+4421486548", :created_on => 'Wed, 15 Jan 2014 16:15:33 UTC +00:00')
|
|
||||||
bob = User.create!(:id => 2, :nick => "bob", :password => "secret", :first_name => "Bob", :last_name => "Doe", :email => "bob@doe.test", :created_on => 'Sun, 19 Jan 2014 17:38:22 UTC +00:00')
|
|
||||||
|
|
||||||
|
|
||||||
Workgroup.create!(:id => 1, :name => "Administrators", :description => "System administrators.", :account_balance => 0.0, :created_on => 'Wed, 15 Jan 2014 16:15:33 UTC +00:00', :role_admin => true, :role_suppliers => true, :role_article_meta => true, :role_finance => true, :role_orders => true, :next_weekly_tasks_number => 8, :ignore_apple_restriction => false)
|
|
||||||
Workgroup.create!(:id => 2, :name => "Finances", :account_balance => 0.0, :created_on => 'Sun, 19 Jan 2014 17:40:03 UTC +00:00', :role_admin => false, :role_suppliers => false, :role_article_meta => false, :role_finance => true, :role_orders => false, :next_weekly_tasks_number => 8, :ignore_apple_restriction => false)
|
|
||||||
Ordergroup.create!(:id => 5, :name => "Alice WG", :account_balance => 0.90E2, :created_on => 'Sat, 18 Jan 2014 00:38:48 UTC +00:00', :role_admin => false, :role_suppliers => false, :role_article_meta => false, :role_finance => false, :role_orders => false, :stats => { :jobs_size => 0, :orders_sum => 1021.74 }, :next_weekly_tasks_number => 8, :ignore_apple_restriction => true)
|
|
||||||
Ordergroup.create!(:id => 8, :name => "Bob's Family", :account_balance => 0.90E2, :created_on => 'Wed, 09 Apr 2014 12:23:29 UTC +00:00', :role_admin => false, :role_suppliers => false, :role_article_meta => false, :role_finance => false, :role_orders => false, :contact_person => "John Doe", :stats => { :jobs_size => 0, :orders_sum => 0 }, :next_weekly_tasks_number => 8, :ignore_apple_restriction => false)
|
|
||||||
FinancialTransaction.create!(:ordergroup_id => 5, :amount => 0.90E2, :note => "Bank transfer", :user_id => 2, :created_on => 'Mon, 17 Feb 2014 16:19:34 UTC +00:00', :financial_transaction_type_id => 1)
|
|
||||||
FinancialTransaction.create!(:ordergroup_id => 8, :amount => 0.90E2, :note => "Bank transfer", :user_id => 2, :created_on => 'Mon, 17 Feb 2014 16:19:34 UTC +00:00', :financial_transaction_type_id => 1)
|
|
||||||
|
|
||||||
Membership.create!(:group_id => 1, :user_id => 1)
|
|
||||||
Membership.create!(:group_id => 5, :user_id => 1)
|
|
||||||
Membership.create!(:group_id => 2, :user_id => 2)
|
|
||||||
Membership.create!(:group_id => 8, :user_id => 2)
|
|
||||||
|
|
||||||
supplier_category = SupplierCategory.create!(:id => 1, :name => "Other", :financial_transaction_class_id => 1)
|
|
||||||
|
|
||||||
chocolate_supplier = Supplier.create!(
|
|
||||||
name: "Kollektiv CHOCK!",
|
|
||||||
address: "Grabower Straße 1\n12345 Berlin",
|
|
||||||
phone: "0123456789",
|
|
||||||
email: "info@bbakery.test",
|
|
||||||
supplier_category: supplier_category
|
|
||||||
)
|
|
||||||
|
|
||||||
nkn_supplier = Supplier.create!(
|
|
||||||
name: "Naturgut Süd",
|
|
||||||
address: "Somewhere in Hamburg, maybe St. Pauli?",
|
|
||||||
phone: "0123434789",
|
|
||||||
email: "foodsoft@local-it.org",
|
|
||||||
supplier_category: supplier_category
|
|
||||||
)
|
|
||||||
|
|
||||||
chocolate_category = ArticleCategory.create!(name: "Schokolade")
|
|
||||||
obst_category = ArticleCategory.create!(name: "Obst, Gemüse, Sprossen, Pilze")
|
|
||||||
nudeln_category = ArticleCategory.create!(name: "Nudeln, Trockenfrüchte, Müsli")
|
|
||||||
reis_category = ArticleCategory.create!(name: "Getreide, Ölsaaten. Nußkerne")
|
|
||||||
|
|
||||||
Article.create!(
|
|
||||||
name: "Vollmilch-Schokolade",
|
|
||||||
supplier_id: chocolate_supplier.id,
|
|
||||||
article_category_id: chocolate_category.id,
|
|
||||||
manufacturer: "Grabower Süßwaren GmbH",
|
|
||||||
origin: "D", price: 3.0, tax: 7.0,
|
|
||||||
unit: "200g", unit_quantity: 5,
|
|
||||||
note: "bio, fairtrade, 40% Kakao, vegan",
|
|
||||||
availability: true, order_number: "1")
|
|
||||||
|
|
||||||
Article.create!(
|
|
||||||
name: "Weiße Schokolade",
|
|
||||||
supplier_id: chocolate_supplier.id,
|
|
||||||
article_category_id: chocolate_category.id,
|
|
||||||
manufacturer: "Grabower Süßwaren GmbH",
|
|
||||||
origin: "D", price: 3.49, tax: 7.0,
|
|
||||||
unit: "200g", unit_quantity: 5,
|
|
||||||
note: "bio, fairtrade, 40% Kakao, vegan",
|
|
||||||
availability: true, order_number: "2")
|
|
||||||
|
|
||||||
dark_chocolate = Article.create!(
|
|
||||||
name: "Dunkle Schokolade",
|
|
||||||
supplier_id: chocolate_supplier.id,
|
|
||||||
article_category_id: chocolate_category.id,
|
|
||||||
manufacturer: "Grabower Süßwaren GmbH",
|
|
||||||
origin: "D", price: 2.89, tax: 7.0,
|
|
||||||
unit: "200g", unit_quantity: 5,
|
|
||||||
note: "bio, fairtrade, 40% Kakao, vegan",
|
|
||||||
availability: true, order_number: "3")
|
|
||||||
|
|
||||||
Article.create!(
|
|
||||||
name: "Himbeer-Schokolade",
|
|
||||||
supplier_id: chocolate_supplier.id,
|
|
||||||
article_category_id: chocolate_category.id,
|
|
||||||
manufacturer: "Grabower Süßwaren GmbH",
|
|
||||||
origin: "D", price: 2.89, tax: 7.0,
|
|
||||||
unit: "170g", unit_quantity: 4,
|
|
||||||
note: "bio, fairtrade, 40% Kakao, vegan",
|
|
||||||
availability: true, order_number: "4")
|
|
||||||
|
|
||||||
previous_order = seed_order(supplier_id: chocolate_supplier.id, starts: 10.days.ago, ends: 7.days.ago)
|
|
||||||
|
|
||||||
GroupOrderArticle.create!(
|
|
||||||
group_order: GroupOrder.create!(order_id: previous_order.id, ordergroup_id: 8),
|
|
||||||
order_article: previous_order.order_articles.find_by(article_id: dark_chocolate.id),
|
|
||||||
quantity: 5, tolerance: 0)
|
|
||||||
|
|
||||||
previous_order.close!(alice)
|
|
||||||
|
|
||||||
seed_order(supplier_id: chocolate_supplier.id, starts: 0.days.ago, ends: 7.days.from_now)
|
|
||||||
|
|
||||||
|
|
||||||
apple = Article.create!(
|
|
||||||
name: "Äpfel Elstar",
|
|
||||||
supplier_id: nkn_supplier.id,
|
|
||||||
article_category_id: obst_category.id,
|
|
||||||
manufacturer: "Obsthof Bruno Brugger",
|
|
||||||
origin: "D", price: 3.49, tax: 7.0,
|
|
||||||
unit: "1kg", unit_quantity: 10,
|
|
||||||
note: "lecker, fruchtig, demeter",
|
|
||||||
availability: true, order_number: "5")
|
|
||||||
|
|
||||||
brokkoli = Article.create!(
|
|
||||||
name: "Brokkoli",
|
|
||||||
supplier_id: nkn_supplier.id,
|
|
||||||
article_category_id: obst_category.id,
|
|
||||||
manufacturer: "Fattoria degli Orsi",
|
|
||||||
origin: "IT", price: 2.89, tax: 7.0,
|
|
||||||
unit: "400g", unit_quantity: 6,
|
|
||||||
note: "gesund und lecker",
|
|
||||||
availability: true, order_number: "6")
|
|
||||||
|
|
||||||
tomatoes = Article.create!(
|
|
||||||
name: "Tomaten",
|
|
||||||
supplier_id: nkn_supplier.id,
|
|
||||||
article_category_id: obst_category.id,
|
|
||||||
manufacturer: "Terra di Puglia",
|
|
||||||
origin: "IT", price: 2.89, tax: 7.0,
|
|
||||||
unit: "500g", unit_quantity: 20,
|
|
||||||
note: "pomodori italiani, demeter",
|
|
||||||
availability: true, order_number: "7")
|
|
||||||
|
|
||||||
rice = Article.create!(
|
|
||||||
name: "Reis",
|
|
||||||
supplier_id: nkn_supplier.id,
|
|
||||||
article_category_id: reis_category.id,
|
|
||||||
manufacturer: "Finck",
|
|
||||||
origin: "D", price: 3.29, tax: 7.0,
|
|
||||||
unit: "3kg", unit_quantity: 10,
|
|
||||||
note: "Reis im Vorratssack, demeter",
|
|
||||||
availability: true, order_number: "8")
|
|
||||||
|
|
||||||
spaghetti = Article.create!(
|
|
||||||
name: "Spaghetti",
|
|
||||||
supplier_id: nkn_supplier.id,
|
|
||||||
article_category_id: nudeln_category.id,
|
|
||||||
manufacturer: "Pastificio Zanellini spa",
|
|
||||||
origin: "D", price: 2.89, tax: 7.0,
|
|
||||||
unit: "500g", unit_quantity: 4,
|
|
||||||
note: "100% italienisches Hartweizengrieß",
|
|
||||||
availability: true, order_number: "9")
|
|
||||||
|
|
|
@ -8,10 +8,10 @@ def seed_group_orders
|
||||||
|
|
||||||
# order 3..12 times a random article
|
# order 3..12 times a random article
|
||||||
go = og.group_orders.create!(order: order, updated_by_user_id: 1)
|
go = og.group_orders.create!(order: order, updated_by_user_id: 1)
|
||||||
(rand(10) + 3).times do
|
(3 + rand(10)).times do
|
||||||
goa = go.group_order_articles.find_or_create_by!(order_article: order.order_articles.offset(rand(noas)).first)
|
goa = go.group_order_articles.find_or_create_by!(order_article: order.order_articles.offset(rand(noas)).first)
|
||||||
unit_quantity = goa.order_article.price.unit_quantity
|
unit_quantity = goa.order_article.price.unit_quantity
|
||||||
goa.update_quantities rand([4, unit_quantity * 2 + 2].max), rand(unit_quantity)
|
goa.update_quantities rand([4, 2 * unit_quantity + 2].max), rand(unit_quantity)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# update totals
|
# update totals
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
BNN;3;0;Naturkost Nord, Hamburg;T;Angebot Nr. 0922;EUR;20220905;20221001;20220825;837;1
|
|
||||||
5;;;;4280001958081;4280001958203;Žpfel Elstar;erntefrisch und knackig;;;obb;;D;C%;DE-™KO-001;120;0301;10;55;;1;10 x1kg;10;1kg;1;N;;;;1,41;;;;1;;;4,49;2,89;J;;2;3;;;;;;;;;;;;;;;;;;;A;;;;;Kg;1;;
|
|
||||||
6;;;;4280001958081;4280001958203;Brokkoli;gesund und lecker;;;fig;;IT;C%;DE-™KO-001;120;03;10;55;;1;6 x400g;6;400g;1;N;;;;1,41;;;;1;;;4,49;2,99;J;;2;3;;;;;;;;;;;;;;;;;;;A;;;;;Kg;2,5;;
|
|
||||||
7;;;;4280001958081;4280001958203;Tomaten;pomodori italiani, demeter;;;TDP;;IT;C%;DE-™KO-001;120;03;10;55;;1;20 x500g;20;500g;1;N;;;;1,41;;;;1;;;4,49;3,19;J;;2;3;;;;;;;;;;;;;;;;;;;A;;;;;Kg;2;;
|
|
||||||
8;;;;4280001958081;4280001958203;Reis;Reis im Vorratssack, demeter;;;FIN;;D;C%;DE-™KO-001;120;05;10;55;;1;12 x3k;12;3kg;1;N;;;;1,41;;;;1;;;4,49;3,49;J;;2;3;;;;;;;;;;;;;;;;;;;A;;;;;Kg;0,3;;
|
|
||||||
9;;;;4280001958081;4280001958203;Spaghetti;100% italienisches Hartweizengrieá;;;ZLN;;D;C%;DE-™KO-001;120;06;10;55;;1;4 x500g;4;500g;1;N;;;;1,41;;;;1;;;4,49;2,99;J;;2;3;;;;;;;;;;;;;;;;;;;A;;;;;Kg;2;;
|
|
||||||
10;;;;4280001958081;4280001958203;Kartoffeln;vorwiegend festkochend;;;rsh;;D;C%;DE-™KO-001;120;0311;10;55;;1;6 x5Kg;6;5Kg;1;N;;;;1,41;;;;1;;;4,49;3,00;J;;2;3;;;;;;;;;;;;;;;;;;;A;;;;;Kg;0.2;;
|
|
|
@ -1,65 +0,0 @@
|
||||||
TYPE=foodsoft
|
|
||||||
|
|
||||||
DOMAIN=order.example.org
|
|
||||||
#EXTRA_DOMAINS=', `www.order.example.com`'
|
|
||||||
LETS_ENCRYPT_ENV=production
|
|
||||||
COMPOSE_FILE="compose.yml"
|
|
||||||
|
|
||||||
# app settings
|
|
||||||
FOODCOOP_MULTI_INSTALL=true # Best for now, see https://github.com/foodcoops/foodsoft/pull/841
|
|
||||||
FOODCOOP_NAME=example
|
|
||||||
FOODCOOP_CITY=XXX
|
|
||||||
FOODCOOP_COUNTRY=XXX
|
|
||||||
FOODCOOP_EMAIL=info@example.org
|
|
||||||
FOODCOOP_PHONE=XXX
|
|
||||||
FOODCOOP_STREET=XXX
|
|
||||||
FOODCOOP_ZIP_CODE=XXX
|
|
||||||
FOODCOOP_HOMEPAGE=https://order.example.org
|
|
||||||
FOODCOOP_HELP_URL=https://order.example.org
|
|
||||||
FOODCOOP_TIME_ZONE=Amsterdam
|
|
||||||
FOODCOOP_USE_NICK=true
|
|
||||||
FOODCOOP_LANGUAGE=en
|
|
||||||
FOODCOOP_FOOTER='<a href="https://example.org/">example</a> hosted by <a href="https://yourhoster.org">Your Tech Co-op</a>.'
|
|
||||||
USE_APPLE_POINTS=false
|
|
||||||
STOP_ORDERING_UNDER=75
|
|
||||||
MINIMUM_BALANCE=0
|
|
||||||
|
|
||||||
# database settings
|
|
||||||
MYSQL_DB=foodsoft
|
|
||||||
MYSQL_HOST=db
|
|
||||||
MYSQL_PORT=3306
|
|
||||||
MYSQL_USER=foodsoft
|
|
||||||
|
|
||||||
# shared supplier list settings
|
|
||||||
# COMPOSE_FILE="$COMPOSE_FILE:compose.sharedlists.yml"
|
|
||||||
# ENABLE_SHARED_LISTS=0
|
|
||||||
# SHARED_LISTS_DB_TYPE=mysql2
|
|
||||||
# SHARED_LISTS_HOST=order.otherfoodcoop.org
|
|
||||||
# SHARED_LISTS_DB_NAME=sharedlists
|
|
||||||
# SHARED_LISTS_USER=example
|
|
||||||
|
|
||||||
# Group order invoices generation pull request
|
|
||||||
# https://github.com/foodcoops/foodsoft/pull/907
|
|
||||||
# COMPOSE_FILE="$COMPOSE_FILE:compose.groupOrderInvoice.yml"
|
|
||||||
|
|
||||||
# outgoing mail settings
|
|
||||||
EMAIL_SENDER=noreply@example.org
|
|
||||||
EMAIL_ERROR=systems@example.org
|
|
||||||
SMTP_ADDRESS=mail.example.com
|
|
||||||
SMTP_AUTHENTICATION=plain
|
|
||||||
SMTP_DOMAIN=mail.example.com
|
|
||||||
SMTP_ENABLE_STARTTLS_AUTO=true
|
|
||||||
SMTP_PORT=587
|
|
||||||
SMTP_USER_NAME=foodsoft
|
|
||||||
|
|
||||||
# incoming mail settings
|
|
||||||
EMAIL_REPLY_DOMAIN=example.org
|
|
||||||
SMTP_SERVER_HOST=0.0.0.0
|
|
||||||
SMTP_SERVER_PORT=2525
|
|
||||||
|
|
||||||
# secret versions
|
|
||||||
SECRET_DB_PASSWORD_VERSION=v1
|
|
||||||
SECRET_DB_ROOT_PASSWORD_VERSION=v1
|
|
||||||
SECRET_SHARED_LISTS_DB_PASSWORD_VERSION=v1
|
|
||||||
SECRET_SMTP_PASSWORD_VERSION=v1
|
|
||||||
SECRET_SECRET_KEY_BASE_VERSION=v1 # length=30
|
|
|
@ -1,168 +0,0 @@
|
||||||
# {{ env "DOMAIN" }} configuration
|
|
||||||
|
|
||||||
default: &defaults
|
|
||||||
# If you wanna serve more than one foodcoop with one installation
|
|
||||||
# Don't forget to setup databases for each foodcoop. See also MULTI_COOP_INSTALL
|
|
||||||
multi_coop_install: {{ env "FOODCOOP_MULTI_INSTALL" }}
|
|
||||||
|
|
||||||
# If multi_coop_install you have to use a coop name, which you you wanna be selected by default
|
|
||||||
default_scope: "{{ env "FOODCOOP_NAME" }}"
|
|
||||||
|
|
||||||
# name of this foodcoop
|
|
||||||
name: "{{ env "FOODCOOP_NAME" }}"
|
|
||||||
|
|
||||||
# foodcoop contact information (used for FAX messages)
|
|
||||||
contact:
|
|
||||||
street: "{{ env "FOODCOOP_STREET" }}"
|
|
||||||
zip_code: "{{ env "FOODCOOP_ZIP_CODE" }}"
|
|
||||||
city: "{{ env "FOODCOOP_CITY" }}"
|
|
||||||
country: "{{ env "FOODCOOP_COUNTRY" }}"
|
|
||||||
email: "{{ env "FOODCOOP_EMAIL" }}"
|
|
||||||
phone: "{{ env "FOODCOOP_PHONE" }}"
|
|
||||||
|
|
||||||
# Homepage
|
|
||||||
homepage: "{{ env "FOODCOOP_HOMEPAGE" }}"
|
|
||||||
|
|
||||||
# foodsoft documentation URL
|
|
||||||
help_url: "{{ env "FOODCOOP_HELP_URL" }}"
|
|
||||||
|
|
||||||
# documentation URL for the apples&pears work system
|
|
||||||
applepear_url: https://github.com/foodcoops/foodsoft/wiki/%C3%84pfel-u.-Birnen
|
|
||||||
|
|
||||||
# custom foodsoft software URL (used in footer)
|
|
||||||
foodsoft_url: https://foodcoops.github.io
|
|
||||||
|
|
||||||
# Default language
|
|
||||||
default_locale: {{ env "FOODCOOP_LANGUAGE" }}
|
|
||||||
|
|
||||||
# By default, foodsoft takes the language from the webbrowser/operating system.
|
|
||||||
# In case you really want foodsoft in a certain language by default, set this to true.
|
|
||||||
# When members are logged in, the language from their profile settings is still used.
|
|
||||||
ignore_browser_locale: false
|
|
||||||
|
|
||||||
# Default timezone, e.g. UTC, Amsterdam, Berlin, etc.
|
|
||||||
time_zone: "{{ env "FOODCOOP_TIME_ZONE" }}"
|
|
||||||
|
|
||||||
# Currency symbol, and whether to add a whitespace after the unit.
|
|
||||||
currency_unit: €
|
|
||||||
#currency_space: true
|
|
||||||
|
|
||||||
# price markup in percent
|
|
||||||
price_markup: 2.0
|
|
||||||
|
|
||||||
# default vat percentage for new articles
|
|
||||||
tax_default: 7.0
|
|
||||||
|
|
||||||
# tolerance order option: If set to false, article tolerance values do not count
|
|
||||||
# for total article price as long as the order is not finished.
|
|
||||||
tolerance_is_costly: false
|
|
||||||
|
|
||||||
# Ordergroups, which have less than 75 apples should not be allowed to make new orders
|
|
||||||
# Comment out this option to activate this restriction
|
|
||||||
stop_ordering_under: {{ env "STOP_ORDERING_UNDER" }}
|
|
||||||
|
|
||||||
# Comment out to completely hide apple points (be sure to comment stop_ordering_under)
|
|
||||||
use_apple_points: {{ env "USE_APPLE_POINTS" }}
|
|
||||||
|
|
||||||
# ordergroups can only order when their balance is higher than or equal to this
|
|
||||||
# not fully enforced right now, since the check is only client-side
|
|
||||||
minimum_balance: {{ env "MINIMUM_BALANCE" }}
|
|
||||||
|
|
||||||
# how many days there are between two periodic tasks
|
|
||||||
#tasks_period_days: 7
|
|
||||||
|
|
||||||
# how many days upfront periodic tasks are created
|
|
||||||
#tasks_upfront_days: 49
|
|
||||||
|
|
||||||
# default order schedule, used to provide initial dates for new orders
|
|
||||||
# (recurring dates in ical format; no spaces!)
|
|
||||||
#order_schedule:
|
|
||||||
# ends:
|
|
||||||
# recurr: FREQ=WEEKLY;INTERVAL=2;BYDAY=MO
|
|
||||||
# time: '9:00'
|
|
||||||
# # reference point, this is generally the first pickup day; empty is often ok
|
|
||||||
# #initial:
|
|
||||||
|
|
||||||
# When use_nick is enabled, there will be a nickname field in the user form,
|
|
||||||
# and the option to show a nickname instead of full name to foodcoop members.
|
|
||||||
# Members of a user's groups and administrators can still see full names.
|
|
||||||
use_nick: {{ env "FOODCOOP_USE_NICK" }}
|
|
||||||
|
|
||||||
# Most plugins can be enabled/disabled here as well. Messages and wiki are enabled
|
|
||||||
# by default and need to be set to false to disable. Most other plugins needs to
|
|
||||||
# be enabled before they do anything.
|
|
||||||
use_wiki: true
|
|
||||||
use_messages: true
|
|
||||||
use_documents: true
|
|
||||||
use_polls: true
|
|
||||||
|
|
||||||
# Base font size for generated PDF documents
|
|
||||||
#pdf_font_size: 12
|
|
||||||
|
|
||||||
# Page size for generated PDF documents
|
|
||||||
#pdf_page_size: A4
|
|
||||||
|
|
||||||
# Some documents (like group and article PDFs) can include page breaks
|
|
||||||
# after each sublist.
|
|
||||||
#pdf_add_page_breaks: true
|
|
||||||
|
|
||||||
# Alternatively, this can be set for each document.
|
|
||||||
#pdf_add_page_breaks:
|
|
||||||
# order_by_groups: true
|
|
||||||
# order_by_articles: true
|
|
||||||
|
|
||||||
# Page footer (html allowed). Default is a Foodsoft footer. Set to `blank` for no footer.
|
|
||||||
page_footer: {{ env "FOODCOOP_FOOTER" }}
|
|
||||||
|
|
||||||
# Custom CSS for the foodcoop
|
|
||||||
#custom_css: 'body { background-color: #fcffba; }'
|
|
||||||
|
|
||||||
# Uncomment to add tracking code for web statistics, e.g. for Piwik. (Added to bottom of page)
|
|
||||||
#webstats_tracking_code: |
|
|
||||||
# <!-- Piwik -->
|
|
||||||
# ......
|
|
||||||
|
|
||||||
# email address to be used as sender
|
|
||||||
email_sender: "{{ env "EMAIL_SENDER" }}"
|
|
||||||
|
|
||||||
# email address to be used as from
|
|
||||||
email_from: "{{ env "EMAIL_SENDER" }}"
|
|
||||||
|
|
||||||
# domain to be used for reply emails
|
|
||||||
reply_email_domain: {{ env "EMAIL_REPLY_DOMAIN" }}
|
|
||||||
|
|
||||||
# If your foodcoop uses a mailing list instead of internal messaging system
|
|
||||||
#mailing_list: list@example.org
|
|
||||||
#mailing_list_subscribe: list-subscribe@example.org
|
|
||||||
|
|
||||||
# Config for the exception_notification plugin
|
|
||||||
notification:
|
|
||||||
error_recipients:
|
|
||||||
- "{{ env "EMAIL_ERROR" }}"
|
|
||||||
sender_address: "\"Foodsoft error\" <{{ env "EMAIL_SENDER" }}>"
|
|
||||||
email_prefix: "[foodsoft] "
|
|
||||||
|
|
||||||
# http config for this host to generate links in emails (uses environment config when not set)
|
|
||||||
protocol: https
|
|
||||||
host: "{{ env "DOMAIN" }}"
|
|
||||||
#port: 3000
|
|
||||||
|
|
||||||
{{ if eq (env "ENABLE_SHARED_LISTS") "1" }}
|
|
||||||
# Access to sharedlists, the external article-database.
|
|
||||||
# This allows a foodcoop to subscribe to a selection of a supplier's full assortment,
|
|
||||||
# and makes it possible to share data with several foodcoops. Using this requires installing
|
|
||||||
# an additional application with a separate database.
|
|
||||||
shared_lists:
|
|
||||||
adapter: "{{ env "SHARED_LISTS_DB_TYPE" }}"
|
|
||||||
host: "{{ env "SHARED_LISTS_HOST" }}"
|
|
||||||
database: "{{ env "SHARED_LISTS_DB_NAME" }}"
|
|
||||||
username: "{{ env "SHARED_LISTS_USER" }}"
|
|
||||||
password: "{{ secret "shared_lists_db_password" }}"
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
# don't remove this, required to run the app
|
|
||||||
production:
|
|
||||||
<<: *defaults
|
|
||||||
|
|
||||||
{{ env "FOODCOOP_NAME" }}:
|
|
||||||
<<: *defaults
|
|
|
@ -1,190 +0,0 @@
|
||||||
---
|
|
||||||
version: "3.8"
|
|
||||||
|
|
||||||
x-env: &env
|
|
||||||
CERTBOT_DISABLED: 1
|
|
||||||
DOMAIN:
|
|
||||||
EMAIL_ERROR:
|
|
||||||
EMAIL_REPLY_DOMAIN:
|
|
||||||
EMAIL_SENDER:
|
|
||||||
FOODCOOP_CITY:
|
|
||||||
FOODCOOP_COUNTRY:
|
|
||||||
FOODCOOP_EMAIL:
|
|
||||||
FOODCOOP_FOOTER:
|
|
||||||
FOODCOOP_HELP_URL:
|
|
||||||
FOODCOOP_HOMEPAGE:
|
|
||||||
FOODCOOP_MULTI_INSTALL:
|
|
||||||
FOODCOOP_NAME:
|
|
||||||
FOODCOOP_PHONE:
|
|
||||||
FOODCOOP_STREET:
|
|
||||||
FOODCOOP_TIME_ZONE:
|
|
||||||
FOODCOOP_ZIP_CODE:
|
|
||||||
FOODCOOP_USE_NICK:
|
|
||||||
FOODCOOP_LANGUAGE:
|
|
||||||
LOG_LEVEL:
|
|
||||||
MINIMUM_BALANCE:
|
|
||||||
MYSQL_DB:
|
|
||||||
MYSQL_HOST:
|
|
||||||
MYSQL_PORT:
|
|
||||||
MYSQL_USER:
|
|
||||||
QUEUE: foodsoft_notifier
|
|
||||||
REDIS_URL: redis://cache:6379
|
|
||||||
SECRET_KEY_BASE_FILE: /run/secrets/secret_key_base
|
|
||||||
SMTP_ADDRESS:
|
|
||||||
SMTP_AUTHENTICATION:
|
|
||||||
SMTP_DOMAIN:
|
|
||||||
SMTP_ENABLE_STARTTLS_AUTO:
|
|
||||||
SMTP_PASSWORD_FILE: /run/secrets/smtp_password
|
|
||||||
SMTP_PORT:
|
|
||||||
SMTP_USER_NAME:
|
|
||||||
STOP_ORDERING_UNDER:
|
|
||||||
USE_APPLE_POINTS:
|
|
||||||
|
|
||||||
x-configs: &configs
|
|
||||||
- source: app_config
|
|
||||||
target: /usr/src/app/config/app_config.yml
|
|
||||||
- source: db_config
|
|
||||||
target: /usr/src/app/config/database.yml
|
|
||||||
- source: entrypoint
|
|
||||||
target: /usr/src/app/docker-entrypoint.sh
|
|
||||||
mode: 0555
|
|
||||||
|
|
||||||
x-secrets: &secrets
|
|
||||||
- db_password
|
|
||||||
- secret_key_base
|
|
||||||
- smtp_password
|
|
||||||
|
|
||||||
services:
|
|
||||||
app:
|
|
||||||
image: ${IMAGE}
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
- proxy
|
|
||||||
secrets: *secrets
|
|
||||||
configs: *configs
|
|
||||||
entrypoint: &entrypoint /usr/src/app/docker-entrypoint.sh
|
|
||||||
environment:
|
|
||||||
<<: *env
|
|
||||||
FOODSOFT_SERVICE: app
|
|
||||||
RAILS_SERVE_STATIC_FILES: 'true'
|
|
||||||
healthcheck:
|
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:3000"]
|
|
||||||
interval: 15s
|
|
||||||
timeout: 10s
|
|
||||||
retries: 10
|
|
||||||
start_period: 1m
|
|
||||||
deploy:
|
|
||||||
update_config:
|
|
||||||
failure_action: rollback
|
|
||||||
order: start-first
|
|
||||||
labels:
|
|
||||||
- "traefik.enable=true"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
|
||||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
|
||||||
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3000"
|
|
||||||
- "coop-cloud.${STACK_NAME}.version=1.0.0+4.7.1"
|
|
||||||
|
|
||||||
cron:
|
|
||||||
image: ${IMAGE}
|
|
||||||
secrets: *secrets
|
|
||||||
configs: *configs
|
|
||||||
entrypoint: *entrypoint
|
|
||||||
environment:
|
|
||||||
<<: *env
|
|
||||||
FOODSOFT_SERVICE: cron
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
|
|
||||||
worker:
|
|
||||||
image: ${IMAGE}
|
|
||||||
secrets: *secrets
|
|
||||||
configs: *configs
|
|
||||||
entrypoint: *entrypoint
|
|
||||||
environment:
|
|
||||||
<<: *env
|
|
||||||
FOODSOFT_SERVICE: worker
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
|
|
||||||
smtp:
|
|
||||||
image: ${IMAGE}
|
|
||||||
configs: *configs
|
|
||||||
entrypoint: *entrypoint
|
|
||||||
secrets: *secrets
|
|
||||||
environment:
|
|
||||||
<<: *env
|
|
||||||
FOODSOFT_SERVICE: smtp
|
|
||||||
SMTP_SERVER_HOST:
|
|
||||||
SMTP_SERVER_PORT:
|
|
||||||
networks:
|
|
||||||
- proxy
|
|
||||||
- internal
|
|
||||||
deploy:
|
|
||||||
labels:
|
|
||||||
- "traefik.enable=true"
|
|
||||||
- "traefik.tcp.routers.foodsoft-smtp.rule=HostSNI(`*`)"
|
|
||||||
- "traefik.tcp.routers.foodsoft-smtp.entrypoints=foodsoft-smtp"
|
|
||||||
- "traefik.tcp.services.foodsoft-smtp.loadbalancer.server.port=${SMTP_SERVER_PORT}"
|
|
||||||
|
|
||||||
db:
|
|
||||||
image: "mariadb:10.6"
|
|
||||||
command: "mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_520_ci"
|
|
||||||
environment:
|
|
||||||
MYSQL_USER: ${MYSQL_USER}
|
|
||||||
MYSQL_DATABASE: ${MYSQL_DB}
|
|
||||||
MYSQL_PASSWORD_FILE: /run/secrets/db_password
|
|
||||||
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
|
|
||||||
secrets:
|
|
||||||
- db_password
|
|
||||||
- db_root_password
|
|
||||||
volumes:
|
|
||||||
- "db:/var/lib/mysql"
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
deploy:
|
|
||||||
labels:
|
|
||||||
backupbot.backup: "true"
|
|
||||||
backupbot.backup.pre-hook: 'mkdir -p /tmp/backup/ && mysqldump --single-transaction -u root -p"$$(cat /run/secrets/db_root_password)" $${MYSQL_DATABASE} > /tmp/backup/backup.sql'
|
|
||||||
backupbot.backup.post-hook: "rm -rf /tmp/backup"
|
|
||||||
backupbot.backup.path: "/tmp/backup/"
|
|
||||||
cache:
|
|
||||||
image: "redis:6"
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
|
|
||||||
networks:
|
|
||||||
internal:
|
|
||||||
proxy:
|
|
||||||
external: true
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
db:
|
|
||||||
|
|
||||||
configs:
|
|
||||||
app_config:
|
|
||||||
name: ${STACK_NAME}_app_config_${APP_CONFIG_VERSION}
|
|
||||||
file: app_config.yml.tmpl
|
|
||||||
template_driver: golang
|
|
||||||
db_config:
|
|
||||||
name: ${STACK_NAME}_db_config_${DB_CONFIG_VERSION}
|
|
||||||
file: database.yml.tmpl
|
|
||||||
template_driver: golang
|
|
||||||
entrypoint:
|
|
||||||
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION}
|
|
||||||
file: entrypoint.sh.tmpl
|
|
||||||
template_driver: golang
|
|
||||||
|
|
||||||
secrets:
|
|
||||||
db_password:
|
|
||||||
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
|
|
||||||
external: true
|
|
||||||
db_root_password:
|
|
||||||
name: ${STACK_NAME}_db_root_password_${SECRET_DB_ROOT_PASSWORD_VERSION}
|
|
||||||
external: true
|
|
||||||
smtp_password:
|
|
||||||
name: ${STACK_NAME}_smtp_password_${SECRET_SMTP_PASSWORD_VERSION}
|
|
||||||
external: true
|
|
||||||
secret_key_base:
|
|
||||||
name: ${STACK_NAME}_secret_key_base_${SECRET_SECRET_KEY_BASE_VERSION}
|
|
||||||
external: true
|
|
|
@ -1,9 +0,0 @@
|
||||||
production:
|
|
||||||
adapter: "mysql2"
|
|
||||||
encoding: "utf8mb4"
|
|
||||||
collation: "utf8mb4_unicode_520_ci"
|
|
||||||
username: "{{ env "MYSQL_USER" }}"
|
|
||||||
password: "{{ secret "db_password" }}"
|
|
||||||
database: "{{ env "MYSQL_DB" }}"
|
|
||||||
host: "{{ env "MYSQL_HOST" }}"
|
|
||||||
port: "{{ env "MYSQL_PORT" }}"
|
|
|
@ -1,44 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
file_env() {
|
|
||||||
local var="$1"
|
|
||||||
local fileVar="${var}_FILE"
|
|
||||||
local def="${2:-}"
|
|
||||||
|
|
||||||
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
|
||||||
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local val="$def"
|
|
||||||
|
|
||||||
if [ "${!var:-}" ]; then
|
|
||||||
val="${!var}"
|
|
||||||
elif [ "${!fileVar:-}" ]; then
|
|
||||||
val="$(< "${!fileVar}")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
export "$var"="$val"
|
|
||||||
unset "$fileVar"
|
|
||||||
}
|
|
||||||
|
|
||||||
file_env "SECRET_KEY_BASE"
|
|
||||||
file_env "SMTP_PASSWORD"
|
|
||||||
|
|
||||||
echo "------------------------------------------------------------------------------"
|
|
||||||
echo "Running entrypoint commands against '$FOODSOFT_SERVICE' service"
|
|
||||||
echo "------------------------------------------------------------------------------"
|
|
||||||
|
|
||||||
if [ "$FOODSOFT_SERVICE" == "app" ]; then
|
|
||||||
bundle exec rake db:setup || true
|
|
||||||
bundle exec rake db:migrate || true
|
|
||||||
./proc-start web
|
|
||||||
elif [ "$FOODSOFT_SERVICE" == "cron" ]; then
|
|
||||||
./proc-start cron
|
|
||||||
elif [ "$FOODSOFT_SERVICE" == "worker" ]; then
|
|
||||||
./proc-start worker
|
|
||||||
elif [ "$FOODSOFT_SERVICE" == "smtp" ]; then
|
|
||||||
./proc-start mail
|
|
||||||
fi
|
|
|
@ -5,11 +5,9 @@ like listing open orders, updating the ordergroup's order, and listing financial
|
||||||
transactions. Not all Foodsoft functionality is available through the API, but
|
transactions. Not all Foodsoft functionality is available through the API, but
|
||||||
we're open for new additions.
|
we're open for new additions.
|
||||||
|
|
||||||
The API is documented using [Open API 3.0.1](https://github.com/OAI/OpenAPI-Specification)
|
The API is documented using [Open API 2.0](https://github.com/OAI/OpenAPI-Specification)
|
||||||
/ [Swagger](https://swagger.io/) in [swagger.yaml](/swagger/v1/swagger.yaml).
|
/ [Swagger](https://swagger.io/) in [swagger.v1.yml](swagger.v1.yml).
|
||||||
This provides a machine-readable reference that is used to provide documentation.
|
This provides a machine-readable reference that is used to provide documentation.
|
||||||
It is generated by [rswag](https://github.com/rswag) wich also provides api-tests.
|
|
||||||
It can be generated running `RAILS_ENV=test rails rswag`.
|
|
||||||
|
|
||||||
**Note:** the current OAuth scopes may be subject to change, until the next release of Foodsoft.
|
**Note:** the current OAuth scopes may be subject to change, until the next release of Foodsoft.
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 392 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 77 KiB |
Before Width: | Height: | Size: 92 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 165 KiB |
Before Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 149 KiB |
Before Width: | Height: | Size: 101 KiB |
1106
doc/swagger.v1.yml
Normal file
|
@ -11,7 +11,6 @@ services:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile-dev
|
dockerfile: Dockerfile-dev
|
||||||
platform: linux/x86_64
|
|
||||||
command: ./proc-start worker
|
command: ./proc-start worker
|
||||||
volumes:
|
volumes:
|
||||||
- bundle:/usr/local/bundle
|
- bundle:/usr/local/bundle
|
||||||
|
|